Skip to content

Commit d402547

Browse files
author
Andras Fekete
committed
Add more logging of calls
1 parent 18d845c commit d402547

11 files changed

Lines changed: 23 additions & 0 deletions

src/wp_aes_aead.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ static int wp_aead_set_param_tls1_iv_rand(wp_AeadCtx* ctx,
603603
#else
604604
(void)ctx;
605605
(void)params;
606+
WOLFPROV_LEAVE(WP_LOG_CIPHER, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
606607
return 1;
607608
#endif
608609
}

src/wp_aes_stream.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ static int wp_aes_stream_final(wp_AesStreamCtx* ctx, unsigned char *out,
450450
(void)out;
451451
(void)outSize;
452452
*outLen = 0;
453+
WOLFPROV_LEAVE(WP_LOG_CIPHER, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
453454
return 1;
454455
}
455456

src/wp_dh_kmgmt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ int wp_dh_up_ref(wp_Dh* dh)
276276
return ok;
277277
#else
278278
dh->refCnt++;
279+
WOLFPROV_LEAVE(WP_LOG_KE, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
279280
return 1;
280281
#endif
281282
}

src/wp_drbg.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ static int wp_drbg_uninstantiate(wp_DrbgCtx* ctx)
166166
OPENSSL_clear_free(ctx->rng, sizeof(*ctx->rng));
167167
#endif
168168
ctx->rng = NULL;
169+
WOLFPROV_LEAVE(WP_LOG_RNG, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
169170
return 1;
170171
}
171172

@@ -331,6 +332,7 @@ static int wp_drbg_unlock(wp_DrbgCtx* ctx)
331332
wc_UnLockMutex(ctx->mutex);
332333
}
333334
#endif
335+
WOLFPROV_LEAVE(WP_LOG_RNG, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
334336
return 1;
335337
}
336338

@@ -419,6 +421,7 @@ static int wp_drbg_set_ctx_params(wp_DrbgCtx* ctx, const OSSL_PARAM params[])
419421
{
420422
(void)ctx;
421423
(void)params;
424+
WOLFPROV_LEAVE(WP_LOG_RNG, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
422425
return 1;
423426
}
424427

@@ -431,6 +434,7 @@ static int wp_drbg_set_ctx_params(wp_DrbgCtx* ctx, const OSSL_PARAM params[])
431434
static int wp_drbg_verify_zeroization(wp_DrbgCtx* ctx)
432435
{
433436
(void)ctx;
437+
WOLFPROV_LEAVE(WP_LOG_RNG, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
434438
return 1;
435439
}
436440

src/wp_ecc_kmgmt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ int wp_ecc_up_ref(wp_Ecc* ecc)
256256
return ok;
257257
#else
258258
ecc->refCnt++;
259+
WOLFPROV_LEAVE(WP_LOG_PK, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
259260
return 1;
260261
#endif
261262
}
@@ -2113,6 +2114,7 @@ static int wp_ecc_encode_params_size(const wp_Ecc *ecc, size_t* keyLen)
21132114
/* ASN.1 type, len and data. */
21142115
*keyLen = ecc->key.dp->oidSz + 2;
21152116

2117+
WOLFPROV_LEAVE(WP_LOG_PK, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
21162118
return 1;
21172119
}
21182120

@@ -2135,6 +2137,7 @@ static int wp_ecc_encode_params(const wp_Ecc *ecc, unsigned char* keyData,
21352137

21362138
*keyLen = ecc->key.dp->oidSz + 2;
21372139

2140+
WOLFPROV_LEAVE(WP_LOG_PK, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
21382141
return 1;
21392142
}
21402143

src/wp_ecx_kmgmt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ int wp_ecx_up_ref(wp_Ecx* ecx)
224224
return ok;
225225
#else
226226
ecx->refCnt++;
227+
WOLFPROV_LEAVE(WP_LOG_PK, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
227228
return 1;
228229
#endif
229230
}

src/wp_file_store.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ static int wp_file_eof(wp_FileCtx* ctx)
480480
static int wp_file_close(wp_FileCtx* ctx)
481481
{
482482
wp_filectx_free(ctx);
483+
WOLFPROV_LEAVE(WP_LOG_PROVIDER, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
483484
return 1;
484485
}
485486

src/wp_kdf_kmgmt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ int wp_kdf_up_ref(wp_Kdf* kdf)
7171
return ok;
7272
#else
7373
kdf->refCnt++;
74+
WOLFPROV_LEAVE(WP_LOG_KDF, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
7475
return 1;
7576
#endif
7677
}
@@ -151,6 +152,7 @@ static int wp_kdf_has(const wp_Kdf* kdf, int selection)
151152
{
152153
(void)kdf;
153154
(void)selection;
155+
WOLFPROV_LEAVE(WP_LOG_KDF, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
154156
return 1;
155157
}
156158

src/wp_mac_kmgmt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ int wp_mac_up_ref(wp_Mac* mac)
108108
return ok;
109109
#else
110110
mac->refCnt++;
111+
WOLFPROV_LEAVE(WP_LOG_MAC, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
111112
return 1;
112113
#endif
113114
}
@@ -435,6 +436,7 @@ static int wp_mac_export_priv_key(wp_Mac* mac, OSSL_PARAM* params, int* pIdx,
435436
}
436437

437438
*pIdx = i;
439+
WOLFPROV_LEAVE(WP_LOG_MAC, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
438440
return 1;
439441
}
440442

src/wp_rsa_kmgmt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ int wp_rsa_up_ref(wp_Rsa* rsa)
199199
return ok;
200200
#else
201201
rsa->refCnt++;
202+
WOLFPROV_LEAVE(WP_LOG_PK, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
202203
return 1;
203204
#endif
204205
}
@@ -468,6 +469,7 @@ static int wp_rsa_pss_params_set_pss_defaults(wp_RsaPssParams* pss)
468469
pss->saltLen = 20;
469470
pss->derTrailer = 1; /* Default: RFC8017 A.2.3 */
470471

472+
WOLFPROV_LEAVE(WP_LOG_PK, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
471473
return 1;
472474
}
473475

@@ -1085,6 +1087,7 @@ static int wp_rsa_pss_params_export(wp_RsaPssParams* pss, OSSL_PARAM* params,
10851087
&pss->saltLen);
10861088

10871089
*idx = i;
1090+
WOLFPROV_LEAVE(WP_LOG_PK, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), 1);
10881091
return 1;
10891092
}
10901093

0 commit comments

Comments
 (0)