From e085be9485d9c078b8465dd634519aa5cccdc22e Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 6 Jun 2016 10:34:35 -0600 Subject: [PATCH] fix index to check for sperator value --- wolfcrypt/src/rsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index 085cc4302..743c6644e 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -657,8 +657,8 @@ static int wc_RsaUnPad_OAEP(byte *pkcsBlock, unsigned int pkcsBlockLen, /* done with use of tmp buffer */ XFREE(tmp, NULL, DYNAMIC_TYPE_TMP_BUFFER); - /* advance idx to index of PS and msg separator */ - idx = hLen + 2 + hLen; + /* advance idx to index of PS and msg separator, account for PS size of 0*/ + idx = hLen + 1 + hLen; while (idx < pkcsBlockLen && pkcsBlock[idx] == 0) {idx++;} /* create hash of label for comparision with hash sent */