-/* $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.
*
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;
+}
-/* $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.
*
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);