diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2017-12-09 14:34:10 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2017-12-09 14:34:10 +0000 |
commit | 4a4bc410a78e4fef659e78d2eb3ab3a6ca496263 (patch) | |
tree | 74b402a6f665417cd596e25da027a0f119310af5 /regress/lib | |
parent | 0739c4672543a26cc0c0df9fab292d265a926565 (diff) |
Use a test value that fits into a long on both 32-bit and 64-bit
architectures, so that the regress passes on both.
Diffstat (limited to 'regress/lib')
-rw-r--r-- | regress/lib/libcrypto/asn1/asn1evp.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/regress/lib/libcrypto/asn1/asn1evp.c b/regress/lib/libcrypto/asn1/asn1evp.c index dd87bbb0209..d1870f9acc7 100644 --- a/regress/lib/libcrypto/asn1/asn1evp.c +++ b/regress/lib/libcrypto/asn1/asn1evp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1evp.c,v 1.1 2017/11/28 16:47:55 jsing Exp $ */ +/* $OpenBSD: asn1evp.c,v 1.2 2017/12/09 14:34:09 jsing Exp $ */ /* * Copyright (c) 2017 Joel Sing <jsing@openbsd.org> * @@ -21,10 +21,12 @@ #include <openssl/asn1.h> +#define TEST_NUM 0x7fffffffL + unsigned char asn1_atios[] = { - 0x30, 0x14, 0x02, 0x08, 0x7f, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x04, 0x08, 0x00, 0x01, - 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x30, 0x10, 0x02, 0x04, 0x7f, 0xff, 0xff, 0xff, + 0x04, 0x08, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, + 0x06, 0x07, }; unsigned char test_octetstring[] = { @@ -66,7 +68,7 @@ int main(int argc, char **argv) { unsigned char data[16]; - long num = LONG_MAX; + long num = TEST_NUM; int failed = 1; ASN1_TYPE at; int len; @@ -100,8 +102,8 @@ main(int argc, char **argv) fprintf(stderr, "FAIL: ASN1_TYPE_get_int_octetstring failed\n"); goto done; } - if (num != LONG_MAX) { - fprintf(stderr, "FAIL: got num %li, want %li\n", num, LONG_MAX); + if (num != TEST_NUM) { + fprintf(stderr, "FAIL: got num %li, want %li\n", num, TEST_NUM); goto done; } if (compare_data("octet string", data, len, @@ -120,8 +122,8 @@ main(int argc, char **argv) fprintf(stderr, "FAIL: ASN1_TYPE_get_int_octetstring failed\n"); goto done; } - if (num != LONG_MAX) { - fprintf(stderr, "FAIL: got num %li, want %li\n", num, LONG_MAX); + if (num != TEST_NUM) { + fprintf(stderr, "FAIL: got num %li, want %li\n", num, TEST_NUM); goto done; } if (len != sizeof(test_octetstring)) { |