Fix a couple more signed/unsigned compares.
Different compilers find different problems.
Change-Id: I732611005ae1cbfcb4bc70c3f98af2c18b0a04da
diff --git a/crypto/pkcs8/p5_pbev2.c b/crypto/pkcs8/p5_pbev2.c
index b00837e..5ccee40 100644
--- a/crypto/pkcs8/p5_pbev2.c
+++ b/crypto/pkcs8/p5_pbev2.c
@@ -356,7 +356,7 @@
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;
}
diff --git a/crypto/rc4/rc4.c b/crypto/rc4/rc4.c
index aa19dc2..b8e1d9f 100644
--- a/crypto/rc4/rc4.c
+++ b/crypto/rc4/rc4.c
@@ -234,23 +234,22 @@
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;
rc4key->y = 0;
id1 = id2 = 0;
-#define SK_LOOP(d, n) \
- { \
- tmp = d[(n)]; \
+#define SK_LOOP(d, n) \
+ { \
+ tmp = d[(n)]; \
id2 = (key[id1] + tmp + id2) & 0xff; \
- if (++id1 == len) \
- id1 = 0; \
- d[(n)] = d[id2]; \
- d[id2] = tmp; \
+ if (++id1 == len) \
+ id1 = 0; \
+ d[(n)] = d[id2]; \
+ d[id2] = tmp; \
}
for (i = 0; i < 256; i++) {