This mainly adds tests for RSA-PSS.
BoringSSL is OK.
BouncyCastle has a minor bug.
OpenJdk is adding PSS, but we don't have that version yet.
Some test run:
http://sponge/a0f74aa9-cbf9-4e8c-8328-7763a8c202dc
PiperOrigin-RevId: 206120374
GitOrigin-RevId: 77979cd774420794645b988bc8e71d3d727f0ddd
Tests using the new test vectors will be added in another CL.
Changes:
AES-GCM has test vectors for modified tags, which were previously missing.
ECDSA has more test vectors for potential arithmetic errors.
There are no more random test vectors.
Webcrypto has a few test vectors with the bitcoin curve (since some libraries
want to add this).
DSA and ECDSA have more invalid test vectors with r,s = ((q-1)/2 or q-1).
This is motivated by some weak ElGamal implementation in beecrypt.
ECDH test vectors have some new files where the public key is just a point
using SEC 1 / X9.62 format.
All tests for ASN modifications are removed from ecdh_test.json, so that
this file has a more resonable size. These test vectors are included in
the files ecdh_curve_test.json.
EDDSA has a few more invalid test vectors for malformed signatures.
(I.e. the python implementation in the RFC has a small bug).
Adding test vectors for AES-CCM. (tested against BouncyCastle, which sort of
abuses the JCE interface)
There are some test vectors for RSA-PSS (so far tested with BouncyCastle and boringSSL)
More tests will be added when we have an idea what is actually being used.
PiperOrigin-RevId: 205802874
GitOrigin-RevId: 250ab89370a0dcfc56e887fb185a494f45f9a3f5
* Add more information about the used Java Runtime and the tested provider version
* Added some recent information about SunEC and Utimaco HSM problems
This supports RFC 3394 and RFC 5649,
which is also described in NIST SP 800 38f.
I also have a mini analysis of the primitive:
If one cares about distinguishing attacks then
there is an attack with a somewhat smaller complexity
than what NIST claims in their standard:
https://docs.google.com/document/d/1oH36v6SNdff5tkydC75EnqRyqqgHbXR4hy_SMPzwqVU/edit?usp=sharing
But even if one cares about these attacks then the key
wrappings are nowhere comparable to the attacks possible against e.g.
AES-GCM.
PiperOrigin-RevId: 192747615
GitOrigin-RevId: 0bebc767022ba3053c1d0391378d5c0b32b7f5be
- Remove `extends TestCase` which triggered usage of the JUnit3 runner
- Replace `import static org.junit.Assert.assertArrayEquals;` with `import static org.junit.Assert.*;`
- Replace `import junit.framework.TestCase;` with `import org.junit.Test;`
- Annotate all existing test methods (that are prefixed with 'test' and have no args) with `@Test`
update/doFinal are required to be "copy-safe". From the javadoc:
Note: this method should be copy-safe, which means the input and output
buffers can reference the same block of memory and no unprocessed input
data is overwritten when the result is copied into the output buffer.
However many implementations of JCE methods do not implement this property in
all cases. Notably, BouncyCastle fails this test on arrays, and the built-in
OpenJDK providers fail when the input bytebuffer is either a read-only
array-backed byte buffer, or if the buffers are direct buffers. For SunJCE,
this has been acknowledged publicly by Oracle at
https://bugs.openjdk.java.net/browse/JDK-8181386 .
These new tests verify correct overlapping buffer handling for AES/GCM
specifically; as future work, it would be good to generalize these tests for
other ciphers and modes.
The current code fails to initialize the cipher c after a c.doFinal()
fails. According to JCE documentation, a cipher is in an undefined state
after throwing an exception.
- add maven entry for BC 1.56 and update the versions range
- DHIES weak crypto tests now pass if algs not even supported
- some ECIES entries moved to the invalid list
- ECIES decryption init calls fixed to pass the correct parameters
- EciesTest.testModifyPoint now expects GeneralSecurityException
* Removing duplicates from BigIntegerTest.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142548323
* Remove @NoPresubmitCheck from testModifiedPublic() and testModifiedPublicSpec(). The corresponding bug was fixed in BC 1.55 or BC 1.56.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142561682
* minor typos
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142743772
* Regenerating the test vectors for ECDSA:
- this adds more comments for bugtypes and modifications or the signatures.
- fixes some ugly formatting.
- adds some additional test vectors.
There are no new bugs.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144619819
* Regenerating DSA test vectors:
This adds a few more test vectors.
The test vectors are now divided between test vectors with valid BER encodings
and test vectors with invalid DER encodings.
The description of the test vector better describes what was modified.
Also fixing issue #17 on Github: testVectors in DsaTest not using the message parameter
There are no changes to the presubmit tests. Tests that can be enabled because of the
Oracles security update will be added in another CL.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144814889
* Regenerating test vectors for EcdhTest.java
Merging a test with small order into the test vectors.
Fixing ASN encoding of 0 (from 0200 to 020100, i.e. length must be > 0).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144815129
* Regenerating RSA signatures.
Adding test vectors that were removed because of b/31575502. Oracle fixes this with CVE-2016-5547.
Changing ASN tags with value 0x50 to 0x30 (0x50 would be something like sequence of sequence but does not exist), hence the old vectors are unlikely to cause problems.
Adding more modifications of OIDs. The new vectors unpack the OIDs and change the nodes.
(E.g. the OID for sha256 is the hexadecimal string "608648016503040201" which is an
ASN encoding of "2.16.840.1.101.3.4.2.1". The new test vectors include invalid encoding,
encodings with additional nodes, deleted nodes and nodes that are changed to large integers)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=144846826
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145060646
* Removing presubmit restrictions for tests that have been fixed internally and upstream.
Mainly these are tests with CVEs that were announced during the Jan 17 security update
by Oracle.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145397539
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145418516
* Adding the CVE numbers from Oracles Jan 17 security update to the documentation.
Minor changes to some test vectors: Some of the garbage added to the ASN encoding
was itself incorrect and has been replaced.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145650774
* ECDSA MODIFIED_SIGNATURES should be public now.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146186539