@@ -129,7 +129,7 @@ psa_status_t psa_mac_update(psa_mac_operation_t *operation,
129
129
};
130
130
131
131
if (operation -> handle <= 0 ) {
132
- return (PSA_ERROR_INVALID_ARGUMENT );
132
+ return (PSA_ERROR_BAD_STATE );
133
133
}
134
134
135
135
err = psa_call (operation -> handle , in_vec , 2 , NULL , 0 );
@@ -153,7 +153,7 @@ psa_status_t psa_mac_sign_finish(psa_mac_operation_t *operation,
153
153
psa_outvec out_vec [2 ] = { { mac , mac_size }, { mac_length , sizeof (* mac_length ) } };
154
154
155
155
if (operation -> handle <= 0 ) {
156
- return (PSA_ERROR_INVALID_ARGUMENT );
156
+ return (PSA_ERROR_BAD_STATE );
157
157
}
158
158
159
159
err_call = psa_call (operation -> handle , in_vec , 2 , out_vec , 2 );
@@ -178,7 +178,7 @@ psa_status_t psa_mac_verify_finish(psa_mac_operation_t *operation,
178
178
};
179
179
180
180
if (operation -> handle <= 0 ) {
181
- return (PSA_ERROR_INVALID_ARGUMENT );
181
+ return (PSA_ERROR_BAD_STATE );
182
182
}
183
183
184
184
err_call = psa_call (operation -> handle , in_vec , 3 , NULL , 0 );
@@ -248,7 +248,7 @@ psa_status_t psa_hash_update(psa_hash_operation_t *operation,
248
248
};
249
249
250
250
if (operation -> handle <= 0 ) {
251
- return (PSA_ERROR_INVALID_ARGUMENT );
251
+ return (PSA_ERROR_BAD_STATE );
252
252
}
253
253
254
254
err = psa_call (operation -> handle , in_vec , 2 , NULL , 0 );
@@ -274,7 +274,7 @@ psa_status_t psa_hash_finish(psa_hash_operation_t *operation,
274
274
};
275
275
276
276
if (operation -> handle <= 0 ) {
277
- return (PSA_ERROR_INVALID_ARGUMENT );
277
+ return (PSA_ERROR_BAD_STATE );
278
278
}
279
279
280
280
err_call = psa_call (operation -> handle , in_vec , 2 , out_vec , 2 );
@@ -299,7 +299,7 @@ psa_status_t psa_hash_verify(psa_hash_operation_t *operation,
299
299
};
300
300
301
301
if (operation -> handle <= 0 ) {
302
- return (PSA_ERROR_INVALID_ARGUMENT );
302
+ return (PSA_ERROR_BAD_STATE );
303
303
}
304
304
305
305
err_call = psa_call (operation -> handle , in_vec , 3 , NULL , 0 );
@@ -1103,7 +1103,7 @@ psa_status_t psa_get_generator_capacity(const psa_crypto_generator_t *generator,
1103
1103
psa_outvec out_vec = { capacity , sizeof (* capacity ) };
1104
1104
1105
1105
if (generator -> handle <= 0 ) {
1106
- return (PSA_ERROR_INVALID_ARGUMENT );
1106
+ return (PSA_ERROR_BAD_STATE );
1107
1107
}
1108
1108
1109
1109
err_call = psa_call (generator -> handle , & in_vec , 1 , & out_vec , 1 );
@@ -1122,7 +1122,7 @@ psa_status_t psa_generator_read(psa_crypto_generator_t *generator,
1122
1122
psa_outvec out_vec = { output , output_length };
1123
1123
1124
1124
if (generator -> handle <= 0 ) {
1125
- return (PSA_ERROR_INVALID_ARGUMENT );
1125
+ return (PSA_ERROR_BAD_STATE );
1126
1126
}
1127
1127
1128
1128
err_call = psa_call (generator -> handle , & in_vec , 1 , & out_vec , 1 );
@@ -1145,7 +1145,7 @@ psa_status_t psa_generator_import_key(psa_key_handle_t key_handle,
1145
1145
};
1146
1146
1147
1147
if (generator -> handle <= 0 ) {
1148
- return (PSA_ERROR_INVALID_ARGUMENT );
1148
+ return (PSA_ERROR_BAD_STATE );
1149
1149
}
1150
1150
1151
1151
err_call = psa_call (generator -> handle , in_vec , 3 , NULL , 0 );
@@ -1306,7 +1306,7 @@ psa_status_t psa_cipher_generate_iv(psa_cipher_operation_t *operation,
1306
1306
};
1307
1307
1308
1308
if (operation -> handle <= 0 ) {
1309
- return (PSA_ERROR_INVALID_ARGUMENT );
1309
+ return (PSA_ERROR_BAD_STATE );
1310
1310
}
1311
1311
1312
1312
err = psa_call (operation -> handle , & in_vec , 1 , out_vec , 2 );
@@ -1332,7 +1332,7 @@ psa_status_t psa_cipher_set_iv(psa_cipher_operation_t *operation,
1332
1332
};
1333
1333
1334
1334
if (operation -> handle <= 0 ) {
1335
- return (PSA_ERROR_INVALID_ARGUMENT );
1335
+ return (PSA_ERROR_BAD_STATE );
1336
1336
}
1337
1337
1338
1338
err = psa_call (operation -> handle , in_vec , 2 , NULL , 0 );
@@ -1370,7 +1370,7 @@ psa_status_t psa_cipher_update(psa_cipher_operation_t *operation,
1370
1370
};
1371
1371
1372
1372
if (operation -> handle <= 0 ) {
1373
- return (PSA_ERROR_INVALID_ARGUMENT );
1373
+ return (PSA_ERROR_BAD_STATE );
1374
1374
}
1375
1375
1376
1376
err = psa_call (operation -> handle , in_vec , 2 , out_vec , 2 );
@@ -1403,7 +1403,7 @@ psa_status_t psa_cipher_finish(psa_cipher_operation_t *operation,
1403
1403
};
1404
1404
1405
1405
if (operation -> handle <= 0 ) {
1406
- return (PSA_ERROR_INVALID_ARGUMENT );
1406
+ return (PSA_ERROR_BAD_STATE );
1407
1407
}
1408
1408
1409
1409
err_call = psa_call (operation -> handle , & in_vec , 1 , out_vec , 2 );
0 commit comments