fixing recovery from x/golang/crypto panics

This commit is contained in:
Chris Hoffman 2017-07-27 21:00:31 -04:00
parent 935b6d7b5c
commit d404dfc494

View file

@ -389,6 +389,16 @@ func (b *backend) calculateTTL(data *framework.FieldData, role *sshRole) (time.D
} }
func (b *creationBundle) sign() (retCert *ssh.Certificate, retErr error) { func (b *creationBundle) sign() (retCert *ssh.Certificate, retErr error) {
defer func() {
if r := recover(); r != nil {
errMsg, ok := r.(string)
if ok {
retCert = nil
retErr = errors.New(errMsg)
}
}
}()
serialNumber, err := certutil.GenerateSerialNumber() serialNumber, err := certutil.GenerateSerialNumber()
if err != nil { if err != nil {
return nil, err return nil, err