diff options
Diffstat (limited to 'src/lib/libcrypto/objects/obj_dat.c')
-rw-r--r-- | src/lib/libcrypto/objects/obj_dat.c | 23 |
1 files changed, 22 insertions, 1 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 | |||
820 | size_t | ||
821 | OBJ_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 | |||
832 | const unsigned char * | ||
833 | OBJ_get0_data(const ASN1_OBJECT *obj) | ||
834 | { | ||
835 | if (obj == NULL) | ||
836 | return NULL; | ||
837 | |||
838 | return obj->data; | ||
839 | } | ||