Skip to content

Commit 87da09d

Browse files
committed
Merge upstream
2 parents 40d2016 + 5d20d42 commit 87da09d

File tree

6 files changed

+152
-71
lines changed

6 files changed

+152
-71
lines changed

decode_response.go

Lines changed: 108 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ func (sp *SAMLServiceProvider) validateElementSignature(el *etree.Element) (*etr
204204
return sp.validationContext().Validate(el)
205205
}
206206

207+
// deprecated
207208
func (sp *SAMLServiceProvider) validateAssertionSignatures(el *etree.Element) error {
208209
signedAssertions := 0
209210
unsignedAssertions := 0
@@ -264,55 +265,131 @@ func (sp *SAMLServiceProvider) ValidateEncodedResponse(encodedResponse string) (
264265
}
265266

266267
// Parse the raw response
267-
doc, el, err := parseResponse(raw, sp.MaximumDecompressedBodySize)
268+
doc, unverifiedResponse, err := parseResponse(raw, sp.MaximumDecompressedBodySize)
268269
if err != nil {
269270
return nil, err
270271
}
271272

272273
var responseSignatureValidated bool
273-
if !sp.SkipSignatureValidation {
274-
el, err = sp.validateElementSignature(el)
275-
if err == dsig.ErrMissingSignature {
276-
// Unfortunately we just blew away our Response
277-
el = doc.Root()
278-
} else if err != nil {
274+
// storing our final response to return back
275+
decodedResponse := &types.Response{}
276+
// user has decided to skip signature verification
277+
// just unmarshal the untrusted el
278+
279+
if sp.SkipSignatureValidation {
280+
err = xmlUnmarshalElement(unverifiedResponse, decodedResponse)
281+
if err != nil {
282+
return nil, fmt.Errorf("unable to unmarshal response: %v", err)
283+
}
284+
285+
decodedResponse.SignatureValidated = false
286+
err := sp.Validate(decodedResponse)
287+
if err != nil {
279288
return nil, err
280-
} else if el == nil {
281-
return nil, fmt.Errorf("missing transformed response")
282-
} else {
283-
responseSignatureValidated = true
284289
}
290+
return decodedResponse, nil
285291
}
286292

287-
err = sp.decryptAssertions(el)
288-
if err != nil {
293+
// first get SignedResponse, if any
294+
signedResponseEl, err := sp.validateElementSignature(unverifiedResponse)
295+
296+
// continue for unsigned Response, maybe individual Assertions are still signed
297+
if err == dsig.ErrMissingSignature {
298+
// Unfortunately we just blew away our Response
299+
unverifiedResponse = doc.Root()
300+
} else if err != nil {
289301
return nil, err
290-
}
302+
} else if signedResponseEl == nil {
303+
return nil, fmt.Errorf("missing transformed response")
304+
} else {
305+
// good case, no errors when verifying signature
306+
// 1. Response is signed
307+
// optionally decrypt each assertion
308+
err = sp.decryptAssertions(signedResponseEl)
309+
if err != nil {
310+
return nil, err
311+
}
291312

292-
var assertionSignaturesValidated bool
293-
if !sp.SkipSignatureValidation {
294-
err = sp.validateAssertionSignatures(el)
295-
if err == dsig.ErrMissingSignature {
296-
if !responseSignatureValidated {
297-
return nil, fmt.Errorf("response and/or assertions must be signed")
298-
}
299-
} else if err != nil {
313+
responseSignatureValidated = true
314+
315+
err = xmlUnmarshalElement(signedResponseEl, decodedResponse)
316+
if err != nil {
317+
return nil, fmt.Errorf("unable to unmarshal response: %v", err)
318+
}
319+
decodedResponse.SignatureValidated = responseSignatureValidated
320+
321+
err := sp.Validate(decodedResponse)
322+
if err != nil {
300323
return nil, err
301-
} else {
302-
assertionSignaturesValidated = true
303324
}
325+
return decodedResponse, nil
304326
}
305327

306-
decodedResponse := &types.Response{}
307-
err = xmlUnmarshalElement(el, decodedResponse)
328+
// now we have a tricky case,
329+
// unsigned response but have some signed Assertions
330+
// unmarshal into decodedResponse,
331+
332+
err = xmlUnmarshalElement(unverifiedResponse, decodedResponse)
308333
if err != nil {
309-
return nil, fmt.Errorf("unable to unmarshal response: %v", err)
334+
return nil, err
310335
}
311-
decodedResponse.SignatureValidated = responseSignatureValidated
312-
if assertionSignaturesValidated {
313-
for idx := 0; idx < len(decodedResponse.Assertions); idx++ {
314-
decodedResponse.Assertions[idx].SignatureValidated = true
336+
337+
// keep in mind anything inside the Response is technically untrusted
338+
// however, we have to keep the relevant details such as StatusCode
339+
// We reset the underlying assertions & encrypted assertions to []
340+
341+
decodedResponse.SignatureValidated = false
342+
decodedResponse.Assertions = []types.Assertion{}
343+
decodedResponse.EncryptedAssertions = []types.EncryptedAssertion{}
344+
345+
// first decrypt all assertions
346+
err = sp.decryptAssertions(unverifiedResponse)
347+
if err != nil {
348+
return nil, err
349+
}
350+
351+
// iterate through each Assertion inside our etree unverifiedResponse
352+
addSignedAssertion := func(ctx etreeutils.NSContext, unverifiedAssertion *etree.Element) error {
353+
parent := unverifiedAssertion.Parent()
354+
if parent == nil {
355+
return fmt.Errorf("parent is nil")
315356
}
357+
if parent != unverifiedResponse {
358+
return fmt.Errorf("found assertion with unexpected parent element: %s", unverifiedAssertion.Parent().Tag)
359+
}
360+
361+
detached, err := etreeutils.NSDetatch(ctx, unverifiedAssertion) // make a detached copy
362+
if err != nil {
363+
return fmt.Errorf("unable to detach unverified assertion: %v", err)
364+
}
365+
366+
// signedAssertion after checking for errors
367+
signedAssertion, err := sp.validationContext().Validate(detached)
368+
369+
if err != nil {
370+
return err // return any errors including unsignedAssertions
371+
}
372+
373+
decodedAssertion := &types.Assertion{}
374+
375+
err = xmlUnmarshalElement(signedAssertion, decodedAssertion)
376+
if err != nil {
377+
return fmt.Errorf("unable to unmarshal assertion: %v", err)
378+
}
379+
380+
decodedAssertion.SignatureValidated = true
381+
382+
// now add it to decodedResponse
383+
decodedResponse.Assertions = append(decodedResponse.Assertions, *decodedAssertion)
384+
385+
return nil
386+
}
387+
388+
// iterate through each Assertion through our unverified Response
389+
// our decodedResponse contains a empty list of Assertions
390+
// throughout iteration, we will add signed assertions to the decodedResponse
391+
if err := etreeutils.NSFindIterate(unverifiedResponse, SAMLAssertionNamespace, AssertionTag, addSignedAssertion); err != nil {
392+
return nil, err
316393
}
317394

318395
err = sp.Validate(decodedResponse)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/beevik/etree v1.5.0
77
github.com/jonboulle/clockwork v0.5.0
88
github.com/mattermost/xml-roundtrip-validator v0.1.0
9-
github.com/russellhaering/goxmldsig v1.4.0
9+
github.com/russellhaering/goxmldsig v1.5.0
1010
github.com/stretchr/testify v1.10.0
1111
)
1212

go.sum

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,44 @@
1+
<<<<<<< HEAD
12
github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A=
23
github.com/beevik/etree v1.5.0 h1:iaQZFSDS+3kYZiGoc9uKeOkUY3nYMXOKLl6KIJxiJWs=
34
github.com/beevik/etree v1.5.0/go.mod h1:gPNJNaBGVZ9AwsidazFZyygnd+0pAU38N4D+WemwKNs=
5+
=======
6+
github.com/beevik/etree v1.5.1 h1:TC3zyxYp+81wAmbsi8SWUpZCurbxa6S8RITYRSkNRwo=
7+
github.com/beevik/etree v1.5.1/go.mod h1:gPNJNaBGVZ9AwsidazFZyygnd+0pAU38N4D+WemwKNs=
8+
>>>>>>> upstream/main
49
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
510
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
611
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
712
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
13+
<<<<<<< HEAD
814
github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
915
github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I=
1016
github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60=
1117
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
1218
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
19+
=======
20+
github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I=
21+
github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60=
22+
>>>>>>> upstream/main
1323
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
1424
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
15-
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
16-
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
1725
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
1826
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
1927
github.com/mattermost/xml-roundtrip-validator v0.1.0 h1:RXbVD2UAl7A7nOTR4u7E3ILa4IbtvKBHw64LDsmu9hU=
2028
github.com/mattermost/xml-roundtrip-validator v0.1.0/go.mod h1:qccnGMcpgwcNaBnxqpJpWWUiPNr5H3O8eDgGV9gT5To=
21-
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
2229
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2330
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
24-
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
2531
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
2632
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
27-
github.com/russellhaering/goxmldsig v1.4.0 h1:8UcDh/xGyQiyrW+Fq5t8f+l2DLB1+zlhYzkPUJ7Qhys=
28-
github.com/russellhaering/goxmldsig v1.4.0/go.mod h1:gM4MDENBQf7M+V824SGfyIUVFWydB7n0KkEubVJl+Tw=
33+
github.com/russellhaering/goxmldsig v1.5.0 h1:AU2UkkYIUOTyZRbe08XMThaOCelArgvNfYapcmSjBNw=
34+
github.com/russellhaering/goxmldsig v1.5.0/go.mod h1:x98CjQNFJcWfMxeOrMnMKg70lvDP6tE0nTaeUnjXDmk=
2935
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
3036
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
3137
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
3238
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
3339
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
34-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3540
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
3641
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
37-
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
3842
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
39-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
4043
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
4144
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

providertests/oktadev_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright 2016 Russell Haering et al.
2-
//
2+
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
6-
//
6+
//
77
// https://www.apache.org/licenses/LICENSE-2.0
8-
//
8+
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,20 +20,20 @@ import (
2020
"time"
2121

2222
"github.com/jonboulle/clockwork"
23-
"github.com/russellhaering/gosaml2"
24-
"github.com/russellhaering/goxmldsig"
23+
saml2 "github.com/russellhaering/gosaml2"
24+
dsig "github.com/russellhaering/goxmldsig"
2525
)
2626

2727
var oktaScenarioErrors = map[int]string{
28-
1: "error validating response: response and/or assertions must be signed",
28+
1: "error validating response: Missing signature referencing the top-level element",
2929
3: "error validating response: Could not verify certificate against trusted certs",
3030
4: "error validating response: Unrecognized Destination value, Expected: http://dba9a5fc.ngrok.io/v1/_saml_callback, Actual: fake.identifier.example.com",
3131
5: "error validating response: Unrecognized Issuer value, Expected: http://example.com/saml/acs/example, Actual: fake.identifier.example.com",
3232
7: "error validating response: missing Issuer element",
3333
8: "error validating response: missing NotOnOrAfter attribute on SubjectConfirmationData element",
3434
9: "missing NotOnOrAfter attribute on Conditions element",
3535
10: "missing NotBefore attribute on Conditions element",
36-
12: "error validating response: response and/or assertions must be signed",
36+
12: "error validating response: Missing signature referencing the top-level element",
3737
13: "error validating response: Signature could not be verified",
3838
14: "error validating response: Unrecognized StatusCode value, Expected: urn:oasis:names:tc:SAML:2.0:status:Success, Actual: Failure",
3939
15: "error validating response: Unrecognized StatusCode value, Expected: urn:oasis:names:tc:SAML:2.0:status:Success, Actual: urn:oasis:names:tc:SAML:2.0:status:Requester",

providertests/onelogin_test.go

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright 2016 Russell Haering et al.
2-
//
2+
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
6-
//
6+
//
77
// https://www.apache.org/licenses/LICENSE-2.0
8-
//
8+
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,14 +18,14 @@ import (
1818
"fmt"
1919
"testing"
2020

21-
"github.com/russellhaering/gosaml2"
21+
saml2 "github.com/russellhaering/gosaml2"
2222
)
2323

2424
var oneLoginScenarioErrors = map[int]string{
2525
// 99 - Response(Assertion) - no signature
26-
99: "error validating response: response and/or assertions must be signed",
26+
99: "error validating response: Missing signature referencing the top-level element",
2727
// 98 - Response(encrypted(Assertion)) - no signature
28-
98: "error validating response: response and/or assertions must be signed",
28+
98: "error validating response: Missing signature referencing the top-level element",
2929
// 01 - signed(Response(Assertion))
3030
1: "",
3131
// 03 - Response(signed(Assertion))
@@ -64,18 +64,16 @@ var oneLoginScenarioErrors = map[int]string{
6464
17: "error validating response: Signature could not be verified",
6565
// 18 - signed(Response(encrypted(signed(Assertion)))) - 16 signed (signature valid, still cannot decrypt)
6666
18: "error validating response: unable to decrypt encrypted assertion: cannot decrypt, error retrieving private key: rsa internal error: crypto/rsa: decryption error",
67-
// 81 - Response(Assertion) - 99 set IssueInstant before EncryptionCertTime
68-
// Note: signatures are being checked before IssueInstant (which is correct)
69-
81: "error validating response: response and/or assertions must be signed",
70-
// 82 - Response(Assertion) - 99 set IssueInstant after EncryptionCertTime
71-
// Note: signatures are being checked before IssueInstant (which is correct)
72-
82: "error validating response: response and/or assertions must be signed",
73-
// 91 - Response(Assertion) - 99 set IssueInstant before CertTime
74-
// Note: signatures are being checked before IssueInstant (which is correct)
75-
91: "error validating response: response and/or assertions must be signed",
76-
// 92 - Response(Assertion) - 99 set IssueInstant after CertTime
77-
// Note: signatures are being checked before IssueInstant (which is correct)
78-
92: "error validating response: response and/or assertions must be signed",
67+
// 81 - Response(Assertion) - 99 missing assertion and response signature
68+
81: "error validating response: Missing signature referencing the top-level element",
69+
// 82 - Response(Assertion) - 99 missing assertion and response signature
70+
82: "error validating response: Missing signature referencing the top-level element",
71+
// 91 - Response(Assertion) - 99 missing Response subject confirmation element
72+
// Note: gosaml2 is correctly checking signature before contents
73+
91: "error validating response: Missing signature referencing the top-level element",
74+
// 92 - Response(Assertion) - 99 missing Response subject confirmation method
75+
// Note: gosaml2 is correctly checking signature before contents
76+
92: "error validating response: Missing signature referencing the top-level element",
7977
// 21 - signed(Response(Assertion)) - 91 sign Response, IssueInstant before SigningCertTime
8078
21: "error validating response: Cert is not valid at this time",
8179
// 22 - signed(Response(Assertion)) - 92 sign Response, IssueInstant after SigningCertTime
@@ -120,19 +118,19 @@ var oneLoginScenarioErrors = map[int]string{
120118
48: "error validating response: unable to decrypt encrypted assertion: cannot decrypt, error retrieving private key: key decryption attempted with mismatched cert, SP cert(cd:f6:7c:e9), assertion cert(42:99:58:b8)",
121119
// 85 - Response(Assertion) - 99 empty Response Destination (empty is ok, Destination is optional)
122120
// Note: gosaml2 is correctly checking signature before contents
123-
85: "error validating response: response and/or assertions must be signed",
121+
85: "error validating response: Missing signature referencing the top-level element",
124122
// 86 - Response(Assertion) - 99 wrong Response Destination (SP acs)
125123
// Note: gosaml2 is correctly checking signature before contents
126-
86: "error validating response: response and/or assertions must be signed",
124+
86: "error validating response: Missing signature referencing the top-level element",
127125
// 87 - Response(Assertion) - 99 wrong Response Issuer (IDP endpoint id)
128126
// Note: gosaml2 is correctly checking signature before contents
129-
87: "error validating response: response and/or assertions must be signed",
127+
87: "error validating response: Missing signature referencing the top-level element",
130128
// 88 - Response(Assertion) - 99 wrong Assertion Audience (SP entity id)
131129
// Note: gosaml2 is correctly checking signature before contents
132-
88: "error validating response: response and/or assertions must be signed",
130+
88: "error validating response: Missing signature referencing the top-level element",
133131
// 89 - Response(Assertion) - 99 wrong Assertion Issuer (IDP endpoint id)
134132
// Note: gosaml2 is correctly checking signature before contents
135-
89: "error validating response: response and/or assertions must be signed",
133+
89: "error validating response: Missing signature referencing the top-level element",
136134
// 50 - signed(Response(Assertion)) - 85 signed Response, empty Response Destination (success, optional)
137135
50: "",
138136
// 51 - signed(Response(Assertion)) - 86 signed Response, wrong Response Destination (SP acs)

types/encrypted_assertion.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ func (ea *EncryptedAssertion) DecryptBytes(cert *tls.Certificate) ([]byte, error
6363
}
6464
return plainText, nil
6565
case MethodAES128CBC, MethodAES256CBC, MethodTripleDESCBC:
66+
if len(data)%k.BlockSize() != 0 {
67+
return nil, fmt.Errorf("encrypted data is not a multiple of the expected CBC block size %d: actual size %d", k.BlockSize(), len(data))
68+
}
6669
nonce, data := data[:k.BlockSize()], data[k.BlockSize():]
6770
c := cipher.NewCBCDecrypter(k, nonce)
6871
c.CryptBlocks(data, data)

0 commit comments

Comments
 (0)