diff options
-rw-r--r-- | src/regress/lib/libcrypto/asn1/asn1api.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/regress/lib/libcrypto/asn1/asn1api.c b/src/regress/lib/libcrypto/asn1/asn1api.c index 4825dd65f2..8d016bde82 100644 --- a/src/regress/lib/libcrypto/asn1/asn1api.c +++ b/src/regress/lib/libcrypto/asn1/asn1api.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1api.c,v 1.2 2021/12/14 17:10:02 jsing Exp $ */ | 1 | /* $OpenBSD: asn1api.c,v 1.3 2022/07/09 14:47:42 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2021 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2021 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -381,6 +381,26 @@ asn1_get_object(void) | |||
381 | return failed; | 381 | return failed; |
382 | } | 382 | } |
383 | 383 | ||
384 | static int | ||
385 | asn1_integer_get_null_test(void) | ||
386 | { | ||
387 | int failed = 0; | ||
388 | long ret; | ||
389 | |||
390 | if ((ret = ASN1_INTEGER_get(NULL)) != 0) { | ||
391 | fprintf(stderr, "FAIL: ASN1_INTEGER_get(NULL) %ld != 0\n", ret); | ||
392 | failed |= 1; | ||
393 | } | ||
394 | |||
395 | if ((ret = ASN1_ENUMERATED_get(NULL)) != 0) { | ||
396 | fprintf(stderr, "FAIL: ASN1_ENUMERATED_get(NULL) %ld != 0\n", | ||
397 | ret); | ||
398 | failed |= 1; | ||
399 | } | ||
400 | |||
401 | return failed; | ||
402 | } | ||
403 | |||
384 | int | 404 | int |
385 | main(int argc, char **argv) | 405 | main(int argc, char **argv) |
386 | { | 406 | { |
@@ -389,6 +409,7 @@ main(int argc, char **argv) | |||
389 | failed |= asn1_tag2bit(); | 409 | failed |= asn1_tag2bit(); |
390 | failed |= asn1_tag2str(); | 410 | failed |= asn1_tag2str(); |
391 | failed |= asn1_get_object(); | 411 | failed |= asn1_get_object(); |
412 | failed |= asn1_integer_get_null_test(); | ||
392 | 413 | ||
393 | return (failed); | 414 | return (failed); |
394 | } | 415 | } |