|
@@ -302,7 +302,7 @@ func (bc *baseChallenge) morph() challenge {
|
|
|
case "tls-alpn-01":
|
|
case "tls-alpn-01":
|
|
|
return &tlsALPN01Challenge{bc}
|
|
return &tlsALPN01Challenge{bc}
|
|
|
default:
|
|
default:
|
|
|
- panic("unrecognized challenge type: " + bc.getType())
|
|
|
|
|
|
|
+ return bc
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -349,13 +349,15 @@ func (hc *http01Challenge) validate(jwk *jose.JSONWebKey, vo validateOptions) (c
|
|
|
// If already valid or invalid then return without performing validation.
|
|
// If already valid or invalid then return without performing validation.
|
|
|
switch hc.getStatus() {
|
|
switch hc.getStatus() {
|
|
|
case StatusPending:
|
|
case StatusPending:
|
|
|
- panic("pending challenges must first be moved to the processing state")
|
|
|
|
|
|
|
+ e := errors.New("pending challenges must first be moved to the processing state")
|
|
|
|
|
+ return nil, ServerInternalErr(e)
|
|
|
case StatusProcessing:
|
|
case StatusProcessing:
|
|
|
break
|
|
break
|
|
|
case StatusValid, StatusInvalid:
|
|
case StatusValid, StatusInvalid:
|
|
|
return hc, nil
|
|
return hc, nil
|
|
|
default:
|
|
default:
|
|
|
- panic("unknown challenge state: " + hc.getStatus())
|
|
|
|
|
|
|
+ e := errors.Errorf("unknown challenge state: %s", hc.getStatus())
|
|
|
|
|
+ return nil, ServerInternalErr(e)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
up := &http01Challenge{hc.baseChallenge.clone()}
|
|
up := &http01Challenge{hc.baseChallenge.clone()}
|
|
@@ -426,13 +428,15 @@ func (tc *tlsALPN01Challenge) validate(jwk *jose.JSONWebKey, vo validateOptions)
|
|
|
// If already valid or invalid then return without performing validation.
|
|
// If already valid or invalid then return without performing validation.
|
|
|
switch tc.getStatus() {
|
|
switch tc.getStatus() {
|
|
|
case StatusPending:
|
|
case StatusPending:
|
|
|
- panic("pending challenges must first be moved to the processing state")
|
|
|
|
|
|
|
+ e := errors.New("pending challenges must first be moved to the processing state")
|
|
|
|
|
+ return nil, ServerInternalErr(e)
|
|
|
case StatusProcessing:
|
|
case StatusProcessing:
|
|
|
break
|
|
break
|
|
|
case StatusValid, StatusInvalid:
|
|
case StatusValid, StatusInvalid:
|
|
|
return tc, nil
|
|
return tc, nil
|
|
|
default:
|
|
default:
|
|
|
- panic("unknown challenge state: " + tc.getStatus())
|
|
|
|
|
|
|
+ e := errors.Errorf("unknown challenge state: %s", tc.getStatus())
|
|
|
|
|
+ return nil, ServerInternalErr(e)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
up := &tlsALPN01Challenge{tc.baseChallenge.clone()}
|
|
up := &tlsALPN01Challenge{tc.baseChallenge.clone()}
|
|
@@ -565,13 +569,15 @@ func (dc *dns01Challenge) validate(jwk *jose.JSONWebKey, vo validateOptions) (ch
|
|
|
// If already valid or invalid then return without performing validation.
|
|
// If already valid or invalid then return without performing validation.
|
|
|
switch dc.getStatus() {
|
|
switch dc.getStatus() {
|
|
|
case StatusPending:
|
|
case StatusPending:
|
|
|
- panic("pending challenges must first be moved to the processing state")
|
|
|
|
|
|
|
+ e := errors.New("pending challenges must first be moved to the processing state")
|
|
|
|
|
+ return nil, ServerInternalErr(e)
|
|
|
case StatusProcessing:
|
|
case StatusProcessing:
|
|
|
break
|
|
break
|
|
|
case StatusValid, StatusInvalid:
|
|
case StatusValid, StatusInvalid:
|
|
|
return dc, nil
|
|
return dc, nil
|
|
|
default:
|
|
default:
|
|
|
- panic("unknown challenge state: " + dc.getStatus())
|
|
|
|
|
|
|
+ e := errors.Errorf("unknown challenge state: %s", dc.getStatus())
|
|
|
|
|
+ return nil, ServerInternalErr(e)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
up := &dns01Challenge{dc.baseChallenge.clone()}
|
|
up := &dns01Challenge{dc.baseChallenge.clone()}
|