Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for expectedFields (0.26 sec)

  1. security/pkg/pki/util/verify_cert_test.go

    	testCases := map[string]struct {
    		privPem        []byte
    		certChainPem   []byte
    		rootCertPem    []byte
    		expectedFields *VerifyFields
    		expectedErr    string
    	}{
    		"Root cert bad": {
    			privPem:        nil,
    			certChainPem:   nil,
    			rootCertPem:    []byte(rootCertBad),
    			expectedFields: verifyField1,
    			expectedErr:    "failed to parse root certificate",
    		},
    		"Cert chain bad": {
    			privPem:        nil,
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 16 14:56:37 UTC 2022
    - 6.5K bytes
    - Viewed (0)
  2. internal/config/config_test.go

    			if len(gotFields) != len(test.expectedFields) {
    				t.Errorf("Expected keys %d, found %d", len(test.expectedFields), len(gotFields))
    			}
    			found := true
    			for _, field := range gotFields {
    				_, ok := test.expectedFields[field]
    				found = found && ok
    			}
    			if !found {
    				t.Errorf("Expected %s, got %s", test.expectedFields, gotFields)
    			}
    		})
    	}
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Aug 18 22:55:17 UTC 2022
    - 4.2K bytes
    - Viewed (0)
  3. security/pkg/pki/util/verify_cert.go

    			return fmt.Errorf("the certificate doesn't have the expected SAN for: %s", host)
    		}
    	}
    	if expectedFields != nil {
    		if nb := expectedFields.NotBefore; !nb.IsZero() && !nb.Equal(cert.NotBefore) {
    			return fmt.Errorf("unexpected value for 'NotBefore' field: want %v but got %v", nb, cert.NotBefore)
    		}
    
    		if ttl := expectedFields.TTL; ttl != 0 && ttl != (cert.NotAfter.Sub(cert.NotBefore)) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Sep 05 10:37:29 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  4. tests/fuzz/pki_fuzzer.go

    	if err != nil {
    		return 0
    	}
    	rootCertPem, err := f.GetBytes()
    	if err != nil {
    		return 0
    	}
    	expectedFields := &util.VerifyFields{}
    	err = f.GenerateStruct(expectedFields)
    	if err != nil {
    		return 0
    	}
    	util.VerifyCertificate(privPem, certChainPem, rootCertPem, expectedFields)
    	return 1
    }
    
    // FindRootCertFromCertificateChainBytesFuzz implements a fuzzer
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jun 05 14:00:25 UTC 2023
    - 5.2K bytes
    - Viewed (0)
Back to top