Skip to content

Commit 6f5fa85

Browse files
committed
Initial implementation of SSHKDF for wolfprovider
1 parent 2279ebf commit 6f5fa85

11 files changed

Lines changed: 937 additions & 1 deletion

File tree

include/wolfprovider/alg_funcs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ typedef void (*DFUNC)(void);
149149
#define WP_NAMES_TLS1_PRF "TLS1-PRF"
150150
#define WP_NAMES_KBKDF "KBKDF"
151151
#define WP_NAMES_KRB5KDF "KRB5KDF"
152+
#define WP_NAMES_SSHKDF "SSHKDF"
152153

153154
/* Signature names. */
154155
#define WP_NAMES_RSA "RSA:rsaEncryption:1.2.840.113549.1.1.1"
@@ -315,6 +316,7 @@ extern const OSSL_DISPATCH wp_kdf_tls1_3_kdf_functions[];
315316
extern const OSSL_DISPATCH wp_kdf_tls1_prf_functions[];
316317
extern const OSSL_DISPATCH wp_kdf_kbkdf_functions[];
317318
extern const OSSL_DISPATCH wp_kdf_krb5kdf_functions[];
319+
extern const OSSL_DISPATCH wp_kdf_sshkdf_functions[];
318320

319321
/* Signature implementations. */
320322
extern const OSSL_DISPATCH wp_rsa_signature_functions[];

include/wolfprovider/settings.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@
116116
#ifndef NO_PWDBASED
117117
#define WP_HAVE_PBE
118118
#endif
119+
#ifdef WOLFSSL_WOLFSSH
120+
#define WP_HAVE_SSHKDF
121+
#endif
119122

120123
#ifndef NO_DH
121124
#define WP_HAVE_DH

include/wolfprovider/wp_logging.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@
186186
#define WP_LOG_COMP_X448 0x4000000 /* X448 operations */
187187
#define WP_LOG_COMP_QUERY 0x8000000 /* wolfprov_query operations */
188188
#define WP_LOG_COMP_TLS1_PRF 0x10000000 /* TLS1 PRF operations */
189+
#define WP_LOG_COMP_SSHKDF 0x20000000 /* SSHKDF operations */
189190

190191
/* log all components */
191192
#define WP_LOG_COMP_ALL ( \
@@ -217,7 +218,8 @@
217218
WP_LOG_COMP_X25519 | \
218219
WP_LOG_COMP_X448 | \
219220
WP_LOG_COMP_QUERY | \
220-
WP_LOG_COMP_TLS1_PRF )
221+
WP_LOG_COMP_TLS1_PRF | \
222+
WP_LOG_COMP_SSHKDF )
221223

222224
/* default components logged */
223225
#define WP_LOG_COMP_DEFAULT WP_LOG_COMP_ALL

src/include.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ libwolfprov_la_SOURCES += src/wp_kdf_exch.c
2323
libwolfprov_la_SOURCES += src/wp_pbkdf2.c
2424
libwolfprov_la_SOURCES += src/wp_kbkdf.c
2525
libwolfprov_la_SOURCES += src/wp_krb5kdf.c
26+
libwolfprov_la_SOURCES += src/wp_sshkdf.c
2627
libwolfprov_la_SOURCES += src/wp_rsa_kmgmt.c
2728
libwolfprov_la_SOURCES += src/wp_rsa_sig.c
2829
libwolfprov_la_SOURCES += src/wp_rsa_asym.c

src/wp_logging.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ static void wolfProv_LogComponentToMask(const char* level, size_t len, void* ctx
531531
{ "WP_LOG_COMP_X448", XSTRLEN("WP_LOG_COMP_X448"), WP_LOG_COMP_X448 },
532532
{ "WP_LOG_COMP_QUERY", XSTRLEN("WP_LOG_COMP_QUERY"), WP_LOG_COMP_QUERY },
533533
{ "WP_LOG_COMP_TLS1_PRF", XSTRLEN("WP_LOG_COMP_TLS1_PRF"), WP_LOG_COMP_TLS1_PRF },
534+
{ "WP_LOG_COMP_SSHKDF", XSTRLEN("WP_LOG_COMP_SSHKDF"), WP_LOG_COMP_SSHKDF },
534535
{ "WP_LOG_COMP_ALL",
535536
XSTRLEN("WP_LOG_COMP_ALL"),
536537
WP_LOG_COMP_ALL },

0 commit comments

Comments
 (0)