Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 300 for Signature (0.18 sec)

  1. cmd/signature-v4.go

    	// Get signature.
    	newSignature := getSignature(signingKey, formValues.Get("Policy"))
    
    	// Verify signature.
    	if !compareSignatureV4(newSignature, formValues.Get(xhttp.AmzSignature)) {
    		return cred, ErrSignatureDoesNotMatch
    	}
    
    	// Success.
    	return cred, ErrNone
    }
    
    // doesPresignedSignatureMatch - Verify query headers with presigned signature
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 16:45:54 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  2. cmd/signature-v2.go

    	signature := calculateSignatureV2(stringToSign, cred.SecretKey)
    	return signature
    }
    
    // compareSignatureV2 returns true if and only if both signatures
    // are equal. The signatures are expected to be base64 encoded strings
    // according to the AWS S3 signature V2 spec.
    func compareSignatureV2(sig1, sig2 string) bool {
    	// Decode signature string to binary byte-sequence representation is required
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 12.2K bytes
    - Viewed (0)
  3. cmd/signature-v4_test.go

    			},
    			expected: ErrInvalidAccessKeyID,
    		},
    		// (2) It should fail with a bad signature.
    		{
    			form: http.Header{
    				"X-Amz-Credential": []string{fmt.Sprintf(credentialTemplate, accessKey, now.Format(yyyymmdd), globalMinioDefaultRegion)},
    				"X-Amz-Date":       []string{now.Format(iso8601Format)},
    				"X-Amz-Signature":  []string{"invalidsignature"},
    				"Policy":           []string{"policy"},
    			},
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 10.4K bytes
    - Viewed (1)
  4. cmd/signature-v2_test.go

    		{
    			queryParams: map[string]string{
    				"Expires":        "60",
    				"Signature":      "badsignature",
    				"AWSAccessKeyId": accessKey,
    			},
    			expected: ErrExpiredPresignRequest,
    		},
    		// (4) Should error when the signature does not match.
    		{
    			queryParams: map[string]string{
    				"Expires":        fmt.Sprintf("%d", now.Unix()+60),
    				"Signature":      "badsignature",
    				"AWSAccessKeyId": accessKey,
    			},
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Oct 14 10:08:40 GMT 2022
    - 8K bytes
    - Viewed (0)
  5. cmd/streaming-signature-v4.go

    			return n, cr.err
    		}
    	}
    
    	// Now, we read the signature of the following payload and expect:
    	//   chunk-signature=" + <signature-as-hex> + "\r\n"
    	//
    	// The signature is 64 bytes long (hex-encoded SHA256 hash) and
    	// starts with a 16 byte header: len("chunk-signature=") + 64 == 80.
    	var signature [80]byte
    	_, err = io.ReadFull(cr.reader, signature[:])
    	if err == io.EOF {
    		err = io.ErrUnexpectedEOF
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 18.2K bytes
    - Viewed (0)
  6. cmd/signature-v4-utils.go

    			extractedSignedHeaders[http.CanonicalHeaderKey(header)] = r.TransferEncoding
    		case "content-length":
    			// Signature-V4 spec excludes Content-Length from signed headers list for signature calculation.
    			// But some clients deviate from this rule. Hence we consider Content-Length for signature
    			// calculation to be compatible with such clients.
    			extractedSignedHeaders.Set(header, strconv.FormatInt(r.ContentLength, 10))
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Wed Jan 31 18:56:45 GMT 2024
    - 9K bytes
    - Viewed (0)
  7. cmd/signature-v4-parser.go

    	if aec != ErrNone {
    		return psv, aec
    	}
    
    	// Save signature.
    	preSignV4Values.Signature, aec = parseSignature("Signature=" + query.Get(xhttp.AmzSignature))
    	if aec != ErrNone {
    		return psv, aec
    	}
    
    	// Return structured form of signature query string.
    	return preSignV4Values, ErrNone
    }
    
    // Parses signature version '4' header of the following form.
    //
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 9.4K bytes
    - Viewed (0)
  8. cmd/signature-v4-parser_test.go

    			// validating the extraction/parsing of signature field.
    			if !compareSignatureV4(testCase.expectedAuthField.Signature, parsedAuthField.Signature) {
    				t.Errorf("Test %d: Parsed Signature field mismatch: Expected \"%s\", got \"%s\"", i+1, testCase.expectedAuthField.Signature, parsedAuthField.Signature)
    			}
    
    			// validating the extracted signed headers.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 27.4K bytes
    - Viewed (0)
  9. cmd/streaming-signature-v4_test.go

    	}
    	// List of readers used.
    	readers := []io.Reader{
    		// Test - 1
    		bytes.NewReader([]byte("1000;chunk-signature=111123333333333333334444211\r\n")),
    		// Test - 2
    		bytes.NewReader([]byte("1000;")),
    		// Test - 3
    		bytes.NewReader([]byte(fmt.Sprintf("%4097d", 1))),
    		// Test - 4
    		bytes.NewReader([]byte("1000;chunk-signature=111123333333333333334444211\r\n")),
    	}
    	testCases := []testCase{
    		// Test - 1 - small bufio reader.
    		{
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 5.7K bytes
    - Viewed (0)
  10. cmd/signature-v4-utils_test.go

    		{"X-Amz-Content-Sha256", unsignedPayload, "X-Amz-Credential", "", true},
    
    		// Test case - 4.
    		// Enabling PreSigned Signature v4, but X-Amz-Content-Sha256 not set has to be skipped.
    		{"", "", "X-Amz-Credential", "", true},
    
    		// Test case - 5.
    		// Enabling PreSigned Signature v4, but X-Amz-Content-Sha256 set and its not UNSIGNED-PAYLOAD, we shouldn't skip.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 05 21:26:41 GMT 2024
    - 14.3K bytes
    - Viewed (0)
Back to top