From OpenSSL.
X509_NAME_dup
X509_NAME_entry_count
X509_NAME_free
+X509_NAME_get0_der
X509_NAME_get_entry
X509_NAME_get_index_by_NID
X509_NAME_get_index_by_OBJ
-/* $OpenBSD: x_name.c,v 1.33 2017/01/29 17:49:22 beck Exp $ */
+/* $OpenBSD: x_name.c,v 1.34 2018/02/20 17:09:20 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
}
return (*xn != NULL);
}
+
+int
+X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen)
+{
+ /* Make sure encoding is valid. */
+ if (i2d_X509_NAME(nm, NULL) <= 0)
+ return 0;
+ if (pder != NULL)
+ *pder = (unsigned char *)nm->bytes->data;
+ if (pderlen != NULL)
+ *pderlen = nm->bytes->length;
+ return 1;
+}
-/* $OpenBSD: x509.h,v 1.31 2018/02/20 17:06:19 jsing Exp $ */
+/* $OpenBSD: x509.h,v 1.32 2018/02/20 17:09:20 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);
X509_NAME *X509_NAME_dup(X509_NAME *xn);
+int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen);
X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);
int X509_cmp_time(const ASN1_TIME *s, time_t *t);