@@ -142,7 +142,7 @@ psa_status_t psa_mac_update(psa_mac_operation_t *operation,
142
142
};
143
143
144
144
if (operation -> handle <= 0 ) {
145
- return (PSA_ERROR_INVALID_ARGUMENT );
145
+ return (PSA_ERROR_BAD_STATE );
146
146
}
147
147
148
148
err = psa_call (operation -> handle , in_vec , 2 , NULL , 0 );
@@ -169,7 +169,7 @@ psa_status_t psa_mac_sign_finish(psa_mac_operation_t *operation,
169
169
psa_outvec out_vec [2 ] = { { mac , mac_size }, { mac_length , sizeof (* mac_length ) } };
170
170
171
171
if (operation -> handle <= 0 ) {
172
- return (PSA_ERROR_INVALID_ARGUMENT );
172
+ return (PSA_ERROR_BAD_STATE );
173
173
}
174
174
175
175
err_call = psa_call (operation -> handle , in_vec , 2 , out_vec , 2 );
@@ -198,7 +198,7 @@ psa_status_t psa_mac_verify_finish(psa_mac_operation_t *operation,
198
198
};
199
199
200
200
if (operation -> handle <= 0 ) {
201
- return (PSA_ERROR_INVALID_ARGUMENT );
201
+ return (PSA_ERROR_BAD_STATE );
202
202
}
203
203
204
204
err_call = psa_call (operation -> handle , in_vec , 3 , NULL , 0 );
@@ -279,7 +279,7 @@ psa_status_t psa_hash_update(psa_hash_operation_t *operation,
279
279
};
280
280
281
281
if (operation -> handle <= 0 ) {
282
- return (PSA_ERROR_INVALID_ARGUMENT );
282
+ return (PSA_ERROR_BAD_STATE );
283
283
}
284
284
285
285
err = psa_call (operation -> handle , in_vec , 2 , NULL , 0 );
@@ -308,7 +308,7 @@ psa_status_t psa_hash_finish(psa_hash_operation_t *operation,
308
308
};
309
309
310
310
if (operation -> handle <= 0 ) {
311
- return (PSA_ERROR_INVALID_ARGUMENT );
311
+ return (PSA_ERROR_BAD_STATE );
312
312
}
313
313
314
314
err_call = psa_call (operation -> handle , in_vec , 2 , out_vec , 2 );
@@ -337,7 +337,7 @@ psa_status_t psa_hash_verify(psa_hash_operation_t *operation,
337
337
};
338
338
339
339
if (operation -> handle <= 0 ) {
340
- return (PSA_ERROR_INVALID_ARGUMENT );
340
+ return (PSA_ERROR_BAD_STATE );
341
341
}
342
342
343
343
err_call = psa_call (operation -> handle , in_vec , 3 , NULL , 0 );
@@ -1213,7 +1213,7 @@ psa_status_t psa_get_generator_capacity(const psa_crypto_generator_t *generator,
1213
1213
psa_outvec out_vec = { capacity , sizeof (* capacity ) };
1214
1214
1215
1215
if (generator -> handle <= 0 ) {
1216
- return (PSA_ERROR_INVALID_ARGUMENT );
1216
+ return (PSA_ERROR_BAD_STATE );
1217
1217
}
1218
1218
1219
1219
err_call = psa_call (generator -> handle , & in_vec , 1 , & out_vec , 1 );
@@ -1235,7 +1235,7 @@ psa_status_t psa_generator_read(psa_crypto_generator_t *generator,
1235
1235
psa_outvec out_vec = { output , output_length };
1236
1236
1237
1237
if (generator -> handle <= 0 ) {
1238
- return (PSA_ERROR_INVALID_ARGUMENT );
1238
+ return (PSA_ERROR_BAD_STATE );
1239
1239
}
1240
1240
1241
1241
err_call = psa_call (generator -> handle , & in_vec , 1 , & out_vec , 1 );
@@ -1261,7 +1261,7 @@ psa_status_t psa_generator_import_key(psa_key_handle_t key_handle,
1261
1261
};
1262
1262
1263
1263
if (generator -> handle <= 0 ) {
1264
- return (PSA_ERROR_INVALID_ARGUMENT );
1264
+ return (PSA_ERROR_BAD_STATE );
1265
1265
}
1266
1266
1267
1267
err_call = psa_call (generator -> handle , in_vec , 3 , NULL , 0 );
@@ -1439,7 +1439,7 @@ psa_status_t psa_cipher_generate_iv(psa_cipher_operation_t *operation,
1439
1439
};
1440
1440
1441
1441
if (operation -> handle <= 0 ) {
1442
- return (PSA_ERROR_INVALID_ARGUMENT );
1442
+ return (PSA_ERROR_BAD_STATE );
1443
1443
}
1444
1444
1445
1445
err = psa_call (operation -> handle , & in_vec , 1 , out_vec , 2 );
@@ -1467,7 +1467,7 @@ psa_status_t psa_cipher_set_iv(psa_cipher_operation_t *operation,
1467
1467
};
1468
1468
1469
1469
if (operation -> handle <= 0 ) {
1470
- return (PSA_ERROR_INVALID_ARGUMENT );
1470
+ return (PSA_ERROR_BAD_STATE );
1471
1471
}
1472
1472
1473
1473
err = psa_call (operation -> handle , in_vec , 2 , NULL , 0 );
@@ -1507,7 +1507,7 @@ psa_status_t psa_cipher_update(psa_cipher_operation_t *operation,
1507
1507
};
1508
1508
1509
1509
if (operation -> handle <= 0 ) {
1510
- return (PSA_ERROR_INVALID_ARGUMENT );
1510
+ return (PSA_ERROR_BAD_STATE );
1511
1511
}
1512
1512
1513
1513
err = psa_call (operation -> handle , in_vec , 2 , out_vec , 2 );
@@ -1542,7 +1542,7 @@ psa_status_t psa_cipher_finish(psa_cipher_operation_t *operation,
1542
1542
};
1543
1543
1544
1544
if (operation -> handle <= 0 ) {
1545
- return (PSA_ERROR_INVALID_ARGUMENT );
1545
+ return (PSA_ERROR_BAD_STATE );
1546
1546
}
1547
1547
1548
1548
err_call = psa_call (operation -> handle , & in_vec , 1 , out_vec , 2 );
0 commit comments