summaryrefslogtreecommitdiffstats
path: root/test/asn1_encode_test.c
AgeCommit message (Collapse)Author
2021-08-13Revert "Fix test/asn1_encode_test.c to not use ASN1_FBOOLEAN"Tomas Mraz
This reverts commit 5434acb6c4d56507d761b28f7e142ccab808a8fa. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/16308)
2021-08-13Revert "Fix test/asn1_encode_test.c to handle encoding/decoding failure"Tomas Mraz
This reverts commit f1d97905bbd8679b7647c992b97f526791069040. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/16308)
2021-07-10Fix test/asn1_encode_test.c to handle encoding/decoding failureRichard Levitte
Make it only report (and fail on) encoding/decoding failures when success is expected. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16027)
2021-07-10Fix test/asn1_encode_test.c to not use ASN1_FBOOLEANRichard Levitte
ASN1_FBOOLEAN is designed to use as a default for optional ASN1 items. This test program used it for non-optional items, which doesn't encode well. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16027)
2020-12-08Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2020-12-08Add a test for encoding/decoding using an invalid ASN.1 TemplateMatt Caswell
If you have a CHOICE type that it must use explicit tagging - otherwise the template is invalid. We add tests for this. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
2019-05-28Update copyright yearRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9034)
2019-03-11fix truncation of integers on 32bit AIXShane Lontis
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8417) (cherry picked from commit 98f29466dc1ed7f80b9b8750309a41b5a1150d25)
2018-02-27Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2018-02-21Use malloc to avoid alignment problems.Viktor Dukhovni
Thanks to Norm Green for reporting this issue. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5423)
2017-11-13Resolve warnings in VC-WIN32 build, which allows to add /WX.Andy Polyakov
It's argued that /WX allows to keep better focus on new code, which motivates its comeback... Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4721)
2017-08-12Fix some typo and commentsFdaSilvaYY
[skip ci] Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4149)
2017-07-27Update the test framework so that the need for test_main is removed. EverythingPauli
that needed test_main now works using the same infrastructure as tests that used register_tests. This meant: * renaming register_tests to setup_tests and giving it a success/failure return. * renaming the init_test function to setup_test_framework. * renaming the finish_test function to pulldown_test_framework. * adding a user provided global_init function that runs before the test frame work is initialised. It returns a failure indication that stops the stest. * adding helper functions that permit tests to access their command line args. * spliting the BIO initialisation and finalisation out from the test setup and teardown. * hiding some of the now test internal functions. * fix the comments in testutil.h Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3953)
2017-06-22TAP line filter BIO.Pauli
This is an implementation of a BIO filter that produce TAP compatible output for the test framework. The current test indentation level is honoured. The test output functions have been modified to not attempt to indent their output and to not include the leading '#' character. The filter is applied to bio_err only. bio_out is left unchanged, although tests using bio_out have been modified to use bio_err instead. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3732)
2017-06-19Put error output back.Pauli
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3710)
2017-06-19Update tests to avoid printf to stdout/stderr when running as test cases.Pauli
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3710)
2017-04-30test/asn1_encode_test.c: test "next negative minimum" corner case.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-04-24Adapt all test programsRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3243)
2017-04-13ASN.1: adapt our use of INTxx et al by making them explicitely embeddedRichard Levitte
Fixes #3191 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3199)
2017-04-12Test printing of ASN.1 types INTxx et alRichard Levitte
[extended tests] Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3190)
2017-04-12Add tests of custom negative 1Richard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3174)
2017-04-12Fix definition of i2d_fn in asn1_encode_test.cRichard Levitte
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3174)
2017-04-12In asn1_encode_test.c, add custom DER encoding checksRichard Levitte
We're already checking that custom DER decodes to expected values (or fails to do so), but we didn't check if values encode back to expected DER. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3174)
2017-04-11Fix int64 test of t_4bytes_4_negRichard Levitte
{ 0x80, 0x00, 0x00, 0x00 } decoded isn't (positive) 0x80000000, it's (negative) INT32_MIN. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3160)
2017-04-11Reject decoding of an INT64 with a value >INT64_MAXMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3159)
2017-04-10Act on deprecation of LONG and ZLONG, step 1Richard Levitte
Don't compile code that still uses LONG when it's deprecated Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3126)
2017-04-10Publish our INT32, UINT32, INT64, UINT64 ASN.1 types and Z variantsRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3126)
2017-04-05Fix test/asn1_encode_test.c, ASN1_LONG_DATA used inappropriatelyRichard Levitte
It's sheer luck that this was used for the first field only which also has the same type in all data structures, so the offsets were never wrong Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3127)
2017-04-04Add a test of encoding and decoding LONG, INT32, UINT32, INT64 and UINT64Richard Levitte
Also Z varieties. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3088)