diff options
author | Richard Levitte <levitte@openssl.org> | 2017-04-10 21:50:25 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2017-04-11 22:08:41 +0200 |
commit | afd7cae2713e407bce5cd7bbc47fcf9c1d7c3862 (patch) | |
tree | c8045c065729edf8f5cc7a6407911b0a7b2cb361 /test/asn1_encode_test.c | |
parent | fe55c4a20f79c77c64a082c5df2c5e8a61317162 (diff) | |
download | openssl-afd7cae2713e407bce5cd7bbc47fcf9c1d7c3862.zip openssl-afd7cae2713e407bce5cd7bbc47fcf9c1d7c3862.tar.gz openssl-afd7cae2713e407bce5cd7bbc47fcf9c1d7c3862.tar.bz2 |
Fix int64 test of t_4bytes_4_neg
{ 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)
Diffstat (limited to 'test/asn1_encode_test.c')
-rw-r--r-- | test/asn1_encode_test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/asn1_encode_test.c b/test/asn1_encode_test.c index 45e3005..36cf7f9 100644 --- a/test/asn1_encode_test.c +++ b/test/asn1_encode_test.c @@ -381,7 +381,7 @@ static ASN1_INT64_DATA int64_expected[] = { CUSTOM_EXPECTED_SUCCESS(0x80000000, 0x80000000), /* t_4bytes_1 */ CUSTOM_EXPECTED_SUCCESS(INT32_MAX - 1, INT32_MAX -1), /* t_4bytes_2 */ CUSTOM_EXPECTED_FAILURE, /* t_4bytes_3_pad (illegal padding) */ - CUSTOM_EXPECTED_SUCCESS(0x80000000, 0x80000000), /* t_4bytes_4_neg */ + CUSTOM_EXPECTED_SUCCESS(INT32_MIN, INT32_MIN), /* t_4bytes_4_neg */ CUSTOM_EXPECTED_FAILURE, /* t_4bytes_5_negpad (illegal padding) */ }; static ASN1_INT64_DATA int64_encdec_data[] = { @@ -419,7 +419,8 @@ static ASN1_UINT64_DATA uint64_expected[] = { CUSTOM_EXPECTED_SUCCESS(ASN1_LONG_UNDEF, ASN1_LONG_UNDEF), /* t_zero */ CUSTOM_EXPECTED_SUCCESS(1, 1), /* t_one */ CUSTOM_EXPECTED_FAILURE, /* t_9bytes_1 */ - CUSTOM_EXPECTED_SUCCESS(INT64_MIN, INT64_MIN), /* t_8bytes_1 */ + CUSTOM_EXPECTED_SUCCESS((uint64_t)INT64_MAX+1, (uint64_t)INT64_MAX+1), + /* t_8bytes_1 */ CUSTOM_EXPECTED_SUCCESS(INT64_MAX, INT64_MAX), /* t_8bytes_2 */ CUSTOM_EXPECTED_FAILURE, /* t_8bytes_3_pad */ CUSTOM_EXPECTED_FAILURE, /* t_8bytes_4_neg */ |