1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 05:31:31 +00:00

ssh2: fix positive mpint packing. Closes #2338

This commit is contained in:
dmiller
2023-01-02 21:20:09 +00:00
parent d8cf5e6eac
commit d4b46b5b43
2 changed files with 4 additions and 1 deletions

View File

@@ -1,5 +1,8 @@
#Nmap Changelog ($Id$); -*-text-*- #Nmap Changelog ($Id$); -*-text-*-
o [GH#2338][NSE] Fix mpint packing in ssh2 library, which was causing OpenSSH
errors like "ssh_dispatch_run_fatal: bignum is negative" [Sami Loone]
o Additional Python 3 update fixes by Sam James, Daniel Miller. Special thanks o Additional Python 3 update fixes by Sam James, Daniel Miller. Special thanks
to those who opened Python 3-related issues and pull requests: Eli Schwartz, Romain to those who opened Python 3-related issues and pull requests: Eli Schwartz, Romain
Leonard, Varunram Ganesh, Pavel Zhukov, Carey Balboa, Hasan Aliyev, and others. Leonard, Varunram Ganesh, Pavel Zhukov, Carey Balboa, Hasan Aliyev, and others.

View File

@@ -57,7 +57,7 @@ transport.pack_mpint = function( bn )
local bytes, packed local bytes, packed
bytes = bn:num_bytes() bytes = bn:num_bytes()
packed = bn:tobin() packed = bn:tobin()
if bytes % 8 == 0 then if bn:num_bits() % 8 == 0 then
bytes = bytes + 1 bytes = bytes + 1
packed = '\0' .. packed packed = '\0' .. packed
end end