diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2005-09-01 13:59:16 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2005-09-01 13:59:16 +0000 |
commit | 1ef7acfe92cabe4312d3a7db33df91d04880aa39 (patch) | |
tree | e204a945f35e45b01f960822b06fc7c9b9747914 /crypto/asn1/x_name.c | |
parent | a0156a926f30beb46a6ac16c4724aff9d5a0fac6 (diff) |
Initial support for ASN1 print code.
WARNING WARNING WARNING, experimental code, handle with care, use at
your own risk, may contain nuts.
Diffstat (limited to 'crypto/asn1/x_name.c')
-rw-r--r-- | crypto/asn1/x_name.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/crypto/asn1/x_name.c b/crypto/asn1/x_name.c index 681e5d110f..7f4e39bcf4 100644 --- a/crypto/asn1/x_name.c +++ b/crypto/asn1/x_name.c @@ -60,6 +60,7 @@ #include "cryptlib.h" #include <openssl/asn1t.h> #include <openssl/x509.h> +#include "asn1_locl.h" static int x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it, int tag, int aclass, char opt, ASN1_TLC *ctx); @@ -70,6 +71,12 @@ static void x509_name_ex_free(ASN1_VALUE **val, const ASN1_ITEM *it); static int x509_name_encode(X509_NAME *a); + +static int x509_name_ex_print(BIO *out, ASN1_VALUE **pval, + int indent, + const char *fname, + const ASN1_PCTX *pctx); + ASN1_SEQUENCE(X509_NAME_ENTRY) = { ASN1_SIMPLE(X509_NAME_ENTRY, object, ASN1_OBJECT), ASN1_SIMPLE(X509_NAME_ENTRY, value, ASN1_PRINTABLE) @@ -102,7 +109,8 @@ const ASN1_EXTERN_FUNCS x509_name_ff = { x509_name_ex_free, 0, /* Default clear behaviour is OK */ x509_name_ex_d2i, - x509_name_ex_i2d + x509_name_ex_i2d, + x509_name_ex_print }; IMPLEMENT_EXTERN_ASN1(X509_NAME, V_ASN1_SEQUENCE, x509_name_ff) @@ -252,6 +260,17 @@ static int x509_name_encode(X509_NAME *a) return -1; } +static int x509_name_ex_print(BIO *out, ASN1_VALUE **pval, + int indent, + const char *fname, + const ASN1_PCTX *pctx) + { + if (X509_NAME_print_ex(out, (X509_NAME *)*pval, + indent, pctx->nm_flags) <= 0) + return 0; + return 1; + } + int X509_NAME_set(X509_NAME **xn, X509_NAME *name) { |