@@ -140,7 +140,7 @@ psa_status_t psa_mac_update(psa_mac_operation_t *operation,
140
140
};
141
141
142
142
if (operation -> handle <= 0 ) {
143
- return (PSA_ERROR_INVALID_ARGUMENT );
143
+ return (PSA_ERROR_BAD_STATE );
144
144
}
145
145
146
146
err = psa_call (operation -> handle , in_vec , 2 , NULL , 0 );
@@ -167,7 +167,7 @@ psa_status_t psa_mac_sign_finish(psa_mac_operation_t *operation,
167
167
psa_outvec out_vec [2 ] = { { mac , mac_size }, { mac_length , sizeof (* mac_length ) } };
168
168
169
169
if (operation -> handle <= 0 ) {
170
- return (PSA_ERROR_INVALID_ARGUMENT );
170
+ return (PSA_ERROR_BAD_STATE );
171
171
}
172
172
173
173
err_call = psa_call (operation -> handle , in_vec , 2 , out_vec , 2 );
@@ -196,7 +196,7 @@ psa_status_t psa_mac_verify_finish(psa_mac_operation_t *operation,
196
196
};
197
197
198
198
if (operation -> handle <= 0 ) {
199
- return (PSA_ERROR_INVALID_ARGUMENT );
199
+ return (PSA_ERROR_BAD_STATE );
200
200
}
201
201
202
202
err_call = psa_call (operation -> handle , in_vec , 3 , NULL , 0 );
@@ -277,7 +277,7 @@ psa_status_t psa_hash_update(psa_hash_operation_t *operation,
277
277
};
278
278
279
279
if (operation -> handle <= 0 ) {
280
- return (PSA_ERROR_INVALID_ARGUMENT );
280
+ return (PSA_ERROR_BAD_STATE );
281
281
}
282
282
283
283
err = psa_call (operation -> handle , in_vec , 2 , NULL , 0 );
@@ -306,7 +306,7 @@ psa_status_t psa_hash_finish(psa_hash_operation_t *operation,
306
306
};
307
307
308
308
if (operation -> handle <= 0 ) {
309
- return (PSA_ERROR_INVALID_ARGUMENT );
309
+ return (PSA_ERROR_BAD_STATE );
310
310
}
311
311
312
312
err_call = psa_call (operation -> handle , in_vec , 2 , out_vec , 2 );
@@ -335,7 +335,7 @@ psa_status_t psa_hash_verify(psa_hash_operation_t *operation,
335
335
};
336
336
337
337
if (operation -> handle <= 0 ) {
338
- return (PSA_ERROR_INVALID_ARGUMENT );
338
+ return (PSA_ERROR_BAD_STATE );
339
339
}
340
340
341
341
err_call = psa_call (operation -> handle , in_vec , 3 , NULL , 0 );
@@ -1206,7 +1206,7 @@ psa_status_t psa_get_generator_capacity(const psa_crypto_generator_t *generator,
1206
1206
psa_outvec out_vec = { capacity , sizeof (* capacity ) };
1207
1207
1208
1208
if (generator -> handle <= 0 ) {
1209
- return (PSA_ERROR_INVALID_ARGUMENT );
1209
+ return (PSA_ERROR_BAD_STATE );
1210
1210
}
1211
1211
1212
1212
err_call = psa_call (generator -> handle , & in_vec , 1 , & out_vec , 1 );
@@ -1228,7 +1228,7 @@ psa_status_t psa_generator_read(psa_crypto_generator_t *generator,
1228
1228
psa_outvec out_vec = { output , output_length };
1229
1229
1230
1230
if (generator -> handle <= 0 ) {
1231
- return (PSA_ERROR_INVALID_ARGUMENT );
1231
+ return (PSA_ERROR_BAD_STATE );
1232
1232
}
1233
1233
1234
1234
err_call = psa_call (generator -> handle , & in_vec , 1 , & out_vec , 1 );
@@ -1254,7 +1254,7 @@ psa_status_t psa_generator_import_key(psa_key_handle_t key_handle,
1254
1254
};
1255
1255
1256
1256
if (generator -> handle <= 0 ) {
1257
- return (PSA_ERROR_INVALID_ARGUMENT );
1257
+ return (PSA_ERROR_BAD_STATE );
1258
1258
}
1259
1259
1260
1260
err_call = psa_call (generator -> handle , in_vec , 3 , NULL , 0 );
@@ -1432,7 +1432,7 @@ psa_status_t psa_cipher_generate_iv(psa_cipher_operation_t *operation,
1432
1432
};
1433
1433
1434
1434
if (operation -> handle <= 0 ) {
1435
- return (PSA_ERROR_INVALID_ARGUMENT );
1435
+ return (PSA_ERROR_BAD_STATE );
1436
1436
}
1437
1437
1438
1438
err = psa_call (operation -> handle , & in_vec , 1 , out_vec , 2 );
@@ -1460,7 +1460,7 @@ psa_status_t psa_cipher_set_iv(psa_cipher_operation_t *operation,
1460
1460
};
1461
1461
1462
1462
if (operation -> handle <= 0 ) {
1463
- return (PSA_ERROR_INVALID_ARGUMENT );
1463
+ return (PSA_ERROR_BAD_STATE );
1464
1464
}
1465
1465
1466
1466
err = psa_call (operation -> handle , in_vec , 2 , NULL , 0 );
@@ -1500,7 +1500,7 @@ psa_status_t psa_cipher_update(psa_cipher_operation_t *operation,
1500
1500
};
1501
1501
1502
1502
if (operation -> handle <= 0 ) {
1503
- return (PSA_ERROR_INVALID_ARGUMENT );
1503
+ return (PSA_ERROR_BAD_STATE );
1504
1504
}
1505
1505
1506
1506
err = psa_call (operation -> handle , in_vec , 2 , out_vec , 2 );
@@ -1535,7 +1535,7 @@ psa_status_t psa_cipher_finish(psa_cipher_operation_t *operation,
1535
1535
};
1536
1536
1537
1537
if (operation -> handle <= 0 ) {
1538
- return (PSA_ERROR_INVALID_ARGUMENT );
1538
+ return (PSA_ERROR_BAD_STATE );
1539
1539
}
1540
1540
1541
1541
err_call = psa_call (operation -> handle , & in_vec , 1 , out_vec , 2 );
0 commit comments