summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp
diff options
context:
space:
mode:
authordoug <>2015-02-07 13:19:15 +0000
committerdoug <>2015-02-07 13:19:15 +0000
commitbd790e322a40e6362231f517d5795d4079eeb2a2 (patch)
tree1f11c8eab9ee5f3f265f1010c299c7fd574d9cdf /src/lib/libcrypto/evp
parentff826d3cb94a579275eb6e97b3cf80ca69016d4b (diff)
downloadopenbsd-bd790e322a40e6362231f517d5795d4079eeb2a2.tar.gz
openbsd-bd790e322a40e6362231f517d5795d4079eeb2a2.tar.bz2
openbsd-bd790e322a40e6362231f517d5795d4079eeb2a2.zip
Delete a lot of #if 0 code in libressl.
There are a few instances where #if 1 is removed but the code remains. Based on the following OpenSSL commits. Some of the commits weren't strictly deletions so they are going to be split up into separate commits. 6f91b017bbb7140f816721141ac156d1b828a6b3 3d47c1d331fdc7574d2275cda1a630ccdb624b08 dfb56425b68314b2b57e17c82c1df42e7a015132 c8fa2356a00cbaada8963f739e5570298311a060 f16a64d11f55c01f56baa62ebf1dec7f8fe718cb 9ccc00ef6ea65567622e40c49aca43f2c6d79cdb 02a938c953b3e1ced71d9a832de1618f907eb96d 75d0ebef2aef7a2c77b27575b8da898e22f3ccd5 d6fbb194095312f4722c81c9362dbd0de66cb656 6f1a93ad111c7dfe36a09a976c4c009079b19ea1 1a5adcfb5edfe23908b350f8757df405b0f5f71f 8de24b792743d11e1d5a0dcd336a49368750c577 a2b18e657ea1a932d125154f4e13ab2258796d90 8e964419603d2478dfb391c66e7ccb2dcc9776b4 32dfde107636ac9bc62a5b3233fe2a54dbc27008 input + ok jsing@, miod@, tedu@
Diffstat (limited to 'src/lib/libcrypto/evp')
-rw-r--r--src/lib/libcrypto/evp/bio_b64.c6
-rw-r--r--src/lib/libcrypto/evp/encode.c35
-rw-r--r--src/lib/libcrypto/evp/evp.h6
-rw-r--r--src/lib/libcrypto/evp/p_sign.c17
4 files changed, 4 insertions, 60 deletions
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c
index 53b8bcf615..b54e8793ec 100644
--- a/src/lib/libcrypto/evp/bio_b64.c
+++ b/src/lib/libcrypto/evp/bio_b64.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_b64.c,v 1.19 2014/07/11 12:04:46 miod Exp $ */ 1/* $OpenBSD: bio_b64.c,v 1.20 2015/02/07 13:19:15 doug 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 *
@@ -293,11 +293,7 @@ b64_read(BIO *b, char *out, int outl)
293 if (BIO_get_flags(b) & BIO_FLAGS_BASE64_NO_NL) { 293 if (BIO_get_flags(b) & BIO_FLAGS_BASE64_NO_NL) {
294 int z, jj; 294 int z, jj;
295 295
296#if 0
297 jj = (i >> 2) << 2;
298#else
299 jj = i & ~3; /* process per 4 */ 296 jj = i & ~3; /* process per 4 */
300#endif
301 z = EVP_DecodeBlock((unsigned char *)ctx->buf, 297 z = EVP_DecodeBlock((unsigned char *)ctx->buf,
302 (unsigned char *)ctx->tmp, jj); 298 (unsigned char *)ctx->tmp, jj);
303 if (jj > 2) { 299 if (jj > 2) {
diff --git a/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c
index 067e62dfe9..725667bfff 100644
--- a/src/lib/libcrypto/evp/encode.c
+++ b/src/lib/libcrypto/evp/encode.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: encode.c,v 1.19 2014/08/06 16:01:44 jsing Exp $ */ 1/* $OpenBSD: encode.c,v 1.20 2015/02/07 13:19:15 doug 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 *
@@ -415,36 +415,3 @@ EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl)
415 } else 415 } else
416 return (1); 416 return (1);
417} 417}
418
419#ifdef undef
420int
421EVP_DecodeValid(unsigned char *buf, int len)
422{
423 int i, num = 0, bad = 0;
424
425 if (len == 0)
426 return (-1);
427 while (conv_ascii2bin(*buf) == B64_WS) {
428 buf++;
429 len--;
430 if (len == 0)
431 return (-1);
432 }
433
434 for (i = len; i >= 4; i -= 4) {
435 if ((conv_ascii2bin(buf[0]) >= 0x40) ||
436 (conv_ascii2bin(buf[1]) >= 0x40) ||
437 (conv_ascii2bin(buf[2]) >= 0x40) ||
438 (conv_ascii2bin(buf[3]) >= 0x40))
439 return (-1);
440 buf += 4;
441 num += 1 + (buf[2] != '=') + (buf[3] != '=');
442 }
443 if ((i == 1) && (conv_ascii2bin(buf[0]) == B64_EOLN))
444 return (num);
445 if ((i == 2) && (conv_ascii2bin(buf[0]) == B64_EOLN) &&
446 (conv_ascii2bin(buf[0]) == B64_EOLN))
447 return (num);
448 return (1);
449}
450#endif
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h
index 6c1bf6c7cd..107119883a 100644
--- a/src/lib/libcrypto/evp/evp.h
+++ b/src/lib/libcrypto/evp/evp.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp.h,v 1.40 2014/11/09 19:17:13 miod Exp $ */ 1/* $OpenBSD: evp.h,v 1.41 2015/02/07 13:19:15 doug 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 *
@@ -701,10 +701,6 @@ const EVP_CIPHER *EVP_des_cfb1(void);
701const EVP_CIPHER *EVP_des_cfb8(void); 701const EVP_CIPHER *EVP_des_cfb8(void);
702const EVP_CIPHER *EVP_des_ede_cfb64(void); 702const EVP_CIPHER *EVP_des_ede_cfb64(void);
703# define EVP_des_ede_cfb EVP_des_ede_cfb64 703# define EVP_des_ede_cfb EVP_des_ede_cfb64
704#if 0
705const EVP_CIPHER *EVP_des_ede_cfb1(void);
706const EVP_CIPHER *EVP_des_ede_cfb8(void);
707#endif
708const EVP_CIPHER *EVP_des_ede3_cfb64(void); 704const EVP_CIPHER *EVP_des_ede3_cfb64(void);
709# define EVP_des_ede3_cfb EVP_des_ede3_cfb64 705# define EVP_des_ede3_cfb EVP_des_ede3_cfb64
710const EVP_CIPHER *EVP_des_ede3_cfb1(void); 706const EVP_CIPHER *EVP_des_ede3_cfb1(void);
diff --git a/src/lib/libcrypto/evp/p_sign.c b/src/lib/libcrypto/evp/p_sign.c
index f68a950c9c..4058d47f07 100644
--- a/src/lib/libcrypto/evp/p_sign.c
+++ b/src/lib/libcrypto/evp/p_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_sign.c,v 1.12 2014/07/11 08:44:48 jsing Exp $ */ 1/* $OpenBSD: p_sign.c,v 1.13 2015/02/07 13:19:15 doug 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 *
@@ -63,21 +63,6 @@
63#include <openssl/objects.h> 63#include <openssl/objects.h>
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65 65
66#ifdef undef
67void
68EVP_SignInit(EVP_MD_CTX *ctx, EVP_MD *type)
69{
70 EVP_DigestInit_ex(ctx, type);
71}
72
73void
74EVP_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data,
75 unsigned int count)
76{
77 EVP_DigestUpdate(ctx, data, count);
78}
79#endif
80
81int 66int
82EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, 67EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
83 EVP_PKEY *pkey) 68 EVP_PKEY *pkey)