Hello,


While trying openssl 0.9.5 (from the redhat package [release 2]) I think
I found a bug.

I first created a 1024-bit dsa key: openssl dsaparam -genkey -out <file>
1024
Then I convert it to a pkcs8 file: openssl pkcs8 -topk8 -v2 des3 -in
<file> -out <file2>

When I try to use file2 openssl dumps core after requesting the password. If
the password
is incorrect, I get a message. But if the password is correct openssl
crashes. This happens
with all openssl commands.

I will include the output of ltrace -S openssl pkcs8 -in <file2> below. The
password
is entered at line 62. (I remove about 400 lines of opening shared libs and
reading
the config file.)

 I hope this helps someone.


 Regards,

 Joost Cassee

 ---trace output---
 SYS_brk(NULL)                                     = 0x080832c4
 [ CUT .. open shared libs .. ]
 [ CUT .. read config file .. ]
 strrchr("openssl", '/')                           = NULL
 strncpy(0xbffffb18, "openssl", 15)                = 0xbffffb18
 lh_retrieve(0x08088a78, 0xbffffb0c, 0xbffffc7d, 0xbffffb18, 16 <unfinished
...>
 lh_strhash(0xbffffb18, 0xbffff5a4, 0x4009bdd4, 0xbffffb0c, 0x400f6f54) =
0x12d061d4
 lh_retrieve(0x08088a78, 0xbffff5c0, 0xbffffb18, 0xbffffb78, 3 <unfinished
...>
 lh_strhash(0xbffffc85, 0xbffff578, 0x4009bdd4, 0xbffff5c0, 0x400f6f54) =
0x0dc8201e
 strncmp("pkcs8", "pkcs8", 8)                      = 0
 ERR_load_crypto_strings(0xbffffb78, 0x080802f0, 3, 0x0804aa20, 0x080826b4)
= 0x0806eab0
 OpenSSL_add_all_algorithms(0xbffffb78, 0x080802f0, 3, 0x0804aa20,
0x080826b4 <unfinished ...>
 SYS_brk(0x0808c000)                               = 0x0808c000
 <... OpenSSL_add_all_algorithms resumed> )        = 1
 BIO_new_file(0xbffffc8f, 0x0807e12b, 0xbffffb78, 0x080802f0, 3 <unfinished
...>
 SYS_open("private/cakey.pem", 0, 0666)            = 5
 <... BIO_new_file resumed> )                      = 0x0808b150
 BIO_new_fp(0x401e7c60, 0, 0xbffffb78, 0x080802f0, 3) = 0x0808b198
 PEM_read_bio_PKCS8(0x0808b150, 0, 0, 0, 0xbffffb78 <unfinished ...>
 SYS_fstat(5, 0xbfffecd0, 0x401e7b00, 0xbfffed44, 5) = 0
 SYS_mmap(0xbfffed20, 0xbfffecd0, 0x401e948c, 4096, 0) = 0x40013000
 SYS_read(5, "-----BEGIN ENCRYPTED PRIVATE KEY"..., 4096) = 631
 <... PEM_read_bio_PKCS8 resumed> )                = 0x08083fc8
 EVP_read_pw_string(0xbffff564, 50, 0x0807e1de, 0, 0xbffffb78 <unfinished
...>
 SYS_open("/dev/tty", 0, 0666)                     = 6
 SYS_ioctl(6, 21509, 0xbfffd49c, 0x08083fc8, 0xbfffd4d4) = 0
 SYS_rt_sigaction(1, 0xbfffd310, 0xbfffd284, 8, 1) = 0
 SYS_rt_sigaction(2, 0xbfffd310, 0xbfffd284, 8, 2) = 0
 SYS_rt_sigaction(3, 0xbfffd310, 0xbfffd284, 8, 3) = 0
 SYS_rt_sigaction(4, 0xbfffd310, 0xbfffd284, 8, 4) = 0
 SYS_rt_sigaction(5, 0xbfffd310, 0xbfffd284, 8, 5) = 0
 SYS_rt_sigaction(6, 0xbfffd310, 0xbfffd284, 8, 6) = 0
 SYS_rt_sigaction(7, 0xbfffd310, 0xbfffd284, 8, 7) = 0
 SYS_rt_sigaction(8, 0xbfffd310, 0xbfffd284, 8, 8) = 0
 SYS_rt_sigaction(9, 0xbfffd310, 0xbfffd284, 8, 9) = -22
 SYS_rt_sigaction(11, 0xbfffd310, 0xbfffd284, 8, 11) = 0
 SYS_rt_sigaction(13, 0xbfffd310, 0xbfffd284, 8, 13) = 0
 SYS_rt_sigaction(14, 0xbfffd310, 0xbfffd284, 8, 14) = 0
 SYS_rt_sigaction(15, 0xbfffd310, 0xbfffd284, 8, 15) = 0
 SYS_rt_sigaction(16, 0xbfffd310, 0xbfffd284, 8, 16) = 0
 SYS_rt_sigaction(17, 0xbfffd310, 0xbfffd284, 8, 17) = 0
 SYS_rt_sigaction(18, 0xbfffd310, 0xbfffd284, 8, 18) = 0
 SYS_rt_sigaction(19, 0xbfffd310, 0xbfffd284, 8, 19) = -22
 SYS_rt_sigaction(20, 0xbfffd310, 0xbfffd284, 8, 20) = 0
 SYS_rt_sigaction(21, 0xbfffd310, 0xbfffd284, 8, 21) = 0
 SYS_rt_sigaction(22, 0xbfffd310, 0xbfffd284, 8, 22) = 0
 SYS_rt_sigaction(23, 0xbfffd310, 0xbfffd284, 8, 23) = 0
 SYS_rt_sigaction(24, 0xbfffd310, 0xbfffd284, 8, 24) = 0
 SYS_rt_sigaction(25, 0xbfffd310, 0xbfffd284, 8, 25) = 0
 SYS_rt_sigaction(26, 0xbfffd310, 0xbfffd284, 8, 26) = 0
 SYS_rt_sigaction(27, 0xbfffd310, 0xbfffd284, 8, 27) = 0
 SYS_rt_sigaction(28, 0xbfffd310, 0xbfffd284, 8, 28) = 0
 SYS_rt_sigaction(29, 0xbfffd310, 0xbfffd284, 8, 29) = 0
 SYS_rt_sigaction(30, 0xbfffd310, 0xbfffd284, 8, 30) = 0
 SYS_rt_sigaction(31, 0xbfffd310, 0xbfffd284, 8, 31) = 0
 SYS_rt_sigaction(28, 0xbfffd1dc, 0xbfffd150, 8, 28) = 0
 SYS_ioctl(6, 21510, 0xbfffd488, 0xbfffd4ae, 0xbfffd49a) = 0
 SYS_write(2, "Enter Password:", 15)               = 15
 SYS_fstat(6, 0xbfffd29c, 0x401e7b00, 0xbfffd310, 6) = 0
 SYS_mmap(0xbfffd2ec, 0xbfffd29c, 0x401e948c, 4096, 1) = 0x40014000
 SYS_ioctl(6, 21505, 0xbfffd284, 0xbfffd2bc, 1)    = 0
 SYS_read(6, "abcd\n", 4096)                       = 5
 SYS_write(2, "\n", 1)                             = 1
 SYS_ioctl(6, 21510, 0xbfffd49c, 0xbfffd4ae, 0xbfffd49a) = 0
 SYS_rt_sigaction(1, 0xbfffd3a4, 0, 8, 1)          = 0
 SYS_rt_sigaction(2, 0xbfffd3a4, 0, 8, 2)          = 0
 SYS_rt_sigaction(3, 0xbfffd3a4, 0, 8, 3)          = 0
 SYS_rt_sigaction(4, 0xbfffd3a4, 0, 8, 4)          = 0
 SYS_rt_sigaction(5, 0xbfffd3a4, 0, 8, 5)          = 0
 SYS_rt_sigaction(6, 0xbfffd3a4, 0, 8, 6)          = 0
 SYS_rt_sigaction(7, 0xbfffd3a4, 0, 8, 7)          = 0
 SYS_rt_sigaction(8, 0xbfffd3a4, 0, 8, 8)          = 0
 SYS_rt_sigaction(9, 0xbfffd3a4, 0, 8, 9)          = -22
 SYS_rt_sigaction(11, 0xbfffd3a4, 0, 8, 11)        = 0
 SYS_rt_sigaction(13, 0xbfffd3a4, 0, 8, 13)        = 0
 SYS_rt_sigaction(14, 0xbfffd3a4, 0, 8, 14)        = 0
 SYS_rt_sigaction(15, 0xbfffd3a4, 0, 8, 15)        = 0
 SYS_rt_sigaction(16, 0xbfffd3a4, 0, 8, 16)        = 0
 SYS_rt_sigaction(17, 0xbfffd3a4, 0, 8, 17)        = 0
 SYS_rt_sigaction(18, 0xbfffd3a4, 0, 8, 18)        = 0
 SYS_rt_sigaction(19, 0xbfffd3a4, 0, 8, 19)        = -22
 SYS_rt_sigaction(20, 0xbfffd3a4, 0, 8, 20)        = 0
 SYS_rt_sigaction(21, 0xbfffd3a4, 0, 8, 21)        = 0
 SYS_rt_sigaction(22, 0xbfffd3a4, 0, 8, 22)        = 0
 SYS_rt_sigaction(23, 0xbfffd3a4, 0, 8, 23)        = 0
 SYS_rt_sigaction(24, 0xbfffd3a4, 0, 8, 24)        = 0
 SYS_rt_sigaction(25, 0xbfffd3a4, 0, 8, 25)        = 0
 SYS_rt_sigaction(26, 0xbfffd3a4, 0, 8, 26)        = 0
 SYS_rt_sigaction(27, 0xbfffd3a4, 0, 8, 27)        = 0
 SYS_rt_sigaction(28, 0xbfffd3a4, 0, 8, 28)        = 0
 SYS_rt_sigaction(29, 0xbfffd3a4, 0, 8, 29)        = 0
 SYS_rt_sigaction(30, 0xbfffd3a4, 0, 8, 30)        = 0
 SYS_rt_sigaction(31, 0xbfffd3a4, 0, 8, 31)        = 0
 SYS_close(6)                                      = 0
 SYS_munmap(0x40014000, 4096)                      = 0
 <... EVP_read_pw_string resumed> )                = 0
 PKCS12_decrypt_d2i(0x0808b1e0, 0x08050598, 0x080516c8, 0xbffff564, 4
<unfinished ...>
 d2i_PKCS8_PRIV_KEY_INFO(0, 0xbffff4d8, 334, 0xbffff564, 0x08083fc8) =
0x0808b360
 X509_SIG_free(0x08083fc8, 0x0808b1e0, 0x08050598, 0x080516c8, 0xbffff564) =
0
 EVP_PKCS82PKEY(0x0808b360, 0xbffffb78, 0x080802f0, 3, 0xbffffc8b
<unfinished ...>
 --- SIGSEGV (Segmentation fault) ---
 +++ killed by SIGSEGV +++
---end---


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to