diff options
author | Richard Levitte <levitte@openssl.org> | 2018-12-13 12:04:26 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-03-06 11:15:14 +0100 |
commit | 5f8a5f46e4e83735bb5ad384d8d7df771d2aa4b3 (patch) | |
tree | 2411a052e62aacfd69981478453cc3c5f901da4d /crypto/pkcs12/p12_decr.c | |
parent | b9ce85f631cf376cd781fd3dfdc80e927d88ee77 (diff) | |
download | openssl-5f8a5f46e4e83735bb5ad384d8d7df771d2aa4b3.tar.gz |
Adapt OPENSSL_DEBUG_DECRYPT to the new generic trace API
Co-authored-by: Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8198)
Diffstat (limited to 'crypto/pkcs12/p12_decr.c')
-rw-r--r-- | crypto/pkcs12/p12_decr.c | 23 |
1 files changed, 6 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); |