mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-06 10:10:52 +02:00
More review feedback: pass hash to LMS export, and drop len check in XMSS verify
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user