summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/pkcs12/p12_decr.c23
-rw-r--r--crypto/trace.c1
2 files changed, 7 insertions, 17 deletions
diff --git a/crypto/pkcs12/p12_decr.c b/crypto/pkcs12/p12_decr.c
index 67a9305438..b9d13d9cf5 100644
--- a/crypto/pkcs12/p12_decr.c
+++ b/crypto/pkcs12/p12_decr.c
@@ -10,11 +10,7 @@
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/pkcs12.h>
-
-/* Define this to dump decrypted output to files called DERnnn */
-/*
- * #define OPENSSL_DEBUG_DECRYPT
- */
+#include <openssl/trace.h>
/*
* Encrypt/Decrypt a buffer based on password and algor, result in a
@@ -95,18 +91,11 @@ void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it,
return NULL;
}
p = out;
-#ifdef OPENSSL_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
+ OSSL_TRACE_BEGIN(PKCS12_DECRYPT) {
+ BIO_printf(trc_out, "\n");
+ BIO_dump(trc_out, out, outlen);
+ BIO_printf(trc_out, "\n");
+ } OSSL_TRACE_END(PKCS12_DECRYPT);
ret = ASN1_item_d2i(NULL, &p, outlen, it);
if (zbuf)
OPENSSL_cleanse(out, outlen);
diff --git a/crypto/trace.c b/crypto/trace.c
index 8020a58e68..3790619d0c 100644
--- a/crypto/trace.c
+++ b/crypto/trace.c
@@ -128,6 +128,7 @@ static const struct trace_category_st trace_categories[] = {
TRACE_CATEGORY_(ENGINE_REF_COUNT),
TRACE_CATEGORY_(PKCS5V2),
TRACE_CATEGORY_(PKCS12_KEYGEN),
+ TRACE_CATEGORY_(PKCS12_DECRYPT),
TRACE_CATEGORY_(X509V3_POLICY),
};