提交 7a82f778 编写于 作者: R Richard Levitte

Fix setting of debug callback in apps/enc.c

Setting the debug callback on the in and out BIOs were done too early.
No debug callback was set on the zlib filter BIO.
Reviewed-by: NTim Hudson <tjh@openssl.org>
上级 9d5ac953
...@@ -323,13 +323,6 @@ int enc_main(int argc, char **argv) ...@@ -323,13 +323,6 @@ int enc_main(int argc, char **argv)
strbuf = app_malloc(SIZE, "strbuf"); strbuf = app_malloc(SIZE, "strbuf");
buff = app_malloc(EVP_ENCODE_LENGTH(bsize), "evp buffer"); buff = app_malloc(EVP_ENCODE_LENGTH(bsize), "evp buffer");
if (debug) {
BIO_set_callback(in, BIO_debug_callback);
BIO_set_callback(out, BIO_debug_callback);
BIO_set_callback_arg(in, (char *)bio_err);
BIO_set_callback_arg(out, (char *)bio_err);
}
if (infile == NULL) { if (infile == NULL) {
unbuffer(stdin); unbuffer(stdin);
in = dup_bio_in(informat); in = dup_bio_in(informat);
...@@ -381,6 +374,13 @@ int enc_main(int argc, char **argv) ...@@ -381,6 +374,13 @@ int enc_main(int argc, char **argv)
if (out == NULL) if (out == NULL)
goto end; goto end;
if (debug) {
BIO_set_callback(in, BIO_debug_callback);
BIO_set_callback(out, BIO_debug_callback);
BIO_set_callback_arg(in, (char *)bio_err);
BIO_set_callback_arg(out, (char *)bio_err);
}
rbio = in; rbio = in;
wbio = out; wbio = out;
...@@ -388,6 +388,10 @@ int enc_main(int argc, char **argv) ...@@ -388,6 +388,10 @@ int enc_main(int argc, char **argv)
if (do_zlib) { if (do_zlib) {
if ((bzl = BIO_new(BIO_f_zlib())) == NULL) if ((bzl = BIO_new(BIO_f_zlib())) == NULL)
goto end; goto end;
if (debug) {
BIO_set_callback(bzl, BIO_debug_callback);
BIO_set_callback_arg(bzl, (char *)bio_err);
}
if (enc) if (enc)
wbio = BIO_push(bzl, wbio); wbio = BIO_push(bzl, wbio);
else else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册