[BACK]Return to cipher.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/cipher.c between version 1.47 and 1.48

version 1.47, 2001/08/23 11:31:59 version 1.48, 2001/12/19 07:18:56
Line 184 
Line 184 
 }  }
 static void  static void
 blowfish_cbc_encrypt(CipherContext *cc, u_char *dest, const u_char *src,  blowfish_cbc_encrypt(CipherContext *cc, u_char *dest, const u_char *src,
      u_int len)      u_int len)
 {  {
         BF_cbc_encrypt((void *)src, dest, len, &cc->u.bf.key, cc->u.bf.iv,          BF_cbc_encrypt((void *)src, dest, len, &cc->u.bf.key, cc->u.bf.iv,
             BF_ENCRYPT);              BF_ENCRYPT);
 }  }
 static void  static void
 blowfish_cbc_decrypt(CipherContext *cc, u_char *dest, const u_char *src,  blowfish_cbc_decrypt(CipherContext *cc, u_char *dest, const u_char *src,
      u_int len)      u_int len)
 {  {
         BF_cbc_encrypt((void *)src, dest, len, &cc->u.bf.key, cc->u.bf.iv,          BF_cbc_encrypt((void *)src, dest, len, &cc->u.bf.key, cc->u.bf.iv,
             BF_DECRYPT);              BF_DECRYPT);
Line 289 
Line 289 
 static void  static void
 rijndael_setiv(CipherContext *cc, const u_char *iv, u_int ivlen)  rijndael_setiv(CipherContext *cc, const u_char *iv, u_int ivlen)
 {  {
         if (iv == NULL || ivlen != RIJNDAEL_BLOCKSIZE)          if (iv == NULL || ivlen != RIJNDAEL_BLOCKSIZE)
                 fatal("bad/no IV for %s.", cc->cipher->name);                  fatal("bad/no IV for %s.", cc->cipher->name);
         memcpy(cc->u.rijndael.iv, iv, RIJNDAEL_BLOCKSIZE);          memcpy(cc->u.rijndael.iv, iv, RIJNDAEL_BLOCKSIZE);
 }  }
Line 417 
Line 417 
 cipher_mask_ssh1(int client)  cipher_mask_ssh1(int client)
 {  {
         u_int mask = 0;          u_int mask = 0;
         mask |= 1 << SSH_CIPHER_3DES;           /* Mandatory */          mask |= 1 << SSH_CIPHER_3DES;           /* Mandatory */
         mask |= 1 << SSH_CIPHER_BLOWFISH;          mask |= 1 << SSH_CIPHER_BLOWFISH;
         if (client) {          if (client) {
                 mask |= 1 << SSH_CIPHER_DES;                  mask |= 1 << SSH_CIPHER_DES;
Line 457 
Line 457 
                 return 0;                  return 0;
         ciphers = cp = xstrdup(names);          ciphers = cp = xstrdup(names);
         for ((p = strsep(&cp, CIPHER_SEP)); p && *p != '\0';          for ((p = strsep(&cp, CIPHER_SEP)); p && *p != '\0';
              (p = strsep(&cp, CIPHER_SEP))) {              (p = strsep(&cp, CIPHER_SEP))) {
                 c = cipher_by_name(p);                  c = cipher_by_name(p);
                 if (c == NULL || c->number != SSH_CIPHER_SSH2) {                  if (c == NULL || c->number != SSH_CIPHER_SSH2) {
                         debug("bad cipher %s [%s]", p, names);                          debug("bad cipher %s [%s]", p, names);

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48