=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh-keygen.c,v retrieving revision 1.446 retrieving revision 1.449 diff -u -r1.446 -r1.449 --- src/usr.bin/ssh/ssh-keygen.c 2022/01/05 21:50:00 1.446 +++ src/usr.bin/ssh/ssh-keygen.c 2022/03/18 02:31:25 1.449 @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keygen.c,v 1.446 2022/01/05 21:50:00 djm Exp $ */ +/* $OpenBSD: ssh-keygen.c,v 1.449 2022/03/18 02:31:25 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1994 Tatu Ylonen , Espoo, Finland @@ -2437,7 +2437,7 @@ { size_t i, slen, plen = strlen(keypath); char *privpath = xstrdup(keypath); - const char *suffixes[] = { "-cert.pub", ".pub", NULL }; + static const char * const suffixes[] = { "-cert.pub", ".pub", NULL }; struct sshkey *ret = NULL, *privkey = NULL; int r; @@ -3497,6 +3497,7 @@ return sig_match_principals(identity_file, cert_key_id, opts, nopts); } else if (strncmp(sign_op, "sign", 4) == 0) { + /* NB. cert_principals is actually namespace, via -n */ if (cert_principals == NULL || *cert_principals == '\0') { error("Too few arguments for sign: " @@ -3511,6 +3512,12 @@ return sig_sign(identity_file, cert_principals, argc, argv, opts, nopts); } else if (strncmp(sign_op, "check-novalidate", 16) == 0) { + if (cert_principals == NULL || + *cert_principals == '\0') { + error("Too few arguments for check-novalidate: " + "missing namespace"); + exit(1); + } if (ca_key_path == NULL) { error("Too few arguments for check-novalidate: " "missing signature file"); @@ -3519,10 +3526,11 @@ return sig_verify(ca_key_path, cert_principals, NULL, NULL, NULL, opts, nopts); } else if (strncmp(sign_op, "verify", 6) == 0) { + /* NB. cert_principals is actually namespace, via -n */ if (cert_principals == NULL || *cert_principals == '\0') { error("Too few arguments for verify: " - "missing principal"); + "missing namespace"); exit(1); } if (ca_key_path == NULL) { @@ -3537,7 +3545,7 @@ } if (cert_key_id == NULL) { error("Too few arguments for verify: " - "missing principal ID"); + "missing principal identity"); exit(1); } return sig_verify(ca_key_path, cert_principals,