OpenSSL is a wonderful library.  I have had much fun learning from it. 
I am running it from Windows NT 4.0 and Windows 98.  Recently, I grew
annoyed, enough, to make a small fix located in read_pwd.c.

The symptom:
  When using genrsa to build an RSA key, after entering the pass-phrase
for the second time, I would often see the error:

fgets(tty): Invalid argument.

genrsa would function properly, and my pass-phrase appeared to be read
from the keyboard correctly.  A quick look at the code identifies the
source of the message near the bottom of des_read_pw() located within
read_pwd.c.  This problem, by no means, is a show stopper.  There does
seem to be, however, an easy fix.

The fix:
  There is an "ok" flag being set, upon successful read and comparison
of the two passwords.  Though incomplete, at the very least, use of this
flag may be used as a conditional to the possibility of an error message
on fgets().  Thus, by adding the conditional between lines 361 & 362,
the console output is improved.

359: error:
360:    fprintf(stderr,"\n");
361: #ifdef DEBUG
+       if (!ok)
362:        perror("fgets(tty)");
363: #endif

The comment:
  I suspect there are differences in the c-runtime implementation of
perror().  The platform I am running OpenSLL from is WIN32, Windoze 98. 
I suspect there is a flaw in the perror() implementation, and providing
the conditional on its call, may be more fo a bandaid than a real fix. 
Just the same, I contribute it here, though, small the contribution is.

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

Reply via email to