summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/objects/obj_dat.c23
-rw-r--r--src/lib/libcrypto/objects/objects.h7
2 files changed, 28 insertions, 2 deletions
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c
index bcbc8cef85..4f7396f669 100644
--- a/src/lib/libcrypto/objects/obj_dat.c
+++ b/src/lib/libcrypto/objects/obj_dat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: obj_dat.c,v 1.44 2022/01/07 11:13:54 tb Exp $ */ 1/* $OpenBSD: obj_dat.c,v 1.45 2022/01/08 21:36:39 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 *
@@ -816,3 +816,24 @@ OBJ_create(const char *oid, const char *sn, const char *ln)
816 free(buf); 816 free(buf);
817 return (ok); 817 return (ok);
818} 818}
819
820size_t
821OBJ_length(const ASN1_OBJECT *obj)
822{
823 if (obj == NULL)
824 return 0;
825
826 if (obj->length < 0)
827 return 0;
828
829 return obj->length;
830}
831
832const unsigned char *
833OBJ_get0_data(const ASN1_OBJECT *obj)
834{
835 if (obj == NULL)
836 return NULL;
837
838 return obj->data;
839}
diff --git a/src/lib/libcrypto/objects/objects.h b/src/lib/libcrypto/objects/objects.h
index 7a7ba82652..2aaaefd96b 100644
--- a/src/lib/libcrypto/objects/objects.h
+++ b/src/lib/libcrypto/objects/objects.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: objects.h,v 1.13 2022/01/08 15:34:59 tb Exp $ */ 1/* $OpenBSD: objects.h,v 1.14 2022/01/08 21:36:39 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 *
@@ -1105,6 +1105,11 @@ int OBJ_create(const char *oid, const char *sn, const char *ln);
1105void OBJ_cleanup(void); 1105void OBJ_cleanup(void);
1106int OBJ_create_objects(BIO *in); 1106int OBJ_create_objects(BIO *in);
1107 1107
1108#if defined(LIBRESSL_CRYPTO_INTERNAL) || defined(LIBRESSL_NEXT_API)
1109size_t OBJ_length(const ASN1_OBJECT *obj);
1110const unsigned char *OBJ_get0_data(const ASN1_OBJECT *obj);
1111#endif
1112
1108int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid); 1113int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid);
1109int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid); 1114int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid);
1110int OBJ_add_sigid(int signid, int dig_id, int pkey_id); 1115int OBJ_add_sigid(int signid, int dig_id, int pkey_id);