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

Diff for /src/usr.bin/ssh/ssh-rsa.c between version 1.71 and 1.72

version 1.71, 2022/10/28 00:37:24 version 1.72, 2022/10/28 00:39:29
Line 97 
Line 97 
         return 0;          return 0;
 }  }
   
   static int
   ssh_rsa_generate(struct sshkey *k, int bits)
   {
           RSA *private = NULL;
           BIGNUM *f4 = NULL;
           int ret = SSH_ERR_INTERNAL_ERROR;
   
           if (bits < SSH_RSA_MINIMUM_MODULUS_SIZE ||
               bits > SSHBUF_MAX_BIGNUM * 8)
                   return SSH_ERR_KEY_LENGTH;
           if ((private = RSA_new()) == NULL || (f4 = BN_new()) == NULL) {
                   ret = SSH_ERR_ALLOC_FAIL;
                   goto out;
           }
           if (!BN_set_word(f4, RSA_F4) ||
               !RSA_generate_key_ex(private, bits, f4, NULL)) {
                   ret = SSH_ERR_LIBCRYPTO_ERROR;
                   goto out;
           }
           k->rsa = private;
           private = NULL;
           ret = 0;
    out:
           RSA_free(private);
           BN_free(f4);
           return ret;
   }
   
 static const char *  static const char *
 rsa_hash_alg_ident(int hash_alg)  rsa_hash_alg_ident(int hash_alg)
 {  {
Line 511 
Line 539 
         /* .cleanup = */        ssh_rsa_cleanup,          /* .cleanup = */        ssh_rsa_cleanup,
         /* .equal = */          ssh_rsa_equal,          /* .equal = */          ssh_rsa_equal,
         /* .ssh_serialize_public = */ ssh_rsa_serialize_public,          /* .ssh_serialize_public = */ ssh_rsa_serialize_public,
           /* .generate = */       ssh_rsa_generate,
 };  };
   
 const struct sshkey_impl sshkey_rsa_impl = {  const struct sshkey_impl sshkey_rsa_impl = {

Legend:
Removed from v.1.71  
changed lines
  Added in v.1.72