summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortedu <>2014-07-09 21:02:35 +0000
committertedu <>2014-07-09 21:02:35 +0000
commit3959f9f6f990883581554dcab8e72a0a88435215 (patch)
treef2eda96cf09f45abd8f8a4b603044f1f495fa2be /src
parentc754d242334164abfaf99184420a18b9d36e8d1b (diff)
downloadopenbsd-3959f9f6f990883581554dcab8e72a0a88435215.tar.gz
openbsd-3959f9f6f990883581554dcab8e72a0a88435215.tar.bz2
openbsd-3959f9f6f990883581554dcab8e72a0a88435215.zip
unifdef a whole bunch of NO RSA/DSA/ECDH defines i deleted from libssl
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/src/apps/apps.c6
-rw-r--r--src/lib/libssl/src/apps/dhparam.c16
-rw-r--r--src/lib/libssl/src/apps/dsa.c4
-rw-r--r--src/lib/libssl/src/apps/dsaparam.c4
-rw-r--r--src/lib/libssl/src/apps/gendsa.c4
-rw-r--r--src/lib/libssl/src/apps/genrsa.c4
-rw-r--r--src/lib/libssl/src/apps/req.c12
-rw-r--r--src/lib/libssl/src/apps/rsa.c4
-rw-r--r--src/lib/libssl/src/apps/rsautl.c4
-rw-r--r--src/lib/libssl/src/apps/s_server.c22
-rw-r--r--src/lib/libssl/src/apps/speed.c112
-rw-r--r--src/lib/libssl/src/apps/x509.c10
12 files changed, 12 insertions, 190 deletions
diff --git a/src/lib/libssl/src/apps/apps.c b/src/lib/libssl/src/apps/apps.c
index 17f4f7668c..e586ec26cc 100644
--- a/src/lib/libssl/src/apps/apps.c
+++ b/src/lib/libssl/src/apps/apps.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: apps.c,v 1.62 2014/07/09 20:37:20 tedu Exp $ */ 1/* $OpenBSD: apps.c,v 1.63 2014/07/09 21:02:35 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -137,9 +137,7 @@
137#include <openssl/engine.h> 137#include <openssl/engine.h>
138#endif 138#endif
139 139
140#ifndef OPENSSL_NO_RSA
141#include <openssl/rsa.h> 140#include <openssl/rsa.h>
142#endif
143 141
144typedef struct { 142typedef struct {
145 const char *name; 143 const char *name;
@@ -797,7 +795,6 @@ load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
797 if (format == FORMAT_ASN1) { 795 if (format == FORMAT_ASN1) {
798 pkey = d2i_PUBKEY_bio(key, NULL); 796 pkey = d2i_PUBKEY_bio(key, NULL);
799 } 797 }
800#ifndef OPENSSL_NO_RSA
801 else if (format == FORMAT_ASN1RSA) { 798 else if (format == FORMAT_ASN1RSA) {
802 RSA *rsa; 799 RSA *rsa;
803 rsa = d2i_RSAPublicKey_bio(key, NULL); 800 rsa = d2i_RSAPublicKey_bio(key, NULL);
@@ -819,7 +816,6 @@ load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
819 } else 816 } else
820 pkey = NULL; 817 pkey = NULL;
821 } 818 }
822#endif
823 else if (format == FORMAT_PEM) { 819 else if (format == FORMAT_PEM) {
824 pkey = PEM_read_bio_PUBKEY(key, NULL, password_callback, &cb_data); 820 pkey = PEM_read_bio_PUBKEY(key, NULL, password_callback, &cb_data);
825 } 821 }
diff --git a/src/lib/libssl/src/apps/dhparam.c b/src/lib/libssl/src/apps/dhparam.c
index 935687ffeb..4bd888541b 100644
--- a/src/lib/libssl/src/apps/dhparam.c
+++ b/src/lib/libssl/src/apps/dhparam.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dhparam.c,v 1.30 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: dhparam.c,v 1.31 2014/07/09 21:02:35 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -127,9 +127,7 @@
127#include <openssl/pem.h> 127#include <openssl/pem.h>
128#include <openssl/x509.h> 128#include <openssl/x509.h>
129 129
130#ifndef OPENSSL_NO_DSA
131#include <openssl/dsa.h> 130#include <openssl/dsa.h>
132#endif
133 131
134#define DEFBITS 512 132#define DEFBITS 512
135 133
@@ -153,9 +151,7 @@ dhparam_main(int argc, char **argv)
153{ 151{
154 DH *dh = NULL; 152 DH *dh = NULL;
155 int i, badops = 0, text = 0; 153 int i, badops = 0, text = 0;
156#ifndef OPENSSL_NO_DSA
157 int dsaparam = 0; 154 int dsaparam = 0;
158#endif
159 BIO *in = NULL, *out = NULL; 155 BIO *in = NULL, *out = NULL;
160 int informat, outformat, check = 0, noout = 0, C = 0, ret = 1; 156 int informat, outformat, check = 0, noout = 0, C = 0, ret = 1;
161 char *infile, *outfile, *prog; 157 char *infile, *outfile, *prog;
@@ -204,10 +200,8 @@ dhparam_main(int argc, char **argv)
204 check = 1; 200 check = 1;
205 else if (strcmp(*argv, "-text") == 0) 201 else if (strcmp(*argv, "-text") == 0)
206 text = 1; 202 text = 1;
207#ifndef OPENSSL_NO_DSA
208 else if (strcmp(*argv, "-dsaparam") == 0) 203 else if (strcmp(*argv, "-dsaparam") == 0)
209 dsaparam = 1; 204 dsaparam = 1;
210#endif
211 else if (strcmp(*argv, "-C") == 0) 205 else if (strcmp(*argv, "-C") == 0)
212 C = 1; 206 C = 1;
213 else if (strcmp(*argv, "-noout") == 0) 207 else if (strcmp(*argv, "-noout") == 0)
@@ -230,9 +224,7 @@ bad:
230 BIO_printf(bio_err, " -outform arg output format - one of DER PEM\n"); 224 BIO_printf(bio_err, " -outform arg output format - one of DER PEM\n");
231 BIO_printf(bio_err, " -in arg input file\n"); 225 BIO_printf(bio_err, " -in arg input file\n");
232 BIO_printf(bio_err, " -out arg output file\n"); 226 BIO_printf(bio_err, " -out arg output file\n");
233#ifndef OPENSSL_NO_DSA
234 BIO_printf(bio_err, " -dsaparam read or generate DSA parameters, convert to DH\n"); 227 BIO_printf(bio_err, " -dsaparam read or generate DSA parameters, convert to DH\n");
235#endif
236 BIO_printf(bio_err, " -check check the DH parameters\n"); 228 BIO_printf(bio_err, " -check check the DH parameters\n");
237 BIO_printf(bio_err, " -text print a text form of the DH parameters\n"); 229 BIO_printf(bio_err, " -text print a text form of the DH parameters\n");
238 BIO_printf(bio_err, " -C Output C code\n"); 230 BIO_printf(bio_err, " -C Output C code\n");
@@ -254,14 +246,12 @@ bad:
254 if (g && !num) 246 if (g && !num)
255 num = DEFBITS; 247 num = DEFBITS;
256 248
257#ifndef OPENSSL_NO_DSA
258 if (dsaparam) { 249 if (dsaparam) {
259 if (g) { 250 if (g) {
260 BIO_printf(bio_err, "generator may not be chosen for DSA parameters\n"); 251 BIO_printf(bio_err, "generator may not be chosen for DSA parameters\n");
261 goto end; 252 goto end;
262 } 253 }
263 } else 254 } else
264#endif
265 { 255 {
266 /* DH parameters */ 256 /* DH parameters */
267 if (num && !g) 257 if (num && !g)
@@ -272,7 +262,6 @@ bad:
272 262
273 BN_GENCB cb; 263 BN_GENCB cb;
274 BN_GENCB_set(&cb, dh_cb, bio_err); 264 BN_GENCB_set(&cb, dh_cb, bio_err);
275#ifndef OPENSSL_NO_DSA
276 if (dsaparam) { 265 if (dsaparam) {
277 DSA *dsa = DSA_new(); 266 DSA *dsa = DSA_new();
278 267
@@ -291,7 +280,6 @@ bad:
291 goto end; 280 goto end;
292 } 281 }
293 } else 282 } else
294#endif
295 { 283 {
296 dh = DH_new(); 284 dh = DH_new();
297 BIO_printf(bio_err, "Generating DH parameters, %d bit long safe prime, generator %d\n", num, g); 285 BIO_printf(bio_err, "Generating DH parameters, %d bit long safe prime, generator %d\n", num, g);
@@ -321,7 +309,6 @@ bad:
321 BIO_printf(bio_err, "bad input format specified\n"); 309 BIO_printf(bio_err, "bad input format specified\n");
322 goto end; 310 goto end;
323 } 311 }
324#ifndef OPENSSL_NO_DSA
325 if (dsaparam) { 312 if (dsaparam) {
326 DSA *dsa; 313 DSA *dsa;
327 314
@@ -342,7 +329,6 @@ bad:
342 goto end; 329 goto end;
343 } 330 }
344 } else 331 } else
345#endif
346 { 332 {
347 if (informat == FORMAT_ASN1) 333 if (informat == FORMAT_ASN1)
348 dh = d2i_DHparams_bio(in, NULL); 334 dh = d2i_DHparams_bio(in, NULL);
diff --git a/src/lib/libssl/src/apps/dsa.c b/src/lib/libssl/src/apps/dsa.c
index 4a05e2d174..d667d6efb7 100644
--- a/src/lib/libssl/src/apps/dsa.c
+++ b/src/lib/libssl/src/apps/dsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa.c,v 1.25 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: dsa.c,v 1.26 2014/07/09 21:02:35 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -58,7 +58,6 @@
58 58
59#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */ 59#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */
60 60
61#ifndef OPENSSL_NO_DSA
62 61
63#include <stdio.h> 62#include <stdio.h>
64#include <stdlib.h> 63#include <stdlib.h>
@@ -335,4 +334,3 @@ end:
335 334
336 return (ret); 335 return (ret);
337} 336}
338#endif
diff --git a/src/lib/libssl/src/apps/dsaparam.c b/src/lib/libssl/src/apps/dsaparam.c
index 18e25d1a21..217679f366 100644
--- a/src/lib/libssl/src/apps/dsaparam.c
+++ b/src/lib/libssl/src/apps/dsaparam.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsaparam.c,v 1.31 2014/06/29 18:26:26 logan Exp $ */ 1/* $OpenBSD: dsaparam.c,v 1.32 2014/07/09 21:02:35 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -64,7 +64,6 @@
64#undef OPENSSL_NO_DEPRECATED 64#undef OPENSSL_NO_DEPRECATED
65#endif 65#endif
66 66
67#ifndef OPENSSL_NO_DSA
68 67
69#include <stdio.h> 68#include <stdio.h>
70#include <stdlib.h> 69#include <stdlib.h>
@@ -417,4 +416,3 @@ dsa_cb(int p, int n, BN_GENCB * cb)
417#endif 416#endif
418 return 1; 417 return 1;
419} 418}
420#endif
diff --git a/src/lib/libssl/src/apps/gendsa.c b/src/lib/libssl/src/apps/gendsa.c
index 92e58a5792..cb86c4ac3e 100644
--- a/src/lib/libssl/src/apps/gendsa.c
+++ b/src/lib/libssl/src/apps/gendsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gendsa.c,v 1.27 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: gendsa.c,v 1.28 2014/07/09 21:02:35 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -58,7 +58,6 @@
58 58
59#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */ 59#include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */
60 60
61#ifndef OPENSSL_NO_DSA
62 61
63#include <sys/types.h> 62#include <sys/types.h>
64#include <sys/stat.h> 63#include <sys/stat.h>
@@ -233,4 +232,3 @@ end:
233 232
234 return (ret); 233 return (ret);
235} 234}
236#endif
diff --git a/src/lib/libssl/src/apps/genrsa.c b/src/lib/libssl/src/apps/genrsa.c
index 9398120809..7b670ece6b 100644
--- a/src/lib/libssl/src/apps/genrsa.c
+++ b/src/lib/libssl/src/apps/genrsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: genrsa.c,v 1.34 2014/07/09 09:06:58 bcook Exp $ */ 1/* $OpenBSD: genrsa.c,v 1.35 2014/07/09 21:02:35 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -64,7 +64,6 @@
64#undef OPENSSL_NO_DEPRECATED 64#undef OPENSSL_NO_DEPRECATED
65#endif 65#endif
66 66
67#ifndef OPENSSL_NO_RSA
68 67
69#include <sys/types.h> 68#include <sys/types.h>
70#include <sys/stat.h> 69#include <sys/stat.h>
@@ -288,4 +287,3 @@ genrsa_cb(int p, int n, BN_GENCB * cb)
288 (void) BIO_flush(cb->arg); 287 (void) BIO_flush(cb->arg);
289 return 1; 288 return 1;
290} 289}
291#endif
diff --git a/src/lib/libssl/src/apps/req.c b/src/lib/libssl/src/apps/req.c
index dcb7ab4a4a..81a58ca54b 100644
--- a/src/lib/libssl/src/apps/req.c
+++ b/src/lib/libssl/src/apps/req.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: req.c,v 1.44 2014/06/28 04:39:41 deraadt Exp $ */ 1/* $OpenBSD: req.c,v 1.45 2014/07/09 21:02:35 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -81,13 +81,9 @@
81#include <openssl/x509.h> 81#include <openssl/x509.h>
82#include <openssl/x509v3.h> 82#include <openssl/x509v3.h>
83 83
84#ifndef OPENSSL_NO_DSA
85#include <openssl/dsa.h> 84#include <openssl/dsa.h>
86#endif
87 85
88#ifndef OPENSSL_NO_RSA
89#include <openssl/rsa.h> 86#include <openssl/rsa.h>
90#endif
91 87
92#define SECTION "req" 88#define SECTION "req"
93 89
@@ -383,9 +379,7 @@ bad:
383 BIO_printf(bio_err, " -keyout arg file to send the key to\n"); 379 BIO_printf(bio_err, " -keyout arg file to send the key to\n");
384 BIO_printf(bio_err, " -newkey rsa:bits generate a new RSA key of 'bits' in size\n"); 380 BIO_printf(bio_err, " -newkey rsa:bits generate a new RSA key of 'bits' in size\n");
385 BIO_printf(bio_err, " -newkey dsa:file generate a new DSA key, parameters taken from CA in 'file'\n"); 381 BIO_printf(bio_err, " -newkey dsa:file generate a new DSA key, parameters taken from CA in 'file'\n");
386#ifndef OPENSSL_NO_ECDSA
387 BIO_printf(bio_err, " -newkey ec:file generate a new EC key, parameters taken from CA in 'file'\n"); 382 BIO_printf(bio_err, " -newkey ec:file generate a new EC key, parameters taken from CA in 'file'\n");
388#endif
389 BIO_printf(bio_err, " -[digest] Digest to sign with (md5, sha1, md2, mdc2, md4)\n"); 383 BIO_printf(bio_err, " -[digest] Digest to sign with (md5, sha1, md2, mdc2, md4)\n");
390 BIO_printf(bio_err, " -config file request template file.\n"); 384 BIO_printf(bio_err, " -config file request template file.\n");
391 BIO_printf(bio_err, " -subj arg set or modify request subject\n"); 385 BIO_printf(bio_err, " -subj arg set or modify request subject\n");
@@ -848,11 +842,9 @@ loop:
848 goto end; 842 goto end;
849 } 843 }
850 fprintf(stdout, "Modulus="); 844 fprintf(stdout, "Modulus=");
851#ifndef OPENSSL_NO_RSA
852 if (EVP_PKEY_base_id(tpubkey) == EVP_PKEY_RSA) 845 if (EVP_PKEY_base_id(tpubkey) == EVP_PKEY_RSA)
853 BN_print(out, tpubkey->pkey.rsa->n); 846 BN_print(out, tpubkey->pkey.rsa->n);
854 else 847 else
855#endif
856 fprintf(stdout, "Wrong Algorithm type"); 848 fprintf(stdout, "Wrong Algorithm type");
857 EVP_PKEY_free(tpubkey); 849 EVP_PKEY_free(tpubkey);
858 fprintf(stdout, "\n"); 850 fprintf(stdout, "\n");
@@ -1512,7 +1504,6 @@ set_keygen_ctx(BIO * err, const char *gstr, int *pkey_type,
1512 ERR_print_errors(err); 1504 ERR_print_errors(err);
1513 return NULL; 1505 return NULL;
1514 } 1506 }
1515#ifndef OPENSSL_NO_RSA
1516 if ((*pkey_type == EVP_PKEY_RSA) && (keylen != -1)) { 1507 if ((*pkey_type == EVP_PKEY_RSA) && (keylen != -1)) {
1517 if (EVP_PKEY_CTX_set_rsa_keygen_bits(gctx, keylen) <= 0) { 1508 if (EVP_PKEY_CTX_set_rsa_keygen_bits(gctx, keylen) <= 0) {
1518 BIO_puts(err, "Error setting RSA keysize\n"); 1509 BIO_puts(err, "Error setting RSA keysize\n");
@@ -1521,7 +1512,6 @@ set_keygen_ctx(BIO * err, const char *gstr, int *pkey_type,
1521 return NULL; 1512 return NULL;
1522 } 1513 }
1523 } 1514 }
1524#endif
1525 1515
1526 return gctx; 1516 return gctx;
1527} 1517}
diff --git a/src/lib/libssl/src/apps/rsa.c b/src/lib/libssl/src/apps/rsa.c
index 1fe7e4bae8..2a9995ed5e 100644
--- a/src/lib/libssl/src/apps/rsa.c
+++ b/src/lib/libssl/src/apps/rsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa.c,v 1.24 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: rsa.c,v 1.25 2014/07/09 21:02:35 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -58,7 +58,6 @@
58 58
59#include <openssl/opensslconf.h> 59#include <openssl/opensslconf.h>
60 60
61#ifndef OPENSSL_NO_RSA
62 61
63#include <stdio.h> 62#include <stdio.h>
64#include <stdlib.h> 63#include <stdlib.h>
@@ -394,4 +393,3 @@ end:
394 393
395 return (ret); 394 return (ret);
396} 395}
397#endif
diff --git a/src/lib/libssl/src/apps/rsautl.c b/src/lib/libssl/src/apps/rsautl.c
index adfae34896..85003780d0 100644
--- a/src/lib/libssl/src/apps/rsautl.c
+++ b/src/lib/libssl/src/apps/rsautl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsautl.c,v 1.21 2014/06/12 15:49:27 deraadt Exp $ */ 1/* $OpenBSD: rsautl.c,v 1.22 2014/07/09 21:02:35 tedu Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -58,7 +58,6 @@
58 58
59#include <openssl/opensslconf.h> 59#include <openssl/opensslconf.h>
60 60
61#ifndef OPENSSL_NO_RSA
62 61
63#include <string.h> 62#include <string.h>
64 63
@@ -343,4 +342,3 @@ usage()
343 342
344} 343}
345 344
346#endif
diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c
index 1f80a8f7d9..1c13d5517d 100644
--- a/src/lib/libssl/src/apps/s_server.c
+++ b/src/lib/libssl/src/apps/s_server.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s_server.c,v 1.55 2014/07/09 20:59:41 tedu Exp $ */ 1/* $OpenBSD: s_server.c,v 1.56 2014/07/09 21:02:35 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -173,16 +173,12 @@
173#include <openssl/dh.h> 173#include <openssl/dh.h>
174#endif 174#endif
175 175
176#ifndef OPENSSL_NO_RSA
177#include <openssl/rsa.h> 176#include <openssl/rsa.h>
178#endif
179 177
180#include "s_apps.h" 178#include "s_apps.h"
181#include "timeouts.h" 179#include "timeouts.h"
182 180
183#ifndef OPENSSL_NO_RSA
184static RSA *tmp_rsa_cb(SSL * s, int is_export, int keylength); 181static RSA *tmp_rsa_cb(SSL * s, int is_export, int keylength);
185#endif
186static int sv_body(char *hostname, int s, unsigned char *context); 182static int sv_body(char *hostname, int s, unsigned char *context);
187static int www_body(char *hostname, int s, unsigned char *context); 183static int www_body(char *hostname, int s, unsigned char *context);
188static void close_accept_socket(void); 184static void close_accept_socket(void);
@@ -406,11 +402,9 @@ sv_usage(void)
406 BIO_printf(bio_err, " -dpass arg - second private key file pass phrase source\n"); 402 BIO_printf(bio_err, " -dpass arg - second private key file pass phrase source\n");
407 BIO_printf(bio_err, " -dhparam arg - DH parameter file to use, in cert file if not specified\n"); 403 BIO_printf(bio_err, " -dhparam arg - DH parameter file to use, in cert file if not specified\n");
408 BIO_printf(bio_err, " or a default set of parameters is used\n"); 404 BIO_printf(bio_err, " or a default set of parameters is used\n");
409#ifndef OPENSSL_NO_ECDH
410 BIO_printf(bio_err, " -named_curve arg - Elliptic curve name to use for ephemeral ECDH keys.\n" \ 405 BIO_printf(bio_err, " -named_curve arg - Elliptic curve name to use for ephemeral ECDH keys.\n" \
411 " Use \"openssl ecparam -list_curves\" for all names\n" \ 406 " Use \"openssl ecparam -list_curves\" for all names\n" \
412 " (default is nistp256).\n"); 407 " (default is nistp256).\n");
413#endif
414 BIO_printf(bio_err, " -nbio - Run with non-blocking IO\n"); 408 BIO_printf(bio_err, " -nbio - Run with non-blocking IO\n");
415 BIO_printf(bio_err, " -nbio_test - test with the non-blocking test bio\n"); 409 BIO_printf(bio_err, " -nbio_test - test with the non-blocking test bio\n");
416 BIO_printf(bio_err, " -crlf - convert LF from terminal into CRLF\n"); 410 BIO_printf(bio_err, " -crlf - convert LF from terminal into CRLF\n");
@@ -444,9 +438,7 @@ sv_usage(void)
444#ifndef OPENSSL_NO_DH 438#ifndef OPENSSL_NO_DH
445 BIO_printf(bio_err, " -no_dhe - Disable ephemeral DH\n"); 439 BIO_printf(bio_err, " -no_dhe - Disable ephemeral DH\n");
446#endif 440#endif
447#ifndef OPENSSL_NO_ECDH
448 BIO_printf(bio_err, " -no_ecdhe - Disable ephemeral ECDH\n"); 441 BIO_printf(bio_err, " -no_ecdhe - Disable ephemeral ECDH\n");
449#endif
450 BIO_printf(bio_err, " -bugs - Turn on SSL bug compatibility\n"); 442 BIO_printf(bio_err, " -bugs - Turn on SSL bug compatibility\n");
451 BIO_printf(bio_err, " -www - Respond to a 'GET /' with a status page\n"); 443 BIO_printf(bio_err, " -www - Respond to a 'GET /' with a status page\n");
452 BIO_printf(bio_err, " -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n"); 444 BIO_printf(bio_err, " -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n");
@@ -681,9 +673,7 @@ s_server_main(int argc, char *argv[])
681 char *CApath = NULL, *CAfile = NULL; 673 char *CApath = NULL, *CAfile = NULL;
682 unsigned char *context = NULL; 674 unsigned char *context = NULL;
683 char *dhfile = NULL; 675 char *dhfile = NULL;
684#ifndef OPENSSL_NO_ECDH
685 char *named_curve = NULL; 676 char *named_curve = NULL;
686#endif
687 int badop = 0, bugs = 0; 677 int badop = 0, bugs = 0;
688 int ret = 1; 678 int ret = 1;
689 int off = 0; 679 int off = 0;
@@ -783,13 +773,11 @@ s_server_main(int argc, char *argv[])
783 goto bad; 773 goto bad;
784 dhfile = *(++argv); 774 dhfile = *(++argv);
785 } 775 }
786#ifndef OPENSSL_NO_ECDH
787 else if (strcmp(*argv, "-named_curve") == 0) { 776 else if (strcmp(*argv, "-named_curve") == 0) {
788 if (--argc < 1) 777 if (--argc < 1)
789 goto bad; 778 goto bad;
790 named_curve = *(++argv); 779 named_curve = *(++argv);
791 } 780 }
792#endif
793 else if (strcmp(*argv, "-dcertform") == 0) { 781 else if (strcmp(*argv, "-dcertform") == 0) {
794 if (--argc < 1) 782 if (--argc < 1)
795 goto bad; 783 goto bad;
@@ -1123,9 +1111,7 @@ bad:
1123 bio_s_out = BIO_new_fp(stdout, BIO_NOCLOSE); 1111 bio_s_out = BIO_new_fp(stdout, BIO_NOCLOSE);
1124 } 1112 }
1125 } 1113 }
1126#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_ECDSA)
1127 if (nocert) 1114 if (nocert)
1128#endif
1129 { 1115 {
1130 s_cert_file = NULL; 1116 s_cert_file = NULL;
1131 s_key_file = NULL; 1117 s_key_file = NULL;
@@ -1286,7 +1272,6 @@ bad:
1286 } 1272 }
1287#endif 1273#endif
1288 1274
1289#ifndef OPENSSL_NO_ECDH
1290 if (!no_ecdhe) { 1275 if (!no_ecdhe) {
1291 EC_KEY *ecdh = NULL; 1276 EC_KEY *ecdh = NULL;
1292 1277
@@ -1324,7 +1309,6 @@ bad:
1324#endif 1309#endif
1325 EC_KEY_free(ecdh); 1310 EC_KEY_free(ecdh);
1326 } 1311 }
1327#endif
1328 1312
1329 if (!set_cert_key_stuff(ctx, s_cert, s_key)) 1313 if (!set_cert_key_stuff(ctx, s_cert, s_key))
1330 goto end; 1314 goto end;
@@ -1336,7 +1320,6 @@ bad:
1336 if (!set_cert_key_stuff(ctx, s_dcert, s_dkey)) 1320 if (!set_cert_key_stuff(ctx, s_dcert, s_dkey))
1337 goto end; 1321 goto end;
1338 } 1322 }
1339#ifndef OPENSSL_NO_RSA
1340 if (!no_tmp_rsa) { 1323 if (!no_tmp_rsa) {
1341 SSL_CTX_set_tmp_rsa_callback(ctx, tmp_rsa_cb); 1324 SSL_CTX_set_tmp_rsa_callback(ctx, tmp_rsa_cb);
1342#ifndef OPENSSL_NO_TLSEXT 1325#ifndef OPENSSL_NO_TLSEXT
@@ -1344,7 +1327,6 @@ bad:
1344 SSL_CTX_set_tmp_rsa_callback(ctx2, tmp_rsa_cb); 1327 SSL_CTX_set_tmp_rsa_callback(ctx2, tmp_rsa_cb);
1345#endif 1328#endif
1346 } 1329 }
1347#endif
1348 1330
1349#ifndef OPENSSL_NO_PSK 1331#ifndef OPENSSL_NO_PSK
1350 if (psk_key != NULL) { 1332 if (psk_key != NULL) {
@@ -2213,7 +2195,6 @@ err:
2213 return (ret); 2195 return (ret);
2214} 2196}
2215 2197
2216#ifndef OPENSSL_NO_RSA
2217static RSA * 2198static RSA *
2218tmp_rsa_cb(SSL * s, int is_export, int keylength) 2199tmp_rsa_cb(SSL * s, int is_export, int keylength)
2219{ 2200{
@@ -2241,7 +2222,6 @@ tmp_rsa_cb(SSL * s, int is_export, int keylength)
2241 } 2222 }
2242 return (rsa_tmp); 2223 return (rsa_tmp);
2243} 2224}
2244#endif
2245 2225
2246#define MAX_SESSION_ID_ATTEMPTS 10 2226#define MAX_SESSION_ID_ATTEMPTS 10
2247static int 2227static int
diff --git a/src/lib/libssl/src/apps/speed.c b/src/lib/libssl/src/apps/speed.c
index 1d320db010..8ff12b27c3 100644
--- a/src/lib/libssl/src/apps/speed.c
+++ b/src/lib/libssl/src/apps/speed.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: speed.c,v 1.49 2014/06/28 04:39:41 deraadt Exp $ */ 1/* $OpenBSD: speed.c,v 1.50 2014/07/09 21:02:35 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -116,15 +116,9 @@
116#ifndef OPENSSL_NO_DES 116#ifndef OPENSSL_NO_DES
117#include <openssl/des.h> 117#include <openssl/des.h>
118#endif 118#endif
119#ifndef OPENSSL_NO_DSA
120#include <openssl/dsa.h> 119#include <openssl/dsa.h>
121#endif
122#ifndef OPENSSL_NO_ECDH
123#include <openssl/ecdh.h> 120#include <openssl/ecdh.h>
124#endif
125#ifndef OPENSSL_NO_ECDSA
126#include <openssl/ecdsa.h> 121#include <openssl/ecdsa.h>
127#endif
128#ifndef OPENSSL_NO_HMAC 122#ifndef OPENSSL_NO_HMAC
129#include <openssl/hmac.h> 123#include <openssl/hmac.h>
130#endif 124#endif
@@ -149,9 +143,7 @@
149#ifndef OPENSSL_NO_RC5 143#ifndef OPENSSL_NO_RC5
150#include <openssl/rc5.h> 144#include <openssl/rc5.h>
151#endif 145#endif
152#ifndef OPENSSL_NO_RSA
153#include <openssl/rsa.h> 146#include <openssl/rsa.h>
154#endif
155#ifndef OPENSSL_NO_RIPEMD 147#ifndef OPENSSL_NO_RIPEMD
156#include <openssl/ripemd.h> 148#include <openssl/ripemd.h>
157#endif 149#endif
@@ -162,12 +154,8 @@
162#include <openssl/whrlpool.h> 154#include <openssl/whrlpool.h>
163#endif 155#endif
164 156
165#ifndef OPENSSL_NO_DSA
166#include "./testdsa.h" 157#include "./testdsa.h"
167#endif
168#ifndef OPENSSL_NO_RSA
169#include "./testrsa.h" 158#include "./testrsa.h"
170#endif
171 159
172#define BUFSIZE ((long)1024*8+1) 160#define BUFSIZE ((long)1024*8+1)
173int run = 0; 161int run = 0;
@@ -201,18 +189,10 @@ static const char *names[ALGOR_NUM] = {
201"aes-128 ige", "aes-192 ige", "aes-256 ige", "ghash"}; 189"aes-128 ige", "aes-192 ige", "aes-256 ige", "ghash"};
202static double results[ALGOR_NUM][SIZE_NUM]; 190static double results[ALGOR_NUM][SIZE_NUM];
203static int lengths[SIZE_NUM] = {16, 64, 256, 1024, 8 * 1024}; 191static int lengths[SIZE_NUM] = {16, 64, 256, 1024, 8 * 1024};
204#ifndef OPENSSL_NO_RSA
205static double rsa_results[RSA_NUM][2]; 192static double rsa_results[RSA_NUM][2];
206#endif
207#ifndef OPENSSL_NO_DSA
208static double dsa_results[DSA_NUM][2]; 193static double dsa_results[DSA_NUM][2];
209#endif
210#ifndef OPENSSL_NO_ECDSA
211static double ecdsa_results[EC_NUM][2]; 194static double ecdsa_results[EC_NUM][2];
212#endif
213#ifndef OPENSSL_NO_ECDH
214static double ecdh_results[EC_NUM][1]; 195static double ecdh_results[EC_NUM][1];
215#endif
216 196
217static void sig_done(int sig); 197static void sig_done(int sig);
218 198
@@ -234,7 +214,6 @@ Time_F(int s)
234} 214}
235 215
236 216
237#ifndef OPENSSL_NO_ECDH
238static const int KDF1_SHA1_len = 20; 217static const int KDF1_SHA1_len = 20;
239static void * 218static void *
240KDF1_SHA1(const void *in, size_t inlen, void *out, size_t * outlen) 219KDF1_SHA1(const void *in, size_t inlen, void *out, size_t * outlen)
@@ -249,7 +228,6 @@ KDF1_SHA1(const void *in, size_t inlen, void *out, size_t * outlen)
249 return NULL; 228 return NULL;
250#endif /* OPENSSL_NO_SHA */ 229#endif /* OPENSSL_NO_SHA */
251} 230}
252#endif /* OPENSSL_NO_ECDH */
253 231
254 232
255int speed_main(int, char **); 233int speed_main(int, char **);
@@ -261,12 +239,8 @@ speed_main(int argc, char **argv)
261 int mret = 1; 239 int mret = 1;
262 long count = 0, save_count = 0; 240 long count = 0, save_count = 0;
263 int i, j, k; 241 int i, j, k;
264#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA)
265 long rsa_count; 242 long rsa_count;
266#endif
267#ifndef OPENSSL_NO_RSA
268 unsigned rsa_num; 243 unsigned rsa_num;
269#endif
270 unsigned char md[EVP_MAX_MD_SIZE]; 244 unsigned char md[EVP_MAX_MD_SIZE];
271#ifndef OPENSSL_NO_MDC2 245#ifndef OPENSSL_NO_MDC2
272 unsigned char mdc2[MDC2_DIGEST_LENGTH]; 246 unsigned char mdc2[MDC2_DIGEST_LENGTH];
@@ -414,7 +388,6 @@ speed_main(int argc, char **argv)
414#define R_EC_B409 14 388#define R_EC_B409 14
415#define R_EC_B571 15 389#define R_EC_B571 15
416 390
417#ifndef OPENSSL_NO_RSA
418 RSA *rsa_key[RSA_NUM]; 391 RSA *rsa_key[RSA_NUM];
419 long rsa_c[RSA_NUM][2]; 392 long rsa_c[RSA_NUM][2];
420 static unsigned int rsa_bits[RSA_NUM] = {512, 1024, 2048, 4096}; 393 static unsigned int rsa_bits[RSA_NUM] = {512, 1024, 2048, 4096};
@@ -423,12 +396,9 @@ speed_main(int argc, char **argv)
423 static int rsa_data_length[RSA_NUM] = { 396 static int rsa_data_length[RSA_NUM] = {
424 sizeof(test512), sizeof(test1024), 397 sizeof(test512), sizeof(test1024),
425 sizeof(test2048), sizeof(test4096)}; 398 sizeof(test2048), sizeof(test4096)};
426#endif
427#ifndef OPENSSL_NO_DSA
428 DSA *dsa_key[DSA_NUM]; 399 DSA *dsa_key[DSA_NUM];
429 long dsa_c[DSA_NUM][2]; 400 long dsa_c[DSA_NUM][2];
430 static unsigned int dsa_bits[DSA_NUM] = {512, 1024, 2048}; 401 static unsigned int dsa_bits[DSA_NUM] = {512, 1024, 2048};
431#endif
432#ifndef OPENSSL_NO_EC 402#ifndef OPENSSL_NO_EC
433 /* 403 /*
434 * We only test over the following curves as they are representative, 404 * We only test over the following curves as they are representative,
@@ -487,30 +457,22 @@ speed_main(int argc, char **argv)
487 457
488#endif 458#endif
489 459
490#ifndef OPENSSL_NO_ECDSA
491 unsigned char ecdsasig[256]; 460 unsigned char ecdsasig[256];
492 unsigned int ecdsasiglen; 461 unsigned int ecdsasiglen;
493 EC_KEY *ecdsa[EC_NUM]; 462 EC_KEY *ecdsa[EC_NUM];
494 long ecdsa_c[EC_NUM][2]; 463 long ecdsa_c[EC_NUM][2];
495#endif
496 464
497#ifndef OPENSSL_NO_ECDH
498 EC_KEY *ecdh_a[EC_NUM], *ecdh_b[EC_NUM]; 465 EC_KEY *ecdh_a[EC_NUM], *ecdh_b[EC_NUM];
499 unsigned char secret_a[MAX_ECDH_SIZE], secret_b[MAX_ECDH_SIZE]; 466 unsigned char secret_a[MAX_ECDH_SIZE], secret_b[MAX_ECDH_SIZE];
500 int secret_size_a, secret_size_b; 467 int secret_size_a, secret_size_b;
501 int ecdh_checks = 0; 468 int ecdh_checks = 0;
502 int secret_idx = 0; 469 int secret_idx = 0;
503 long ecdh_c[EC_NUM][2]; 470 long ecdh_c[EC_NUM][2];
504#endif
505 471
506 int rsa_doit[RSA_NUM]; 472 int rsa_doit[RSA_NUM];
507 int dsa_doit[DSA_NUM]; 473 int dsa_doit[DSA_NUM];
508#ifndef OPENSSL_NO_ECDSA
509 int ecdsa_doit[EC_NUM]; 474 int ecdsa_doit[EC_NUM];
510#endif
511#ifndef OPENSSL_NO_ECDH
512 int ecdh_doit[EC_NUM]; 475 int ecdh_doit[EC_NUM];
513#endif
514 int doit[ALGOR_NUM]; 476 int doit[ALGOR_NUM];
515 int pr_header = 0; 477 int pr_header = 0;
516 const EVP_CIPHER *evp_cipher = NULL; 478 const EVP_CIPHER *evp_cipher = NULL;
@@ -524,28 +486,20 @@ speed_main(int argc, char **argv)
524#endif 486#endif
525 487
526 memset(results, 0, sizeof(results)); 488 memset(results, 0, sizeof(results));
527#ifndef OPENSSL_NO_DSA
528 memset(dsa_key, 0, sizeof(dsa_key)); 489 memset(dsa_key, 0, sizeof(dsa_key));
529#endif
530#ifndef OPENSSL_NO_ECDSA
531 for (i = 0; i < EC_NUM; i++) 490 for (i = 0; i < EC_NUM; i++)
532 ecdsa[i] = NULL; 491 ecdsa[i] = NULL;
533#endif
534#ifndef OPENSSL_NO_ECDH
535 for (i = 0; i < EC_NUM; i++) { 492 for (i = 0; i < EC_NUM; i++) {
536 ecdh_a[i] = NULL; 493 ecdh_a[i] = NULL;
537 ecdh_b[i] = NULL; 494 ecdh_b[i] = NULL;
538 } 495 }
539#endif
540 496
541 if (!load_config(bio_err, NULL)) 497 if (!load_config(bio_err, NULL))
542 goto end; 498 goto end;
543 499
544#ifndef OPENSSL_NO_RSA
545 memset(rsa_key, 0, sizeof(rsa_key)); 500 memset(rsa_key, 0, sizeof(rsa_key));
546 for (i = 0; i < RSA_NUM; i++) 501 for (i = 0; i < RSA_NUM; i++)
547 rsa_key[i] = NULL; 502 rsa_key[i] = NULL;
548#endif
549 503
550 if ((buf = malloc((int) BUFSIZE)) == NULL) { 504 if ((buf = malloc((int) BUFSIZE)) == NULL) {
551 BIO_printf(bio_err, "out of memory\n"); 505 BIO_printf(bio_err, "out of memory\n");
@@ -565,14 +519,10 @@ speed_main(int argc, char **argv)
565 rsa_doit[i] = 0; 519 rsa_doit[i] = 0;
566 for (i = 0; i < DSA_NUM; i++) 520 for (i = 0; i < DSA_NUM; i++)
567 dsa_doit[i] = 0; 521 dsa_doit[i] = 0;
568#ifndef OPENSSL_NO_ECDSA
569 for (i = 0; i < EC_NUM; i++) 522 for (i = 0; i < EC_NUM; i++)
570 ecdsa_doit[i] = 0; 523 ecdsa_doit[i] = 0;
571#endif
572#ifndef OPENSSL_NO_ECDH
573 for (i = 0; i < EC_NUM; i++) 524 for (i = 0; i < EC_NUM; i++)
574 ecdh_doit[i] = 0; 525 ecdh_doit[i] = 0;
575#endif
576 526
577 527
578 j = 0; 528 j = 0;
@@ -731,7 +681,6 @@ speed_main(int argc, char **argv)
731 doit[D_CBC_256_CML] = 1; 681 doit[D_CBC_256_CML] = 1;
732 else 682 else
733#endif 683#endif
734#ifndef OPENSSL_NO_RSA
735#if 0 /* was: #ifdef RSAref */ 684#if 0 /* was: #ifdef RSAref */
736 if (strcmp(*argv, "rsaref") == 0) { 685 if (strcmp(*argv, "rsaref") == 0) {
737 RSA_set_default_openssl_method(RSA_PKCS1_RSAref()); 686 RSA_set_default_openssl_method(RSA_PKCS1_RSAref());
@@ -744,7 +693,6 @@ speed_main(int argc, char **argv)
744 j--; 693 j--;
745 } else 694 } else
746#endif 695#endif
747#endif /* !OPENSSL_NO_RSA */
748 if (strcmp(*argv, "dsa512") == 0) 696 if (strcmp(*argv, "dsa512") == 0)
749 dsa_doit[R_DSA_512] = 2; 697 dsa_doit[R_DSA_512] = 2;
750 else if (strcmp(*argv, "dsa1024") == 0) 698 else if (strcmp(*argv, "dsa1024") == 0)
@@ -821,22 +769,17 @@ speed_main(int argc, char **argv)
821 doit[D_CBC_256_CML] = 1; 769 doit[D_CBC_256_CML] = 1;
822 } else 770 } else
823#endif 771#endif
824#ifndef OPENSSL_NO_RSA
825 if (strcmp(*argv, "rsa") == 0) { 772 if (strcmp(*argv, "rsa") == 0) {
826 rsa_doit[R_RSA_512] = 1; 773 rsa_doit[R_RSA_512] = 1;
827 rsa_doit[R_RSA_1024] = 1; 774 rsa_doit[R_RSA_1024] = 1;
828 rsa_doit[R_RSA_2048] = 1; 775 rsa_doit[R_RSA_2048] = 1;
829 rsa_doit[R_RSA_4096] = 1; 776 rsa_doit[R_RSA_4096] = 1;
830 } else 777 } else
831#endif
832#ifndef OPENSSL_NO_DSA
833 if (strcmp(*argv, "dsa") == 0) { 778 if (strcmp(*argv, "dsa") == 0) {
834 dsa_doit[R_DSA_512] = 1; 779 dsa_doit[R_DSA_512] = 1;
835 dsa_doit[R_DSA_1024] = 1; 780 dsa_doit[R_DSA_1024] = 1;
836 dsa_doit[R_DSA_2048] = 1; 781 dsa_doit[R_DSA_2048] = 1;
837 } else 782 } else
838#endif
839#ifndef OPENSSL_NO_ECDSA
840 if (strcmp(*argv, "ecdsap160") == 0) 783 if (strcmp(*argv, "ecdsap160") == 0)
841 ecdsa_doit[R_EC_P160] = 2; 784 ecdsa_doit[R_EC_P160] = 2;
842 else if (strcmp(*argv, "ecdsap192") == 0) 785 else if (strcmp(*argv, "ecdsap192") == 0)
@@ -873,8 +816,6 @@ speed_main(int argc, char **argv)
873 for (i = 0; i < EC_NUM; i++) 816 for (i = 0; i < EC_NUM; i++)
874 ecdsa_doit[i] = 1; 817 ecdsa_doit[i] = 1;
875 } else 818 } else
876#endif
877#ifndef OPENSSL_NO_ECDH
878 if (strcmp(*argv, "ecdhp160") == 0) 819 if (strcmp(*argv, "ecdhp160") == 0)
879 ecdh_doit[R_EC_P160] = 2; 820 ecdh_doit[R_EC_P160] = 2;
880 else if (strcmp(*argv, "ecdhp192") == 0) 821 else if (strcmp(*argv, "ecdhp192") == 0)
@@ -911,7 +852,6 @@ speed_main(int argc, char **argv)
911 for (i = 0; i < EC_NUM; i++) 852 for (i = 0; i < EC_NUM; i++)
912 ecdh_doit[i] = 1; 853 ecdh_doit[i] = 1;
913 } else 854 } else
914#endif
915 { 855 {
916 BIO_printf(bio_err, "Error: bad option or value\n"); 856 BIO_printf(bio_err, "Error: bad option or value\n");
917 BIO_printf(bio_err, "\n"); 857 BIO_printf(bio_err, "\n");
@@ -982,25 +922,17 @@ speed_main(int argc, char **argv)
982#endif 922#endif
983 BIO_printf(bio_err, "\n"); 923 BIO_printf(bio_err, "\n");
984 924
985#ifndef OPENSSL_NO_RSA
986 BIO_printf(bio_err, "rsa512 rsa1024 rsa2048 rsa4096\n"); 925 BIO_printf(bio_err, "rsa512 rsa1024 rsa2048 rsa4096\n");
987#endif
988 926
989#ifndef OPENSSL_NO_DSA
990 BIO_printf(bio_err, "dsa512 dsa1024 dsa2048\n"); 927 BIO_printf(bio_err, "dsa512 dsa1024 dsa2048\n");
991#endif
992#ifndef OPENSSL_NO_ECDSA
993 BIO_printf(bio_err, "ecdsap160 ecdsap192 ecdsap224 ecdsap256 ecdsap384 ecdsap521\n"); 928 BIO_printf(bio_err, "ecdsap160 ecdsap192 ecdsap224 ecdsap256 ecdsap384 ecdsap521\n");
994 BIO_printf(bio_err, "ecdsak163 ecdsak233 ecdsak283 ecdsak409 ecdsak571\n"); 929 BIO_printf(bio_err, "ecdsak163 ecdsak233 ecdsak283 ecdsak409 ecdsak571\n");
995 BIO_printf(bio_err, "ecdsab163 ecdsab233 ecdsab283 ecdsab409 ecdsab571\n"); 930 BIO_printf(bio_err, "ecdsab163 ecdsab233 ecdsab283 ecdsab409 ecdsab571\n");
996 BIO_printf(bio_err, "ecdsa\n"); 931 BIO_printf(bio_err, "ecdsa\n");
997#endif
998#ifndef OPENSSL_NO_ECDH
999 BIO_printf(bio_err, "ecdhp160 ecdhp192 ecdhp224 ecdhp256 ecdhp384 ecdhp521\n"); 932 BIO_printf(bio_err, "ecdhp160 ecdhp192 ecdhp224 ecdhp256 ecdhp384 ecdhp521\n");
1000 BIO_printf(bio_err, "ecdhk163 ecdhk233 ecdhk283 ecdhk409 ecdhk571\n"); 933 BIO_printf(bio_err, "ecdhk163 ecdhk233 ecdhk283 ecdhk409 ecdhk571\n");
1001 BIO_printf(bio_err, "ecdhb163 ecdhb233 ecdhb283 ecdhb409 ecdhb571\n"); 934 BIO_printf(bio_err, "ecdhb163 ecdhb233 ecdhb283 ecdhb409 ecdhb571\n");
1002 BIO_printf(bio_err, "ecdh\n"); 935 BIO_printf(bio_err, "ecdh\n");
1003#endif
1004 936
1005#ifndef OPENSSL_NO_IDEA 937#ifndef OPENSSL_NO_IDEA
1006 BIO_printf(bio_err, "idea "); 938 BIO_printf(bio_err, "idea ");
@@ -1017,9 +949,7 @@ speed_main(int argc, char **argv)
1017#ifndef OPENSSL_NO_CAMELLIA 949#ifndef OPENSSL_NO_CAMELLIA
1018 BIO_printf(bio_err, "camellia "); 950 BIO_printf(bio_err, "camellia ");
1019#endif 951#endif
1020#ifndef OPENSSL_NO_RSA
1021 BIO_printf(bio_err, "rsa "); 952 BIO_printf(bio_err, "rsa ");
1022#endif
1023#ifndef OPENSSL_NO_BF 953#ifndef OPENSSL_NO_BF
1024 BIO_printf(bio_err, "blowfish"); 954 BIO_printf(bio_err, "blowfish");
1025#endif 955#endif
@@ -1061,14 +991,10 @@ speed_main(int argc, char **argv)
1061 rsa_doit[i] = 1; 991 rsa_doit[i] = 1;
1062 for (i = 0; i < DSA_NUM; i++) 992 for (i = 0; i < DSA_NUM; i++)
1063 dsa_doit[i] = 1; 993 dsa_doit[i] = 1;
1064#ifndef OPENSSL_NO_ECDSA
1065 for (i = 0; i < EC_NUM; i++) 994 for (i = 0; i < EC_NUM; i++)
1066 ecdsa_doit[i] = 1; 995 ecdsa_doit[i] = 1;
1067#endif
1068#ifndef OPENSSL_NO_ECDH
1069 for (i = 0; i < EC_NUM; i++) 996 for (i = 0; i < EC_NUM; i++)
1070 ecdh_doit[i] = 1; 997 ecdh_doit[i] = 1;
1071#endif
1072 } 998 }
1073 for (i = 0; i < ALGOR_NUM; i++) 999 for (i = 0; i < ALGOR_NUM; i++)
1074 if (doit[i]) 1000 if (doit[i])
@@ -1077,7 +1003,6 @@ speed_main(int argc, char **argv)
1077 if (usertime == 0 && !mr) 1003 if (usertime == 0 && !mr)
1078 BIO_printf(bio_err, "You have chosen to measure elapsed time instead of user CPU time.\n"); 1004 BIO_printf(bio_err, "You have chosen to measure elapsed time instead of user CPU time.\n");
1079 1005
1080#ifndef OPENSSL_NO_RSA
1081 for (i = 0; i < RSA_NUM; i++) { 1006 for (i = 0; i < RSA_NUM; i++) {
1082 const unsigned char *p; 1007 const unsigned char *p;
1083 1008
@@ -1097,13 +1022,10 @@ speed_main(int argc, char **argv)
1097 } 1022 }
1098#endif 1023#endif
1099 } 1024 }
1100#endif
1101 1025
1102#ifndef OPENSSL_NO_DSA
1103 dsa_key[0] = get_dsa512(); 1026 dsa_key[0] = get_dsa512();
1104 dsa_key[1] = get_dsa1024(); 1027 dsa_key[1] = get_dsa1024();
1105 dsa_key[2] = get_dsa2048(); 1028 dsa_key[2] = get_dsa2048();
1106#endif
1107 1029
1108#ifndef OPENSSL_NO_DES 1030#ifndef OPENSSL_NO_DES
1109 DES_set_key_unchecked(&key, &sch); 1031 DES_set_key_unchecked(&key, &sch);
@@ -1138,9 +1060,7 @@ speed_main(int argc, char **argv)
1138#ifndef OPENSSL_NO_CAST 1060#ifndef OPENSSL_NO_CAST
1139 CAST_set_key(&cast_ks, 16, key16); 1061 CAST_set_key(&cast_ks, 16, key16);
1140#endif 1062#endif
1141#ifndef OPENSSL_NO_RSA
1142 memset(rsa_c, 0, sizeof(rsa_c)); 1063 memset(rsa_c, 0, sizeof(rsa_c));
1143#endif
1144#define COND(c) (run && count<0x7fffffff) 1064#define COND(c) (run && count<0x7fffffff)
1145#define COUNT(d) (count) 1065#define COUNT(d) (count)
1146 signal(SIGALRM, sig_done); 1066 signal(SIGALRM, sig_done);
@@ -1555,7 +1475,6 @@ speed_main(int argc, char **argv)
1555 } 1475 }
1556 } 1476 }
1557 RAND_pseudo_bytes(buf, 36); 1477 RAND_pseudo_bytes(buf, 36);
1558#ifndef OPENSSL_NO_RSA
1559 for (j = 0; j < RSA_NUM; j++) { 1478 for (j = 0; j < RSA_NUM; j++) {
1560 int ret; 1479 int ret;
1561 if (!rsa_doit[j]) 1480 if (!rsa_doit[j])
@@ -1626,10 +1545,8 @@ speed_main(int argc, char **argv)
1626 rsa_doit[j] = 0; 1545 rsa_doit[j] = 0;
1627 } 1546 }
1628 } 1547 }
1629#endif
1630 1548
1631 RAND_pseudo_bytes(buf, 20); 1549 RAND_pseudo_bytes(buf, 20);
1632#ifndef OPENSSL_NO_DSA
1633 for (j = 0; j < DSA_NUM; j++) { 1550 for (j = 0; j < DSA_NUM; j++) {
1634 unsigned int kk; 1551 unsigned int kk;
1635 int ret; 1552 int ret;
@@ -1703,9 +1620,7 @@ speed_main(int argc, char **argv)
1703 dsa_doit[j] = 0; 1620 dsa_doit[j] = 0;
1704 } 1621 }
1705 } 1622 }
1706#endif
1707 1623
1708#ifndef OPENSSL_NO_ECDSA
1709 for (j = 0; j < EC_NUM; j++) { 1624 for (j = 0; j < EC_NUM; j++) {
1710 int ret; 1625 int ret;
1711 1626
@@ -1792,9 +1707,7 @@ speed_main(int argc, char **argv)
1792 } 1707 }
1793 } 1708 }
1794 } 1709 }
1795#endif
1796 1710
1797#ifndef OPENSSL_NO_ECDH
1798 for (j = 0; j < EC_NUM; j++) { 1711 for (j = 0; j < EC_NUM; j++) {
1799 if (!ecdh_doit[j]) 1712 if (!ecdh_doit[j])
1800 continue; 1713 continue;
@@ -1877,7 +1790,6 @@ speed_main(int argc, char **argv)
1877 ecdh_doit[j] = 0; 1790 ecdh_doit[j] = 0;
1878 } 1791 }
1879 } 1792 }
1880#endif
1881show_res: 1793show_res:
1882 if (!mr) { 1794 if (!mr) {
1883 fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_VERSION)); 1795 fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_VERSION));
@@ -1927,7 +1839,6 @@ show_res:
1927 } 1839 }
1928 fprintf(stdout, "\n"); 1840 fprintf(stdout, "\n");
1929 } 1841 }
1930#ifndef OPENSSL_NO_RSA
1931 j = 1; 1842 j = 1;
1932 for (k = 0; k < RSA_NUM; k++) { 1843 for (k = 0; k < RSA_NUM; k++) {
1933 if (!rsa_doit[k]) 1844 if (!rsa_doit[k])
@@ -1945,8 +1856,6 @@ show_res:
1945 rsa_bits[k], rsa_results[k][0], rsa_results[k][1], 1856 rsa_bits[k], rsa_results[k][0], rsa_results[k][1],
1946 1.0 / rsa_results[k][0], 1.0 / rsa_results[k][1]); 1857 1.0 / rsa_results[k][0], 1.0 / rsa_results[k][1]);
1947 } 1858 }
1948#endif
1949#ifndef OPENSSL_NO_DSA
1950 j = 1; 1859 j = 1;
1951 for (k = 0; k < DSA_NUM; k++) { 1860 for (k = 0; k < DSA_NUM; k++) {
1952 if (!dsa_doit[k]) 1861 if (!dsa_doit[k])
@@ -1963,8 +1872,6 @@ show_res:
1963 dsa_bits[k], dsa_results[k][0], dsa_results[k][1], 1872 dsa_bits[k], dsa_results[k][0], dsa_results[k][1],
1964 1.0 / dsa_results[k][0], 1.0 / dsa_results[k][1]); 1873 1.0 / dsa_results[k][0], 1.0 / dsa_results[k][1]);
1965 } 1874 }
1966#endif
1967#ifndef OPENSSL_NO_ECDSA
1968 j = 1; 1875 j = 1;
1969 for (k = 0; k < EC_NUM; k++) { 1876 for (k = 0; k < EC_NUM; k++) {
1970 if (!ecdsa_doit[k]) 1877 if (!ecdsa_doit[k])
@@ -1985,10 +1892,8 @@ show_res:
1985 ecdsa_results[k][0], ecdsa_results[k][1], 1892 ecdsa_results[k][0], ecdsa_results[k][1],
1986 1.0 / ecdsa_results[k][0], 1.0 / ecdsa_results[k][1]); 1893 1.0 / ecdsa_results[k][0], 1.0 / ecdsa_results[k][1]);
1987 } 1894 }
1988#endif
1989 1895
1990 1896
1991#ifndef OPENSSL_NO_ECDH
1992 j = 1; 1897 j = 1;
1993 for (k = 0; k < EC_NUM; k++) { 1898 for (k = 0; k < EC_NUM; k++) {
1994 if (!ecdh_doit[k]) 1899 if (!ecdh_doit[k])
@@ -2008,7 +1913,6 @@ show_res:
2008 test_curves_names[k], 1913 test_curves_names[k],
2009 ecdh_results[k][0], 1.0 / ecdh_results[k][0]); 1914 ecdh_results[k][0], 1.0 / ecdh_results[k][0]);
2010 } 1915 }
2011#endif
2012 1916
2013 mret = 0; 1917 mret = 0;
2014 1918
@@ -2016,30 +1920,22 @@ end:
2016 ERR_print_errors(bio_err); 1920 ERR_print_errors(bio_err);
2017 free(buf); 1921 free(buf);
2018 free(buf2); 1922 free(buf2);
2019#ifndef OPENSSL_NO_RSA
2020 for (i = 0; i < RSA_NUM; i++) 1923 for (i = 0; i < RSA_NUM; i++)
2021 if (rsa_key[i] != NULL) 1924 if (rsa_key[i] != NULL)
2022 RSA_free(rsa_key[i]); 1925 RSA_free(rsa_key[i]);
2023#endif
2024#ifndef OPENSSL_NO_DSA
2025 for (i = 0; i < DSA_NUM; i++) 1926 for (i = 0; i < DSA_NUM; i++)
2026 if (dsa_key[i] != NULL) 1927 if (dsa_key[i] != NULL)
2027 DSA_free(dsa_key[i]); 1928 DSA_free(dsa_key[i]);
2028#endif
2029 1929
2030#ifndef OPENSSL_NO_ECDSA
2031 for (i = 0; i < EC_NUM; i++) 1930 for (i = 0; i < EC_NUM; i++)
2032 if (ecdsa[i] != NULL) 1931 if (ecdsa[i] != NULL)
2033 EC_KEY_free(ecdsa[i]); 1932 EC_KEY_free(ecdsa[i]);
2034#endif
2035#ifndef OPENSSL_NO_ECDH
2036 for (i = 0; i < EC_NUM; i++) { 1933 for (i = 0; i < EC_NUM; i++) {
2037 if (ecdh_a[i] != NULL) 1934 if (ecdh_a[i] != NULL)
2038 EC_KEY_free(ecdh_a[i]); 1935 EC_KEY_free(ecdh_a[i]);
2039 if (ecdh_b[i] != NULL) 1936 if (ecdh_b[i] != NULL)
2040 EC_KEY_free(ecdh_b[i]); 1937 EC_KEY_free(ecdh_b[i]);
2041 } 1938 }
2042#endif
2043 1939
2044 1940
2045 return (mret); 1941 return (mret);
@@ -2204,7 +2100,6 @@ do_multi(int multi)
2204 else 2100 else
2205 rsa_results[k][1] = d; 2101 rsa_results[k][1] = d;
2206 } 2102 }
2207#ifndef OPENSSL_NO_DSA
2208 else if (!strncmp(buf, "+F3:", 4)) { 2103 else if (!strncmp(buf, "+F3:", 4)) {
2209 int k; 2104 int k;
2210 double d; 2105 double d;
@@ -2226,8 +2121,6 @@ do_multi(int multi)
2226 else 2121 else
2227 dsa_results[k][1] = d; 2122 dsa_results[k][1] = d;
2228 } 2123 }
2229#endif
2230#ifndef OPENSSL_NO_ECDSA
2231 else if (!strncmp(buf, "+F4:", 4)) { 2124 else if (!strncmp(buf, "+F4:", 4)) {
2232 int k; 2125 int k;
2233 double d; 2126 double d;
@@ -2249,9 +2142,7 @@ do_multi(int multi)
2249 else 2142 else
2250 ecdsa_results[k][1] = d; 2143 ecdsa_results[k][1] = d;
2251 } 2144 }
2252#endif
2253 2145
2254#ifndef OPENSSL_NO_ECDH
2255 else if (!strncmp(buf, "+F5:", 4)) { 2146 else if (!strncmp(buf, "+F5:", 4)) {
2256 int k; 2147 int k;
2257 double d; 2148 double d;
@@ -2268,7 +2159,6 @@ do_multi(int multi)
2268 ecdh_results[k][0] = d; 2159 ecdh_results[k][0] = d;
2269 2160
2270 } 2161 }
2271#endif
2272 2162
2273 else if (!strncmp(buf, "+H:", 3)) { 2163 else if (!strncmp(buf, "+H:", 3)) {
2274 } else 2164 } else
diff --git a/src/lib/libssl/src/apps/x509.c b/src/lib/libssl/src/apps/x509.c
index 4f86a1bb53..e6b33c7a19 100644
--- a/src/lib/libssl/src/apps/x509.c
+++ b/src/lib/libssl/src/apps/x509.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.c,v 1.46 2014/06/28 04:39:41 deraadt Exp $ */ 1/* $OpenBSD: x509.c,v 1.47 2014/07/09 21:02:35 tedu Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -74,13 +74,9 @@
74#include <openssl/x509.h> 74#include <openssl/x509.h>
75#include <openssl/x509v3.h> 75#include <openssl/x509v3.h>
76 76
77#ifndef OPENSSL_NO_DSA
78#include <openssl/dsa.h> 77#include <openssl/dsa.h>
79#endif
80 78
81#ifndef OPENSSL_NO_RSA
82#include <openssl/rsa.h> 79#include <openssl/rsa.h>
83#endif
84 80
85#define POSTFIX ".srl" 81#define POSTFIX ".srl"
86#define DEF_DAYS 30 82#define DEF_DAYS 30
@@ -713,16 +709,12 @@ bad:
713 goto end; 709 goto end;
714 } 710 }
715 BIO_printf(STDout, "Modulus="); 711 BIO_printf(STDout, "Modulus=");
716#ifndef OPENSSL_NO_RSA
717 if (pkey->type == EVP_PKEY_RSA) 712 if (pkey->type == EVP_PKEY_RSA)
718 BN_print(STDout, pkey->pkey.rsa->n); 713 BN_print(STDout, pkey->pkey.rsa->n);
719 else 714 else
720#endif
721#ifndef OPENSSL_NO_DSA
722 if (pkey->type == EVP_PKEY_DSA) 715 if (pkey->type == EVP_PKEY_DSA)
723 BN_print(STDout, pkey->pkey.dsa->pub_key); 716 BN_print(STDout, pkey->pkey.dsa->pub_key);
724 else 717 else
725#endif
726 BIO_printf(STDout, "Wrong Algorithm type"); 718 BIO_printf(STDout, "Wrong Algorithm type");
727 BIO_printf(STDout, "\n"); 719 BIO_printf(STDout, "\n");
728 EVP_PKEY_free(pkey); 720 EVP_PKEY_free(pkey);