Indent examples. Fix syntax-check warnings.
authorSimon Josefsson <simon@josefsson.org>
Tue, 13 Apr 2010 08:32:40 +0000 (10:32 +0200)
committerSimon Josefsson <simon@josefsson.org>
Tue, 13 Apr 2010 08:32:40 +0000 (10:32 +0200)
17 files changed:
NEWS
cfg.mk
configure.ac
doc/libtasn1.texi
doc/reference/libtasn1-docs.sgml
doc/texinfo.css
examples/CertificateExample.c
examples/CrlExample.c
examples/pkix.asn
lib/ASN1.y
lib/coding.c
lib/decoding.c
lib/libtasn1.map
lib/parser_aux.c
src/Makefile.am
tests/Test_tree.asn
tests/pkix.asn

diff --git a/NEWS b/NEWS
index cdf796e..3e6b096 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -237,7 +237,7 @@ GNU Libtasn1 NEWS                                     -*- outline -*-
 - Added the self test with "make check" target
 - Added management of ANY type with null length
 - Corrected some writes to invalid data.
+
 * Noteworthy changes in release 0.2.10
 - Added scripts to assist in libtasn1 version detection
   from configure scripts.
@@ -258,17 +258,17 @@ GNU Libtasn1 NEWS                                     -*- outline -*-
   "INTEGER (5 | 10)" and
   "INTEGER (5)"
 - Comments start at "--" and finish at the "end of line" or
-  with another "--". 
+  with another "--".
 
 * Noteworthy changes in release 0.2.5
 - Bug fix in ordering procedure for SET OF and SEQUENCE OF
   types coding.
 - Manage structured format (BER encoding) in
-  asn1_der_decoding, asn1_decoding_element and 
+  asn1_der_decoding, asn1_decoding_element and
   asn1_der_decoding_startEnd for OCTET STRING type.
-- Manage SEQUENCE and SET empty structure. 
+- Manage SEQUENCE and SET empty structure.
 - Manage "indefinite length method" in asn1_der_decoding,
-  asn1_decoding_element and asn1_der_decoding_startEnd 
+  asn1_decoding_element and asn1_der_decoding_startEnd
   for the following types:
   SEQUENCE, SEQUENCE OF, SET, and SET OF.
 - Bug fix in asn1_read_value with NULL parameter in case
@@ -296,7 +296,7 @@ GNU Libtasn1 NEWS                                     -*- outline -*-
 * Noteworthy changes in release 0.2.0
 - Support for other platforms
 - Change asn1_create_element function interface (dest_name not needed any more)
-- Change OBJECT IDENTIFIER syntax: numbers must be separated by dot in 
+- Change OBJECT IDENTIFIER syntax: numbers must be separated by dot in
   asn1_write_element and asn1_read_element functions (e.g. "1.2.3.4")
 
 * Noteworthy changes in release 0.1.2
diff --git a/cfg.mk b/cfg.mk
index 47294f2..4f9acb4 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -29,8 +29,7 @@ endif
 
 local-checks-to-skip = sc_prohibit_strcmp sc_prohibit_have_config_h    \
        sc_require_config_h sc_require_config_h_first                   \
-       sc_trailing_blank sc_immutable_NEWS                             \
-       sc_prohibit_magic_number_exit
+       sc_immutable_NEWS sc_prohibit_magic_number_exit
 VC_LIST_ALWAYS_EXCLUDE_REGEX = ^(build-aux|gl|lib/gllib|lib/glm4)/.*$
 
 bootstrap-tools := autoconf,automake,libtool,bison
@@ -52,7 +51,7 @@ upload-web-coverage:
 
 W32ROOT ?= $(HOME)/gnutls4win/inst
 
-mingw32: autoreconf 
+mingw32: autoreconf
        ./configure --enable-gtk-doc --host=i586-mingw32msvc --build=`./config.guess` --prefix=$(W32ROOT)
 
 ChangeLog:
index faec539..6ee9007 100644 (file)
@@ -80,9 +80,9 @@ if test "$gl_gcc_warnings" = yes; then
   nw="$nw -Wtraditional-conversion" # Too many warnings for now
   nw="$nw -Wconversion"             # Too many warnings for now
   nw="$nw -Wsign-conversion"        # Too many warnings for now
-  nw="$nw -Wold-style-definition"   # 
+  nw="$nw -Wold-style-definition"   #
   nw="$nw -Wpadded"                 # Our structs are not padded
-  nw="$nw -Wundef"                  # 
+  nw="$nw -Wundef"                  #
   nw="$nw -Wunreachable-code"       # Too many false positives
   nw="$nw -Wunused-macros"          # Breaks on bison generated ASN1.c
   nw="$nw -Wunsafe-loop-optimizations"
index b7467bc..8d823fa 100644 (file)
@@ -128,7 +128,7 @@ definitions must have this syntax:
 
       DEFINITIONS <EXPLICIT or IMPLICIT> TAGS ::=
 
-      BEGIN 
+      BEGIN
 
       <type and constants definitions>
 
@@ -255,7 +255,7 @@ name inside a file with ASN1 definitions.
 
 @itemize @bullet
 
-@item Add functions for a C code file generation containing equivalent 
+@item Add functions for a C code file generation containing equivalent
 data structures (not a single array like now).
 
 @item Type REAL.
index 49b8844..ee3b3af 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
 <book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
   <bookinfo>
index 96df89e..69614b5 100644 (file)
@@ -1,4 +1,4 @@
-body { 
+body {
        margin: 2%;
        padding: 0 5%;
        background: #ffffff;
index 396b8cf..4673f5f 100644 (file)
@@ -227,7 +227,7 @@ create_certificate (ASN1_TYPE cert_def, unsigned char *der, int *der_len)
 
   /* Use the next 3 lines to visit the empty certificate */
   /* printf("-----------------\n");
-     asn1_visit_tree(cert1,"");   
+     asn1_visit_tree(cert1,"");
      printf("-----------------\n"); */
 
   /* version: v3(2) */
@@ -532,8 +532,8 @@ create_certificate (ASN1_TYPE cert_def, unsigned char *der, int *der_len)
 
 
   /* Use the next 3 lines to visit the certificate */
-  /* printf("-----------------\n");   
-     asn1_visit_tree(cert1,"");  
+  /* printf("-----------------\n");
+     asn1_visit_tree(cert1,"");
      printf("-----------------\n"); */
 
   *der_len = max_len;
@@ -616,8 +616,8 @@ get_certificate (ASN1_TYPE cert_def, unsigned char *der, int der_len)
     }
 
   /* Use the next 3 lines to visit the certificate */
-  /*   printf("-----------------\n");   
-     asn1_visit_tree(cert2,"");  
+  /*   printf("-----------------\n");
+     asn1_visit_tree(cert2,"");
      printf("-----------------\n"); */
 
 
@@ -659,7 +659,7 @@ main (int argc, char *argv[])
 
   /* Use the following 3 lines to visit the PKIX1Implicit structures */
   /* printf("-----------------\n");
-     asn1_visit_tree(PKIX1Implicit88,"PKIX1Implicit88");   
+     asn1_visit_tree(PKIX1Implicit88,"PKIX1Implicit88");
      printf("-----------------\n"); */
 
   der_len = 1024;
index 75a7416..f38f1a0 100644 (file)
@@ -236,7 +236,7 @@ create_CRL (ASN1_TYPE cert_def, unsigned char *der, int *der_len)
 
   /* Use the next 3 lines to visit the empty certificate */
   /*  printf("-----------------\n");
-     asn1_visit_tree(crl,"");   
+     asn1_visit_tree(crl,"");
      printf("-----------------\n"); */
 
 
@@ -402,8 +402,8 @@ create_CRL (ASN1_TYPE cert_def, unsigned char *der, int *der_len)
 
 
   /* Use the next 3 lines to visit the certificate */
-  /* printf("-----------------\n");   
-     asn1_visit_tree(crl,"");  
+  /* printf("-----------------\n");
+     asn1_visit_tree(crl,"");
      printf("-----------------\n"); */
 
   *der_len = max_len;
@@ -482,8 +482,8 @@ get_CRL (ASN1_TYPE cert_def, unsigned char *der, int der_len)
     }
 
   /* Use the next 3 lines to visit the certificate */
-  /* printf("-----------------\n");   
-     asn1_visit_tree(crl2,"");  
+  /* printf("-----------------\n");
+     asn1_visit_tree(crl2,"");
      printf("-----------------\n"); */
 
 
@@ -524,7 +524,7 @@ main (int argc, char *argv[])
 
   /* Use the following 3 lines to visit the PKIX1Implicit structures */
   /* printf("-----------------\n");
-     asn1_visit_tree(cert_def,"PKIX1Implicit88");   
+     asn1_visit_tree(cert_def,"PKIX1Implicit88");
      printf("-----------------\n"); */
 
   der_len = 1024;
index 76cbb0d..d13ce20 100644 (file)
@@ -384,7 +384,7 @@ id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
 Attribute       ::=     SEQUENCE {
         type            AttributeType,
         values  SET OF AttributeValue
-                -- at least one value is required -- 
+                -- at least one value is required --
 }
 
 AttributeType           ::=   OBJECT IDENTIFIER
@@ -548,7 +548,7 @@ TBSCertificate  ::=  SEQUENCE  {
      subjectUniqueID [2]  IMPLICIT UniqueIdentifier OPTIONAL,
                           -- If present, version shall be v2 or v3
      extensions      [3]  EXPLICIT Extensions OPTIONAL
-                          -- If present, version shall be v3 --  
+                          -- If present, version shall be v3 --
 }
 
 Version  ::=  INTEGER  {  v1(0), v2(1), v3(2)  }
@@ -600,7 +600,7 @@ TBSCertList  ::=  SEQUENCE  {
                                          -- if present, shall be v2
                                }  OPTIONAL,
      crlExtensions           [0] EXPLICIT Extensions OPTIONAL
-                                         -- if present, shall be v2 -- 
+                                         -- if present, shall be v2 --
 }
 
 -- Version, Time, CertificateSerialNumber, and Extensions were
@@ -684,7 +684,7 @@ BuiltInStandardAttributes ::= SEQUENCE {
    personal-name        [5] EXPLICIT PersonalName OPTIONAL,
    -- see also teletex-personal-name
    organizational-unit-names    [6] EXPLICIT OrganizationalUnitNames OPTIONAL
-   -- see also teletex-organizational-unit-names -- 
+   -- see also teletex-organizational-unit-names --
 }
 
 CountryName ::= [APPLICATION 1] CHOICE {
index 953e031..ff74927 100644 (file)
@@ -299,7 +299,7 @@ type_assig_right_tag_default : type_assig_right_tag   {$$=$1;}
                                                       _asn1_set_down($$,$2);}
                       | type_assig_right_tag OPTIONAL {$$=_asn1_mod_type($1,CONST_OPTION);}
 ;
+
 type_assig : IDENTIFIER type_assig_right_tag_default  {$$=_asn1_set_name($2,$1);}
 ;
 
index 9a28b12..31b5ebb 100644 (file)
@@ -384,7 +384,7 @@ _asn1_complete_explicit_tag (ASN1_TYPE node, unsigned char *der,
       p = node->down;
       /* When there are nested tags we must complete them reverse to
          the order they were created. This is because completing a tag
-         modifies all data within it, including the incomplete tags 
+         modifies all data within it, including the incomplete tags
          which store buffer positions -- simon@josefsson.org 2002-09-06
        */
       while (p->right)
index 253c9ba..689702e 100644 (file)
@@ -2561,7 +2561,7 @@ asn1_expand_any_defined_by (ASN1_TYPE definitions, ASN1_TYPE * element)
                      if ((result == ASN1_SUCCESS)
                          && (!strcmp (p3->value, value)))
                        {
-                         p2 = p2->right;       /* pointer to the structure to 
+                         p2 = p2->right;       /* pointer to the structure to
                                                   use for expansion */
                          while ((p2) && (p2->type & CONST_ASSIGN))
                            p2 = p2->right;
@@ -2743,7 +2743,7 @@ asn1_expand_octet_string (ASN1_TYPE definitions, ASN1_TYPE * element,
              && (!strcmp (objectNode->value, value)))
            {
 
-             p2 = p2->right;   /* pointer to the structure to 
+             p2 = p2->right;   /* pointer to the structure to
                                   use for expansion */
              while ((p2) && (p2->type & CONST_ASSIGN))
                p2 = p2->right;
index 263a7a7..06d5048 100644 (file)
@@ -50,7 +50,7 @@ LIBTASN1_0_3
     asn1_strerror;
     asn1_write_value;
 
-    # Old symbols    
+    # Old symbols
     libtasn1_strerror;
     libtasn1_perror;
 
index 65d57d0..a3150a8 100644 (file)
@@ -160,7 +160,7 @@ asn1_find_node (ASN1_TYPE pointer, const char *name)
 
       p = p->down;
 
-      /* The identifier "?LAST" indicates the last element 
+      /* The identifier "?LAST" indicates the last element
          in the right chain. */
       if (!strcmp (n, "?LAST"))
        {
index e565464..09133f6 100644 (file)
@@ -24,8 +24,8 @@ LDADD = ../lib/libtasn1.la ../gl/libgnu.la
 
 bin_PROGRAMS = asn1Parser asn1Coding asn1Decoding
 
-asn1Parser_SOURCES = asn1Parser.c  
+asn1Parser_SOURCES = asn1Parser.c
 
-asn1Coding_SOURCES = asn1Coding.c  
+asn1Coding_SOURCES = asn1Coding.c
 
-asn1Decoding_SOURCES = asn1Decoding.c  
+asn1Decoding_SOURCES = asn1Decoding.c
index 2cac58c..ec3c996 100644 (file)
@@ -115,7 +115,7 @@ id-anyTest OBJECT IDENTIFIER  ::=  {id-ic 29 1}
 id-anyTest2 OBJECT IDENTIFIER  ::=  {id-ic 29 2}
 
 
-anyTest2  ::= INTEGER 
+anyTest2  ::= INTEGER
 
 
 VisibleString ::= [UNIVERSAL 26] IMPLICIT OCTET STRING
index 2883361..bd3c435 100644 (file)
@@ -208,7 +208,7 @@ DistributionPoint ::= SEQUENCE {
 
 DistributionPointName ::= CHOICE {
     fullName                [0]     GeneralNames,
-    nameRelativeToCRLIssuer [1]     RelativeDistinguishedName 
+    nameRelativeToCRLIssuer [1]     RelativeDistinguishedName
 }
 
 ReasonFlags ::= BIT STRING {
@@ -384,7 +384,7 @@ id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
 Attribute       ::=     SEQUENCE {
         type            AttributeType,
         values  SET OF AttributeValue
-                -- at least one value is required -- 
+                -- at least one value is required --
 }
 
 AttributeType           ::=   OBJECT IDENTIFIER
@@ -521,7 +521,7 @@ TBSCertificate  ::=  SEQUENCE  {
      subjectUniqueID [2]  IMPLICIT UniqueIdentifier OPTIONAL,
                           -- If present, version shall be v2 or v3
      extensions      [3]  EXPLICIT Extensions OPTIONAL
-                          -- If present, version shall be v3 --  
+                          -- If present, version shall be v3 --
 }
 
 Version  ::=  INTEGER  {  v1(0), v2(1), v3(2)  }
@@ -573,7 +573,7 @@ TBSCertList  ::=  SEQUENCE  {
                                          -- if present, shall be v2
                                }  OPTIONAL,
      crlExtensions           [0] EXPLICIT Extensions OPTIONAL
-                                         -- if present, shall be v2 -- 
+                                         -- if present, shall be v2 --
 }
 
 -- Version, Time, CertificateSerialNumber, and Extensions were
@@ -604,7 +604,7 @@ id-dsa-with-sha1 OBJECT IDENTIFIER ::=  {
 
 Dss-Sig-Value ::= SEQUENCE {
      r       INTEGER,
-     s       INTEGER  
+     s       INTEGER
 }
 
 dhpublicnumber OBJECT IDENTIFIER ::= {
@@ -658,7 +658,7 @@ BuiltInStandardAttributes ::= SEQUENCE {
    personal-name        [5] EXPLICIT PersonalName OPTIONAL,
    -- see also teletex-personal-name
    organizational-unit-names    [6] EXPLICIT OrganizationalUnitNames OPTIONAL
-   -- see also teletex-organizational-unit-names -- 
+   -- see also teletex-organizational-unit-names --
 }
 
 CountryName ::= [APPLICATION 1] CHOICE {
@@ -939,7 +939,7 @@ pkcs-7-ContentInfo ::= SEQUENCE {
 
 pkcs-7-DigestInfo ::= SEQUENCE {
   digestAlgorithm pkcs-7-DigestAlgorithmIdentifier,
-  digest pkcs-7-Digest 
+  digest pkcs-7-Digest
 }
 
 pkcs-7-Digest ::= OCTET STRING
@@ -952,7 +952,7 @@ pkcs-7-SignedData ::= SEQUENCE {
   encapContentInfo pkcs-7-EncapsulatedContentInfo,
   certificates [0] IMPLICIT pkcs-7-CertificateSet OPTIONAL,
   crls [1] IMPLICIT pkcs-7-CertificateRevocationLists OPTIONAL,
-  signerInfos pkcs-7-SignerInfos 
+  signerInfos pkcs-7-SignerInfos
 }
 
 pkcs-7-CMSVersion ::= INTEGER  { v0(0), v1(1), v2(2), v3(3), v4(4) }
@@ -1041,7 +1041,7 @@ pkcs-8-Attributes ::= SET OF Attribute
 
 pkcs-8-EncryptedPrivateKeyInfo ::= SEQUENCE {
     encryptionAlgorithm AlgorithmIdentifier,
-    encryptedData pkcs-8-EncryptedData 
+    encryptedData pkcs-8-EncryptedData
 }
 
 pkcs-8-EncryptedData ::= OCTET STRING
@@ -1080,7 +1080,7 @@ pkcs-5-PBKDF2-params ::= SEQUENCE {
   },
   iterationCount INTEGER (1..MAX),
   keyLength INTEGER (1..MAX) OPTIONAL,
-  prf AlgorithmIdentifier OPTIONAL -- DEFAULT pkcs-5-id-hmacWithSHA1 
+  prf AlgorithmIdentifier OPTIONAL -- DEFAULT pkcs-5-id-hmacWithSHA1
 }
 
 -- PKCS #12 stuff