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

Diff for /src/usr.bin/ssh/sshconnect2.c between version 1.243 and 1.244

version 1.243, 2016/05/02 10:26:04 version 1.244, 2016/05/23 23:30:50
Line 1291 
Line 1291 
                 id->userprovided = options.identity_file_userprovided[i];                  id->userprovided = options.identity_file_userprovided[i];
                 TAILQ_INSERT_TAIL(&files, id, next);                  TAILQ_INSERT_TAIL(&files, id, next);
         }          }
         /* Prefer PKCS11 keys that are explicitly listed */  
         TAILQ_FOREACH_SAFE(id, &files, next, tmp) {  
                 if (id->key == NULL || (id->key->flags & SSHKEY_FLAG_EXT) == 0)  
                         continue;  
                 found = 0;  
                 TAILQ_FOREACH(id2, &files, next) {  
                         if (id2->key == NULL ||  
                             (id2->key->flags & SSHKEY_FLAG_EXT) == 0)  
                                 continue;  
                         if (sshkey_equal(id->key, id2->key)) {  
                                 TAILQ_REMOVE(&files, id, next);  
                                 TAILQ_INSERT_TAIL(preferred, id, next);  
                                 found = 1;  
                                 break;  
                         }  
                 }  
                 /* If IdentitiesOnly set and key not found then don't use it */  
                 if (!found && options.identities_only) {  
                         TAILQ_REMOVE(&files, id, next);  
                         explicit_bzero(id, sizeof(*id));  
                         free(id);  
                 }  
         }  
         /* list of certificates specified by user */          /* list of certificates specified by user */
         for (i = 0; i < options.num_certificate_files; i++) {          for (i = 0; i < options.num_certificate_files; i++) {
                 key = options.certificates[i];                  key = options.certificates[i];
Line 1371 
Line 1348 
                         TAILQ_INSERT_TAIL(preferred, id, next);                          TAILQ_INSERT_TAIL(preferred, id, next);
                 }                  }
                 authctxt->agent_fd = agent_fd;                  authctxt->agent_fd = agent_fd;
           }
           /* Prefer PKCS11 keys that are explicitly listed */
           TAILQ_FOREACH_SAFE(id, &files, next, tmp) {
                   if (id->key == NULL || (id->key->flags & SSHKEY_FLAG_EXT) == 0)
                           continue;
                   found = 0;
                   TAILQ_FOREACH(id2, &files, next) {
                           if (id2->key == NULL ||
                               (id2->key->flags & SSHKEY_FLAG_EXT) == 0)
                                   continue;
                           if (sshkey_equal(id->key, id2->key)) {
                                   TAILQ_REMOVE(&files, id, next);
                                   TAILQ_INSERT_TAIL(preferred, id, next);
                                   found = 1;
                                   break;
                           }
                   }
                   /* If IdentitiesOnly set and key not found then don't use it */
                   if (!found && options.identities_only) {
                           TAILQ_REMOVE(&files, id, next);
                           explicit_bzero(id, sizeof(*id));
                           free(id);
                   }
         }          }
         /* append remaining keys from the config file */          /* append remaining keys from the config file */
         for (id = TAILQ_FIRST(&files); id; id = TAILQ_FIRST(&files)) {          for (id = TAILQ_FIRST(&files); id; id = TAILQ_FIRST(&files)) {

Legend:
Removed from v.1.243  
changed lines
  Added in v.1.244