Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
O
OpenPGP interoperability test suite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sequoia-pgp
OpenPGP interoperability test suite
Commits
62f411e0
Verified
Commit
62f411e0
authored
Nov 13, 2020
by
Justus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the Shattered test vectors.
parent
4b3859dd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
108 additions
and
0 deletions
+108
-0
data/messages/shattered-1.pdf
data/messages/shattered-1.pdf
+0
-0
data/messages/shattered-1.pdf.asc
data/messages/shattered-1.pdf.asc
+14
-0
data/messages/shattered-2.pdf
data/messages/shattered-2.pdf
+0
-0
data/messages/shattered-2.pdf.asc
data/messages/shattered-2.pdf.asc
+14
-0
src/tests/hashes.rs
src/tests/hashes.rs
+3
-0
src/tests/hashes/shattered.rs
src/tests/hashes/shattered.rs
+77
-0
No files found.
data/messages/shattered-1.pdf
0 → 100644
View file @
62f411e0
File added
data/messages/shattered-1.pdf.asc
0 → 100644
View file @
62f411e0
-----BEGIN PGP SIGNATURE-----
wsDzBAABAgAdFiEE0aZuGiOxgsmYD3iM+/zIKgFeczAFAl+uh1wACgkQ+/zIKgFe
czBqzAv9G9v98so++R88YSVMTGbfzq4fSh4C/DkfZCT9+j6H1IpYfjfouFQNtTE7
0ACiusd0cTxBdRKOqsbh9EW3yfv77+8XU+sNY0QZ2UgfbEW1USAP4BgACMkpSu5X
mlcE65jw7bhfdnnNsypOKORpH/uyLSMTAvBj3rrzFyikDjJwmSyLdJocjCawkr0U
aOQfDZfJVXhRCj9oXrRW2LBdB7HsLqwFvt/EIct8FYnTxriV8+xuVaihCbX357uE
NXqbT8x07xMAUws/iwrHptmPZP6sz4+bdekMXAMncY4hBR8J0NDh6vpq8yYRylpa
ebJ8mLGhujJPIcU12VOMimGE7+zpAwmlJgPQqdZsjS1ZuvQ/BS37hRIvdUTZljff
EXqqJq3SwZOvdvyRzTk3vciZhEzJ2aLSj0A4PY/k/6fZEdY3ZHRKdWP3btOU6GNF
b+BXPE/eNerLy0Y5BgMOKfsOaqPGz4bDJTNv83gsbYPyFXvhb0hTESRgyNeGC+rC
WOUcC767
=Ox9v
-----END PGP SIGNATURE-----
data/messages/shattered-2.pdf
0 → 100644
View file @
62f411e0
File added
data/messages/shattered-2.pdf.asc
0 → 100644
View file @
62f411e0
-----BEGIN PGP SIGNATURE-----
wsDzBAABAgAdFiEE0aZuGiOxgsmYD3iM+/zIKgFeczAFAl+uh3MACgkQ+/zIKgFe
czCqAgwAtNZWYfg3S2kytvaBjxW9nExtj5/Iacuxv08xUVdnJ8S+KZh0i3WXy4wo
d0ZhN2WlcoTY71Eof1QEvoSyoWJ1LaK9xsRiKoQCj0+NFXCzUzLoB08iYh+7hc9c
q0jn7m6Sp8BwKQ3fsE/ytR4bQPgWOY2FFRv4V6YUcmt5HdBzcIUyztyWTFIXt50S
68N4kcF+3qB51eIwvKPkKFLIOrIc5Ds1IgMjlu2jMZzsDkFQDr4rJ9efUMjuDGya
8fy5oCEtpxXcM9KUtiZSxMoKjisrBMFQV32rxu/W7EfvN280rgqz0G9j+8Ha0UX4
xQz+/ygkmf3aAHW4cx2iQC72UfuvfqW/07XRa7HDFYwfP/kr50LtyhxfV91nKdIo
i3pFKmM6DH9j+bDfeAvLhvRDBgjuhLQCbEu7pVEeLWoISh7F2TE2xz0XUz1YPQv7
p2Ma6X7buWPGX1Z9+26tdaU/7YWX33+PZ6QXDzmHCGba14Ya36RqE99tobislcIT
q4Z/4b0w
=p4TW
-----END PGP SIGNATURE-----
src/tests/hashes.rs
View file @
62f411e0
...
...
@@ -10,6 +10,8 @@ use crate::{
},
};
mod
shattered
;
pub
fn
schedule
(
report
:
&
mut
Report
)
->
Result
<
()
>
{
use
openpgp
::
types
::
HashAlgorithm
::
*
;
...
...
@@ -26,6 +28,7 @@ pub fn schedule(report: &mut Report) -> Result<()> {
openpgp
::
Cert
::
from_bytes
(
data
::
certificate
(
"bob-secret.pgp"
))
?
,
b
"Hello, world!"
.to_vec
()
.into_boxed_slice
(),
hash
)
?
));
}
report
.add
(
Box
::
new
(
shattered
::
Shattered
::
new
()
?
));
Ok
(())
}
src/tests/hashes/shattered.rs
0 → 100644
View file @
62f411e0
use
crate
::{
Data
,
OpenPGP
,
Result
,
data
,
tests
::{
ConsumerTest
,
Expectation
,
Test
,
TestMatrix
,
},
};
/// Explores whether SHA-1 signatures over colliding files are
/// considered valid.
pub
struct
Shattered
{
}
impl
Shattered
{
pub
fn
new
()
->
Result
<
Shattered
>
{
Ok
(
Shattered
{
})
}
}
impl
Test
for
Shattered
{
fn
title
(
&
self
)
->
String
{
"Signature over the shattered collision"
.into
()
}
fn
description
(
&
self
)
->
String
{
"<p>This tests whether detached signatures using SHA-1 over
the collision from the paper <i>The first collision for full
SHA-1</i> are considered valid.</p>"
.into
()
}
fn
artifacts
(
&
self
)
->
Vec
<
(
String
,
Data
)
>
{
vec!
[(
"Certificate"
.into
(),
data
::
certificate
(
"bob.pgp"
)
.into
())]
}
fn
run
(
&
self
,
implementations
:
&
[
Box
<
dyn
OpenPGP
+
Sync
>
])
->
Result
<
TestMatrix
>
{
ConsumerTest
::
run
(
self
,
implementations
)
}
}
impl
ConsumerTest
for
Shattered
{
fn
produce
(
&
self
)
->
Result
<
Vec
<
(
String
,
Data
,
Option
<
Expectation
>
)
>>
{
Ok
(
vec!
[
(
"SIG-1 over PDF-1"
.into
(),
data
::
message
(
"shattered-1.pdf.asc"
)
.into
(),
Some
(
Err
(
"Attack must be mitigated"
.into
()))),
(
"SIG-1 over PDF-2"
.into
(),
data
::
message
(
"shattered-1.pdf.asc"
)
.into
(),
Some
(
Err
(
"Attack must be mitigated"
.into
()))),
(
"SIG-2 over PDF-1"
.into
(),
data
::
message
(
"shattered-2.pdf.asc"
)
.into
(),
Some
(
Err
(
"Attack must be mitigated"
.into
()))),
(
"SIG-2 over PDF-2"
.into
(),
data
::
message
(
"shattered-2.pdf.asc"
)
.into
(),
Some
(
Err
(
"Attack must be mitigated"
.into
()))),
])
}
fn
consume
(
&
self
,
i
:
usize
,
pgp
:
&
mut
dyn
OpenPGP
,
artifact
:
&
[
u8
])
->
Result
<
Data
>
{
let
message
=
match
i
{
0
|
2
=>
data
::
message
(
"shattered-1.pdf"
),
1
|
3
=>
data
::
message
(
"shattered-2.pdf"
),
_
=>
unreachable!
(),
};
pgp
.verify_detached
(
data
::
certificate
(
"bob.pgp"
),
message
,
artifact
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment