Przeglądaj źródła

Improve test coverage for `wireDPOP01Validate`

Herman Slatman 2 lat temu
rodzic
commit
7520736f5b

+ 1 - 2
acme/challenge.go

@@ -484,8 +484,7 @@ func wireDPOP01Validate(ctx context.Context, ch *Challenge, db DB, accountJWK *j
 
 	var dpopPayload wireDpopPayload
 	if err := json.Unmarshal(payload, &dpopPayload); err != nil {
-		return storeError(ctx, db, ch, false, WrapError(ErrorRejectedIdentifierType, err,
-			"error unmarshalling Wire challenge payload"))
+		return WrapError(ErrorMalformedType, err, "error unmarshalling Wire challenge payload")
 	}
 
 	wireID, err := wire.ParseID([]byte(ch.Value))

Plik diff jest za duży
+ 0 - 16
acme/challenge_test.go


Plik diff jest za duży
+ 1033 - 0
acme/challenge_wire_test.go


+ 3 - 0
authority/provisioner/options.go

@@ -57,6 +57,9 @@ func (o *Options) GetSSHOptions() *SSHOptions {
 // GetWireOptions returns the SSH options.
 func (o *Options) GetWireOptions() (*wire.Options, error) {
 	if o == nil {
+		return nil, errors.New("no options available")
+	}
+	if o.Wire == nil {
 		return nil, errors.New("no Wire options available")
 	}
 	if err := o.Wire.Validate(); err != nil {

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików