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

Diff for /src/usr.bin/ssh/ssh-ed25519.c between version 1.15 and 1.16

version 1.15, 2022/10/28 00:41:17 version 1.16, 2022/10/28 00:41:52
Line 50 
Line 50 
   
 static int  static int
 ssh_ed25519_serialize_public(const struct sshkey *key, struct sshbuf *b,  ssh_ed25519_serialize_public(const struct sshkey *key, struct sshbuf *b,
     const char *typename, enum sshkey_serialize_rep opts)      enum sshkey_serialize_rep opts)
 {  {
         int r;          int r;
   
         if (key->ed25519_pk == NULL)          if (key->ed25519_pk == NULL)
                 return SSH_ERR_INVALID_ARGUMENT;                  return SSH_ERR_INVALID_ARGUMENT;
         if ((r = sshbuf_put_cstring(b, typename)) != 0 ||          if ((r = sshbuf_put_string(b, key->ed25519_pk, ED25519_PK_SZ)) != 0)
             (r = sshbuf_put_string(b, key->ed25519_pk, ED25519_PK_SZ)) != 0)  
                 return r;                  return r;
   
         return 0;          return 0;
Line 84 
Line 83 
         return 0;          return 0;
 }  }
   
   static int
   ssh_ed25519_deserialize_public(const char *ktype, struct sshbuf *b,
       struct sshkey *key)
   {
           u_char *pk = NULL;
           size_t len = 0;
           int r;
   
           if ((r = sshbuf_get_string(b, &pk, &len)) != 0)
                   return r;
           if (len != ED25519_PK_SZ) {
                   freezero(pk, len);
                   return SSH_ERR_INVALID_FORMAT;
           }
           key->ed25519_pk = pk;
           return 0;
   }
   
 int  int
 ssh_ed25519_sign(const struct sshkey *key, u_char **sigp, size_t *lenp,  ssh_ed25519_sign(const struct sshkey *key, u_char **sigp, size_t *lenp,
     const u_char *data, size_t datalen, u_int compat)      const u_char *data, size_t datalen, u_int compat)
Line 218 
Line 235 
         /* .cleanup = */        ssh_ed25519_cleanup,          /* .cleanup = */        ssh_ed25519_cleanup,
         /* .equal = */          ssh_ed25519_equal,          /* .equal = */          ssh_ed25519_equal,
         /* .ssh_serialize_public = */ ssh_ed25519_serialize_public,          /* .ssh_serialize_public = */ ssh_ed25519_serialize_public,
           /* .ssh_deserialize_public = */ ssh_ed25519_deserialize_public,
         /* .generate = */       ssh_ed25519_generate,          /* .generate = */       ssh_ed25519_generate,
         /* .copy_public = */    ssh_ed25519_copy_public,          /* .copy_public = */    ssh_ed25519_copy_public,
 };  };

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16