diff options
author | Richard Levitte <levitte@openssl.org> | 2000-09-12 08:37:51 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-09-12 08:37:51 +0000 |
commit | 2be96941164571dfbdf180a00b6ea4d00af53a1a (patch) | |
tree | 0d6b3cd63f4fcaf8494ce62a3d976c3a917617e7 /apps | |
parent | b46ba9b1bcd1431b3675cacfab3c3666703a3685 (diff) |
Merge of main trunk, conflicts resolved.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/CA.pl.in | 1 | ||||
-rw-r--r-- | apps/speed.c | 179 |
2 files changed, 114 insertions, 66 deletions
diff --git a/apps/CA.pl.in b/apps/CA.pl.in index 7781067d6a..f1ac7e7726 100644 --- a/apps/CA.pl.in +++ b/apps/CA.pl.in @@ -36,6 +36,7 @@ # default openssl.cnf file has setup as per the following # demoCA ... where everything is stored +$SSLEAY_CONFIG=$ENV{"SSLEAY_CONFIG"}; $DAYS="-days 365"; $REQ="openssl req $SSLEAY_CONFIG"; $CA="openssl ca $SSLEAY_CONFIG"; diff --git a/apps/speed.c b/apps/speed.c index e52767153b..d8d1b6d46d 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -88,7 +88,7 @@ #elif !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) # define TIMES #endif -#if !defined(_UNICOS) +#if !defined(_UNICOS) && !defined(__OpenBSD__) # define TIMEB #endif @@ -1167,49 +1167,73 @@ int MAIN(int argc, char **argv) int ret; if (!rsa_doit[j]) continue; ret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num, rsa_key[j]); - pkey_print_message("private","rsa",rsa_c[j][0],rsa_bits[j], - RSA_SECONDS); -/* RSA_blinding_on(rsa_key[j],NULL); */ - Time_F(START,usertime); - for (count=0,run=1; COND(rsa_c[j][0]); count++) + if (ret == 0) + { + BIO_printf(bio_err,"RSA sign failure. No RSA sign will be done.\n"); + ERR_print_errors(bio_err); + rsa_count=1; + } + else { - ret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num, - rsa_key[j]); - if (ret <= 0) + pkey_print_message("private","rsa", + rsa_c[j][0],rsa_bits[j], + RSA_SECONDS); +/* RSA_blinding_on(rsa_key[j],NULL); */ + Time_F(START,usertime); + for (count=0,run=1; COND(rsa_c[j][0]); count++) { - BIO_printf(bio_err,"RSA private encrypt failure\n"); - ERR_print_errors(bio_err); - count=1; - break; + ret=RSA_sign(NID_md5_sha1, buf,36, buf2, + &rsa_num, rsa_key[j]); + if (ret == 0) + { + BIO_printf(bio_err, + "RSA sign failure\n"); + ERR_print_errors(bio_err); + count=1; + break; + } } + d=Time_F(STOP,usertime); + BIO_printf(bio_err, + "%ld %d bit private RSA's in %.2fs\n", + count,rsa_bits[j],d); + rsa_results[j][0]=d/(double)count; + rsa_count=count; } - d=Time_F(STOP,usertime); - BIO_printf(bio_err,"%ld %d bit private RSA's in %.2fs\n", - count,rsa_bits[j],d); - rsa_results[j][0]=d/(double)count; - rsa_count=count; #if 1 ret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num, rsa_key[j]); - pkey_print_message("public","rsa",rsa_c[j][1],rsa_bits[j], - RSA_SECONDS); - Time_F(START,usertime); - for (count=0,run=1; COND(rsa_c[j][1]); count++) + if (ret <= 0) { - ret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num, - rsa_key[j]); - if (ret <= 0) + BIO_printf(bio_err,"RSA verify failure. No RSA verify will be done.\n"); + ERR_print_errors(bio_err); + dsa_doit[j] = 0; + } + else + { + pkey_print_message("public","rsa", + rsa_c[j][1],rsa_bits[j], + RSA_SECONDS); + Time_F(START,usertime); + for (count=0,run=1; COND(rsa_c[j][1]); count++) { - BIO_printf(bio_err,"RSA verify failure\n"); - ERR_print_errors(bio_err); - count=1; - break; + ret=RSA_verify(NID_md5_sha1, buf,36, buf2, + rsa_num, rsa_key[j]); + if (ret == 0) + { + BIO_printf(bio_err, + "RSA verify failure\n"); + ERR_print_errors(bio_err); + count=1; + break; + } } + d=Time_F(STOP,usertime); + BIO_printf(bio_err, + "%ld %d bit public RSA's in %.2fs\n", + count,rsa_bits[j],d); + rsa_results[j][1]=d/(double)count; } - d=Time_F(STOP,usertime); - BIO_printf(bio_err,"%ld %d bit public RSA's in %.2fs\n", - count,rsa_bits[j],d); - rsa_results[j][1]=d/(double)count; #endif if (rsa_count <= 1) @@ -1231,54 +1255,77 @@ int MAIN(int argc, char **argv) for (j=0; j<DSA_NUM; j++) { unsigned int kk; + int ret; if (!dsa_doit[j]) continue; DSA_generate_key(dsa_key[j]); /* DSA_sign_setup(dsa_key[j],NULL); */ - rsa_num=DSA_sign(EVP_PKEY_DSA,buf,20,buf2, + ret=DSA_sign(EVP_PKEY_DSA,buf,20,buf2, &kk,dsa_key[j]); - pkey_print_message("sign","dsa",dsa_c[j][0],dsa_bits[j], - DSA_SECONDS); - Time_F(START,usertime); - for (count=0,run=1; COND(dsa_c[j][0]); count++) + if (ret == 0) + { + BIO_printf(bio_err,"DSA sign failure. No DSA sign will be done.\n"); + ERR_print_errors(bio_err); + rsa_count=1; + } + else { - rsa_num=DSA_sign(EVP_PKEY_DSA,buf,20,buf2, - &kk,dsa_key[j]); - if (rsa_num == 0) + pkey_print_message("sign","dsa", + dsa_c[j][0],dsa_bits[j], + DSA_SECONDS); + Time_F(START,usertime); + for (count=0,run=1; COND(dsa_c[j][0]); count++) { - BIO_printf(bio_err,"DSA sign failure\n"); - ERR_print_errors(bio_err); - count=1; - break; + ret=DSA_sign(EVP_PKEY_DSA,buf,20,buf2, + &kk,dsa_key[j]); + if (ret == 0) + { + BIO_printf(bio_err, + "DSA sign failure\n"); + ERR_print_errors(bio_err); + count=1; + break; + } } + d=Time_F(STOP,usertime); + BIO_printf(bio_err,"%ld %d bit DSA signs in %.2fs\n", + count,dsa_bits[j],d); + dsa_results[j][0]=d/(double)count; + rsa_count=count; } - d=Time_F(STOP,usertime); - BIO_printf(bio_err,"%ld %d bit DSA signs in %.2fs\n", - count,dsa_bits[j],d); - dsa_results[j][0]=d/(double)count; - rsa_count=count; - rsa_num2=DSA_verify(EVP_PKEY_DSA,buf,20,buf2, + ret=DSA_verify(EVP_PKEY_DSA,buf,20,buf2, kk,dsa_key[j]); - pkey_print_message("verify","dsa",dsa_c[j][1],dsa_bits[j], - DSA_SECONDS); - Time_F(START,usertime); - for (count=0,run=1; COND(dsa_c[j][1]); count++) + if (ret <= 0) + { + BIO_printf(bio_err,"DSA verify failure. No DSA verify will be done.\n"); + ERR_print_errors(bio_err); + dsa_doit[j] = 0; + } + else { - rsa_num2=DSA_verify(EVP_PKEY_DSA,buf,20,buf2, - kk,dsa_key[j]); - if (rsa_num2 == 0) + pkey_print_message("verify","dsa", + dsa_c[j][1],dsa_bits[j], + DSA_SECONDS); + Time_F(START,usertime); + for (count=0,run=1; COND(dsa_c[j][1]); count++) { - BIO_printf(bio_err,"DSA verify failure\n"); - ERR_print_errors(bio_err); - count=1; - break; + ret=DSA_verify(EVP_PKEY_DSA,buf,20,buf2, + kk,dsa_key[j]); + if (ret <= 0) + { + BIO_printf(bio_err, + "DSA verify failure\n"); + ERR_print_errors(bio_err); + count=1; + break; + } } + d=Time_F(STOP,usertime); + BIO_printf(bio_err,"%ld %d bit DSA verify in %.2fs\n", + count,dsa_bits[j],d); + dsa_results[j][1]=d/(double)count; } - d=Time_F(STOP,usertime); - BIO_printf(bio_err,"%ld %d bit DSA verify in %.2fs\n", - count,dsa_bits[j],d); - dsa_results[j][1]=d/(double)count; if (rsa_count <= 1) { |