Skip to content

Commit 958c8e8

Browse files
committed
Fix debug_level for UTIL_CTX_log()
1 parent 1a780a0 commit 958c8e8

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/eng_back.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ EVP_PKEY *ENGINE_CTX_load_privkey(ENGINE_CTX *ctx, const char *s_key_id,
235235
static int ENGINE_CTX_ctrl_set_debug_level(ENGINE_CTX *ctx, int level)
236236
{
237237
ctx->debug_level = level;
238+
UTIL_CTX_set_debug_level(ctx->util_ctx, level);
238239
return 1;
239240
}
240241

src/util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ int UTIL_CTX_init_libp11(UTIL_CTX *ctx);
6363
int UTIL_CTX_free_libp11(UTIL_CTX *ctx);
6464

6565
void UTIL_CTX_set_vlog_a(UTIL_CTX *ctx, PKCS11_VLOG_A_CB vlog);
66+
void UTIL_CTX_set_debug_level(UTIL_CTX *ctx, int debug_level);
6667
void UTIL_CTX_log(UTIL_CTX *ctx, int level, const char *format, ...);
6768

6869
int UTIL_CTX_set_pin(UTIL_CTX *ctx, const char *pin);

src/util_uri.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ void UTIL_CTX_set_vlog_a(UTIL_CTX *ctx, PKCS11_VLOG_A_CB vlog)
191191
PKCS11_set_vlog_a_method(ctx->pkcs11_ctx, vlog); /* update */
192192
}
193193

194+
void UTIL_CTX_set_debug_level(UTIL_CTX *ctx, int debug_level)
195+
{
196+
ctx->debug_level = debug_level;
197+
}
198+
194199
void UTIL_CTX_log(UTIL_CTX *ctx, int level, const char *format, ...)
195200
{
196201
va_list args;
@@ -382,9 +387,8 @@ static int UTIL_CTX_get_pin(UTIL_CTX *ctx, const char *token_label)
382387
memset(ctx->pin, 0, MAX_PIN_LENGTH+1);
383388
ctx->pin_length = MAX_PIN_LENGTH;
384389
prompt = UI_construct_prompt(ui, "PKCS#11 token PIN", token_label);
385-
if (!prompt) {
390+
if (!prompt)
386391
return 0;
387-
}
388392
if (UI_dup_input_string(ui, prompt,
389393
UI_INPUT_FLAG_DEFAULT_PWD, ctx->pin, 4, MAX_PIN_LENGTH) <= 0) {
390394
UTIL_CTX_log(ctx, LOG_ERR, "UI_dup_input_string failed\n");

0 commit comments

Comments
 (0)