More review feedback: pass hash to LMS export, and drop len check in XMSS verify

This commit is contained in:
Paul Adelsbach
2026-05-06 17:46:42 -07:00
parent 0f2c526ee2
commit 7f5138fb9a
2 changed files with 8 additions and 5 deletions
+7 -1
View File
@@ -1529,7 +1529,13 @@ int wc_LmsKey_ExportPub_ex(LmsKey* keyDst, const LmsKey* keySrc,
*/
int wc_LmsKey_ExportPub(LmsKey* keyDst, const LmsKey* keySrc)
{
return wc_LmsKey_ExportPub_ex(keyDst, keySrc, NULL, INVALID_DEVID);
return wc_LmsKey_ExportPub_ex(keyDst, keySrc,
#ifndef WOLFSSL_LMS_VERIFY_ONLY
(keySrc != NULL) ? keySrc->heap : NULL,
#else
NULL,
#endif
INVALID_DEVID);
}
/* Exports the raw LMS public key buffer from key to out buffer.
+1 -4
View File
@@ -1798,15 +1798,12 @@ int wc_XmssKey_GetSigLen(const XmssKey* key, word32* len)
int wc_XmssKey_Verify(XmssKey* key, const byte* sig, word32 sigLen,
const byte* m, int mLen)
{
int ret = 0;
int ret = 0;
/* Validate parameters. */
if ((key == NULL) || (sig == NULL) || (m == NULL)) {
ret = BAD_FUNC_ARG;
}
if ((ret == 0) && (mLen <= 0)) {
ret = BAD_FUNC_ARG;
}
/* Validate state. */
if ((ret == 0) && (key->state != WC_XMSS_STATE_OK) &&
(key->state != WC_XMSS_STATE_VERIFYONLY)) {