File tree Expand file tree Collapse file tree 5 files changed +33
-1
lines changed Expand file tree Collapse file tree 5 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 1111 --disable-dilithium
1212 --enable-aes-bitsliced
1313 --enable-curve25519
14+ --enable-debug
1415 --enable-dtls
1516 --enable-dtls13
1617 --enable-dtls-frag-ch
Original file line number Diff line number Diff line change @@ -66,7 +66,9 @@ build() {
6666 --enable-aes-bitsliced \
6767 --enable-experimental \
6868 --enable-sha3 \
69- --enable-kyber=all,original,ml-kem
69+ --enable-kyber=all,original,ml-kem \
70+ --enable-debug
71+
7072 make clean
7173 mkdir -p " ${EXEC_PREFIX} "
7274 make V=1 -j" ${MAKE_JOBS} " --debug=j
Original file line number Diff line number Diff line change @@ -644,6 +644,14 @@ he_return_code_t he_init(void);
644644 */
645645he_return_code_t he_cleanup (void );
646646
647+ typedef void (* he_log_cb_t )(const int log_level , const char * const log_msg );
648+
649+ /**
650+ * @brief Enable WolfSSL debug logging and set the log callback
651+ * @return HE_SUCCESS on success, HE_ERR_FAILED on any error.
652+ */
653+ he_return_code_t he_enable_debugging (he_log_cb_t log_cb );
654+
647655/**
648656 * @brief Checks whether the client context has the basic configuration to allow Helium to connect.
649657 * @param ctx A pointer to a valid SSL context configuration
Original file line number Diff line number Diff line change @@ -52,6 +52,19 @@ he_return_code_t he_cleanup() {
5252 return HE_SUCCESS ;
5353}
5454
55+ he_return_code_t he_enable_debugging (he_log_cb_t log_cb ) {
56+ int rc = wolfSSL_Debugging_ON ();
57+ if (rc ) {
58+ return HE_ERR_FAILED ;
59+ }
60+ if (log_cb ) {
61+ if (wolfSSL_SetLoggingCb (log_cb )) {
62+ return HE_ERR_FAILED ;
63+ }
64+ };
65+ return HE_SUCCESS ;
66+ }
67+
5568static he_return_code_t he_ssl_ctx_is_valid_common (he_ssl_ctx_t * ctx ) {
5669 if (!ctx ) {
5770 return HE_ERR_NULL_POINTER ;
Original file line number Diff line number Diff line change @@ -55,6 +55,14 @@ he_return_code_t he_init(void);
5555 */
5656he_return_code_t he_cleanup (void );
5757
58+ typedef void (* he_log_cb_t )(const int log_level , const char * const log_msg );
59+
60+ /**
61+ * @brief Enable WolfSSL debug logging and set the log callback
62+ * @return HE_SUCCESS on success, HE_ERR_FAILED on any error.
63+ */
64+ he_return_code_t he_enable_debugging (he_log_cb_t log_cb );
65+
5866/**
5967 * @brief Checks whether the client context has the basic configuration to allow Helium to connect.
6068 * @param ctx A pointer to a valid SSL context configuration
You can’t perform that action at this time.
0 commit comments