Merge pull request #9829 from netanelgonen/re-issuing-the-fix-for-SPM-error-codes

Fix SPM error codes
pull/9842/head
Cruz Monrreal 2019-02-25 10:33:52 -06:00 committed by GitHub
commit afeab0f77d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 13 deletions

View File

@ -129,7 +129,7 @@ psa_status_t psa_mac_update(psa_mac_operation_t *operation,
};
if (operation->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
psa_outvec out_vec[2] = { { mac, mac_size }, { mac_length, sizeof(*mac_length) } };
if (operation->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
};
if (operation->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
};
if (operation->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
};
if (operation->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
};
if (operation->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
psa_outvec out_vec = { capacity, sizeof(*capacity) };
if (generator->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
psa_outvec out_vec = { output, output_length };
if (generator->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
};
if (generator->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
};
if (operation->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
};
if (operation->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
};
if (operation->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
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,
};
if (operation->handle <= 0) {
return (PSA_ERROR_INVALID_ARGUMENT);
return (PSA_ERROR_BAD_STATE);
}
err_call = psa_call(operation->handle, &in_vec, 1, out_vec, 2);