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

Diff for /src/usr.bin/ssh/auth2-pubkey.c between version 1.119 and 1.120

version 1.119, 2023/07/27 22:25:17 version 1.120, 2024/05/17 00:30:23
Line 69 
Line 69 
   
 /* import */  /* import */
 extern ServerOptions options;  extern ServerOptions options;
   extern struct authmethod_cfg methodcfg_pubkey;
   
 static char *  static char *
 format_key(const struct sshkey *key)  format_key(const struct sshkey *key)
Line 216 
Line 217 
 #endif  #endif
                 /* test for correct signature */                  /* test for correct signature */
                 authenticated = 0;                  authenticated = 0;
                 if (PRIVSEP(user_key_allowed(ssh, pw, key, 1, &authopts)) &&                  if (mm_user_key_allowed(ssh, pw, key, 1, &authopts) &&
                     PRIVSEP(sshkey_verify(key, sig, slen,                      mm_sshkey_verify(key, sig, slen,
                     sshbuf_ptr(b), sshbuf_len(b),                      sshbuf_ptr(b), sshbuf_len(b),
                     (ssh->compat & SSH_BUG_SIGTYPE) == 0 ? pkalg : NULL,                      (ssh->compat & SSH_BUG_SIGTYPE) == 0 ? pkalg : NULL,
                     ssh->compat, &sig_details)) == 0) {                      ssh->compat, &sig_details) == 0) {
                         authenticated = 1;                          authenticated = 1;
                 }                  }
                 if (authenticated == 1 && sig_details != NULL) {                  if (authenticated == 1 && sig_details != NULL) {
Line 278 
Line 279 
                  * if a user is not allowed to login. is this an                   * if a user is not allowed to login. is this an
                  * issue? -markus                   * issue? -markus
                  */                   */
                 if (PRIVSEP(user_key_allowed(ssh, pw, key, 0, NULL))) {                  if (mm_user_key_allowed(ssh, pw, key, 0, NULL)) {
                         if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_PK_OK))                          if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_PK_OK))
                             != 0 ||                              != 0 ||
                             (r = sshpkt_put_cstring(ssh, pkalg)) != 0 ||                              (r = sshpkt_put_cstring(ssh, pkalg)) != 0 ||
Line 810 
Line 811 
 }  }
   
 Authmethod method_pubkey = {  Authmethod method_pubkey = {
         "publickey",          &methodcfg_pubkey,
         "publickey-hostbound-v00@openssh.com",  
         userauth_pubkey,          userauth_pubkey,
         &options.pubkey_authentication  
 };  };

Legend:
Removed from v.1.119  
changed lines
  Added in v.1.120