Loading apps/s_cb.c +1 −1 Original line number Diff line number Diff line Loading @@ -1012,7 +1012,7 @@ int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, /* Initialize a random secret */ if (!cookie_initialized) { if (!RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH)) { if (RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH) <= 0) { BIO_printf(bio_err, "error setting random cookie secret\n"); return 0; } Loading apps/s_server.c +2 −1 Original line number Diff line number Diff line Loading @@ -3281,7 +3281,8 @@ static int generate_session_id(const SSL *ssl, unsigned char *id, { unsigned int count = 0; do { RAND_pseudo_bytes(id, *id_len); if(RAND_pseudo_bytes(id, *id_len) < 0) return 0; /* * Prefix the session_id with the required prefix. NB: If our prefix * is too long, clip it - but there will be worse effects anyway, eg. Loading crypto/asn1/asn_mime.c +2 −1 Original line number Diff line number Diff line Loading @@ -289,7 +289,8 @@ int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, if ((flags & SMIME_DETACHED) && data) { /* We want multipart/signed */ /* Generate a random boundary */ RAND_pseudo_bytes((unsigned char *)bound, 32); if(RAND_pseudo_bytes((unsigned char *)bound, 32) < 0) return 0; for (i = 0; i < 32; i++) { c = bound[i] & 0xf; if (c < 10) Loading crypto/bio/bf_nbio.c +4 −2 Original line number Diff line number Diff line Loading @@ -139,7 +139,8 @@ static int nbiof_read(BIO *b, char *out, int outl) BIO_clear_retry_flags(b); #if 1 RAND_pseudo_bytes(&n, 1); if(RAND_pseudo_bytes(&n, 1) < 0) return -1; num = (n & 0x07); if (outl > num) Loading Loading @@ -178,7 +179,8 @@ static int nbiof_write(BIO *b, const char *in, int inl) num = nt->lwn; nt->lwn = 0; } else { RAND_pseudo_bytes(&n, 1); if(RAND_pseudo_bytes(&n, 1) < 0) return -1; num = (n & 7); } Loading crypto/bn/bn.h +1 −0 Original line number Diff line number Diff line Loading @@ -779,6 +779,7 @@ int RAND_pseudo_bytes(unsigned char *buf, int num); * wouldn't be constructed with top!=dmax. */ \ BN_ULONG *_not_const; \ memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \ /* Debug only - safe to ignore error return */ \ RAND_pseudo_bytes(&_tmp_char, 1); \ memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \ (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \ Loading Loading
apps/s_cb.c +1 −1 Original line number Diff line number Diff line Loading @@ -1012,7 +1012,7 @@ int MS_CALLBACK generate_cookie_callback(SSL *ssl, unsigned char *cookie, /* Initialize a random secret */ if (!cookie_initialized) { if (!RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH)) { if (RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH) <= 0) { BIO_printf(bio_err, "error setting random cookie secret\n"); return 0; } Loading
apps/s_server.c +2 −1 Original line number Diff line number Diff line Loading @@ -3281,7 +3281,8 @@ static int generate_session_id(const SSL *ssl, unsigned char *id, { unsigned int count = 0; do { RAND_pseudo_bytes(id, *id_len); if(RAND_pseudo_bytes(id, *id_len) < 0) return 0; /* * Prefix the session_id with the required prefix. NB: If our prefix * is too long, clip it - but there will be worse effects anyway, eg. Loading
crypto/asn1/asn_mime.c +2 −1 Original line number Diff line number Diff line Loading @@ -289,7 +289,8 @@ int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, if ((flags & SMIME_DETACHED) && data) { /* We want multipart/signed */ /* Generate a random boundary */ RAND_pseudo_bytes((unsigned char *)bound, 32); if(RAND_pseudo_bytes((unsigned char *)bound, 32) < 0) return 0; for (i = 0; i < 32; i++) { c = bound[i] & 0xf; if (c < 10) Loading
crypto/bio/bf_nbio.c +4 −2 Original line number Diff line number Diff line Loading @@ -139,7 +139,8 @@ static int nbiof_read(BIO *b, char *out, int outl) BIO_clear_retry_flags(b); #if 1 RAND_pseudo_bytes(&n, 1); if(RAND_pseudo_bytes(&n, 1) < 0) return -1; num = (n & 0x07); if (outl > num) Loading Loading @@ -178,7 +179,8 @@ static int nbiof_write(BIO *b, const char *in, int inl) num = nt->lwn; nt->lwn = 0; } else { RAND_pseudo_bytes(&n, 1); if(RAND_pseudo_bytes(&n, 1) < 0) return -1; num = (n & 7); } Loading
crypto/bn/bn.h +1 −0 Original line number Diff line number Diff line Loading @@ -779,6 +779,7 @@ int RAND_pseudo_bytes(unsigned char *buf, int num); * wouldn't be constructed with top!=dmax. */ \ BN_ULONG *_not_const; \ memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \ /* Debug only - safe to ignore error return */ \ RAND_pseudo_bytes(&_tmp_char, 1); \ memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \ (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \ Loading