1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-07 06:59:03 +00:00

Take into account the current SSL desire when decrementing socket

counts. Brandon reported this assertion failure when running http-enum:

nmap: nsock_core.c:199: socket_count_write_dec: Assertion `(iod->writesd_count) > 0' failed.

The problem was that handle_write_result always assumed that if a call
to SSL_write failed with SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE,
that it must have been invoked because the socket was writable (and
hence the write count should be decremented). Because of how
non-blocking sockets work in OpenSSL, it's possible that we called
handle_write_result because a socket because *readable* and thus we
should decrement the read count, not the write count.
This commit is contained in:
david
2010-03-10 01:30:52 +00:00
parent c538d86a83
commit 934868f3ce

View File

@@ -2,6 +2,14 @@
[NOT YET RELEASED]
o Fixed an assertion failure:
nsock_core.c:199: socket_count_write_dec: Assertion `(iod->writesd_count)
> 0' failed.
that could occur when connecting to an SSL server with Nsock. This
was observed when running the http-enum script but could possibly
have happened in other situations. Thanks to Brandon for reporting
the bug and testing. [David]
o Added the function bignum_add to the nse_openssl library to support BIGNUM
addition [Patrik]