You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
There is a strlen(NUL) call when using an encrypted key with the CURLOPT_SSLKEY_BLOB option, without setting the CURLOPT_KEYPASSWD option value.
Backtrace of the simple "libcurl_test" program.
roman@OFFICE02:/tmp/libcurl_test$ LD_LIBRARY_PATH=/home/roman/.curl/lib/ gdb libcurl_test
GNU gdb (Ubuntu 12.1-0ubuntu122.04.2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see: https://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from libcurl_test...
(gdb) r
Starting program: /home/roman/tmp/libcurl_test/libcurl_test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
74 ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory.
(gdb) bt
#0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74 #1 0x00007ffff7f4dc82 in passwd_callback (buf=0x7fffffffc250 "", num=1024, encrypting=0, global_passwd=0x0) at vtls/openssl.c:939 #2 0x00007ffff7722194 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.3 #3 0x00007ffff7721d3c in UI_process () from /lib/x86_64-linux-gnu/libcrypto.so.3 #4 0x00007ffff76d6808 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.3
...
...
... #33 0x00005555555553e6 in main () at libcurl_test.cpp:115
(gdb) f 1 #1 0x00007ffff7f4dc82 in passwd_callback (buf=0x7fffffffc250 "", num=1024, encrypting=0, global_passwd=0x0) at vtls/openssl.c:939
939 int klen = curlx_uztosi(strlen((char *)global_passwd));
(gdb) p global_passwd
$1 = (void *) 0x0
(gdb)
- Return 0 for password length if OpenSSL is expecting a certificate
password but the user did not provide one.
Prior to this change libcurl would crash if OpenSSL called the certificate
password callback in libcurl but no password was provided (NULL).
Reported-by: Roman Zharkov
Fixescurl#16806
Closes #xxxx
I did this
Hello,
There is a strlen(NUL) call when using an encrypted key with the CURLOPT_SSLKEY_BLOB option, without setting the CURLOPT_KEYPASSWD option value.
Backtrace of the simple "libcurl_test" program.
Here is the source code:
I expected the following
With the uncommented line "curl_easy_setopt(curl, CURLOPT_KEYPASSWD, "superpassword");" program works fine.
curl/libcurl version
operating system
5.15.167.4-microsoft-standard-WSL2 (Ubuntu linux)
Windows 10
The text was updated successfully, but these errors were encountered: