@@ -638,20 +638,20 @@ typedef struct wc_CryptoInfo {
638638 int hashType ; /* WC_SHA256, etc. */
639639 const byte * inKey ; /* Input keying material */
640640 word32 inKeySz ;
641- const byte * salt ; /* Optional salt */
641+ const byte * salt ; /* Optional salt */
642642 word32 saltSz ;
643- const byte * info ; /* Optional info */
643+ const byte * info ; /* Optional info */
644644 word32 infoSz ;
645- byte * out ; /* Output key material */
645+ byte * out ; /* Output key material */
646646 word32 outSz ;
647647 } hkdf ;
648648 struct { /* HKDF extract */
649649 int hashType ; /* WC_SHA256, etc. */
650- const byte * salt ; /* Optional salt */
651- word32 saltSz ;
650+ const byte * salt ; /* Optional salt */
651+ word32 saltSz ; /* must be 0 if salt==NULL */
652652 const byte * inKey ; /* Input keying material */
653653 word32 inKeySz ;
654- byte * out ; /* Output key material */
654+ byte * out ; /* out must be size of the hashType digest */
655655 } hkdf_extract ;
656656 struct { /* HKDF expand */
657657 int hashType ; /* WC_SHA256, etc. */
@@ -905,7 +905,7 @@ WOLFSSL_LOCAL int wc_CryptoCb_Hmac(Hmac* hmac, int macType, const byte* in,
905905 word32 inSz , byte * digest );
906906#endif /* !NO_HMAC */
907907
908- #ifdef HAVE_HKDF
908+ #if defined( HAVE_HKDF ) && !defined( NO_HMAC )
909909WOLFSSL_LOCAL int wc_CryptoCb_Hkdf (int hashType , const byte * inKey ,
910910 word32 inKeySz , const byte * salt ,
911911 word32 saltSz , const byte * info ,
@@ -916,7 +916,7 @@ WOLFSSL_LOCAL int wc_CryptoCb_Hkdf_Extract(int hashType, const byte* salt,
916916WOLFSSL_LOCAL int wc_CryptoCb_Hkdf_Expand (int hashType , const byte * inKey ,
917917 word32 inKeySz , const byte * info , word32 infoSz ,
918918 byte * out , word32 outSz , int devId );
919- #endif
919+ #endif /* HAVE_HKDF && !NO_HMAC */
920920
921921#if defined(HAVE_CMAC_KDF )
922922WOLFSSL_LOCAL int wc_CryptoCb_Kdf_TwostepCmac (const byte * salt , word32 saltSz ,
0 commit comments