shishi-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS shishi/asn1


From: shishi-commit
Subject: CVS shishi/asn1
Date: Tue, 09 Nov 2004 20:00:54 +0100

Update of /home/cvs/shishi/asn1
In directory dopio:/tmp/cvs-serv4771

Modified Files:
        coding.c decoding.c element.c errors.c errors.h errors_int.h 
        gstr.c gstr.h int.h libtasn1.h parser_aux.c structure.c 
Log Message:
Sync upstream.

--- /home/cvs/shishi/asn1/coding.c      2004/04/17 22:05:54     1.2
+++ /home/cvs/shishi/asn1/coding.c      2004/11/09 19:00:53     1.3
@@ -63,7 +63,7 @@
 /* Parameters:                                        */
 /*   len: value to convert.                           */
 /*   ans: string returned.                            */
-/*   ans_len: number of meanful bytes of ANS          */
+/*   ans_len: number of meaningful bytes of ANS       */
 /*            (ans[0]..ans[ans_len-1]).               */
 /* Return:                                            */
 /******************************************************/
@@ -101,7 +101,7 @@
 /*   class: value to convert.                         */
 /*   tag_value: value to convert.                     */
 /*   ans: string returned.                            */
-/*   ans_len: number of meanful bytes of ANS          */
+/*   ans_len: number of meaningful bytes of ANS       */
 /*            (ans[0]..ans[ans_len-1]).               */
 /* Return:                                            */
 /******************************************************/
@@ -138,7 +138,7 @@
 /*   str: OCTET string.                               */
 /*   str_len: STR length (str[0]..str[str_len-1]).    */
 /*   der: string returned.                            */
-/*   der_len: number of meanful bytes of DER          */
+/*   der_len: number of meaningful bytes of DER       */
 /*            (der[0]..der[ans_len-1]).               */
 /* Return:                                            */
 /******************************************************/
@@ -160,7 +160,7 @@
 /* Parameters:                                        */
 /*   str: TIME null-terminated string.                */
 /*   der: string returned.                            */
-/*   der_len: number of meanful bytes of DER          */
+/*   der_len: number of meaningful bytes of DER       */
 /*            (der[0]..der[ans_len-1]). Initially it  */
 /*            if must store the lenght of DER.        */
 /* Return:                                            */
@@ -229,9 +229,9 @@
 /* Parameters:                                        */
 /*   str: OBJECT IDENTIFIER null-terminated string.   */
 /*   der: string returned.                            */
-/*   der_len: number of meanful bytes of DER          */
+/*   der_len: number of meaningful bytes of DER       */
 /*            (der[0]..der[ans_len-1]). Initially it  */
-/*            if must store the lenght of DER.        */
+/*            must store the length of DER.           */
 /* Return:                                            */
 /*   ASN1_MEM_ERROR when DER isn't big enough         */
 /*   ASN1_SUCCESS otherwise                           */
@@ -305,9 +305,9 @@
 /* STRING  type (length and pad included).            */
 /* Parameters:                                        */
 /*   str: BIT string.                                 */
-/*   bit_len: number of meanful bits in STR.          */
+/*   bit_len: number of meaningful bits in STR.       */
 /*   der: string returned.                            */
-/*   der_len: number of meanful bytes of DER          */
+/*   der_len: number of meaningful bytes of DER       */
 /*            (der[0]..der[ans_len-1]).               */
 /* Return:                                            */
 /******************************************************/
@@ -336,7 +336,7 @@
 /* Parameters:                                        */
 /*   node: pointer to the tree element.               */
 /*   der: string with the DER coding of the whole tree*/
-/*   counter: number of meanful bytes of DER          */
+/*   counter: number of meaningful bytes of DER       */
 /*            (der[0]..der[*counter-1]).              */
 /*   max_len: size of der vector                      */
 /* Return:                                            */
@@ -356,7 +356,7 @@
     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 alla date within it, including the incomplete tags 
+       modifies all data within it, including the incomplete tags 
        which store buffer positions -- address@hidden 2002-09-06
     */
     while(p->right)
@@ -398,7 +398,7 @@
 /* Parameters:                                        */
 /*   node: pointer to the tree element.               */
 /*   der: string returned                             */
-/*   counter: number of meanful bytes of DER          */
+/*   counter: number of meaningful bytes of DER       */
 /*            (counter[0]..der[*counter-1]).          */
 /*   max_len: size of der vector                      */
 /* Return:                                            */
@@ -572,7 +572,7 @@
     p_vet->value=(class<<24)|tag;
     counter+=len2;
 
-    /* extraction  and length */
+    /* extraction and length */
     len2=_asn1_get_length_der(der+counter,&len);
     counter+=len+len2;
 
@@ -976,18 +976,3 @@
 
   return ASN1_SUCCESS;
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- /home/cvs/shishi/asn1/decoding.c    2004/09/09 10:31:25     1.4
+++ /home/cvs/shishi/asn1/decoding.c    2004/11/09 19:00:53     1.5
@@ -64,7 +64,7 @@
       ans=0;
       while(punt<=k) ans=ans*256+der[punt++];
     }
-    else{  /* indefinite lenght method */
+    else{  /* indefinite length method */
       ans=-1;
     }
 
@@ -492,11 +492,11 @@
   * @element: pointer to an ASN1 structure
   * @ider: vector that contains the DER encoding. 
   * @len: number of bytes of *der: der[0]..der[len-1]
-  * Description:
+  * @errorDescription: null-terminated string contains details when an error 
occurred.
   *
   * Fill the structure *ELEMENT with values of a DER encoding string. The 
sructure must just be
   * created with function 'create_stucture'.
-  * If an error accurs during de decoding procedure, the *ELEMENT is deleted
+  * If an error occurs during the decoding procedure, the *ELEMENT is deleted
   * and set equal to ASN1_TYPE_EMPTY.
   *
   * Returns:
@@ -833,7 +833,7 @@
          counter+=len2+len3;
        }
        else{ /* indefinite length */
-         /* Check indefinite lenth method in a EXPLICIT TAG */
+         /* Check indefinite lenth method in an EXPLICIT TAG */
          if((p->type&CONST_TAG) && (der[counter-1]==0x80))
            indefinite=1;
          else
@@ -858,7 +858,7 @@
          counter+=len2;
 
          /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with
-            a indefinite length method. */
+            an indefinite length method. */
          if(indefinite){
            if(!der[counter] && !der[counter+1]){ 
              counter+=2;
@@ -912,14 +912,14 @@
   * @elementName: name of the element to fill
   * @ider: vector that contains the DER encoding of the whole structure. 
   * @len: number of bytes of *der: der[0]..der[len-1]
-  * @errorDescription: null-terminated string contains details when an arror 
accured.
+  * @errorDescription: null-terminated string contains details when an error 
occurred.
   * 
   * Description:
   *
   * Fill the element named ELEMENTNAME with values of a DER encoding string. 
   * The sructure must just be created with function 'create_stucture'.
   * The DER vector must contain the encoding string of the whole STRUCTURE.
-  * If an error accurs during the decoding procedure, the *STRUCTURE is deleted
+  * If an error occurs during the decoding procedure, the *STRUCTURE is deleted
   * and set equal to ASN1_TYPE_EMPTY.
   *
   * Returns:
@@ -958,7 +958,7 @@
     return ASN1_GENERIC_ERROR;
   }
 
-  if((*structure)->name){  /* Has *structure a name? */
+  if((*structure)->name){  /* Has *structure got a name? */
     nameLen-=strlen((*structure)->name);
     if(nameLen>0) strcpy(currentName,(*structure)->name);
     else{
@@ -1335,7 +1335,7 @@
          counter+=len2+len3;
        }
        else{ /* indefinite length */
-         /* Check indefinite lenth method in a EXPLICIT TAG */
+         /* Check indefinite lenth method in an EXPLICIT TAG */
          if((p->type&CONST_TAG) && (der[counter-1]==0x80))
            indefinite=1;
          else
@@ -1366,7 +1366,7 @@
          counter+=len2;
 
          /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with
-            a indefinite length method. */
+            an indefinite length method. */
          if(indefinite){
            if(!der[counter] && !der[counter+1]){ 
              counter+=2;
@@ -1690,7 +1690,7 @@
          counter+=len2+len4+len3;
        }
        else{ /* indefinite length */
-         /* Check indefinite lenth method in a EXPLICIT TAG */
+         /* Check indefinite lenth method in an EXPLICIT TAG */
          if((p->type&CONST_TAG) && (der[counter-1]==0x80))
            indefinite=1;
          else
@@ -1703,7 +1703,7 @@
          counter+=len2;
 
          /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with
-            a indefinite length method. */
+            an indefinite length method. */
          if(indefinite){
            if(!der[counter] && !der[counter+1])
              counter+=2;
@@ -1742,8 +1742,7 @@
 
 
 /**
-  * asn1_expand_any_defined_by - Expand every "ANY DEFINED BY" fields of 
-  *    structure *ELEMENT with the corresponding type.
+  * asn1_expand_any_defined_by - Expand "ANY DEFINED BY" fields in structure.
   * @definitions: ASN1 definitions
   * @element: pointer to an ASN1 structure
   * Description:
@@ -1938,8 +1937,7 @@
 
 
 /**
-  * asn1_expand_octet_string - Expand an "OCTET STRING" fields of 
-  *    structure *ELEMENT with the corresponding type.
+  * asn1_expand_octet_string - Expand "OCTET STRING" fields in structure.
   * @definitions: ASN1 definitions
   * @element: pointer to an ASN1 structure
   * @octetName: name of the OCTECT STRING field to expand.
@@ -2070,9 +2068,3 @@
   return retCode;
 }
 
-
-
-
-
-
-
--- /home/cvs/shishi/asn1/element.c     2004/04/17 22:05:54     1.2
+++ /home/cvs/shishi/asn1/element.c     2004/11/09 19:00:53     1.3
@@ -99,7 +99,7 @@
   *len=SIZEOF_UNSIGNED_LONG_INT-k;  
 
   if (SIZEOF_UNSIGNED_LONG_INT-k> value_out_size)
-    /* VALUE_OUT is too short to contain the value convertion */
+    /* VALUE_OUT is too short to contain the value conversion */
     return ASN1_MEM_ERROR;
 
   for(k2=k;k2<SIZEOF_UNSIGNED_LONG_INT;k2++)
@@ -204,10 +204,10 @@
   *            value="2001010112001.12-0700" , len=1 -> time=Jannuary 1st, 
2001 at 12h 00m 01.12s 
   *                                                     Pacific Daylight Time
   *
-  * \item OCTET STRING\: VALUE contains the octet string and LEN is the number 
of octet.
+  * \item OCTET STRING\: VALUE contains the octet string and LEN is the number 
of octets.
   *            value="$\backslash$x01$\backslash$x02$\backslash$x03" , len=3  
-> three bytes octet string
   *
-  * \item GeneralString\: VALUE contains the generalstring and LEN is the 
number of octet.
+  * \item GeneralString\: VALUE contains the generalstring and LEN is the 
number of octets.
   *            value="$\backslash$x01$\backslash$x02$\backslash$x03" , len=3  
-> three bytes generalstring
   *
   * \item BIT STRING\: VALUE contains the bit string organized by bytes and 
LEN is the number of bits.
@@ -576,9 +576,9 @@
   * \item GeneralizedTime\: VALUE will be a null terminated string in the same 
format used to set
   *                    the value
   *
-  * \item OCTET STRING\: VALUE will contain the octet string and LEN will be 
the number of octet.
+  * \item OCTET STRING\: VALUE will contain the octet string and LEN will be 
the number of octets.
   *
-  * \item GeneralString\: VALUE will contain the generalstring and LEN will be 
the number of octet.
+  * \item GeneralString\: VALUE will contain the generalstring and LEN will be 
the number of octets.
   *
   * \item BIT STRING\: VALUE will contain the bit string organized by bytes 
and LEN will be the 
   *               number of bits.
@@ -811,7 +811,3 @@
   return ASN1_SUCCESS;
 
 }
-
-
-
-
--- /home/cvs/shishi/asn1/errors.c      2003/08/07 02:11:49     1.1
+++ /home/cvs/shishi/asn1/errors.c      2004/11/09 19:00:53     1.2
@@ -88,8 +88,11 @@
   * libtasn1_strerror - Returns a string with a description of an error
   * @error: is an error returned by a libtasn1 function.
   *
-  * This function is similar to strerror(). The only difference is that it 
-  * accepts an error (number) returned by a libasn1 function. 
+  * This function is similar to strerror(). The only difference is that it
+  * accepts an error (number) returned by a libasn1 function.
+  *
+  * Returns: Pointer to static zero-terminated string describing error
+  *   code.
   **/
 const char* libtasn1_strerror(asn1_retCode error)
 {
@@ -126,4 +129,3 @@
 void _libtasn1_null_log( void* x, ...) { return; }
 # endif /* C99_MACROS */
 #endif /* DEBUG */
-
--- /home/cvs/shishi/asn1/errors.h      2003/08/07 02:11:49     1.1
+++ /home/cvs/shishi/asn1/errors.h      2004/11/09 19:00:53     1.2
@@ -58,9 +58,3 @@
 #endif /* DEBUG */
 
 #endif /* ERRORS_H */
-
-
-
-
-
-
--- /home/cvs/shishi/asn1/errors_int.h  2003/08/07 02:11:49     1.1
+++ /home/cvs/shishi/asn1/errors_int.h  2004/11/09 19:00:53     1.2
@@ -20,5 +20,3 @@
 #define ASN1_NAME_TOO_LONG         15
 #define ASN1_ARRAY_ERROR           16
 #define ASN1_ELEMENT_NOT_EMPTY     17
-
-
--- /home/cvs/shishi/asn1/gstr.c        2003/08/07 02:11:49     1.1
+++ /home/cvs/shishi/asn1/gstr.c        2004/11/09 19:00:53     1.2
@@ -21,7 +21,7 @@
 #include <int.h>
 
 /* These function are like strcat, strcpy. They only
- * do bound checking (they shouldn't cause buffer overruns),
+ * do bounds checking (they shouldn't cause buffer overruns),
  * and they always produce null terminated strings.
  *
  * They should be used only with null terminated strings.
@@ -64,14 +64,3 @@
                }
        }
 }
-
-
-
-
-
-
-
-
-
-
-
--- /home/cvs/shishi/asn1/gstr.h        2003/08/07 02:11:49     1.1
+++ /home/cvs/shishi/asn1/gstr.h        2004/11/09 19:00:53     1.2
@@ -4,4 +4,3 @@
 
 #define Estrcpy(x,y) _asn1_str_cpy(x,MAX_ERROR_DESCRIPTION_SIZE,y)
 #define Estrcat(x,y) _asn1_str_cat(x,MAX_ERROR_DESCRIPTION_SIZE,y)
-
--- /home/cvs/shishi/asn1/int.h 2004/09/09 10:31:25     1.6
+++ /home/cvs/shishi/asn1/int.h 2004/11/09 19:00:53     1.7
@@ -39,7 +39,7 @@
 #define MAX16 65535
 
 #define MAX_LOG_SIZE 1024 /* maximum number of characters of a log message */
-#define MAX_NAME_SIZE 128 /* maximum number of characters of a name inside an 
ASN1 file definitons */
+#define MAX_NAME_SIZE 128 /* maximum number of characters of a name inside an 
ASN1 file definiton */
 #define MAX_ERROR_DESCRIPTION_SIZE 128 /* maximum number of characters of a 
description message */
 
 /*****************************************/
@@ -79,7 +79,7 @@
 
 /******************************************************/
 /* Structure definition used for the node of the tree */
-/* that rappresent an ASN.1 DEFINITION.               */
+/* that represent an ASN.1 DEFINITION.               */
 /******************************************************/
 typedef struct node_asn_struct{
   char *name;                    /* Node name */
@@ -136,7 +136,7 @@
 
 
 /***********************************************************************/
-/* List of constants for specify better the type of typedef node_asn.  */
+/* List of constants to better specify the type of typedef node_asn.   */
 /***********************************************************************/
 /*  Used with TYPE_TAG  */
 #define CONST_UNIVERSAL   (1<<8)
@@ -195,5 +195,3 @@
 
 
 #endif /* INT_H */
-
-
--- /home/cvs/shishi/asn1/libtasn1.h    2004/09/09 10:31:25     1.6
+++ /home/cvs/shishi/asn1/libtasn1.h    2004/11/09 19:00:53     1.7
@@ -100,7 +100,7 @@
 
 /******************************************************/
 /* Structure definition used for the node of the tree */
-/* that rappresent an ASN.1 DEFINITION.               */
+/* that represent an ASN.1 DEFINITION.                */
 /******************************************************/
 typedef struct node_asn_struct{
   char *name;                    /* Node name */
@@ -147,25 +147,30 @@
 
 asn1_retCode asn1_delete_element(ASN1_TYPE structure,const char *element_name);
 
-asn1_retCode asn1_write_value(ASN1_TYPE element,const char *name,
-                             const void *value,int len);
+asn1_retCode asn1_write_value(ASN1_TYPE *node_root,const char *name,
+                             const void *ivalue,int len);
 
-asn1_retCode asn1_read_value(ASN1_TYPE element,const char *name,void *value,
-                             int *len);
+asn1_retCode asn1_read_value(ASN1_TYPE *root,const char *name,
+                            void* ivalue,int *len);
 
 asn1_retCode asn1_number_of_elements(ASN1_TYPE element,const char *name,int 
*num);
 
 asn1_retCode asn1_der_coding(ASN1_TYPE element,const char *name,
-               void *der,int *len,char *ErrorDescription);
+                            void *ider,int *len,
+                            char *ErrorDescription);
 
-asn1_retCode asn1_der_decoding(ASN1_TYPE *element,const void *der,int len,
-                 char *errorDescription);
+asn1_retCode asn1_der_decoding(ASN1_TYPE *element,const void *ider,int len,
+                              char *errorDescription);
 
-asn1_retCode asn1_der_decoding_element(ASN1_TYPE *structure,const char 
*elementName,
-                const void *der,int len,char *errorDescription);
-
-asn1_retCode asn1_der_decoding_startEnd(ASN1_TYPE element,const void *der,
-               int len,const char *name,int *start, int *end);
+asn1_retCode asn1_der_decoding_element(ASN1_TYPE *structure,
+                                      const char *elementName,
+                                      const void *ider,int len,
+                                      char *errorDescription);
+
+asn1_retCode asn1_der_decoding_startEnd(ASN1_TYPE element,
+                                       const void *ider,int len,
+                                       const char *name_element,
+                                       int *start,int *end);
 
 asn1_retCode asn1_expand_any_defined_by(ASN1_TYPE definitions,
                ASN1_TYPE *element);
@@ -190,16 +195,3 @@
 #endif
 
 #endif /* LIBASN1_H */
-
-
-
-
-
-
-
-
-
-
-
-
-
--- /home/cvs/shishi/asn1/parser_aux.c  2003/08/07 02:11:49     1.1
+++ /home/cvs/shishi/asn1/parser_aux.c  2004/11/09 19:00:53     1.2
@@ -91,7 +91,7 @@
 /* Parameters:                                                    */
 /*   pointer: NODE_ASN element pointer.                           */
 /*   name: null terminated string with the element's name to find.*/
-/* Return: the searching result. NULL if not find.                */
+/* Return: the searching result. NULL if not found.               */
 /******************************************************************/
 node_asn *
 _asn1_find_node(node_asn *pointer,const char *name)
@@ -107,7 +107,7 @@
   p=pointer;
   n_start=name;
 
-  if(p->name != NULL){ /* has *pointer a name ? */
+  if(p->name != NULL){ /* has *pointer got a name ? */
     n_end=strchr(n_start,'.');     /* search the first dot */
     if(n_end){
       memcpy(n,n_start,n_end-n_start);
@@ -171,7 +171,7 @@
 /******************************************************************/
 /* Function : _asn1_set_value                                     */
 /* Description: sets the field VALUE in a NODE_ASN element. The   */
-/*              previus value (if exist) will be lost             */
+/*              previous value (if exist) will be lost            */
 /* Parameters:                                                    */
 /*   node: element pointer.                                       */
 /*   value: pointer to the value that you want to set.            */
@@ -198,7 +198,7 @@
 /******************************************************************/
 /* Function : _asn1_set_name                                      */
 /* Description: sets the field NAME in a NODE_ASN element. The    */
-/*              previus value (if exist) will be lost             */
+/*              previous value (if exist) will be lost            */
 /* Parameters:                                                    */
 /*   node: element pointer.                                       */
 /*   name: a null terminated string with the name that you want   */
@@ -788,9 +788,9 @@
 /* Parameters:                                                    */
 /*   node: pointer to a DEFINITIONS element.                      */
 /* Return:                                                        */
-/*   ASN1_ELEMENT_NOT_FOUND if NODE is NULL or not a pointer to    */
+/*   ASN1_ELEMENT_NOT_FOUND if NODE is NULL or not a pointer to   */
 /*     a DEFINITIONS element,                                     */
-/*   otherwise ASN1_SUCCESS                                             */
+/*   otherwise ASN1_SUCCESS                                       */
 /******************************************************************/
 asn1_retCode 
 _asn1_set_default_tag(ASN1_TYPE node)
@@ -871,11 +871,13 @@
   * asn1_check_version - This function checks the library's version
   * @req_version: the version to check
   *
-  * Check that the the version of the library is at minimum the requested one
-  * and return the version string; return NULL if the condition is not
-  * satisfied.  If a NULL is passed to this function, no check is done,
-  * but the version string is simply returned.
+  * Check library version.
   *
+  * Return value: Check that the the version of the library is at
+  *   minimum the one given as a string in @req_version and return the
+  *   actual version string of the library; return NULL if the
+  *   condition is not met.  If %NULL is passed to this function no
+  *   check is done and only the version string is returned.
   **/
 const char *
 asn1_check_version( const char *req_version )
@@ -907,5 +909,3 @@
     }
     return NULL;
 }
-
-
--- /home/cvs/shishi/asn1/structure.c   2004/04/17 22:05:54     1.2
+++ /home/cvs/shishi/asn1/structure.c   2004/11/09 19:00:53     1.3
@@ -571,7 +571,7 @@
   *  ASN1_ELEMENT_NOT_FOUND\: SOURCE_NAME isn't known
   * 
   * Example: using "pkix.asn"
-  *  result=asn1_create_structure(cert_def,"PKIX1.Certificate",&cert);
+  *  result=asn1_create_structure(cert_def,"PKIX1.Certificate",certptr);
   **/
 asn1_retCode
 asn1_create_element(ASN1_TYPE definitions,const char *source_name,
@@ -600,6 +600,9 @@
   * @out: pointer to the output file (e.g. stdout).
   * @structure: pointer to the structure that you want to visit.
   * @name: an element of the structure
+  * @mode: specify how much of the structure to print, can be
+  *   ASN1_PRINT_NAME, ASN1_PRINT_NAME_TYPE,
+  *   ASN1_PRINT_NAME_TYPE_VALUE, or ASN1_PRINT_ALL.
   * 
   * Prints on the standard output the structure's tree starting from the NAME 
element inside
   * the structure *POINTER. 
@@ -894,8 +897,7 @@
 
 
 /**
-  * asn1_find_structure_from_oid - Search the structure that is defined just
-  * after an OID definition.
+  * asn1_find_structure_from_oid - Locate structure defined by a specific OID.
   * @definitions: ASN1 definitions
   * @oidValue: value of the OID to search (e.g. "1.2.3.4").
   * Description:





reply via email to

[Prev in Thread] Current Thread [Next in Thread]