Changeset 133 for trunk/src/sh_srp.c


Ignore:
Timestamp:
Oct 25, 2007, 12:19:05 AM (12 years ago)
Author:
rainer
Message:

Reentrant checksum/hash functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_srp.c

    r34 r133  
    200200  register int i;
    201201  unsigned char * dez = NULL;
     202  char hashbuf[KEYBUF_SIZE];
    202203
    203204  SL_ENTER(_("sh_srp_x"));
     
    218219
    219220  (void) sl_strlcpy (skey->vernam,
    220                      sh_tiger_hash(skey->vernam, TIGER_DATA, PW_LEN), KEY_LEN);
     221                     sh_tiger_hash(skey->vernam, TIGER_DATA, PW_LEN,
     222                                   hashbuf, sizeof(hashbuf)),
     223                     KEY_LEN);
    221224  skey->vernam[KEY_LEN] = '\0';
    222225
     
    233236  (void) sl_strlcpy (sh_srp.x,
    234237                     sh_tiger_hash(combi, TIGER_DATA,
    235                                    (unsigned long) sl_strlen(combi)),
     238                                   (unsigned long) sl_strlen(combi),
     239                                   hashbuf, sizeof(hashbuf)),
    236240                     KEY_LEN+1);
    237241  SH_FREE (combi);
     
    240244}
    241245
    242 char * sh_srp_M (char * x1, char * x2, char * x3)
     246char * sh_srp_M (char * x1, char * x2, char * x3, char * hash, size_t size)
    243247{
    244248  char           *combi;
    245249  size_t          len, l2, l3;
    246   static char     hash[KEY_LEN+1];
    247250 
    248251  SL_ENTER(_("sh_srp_M"));
     
    266269  (void) sl_strlcat (combi, x2, len);
    267270  (void) sl_strlcat (combi, x3, len);
    268   (void) sl_strlcpy (hash,
    269                      sh_tiger_hash(combi, TIGER_DATA, (unsigned long) (len-1)),
    270                      KEY_LEN+1);
     271  (void) sh_tiger_hash(combi, TIGER_DATA, (unsigned long) (len-1),
     272                       hash, size);
    271273  SH_FREE (combi);
    272274 
Note: See TracChangeset for help on using the changeset viewer.