]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add SETWRAP modifier to ASN1 generate.
authorDr. Stephen Henson <steve@openssl.org>
Fri, 15 Nov 2002 00:26:07 +0000 (00:26 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 15 Nov 2002 00:26:07 +0000 (00:26 +0000)
crypto/asn1/asn1_gen.c
doc/crypto/ASN1_generate_nconf.pod

index 0c5dd9b52b4f903e832b9f74ed6369ab76937ca2..097b4b8ecfe5223dedfff740f60953f3ad2df0fa 100644 (file)
@@ -67,7 +67,8 @@
 #define ASN1_GEN_FLAG_BITWRAP  (ASN1_GEN_FLAG|4)
 #define ASN1_GEN_FLAG_OCTWRAP  (ASN1_GEN_FLAG|5)
 #define ASN1_GEN_FLAG_SEQWRAP  (ASN1_GEN_FLAG|6)
-#define ASN1_GEN_FLAG_FORMAT   (ASN1_GEN_FLAG|7)
+#define ASN1_GEN_FLAG_SETWRAP  (ASN1_GEN_FLAG|7)
+#define ASN1_GEN_FLAG_FORMAT   (ASN1_GEN_FLAG|8)
 
 #define ASN1_GEN_STR(str,val)  {str, sizeof(str) - 1, val}
 
@@ -335,6 +336,11 @@ static int asn1_cb(const char *elem, int len, void *bitstr)
                        return -1;
                break;
 
+               case ASN1_GEN_FLAG_SETWRAP:
+               if (!append_exp(arg, V_ASN1_SET, V_ASN1_UNIVERSAL, 1, 0, 1))
+                       return -1;
+               break;
+
                case ASN1_GEN_FLAG_BITWRAP:
                if (!append_exp(arg, V_ASN1_BIT_STRING, V_ASN1_UNIVERSAL, 0, 1, 1))
                        return -1;
@@ -588,6 +594,8 @@ static int asn1_str2tag(const char *tagstr, int len)
                ASN1_GEN_STR("OCTWRAP", ASN1_GEN_FLAG_OCTWRAP),
                /* SEQUENCE wrapper */
                ASN1_GEN_STR("SEQWRAP", ASN1_GEN_FLAG_SEQWRAP),
+               /* SET wrapper */
+               ASN1_GEN_STR("SETWRAP", ASN1_GEN_FLAG_SEQWRAP),
                /* BIT STRING wrapper */
                ASN1_GEN_STR("BITWRAP", ASN1_GEN_FLAG_BITWRAP),
                ASN1_GEN_STR("FORM", ASN1_GEN_FLAG_FORMAT),
index c4c683b2a6d78f219cf28736aa38bcb4b45810ef..b4c89377f6a331d38db2a02aaec4072415c4ce86 100644 (file)
@@ -32,7 +32,7 @@ is:
 
 That is zero or more comma separated modifiers followed by a type
 followed by an optional colon and a value. The formats of B<type>,
-B<value> and B<modifier> is explained below.
+B<value> and B<modifier> are explained below.
 
 =head2 SUPPORTED TYPES
 
@@ -45,7 +45,7 @@ only the B<ASCII> format is permissible.
 
 This encodes a boolean type. The B<value> string is mandatory and
 should be B<TRUE> or B<FALSE>. Additionally B<TRUE>, B<true>, B<Y>,
-B<y>, B<YES>, B<yes>, B<FALSE> B<false>, B<N>, B<n>, B<NO> and B<no>
+B<y>, B<YES>, B<yes>, B<FALSE>, B<false>, B<N>, B<n>, B<NO> and B<no>
 are acceptable. 
 
 =item B<NULL>
@@ -106,8 +106,9 @@ contents of this structure. The format can be B<ASCII> or B<UTF8>.
 
 Formats the result as an ASN1 B<SEQUENCE> or B<SET> type. B<value>
 should be a section name which will contain the contents. The
-field names are ignored and the values are in the generated
-string format. If B<value> is absent the the content will be empty.
+field names in the section are ignored and the values are in the
+generated string format. If B<value> is absent then an empty SEQUENCE
+will be encoded.
 
 =back
 
@@ -135,10 +136,10 @@ the default is CONTEXT SPECIFIC.
 This is the same as B<EXPLICIT> except IMPLICIT tagging is used
 instead.
 
-=item B<OCTWRAP>, B<SEQWRAP>, B<BITWRAP>
+=item B<OCTWRAP>, B<SEQWRAP>, B<SETWRAP>, B<BITWRAP>
 
-The following structure is surrounded by an OCTET STRING, a SEQUENCE
-or a BIT STRING respectively. For a BIT STRING the number of unused
+The following structure is surrounded by an OCTET STRING, a SEQUENCE,
+a SET or a BIT STRING respectively. For a BIT STRING the number of unused
 bits is set to zero.
 
 =item B<FORMAT>