Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -4636,6 +4636,13 @@ static int CreateMpint(byte* buf, word32* sz, byte* pad)
if (buf[i] != 0x00)
break;
}
/* all-zero buffer encodes as empty mpint per RFC 4251 */
if (i == *sz) {
*pad = 0;
*sz = 0;
return WS_SUCCESS;
}

*pad = (buf[i] & 0x80) ? 1 : 0;

/* if padding would be needed and have leading 0's already then do not add
Expand Down
Loading