From: Dr. Stephen Henson Date: Tue, 7 Apr 2009 12:10:12 +0000 (+0000) Subject: PR: 1795 X-Git-Tag: OpenSSL_0_9_8m-beta1~248 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3fdc2c906d9cc710bde85804838b3ace3117a02c;p=openssl PR: 1795 Submitted by: Peter Edwards Approved by: steve@openssl.org Avoid race condition by sorting cipher list straight away. --- diff --git a/apps/genrsa.c b/apps/genrsa.c index fdc0d4a07d..09b0b19690 100644 --- a/apps/genrsa.c +++ b/apps/genrsa.c @@ -106,9 +106,9 @@ int MAIN(int argc, char **argv) char *inrand=NULL; BIO *out=NULL; BIGNUM *bn = BN_new(); - RSA *rsa = RSA_new(); + RSA *rsa = NULL; - if(!bn || !rsa) goto err; + if(!bn) goto err; apps_startup(); BN_GENCB_set(&cb, genrsa_cb, bio_err); diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 52f91cfe60..5aa03ee449 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -1091,6 +1091,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, *cipher_list_by_id = tmp_cipher_list; (void)sk_SSL_CIPHER_set_cmp_func(*cipher_list_by_id,ssl_cipher_ptr_id_cmp); + sk_SSL_CIPHER_sort(*cipher_list_by_id); return(cipherstack); }