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

Diff for /src/usr.bin/ssh/ssh-keygen.c between version 1.371 and 1.374

version 1.371, 2019/11/25 00:54:23 version 1.374, 2019/12/10 22:37:20
Line 1715 
Line 1715 
         int r, i, fd, found, agent_fd = -1;          int r, i, fd, found, agent_fd = -1;
         u_int n;          u_int n;
         struct sshkey *ca, *public;          struct sshkey *ca, *public;
         char valid[64], *otmp, *tmp, *cp, *out, *comment, **plist = NULL;          char valid[64], *otmp, *tmp, *cp, *out, *comment;
           char *ca_fp = NULL, **plist = NULL;
         FILE *f;          FILE *f;
         struct ssh_identitylist *agent_ids;          struct ssh_identitylist *agent_ids;
         size_t j;          size_t j;
           struct notifier_ctx *notifier = NULL;
   
 #ifdef ENABLE_PKCS11  #ifdef ENABLE_PKCS11
         pkcs11_init(1);          pkcs11_init(1);
Line 1764 
Line 1766 
                 fatal("CA key type %s doesn't match specified %s",                  fatal("CA key type %s doesn't match specified %s",
                     sshkey_ssh_name(ca), key_type_name);                      sshkey_ssh_name(ca), key_type_name);
         }          }
           ca_fp = sshkey_fingerprint(ca, fingerprint_hash, SSH_FP_DEFAULT);
   
         for (i = 0; i < argc; i++) {          for (i = 0; i < argc; i++) {
                 /* Split list of principals */                  /* Split list of principals */
Line 1814 
Line 1817 
                                 fatal("Couldn't certify key %s via agent: %s",                                  fatal("Couldn't certify key %s via agent: %s",
                                     tmp, ssh_err(r));                                      tmp, ssh_err(r));
                 } else {                  } else {
                         if ((r = sshkey_certify(public, ca, key_type_name,                          if (sshkey_is_sk(ca) &&
                             sk_provider)) != 0)                              (ca->sk_flags & SSH_SK_USER_PRESENCE_REQD)) {
                                   notifier = notify_start(0,
                                       "Confirm user presence for key %s %s",
                                       sshkey_type(ca), ca_fp);
                           }
                           r = sshkey_certify(public, ca, key_type_name,
                               sk_provider);
                           notify_complete(notifier);
                           if (r != 0)
                                 fatal("Couldn't certify key %s: %s",                                  fatal("Couldn't certify key %s: %s",
                                     tmp, ssh_err(r));                                      tmp, ssh_err(r));
                 }                  }
Line 1853 
Line 1864 
                 if (cert_serial_autoinc)                  if (cert_serial_autoinc)
                         cert_serial++;                          cert_serial++;
         }          }
           free(ca_fp);
 #ifdef ENABLE_PKCS11  #ifdef ENABLE_PKCS11
         pkcs11_terminate();          pkcs11_terminate();
 #endif  #endif
Line 2994 
Line 3006 
                 case 'x':                  case 'x':
                         if (*optarg == '\0')                          if (*optarg == '\0')
                                 fatal("Missing security key flags");                                  fatal("Missing security key flags");
                         ull = strtoull(optarg, &ep, 0);                          if (strcasecmp(optarg, "no-touch-required") == 0)
                         if (*ep != '\0')                                  sk_flags &= ~SSH_SK_USER_PRESENCE_REQD;
                                 fatal("Security key flags \"%s\" is not a "                          else {
                                     "number", optarg);                                  ull = strtoull(optarg, &ep, 0);
                         if (ull > 0xff)                                  if (*ep != '\0')
                                 fatal("Invalid security key flags 0x%llx", ull);                                          fatal("Security key flags \"%s\" is "
                         sk_flags = (uint8_t)ull;                                              "not a number", optarg);
                                   if (ull > 0xff) {
                                           fatal("Invalid security key "
                                               "flags 0x%llx", ull);
                                   }
                                   sk_flags = (uint8_t)ull;
                           }
                         break;                          break;
                 case 'z':                  case 'z':
                         errno = 0;                          errno = 0;
Line 3266 
Line 3284 
         switch (type) {          switch (type) {
         case KEY_ECDSA_SK:          case KEY_ECDSA_SK:
         case KEY_ED25519_SK:          case KEY_ED25519_SK:
                   if (!quiet) {
                           printf("You may need to touch your security key "
                               "to authorize key generation.\n");
                   }
                   fflush(stdout);
                 if (sshsk_enroll(type, sk_provider,                  if (sshsk_enroll(type, sk_provider,
                     cert_key_id == NULL ? "ssh:" : cert_key_id,                      cert_key_id == NULL ? "ssh:" : cert_key_id,
                     sk_flags, NULL, &private, NULL) != 0)                      sk_flags, NULL, &private, NULL) != 0)

Legend:
Removed from v.1.371  
changed lines
  Added in v.1.374