summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/objects/obj_dat.c23
-rw-r--r--lib/libcrypto/objects/objects.h7
2 files changed, 28 insertions, 2 deletions
diff --git a/lib/libcrypto/objects/obj_dat.c b/lib/libcrypto/objects/obj_dat.c
index bcbc8cef85a..4f7396f669b 100644
--- a/lib/libcrypto/objects/obj_dat.c
+++ b/lib/libcrypto/objects/obj_dat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: obj_dat.c,v 1.44 2022/01/07 11:13:54 tb Exp $ */
+/* $OpenBSD: obj_dat.c,v 1.45 2022/01/08 21:36:39 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -816,3 +816,24 @@ OBJ_create(const char *oid, const char *sn, const char *ln)
free(buf);
return (ok);
}
+
+size_t
+OBJ_length(const ASN1_OBJECT *obj)
+{
+ if (obj == NULL)
+ return 0;
+
+ if (obj->length < 0)
+ return 0;
+
+ return obj->length;
+}
+
+const unsigned char *
+OBJ_get0_data(const ASN1_OBJECT *obj)
+{
+ if (obj == NULL)
+ return NULL;
+
+ return obj->data;
+}
diff --git a/lib/libcrypto/objects/objects.h b/lib/libcrypto/objects/objects.h
index 7a7ba82652e..2aaaefd96b1 100644
--- a/lib/libcrypto/objects/objects.h
+++ b/lib/libcrypto/objects/objects.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: objects.h,v 1.13 2022/01/08 15:34:59 tb Exp $ */
+/* $OpenBSD: objects.h,v 1.14 2022/01/08 21:36:39 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1105,6 +1105,11 @@ int OBJ_create(const char *oid, const char *sn, const char *ln);
void OBJ_cleanup(void);
int OBJ_create_objects(BIO *in);
+#if defined(LIBRESSL_CRYPTO_INTERNAL) || defined(LIBRESSL_NEXT_API)
+size_t OBJ_length(const ASN1_OBJECT *obj);
+const unsigned char *OBJ_get0_data(const ASN1_OBJECT *obj);
+#endif
+
int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid);
int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid);
int OBJ_add_sigid(int signid, int dig_id, int pkey_id);