Clean up typos, warnings, and incorrect libtool age.

This commit is contained in:
Trevor Bentley
2017-11-08 11:11:45 +01:00
parent c7549ac9cc
commit 3ce4f0ccae
5 changed files with 21 additions and 15 deletions
+11 -5
View File
@@ -1058,7 +1058,7 @@ Cleanup:
return res;
}
ykpiv_rc ykpiv_get_pin_retries(ykpiv_state *state, int* tries) {
ykpiv_rc ykpiv_get_pin_retries(ykpiv_state *state, int *tries) {
ykpiv_rc res;
ykpiv_rc ykrc;
if (NULL == state || NULL == tries) {
@@ -1329,10 +1329,6 @@ ykpiv_rc ykpiv_import_private_key(ykpiv_state *state, const unsigned char key, u
if (state == NULL)
return YKPIV_GENERIC_ERROR;
if (p_len + q_len + dp_len + dq_len + qinv_len + ec_data_len >= sizeof(key_data)) {
return YKPIV_SIZE_ERROR;
}
if (key == YKPIV_KEY_CARDMGM ||
key < YKPIV_KEY_RETIRED1 ||
(key > YKPIV_KEY_RETIRED20 && key < YKPIV_KEY_AUTHENTICATION) ||
@@ -1354,6 +1350,10 @@ ykpiv_rc ykpiv_import_private_key(ykpiv_state *state, const unsigned char key, u
if (algorithm == YKPIV_ALGO_RSA1024 || algorithm == YKPIV_ALGO_RSA2048) {
if (p_len + q_len + dp_len + dq_len + qinv_len >= sizeof(key_data)) {
return YKPIV_SIZE_ERROR;
}
if (algorithm == YKPIV_ALGO_RSA1024)
elem_len = 64;
if (algorithm == YKPIV_ALGO_RSA2048)
@@ -1378,6 +1378,12 @@ ykpiv_rc ykpiv_import_private_key(ykpiv_state *state, const unsigned char key, u
n_params = 5;
}
else if (algorithm == YKPIV_ALGO_ECCP256 || algorithm == YKPIV_ALGO_ECCP384) {
if ((size_t)ec_data_len >= sizeof(key_data)) {
// This can never be true, but check to be explicit.
return YKPIV_SIZE_ERROR;
}
if (algorithm == YKPIV_ALGO_ECCP256)
elem_len = 32;
if (algorithm == YKPIV_ALGO_ECCP384)