Fix a couple more signed/unsigned compares.

Different compilers find different problems.

Change-Id: I732611005ae1cbfcb4bc70c3f98af2c18b0a04da
This commit is contained in:
Adam Langley 2015-10-27 16:07:26 -07:00
parent 96c2a28171
commit 13f1dd497f
2 changed files with 9 additions and 10 deletions

View File

@ -356,7 +356,7 @@ static int PKCS5_v2_PBKDF2_keyivgen(EVP_CIPHER_CTX *ctx,
goto err;
}
long iterations = ASN1_INTEGER_get(pbkdf2param->iter);
if (iterations <= 0 || iterations > UINT_MAX) {
if (iterations <= 0 || iterations > (long) UINT_MAX) {
OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_ITERATION_COUNT);
goto err;
}

View File

@ -234,9 +234,8 @@ void RC4(RC4_KEY *key, size_t len, const uint8_t *in, uint8_t *out) {
void RC4_set_key(RC4_KEY *rc4key, unsigned len, const uint8_t *key) {
uint32_t tmp;
int id1, id2;
unsigned i, id1, id2;
uint32_t *d;
unsigned int i;
d = &rc4key->data[0];
rc4key->x = 0;