Maybe problem in openbsd-compat/bsd-arc4random.c

Chris Maxwell maxwell at cs.dal.ca
Thu May 9 06:09:35 EST 2002


  I believe there is a problem with the openbsd-compat/bsd-arc4random.c
file. If arc4random () is called without seed_rng having previously 
been called (eg if you run ssh-keygen -p ) then it does not in 
fact invoke seed_rng () if it is the first time.  Instead it 
will invoke seed_rng every time BUT the first time.  At least 
that is the way I read the code, and changing it as below allowed
me to change my passphrase.  :-)

  Thank you very much for all your wonderful work,
-- 
  Chris Maxwell
  Unix SysAdmin, Faculty of Computer Science, 
  Dalhousie University, Halifax, Nova Scotia, Canada
  (902) 494-1369 / chris.maxwell at dal.ca / FAX: (902) 492-1517


*** openbsd-compat/bsd-arc4random.c.old Sun Mar 18 19:00:53 2001
--- bsd-arc4random.c     Wed May  8 16:44:22 2002
***************
*** 48,54 ****
        static int first_time = 1;

        if (rc4_ready <= 0) {
!               if (!first_time)
                        seed_rng();
                first_time = 0;
                arc4random_stir();
--- 48,54 ----
        static int first_time = 1;

        if (rc4_ready <= 0) {
!               if (first_time)
                        seed_rng();
                first_time = 0;
                arc4random_stir();



More information about the openssh-unix-dev mailing list