[openssl.org #1018] unbuffered stdin problem?
openssl rsa -passin stdin -noout -modulus < passkey
unable to load Private Key
1860:error:0906D06C:PEM routines:PEM_read_bio:no start line:./pem/pem_lib.c:637:Expecting: ANY PRIVATE KEY
I suspect the error has to do with [url]http://cvs.openssl.org/chngview?cn=4024[/url] (this is for cert but equally valid for keys)
setvbuf man page says that the input could be discarded if the stream is "Active".
Commenting that line of code does solve this problem.
This applies to all recent versions of openssl.
One potential solution is to do the setvbuf before reading the passphrase. I don't know of one single place to put this change except maybe openssl.c.
Do you see any problem with this solution? Is there a better solution?
OpenSSL Project [url]http://www.openssl.org[/url]
Development Mailing List [email]email@example.com[/email]
Automated List Manager [email]firstname.lastname@example.org[/email]