Skip to content

Commit e043b94

Browse files
authored
Merge pull request #250 from JacobBarthelmeh/memory
init on mp_int r and s
2 parents 7700b85 + df0b9ed commit e043b94

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/internal.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3543,6 +3543,12 @@ static int DoUserAuthRequestEcc(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
35433543
ret = GetUint32(&sz, pk->signature, pk->signatureSz, &i);
35443544
}
35453545

3546+
if (ret == WS_SUCCESS) {
3547+
if (mp_init(&r) != MP_OKAY) {
3548+
ret = WS_FATAL_ERROR;
3549+
}
3550+
}
3551+
35463552
if (ret == WS_SUCCESS) {
35473553
ret = mp_read_unsigned_bin(&r, pk->signature + i, sz);
35483554
if (ret != 0)
@@ -3556,6 +3562,12 @@ static int DoUserAuthRequestEcc(WOLFSSH* ssh, WS_UserAuthData_PublicKey* pk,
35563562
ret = GetUint32(&sz, pk->signature, pk->signatureSz, &i);
35573563
}
35583564

3565+
if (ret == WS_SUCCESS) {
3566+
if (mp_init(&s) != MP_OKAY) {
3567+
ret = WS_FATAL_ERROR;
3568+
}
3569+
}
3570+
35593571
if (ret == WS_SUCCESS) {
35603572
ret = mp_read_unsigned_bin(&s, pk->signature + i, sz);
35613573
if (ret != 0)

0 commit comments

Comments
 (0)