summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2024-05-29 16:10:41 +0000
committertb <>2024-05-29 16:10:41 +0000
commitee6d4c1817b222ada4324d5184c408de5e9ed5ac (patch)
treeb0207d5df91ffb8f1e9c618c312a0865d1ca36d0
parentd72986de761f79c4101553b99119eb53491230eb (diff)
downloadopenbsd-ee6d4c1817b222ada4324d5184c408de5e9ed5ac.tar.gz
openbsd-ee6d4c1817b222ada4324d5184c408de5e9ed5ac.tar.bz2
openbsd-ee6d4c1817b222ada4324d5184c408de5e9ed5ac.zip
Make i2d_ASN1_OBJECT() return -1 on error
This is what the (not quite appropriately) referenced ASN1_item_i2d() page documents for errors, matches what the RETURN VALUE section has been documenting for ages, matches BoringSSL, it's the usal behavior for i2d_*. It's also what OpenSSL (of course incorrectly) documents. discussed with jsing
-rw-r--r--src/lib/libcrypto/asn1/a_object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/a_object.c b/src/lib/libcrypto/asn1/a_object.c
index 00b5e7af92..aae1b8bbd7 100644
--- a/src/lib/libcrypto/asn1/a_object.c
+++ b/src/lib/libcrypto/asn1/a_object.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_object.c,v 1.52 2024/05/29 16:04:50 tb Exp $ */ 1/* $OpenBSD: a_object.c,v 1.53 2024/05/29 16:10:41 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -619,7 +619,7 @@ i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)
619 int objsize; 619 int objsize;
620 620
621 if (a == NULL || a->data == NULL) 621 if (a == NULL || a->data == NULL)
622 return 0; 622 return -1;
623 623
624 objsize = ASN1_object_size(0, a->length, V_ASN1_OBJECT); 624 objsize = ASN1_object_size(0, a->length, V_ASN1_OBJECT);
625 625