diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-07-10 10:01:24 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-07-10 10:01:24 +0000 |
commit | fd61a946b3b8381364c25e651d7382fdba3661b0 (patch) | |
tree | 62b83d3a03c5d4d6814f7f2bb2b0477f36a38433 /lib/libssl | |
parent | 3f828d05360a3ebc953b98fac603d0a93911db4a (diff) |
Remove DEBUG_KEYGEN and DEBUG_DECRYPT support.
Diffstat (limited to 'lib/libssl')
-rw-r--r-- | lib/libssl/src/crypto/pkcs12/p12_decr.c | 17 | ||||
-rw-r--r-- | lib/libssl/src/crypto/pkcs12/p12_key.c | 34 |
2 files changed, 2 insertions, 49 deletions
diff --git a/lib/libssl/src/crypto/pkcs12/p12_decr.c b/lib/libssl/src/crypto/pkcs12/p12_decr.c index 577bb06f806..c06f580de22 100644 --- a/lib/libssl/src/crypto/pkcs12/p12_decr.c +++ b/lib/libssl/src/crypto/pkcs12/p12_decr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_decr.c,v 1.11 2014/07/08 09:24:53 jsing Exp $ */ +/* $OpenBSD: p12_decr.c,v 1.12 2014/07/10 10:01:23 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -60,9 +60,6 @@ #include "cryptlib.h" #include <openssl/pkcs12.h> -/* Define this to dump decrypted output to files called DERnnn */ -/*#define DEBUG_DECRYPT*/ - /* Encrypt/Decrypt a buffer based on password and algor, result in a * malloc'ed buffer @@ -137,18 +134,6 @@ PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, return NULL; } p = out; -#ifdef DEBUG_DECRYPT - { - FILE *op; - - char fname[30]; - static int fnm = 1; - sprintf(fname, "DER%d", fnm++); - op = fopen(fname, "wb"); - fwrite (p, 1, outlen, op); - fclose(op); - } -#endif ret = ASN1_item_d2i(NULL, &p, outlen, it); if (zbuf) OPENSSL_cleanse(out, outlen); diff --git a/lib/libssl/src/crypto/pkcs12/p12_key.c b/lib/libssl/src/crypto/pkcs12/p12_key.c index ffa736a04fa..a2f7db82679 100644 --- a/lib/libssl/src/crypto/pkcs12/p12_key.c +++ b/lib/libssl/src/crypto/pkcs12/p12_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_key.c,v 1.16 2014/07/08 09:24:53 jsing Exp $ */ +/* $OpenBSD: p12_key.c,v 1.17 2014/07/10 10:01:23 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -61,14 +61,6 @@ #include <openssl/pkcs12.h> #include <openssl/bn.h> -/* Uncomment out this line to get debugging info about key generation */ -/*#define DEBUG_KEYGEN*/ -#ifdef DEBUG_KEYGEN -#include <openssl/bio.h> -extern BIO *bio_err; -void h__dump (unsigned char *p, int len); -#endif - /* PKCS12 compatible key/IV generation */ #ifndef min #define min(a,b) ((a) < (b) ? (a) : (b)) @@ -112,10 +104,6 @@ PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, int ret = 0; BIGNUM *Ij, *Bpl1; /* These hold Ij and B + 1 */ EVP_MD_CTX ctx; -#ifdef DEBUG_KEYGEN - unsigned char *tmpout = out; - int tmpn = n; -#endif #if 0 if (!pass) { @@ -125,14 +113,6 @@ PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, #endif EVP_MD_CTX_init(&ctx); -#ifdef DEBUG_KEYGEN - fprintf(stderr, "KEYGEN DEBUG\n"); - fprintf(stderr, "ID %d, ITER %d\n", id, iter); - fprintf(stderr, "Password (length %d):\n", passlen); - h__dump(pass, passlen); - fprintf(stderr, "Salt (length %d):\n", saltlen); - h__dump(salt, saltlen); -#endif v = EVP_MD_block_size(md_type); u = EVP_MD_size(md_type); if (u < 0) @@ -172,10 +152,6 @@ PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, } memcpy (out, Ai, min (n, u)); if (u >= n) { -#ifdef DEBUG_KEYGEN - fprintf(stderr, "Output KEY (length %d)\n", tmpn); - h__dump(tmpout, tmpn); -#endif ret = 1; goto end; } @@ -226,11 +202,3 @@ end: EVP_MD_CTX_cleanup(&ctx); return ret; } -#ifdef DEBUG_KEYGEN -void h__dump (unsigned char *p, int len) -{ - for (; len --; p++) - fprintf(stderr, "%02X", *p); - fprintf(stderr, "\n"); -} -#endif |