RAND_bytes's return values is 0 for an error, not -1.
authorBodo Möller <bodo@openssl.org>
Sat, 15 Jan 2000 20:24:12 +0000 (20:24 +0000)
committerBodo Möller <bodo@openssl.org>
Sat, 15 Jan 2000 20:24:12 +0000 (20:24 +0000)
crypto/evp/p_seal.c

index 7966545..e372f13 100644 (file)
@@ -73,7 +73,7 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek,
        int i;
        
        if (npubk <= 0) return(0);
-       if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) == -1) return(0);
+       if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) <= 0) return(0);
        if (type->iv_len > 0)
                RAND_bytes(iv,type->iv_len);