gl_WARN_SUPPORTED([WARNINGS])
-# Useless warnings for libidn.
+# Useless warnings for libtasn1.
USELESS_WARNINGS=" \
-Wc++-compat \
-Woverlength-strings \
gl_WARN_ADD([$w])
done
+gl_WARN_ADD([-Wno-missing-field-initializers])
gl_WARN_ADD([-Wno-pointer-sign])
gl_WARN_ADD([-Wno-unused-parameter])
gl_WARN_ADD([-fdiagnostics-show-option])
/* Parameters: */
/* char *root: the structure identifier */
/* char *answer: the string with elements like: */
-/* "C=US O=gov" */
+/* "C=US O=gov" */
/******************************************************/
static void
-get_Name_type(ASN1_TYPE cert_def,ASN1_TYPE cert,char *root, char *answer)
+get_Name_type(ASN1_TYPE cert_def,ASN1_TYPE cert,const char *root, char *answer)
{
int k,k2,result,len;
char name[128],str[1024],str2[1024],name2[128],counter[5],name3[128];
/* int *der_len: number of bytes of der string */
/******************************************************/
static void
-create_certificate(ASN1_TYPE cert_def,unsigned char *der,int *der_len)
+create_certificate(ASN1_TYPE cert_def, unsigned char *der,int *der_len)
{
int result,k,len;
- unsigned char str[1024],*str2;
+ unsigned char str[1024];
+ const unsigned char *str2;
ASN1_TYPE cert1=ASN1_TYPE_EMPTY;
ASN1_TYPE value=ASN1_TYPE_EMPTY;
ASN1_TYPE param=ASN1_TYPE_EMPTY;
/* Parameters: */
/* char *root: the structure identifier */
/* char *answer: the string with elements like: */
-/* "C=US O=gov" */
+/* "C=US O=gov" */
/******************************************************/
static void
-get_Name_type(ASN1_TYPE cert_def,ASN1_TYPE cert,char *root, char *answer)
+get_Name_type(ASN1_TYPE cert_def,ASN1_TYPE cert,const char *root, char *answer)
{
int k,k2,result,len;
char name[128],str[1024],str2[1024],name2[128],counter[5],name3[128];
create_CRL(ASN1_TYPE cert_def, unsigned char *der,int *der_len)
{
int result,k,len;
- unsigned char str[1024],*str2;
+ unsigned char str[1024];
+ const unsigned char *str2;
ASN1_TYPE crl=ASN1_TYPE_EMPTY;
ASN1_TYPE value=ASN1_TYPE_EMPTY;
char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
/* Set program_name, based on argv[0]. */
extern void set_program_name (const char *argv0);
-#if ENABLE_RELOCATABLE
+#if defined(ENABLE_RELOCATABLE) && ENABLE_RELOCATABLE
/* Set program_name, based on argv[0], and original installation prefix and
directory, for relocatability. */
extern char _asn1_identifierMissing[];
static const char *fileName; /* file to parse */
-static int _asn1_yyerror (char *);
+static int _asn1_yyerror (const char *);
static int _asn1_yylex(void);
/* Return: int */
/* */
/*************************************************************/
-static int _asn1_yyerror (char *s)
+static int _asn1_yyerror (const char *s)
{
/* Sends the error description to the std_out */
extern char _asn1_identifierMissing[];
static const char *fileName; /* file to parse */
-static int _asn1_yyerror (char *);
+static int _asn1_yyerror (const char *);
static int _asn1_yylex(void);
%}
/* Return: int */
/* */
/*************************************************************/
-static int _asn1_yyerror (char *s)
+static int _asn1_yyerror (const char *s)
{
/* Sends the error description to the std_out */
#include <gstr.h>
#include "structure.h"
+#include "element.h"
+
void
_asn1_hierarchical_name (ASN1_TYPE node, char *name, int name_size)
{
LIBTASN1_ERROR_ENTRY (ASN1_NAME_TOO_LONG),
LIBTASN1_ERROR_ENTRY (ASN1_ARRAY_ERROR),
LIBTASN1_ERROR_ENTRY (ASN1_ELEMENT_NOT_EMPTY),
- {0}
+ {0, 0}
};
/**
/*
- * Copyright (C) 2006 Free Software Foundation
+ * Copyright (C) 2006, 2008 Free Software Foundation
* Copyright (C) 2002 Nikos Mavroyanopoulos
*
* This file is part of LIBTASN1.
*/
#include <int.h>
+#include "gstr.h"
/* These function are like strcat, strcpy. They only
* do bounds checking (they shouldn't cause buffer overruns),
#define CONST_DOWN (1<<29)
#define CONST_RIGHT (1<<30)
-/* Prototypes for gstr.c. */
-void _asn1_str_cat (char *dest, size_t dest_tot_size, const char *src);
-void _asn1_str_cpy (char *dest, size_t dest_tot_size, const char *src);
-
-/* Prototypes for element.c. */
-void _asn1_hierarchical_name (ASN1_TYPE node, char *name, int name_size);
-asn1_retCode _asn1_convert_integer (const char *value,
- unsigned char *value_out,
- int value_out_size, int *len);
-int _asn1_append_sequence_set (ASN1_TYPE node);
-
#endif /* INT_H */
/*
- * Copyright (C) 2006, 2007 Free Software Foundation
+ * Copyright (C) 2006, 2007, 2008 Free Software Foundation
* Copyright (C) 2002 Fabio Fiorina
*
* This file is part of LIBTASN1.
#define ASSIGNMENT_ERROR 2
#define ASSIGNMENT_EOF 3
-int readAssignment(FILE *file,char *varName, char *value){
+static int
+readAssignment(FILE *file,char *varName, char *value){
int ret;
-void createFileName(char *inputFileName, char **outputFileName)
+static void
+createFileName(char *inputFileName, char **outputFileName)
{
char *char_p,*slash_p,*dot_p;