add additional checks + cleanup
[openssl.git] / ssl / d1_enc.c
index 42997eaee99015cead88707fe4af3955c1c52deb..cbff7495c502a45c91f27db3d9268bb849329dba 100644 (file)
@@ -146,7 +146,10 @@ int dtls1_enc(SSL *s, int send)
                                fprintf(stderr, "%s:%d: rec->data != rec->input\n",
                                        __FILE__, __LINE__);
                        else if ( EVP_CIPHER_block_size(ds->cipher) > 1)
-                               RAND_bytes(rec->input, EVP_CIPHER_block_size(ds->cipher));
+                               {
+                               if (!RAND_bytes(rec->input, EVP_CIPHER_block_size(ds->cipher)))
+                                       return -1;
+                               }
                        }
                }
        else