@@ -21,9 +21,9 @@ import (
2121func TestX509FederationClient_VeryFirstSecurityToken (t * testing.T ) {
2222 authServer := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
2323 // Verify request
24- expectedKeyID := fmt .Sprintf ("%s/fed-x509/%s" , tenancyID , leafCertFingerprint )
24+ expectedKeyID := fmt .Sprintf ("%s/fed-x509-sha256 /%s" , tenancyID , leafCertFingerprint )
2525 assert .True (t , strings .HasPrefix (r .Header .Get ("Authorization" ), fmt .Sprintf (`Signature version="1",headers="date (request-target) content-length content-type x-content-sha256",keyId="%s",algorithm="rsa-sha256",signature=` , expectedKeyID )))
26- expectedBody := fmt .Sprintf (`{"certificate":"%s","intermediateCertificates":["%s"],"publicKey":"%s"}` ,
26+ expectedBody := fmt .Sprintf (`{"certificate":"%s","intermediateCertificates":["%s"],"publicKey":"%s","fingerprintAlgorithm":"SHA256","purpose":"DEFAULT" }` ,
2727 leafCertBodyNoNewLine , intermediateCertBodyNoNewLine , sessionPublicKeyBodyNoNewLine )
2828
2929 var buf bytes.Buffer
@@ -72,10 +72,10 @@ func TestX509FederationClient_VeryFirstSecurityToken(t *testing.T) {
7272func TestX509FederationClient_RenewSecurityToken (t * testing.T ) {
7373 authServer := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
7474 // Verify request
75- expectedKeyID := fmt .Sprintf ("%s/fed-x509/%s" , tenancyID , leafCertFingerprint )
75+ expectedKeyID := fmt .Sprintf ("%s/fed-x509-sha256 /%s" , tenancyID , leafCertFingerprint )
7676 assert .True (t , strings .HasPrefix (r .Header .Get ("Authorization" ), fmt .Sprintf (`Signature version="1",headers="date (request-target) content-length content-type x-content-sha256",keyId="%s",algorithm="rsa-sha256",signature=` , expectedKeyID )))
7777
78- expectedBody := fmt .Sprintf (`{"certificate":"%s","intermediateCertificates":["%s"],"publicKey":"%s"}` ,
78+ expectedBody := fmt .Sprintf (`{"certificate":"%s","intermediateCertificates":["%s"],"publicKey":"%s","fingerprintAlgorithm":"SHA256","purpose":"DEFAULT" }` ,
7979 leafCertBodyNoNewLine , intermediateCertBodyNoNewLine , sessionPublicKeyBodyNoNewLine )
8080 var buf bytes.Buffer
8181 buf .ReadFrom (r .Body )
@@ -430,7 +430,12 @@ ysvMnQwaC0432ceRJ3r6vPAI2EPRd9KOE7Va1IFNJNmOuIkmRx8t`
430430 // certPem = pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: newCertBytes})
431431 // return
432432 //}
433- leafCertFingerprint = `52:3c:9d:93:8b:b8:07:21:ce:36:30:98:ba:fc:e2:4a:bc:3a:2e:0b`
433+
434+ // old SHA-1 fingerprint
435+ //leafCertFingerprint = `52:3c:9d:93:8b:b8:07:21:ce:36:30:98:ba:fc:e2:4a:bc:3a:2e:0b`
436+
437+ // new SHA-256 fingerprint
438+ leafCertFingerprint = `0c:1e:d8:13:80:d4:30:cc:2c:62:13:57:2a:fe:d5:4e:75:be:54:32:59:12:8f:2f:96:78:f8:b1:f3:62:78:bc`
434439 intermediateCertBody = `MIIC4TCCAcmgAwIBAgIRAK7jQKVEO6ssUBICuPw4OwQwDQYJKoZIhvcNAQELBQAw
435440KjEoMCYGA1UEAxMfUEtJU1ZDIElkZW50aXR5IEludGVybWVkaWF0ZSByMjAeFw0x
436441NzExMzAwMDE0MDhaFw0xODExMzAwMDE0MDhaMCoxKDAmBgNVBAMTH1BLSVNWQyBJ
0 commit comments