diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2012-10-22 13:05:54 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2012-10-22 13:05:54 +0000 |
commit | 30765fed5558e81ea474c92291f6a9b139258f4d (patch) | |
tree | 29d0e14cf2e3117c1663a5cdaa1ad15a2953c1db /crypto/asn1/asn1_gen.c | |
parent | 6a45ea4f887494bd972dcfc3186002497a1c6eeb (diff) |
New config module for string tables. This can be used to add new
multi string components (as used in DN fields or request attributes)
or change the values of existing ones.
Diffstat (limited to 'crypto/asn1/asn1_gen.c')
-rw-r--r-- | crypto/asn1/asn1_gen.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c index 4fc241908f..7c2c337a1a 100644 --- a/crypto/asn1/asn1_gen.c +++ b/crypto/asn1/asn1_gen.c @@ -852,3 +852,27 @@ static int bitstr_cb(const char *elem, int len, void *bitstr) return 1; } +static int mask_cb(const char *elem, int len, void *arg) + { + unsigned long *pmask = arg, tmpmask; + int tag; + if (len == 3 && !strncmp(elem, "DIR", 3)) + { + *pmask |= B_ASN1_DIRECTORYSTRING; + return 1; + } + tag = asn1_str2tag(elem, len); + if (!tag || (tag & ASN1_GEN_FLAG)) + return 0; + tmpmask = ASN1_tag2bit(tag); + if (!tmpmask) + return 0; + *pmask |= tmpmask; + return 1; + } + +int ASN1_str2mask(const char *str, unsigned long *pmask) + { + *pmask = 0; + return CONF_parse_list(str, '|', 1, mask_cb, pmask); + } |