-
Notifications
You must be signed in to change notification settings - Fork 1
test(xmlenc): add Phaos decrypt vectors #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
19b5849
test(xmlenc): add Phaos decrypt vectors
polaz 10359d8
test(fixtures): cover stale donor removal
polaz 2b03e83
fix(fixtures): synchronize donor directories
polaz 7ed8eda
test(xmlenc): cover mixed key candidates
polaz 23e399d
fix(xmlenc): defer unsupported key agreement
polaz 1fc0945
style(xmlenc): format mixed key assertion
polaz 0201961
test(fixtures): cover fixture root aliases
polaz cbfbb92
fix(fixtures): reject corpus root aliases
polaz 5ffc071
test(fixtures): cover failed snapshot imports
polaz 9a7a9ca
fix(fixtures): stage donor snapshots atomically
polaz f7187c8
style(fixtures): format failure regression
polaz 3e099f1
test(fixtures): cover directory to file imports
polaz 9dcffe7
fix(fixtures): replace directory targets with files
polaz 72149ad
docs(fixtures): preserve donor artifacts verbatim
polaz af728d8
docs(tests): document donor workflow contracts
polaz 51ffdc2
test(fixtures): cover trailing directory separators
polaz 0784314
fix(fixtures): normalize directory import paths
polaz 97767ad
test(fixtures): gate importer suite on Unix
polaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| tests/fixtures/xmlenc/aleksey-xmlenc-01/*.tmpl -text whitespace=-trailing-space,-space-before-tab | ||
| tests/fixtures/xmlenc/01-phaos-xmlenc-3/** -text whitespace=-trailing-space,-space-before-tab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| This directory contains the following files: | ||
|
|
||
| Readme.txt -- This file. | ||
|
|
||
| payment.xml -- A sample XML file. | ||
|
|
||
| key.txt -- Keys for decrypting the encrypted XML files enc-*-*-*-*.xml. | ||
|
|
||
| dh-priv-key.der | ||
| -- Diffie-Hellman private key encoded in PKCS#8 PrivateKeyInfo formate. | ||
| This key can be used to decrypt the files enc-*-*-ka-dh.xml. | ||
| rsa-priv-key.der | ||
| -- RSA private key encoded in PKCS#8 PrivateKeyInfo formate. | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| This key can be used to decrypt the files enc-*-*-kt-*.xml. | ||
|
|
||
| enc-*-*-*-*.xml | ||
| -- XML document obtained by encrypting and replacing part of the | ||
| sample payment.xml. The data encryption key is in turn | ||
| encrypted. | ||
|
|
||
| Each file has the form: enc-A-B-C-D.xml, where: | ||
|
|
||
| A indicates the type of the data encrypted. This includes: | ||
|
|
||
| element = The CreditCard element. | ||
| content = The content of the CreditCard element | ||
| (multiple elements). | ||
| text = The content of the Number element (text node). | ||
|
|
||
| B indicates the data encryption algorithm. | ||
|
|
||
| C indicates the key encryption protocols: | ||
| kt = key transport | ||
| kw = key wrap | ||
| ka = key agreement | ||
|
|
||
| D indicates the key encryption algorithm. | ||
|
|
||
| bad-*-enc-*-*-*-*.xml | ||
| -- some "screw-up" samples | ||
|
|
||
| The sample encrypted XML files are produced from Phaos XML toolkit. | ||
|
|
||
| Jiandong Guo | ||
| Phaos Technology | ||
| http://www.phaos.com | ||
|
|
||
| jguo@phaos.com | ||
|
|
||
|
|
||
|
|
||
|
|
||
29 changes: 29 additions & 0 deletions
29
tests/fixtures/xmlenc/01-phaos-xmlenc-3/bad-alg-enc-element-aes128-kw-3des.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <PaymentInfo xmlns="http://example.org/paymentv2"> | ||
| <Name>John Smith</Name> | ||
| <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#"> | ||
| <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/> | ||
| <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> | ||
| <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#"> | ||
| <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-tripledes"/> | ||
| <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> | ||
| <ds:KeyName>my-tripledes-key</ds:KeyName> | ||
| </ds:KeyInfo> | ||
| <CipherData> | ||
| <CipherValue>HgVuHoXxBQWD9fvi0gt9TanywZ5lJokM/12fcMG6gRoMjsCPulH+4A==</CipherValue> | ||
| </CipherData> | ||
| <ReferenceList> | ||
| <DataReference URI="#ED"/> | ||
| </ReferenceList> | ||
| </EncryptedKey> | ||
| </ds:KeyInfo> | ||
| <CipherData> | ||
| <CipherValue> | ||
| yUMIHkj5EETckjZ59fpda4+m4YLCrkJsnuRz+Q3e5sP+VvHKRH1kdeGkXw3kYURV | ||
| JM3nQjGl2egW80oUxSykQD2F9iDoIjNhLSgIbyuse64oo/5/v9IiaUpSvrAocwLP | ||
| AzFIUmOrxmIagAkRGDOeMR8tdHLD6g84dQj4O/aGfwhL/2wUo/l+7onrbmsd6pVI | ||
| fjNyvXm+eITuyUnkDTHrCR+dfb2sHaQ3g3McgyfP6ZjI/L50SPJZ/w== | ||
| </CipherValue> | ||
| </CipherData> | ||
| </EncryptedData> | ||
| </PaymentInfo> |
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
tests/fixtures/xmlenc/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <PaymentInfo xmlns="http://example.org/paymentv2"> | ||
| <Name>John Smith</Name> | ||
| <CreditCard Currency="USD" Limit="5,000"> | ||
| <Number>4019 2445 0277 5567</Number> | ||
| <Issuer>Bank of the Internet</Issuer> | ||
| <Expiration Time="04/02"/> | ||
| </CreditCard> | ||
| </PaymentInfo> |
22 changes: 22 additions & 0 deletions
22
tests/fixtures/xmlenc/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#"> | ||
| <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/> | ||
| <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> | ||
| <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#"> | ||
| <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes192"/> | ||
| <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> | ||
| <ds:KeyName>my-aes192-key</ds:KeyName> | ||
| </ds:KeyInfo> | ||
| <CipherData> | ||
| <CipherValue></CipherValue> | ||
| </CipherData> | ||
| <ReferenceList> | ||
| <DataReference URI="#ED"/> | ||
| </ReferenceList> | ||
| </EncryptedKey> | ||
| </ds:KeyInfo> | ||
| <CipherData> | ||
| <CipherValue> | ||
| </CipherValue> | ||
| </CipherData> | ||
| </EncryptedData> |
30 changes: 30 additions & 0 deletions
30
tests/fixtures/xmlenc/01-phaos-xmlenc-3/enc-content-3des-kw-aes192.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <PaymentInfo xmlns="http://example.org/paymentv2"> | ||
| <Name>John Smith</Name> | ||
| <CreditCard Currency="USD" Limit="5,000"> | ||
| <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#"> | ||
| <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/> | ||
| <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> | ||
| <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#"> | ||
| <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes192"/> | ||
| <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> | ||
| <ds:KeyName>my-aes192-key</ds:KeyName> | ||
| </ds:KeyInfo> | ||
| <CipherData> | ||
| <CipherValue>5+GpVUQNTAT3uY8pPedEg/PpftiX+fJsTCun+fgmIz0=</CipherValue> | ||
| </CipherData> | ||
| <ReferenceList> | ||
| <DataReference URI="#ED"/> | ||
| </ReferenceList> | ||
| </EncryptedKey> | ||
| </ds:KeyInfo> | ||
| <CipherData> | ||
| <CipherValue> | ||
| QBWlf/iYDXKbBWf0Pu3Bgzt5oLBwIs4NKPb/I0SxDYVnDc34i7tZG5UzHlztsWlX | ||
| udfbIW9l7k5WVdy9bfXZWrp6sXamBedUQTrr+z4v4u2jWaUyqEioLe7h36QeoU23 | ||
| QvkOzRO9AiWm/QCCzePZ3Frp4LM9lXOE | ||
| </CipherValue> | ||
| </CipherData> | ||
| </EncryptedData> | ||
| </CreditCard> | ||
| </PaymentInfo> |
9 changes: 9 additions & 0 deletions
9
tests/fixtures/xmlenc/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <PaymentInfo xmlns="http://example.org/paymentv2"> | ||
| <Name>John Smith</Name> | ||
| <CreditCard Currency="USD" Limit="5,000"> | ||
| <Number>4019 2445 0277 5567</Number> | ||
| <Issuer>Bank of the Internet</Issuer> | ||
| <Expiration Time="04/02"/> | ||
| </CreditCard> | ||
| </PaymentInfo> |
22 changes: 22 additions & 0 deletions
22
tests/fixtures/xmlenc/01-phaos-xmlenc-3/enc-content-aes128-kw-3des.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <EncryptedData Id="ED" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns="http://www.w3.org/2001/04/xmlenc#"> | ||
| <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/> | ||
| <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> | ||
| <EncryptedKey Id="EK" xmlns="http://www.w3.org/2001/04/xmlenc#"> | ||
| <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-tripledes"/> | ||
| <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> | ||
| <ds:KeyName>my-3des-key</ds:KeyName> | ||
| </ds:KeyInfo> | ||
| <CipherData> | ||
| <CipherValue></CipherValue> | ||
| </CipherData> | ||
| <ReferenceList> | ||
| <DataReference URI="#ED"/> | ||
| </ReferenceList> | ||
| </EncryptedKey> | ||
| </ds:KeyInfo> | ||
| <CipherData> | ||
| <CipherValue> | ||
| </CipherValue> | ||
| </CipherData> | ||
| </EncryptedData> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.