This is the documented behavior which got lost in the recent rewrite.
Mismatch of documentation and reality pointed out by schwarze
ok jsing
-/* $OpenBSD: a_enum.c,v 1.24 2022/06/25 16:15:18 jsing Exp $ */
+/* $OpenBSD: a_enum.c,v 1.25 2022/07/09 14:46:43 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
{
int64_t val;
+ if (aenum == NULL)
+ return 0;
if (!ASN1_ENUMERATED_get_int64(&val, aenum))
return -1;
if (val < LONG_MIN || val > LONG_MAX) {
-/* $OpenBSD: a_int.c,v 1.42 2022/06/28 19:44:28 jsing Exp $ */
+/* $OpenBSD: a_int.c,v 1.43 2022/07/09 14:46:42 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
{
int64_t val;
+ if (aint == NULL)
+ return 0;
if (!ASN1_INTEGER_get_int64(&val, aint))
return -1;
if (val < LONG_MIN || val > LONG_MAX) {