diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2003-02-27 01:54:11 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2003-02-27 01:54:11 +0000 |
commit | f0dc08e6564df980f3c38965f6f85c7c807cfbb8 (patch) | |
tree | 002e3f699ac96604db5198651a120dd8682244f1 /crypto/x509v3/v3_utl.c | |
parent | e9ec63961be610bbd386f482335772bc23dc095e (diff) | |
download | openssl-f0dc08e6564df980f3c38965f6f85c7c807cfbb8.zip openssl-f0dc08e6564df980f3c38965f6f85c7c807cfbb8.tar.gz openssl-f0dc08e6564df980f3c38965f6f85c7c807cfbb8.tar.bz2 |
Support for dirName from config files in GeneralName extensions.
Diffstat (limited to 'crypto/x509v3/v3_utl.c')
-rw-r--r-- | crypto/x509v3/v3_utl.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c index 4b85378..2af05e5 100644 --- a/crypto/x509v3/v3_utl.c +++ b/crypto/x509v3/v3_utl.c @@ -740,3 +740,38 @@ static int ipv6_hex(unsigned char *out, const char *in, int inlen) return 1; } + +int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk, + unsigned long chtype) + { + CONF_VALUE *v; + int i; + char *p, *type; + if (!nm) + return 0; + + for (i = 0; i < sk_CONF_VALUE_num(dn_sk); i++) + { + v=sk_CONF_VALUE_value(dn_sk,i); + type=v->name; + /* Skip past any leading X. X: X, etc to allow for + * multiple instances + */ + for(p = type; *p ; p++) +#ifndef CHARSET_EBCDIC + if ((*p == ':') || (*p == ',') || (*p == '.')) +#else + if ((*p == os_toascii[':']) || (*p == os_toascii[',']) || (*p == os_toascii['.'])) +#endif + { + p++; + if(*p) type = p; + break; + } + if (!X509_NAME_add_entry_by_txt(nm,type, chtype, + (unsigned char *) v->value,-1,-1,0)) + return 0; + + } + return 1; + } |