diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-01-30 02:51:01 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-01-30 16:02:48 +0000 |
commit | 7ab507495b86371756575d606af556b4fd74e27a (patch) | |
tree | 07b1c2b00859f8e6764d190833657b7fbfeccfc1 /crypto/x509/x_name.c | |
parent | 33254e1c6fa6a1acf28fd0d9b6dc4ee30e569b95 (diff) | |
download | openssl-7ab507495b86371756575d606af556b4fd74e27a.zip openssl-7ab507495b86371756575d606af556b4fd74e27a.tar.gz openssl-7ab507495b86371756575d606af556b4fd74e27a.tar.bz2 |
Add function to return internal enoding of X509_NAME.
PR#4280
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/x509/x_name.c')
-rw-r--r-- | crypto/x509/x_name.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/x509/x_name.c b/crypto/x509/x_name.c index 9cc855a..9133e3c 100644 --- a/crypto/x509/x_name.c +++ b/crypto/x509/x_name.c @@ -567,3 +567,16 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) OPENSSL_free(b); return 0; } + +int X509_NAME_get0_der(const unsigned char **pder, size_t *pderlen, + X509_NAME *nm) +{ + /* 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; +} |