fixing recovery from x/golang/crypto panics
This commit is contained in:
parent
935b6d7b5c
commit
d404dfc494
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue