Loading CHANGES +3 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,9 @@ Changes between 0.9.7c and 0.9.8 [xx XXX xxxx] *) Ensure that deprecated functions do not get compiled when OPENSSL_NO_DEPRECATED is defined. OPENSSL_NO_DEPRECATED is defined. Some "openssl" subcommands and a few of the self-tests were still using deprecated key-generation functions so these have been updated also. [Geoff Thorpe] *) Reorganise PKCS#7 code to separate the digest location functionality Loading apps/dhparam.c +14 −10 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ * -C */ static void MS_CALLBACK dh_cb(int p, int n, void *arg); static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb); int MAIN(int, char **); Loading Loading @@ -294,6 +294,8 @@ bad: if(num) { BN_GENCB cb; BN_GENCB_set(&cb, dh_cb, bio_err); if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) { BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); Loading @@ -305,12 +307,13 @@ bad: #ifndef OPENSSL_NO_DSA if (dsaparam) { DSA *dsa; DSA *dsa = DSA_new(); BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num); dsa = DSA_generate_parameters(num, NULL, 0, NULL, NULL, dh_cb, bio_err); if (dsa == NULL) if(!dsa || !DSA_generate_parameters_ex(dsa, num, NULL, 0, NULL, NULL, &cb)) { if(dsa) DSA_free(dsa); ERR_print_errors(bio_err); goto end; } Loading @@ -326,12 +329,12 @@ bad: else #endif { dh = DH_new(); BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g); BIO_printf(bio_err,"This is going to take a long time\n"); dh=DH_generate_parameters(num,g,dh_cb,bio_err); if (dh == NULL) if(!dh || !DH_generate_parameters_ex(dh, num, g, &cb)) { if(dh) DH_free(dh); ERR_print_errors(bio_err); goto end; } Loading Loading @@ -534,7 +537,7 @@ end: } /* dh_cb is identical to dsa_cb in apps/dsaparam.c */ static void MS_CALLBACK dh_cb(int p, int n, void *arg) static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb) { char c='*'; Loading @@ -542,11 +545,12 @@ static void MS_CALLBACK dh_cb(int p, int n, void *arg) if (p == 1) c='+'; if (p == 2) c='*'; if (p == 3) c='\n'; BIO_write((BIO *)arg,&c,1); (void)BIO_flush((BIO *)arg); BIO_write(cb->arg,&c,1); (void)BIO_flush(cb->arg); #ifdef LINT p=n; #endif return 1; } #endif apps/gendh.c +10 −7 Original line number Diff line number Diff line Loading @@ -81,12 +81,13 @@ #undef PROG #define PROG gendh_main static void MS_CALLBACK dh_cb(int p, int n, void *arg); static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb); int MAIN(int, char **); int MAIN(int argc, char **argv) { BN_GENCB cb; #ifndef OPENSSL_NO_ENGINE ENGINE *e = NULL; #endif Loading @@ -102,6 +103,7 @@ int MAIN(int argc, char **argv) apps_startup(); BN_GENCB_set(&cb, dh_cb, bio_err); if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); Loading Loading @@ -199,9 +201,9 @@ bad: BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g); BIO_printf(bio_err,"This is going to take a long time\n"); dh=DH_generate_parameters(num,g,dh_cb,bio_err); if (dh == NULL) goto end; if(((dh = DH_new()) == NULL) || !DH_generate_parameters_ex(dh, num, g, &cb)) goto end; app_RAND_write_file(NULL, bio_err); Loading @@ -217,7 +219,7 @@ end: OPENSSL_EXIT(ret); } static void MS_CALLBACK dh_cb(int p, int n, void *arg) static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb) { char c='*'; Loading @@ -225,10 +227,11 @@ static void MS_CALLBACK dh_cb(int p, int n, void *arg) if (p == 1) c='+'; if (p == 2) c='*'; if (p == 3) c='\n'; BIO_write((BIO *)arg,&c,1); (void)BIO_flush((BIO *)arg); BIO_write(cb->arg,&c,1); (void)BIO_flush(cb->arg); #ifdef LINT p=n; #endif return 1; } #endif apps/genrsa.c +10 −5 Original line number Diff line number Diff line Loading @@ -81,12 +81,13 @@ #undef PROG #define PROG genrsa_main static void MS_CALLBACK genrsa_cb(int p, int n, void *arg); static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb); int MAIN(int, char **); int MAIN(int argc, char **argv) { BN_GENCB cb; #ifndef OPENSSL_NO_ENGINE ENGINE *e = NULL; #endif Loading @@ -105,6 +106,7 @@ int MAIN(int argc, char **argv) BIO *out=NULL; apps_startup(); BN_GENCB_set(&cb, genrsa_cb, bio_err); if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) Loading Loading @@ -239,7 +241,9 @@ bad: BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n", num); rsa=RSA_generate_key(num,f4,genrsa_cb,bio_err); if(((rsa = RSA_new()) == NULL) || !RSA_generate_key_ex(rsa, num, f4, &cb)) goto err; app_RAND_write_file(NULL, bio_err); Loading Loading @@ -277,7 +281,7 @@ err: OPENSSL_EXIT(ret); } static void MS_CALLBACK genrsa_cb(int p, int n, void *arg) static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb) { char c='*'; Loading @@ -285,11 +289,12 @@ static void MS_CALLBACK genrsa_cb(int p, int n, void *arg) if (p == 1) c='+'; if (p == 2) c='*'; if (p == 3) c='\n'; BIO_write((BIO *)arg,&c,1); (void)BIO_flush((BIO *)arg); BIO_write(cb->arg,&c,1); (void)BIO_flush(cb->arg); #ifdef LINT p=n; #endif return 1; } #else /* !OPENSSL_NO_RSA */ Loading apps/req.c +13 −7 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ static int add_attribute_object(X509_REQ *req, char *text, static int add_DN_object(X509_NAME *n, char *text, char *def, char *value, int nid,int n_min,int n_max, unsigned long chtype, int mval); #ifndef OPENSSL_NO_RSA static void MS_CALLBACK req_cb(int p,int n,void *arg); static int MS_CALLBACK req_cb(int p, int n, BN_GENCB *cb); #endif static int req_check_len(int len,int n_min,int n_max); static int check_end(char *str, char *end); Loading Loading @@ -712,6 +712,8 @@ bad: 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(); Loading Loading @@ -740,11 +742,14 @@ bad: #ifndef OPENSSL_NO_RSA if (pkey_type == TYPE_RSA) { if (!EVP_PKEY_assign_RSA(pkey, RSA_generate_key(newkey,0x10001, req_cb,bio_err))) RSA *rsa = RSA_new(); if(!rsa || !RSA_generate_key_ex(rsa, newkey, 0x10001, &cb) || !EVP_PKEY_assign_RSA(pkey, rsa)) { if(rsa) RSA_free(rsa); goto end; } } else #endif #ifndef OPENSSL_NO_DSA Loading Loading @@ -1610,7 +1615,7 @@ err: } #ifndef OPENSSL_NO_RSA static void MS_CALLBACK req_cb(int p, int n, void *arg) static int MS_CALLBACK req_cb(int p, int n, BN_GENCB *cb) { char c='*'; Loading @@ -1618,11 +1623,12 @@ static void MS_CALLBACK req_cb(int p, int n, void *arg) if (p == 1) c='+'; if (p == 2) c='*'; if (p == 3) c='\n'; BIO_write((BIO *)arg,&c,1); (void)BIO_flush((BIO *)arg); BIO_write(cb->arg,&c,1); (void)BIO_flush(cb->arg); #ifdef LINT p=n; #endif return 1; } #endif Loading Loading
CHANGES +3 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,9 @@ Changes between 0.9.7c and 0.9.8 [xx XXX xxxx] *) Ensure that deprecated functions do not get compiled when OPENSSL_NO_DEPRECATED is defined. OPENSSL_NO_DEPRECATED is defined. Some "openssl" subcommands and a few of the self-tests were still using deprecated key-generation functions so these have been updated also. [Geoff Thorpe] *) Reorganise PKCS#7 code to separate the digest location functionality Loading
apps/dhparam.c +14 −10 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ * -C */ static void MS_CALLBACK dh_cb(int p, int n, void *arg); static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb); int MAIN(int, char **); Loading Loading @@ -294,6 +294,8 @@ bad: if(num) { BN_GENCB cb; BN_GENCB_set(&cb, dh_cb, bio_err); if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) { BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); Loading @@ -305,12 +307,13 @@ bad: #ifndef OPENSSL_NO_DSA if (dsaparam) { DSA *dsa; DSA *dsa = DSA_new(); BIO_printf(bio_err,"Generating DSA parameters, %d bit long prime\n",num); dsa = DSA_generate_parameters(num, NULL, 0, NULL, NULL, dh_cb, bio_err); if (dsa == NULL) if(!dsa || !DSA_generate_parameters_ex(dsa, num, NULL, 0, NULL, NULL, &cb)) { if(dsa) DSA_free(dsa); ERR_print_errors(bio_err); goto end; } Loading @@ -326,12 +329,12 @@ bad: else #endif { dh = DH_new(); BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g); BIO_printf(bio_err,"This is going to take a long time\n"); dh=DH_generate_parameters(num,g,dh_cb,bio_err); if (dh == NULL) if(!dh || !DH_generate_parameters_ex(dh, num, g, &cb)) { if(dh) DH_free(dh); ERR_print_errors(bio_err); goto end; } Loading Loading @@ -534,7 +537,7 @@ end: } /* dh_cb is identical to dsa_cb in apps/dsaparam.c */ static void MS_CALLBACK dh_cb(int p, int n, void *arg) static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb) { char c='*'; Loading @@ -542,11 +545,12 @@ static void MS_CALLBACK dh_cb(int p, int n, void *arg) if (p == 1) c='+'; if (p == 2) c='*'; if (p == 3) c='\n'; BIO_write((BIO *)arg,&c,1); (void)BIO_flush((BIO *)arg); BIO_write(cb->arg,&c,1); (void)BIO_flush(cb->arg); #ifdef LINT p=n; #endif return 1; } #endif
apps/gendh.c +10 −7 Original line number Diff line number Diff line Loading @@ -81,12 +81,13 @@ #undef PROG #define PROG gendh_main static void MS_CALLBACK dh_cb(int p, int n, void *arg); static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb); int MAIN(int, char **); int MAIN(int argc, char **argv) { BN_GENCB cb; #ifndef OPENSSL_NO_ENGINE ENGINE *e = NULL; #endif Loading @@ -102,6 +103,7 @@ int MAIN(int argc, char **argv) apps_startup(); BN_GENCB_set(&cb, dh_cb, bio_err); if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); Loading Loading @@ -199,9 +201,9 @@ bad: BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g); BIO_printf(bio_err,"This is going to take a long time\n"); dh=DH_generate_parameters(num,g,dh_cb,bio_err); if (dh == NULL) goto end; if(((dh = DH_new()) == NULL) || !DH_generate_parameters_ex(dh, num, g, &cb)) goto end; app_RAND_write_file(NULL, bio_err); Loading @@ -217,7 +219,7 @@ end: OPENSSL_EXIT(ret); } static void MS_CALLBACK dh_cb(int p, int n, void *arg) static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb) { char c='*'; Loading @@ -225,10 +227,11 @@ static void MS_CALLBACK dh_cb(int p, int n, void *arg) if (p == 1) c='+'; if (p == 2) c='*'; if (p == 3) c='\n'; BIO_write((BIO *)arg,&c,1); (void)BIO_flush((BIO *)arg); BIO_write(cb->arg,&c,1); (void)BIO_flush(cb->arg); #ifdef LINT p=n; #endif return 1; } #endif
apps/genrsa.c +10 −5 Original line number Diff line number Diff line Loading @@ -81,12 +81,13 @@ #undef PROG #define PROG genrsa_main static void MS_CALLBACK genrsa_cb(int p, int n, void *arg); static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb); int MAIN(int, char **); int MAIN(int argc, char **argv) { BN_GENCB cb; #ifndef OPENSSL_NO_ENGINE ENGINE *e = NULL; #endif Loading @@ -105,6 +106,7 @@ int MAIN(int argc, char **argv) BIO *out=NULL; apps_startup(); BN_GENCB_set(&cb, genrsa_cb, bio_err); if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) Loading Loading @@ -239,7 +241,9 @@ bad: BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n", num); rsa=RSA_generate_key(num,f4,genrsa_cb,bio_err); if(((rsa = RSA_new()) == NULL) || !RSA_generate_key_ex(rsa, num, f4, &cb)) goto err; app_RAND_write_file(NULL, bio_err); Loading Loading @@ -277,7 +281,7 @@ err: OPENSSL_EXIT(ret); } static void MS_CALLBACK genrsa_cb(int p, int n, void *arg) static int MS_CALLBACK genrsa_cb(int p, int n, BN_GENCB *cb) { char c='*'; Loading @@ -285,11 +289,12 @@ static void MS_CALLBACK genrsa_cb(int p, int n, void *arg) if (p == 1) c='+'; if (p == 2) c='*'; if (p == 3) c='\n'; BIO_write((BIO *)arg,&c,1); (void)BIO_flush((BIO *)arg); BIO_write(cb->arg,&c,1); (void)BIO_flush(cb->arg); #ifdef LINT p=n; #endif return 1; } #else /* !OPENSSL_NO_RSA */ Loading
apps/req.c +13 −7 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ static int add_attribute_object(X509_REQ *req, char *text, static int add_DN_object(X509_NAME *n, char *text, char *def, char *value, int nid,int n_min,int n_max, unsigned long chtype, int mval); #ifndef OPENSSL_NO_RSA static void MS_CALLBACK req_cb(int p,int n,void *arg); static int MS_CALLBACK req_cb(int p, int n, BN_GENCB *cb); #endif static int req_check_len(int len,int n_min,int n_max); static int check_end(char *str, char *end); Loading Loading @@ -712,6 +712,8 @@ bad: 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(); Loading Loading @@ -740,11 +742,14 @@ bad: #ifndef OPENSSL_NO_RSA if (pkey_type == TYPE_RSA) { if (!EVP_PKEY_assign_RSA(pkey, RSA_generate_key(newkey,0x10001, req_cb,bio_err))) RSA *rsa = RSA_new(); if(!rsa || !RSA_generate_key_ex(rsa, newkey, 0x10001, &cb) || !EVP_PKEY_assign_RSA(pkey, rsa)) { if(rsa) RSA_free(rsa); goto end; } } else #endif #ifndef OPENSSL_NO_DSA Loading Loading @@ -1610,7 +1615,7 @@ err: } #ifndef OPENSSL_NO_RSA static void MS_CALLBACK req_cb(int p, int n, void *arg) static int MS_CALLBACK req_cb(int p, int n, BN_GENCB *cb) { char c='*'; Loading @@ -1618,11 +1623,12 @@ static void MS_CALLBACK req_cb(int p, int n, void *arg) if (p == 1) c='+'; if (p == 2) c='*'; if (p == 3) c='\n'; BIO_write((BIO *)arg,&c,1); (void)BIO_flush((BIO *)arg); BIO_write(cb->arg,&c,1); (void)BIO_flush(cb->arg); #ifdef LINT p=n; #endif return 1; } #endif Loading