fix for setting rPad/sPad value

pull/174/head
Jacob Barthelmeh 2019-06-24 10:22:02 -06:00
parent 62f309c8ae
commit 2279183e3a
1 changed files with 5 additions and 3 deletions

View File

@ -7076,10 +7076,12 @@ static int BuildUserAuthRequestEcc(WOLFSSH* ssh,
}
if (ret == WS_SUCCESS) {
byte rPad = (r[0] & 0x80) ? 1 : 0;
byte sPad = (s[0] & 0x80) ? 1 : 0;
byte rPad;
byte sPad;
rPad = 0; sPad = 0;
/* adds a byte of padding if needed to avoid negative values */
rPad = (r[0] & 0x80) ? 1 : 0;
sPad = (s[0] & 0x80) ? 1 : 0;
c32toa(rSz + rPad + sSz + sPad +
cannedKeyAlgoEcc256NamesSz + LENGTH_SZ * 4,
output + begin);