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

Diff for /src/usr.bin/ssh/Attic/key.c between version 1.25 and 1.25.2.1

version 1.25, 2001/04/17 10:53:24 version 1.25.2.1, 2001/09/27 19:03:54
Line 9 
Line 9 
  * called by a name other than "ssh" or "Secure Shell".   * called by a name other than "ssh" or "Secure Shell".
  *   *
  *   *
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.   * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions   * modification, are permitted provided that the following conditions
Line 54 
Line 54 
         DSA *dsa;          DSA *dsa;
         k = xmalloc(sizeof(*k));          k = xmalloc(sizeof(*k));
         k->type = type;          k->type = type;
           k->flags = 0;
         k->dsa = NULL;          k->dsa = NULL;
         k->rsa = NULL;          k->rsa = NULL;
         switch (k->type) {          switch (k->type) {
Line 153 
Line 154 
         return 0;          return 0;
 }  }
   
 u_char*  static u_char*
 key_fingerprint_raw(Key *k, enum fp_type dgst_type, size_t *dgst_raw_length)  key_fingerprint_raw(Key *k, enum fp_type dgst_type, size_t *dgst_raw_length)
 {  {
         EVP_MD *md = NULL;          EVP_MD *md = NULL;
Line 210 
Line 211 
         return retval;          return retval;
 }  }
   
 char*  static char*
 key_fingerprint_hex(u_char* dgst_raw, size_t dgst_raw_len)  key_fingerprint_hex(u_char* dgst_raw, size_t dgst_raw_len)
 {  {
         char *retval;          char *retval;
Line 227 
Line 228 
         return retval;          return retval;
 }  }
   
 char*  static char*
 key_fingerprint_bubblebabble(u_char* dgst_raw, size_t dgst_raw_len)  key_fingerprint_bubblebabble(u_char* dgst_raw, size_t dgst_raw_len)
 {  {
         char vowels[] = { 'a', 'e', 'i', 'o', 'u', 'y' };          char vowels[] = { 'a', 'e', 'i', 'o', 'u', 'y' };
Line 308 
Line 309 
  * last processed (and maybe modified) character.  Note that this may modify   * last processed (and maybe modified) character.  Note that this may modify
  * the buffer containing the number.   * the buffer containing the number.
  */   */
 int  static int
 read_bignum(char **cpp, BIGNUM * value)  read_bignum(char **cpp, BIGNUM * value)
 {  {
         char *cp = *cpp;          char *cp = *cpp;
Line 344 
Line 345 
         *cpp = cp;          *cpp = cp;
         return 1;          return 1;
 }  }
 int  static int
 write_bignum(FILE *f, BIGNUM *num)  write_bignum(FILE *f, BIGNUM *num)
 {  {
         char *buf = BN_bn2dec(num);          char *buf = BN_bn2dec(num);
Line 357 
Line 358 
         return 1;          return 1;
 }  }
   
 /* returns 1 ok, -1 error, 0 type mismatch */  /* returns 1 ok, -1 error */
 int  int
 key_read(Key *ret, char **cpp)  key_read(Key *ret, char **cpp)
 {  {
Line 412 
Line 413 
                 } else if (ret->type != type) {                  } else if (ret->type != type) {
                         /* is a key, but different type */                          /* is a key, but different type */
                         debug3("key_read: type mismatch");                          debug3("key_read: type mismatch");
                         return 0;                          return -1;
                 }                  }
                 len = 2*strlen(cp);                  len = 2*strlen(cp);
                 blob = xmalloc(len);                  blob = xmalloc(len);
Line 544 
Line 545 
         return 0;          return 0;
 }  }
   
 RSA *  static RSA *
 rsa_generate_private_key(u_int bits)  rsa_generate_private_key(u_int bits)
 {  {
         RSA *private;          RSA *private;
Line 554 
Line 555 
         return private;          return private;
 }  }
   
 DSA*  static DSA*
 dsa_generate_private_key(u_int bits)  dsa_generate_private_key(u_int bits)
 {  {
         DSA *private = DSA_generate_parameters(bits, NULL, 0, NULL, NULL, NULL, NULL);          DSA *private = DSA_generate_parameters(bits, NULL, 0, NULL, NULL, NULL, NULL);
Line 652 
Line 653 
 }  }
   
 Key *  Key *
 key_from_blob(char *blob, int blen)  key_from_blob(u_char *blob, int blen)
 {  {
         Buffer b;          Buffer b;
         char *ktype;          char *ktype;
Line 727 
Line 728 
                 buffer_put_bignum2(&b, key->rsa->n);                  buffer_put_bignum2(&b, key->rsa->n);
                 break;                  break;
         default:          default:
                 error("key_to_blob: illegal key type %d", key->type);                  error("key_to_blob: unsupported key type %d", key->type);
                 break;                  buffer_free(&b);
                   return 0;
         }          }
         len = buffer_len(&b);          len = buffer_len(&b);
         buf = xmalloc(len);          buf = xmalloc(len);
Line 768 
Line 770 
     u_char *signature, int signaturelen,      u_char *signature, int signaturelen,
     u_char *data, int datalen)      u_char *data, int datalen)
 {  {
           if (signaturelen == 0)
                   return -1;
   
         switch(key->type){          switch(key->type){
         case KEY_DSA:          case KEY_DSA:
                 return ssh_dss_verify(key, signature, signaturelen, data, datalen);                  return ssh_dss_verify(key, signature, signaturelen, data, datalen);

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.25.2.1