fix dsa_int_validate_key related compiler warnings

This commit is contained in:
Karel Miko 2017-09-12 07:03:21 +02:00
parent 1625ce4001
commit aa5b9dafc4
3 changed files with 5 additions and 4 deletions

View File

@ -480,7 +480,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key);
int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key); int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key);
int dsa_verify_key(dsa_key *key, int *stat); int dsa_verify_key(dsa_key *key, int *stat);
#ifdef LTC_SOURCE #ifdef LTC_SOURCE
int dsa_int_validate_key(dsa_key *key, int *stat, int mode); int dsa_int_validate_key(dsa_key *key, int *stat);
#endif #endif
int dsa_shared_secret(void *private_key, void *base, int dsa_shared_secret(void *private_key, void *base,
dsa_key *public_key, dsa_key *public_key,

View File

@ -90,7 +90,8 @@ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key
if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; } if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; }
} }
if ((err = dsa_int_validate_key(key, &stat, 0)) != CRYPT_OK) { goto LBL_ERR; } /* do only a quick validation, without primality testing */
if ((err = dsa_int_validate_key(key, &stat)) != CRYPT_OK) { goto LBL_ERR; }
if (stat == 0) { if (stat == 0) {
err = CRYPT_INVALID_ARG; err = CRYPT_INVALID_ARG;
goto LBL_ERR; goto LBL_ERR;

View File

@ -51,7 +51,7 @@ int dsa_verify_key(dsa_key *key, int *stat)
return CRYPT_OK; return CRYPT_OK;
} }
return dsa_int_validate_key(key, stat); /* 1 = full check */ return dsa_int_validate_key(key, stat);
} }
/** /**
@ -67,7 +67,7 @@ int dsa_verify_key(dsa_key *key, int *stat)
int dsa_int_validate_key(dsa_key *key, int *stat) int dsa_int_validate_key(dsa_key *key, int *stat)
{ {
void *tmp, *tmp2; void *tmp, *tmp2;
int res, err; int err;
LTC_ARGCHK(key != NULL); LTC_ARGCHK(key != NULL);
LTC_ARGCHK(stat != NULL); LTC_ARGCHK(stat != NULL);