- ${SSHKEYGEN} -q -s $ca $tflag -I "regress host key for $USER" \
- $sign_opts $OBJ/cert_host_key_${kt} ||
- fatal "couldn't sign cert_host_key_${kt}"
+ if test -z "$hosts" ; then
+ # Empty principals section.
+ ${SSHKEYGEN} -q -s $ca $tflag $sign_opts \
+ -I "regress host key for $USER" \
+ $OBJ/cert_host_key_${kt} 2>/dev/null ||
+ fatal "couldn't sign cert_host_key_${kt}"
+ else
+ # Be careful with quoting principals, which may contain
+ # wilcards.
+ ${SSHKEYGEN} -q -s $ca $tflag $sign_opts \
+ -I "regress host key for $USER" -n "$hosts" \
+ $OBJ/cert_host_key_${kt} ||
+ fatal "couldn't sign cert_host_key_${kt}"
+ fi