Skip to content

Commit 96b8e35

Browse files
committed
More review feedback: pass hash to LMS export, and drop len check in XMSS verify
1 parent 0f2c526 commit 96b8e35

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

wolfcrypt/src/wc_lms.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,8 @@ int wc_LmsKey_ExportPub_ex(LmsKey* keyDst, const LmsKey* keySrc,
15291529
*/
15301530
int wc_LmsKey_ExportPub(LmsKey* keyDst, const LmsKey* keySrc)
15311531
{
1532-
return wc_LmsKey_ExportPub_ex(keyDst, keySrc, NULL, INVALID_DEVID);
1532+
return wc_LmsKey_ExportPub_ex(keyDst, keySrc,
1533+
(keySrc != NULL) ? keySrc->heap : NULL, INVALID_DEVID);
15331534
}
15341535

15351536
/* Exports the raw LMS public key buffer from key to out buffer.

wolfcrypt/src/wc_xmss.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,15 +1798,12 @@ int wc_XmssKey_GetSigLen(const XmssKey* key, word32* len)
17981798
int wc_XmssKey_Verify(XmssKey* key, const byte* sig, word32 sigLen,
17991799
const byte* m, int mLen)
18001800
{
1801-
int ret = 0;
1801+
int ret = 0;
18021802

18031803
/* Validate parameters. */
18041804
if ((key == NULL) || (sig == NULL) || (m == NULL)) {
18051805
ret = BAD_FUNC_ARG;
18061806
}
1807-
if ((ret == 0) && (mLen <= 0)) {
1808-
ret = BAD_FUNC_ARG;
1809-
}
18101807
/* Validate state. */
18111808
if ((ret == 0) && (key->state != WC_XMSS_STATE_OK) &&
18121809
(key->state != WC_XMSS_STATE_VERIFYONLY)) {

0 commit comments

Comments
 (0)