Skip to content

Fix SPM returning the wrong value #9754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,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);
Expand All @@ -169,7 +169,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);
Expand Down Expand Up @@ -198,7 +198,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);
Expand Down Expand Up @@ -279,7 +279,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);
Expand Down Expand Up @@ -308,7 +308,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);
Expand Down Expand Up @@ -337,7 +337,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);
Expand Down Expand Up @@ -1213,7 +1213,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);
Expand All @@ -1235,7 +1235,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);
Expand All @@ -1261,7 +1261,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);
Expand Down Expand Up @@ -1439,7 +1439,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);
Expand Down Expand Up @@ -1467,7 +1467,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);
Expand Down Expand Up @@ -1507,7 +1507,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);
Expand Down Expand Up @@ -1542,7 +1542,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);
Expand Down