]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
some changes to keep gcc -Wall happy
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 6 Dec 2001 12:18:04 +0000 (12:18 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 6 Dec 2001 12:18:04 +0000 (12:18 +0000)
lib/x509_ASN.y
lib/x509_asn1.c
lib/x509_asn1.h
lib/x509_der.c
lib/x509_der.h

index 567a8e8d86e08c782659e2f1a69ba0fd9b5ddc94..abe38013aa33966bca4f51fcf64c71b7d82b096e 100755 (executable)
@@ -37,6 +37,10 @@ extern int parse_mode;   /* PARSE_MODE_CHECK  = only syntax check
 int result_parse;        /* result of the parser algorithm */
 node_asn *p_tree;        /* pointer to the root of the structure 
                             created by the parser*/     
+
+int yyerror (char *);
+int yylex();
+
 %}
 
 
@@ -546,7 +550,7 @@ int asn1_parser_asn1_file_c(char *file_name){
     yyparse();
 
     /* structure saved in a file */
-    result=_asn1_create_static_structure(p_tree,file_name);
+    result=_asn1_create_static_structure(p_tree,file_name,NULL);
 
     /* delete structure in memory */
     asn1_delete_structure(p_tree);
@@ -573,6 +577,7 @@ int yyerror (char *s)
   /* Sends the error description to the std_out */
   /*  printf("%s\n",s); */
   result_parse=ASN_SYNTAX_ERROR;
+  return 0;
 }
 
 
index a377f91efaf1b851943c90b3b1ca54357e0eb791..4e01b543ba2bc41c7e6c33b8ea78469fe78989c5 100755 (executable)
@@ -30,6 +30,8 @@
 #include "x509_asn1.h" 
 #include "x509_der.h"
 
+
+
 /* define used for visiting trees */
 #define UP     1
 #define RIGHT  2
@@ -266,8 +268,6 @@ _asn1_mod_type(node_asn *node,unsigned int value)
 void
 _asn1_remove_node(node_asn *node)
 {
-  node_asn *punt,*punt_prev;
-
   if(node==NULL) return;
 
   if (node->name!=NULL)
@@ -520,7 +520,7 @@ _asn1_create_static_structure(node_asn *pointer,char *file_name, char* out_name)
 
   char_p=file_name;
   slash_p=file_name;
-  while(char_p=strchr(char_p,'/')){
+  while((char_p=strchr(char_p,'/'))){
     char_p++;
     slash_p=char_p;
   }
@@ -528,7 +528,7 @@ _asn1_create_static_structure(node_asn *pointer,char *file_name, char* out_name)
   char_p=slash_p;
   dot_p=file_name+strlen(file_name);
 
-  while(char_p=strchr(char_p,'.')){
+  while((char_p=strchr(char_p,'.'))){
     dot_p=char_p;
     char_p++;
   }
@@ -610,8 +610,6 @@ asn1_visit_tree(node_asn *pointer,char *name)
 {
   node_asn *p,*root;
   int k,indent=0,len,len2,len3;
-  unsigned char class;
-  unsigned long tag;
 
   root=_asn1_find_node(pointer,name);   
 
@@ -663,8 +661,8 @@ asn1_visit_tree(node_asn *pointer,char *name)
     case TYPE_BOOLEAN:
       printf("BOOLEAN");
       if(p->value){
-       if(p->value[0]=='T') printf("  value:TRUE",p->value);
-       else if(p->value[0]=='F') printf("  value:FALSE",p->value);
+       if(p->value[0]=='T') printf("  value:TRUE");
+       else if(p->value[0]=='F') printf("  value:FALSE");
       }
       break;
     case TYPE_SEQUENCE:
@@ -1082,9 +1080,8 @@ int
 asn1_write_value(node_asn *node_root,char *name,unsigned char *value,int len)
 {
   node_asn *node,*p,*p2;
-  unsigned char *temp,*value_temp,*default_temp,val[4];
+  unsigned char *temp,*value_temp,*default_temp;
   int len2,k,k2,negative;
-  unsigned char *root,*n_end;
 
   node=_asn1_find_node(node_root,name);
   if(node==NULL) return  ASN_ELEMENT_NOT_FOUND;
@@ -1364,8 +1361,6 @@ asn1_read_value(node_asn *root,char *name,unsigned char *value,int *len)
 {
   node_asn *node,*p;
   int len2,len3;
-  unsigned long tag;
-  unsigned char class;
   int value_size = *len;
 
   node=_asn1_find_node(root,name);
@@ -1416,12 +1411,13 @@ asn1_read_value(node_asn *root,char *name,unsigned char *value,int *len)
       while(p){
        if(type_field(p->type)==TYPE_CONSTANT){
          ADD_STR_VALUE( value, value_size, p->value);
-         if(p->right) ADD_STR_VALUE( value, value_size, " ");
+         if(p->right) {
+               ADD_STR_VALUE( value, value_size, " ");
+         }
        }
        p=p->right;
       }
-    } 
-    else {
+    } else {
       PUT_STR_VALUE(value, value_size, node->value);
     }
     break;
@@ -1547,10 +1543,9 @@ _asn1_check_identifier(node_asn *node)
 int 
 _asn1_change_integer_value(node_asn *node)
 {
-  node_asn *p,*p2;
-  char negative;
-  unsigned char val[4],val2[5],temp;
-  int len,k,force_exit;
+  node_asn *p;
+  unsigned char val[4],val2[5];
+  int len;
 
   if(node==NULL) return ASN_ELEMENT_NOT_FOUND;
 
@@ -1821,7 +1816,7 @@ int
 _asn1_expand_object_id(node_asn *node)
 {
   node_asn *p,*p2,*p3,*p4,*p5;
-  char name_root[129],name2[129],*c;
+  char name_root[129],name2[129];
   int move;
  
   if(node==NULL) return ASN_ELEMENT_NOT_FOUND;
index c3bdb98d34e4e882fb0f6070ae34371cd8278a9f..988b53332c4049d55b9234e25e537e8c787616a5 100755 (executable)
@@ -160,6 +160,23 @@ _asn1_find_node(node_asn *pointer,char *name);
 node_asn *
 _asn1_find_up(node_asn *node);
 
+int 
+_asn1_append_sequence_set(node_asn *node);
+
+int 
+_asn1_delete_not_used(node_asn *node);
+
+int 
+_asn1_set_default_tag(node_asn *node);
+
+/* prototypes - not defined elsewere */
+int _asn1_change_integer_value(node_asn *node);
+int _asn1_expand_object_id(node_asn *node);
+int _asn1_expand_identifier(node_asn **node,node_asn *root);
+int _asn1_type_choice_config(node_asn *node);
+int _asn1_type_set_config(node_asn *node);
+int _asn1_check_identifier(node_asn *node);
+int _asn1_create_static_structure(node_asn *pointer,char *file_name, char* out_name);
 
 int 
 asn1_parser_asn1(char *file_name,node_asn **pointer);
index f523e7f08a1909667e48a047f18d4289274ef057..78b8b6b04fc4943d6c1514c4ed705029e618e0b4 100644 (file)
@@ -46,7 +46,7 @@
 char *
 _asn1_ltostr(long v,char *str)
 {
-  long d,r,v2;
+  long d,r;
   char temp[20];
   int count,k,start;
 
@@ -152,7 +152,6 @@ _asn1_tag_der(unsigned char class,unsigned int tag_value,unsigned char *ans,int
 unsigned int
 _asn1_get_tag_der(unsigned char *der,unsigned char *class,int  *len)
 {
-  unsigned long ans;
   int punt,ris;
 
   *class=der[0]&0xE0;
@@ -276,7 +275,7 @@ _asn1_objectid_der(unsigned char *str,unsigned char *der,int *der_len)
 
   counter=0;
   n_start=temp;
-  while(n_end=strchr(n_start,' ')){
+  while((n_end=strchr(n_start,' '))){
     *n_end=0;
     val=strtoul(n_start,NULL,10);
     counter++;
@@ -391,10 +390,9 @@ void
 _asn1_complete_explicit_tag(node_asn *node,unsigned char *der,int *counter)
 {
   node_asn *p;
-  int tag_len,is_tag_implicit,len2,len3;
-  unsigned char class,class_implicit,temp[10];
-  unsigned long tag_implicit;
-   
+  int is_tag_implicit,len2,len3;
+  unsigned char temp[10];
+  
   is_tag_implicit=0;
 
   if(node->type&CONST_TAG){
@@ -426,7 +424,7 @@ int
 _asn1_insert_tag_der(node_asn *node,unsigned char *der,int *counter)
 {
   node_asn *p;
-  int tag_len,is_tag_implicit,len2,len3;
+  int tag_len,is_tag_implicit;
   unsigned char class,class_implicit,temp[10];
   unsigned long tag_implicit;
    
@@ -833,9 +831,9 @@ _asn1_ordering_set_of(unsigned char *der,node_asn *node)
 int 
 asn1_create_der(node_asn *root,char *name,unsigned char *der,int *len)
 {
-  node_asn *node,*p,*p2,*p3;
+  node_asn *node,*p;
   char temp[20];
-  int counter,counter_old,len2,len3,len4,move,ris;
+  int counter,counter_old,len2,len3,move,ris;
 
   node=_asn1_find_node(root,name);
   if(node==NULL) return ASN_ELEMENT_NOT_FOUND;
@@ -995,7 +993,6 @@ asn1_get_der(node_asn *root,unsigned char *der,int len)
   int counter,len2,len3,len4,move,ris;
   unsigned char class,*temp2;
   unsigned int tag;
-  long val;
 
   node=root;
   if(node==NULL) return ASN_ELEMENT_NOT_FOUND;
@@ -1239,11 +1236,9 @@ int
 asn1_get_start_end_der(node_asn *root,unsigned char *der,int len,char *name_element,int *start, int *end)
 {
   node_asn *node,*node_to_find,*p,*p2,*p3;
-  char temp[128];
   int counter,len2,len3,move,ris;
   unsigned char class;
   unsigned int tag;
-  long val;
 
   node=root;
   node_to_find=_asn1_find_node(root,name_element);
index 024367f1597bc7716735cc709732a5e8626ca886..b926963dc2caccc84e7487f8647a0237c366998b 100644 (file)
@@ -37,6 +37,14 @@ asn1_get_der(node_asn *root,unsigned char *der,int len);
 int 
 asn1_get_start_end_der(node_asn *root,unsigned char *der,int len,char *name_element,int *start, int *end);
 
+unsigned long
+_asn1_get_length_der(unsigned char *der,int  *len);
+
+void
+_asn1_length_der(unsigned long len,unsigned char *ans,int *ans_len);
+
+char *
+_asn1_ltostr(long v,char *str);
 
 #endif