Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/ssh.c

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

revision 6144 by maya, Mon Nov 16 14:59:37 2015 UTC revision 6157 by maya, Thu Nov 19 08:35:26 2015 UTC
# Line 4145  error: Line 4145  error:
4145  static char * get_cipher_string(SSHCipher cipher)  static char * get_cipher_string(SSHCipher cipher)
4146  {  {
4147          ssh2_cipher_t *ptr = ssh2_ciphers;          ssh2_cipher_t *ptr = ssh2_ciphers;
4148          static char buf[32];          char *p = "unknown";
4149    
4150          while (ptr->name != NULL) {          while (ptr->name != NULL) {
4151                  if (cipher == ptr->cipher) {                  if (cipher == ptr->cipher) {
4152                          strncpy_s(buf, sizeof(buf), ptr->name, _TRUNCATE);                          p = ptr->name;
4153                          break;                          break;
4154                  }                  }
4155                  ptr++;                  ptr++;
4156          }          }
4157          return buf;          return p;
4158  }  }
4159    
4160  const EVP_CIPHER* get_cipher_EVP_CIPHER(SSHCipher cipher)  const EVP_CIPHER* get_cipher_EVP_CIPHER(SSHCipher cipher)
# Line 4177  const EVP_CIPHER* get_cipher_EVP_CIPHER( Line 4177  const EVP_CIPHER* get_cipher_EVP_CIPHER(
4177  char* get_kex_algorithm_name(kex_algorithm kextype)  char* get_kex_algorithm_name(kex_algorithm kextype)
4178  {  {
4179          ssh2_kex_algorithm_t *ptr = ssh2_kex_algorithms;          ssh2_kex_algorithm_t *ptr = ssh2_kex_algorithms;
4180          static char buf[64];          char *p = "unknown";
4181    
4182          while (ptr->name != NULL) {          while (ptr->name != NULL) {
4183                  if (kextype == ptr->kextype) {                  if (kextype == ptr->kextype) {
4184                          strncpy_s(buf, sizeof(buf), ptr->name, _TRUNCATE);                          p = ptr->name;
4185                          break;                          break;
4186                  }                  }
4187                  ptr++;                  ptr++;
4188          }          }
4189          return buf;          return p;
4190  }  }
4191    
4192  const EVP_MD* get_kex_algorithm_EVP_MD(kex_algorithm kextype)  const EVP_MD* get_kex_algorithm_EVP_MD(kex_algorithm kextype)
# Line 4207  const EVP_MD* get_kex_algorithm_EVP_MD(k Line 4207  const EVP_MD* get_kex_algorithm_EVP_MD(k
4207  char* get_ssh2_mac_name(hmac_type type)  char* get_ssh2_mac_name(hmac_type type)
4208  {  {
4209          ssh2_mac_t *ptr = ssh2_macs;          ssh2_mac_t *ptr = ssh2_macs;
4210          static char buf[64];          char *p = "unknown";
4211    
4212          while (ptr->name != NULL) {          while (ptr->name != NULL) {
4213                  if (type == ptr->type) {                  if (type == ptr->type) {
4214                          strncpy_s(buf, sizeof(buf), ptr->name, _TRUNCATE);                          p = ptr->name;
4215                          break;                          break;
4216                  }                  }
4217                  ptr++;                  ptr++;
4218          }          }
4219          return buf;          return p;
4220  }  }
4221    
4222  const EVP_MD* get_ssh2_mac_EVP_MD(hmac_type type)  const EVP_MD* get_ssh2_mac_EVP_MD(hmac_type type)
# Line 4252  int get_ssh2_mac_truncatebits(hmac_type Line 4252  int get_ssh2_mac_truncatebits(hmac_type
4252  char* get_ssh2_comp_name(compression_type type)  char* get_ssh2_comp_name(compression_type type)
4253  {  {
4254          ssh2_comp_t *ptr = ssh2_comps;          ssh2_comp_t *ptr = ssh2_comps;
4255          static char buf[32];          char *p = "unknown";
4256    
4257          while (ptr->name != NULL) {          while (ptr->name != NULL) {
4258                  if (type == ptr->type) {                  if (type == ptr->type) {
4259                          strncpy_s(buf, sizeof(buf), ptr->name, _TRUNCATE);                          p = ptr->name;
4260                          break;                          break;
4261                  }                  }
4262                  ptr++;                  ptr++;
4263          }          }
4264          return buf;          return p;
4265  }  }
4266    
4267  char* get_ssh_keytype_name(ssh_keytype type)  char* get_ssh_keytype_name(ssh_keytype type)
# Line 4283  char* get_ssh_keytype_name(ssh_keytype t Line 4283  char* get_ssh_keytype_name(ssh_keytype t
4283  char* get_digest_algorithm_name(digest_algorithm id)  char* get_digest_algorithm_name(digest_algorithm id)
4284  {  {
4285          ssh_digest_t *ptr = ssh_digests;          ssh_digest_t *ptr = ssh_digests;
4286          static char buf[16];          char *p = "unknown";
4287    
4288          while (ptr->name != NULL) {          while (ptr->name != NULL) {
4289                  if (id == ptr->id) {                  if (id == ptr->id) {
4290                          strncpy_s(buf, sizeof(buf), ptr->name, _TRUNCATE);                          p = ptr->name;
4291                          break;                          break;
4292                  }                  }
4293                  ptr++;                  ptr++;
4294          }          }
4295          return buf;          return p;
4296  }  }
4297    
4298  static void do_write_buffer_file(void *buf, int len, char *file, int lineno)  static void do_write_buffer_file(void *buf, int len, char *file, int lineno)

Legend:
Removed from v.6144  
changed lines
  Added in v.6157

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26