summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto
diff options
context:
space:
mode:
authortb <>2024-05-29 16:10:41 +0000
committertb <>2024-05-29 16:10:41 +0000
commit6e60fa7a3fdcdc4d76c110acc3f8ff22588375c5 (patch)
treeb0207d5df91ffb8f1e9c618c312a0865d1ca36d0 /src/lib/libcrypto
parenta3d1a2766537320e31fb30ef8f4dbd7a7532ccfc (diff)
downloadopenbsd-6e60fa7a3fdcdc4d76c110acc3f8ff22588375c5.tar.gz
openbsd-6e60fa7a3fdcdc4d76c110acc3f8ff22588375c5.tar.bz2
openbsd-6e60fa7a3fdcdc4d76c110acc3f8ff22588375c5.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
Diffstat (limited to 'src/lib/libcrypto')
-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