init on mp_int r and s

pull/250/head
Jacob Barthelmeh 2020-03-03 14:33:00 -07:00
parent 3ea6737740
commit df0b9ed889
1 changed files with 12 additions and 0 deletions

View File

@ -3543,6 +3543,12 @@ static int DoUserAuthRequestEcc(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
ret = GetUint32(&sz, pk->signature, pk->signatureSz, &i);
}
if (ret == WS_SUCCESS) {
if (mp_init(&r) != MP_OKAY) {
ret = WS_FATAL_ERROR;
}
}
if (ret == WS_SUCCESS) {
ret = mp_read_unsigned_bin(&r, pk->signature + i, sz);
if (ret != 0)
@ -3556,6 +3562,12 @@ static int DoUserAuthRequestEcc(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
ret = GetUint32(&sz, pk->signature, pk->signatureSz, &i);
}
if (ret == WS_SUCCESS) {
if (mp_init(&s) != MP_OKAY) {
ret = WS_FATAL_ERROR;
}
}
if (ret == WS_SUCCESS) {
ret = mp_read_unsigned_bin(&s, pk->signature + i, sz);
if (ret != 0)