[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnupg-commit-watchers
Subject:    [gnutls-commits] CVS gnutls/lib/minitasn1
From:       "CVS User jas" <jas () gnutls ! org>
Date:       2006-02-28 12:52:21
Message-ID: E1FE4Kz-0003Vs-UH () trithemius ! gnupg ! org
[Download RAW message or body]

Update of /cvs/gnutls/gnutls/lib/minitasn1
In directory trithemius:/tmp/cvs-serv13504

Modified Files:
	Makefile.am coding.c decoding.c element.c errors.h gstr.c 
	gstr.h int.h libtasn1.h parser_aux.c structure.c structure.h 
Removed Files:
	der.h errors_int.h 
Log Message:
Update.

--- /cvs/gnutls/gnutls/lib/minitasn1/Makefile.am	2005/08/23 22:28:16	1.7
+++ /cvs/gnutls/gnutls/lib/minitasn1/Makefile.am	2006/02/28 12:52:21	1.8
@@ -2,8 +2,8 @@
 
 noinst_LTLIBRARIES = libminitasn1.la
 
-libminitasn1_la_SOURCES = libtasn1.h der.h mem.h gstr.h errors.h int.h	\
-        parser_aux.h structure.h errors_int.h element.h decoding.c	\
-        gstr.c errors.c parser_aux.c structure.c element.c coding.c
+libminitasn1_la_SOURCES = libtasn1.h mem.h gstr.h errors.h int.h	\
+        parser_aux.h structure.h element.h decoding.c gstr.c errors.c	\
+        parser_aux.c structure.c element.c coding.c
 
 EXTRA_DIST = README
--- /cvs/gnutls/gnutls/lib/minitasn1/coding.c	2006/02/11 10:51:30	1.19
+++ /cvs/gnutls/gnutls/lib/minitasn1/coding.c	2006/02/28 12:52:21	1.20
@@ -26,10 +26,9 @@
 /* Description: Functions to create a DER coding of  */
 /*   an ASN1 type.                                   */
 /*****************************************************/
- 
+
 #include <int.h>
 #include <errors.h>
-#include "der.h"
 #include "parser_aux.h"
 #include <gstr.h>
 #include "element.h"
@@ -58,17 +57,15 @@
 
 }
 
-/******************************************************/
-/* Function : asn1_length_der                        */
-/* Description: creates the DER coding for the LEN    */
-/* parameter (only the length).                       */
-/* Parameters:                                        */
-/*   len: value to convert.                           */
-/*   ans: string returned.                            */
-/*   ans_len: number of meaningful bytes of ANS       */
-/*            (ans[0]..ans[ans_len-1]).               */
-/* Return:                                            */
-/******************************************************/
+/**
+ * asn1_length_der:
+ * @len: value to convert.
+ * @ans: string returned.
+ * @ans_len: number of meaningful bytes of ANS (ans[0]..ans[ans_len-1]).
+ *
+ * Creates the DER coding for the LEN parameter (only the length).
+ * The @ans buffer is pre-allocated and must have room for the output.
+ **/
 void
 asn1_length_der(unsigned long len,unsigned char *ans,int *ans_len)
 {
@@ -132,20 +129,18 @@
   }
 }
 
-/******************************************************/
-/* Function : _asn1_octect_der                        */
-/* Description: creates the DER coding for an         */
-/* OCTET type (length included).                      */
-/* Parameters:                                        */
-/*   str: OCTET string.                               */
-/*   str_len: STR length (str[0]..str[str_len-1]).    */
-/*   der: string returned.                            */
-/*   der_len: number of meaningful bytes of DER       */
-/*            (der[0]..der[ans_len-1]).               */
-/* Return:                                            */
-/******************************************************/
+/**
+ * asn1_octet_der:
+ * @str: OCTET string.
+ * @str_len: STR length (str[0]..str[str_len-1]).
+ * @der: string returned.
+ * @der_len: number of meaningful bytes of DER (der[0]..der[ans_len-1]).
+ *
+ * Creates the DER coding for an OCTET type (length included).
+ **/
 void
-asn1_octet_der(const unsigned char *str,int str_len,unsigned char *der,int *der_len)
+asn1_octet_der(const unsigned char *str,int str_len,
+	       unsigned char *der,int *der_len)
 {
   int len_len;
 
@@ -302,20 +297,20 @@
 
 const char bit_mask[]={0xFF,0xFE,0xFC,0xF8,0xF0,0xE0,0xC0,0x80};
 
-/******************************************************/
-/* Function : asn1_bit_der                           */
-/* Description: creates the DER coding for a BIT      */
-/* STRING  type (length and pad included).            */
-/* Parameters:                                        */
-/*   str: BIT string.                                 */
-/*   bit_len: number of meaningful bits in STR.       */
-/*   der: string returned.                            */
-/*   der_len: number of meaningful bytes of DER       */
-/*            (der[0]..der[ans_len-1]).               */
-/* Return:                                            */
-/******************************************************/
+/**
+ * asn1_bit_der:
+ * @str: BIT string.
+ * @bit_len: number of meaningful bits in STR.
+ * @der: string returned.
+ * @der_len: number of meaningful bytes of DER
+ *   (der[0]..der[ans_len-1]).
+ *
+ * Creates the DER coding for a BIT STRING type (length and pad
+ * included).
+ **/
 void
-asn1_bit_der(const unsigned char *str,int bit_len,unsigned char *der,int *der_len)
+asn1_bit_der(const unsigned char *str, int bit_len,
+	     unsigned char *der, int *der_len)
 {
   int len_len,len_byte,len_pad;
 
@@ -424,16 +419,16 @@
     p=node->down;
     while(p){
       if(type_field(p->type)==TYPE_TAG){
-	if(p->type&CONST_APPLICATION) class=APPLICATION;
-	else if(p->type&CONST_UNIVERSAL) class=UNIVERSAL;
-	else if(p->type&CONST_PRIVATE) class=PRIVATE;
-	else class=CONTEXT_SPECIFIC;
+	if(p->type&CONST_APPLICATION) class=ASN1_CLASS_APPLICATION;
+	else if(p->type&CONST_UNIVERSAL) class=ASN1_CLASS_UNIVERSAL;
+	else if(p->type&CONST_PRIVATE) class=ASN1_CLASS_PRIVATE;
+	else class=ASN1_CLASS_CONTEXT_SPECIFIC;
 	
 	if(p->type&CONST_EXPLICIT){
 	  if(is_tag_implicit)
 	    _asn1_tag_der(class_implicit,tag_implicit,tag_der,&tag_len);
 	  else
-	    _asn1_tag_der(class|STRUCTURED,strtoul(p->value,NULL,10),tag_der,&tag_len);
+	    _asn1_tag_der(class|ASN1_CLASS_STRUCTURED,strtoul(p->value,NULL,10),tag_der,&tag_len);
  
 	  *max_len -= tag_len;
 	  if(*max_len>=0)
@@ -450,7 +445,7 @@
 	    if((type_field(node->type)==TYPE_SEQUENCE) || 
 	       (type_field(node->type)==TYPE_SEQUENCE_OF) ||
 	       (type_field(node->type)==TYPE_SET) ||
-	       (type_field(node->type)==TYPE_SET_OF)) class|=STRUCTURED;
+	       (type_field(node->type)==TYPE_SET_OF)) class|=ASN1_CLASS_STRUCTURED;
 	    class_implicit=class;
 	    tag_implicit=strtoul(p->value,NULL,10);
 	    is_tag_implicit=1;
@@ -467,40 +462,40 @@
   else{
     switch(type_field(node->type)){
     case TYPE_NULL:
-      _asn1_tag_der(UNIVERSAL,TAG_NULL,tag_der,&tag_len);
+      _asn1_tag_der(ASN1_CLASS_UNIVERSAL,ASN1_TAG_NULL,tag_der,&tag_len);
       break;
     case TYPE_BOOLEAN:
-      _asn1_tag_der(UNIVERSAL,TAG_BOOLEAN,tag_der,&tag_len);
+      _asn1_tag_der(ASN1_CLASS_UNIVERSAL,ASN1_TAG_BOOLEAN,tag_der,&tag_len);
       break;
     case TYPE_INTEGER:
-      _asn1_tag_der(UNIVERSAL,TAG_INTEGER,tag_der,&tag_len);
+      _asn1_tag_der(ASN1_CLASS_UNIVERSAL,ASN1_TAG_INTEGER,tag_der,&tag_len);
       break;
     case TYPE_ENUMERATED:
-      _asn1_tag_der(UNIVERSAL,TAG_ENUMERATED,tag_der,&tag_len);
+      _asn1_tag_der(ASN1_CLASS_UNIVERSAL,ASN1_TAG_ENUMERATED,tag_der,&tag_len);
       break;
     case TYPE_OBJECT_ID:
-      _asn1_tag_der(UNIVERSAL,TAG_OBJECT_ID,tag_der,&tag_len);
+      _asn1_tag_der(ASN1_CLASS_UNIVERSAL,ASN1_TAG_OBJECT_ID,tag_der,&tag_len);
       break;
     case TYPE_TIME:
       if(node->type&CONST_UTC){
-	_asn1_tag_der(UNIVERSAL,TAG_UTCTime,tag_der,&tag_len);
+	_asn1_tag_der(ASN1_CLASS_UNIVERSAL,ASN1_TAG_UTCTime,tag_der,&tag_len);
       }
-      else _asn1_tag_der(UNIVERSAL,TAG_GENERALIZEDTime,tag_der,&tag_len);
+      else _asn1_tag_der(ASN1_CLASS_UNIVERSAL,ASN1_TAG_GENERALIZEDTime,tag_der,&tag_len);
  break;
     case TYPE_OCTET_STRING:
-      _asn1_tag_der(UNIVERSAL,TAG_OCTET_STRING,tag_der,&tag_len);
+      _asn1_tag_der(ASN1_CLASS_UNIVERSAL,ASN1_TAG_OCTET_STRING,tag_der,&tag_len);
       break;
     case TYPE_GENERALSTRING:
-      _asn1_tag_der(UNIVERSAL,TAG_GENERALSTRING,tag_der,&tag_len);
+      _asn1_tag_der(ASN1_CLASS_UNIVERSAL,ASN1_TAG_GENERALSTRING,tag_der,&tag_len);
       break;
     case TYPE_BIT_STRING:
-      _asn1_tag_der(UNIVERSAL,TAG_BIT_STRING,tag_der,&tag_len);
+      _asn1_tag_der(ASN1_CLASS_UNIVERSAL,ASN1_TAG_BIT_STRING,tag_der,&tag_len);
       break;
     case TYPE_SEQUENCE: case TYPE_SEQUENCE_OF:
-      _asn1_tag_der(UNIVERSAL|STRUCTURED,TAG_SEQUENCE,tag_der,&tag_len);
+      _asn1_tag_der(ASN1_CLASS_UNIVERSAL|ASN1_CLASS_STRUCTURED,ASN1_TAG_SEQUENCE,tag_der,&tag_len);
  break;
     case TYPE_SET: case TYPE_SET_OF:
-      _asn1_tag_der(UNIVERSAL|STRUCTURED,TAG_SET,tag_der,&tag_len);
+      _asn1_tag_der(ASN1_CLASS_UNIVERSAL|ASN1_CLASS_STRUCTURED,ASN1_TAG_SET,tag_der,&tag_len);
  break;
     case TYPE_TAG:
       tag_len=0;
--- /cvs/gnutls/gnutls/lib/minitasn1/decoding.c	2006/02/11 10:51:30	1.29
+++ /cvs/gnutls/gnutls/lib/minitasn1/decoding.c	2006/02/28 12:52:21	1.30
@@ -28,7 +28,6 @@
  
 #include <int.h>
 #include <errors.h>
-#include "der.h"
 #include "parser_aux.h"
 #include <gstr.h>
 #include "structure.h"
@@ -46,7 +45,17 @@
 
 }
 
-  
+/**
+ * asn1_get_length_der:
+ * @der: DER data to decode.
+ * @der_len: Length of DER data to decode.
+ * @len: Output variable containing the length of the DER length field.
+ *
+ * Extract a length field from DER data.
+ *
+ * Return value: Return the decoded length value, or -1 on indefinite
+ *   length, or -2 when the value was too big.
+ **/
 signed long
 asn1_get_length_der(const unsigned char *der, int der_len, int  *len)
 {
@@ -69,10 +78,11 @@
       ans=0;
       while(punt<=k && punt < der_len) {
 	unsigned long last = ans;
-         ans=ans*256+der[punt++];
-	 if (ans < last)
-	   /* we wrapped around, no bignum support... */
-	   return -2;
+
+	ans=ans*256+der[punt++];
+	if (ans < last)
+	  /* we wrapped around, no bignum support... */
+	  return -2;
       }
     }
     else{  /* indefinite length method */
@@ -87,9 +97,21 @@
 
 
 
+/**
+ * asn1_get_tag_der:
+ * @der: DER data to decode.
+ * @der_len: Length of DER data to decode.
+ * @class: Output variable containing decoded class.
+ * @len: Output variable containing the length of the DER TAG data.
+ * @tag: Output variable containing the decoded tag.
+ *
+ * Decode the class and TAG from DER code.
+ *
+ * Return value: Returns ASN1_SUCCESS on success, or an error.
+ **/
 int
 asn1_get_tag_der(const unsigned char *der, int der_len,
-                 unsigned char *class,int  *len, unsigned long *tag)
+		 unsigned char *class,int  *len, unsigned long *tag)
 {
   int punt,ris;
 
@@ -131,8 +153,22 @@
 
 
 
+/**
+ * asn1_get_octet_der:
+ * @der: DER data to decode containing the OCTET SEQUENCE.
+ * @der_len: Length of DER data to decode.
+ * @ret_len: Output variable containing the length of the DER data.
+ * @str: Pre-allocated output buffer to put decoded OCTET SEQUENCE in.
+ * @str_size: Length of pre-allocated output buffer.
+ * @str_len: Output variable containing the length of the OCTET SEQUENCE.
+ *
+ * Extract an OCTET SEQUENCE from DER data.
+ *
+ * Return value: Returns ASN1_SUCCESS on success, or an error.
+ **/
 int
-asn1_get_octet_der(const unsigned char *der, int der_len, int *ret_len,unsigned char \
*str,int str_size, int *str_len) +asn1_get_octet_der(const unsigned char *der, int \
der_len, +		   int *ret_len,unsigned char *str, int str_size, int *str_len)
 {
   int len_len;
 
@@ -140,17 +176,17 @@
 
   /* if(str==NULL) return ASN1_SUCCESS; */
   *str_len=asn1_get_length_der(der, der_len, &len_len);
-  
+
   if (*str_len < 0)
      return ASN1_DER_ERROR;
 
   *ret_len=*str_len+len_len;
   if ( str_size >= *str_len)
-	  memcpy(str,der+len_len,*str_len);
+    memcpy(str,der+len_len,*str_len);
   else {
-  	return ASN1_MEM_ERROR;
+    return ASN1_MEM_ERROR;
   }
-  
+
   return ASN1_SUCCESS;
 }
 
@@ -214,9 +250,22 @@
 
 
 
+/**
+ * asn1_get_bit_der:
+ * @der: DER data to decode containing the BIT SEQUENCE.
+ * @der_len: Length of DER data to decode.
+ * @ret_len: Output variable containing the length of the DER data.
+ * @str: Pre-allocated output buffer to put decoded BIT SEQUENCE in.
+ * @str_size: Length of pre-allocated output buffer.
+ * @bit_len: Output variable containing the size of the BIT SEQUENCE.
+ *
+ * Extract a BIT SEQUENCE from DER data.
+ *
+ * Return value: Return ASN1_SUCCESS on success, or an error.
+ **/
 int
 asn1_get_bit_der(const unsigned char *der, int der_len,
-  int *ret_len,unsigned char *str, int str_size, int *bit_len)
+		 int *ret_len, unsigned char *str, int str_size, int *bit_len)
 {
   int len_len,len_byte;
 
@@ -225,15 +274,15 @@
   if (len_byte < 0)
     return ASN1_DER_ERROR;
 
-  *ret_len=len_byte+len_len+1;  
+  *ret_len=len_byte+len_len+1;
   *bit_len=len_byte*8-der[len_len];
 
   if (str_size >= len_byte)
- 	memcpy(str,der+len_len+1,len_byte);
+    memcpy(str,der+len_len+1,len_byte);
   else {
-  	return ASN1_MEM_ERROR;
+    return ASN1_MEM_ERROR;
   }
- 
+
   return ASN1_SUCCESS;
 }
 
@@ -256,10 +305,10 @@
     p=node->down;
     while(p){
       if(type_field(p->type)==TYPE_TAG){
-	if(p->type&CONST_APPLICATION) class2=APPLICATION;
-	else if(p->type&CONST_UNIVERSAL) class2=UNIVERSAL;
-	else if(p->type&CONST_PRIVATE) class2=PRIVATE;
-	else class2=CONTEXT_SPECIFIC;
+	if(p->type&CONST_APPLICATION) class2=ASN1_CLASS_APPLICATION;
+	else if(p->type&CONST_UNIVERSAL) class2=ASN1_CLASS_UNIVERSAL;
+	else if(p->type&CONST_PRIVATE) class2=ASN1_CLASS_PRIVATE;
+	else class2=ASN1_CLASS_CONTEXT_SPECIFIC;
 	
 	if(p->type&CONST_EXPLICIT){
 	  if (asn1_get_tag_der(der+counter, der_len-counter,&class,&len2, \
&tag)!=ASN1_SUCCESS) @@ -272,22 +321,23 @@
 	    return ASN1_DER_ERROR;
 	  counter+=len2;
 	  if(!is_tag_implicit){
-	    if((class!=(class2|STRUCTURED)) || (tag!=strtoul(p->value,NULL,10)))
+	    if((class!=(class2|ASN1_CLASS_STRUCTURED)) ||
+	       (tag!=strtoul(p->value,NULL,10)))
 	      return ASN1_TAG_ERROR;
 	  }
-	  else{    /* TAG_IMPLICIT */
+	  else{    /* ASN1_TAG_IMPLICIT */
 	    if((class!=class_implicit) || (tag!=tag_implicit))
 	      return ASN1_TAG_ERROR;
 	  }
 
 	  is_tag_implicit=0;
 	}
-	else{    /* TAG_IMPLICIT */
+	else{    /* ASN1_TAG_IMPLICIT */
 	  if(!is_tag_implicit){
 	    if((type_field(node->type)==TYPE_SEQUENCE) ||
 	       (type_field(node->type)==TYPE_SEQUENCE_OF) ||
 	       (type_field(node->type)==TYPE_SET) ||
-	       (type_field(node->type)==TYPE_SET_OF))  class2|=STRUCTURED;
+	       (type_field(node->type)==TYPE_SET_OF))  class2|=ASN1_CLASS_STRUCTURED;
 	    class_implicit=class2;
 	    tag_implicit=strtoul(p->value,NULL,10);
 	    is_tag_implicit=1;
@@ -306,7 +356,7 @@
 
     if((class!=class_implicit) || (tag!=tag_implicit)){
       if(type_field(node->type)==TYPE_OCTET_STRING){
-	class_implicit |= STRUCTURED;
+	class_implicit |= ASN1_CLASS_STRUCTURED;
 	if((class!=class_implicit) || (tag!=tag_implicit))
 	  return ASN1_TAG_ERROR;
       }
@@ -328,45 +378,45 @@
 
     switch(type_field(node->type)){
     case TYPE_NULL:
-      if((class!=UNIVERSAL) || (tag!=TAG_NULL)) return ASN1_DER_ERROR;
+      if((class!=ASN1_CLASS_UNIVERSAL) || (tag!=ASN1_TAG_NULL)) return \
ASN1_DER_ERROR;  break;
     case TYPE_BOOLEAN:
-      if((class!=UNIVERSAL) || (tag!=TAG_BOOLEAN)) return ASN1_DER_ERROR;
+      if((class!=ASN1_CLASS_UNIVERSAL) || (tag!=ASN1_TAG_BOOLEAN)) return \
ASN1_DER_ERROR;  break;
     case TYPE_INTEGER:
-      if((class!=UNIVERSAL) || (tag!=TAG_INTEGER)) return ASN1_DER_ERROR;
+      if((class!=ASN1_CLASS_UNIVERSAL) || (tag!=ASN1_TAG_INTEGER)) return \
ASN1_DER_ERROR;  break;
     case TYPE_ENUMERATED:
-      if((class!=UNIVERSAL) || (tag!=TAG_ENUMERATED)) return ASN1_DER_ERROR;
+      if((class!=ASN1_CLASS_UNIVERSAL) || (tag!=ASN1_TAG_ENUMERATED)) return \
ASN1_DER_ERROR;  break;
     case TYPE_OBJECT_ID:
-      if((class!=UNIVERSAL) || (tag!=TAG_OBJECT_ID)) return ASN1_DER_ERROR;
+      if((class!=ASN1_CLASS_UNIVERSAL) || (tag!=ASN1_TAG_OBJECT_ID)) return \
ASN1_DER_ERROR;  break;
     case TYPE_TIME:
       if(node->type&CONST_UTC){
-	  if((class!=UNIVERSAL) || (tag!=TAG_UTCTime)) return ASN1_DER_ERROR;
+	if((class!=ASN1_CLASS_UNIVERSAL) || (tag!=ASN1_TAG_UTCTime)) return ASN1_DER_ERROR;
       }
       else{
-	if((class!=UNIVERSAL) || (tag!=TAG_GENERALIZEDTime)) 
+	if((class!=ASN1_CLASS_UNIVERSAL) || (tag!=ASN1_TAG_GENERALIZEDTime))
 	  return ASN1_DER_ERROR;
       }
       break;
     case TYPE_OCTET_STRING:
-      if(((class!=UNIVERSAL) && (class!=(UNIVERSAL|STRUCTURED)))
-	 || (tag!=TAG_OCTET_STRING)) return ASN1_DER_ERROR;
+      if(((class!=ASN1_CLASS_UNIVERSAL) && \
(class!=(ASN1_CLASS_UNIVERSAL|ASN1_CLASS_STRUCTURED))) +	 || \
(tag!=ASN1_TAG_OCTET_STRING)) return ASN1_DER_ERROR;  break;
     case TYPE_GENERALSTRING:
-      if((class!=UNIVERSAL) || (tag!=TAG_GENERALSTRING)) return ASN1_DER_ERROR;
+      if((class!=ASN1_CLASS_UNIVERSAL) || (tag!=ASN1_TAG_GENERALSTRING)) return \
ASN1_DER_ERROR;  break;
     case TYPE_BIT_STRING:
-      if((class!=UNIVERSAL) || (tag!=TAG_BIT_STRING)) return ASN1_DER_ERROR;
+      if((class!=ASN1_CLASS_UNIVERSAL) || (tag!=ASN1_TAG_BIT_STRING)) return \
ASN1_DER_ERROR;  break;
     case TYPE_SEQUENCE: case TYPE_SEQUENCE_OF:
-      if((class!=(UNIVERSAL|STRUCTURED)) || (tag!=TAG_SEQUENCE)) 
+      if((class!=(ASN1_CLASS_UNIVERSAL|ASN1_CLASS_STRUCTURED)) || \
(tag!=ASN1_TAG_SEQUENCE))  return ASN1_DER_ERROR;
       break;
     case TYPE_SET: case TYPE_SET_OF:
-      if((class!=(UNIVERSAL|STRUCTURED)) || (tag!=TAG_SET)) 
+      if((class!=(ASN1_CLASS_UNIVERSAL|ASN1_CLASS_STRUCTURED)) || \
(tag!=ASN1_TAG_SET))  return ASN1_DER_ERROR;
       break;
     case TYPE_ANY:
@@ -438,7 +488,7 @@
 
   counter=0;
 
-  if(*(der-1) & STRUCTURED){
+  if(*(der-1) & ASN1_CLASS_STRUCTURED){
     tot_len=0;
     indefinite=asn1_get_length_der(der, *len, &len3);
     if (indefinite < -1)
@@ -458,8 +508,8 @@
       }
       else if(counter>=indefinite) break;
 
-      if(der[counter] != TAG_OCTET_STRING) return ASN1_DER_ERROR;
-	
+      if(der[counter] != ASN1_TAG_OCTET_STRING) return ASN1_DER_ERROR;
+
       counter++;
 
       len2=asn1_get_length_der(der+counter,*len-counter, &len3);
--- /cvs/gnutls/gnutls/lib/minitasn1/element.c	2006/02/11 10:51:30	1.17
+++ /cvs/gnutls/gnutls/lib/minitasn1/element.c	2006/02/28 12:52:21	1.18
@@ -30,7 +30,6 @@
 #include <int.h>
 #include <errors.h>
 #include "parser_aux.h"
-#include "der.h"
 #include <gstr.h>
 #include "structure.h"
 
--- /cvs/gnutls/gnutls/lib/minitasn1/errors.h	2006/02/09 13:04:37	1.5
+++ /cvs/gnutls/gnutls/lib/minitasn1/errors.h	2006/02/28 12:52:21	1.6
@@ -24,10 +24,6 @@
 #define ERRORS_H
 
 #include "int.h"
-#include "errors_int.h"
-
-const char* libtasn1_strerror(int error);
-void libtasn1_perror(int error);
 
 void _libtasn1_log( const char *fmt, ...);
 
--- /cvs/gnutls/gnutls/lib/minitasn1/gstr.c	2006/02/09 13:04:37	1.4
+++ /cvs/gnutls/gnutls/lib/minitasn1/gstr.c	2006/02/28 12:52:21	1.5
@@ -54,15 +54,3 @@
 		}
 	}
 }
-
-void _asn1_mem_cpy( char* dest, size_t dest_tot_size, const char* src, size_t \
                src_size) 
-{
-
-	if ( dest_tot_size >= src_size) {
-		memcpy( dest, src, src_size);
-	} else {
-		if ( dest_tot_size > 0) {
-			memcpy( dest, src, dest_tot_size);
-		}
-	}
-}
--- /cvs/gnutls/gnutls/lib/minitasn1/gstr.h	2004/10/28 20:58:06	1.3
+++ /cvs/gnutls/gnutls/lib/minitasn1/gstr.h	2006/02/28 12:52:21	1.4
@@ -1,5 +1,4 @@
 void _asn1_str_cpy( char* dest, size_t dest_tot_size, const char* src);
-void _asn1_mem_cpy( char* dest, size_t dest_tot_size, const char* src, size_t \
src_size);  void _asn1_str_cat( char* dest, size_t dest_tot_size, const char* src);
 
 #define Estrcpy(x,y) _asn1_str_cpy(x,MAX_ERROR_DESCRIPTION_SIZE,y)
--- /cvs/gnutls/gnutls/lib/minitasn1/int.h	2006/02/09 13:04:37	1.16
+++ /cvs/gnutls/gnutls/lib/minitasn1/int.h	2006/02/28 12:52:21	1.17
@@ -35,15 +35,9 @@
 
 #include <mem.h>
 
-#define MAX32 4294967295
-#define MAX24 16777215
-#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 definiton */
-#define MAX_ERROR_DESCRIPTION_SIZE 128 /* maximum number of characters of a \
description message */  
-/* define used for visiting trees */
+/* Define used for visiting trees. */
 #define UP     1
 #define RIGHT  2
 #define DOWN   3
--- /cvs/gnutls/gnutls/lib/minitasn1/libtasn1.h	2006/02/11 10:51:30	1.23
+++ /cvs/gnutls/gnutls/lib/minitasn1/libtasn1.h	2006/02/28 12:52:21	1.24
@@ -77,11 +77,11 @@
 /*****************************************/
 /* Constants returned by asn1_read_tag   */
 /*****************************************/
-#define ASN1_CLASS_UNIVERSAL        1
-#define ASN1_CLASS_APPLICATION      2
-#define ASN1_CLASS_CONTEXT_SPECIFIC 3
-#define ASN1_CLASS_PRIVATE          4
-
+#define ASN1_CLASS_UNIVERSAL        0x00  /* old: 1 */
+#define ASN1_CLASS_APPLICATION      0x40  /* old: 2 */
+#define ASN1_CLASS_CONTEXT_SPECIFIC 0x80  /* old: 3 */
+#define ASN1_CLASS_PRIVATE          0xC0  /* old: 4 */
+#define ASN1_CLASS_STRUCTURED       0x20
 
 /*****************************************/
 /* Constants returned by asn1_read_tag   */
@@ -198,8 +198,8 @@
   int asn1_get_tag_der(const unsigned char *der, int der_len,
 		       unsigned char *class,int  *len, unsigned long *tag);
 
-  void _asn1_octet_der(const unsigned char *str,int str_len,
-		       unsigned char *der,int *der_len);
+  void asn1_octet_der(const unsigned char *str,int str_len,
+		      unsigned char *der,int *der_len);
 
   asn1_retCode asn1_get_octet_der(const unsigned char *der, int der_len,
 				  int *ret_len,unsigned char *str,
--- /cvs/gnutls/gnutls/lib/minitasn1/parser_aux.c	2006/02/11 10:51:30	1.12
+++ /cvs/gnutls/gnutls/lib/minitasn1/parser_aux.c	2006/02/28 12:52:21	1.13
@@ -23,7 +23,6 @@
 #include <int.h>
 #include <errors.h>
 #include "parser_aux.h"
-#include "der.h"
 #include "gstr.h"
 #include "structure.h"
 #include "element.h"
--- /cvs/gnutls/gnutls/lib/minitasn1/structure.c	2006/02/11 10:51:30	1.18
+++ /cvs/gnutls/gnutls/lib/minitasn1/structure.c	2006/02/28 12:52:21	1.19
@@ -32,7 +32,6 @@
 #include <errors.h>
 #include <structure.h>
 #include "parser_aux.h"
-#include "der.h"
 #include <gstr.h>
 
 
--- /cvs/gnutls/gnutls/lib/minitasn1/structure.h	2002/12/28 17:26:29	1.1
+++ /cvs/gnutls/gnutls/lib/minitasn1/structure.h	2006/02/28 12:52:21	1.2
@@ -8,16 +8,6 @@
 #ifndef _STRUCTURE_H
 #define _STRUCTURE_H
 
-
-/*************************************/
-/* Constants used in asn1_visit_tree */
-/*************************************/
-#define ASN1_PRINT_NAME             1
-#define ASN1_PRINT_NAME_TYPE        2
-#define ASN1_PRINT_NAME_TYPE_VALUE  3
-#define ASN1_PRINT_ALL              4
-
-
 asn1_retCode _asn1_create_static_structure(node_asn *pointer,
        char* output_file_name,char *vector_name);
 


_______________________________________________
Gnutls-commits mailing list
Gnutls-commits@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnutls-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic