[BACK]Return to crypt-sha1.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libcrypt

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libcrypt/crypt-sha1.c between version 1.4.4.2 and 1.5

version 1.4.4.2, 2014/05/22 11:36:55 version 1.5, 2012/08/30 12:16:49
Line 130  __crypt_sha1 (const char *pw, const char
Line 130  __crypt_sha1 (const char *pw, const char
     int dl;      int dl;
     unsigned int iterations;      unsigned int iterations;
     unsigned int i;      unsigned int i;
     /* XXX silence -Wpointer-sign (would be nice to fix this some other way) */  
     const unsigned char *pwu = (const unsigned char *)pw;  
   
     /*      /*
      * Salt format is       * Salt format is
Line 168  __crypt_sha1 (const char *pw, const char
Line 166  __crypt_sha1 (const char *pw, const char
     /*      /*
      * Then hmac using <pw> as key, and repeat...       * Then hmac using <pw> as key, and repeat...
      */       */
     __hmac_sha1((unsigned char *)passwd, dl, pwu, pl, hmac_buf);      __hmac_sha1(passwd, dl, pw, pl, hmac_buf);
     for (i = 1; i < iterations; i++) {      for (i = 1; i < iterations; i++) {
         __hmac_sha1(hmac_buf, SHA1_SIZE, pwu, pl, hmac_buf);          __hmac_sha1(hmac_buf, SHA1_SIZE, pw, pl, hmac_buf);
     }      }
     /* Now output... */      /* Now output... */
     pl = snprintf(passwd, sizeof(passwd), "%s%u$%.*s$",      pl = snprintf(passwd, sizeof(passwd), "%s%u$%.*s$",
Line 192  __crypt_sha1 (const char *pw, const char
Line 190  __crypt_sha1 (const char *pw, const char
     *ep = '\0';      *ep = '\0';
   
     /* Don't leave anything around in vm they could use. */      /* Don't leave anything around in vm they could use. */
     explicit_memset(hmac_buf, 0, sizeof hmac_buf);      __explicit_bzero(hmac_buf, sizeof hmac_buf);
   
     return passwd;      return passwd;
 }  }

Legend:
Removed from v.1.4.4.2  
changed lines
  Added in v.1.5

CVSweb <webmaster@jp.NetBSD.org>