Merge pull request #250 from JacobBarthelmeh/memory

init on mp_int r and s
pull/211/head
John Safranek 2020-03-03 14:50:38 -08:00 committed by GitHub
commit e043b9455f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)