Commit Graph

452 Commits

Author SHA1 Message Date
Christopher Brown
678b6d9641 fix constructed type identifier check 2014-08-28 14:02:56 +02:00
Steffen Jaeckel
171eae5378 asn1: use LTC_SET_ASN1 macro to access ltc_asn1_list elements 2014-08-28 14:02:56 +02:00
Steffen Jaeckel
4071475558 fix compiler warnings 2014-08-28 13:53:51 +02:00
Steffen Jaeckel
78e367895a Merge branch 'feature/testRsaPkcs1' into develop
This closes #48
2014-08-28 13:35:13 +02:00
Steffen Jaeckel
efc6844f9c tests: add function print_hex() 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
64f887e8f3 predictable rand() values please 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
8ce125f8a8 mp_rand() assumes the number of digits and not the bitsize as parameter 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
f86d36c676 rsa_test: improve a bit 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
536a199203 rsa_test: fix valgrind warnings 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
d51715db72 pkcs#1 v1.5 decode: fix missing check of PS length in EMSA mode 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
2b3c603c6c udpate bleichenbacher signature attack
also test for too short padding strings
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
e227000578 tests: remove surplus ';' in DO()/DOX() macros 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
5eb9743410 rsa_verify_hash: fix possible bleichenbacher signature attack 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
c6dfef95eb testprof/rsa_test: add testcase for bleichenbacher signature attack 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
dc0c6ed9d9 regen rsa-testvectors 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
7c10ec9dd2 add makefile for rsa-testvectors 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
2c69088be8 execute only one testcase per default 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
92274aafb5 add testprof/pkcs_1_eme_test 2014-08-28 13:30:26 +02:00
Steffen Jaeckel
c24e2a1e6b fix pkcs1v15crypt-vectors.txt 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
b51824748a rt.py: extend for PKCS#1 v1.5 EME 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
7302a7cfcb add testprof/pkcs_1_emsa_test 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
25fcd4c70f rt.py: add possibility to parse PKCS#1 v1.5 EMSA testvectors 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
95f9d527f6 rt.py: start making even more generic, fixed naming of p and q 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
c99a147d4a add testprof/pkcs_1_oaep_test 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
ed0982b7e7 add oaep testvectors 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
b0c7cbfaae improve testprof/pkcs_1_pss_test 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
60b9c5a6f1 make pkcs1 test more generic 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
faa9c6a607 add missing unregister of no_prng 2014-08-28 13:30:25 +02:00
Jonathan Herzog
3324da2601 Fixed small padding error in the PKCS#1 PSS code.
The existing LTC code for padding meassages for PSS signatures
contained a small error. In particular, the PSS-passing algorithms is
supposed to be given (bitlength of key - 1) as an argument. The LTC
code passes (bitlength of key), and subtracts 1 in the middle of the
PSS-padding. This subtraction unfortunately comes too late: a
calculation using that argument has already been made. Fortunately,
this bug only appeared if the bit-length of the key was 1 mod 8, and
so is unlikely to show up in practice. Still, this patch fixes the
problem.

Conflicts:
	src/pk/pkcs1/pkcs_1_pss_decode.c
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
fe1b6eced7 add testprof/pkcs_1_pss_test 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
b570175b47 add testprof/no_prng
a PRNG that is no PRNG as its output is predefined and can be set
by calling add_entropy()
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
4a819b2f1b add generated file pss-vect.c 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
269516533c rt.py: add name of testcase in struct 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
055c515161 fix pss-vect.txt 2014-08-28 13:30:25 +02:00
Steffen Jaeckel
6dfe0013e1 rt.py: initial version 2014-08-28 13:30:24 +02:00
Steffen Jaeckel
b2317279b8 add original RSA testvector files 2014-08-28 13:30:24 +02:00
Steffen Jaeckel
394806cab1 tests: use correct format string parameter for 64bit values on windows 2014-08-28 13:27:52 +02:00
Steffen Jaeckel
14272976d0 add release flag to makefile.shared 2014-08-27 18:20:47 +02:00
Steffen Jaeckel
47b8ccc07c fix hash ID's of ripemd 256 & 320 2014-08-26 17:42:10 +02:00
Steffen Jaeckel
473b0319ad re-enable "unused-parameters" warning 2014-08-24 18:25:24 +02:00
Steffen Jaeckel
01c34dc236 trim trailing spaces 2014-08-24 18:25:24 +02:00
Steffen Jaeckel
1fb649d394 chc: don't execute tests if LTC_TEST is not defined 2014-08-07 01:36:03 +02:00
Steffen Jaeckel
f8449f55d9 trim trailing spaces 2014-08-07 01:36:03 +02:00
Jonathan Herzog
ff736a61bb Hash functions now check for input-length overflow.
Because many of the hash-functions implemented by LTC use the length
of the input when padding the input out to a block-length, LTC keeps
track of the input length in a 64-bit integer. However, it did not
previously test for overflow of this value. Since many of the
hash-functions implemented by LTC are defined for inputs of length
2^128 bits or more, this means that LTC was incorrectly implementing
these hash functions for extremely long inputs. Also, this might have
been a minor security problem: A clever attacker might have been able
to take a message with a known hash and find another message (longer
by 2^64 bits) that would be hashed to the same value by LTC.

Fortunately, LTC uses a pre-processor macro to make the actual code
for hashing, and so this problem could be fixed by adding an
overflow-check to that macro.
2014-08-06 19:06:00 +02:00
Steffen Jaeckel
757ac982a5 if selected, always make targets 'test' and 'testprof/$(LIBTEST)' 2014-08-06 15:16:37 +02:00
Steffen Jaeckel
09a0de69a0 update makefile.mingw 2014-08-06 15:16:30 +02:00
Steffen Jaeckel
98e05b10a0 trim trailing spaces in mingw makefiles 2014-08-06 15:11:45 +02:00
Steffen Jaeckel
a8598b0faf fix unregister_prng() where always the first prng would have been removed 2014-08-05 17:47:50 +02:00
Steffen Jaeckel
3cda802deb fixed ecc_test.c
luckily gcc 4.6 of travis CI complained!

shame on you gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)
2014-07-17 12:10:05 +02:00
Steffen Jaeckel
48bd6702aa uncomment argchk in camellia_setup() 2014-07-17 11:32:52 +02:00