/[shishi]/inetutils/libinetutils/shishi.c
ViewVC logotype

Diff of /inetutils/libinetutils/shishi.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by npo, Thu Sep 18 12:50:39 2003 UTC revision 1.5 by npo, Fri Sep 19 19:45:29 2003 UTC
# Line 494  readenc (Shishi * h, int sock, char *buf Line 494  readenc (Shishi * h, int sock, char *buf
494    blocksize = shishi_cipher_blocksize (enctype);    blocksize = shishi_cipher_blocksize (enctype);
495    hashsize =    hashsize =
496      shishi_checksum_cksumlen (shishi_cipher_defaultcksumtype (enctype));      shishi_checksum_cksumlen (shishi_cipher_defaultcksumtype (enctype));
497      
498      switch (enctype)
499        {
500        case SHISHI_AES128_CTS_HMAC_SHA1_96:
501        case SHISHI_AES256_CTS_HMAC_SHA1_96:
502          dlen += 4 + hashsize + blocksize;
503          break;
504        case SHISHI_DES3_CBC_HMAC_SHA1_KD:
505        case SHISHI_ARCFOUR_HMAC:
506        case SHISHI_ARCFOUR_HMAC_EXP:
507          dlen += 2*blocksize - 1;
508          if (proto == 2)
509            dlen += 4;
510          dlen /= blocksize;
511          dlen *= blocksize;
512          dlen += hashsize;
513          break;
514        default:
515          dlen += blocksize - 1;
516          if (proto == 2)
517            dlen += 4;
518          dlen += hashsize;
519          dlen /= blocksize;
520          dlen *= blocksize;
521          break;
522        }
523    
524    dlen += blocksize - 1;    syslog(LOG_ERR, "vla = %d", dlen);
   if (proto == 2)  
     dlen += 4;  
   if (enctype != SHISHI_DES3_CBC_HMAC_SHA1_KD)  
     dlen += hashsize;  
   else  
     dlen += blocksize;  
   
   dlen /= blocksize;  
   dlen *= blocksize;  
   
   if (enctype == SHISHI_DES3_CBC_HMAC_SHA1_KD)  
     dlen += hashsize;  
   
525    /* read encrypted data */    /* read encrypted data */
526    outbis = (char *)xmalloc (dlen);    outbis = (char *)xmalloc (dlen);
527    if (outbis == NULL)    if (outbis == NULL)

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

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26