Copy-n-paste bug (don't mix variable declarations and code). This sets the
authorGeoff Thorpe <geoff@openssl.org>
Wed, 29 Oct 2003 22:30:45 +0000 (22:30 +0000)
committerGeoff Thorpe <geoff@openssl.org>
Wed, 29 Oct 2003 22:30:45 +0000 (22:30 +0000)
callback structure just before it is needed.

apps/req.c

index 29076266fbc36fc38b2edb125a1ce59f5e54cdb6..bbef942860e3329ddf0f2a7b74d27cbc0c06f422 100644 (file)
@@ -713,7 +713,6 @@ bad:
        if (newreq && (pkey == NULL))
                {
                BN_GENCB cb;
        if (newreq && (pkey == NULL))
                {
                BN_GENCB cb;
-               BN_GENCB_set(&cb, req_cb, bio_err);
                char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE");
                if (randfile == NULL)
                        ERR_clear_error();
                char *randfile = NCONF_get_string(req_conf,SECTION,"RANDFILE");
                if (randfile == NULL)
                        ERR_clear_error();
@@ -740,6 +739,7 @@ bad:
                if ((pkey=EVP_PKEY_new()) == NULL) goto end;
 
 #ifndef OPENSSL_NO_RSA
                if ((pkey=EVP_PKEY_new()) == NULL) goto end;
 
 #ifndef OPENSSL_NO_RSA
+               BN_GENCB_set(&cb, req_cb, bio_err);
                if (pkey_type == TYPE_RSA)
                        {
                        RSA *rsa = RSA_new();
                if (pkey_type == TYPE_RSA)
                        {
                        RSA *rsa = RSA_new();