Check for error creating signers.
This commit is contained in:
parent
004ea12212
commit
390aecca0b
1 changed files with 12 additions and 2 deletions
|
@ -87,7 +87,12 @@ func (a *Authority) SignSSH(key ssh.PublicKey, opts provisioner.SSHOptions, sign
|
|||
code: http.StatusNotImplemented,
|
||||
}
|
||||
}
|
||||
signer, err = ssh.NewSignerFromSigner(a.sshCAUserCertSignKey)
|
||||
if signer, err = ssh.NewSignerFromSigner(a.sshCAUserCertSignKey); err != nil {
|
||||
return nil, &apiError{
|
||||
err: errors.Wrap(err, "signSSH: error creating signer"),
|
||||
code: http.StatusInternalServerError,
|
||||
}
|
||||
}
|
||||
case ssh.HostCert:
|
||||
if a.sshCAHostCertSignKey == nil {
|
||||
return nil, &apiError{
|
||||
|
@ -95,7 +100,12 @@ func (a *Authority) SignSSH(key ssh.PublicKey, opts provisioner.SSHOptions, sign
|
|||
code: http.StatusNotImplemented,
|
||||
}
|
||||
}
|
||||
signer, err = ssh.NewSignerFromSigner(a.sshCAHostCertSignKey)
|
||||
if signer, err = ssh.NewSignerFromSigner(a.sshCAHostCertSignKey); err != nil {
|
||||
return nil, &apiError{
|
||||
err: errors.Wrap(err, "signSSH: error creating signer"),
|
||||
code: http.StatusInternalServerError,
|
||||
}
|
||||
}
|
||||
default:
|
||||
return nil, &apiError{
|
||||
err: errors.Errorf("unexpected ssh certificate type: %d", cert.CertType),
|
||||
|
|
Loading…
Reference in a new issue