Commit graph

49 commits

Author SHA1 Message Date
Steffen Jaeckel
47162b9609 Add demos/der_print_flexi.c
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:56:42 +01:00
Steffen Jaeckel
78bb06c8d6 Minor cleanup
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-12 18:25:09 +02:00
Steffen Jaeckel
fe32e7ea9d Add LTC_ARRAY_SIZE() macro
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-06 15:00:00 +02:00
Steffen Jaeckel
6155a33e5f Use COMPARE_TESTVECTOR() consistently
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-06 15:00:00 +02:00
Steffen Jaeckel
236477823a prefix the MPI related macros with ltc_
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-20 14:41:50 +01:00
Steffen Jaeckel
1d07689581 Remove unnecessary casts in the tests
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-11-08 17:15:39 +01:00
Steffen Jaeckel
a76447f7aa add file-iterator to test_process_dir()
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
dc883ea0ea Add Testcase for #627
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 13:06:53 +02:00
Steffen Jaeckel
5fa7837f3a Add empty stub for s_der_tests_print_flexi()
So we don't have to `#ifdef` whether it's available or not.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 11:37:19 +02:00
Steffen Jaeckel
c939720699 Add Testcase that UTF-8 decoding respects the ASN.1 length
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 11:37:19 +02:00
Steffen Jaeckel
87665fb276 Calm scan-build static analyser
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 16:34:07 +02:00
Steffen Jaeckel
1c805e1c66 use LTC_NULL in the library code
`NULL` as defined by the standard is not guaranteed to be of a pointer
type. In order to make sure that in vararg API's a pointer type is used,
define our own version and use that one internally.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-08-31 13:05:00 +02:00
Steffen Jaeckel
2c51ae81ac make sure to check yarrow_read() return values
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-03-17 15:08:37 +01:00
Steffen Jaeckel
7a8496df5c better debug output
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
1052703116 fix/improve DER tests
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
James Muir
2092250088 Add new utf8 test-vector, update comments explaining utf8 decoding
Description:
Minor changes to help test and clarify the way utf8 strings are
decoded.  This originated from my misunderstanding of the fix for
issue #507.  The new test-vector uses two bytes to encode each
wide-char.

The utf8 format is described here:

  https://tools.ietf.org/html/rfc3629#section-3

Testing:

  $ make clean
  $ make CFLAGS="-DUSE_LTM -DLTM_DESC -I../libtommath" EXTRALIBS="../libtommath/libtommath.a" test
  $ ./test

You can confirm that the new utf8 test data is correct using python:

  >>> s="\xD7\xA9\xD7\x9C\xD7\x95\xD7\x9D"
  >>> s.decode("utf-8")
  u'\u05e9\u05dc\u05d5\u05dd'
2021-01-15 20:55:09 -05:00
Steffen Jaeckel
c5d7bfb2cc manually fix the remaining leading _'s 2020-07-16 10:38:33 +02:00
Steffen Jaeckel
9824af8e3b update header 2020-07-14 18:41:30 +02:00
Steffen Jaeckel
24765c30c5 remove footer 2020-07-14 18:41:29 +02:00
Steffen Jaeckel
cac400cf79 really implement DER decoding resursion limit
PR #373 did not really fix the issue of preventing a potential stack
overflow in case a lot of nested sequences have to be decoded.
Instead it only threw an error after successfully decoding all the nested
sequences.
This change fixes this and prevents the decoding.
2020-06-20 12:28:22 +02:00
Steffen Jaeckel
68cc580602 use macros in more tests 2019-10-17 12:49:20 +02:00
Steffen Jaeckel
ef55d1335e fix some MSVC compiler warnings 2019-10-17 10:29:27 +02:00
Steffen Jaeckel
2a63adc1ab add XSTRLEN 2019-10-17 10:29:27 +02:00
Steffen Jaeckel
d2027d60eb add testcase for issue #507 2019-10-11 14:32:22 +02:00
Steffen Jaeckel
eaf2c7b6b9 fix build for msvc 2019-09-24 14:09:35 +02:00
Steffen Jaeckel
1a90da844c only print der flexi-test on higher debug level
it's smashing the stack for some inputs :>
2018-09-07 11:58:54 +02:00
Steffen Jaeckel
6584569872 add another OID testcase for root-node 3 2018-09-07 08:24:25 +02:00
Steffen Jaeckel
079ed04b17 add OID testcase from x.690 2018-09-07 08:24:25 +02:00
Karel Miko
4fb0562a3b fix -Wmissing-declarations -Wmissing-prototypes -Wmissing-noreturn 2018-07-07 19:54:08 +02:00
Steffen Jaeckel
0011f7f927 add generic test_process_dir() 2018-05-23 10:33:47 +02:00
Karel Miko
24c0eb84f9 ECC curves y^2 = x^3 + ax + b 2018-05-22 23:02:44 +02:00
Steffen Jaeckel
62c2124b82 implement DER resursion limit 2018-04-11 11:15:21 +02:00
Karel Miko
065c89108e base64_* use char * for Base64 strings 2018-03-26 16:42:19 +02:00
Steffen Jaeckel
b026c23b0a use do_compare_testvector() where possible 2018-03-22 16:12:56 +01:00
Steffen Jaeckel
e1cba4da7d fix der_test and rsa_test when compiling for msvc 2018-03-22 16:12:56 +01:00
Steffen Jaeckel
7fb108d884 add full-debug build to ci-tests 2018-03-10 17:37:54 +01:00
Steffen Jaeckel
3cfdd4bfdb fix compilation with debug output enabled 2018-03-10 11:34:05 +01:00
Steffen Jaeckel
9d03c38ea4 add flags to der_decode_sequence() 2018-02-25 20:42:26 +01:00
Steffen Jaeckel
7e2d163d1d add testvectors from [1]
[1] https://misc.daniel-marschall.de/asn.1/oid_facts.html
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
3431763275 update/add more DER tests 2018-02-25 20:42:26 +01:00
Steffen Jaeckel
b75c3ce9db remove LTC_ASN1_CONSTRUCTED and LTC_ASN1_CONTEXT_SPECIFIC 2018-02-25 20:42:26 +01:00
Steffen Jaeckel
64875d3a8f add ASN.1-length functions 2018-02-25 20:42:26 +01:00
Steffen Jaeckel
a898fde5b7 better debug output 2018-01-11 18:06:23 +01:00
Steffen Jaeckel
fdc6cd2013 improve tests and timing in regards to MPI provider selection 2017-10-18 08:46:17 +02:00
Steffen Jaeckel
efa089e211 fixup #290 2017-10-01 22:56:47 +02:00
Steffen Jaeckel
a65cfb8dbe make it possible to 'make all' w/o an MPI provider 2017-08-07 21:11:42 +02:00
Steffen Jaeckel
6fc0a90a1e fix headers & footers in demos & tests 2017-06-20 15:16:11 +02:00
Steffen Jaeckel
fe19dad623 replace SVN tags 2017-06-20 15:16:11 +02:00
Steffen Jaeckel
5a3a27bbd6 rename der_tests to der_test 2017-06-08 22:20:45 +02:00
Renamed from tests/der_tests.c (Browse further)