[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.102 and 1.103

version 1.102, 2016/08/03 05:41:57 version 1.103, 2017/04/30 23:10:43
Line 47 
Line 47 
 #include "ssherr.h"  #include "ssherr.h"
 #include "digest.h"  #include "digest.h"
   
 #ifdef WITH_SSH1  
 extern const EVP_CIPHER *evp_ssh1_bf(void);  
 extern const EVP_CIPHER *evp_ssh1_3des(void);  
 extern int ssh1_3des_iv(EVP_CIPHER_CTX *, int, u_char *, int);  
 #endif  
   
 struct sshcipher_ctx {  struct sshcipher_ctx {
         int     plaintext;          int     plaintext;
Line 83 
Line 78 
 };  };
   
 static const struct sshcipher ciphers[] = {  static const struct sshcipher ciphers[] = {
 #ifdef WITH_SSH1  
         { "des",        SSH_CIPHER_DES, 8, 8, 0, 0, 0, 1, EVP_des_cbc },  
         { "3des",       SSH_CIPHER_3DES, 8, 16, 0, 0, 0, 1, evp_ssh1_3des },  
         { "blowfish",   SSH_CIPHER_BLOWFISH, 8, 32, 0, 0, 0, 1, evp_ssh1_bf },  
 #endif  
 #ifdef WITH_OPENSSL  #ifdef WITH_OPENSSL
         { "none",       SSH_CIPHER_NONE, 8, 0, 0, 0, 0, 0, EVP_enc_null },          { "none",       SSH_CIPHER_NONE, 8, 0, 0, 0, 0, 0, EVP_enc_null },
         { "3des-cbc",   SSH_CIPHER_SSH2, 8, 24, 0, 0, 0, 1, EVP_des_ede3_cbc },          { "3des-cbc",   SSH_CIPHER_SSH2, 8, 24, 0, 0, 0, 1, EVP_des_ede3_cbc },
Line 609 
Line 599 
                         memcpy(iv, cc->evp->iv, len);                          memcpy(iv, cc->evp->iv, len);
                 break;                  break;
 #endif  #endif
 #ifdef WITH_SSH1  
         case SSH_CIPHER_3DES:  
                 return ssh1_3des_iv(cc->evp, 0, iv, 24);  
 #endif  
         default:          default:
                 return SSH_ERR_INVALID_ARGUMENT;                  return SSH_ERR_INVALID_ARGUMENT;
         }          }
Line 648 
Line 634 
                 } else                  } else
                         memcpy(cc->evp->iv, iv, evplen);                          memcpy(cc->evp->iv, iv, evplen);
                 break;                  break;
 #endif  
 #ifdef WITH_SSH1  
         case SSH_CIPHER_3DES:  
                 return ssh1_3des_iv(cc->evp, 1, (u_char *)iv, 24);  
 #endif  #endif
         default:          default:
                 return SSH_ERR_INVALID_ARGUMENT;                  return SSH_ERR_INVALID_ARGUMENT;

Legend:
Removed from v.1.102  
changed lines
  Added in v.1.103