The handling of DSA_METHOD and DH_METHOD wasn't quite as problematic as
authorGeoff Thorpe <geoff@openssl.org>
Thu, 20 Apr 2000 07:58:11 +0000 (07:58 +0000)
committerGeoff Thorpe <geoff@openssl.org>
Thu, 20 Apr 2000 07:58:11 +0000 (07:58 +0000)
with RSA_METHOD (the **_get_default_methods do set the default value if
it's not set). However, the code had some duplication and was a bit
conter-intuitive.

crypto/dh/dh_lib.c
crypto/dsa/dsa_lib.c

index 6c21463028a7f1d9301e02022858c0da1c2f092b..be00ceee2ff294ef39922d4c37b6671db491ca55 100644 (file)
@@ -103,9 +103,8 @@ DH *DH_new_method(DH_METHOD *meth)
                DHerr(DH_F_DH_NEW,ERR_R_MALLOC_FAILURE);
                return(NULL);
                }
-       if(!default_DH_method) default_DH_method = DH_OpenSSL();
        if(meth) ret->meth = meth;
-       else ret->meth = default_DH_method;
+       else ret->meth = DH_get_default_method();
        ret->pad=0;
        ret->version=0;
        ret->p=NULL;
index 224e412afc42c3f17e273c899044003e0f8ff1d8..9c106b2b165fd850b6f76de5833c9f08d9deae7d 100644 (file)
@@ -107,9 +107,8 @@ DSA *DSA_new_method(DSA_METHOD *meth)
                DSAerr(DSA_F_DSA_NEW,ERR_R_MALLOC_FAILURE);
                return(NULL);
                }
-       if(!default_DSA_method) default_DSA_method = DSA_OpenSSL();
        if(meth) ret->meth = meth;
-       else ret->meth = default_DSA_method;
+       else ret->meth = DSA_get_default_method();
        ret->pad=0;
        ret->version=0;
        ret->write_params=1;