From 2d2b4693689d5f3b858e2d983c428f2e4a24d364 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Sun, 3 May 2009 22:29:21 +0200 Subject: [PATCH] Fix syntax-check warnings. --- .x-sc_GPL_version | 4 ++ .x-sc_avoid_if_before_free | 3 ++ .x-sc_cast_of_alloca_return_value | 3 ++ .x-sc_cast_of_argument_to_free | 1 + .x-sc_file_system | 2 + .x-sc_m4_quote_check | 1 + .x-sc_makefile_check | 2 + .x-sc_program_name | 5 +++ .x-sc_prohibit_HAVE_MBRTOWC | 2 + .x-sc_prohibit_S_IS_definition | 2 + .x-sc_space_tab | 9 +++++ .x-sc_the_the | 3 ++ .x-sc_two_space_separator_in_usage | 3 ++ .x-sc_useless_cpp_parens | 4 ++ NEWS | 2 +- cfg.mk | 5 ++- doc/examples/ex-serv-export.c | 5 +-- doc/gnutls.texi | 3 +- gtk-doc.make | 6 +-- lib/gnutls.asn | 46 +++++++++++----------- lib/m4/hooks.m4 | 60 ++++++++++++++--------------- lib/openpgp/Makefile.am | 4 +- lib/pkix.asn | 61 +++++++++++++++--------------- lib/x509/Makefile.am | 2 +- libextra/m4/hooks.m4 | 9 ++--- m4/valgrind.m4 | 8 ++-- src/Makefile.am | 2 +- src/certtool-cfg.c | 3 +- src/certtool.c | 11 +++--- src/crypt.c | 5 ++- src/psk.c | 5 ++- src/serv.c | 6 +-- src/tls_test.c | 2 + tests/Makefile.am | 2 +- tests/resume.c | 5 +-- tests/x509dn.c | 7 ++-- 36 files changed, 175 insertions(+), 128 deletions(-) create mode 100644 .x-sc_GPL_version create mode 100644 .x-sc_avoid_if_before_free create mode 100644 .x-sc_cast_of_alloca_return_value create mode 100644 .x-sc_cast_of_argument_to_free create mode 100644 .x-sc_file_system create mode 100644 .x-sc_m4_quote_check create mode 100644 .x-sc_makefile_check create mode 100644 .x-sc_program_name create mode 100644 .x-sc_prohibit_HAVE_MBRTOWC create mode 100644 .x-sc_prohibit_S_IS_definition create mode 100644 .x-sc_space_tab create mode 100644 .x-sc_the_the create mode 100644 .x-sc_two_space_separator_in_usage create mode 100644 .x-sc_useless_cpp_parens diff --git a/.x-sc_GPL_version b/.x-sc_GPL_version new file mode 100644 index 000000000..fce02216d --- /dev/null +++ b/.x-sc_GPL_version @@ -0,0 +1,4 @@ +^doc/lgpl-2.1.texi +^doc/protocol/ +^lib/ +^m4/pkg.m4 diff --git a/.x-sc_avoid_if_before_free b/.x-sc_avoid_if_before_free new file mode 100644 index 000000000..dbc2f0dfb --- /dev/null +++ b/.x-sc_avoid_if_before_free @@ -0,0 +1,3 @@ +^gl/ +^lib/gl/ +^src/cfg/ diff --git a/.x-sc_cast_of_alloca_return_value b/.x-sc_cast_of_alloca_return_value new file mode 100644 index 000000000..1edcd73ec --- /dev/null +++ b/.x-sc_cast_of_alloca_return_value @@ -0,0 +1,3 @@ +^gl/ +^guile/ +^lib/gl/ diff --git a/.x-sc_cast_of_argument_to_free b/.x-sc_cast_of_argument_to_free new file mode 100644 index 000000000..8dcd9685c --- /dev/null +++ b/.x-sc_cast_of_argument_to_free @@ -0,0 +1 @@ +^src/cfg/ diff --git a/.x-sc_file_system b/.x-sc_file_system new file mode 100644 index 000000000..075cd88a6 --- /dev/null +++ b/.x-sc_file_system @@ -0,0 +1,2 @@ +^doc/doxygen/ +^doc/protocol/ diff --git a/.x-sc_m4_quote_check b/.x-sc_m4_quote_check new file mode 100644 index 000000000..be1faa877 --- /dev/null +++ b/.x-sc_m4_quote_check @@ -0,0 +1 @@ +^lib/gl/m4/intl.m4 diff --git a/.x-sc_makefile_check b/.x-sc_makefile_check new file mode 100644 index 000000000..9a2efd1e5 --- /dev/null +++ b/.x-sc_makefile_check @@ -0,0 +1,2 @@ +^gl/ +^lib/gl/ diff --git a/.x-sc_program_name b/.x-sc_program_name new file mode 100644 index 000000000..64bb52e48 --- /dev/null +++ b/.x-sc_program_name @@ -0,0 +1,5 @@ +^doc/ +^gl/ +^lib/gl/ +^src/cfg/ +^tests/ diff --git a/.x-sc_prohibit_HAVE_MBRTOWC b/.x-sc_prohibit_HAVE_MBRTOWC new file mode 100644 index 000000000..9a2efd1e5 --- /dev/null +++ b/.x-sc_prohibit_HAVE_MBRTOWC @@ -0,0 +1,2 @@ +^gl/ +^lib/gl/ diff --git a/.x-sc_prohibit_S_IS_definition b/.x-sc_prohibit_S_IS_definition new file mode 100644 index 000000000..bf7f14e07 --- /dev/null +++ b/.x-sc_prohibit_S_IS_definition @@ -0,0 +1,2 @@ +^gl/sys_stat.in.h +^lib/gl/sys_stat.in.h diff --git a/.x-sc_space_tab b/.x-sc_space_tab new file mode 100644 index 000000000..8868024ea --- /dev/null +++ b/.x-sc_space_tab @@ -0,0 +1,9 @@ +*.png +^ChangeLog +^doc/protocol/ +^gl/ +^lib/gl/ +^lib/minitasn1/ +^libextra/gl/ +^tests/nist-pkits/ +^tests/x509paths/ diff --git a/.x-sc_the_the b/.x-sc_the_the new file mode 100644 index 000000000..47e5e223d --- /dev/null +++ b/.x-sc_the_the @@ -0,0 +1,3 @@ +^doc/protocol/ +^lib/minitasn1/ +^tests/rsa-md5-collision/mbox diff --git a/.x-sc_two_space_separator_in_usage b/.x-sc_two_space_separator_in_usage new file mode 100644 index 000000000..ec74edbb6 --- /dev/null +++ b/.x-sc_two_space_separator_in_usage @@ -0,0 +1,3 @@ +^build-aux/gnupload +^doc/gnutls.texi +^tests/sha2/sha2 diff --git a/.x-sc_useless_cpp_parens b/.x-sc_useless_cpp_parens new file mode 100644 index 000000000..6f383c1ae --- /dev/null +++ b/.x-sc_useless_cpp_parens @@ -0,0 +1,4 @@ +^gl/ +^lib/gl/ +^src/cfg/ +^src/.*-gaa.c diff --git a/NEWS b/NEWS index 6ddbaa6ee..18040c29e 100644 --- a/NEWS +++ b/NEWS @@ -3131,7 +3131,7 @@ up to date information. ** Fix gnutls-cli-debug regarding resume support detection. Earlier, if the session-id from the server had a length of 0, it would -indicate the the server supports resumption, which isn't the case. +indicate that the server supports resumption, which isn't the case. Reported by Kataja Kai . ** Fix building of examples on FreeBSD by including netinet/in.h. diff --git a/cfg.mk b/cfg.mk index e1ffa98a5..d74dec3d0 100644 --- a/cfg.mk +++ b/cfg.mk @@ -29,7 +29,10 @@ endif PODIR := lib/po PO_DOMAIN := libgnutls -local-checks-to-skip = sc_prohibit_strcmp +local-checks-to-skip = sc_prohibit_strcmp sc_prohibit_atoi_atof \ + sc_error_message_uppercase sc_prohibit_have_config_h \ + sc_require_config_h sc_require_config_h_first \ + sc_trailing_blank sc_unmarked_diagnostics sc_immutable_NEWS autoreconf: for f in $(PODIR)/*.po.in; do \ diff --git a/doc/examples/ex-serv-export.c b/doc/examples/ex-serv-export.c index 12e0588bb..afea7373e 100644 --- a/doc/examples/ex-serv-export.c +++ b/doc/examples/ex-serv-export.c @@ -1,4 +1,4 @@ -/* Copyright 2007, 2008 Free Software Foundation +/* Copyright 2007, 2008, 2009 Free Software Foundation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright @@ -292,8 +292,7 @@ wrap_db_init (void) static void wrap_db_deinit (void) { - if (cache_db) - free (cache_db); + free (cache_db); cache_db = NULL; return; } diff --git a/doc/gnutls.texi b/doc/gnutls.texi index 7c84e809b..5dd8325c6 100644 --- a/doc/gnutls.texi +++ b/doc/gnutls.texi @@ -1,5 +1,4 @@ \input texinfo @c -*-texinfo-*- -@comment $Id$ @comment %**start of header @setfilename gnutls.info @include version.texi @@ -18,7 +17,7 @@ This manual is last updated @value{UPDATED} for version @value{VERSION} of GNU TLS. -Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright @copyright{} 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document diff --git a/gtk-doc.make b/gtk-doc.make index d42338993..7dfee8645 100644 --- a/gtk-doc.make +++ b/gtk-doc.make @@ -23,7 +23,7 @@ GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) -EXTRA_DIST = \ +EXTRA_DIST = \ $(content_files) \ $(HTML_IMAGES) \ $(DOC_MAIN_SGML_FILE) \ @@ -33,8 +33,8 @@ EXTRA_DIST = \ DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp -SCANOBJ_FILES = \ - $(DOC_MODULE).args \ +SCANOBJ_FILES = \ + $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ diff --git a/lib/gnutls.asn b/lib/gnutls.asn index 0cb98414d..f485c27d6 100644 --- a/lib/gnutls.asn +++ b/lib/gnutls.asn @@ -17,27 +17,27 @@ RSAPublicKey ::= SEQUENCE { -- CRT algorithm. -- RSAPrivateKey ::= SEQUENCE { - version Version, - modulus INTEGER, -- (Usually large) n - publicExponent INTEGER, -- (Usually small) e - privateExponent INTEGER, -- (Usually large) d - prime1 INTEGER, -- (Usually large) p - prime2 INTEGER, -- (Usually large) q - exponent1 INTEGER, -- (Usually large) d mod (p-1) - exponent2 INTEGER, -- (Usually large) d mod (q-1) - coefficient INTEGER, -- (Usually large) (inverse of q) mod p - otherPrimeInfos OtherPrimeInfos OPTIONAL + version Version, + modulus INTEGER, -- (Usually large) n + publicExponent INTEGER, -- (Usually small) e + privateExponent INTEGER, -- (Usually large) d + prime1 INTEGER, -- (Usually large) p + prime2 INTEGER, -- (Usually large) q + exponent1 INTEGER, -- (Usually large) d mod (p-1) + exponent2 INTEGER, -- (Usually large) d mod (q-1) + coefficient INTEGER, -- (Usually large) (inverse of q) mod p + otherPrimeInfos OtherPrimeInfos OPTIONAL } Version ::= INTEGER { two-prime(0), multi(1) } --- (CONSTRAINED BY { version must be multi if otherPrimeInfos present }) -- +-- (CONSTRAINED BY { version must be multi if otherPrimeInfos present }) -- OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo OtherPrimeInfo ::= SEQUENCE { - prime INTEGER, -- ri - exponent INTEGER, -- di - coefficient INTEGER -- ti + prime INTEGER, -- ri + exponent INTEGER, -- di + coefficient INTEGER -- ti } -- for signature calculation @@ -74,19 +74,19 @@ DSASignatureValue ::= SEQUENCE { } DSAPrivateKey ::= SEQUENCE { - version INTEGER, -- should be zero - p INTEGER, - q INTEGER, - g INTEGER, - Y INTEGER, -- public - priv INTEGER + version INTEGER, -- should be zero + p INTEGER, + q INTEGER, + g INTEGER, + Y INTEGER, -- public + priv INTEGER } -- from PKCS#3 DHParameter ::= SEQUENCE { - prime INTEGER, -- p - base INTEGER, -- g - privateValueLength INTEGER OPTIONAL + prime INTEGER, -- p + base INTEGER, -- g + privateValueLength INTEGER OPTIONAL } diff --git a/lib/m4/hooks.m4 b/lib/m4/hooks.m4 index 7a191c5a6..43260cd2e 100644 --- a/lib/m4/hooks.m4 +++ b/lib/m4/hooks.m4 @@ -51,7 +51,7 @@ AC_DEFUN([LIBGNUTLS_HOOKS], included_libtasn1=no) if test "$included_libtasn1" = "no"; then AC_LIB_HAVE_LINKFLAGS(tasn1,, [#include ], - [asn1_check_version (NULL)]) + [asn1_check_version (NULL)]) if test "$ac_cv_libtasn1" != yes; then included_libtasn1=yes AC_MSG_WARN([[ @@ -84,7 +84,7 @@ AC_DEFUN([LIBGNUTLS_HOOKS], fi AC_SUBST(LZO_LIBS) if test "$use_lzo" = "yes"; then - AC_DEFINE(USE_LZO, 1, [whether to use the LZO compression]) + AC_DEFINE([USE_LZO], 1, [whether to use the LZO compression]) if test "$LZO_LIBS" = "-llzo"; then AC_CHECK_HEADERS(lzo1x.h) elif test "$LZO_LIBS" = "-llzo2"; then @@ -101,7 +101,7 @@ AC_DEFUN([LIBGNUTLS_HOOKS], test_mac(x,y,z); return 0; ], [ - AC_DEFINE(C99_MACROS, 1, [C99 macros are supported]) + AC_DEFINE([C99_MACROS], 1, [C99 macros are supported]) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) @@ -110,9 +110,9 @@ AC_DEFUN([LIBGNUTLS_HOOKS], AC_MSG_CHECKING([whether to enable Opaque PRF input support]) AC_ARG_ENABLE(opaque-prf-input, - AS_HELP_STRING([--enable-opaque-prf-input=DD], - [enable Opaque PRF input using DD as extension type]), - ac_opaque_prf_input=$enableval, ac_opaque_prf_input=no) + AS_HELP_STRING([--enable-opaque-prf-input=DD], + [enable Opaque PRF input using DD as extension type]), + ac_opaque_prf_input=$enableval, ac_opaque_prf_input=no) if test "$ac_opaque_prf_input" != "no"; then if ! echo $ac_opaque_prf_input | egrep -q '^[[0-9]]+$'; then ac_opaque_prf_input=no @@ -124,7 +124,7 @@ AC_DEFUN([LIBGNUTLS_HOOKS], fi if test "$ac_opaque_prf_input" != "no"; then AC_MSG_RESULT([yes (extension value $ac_opaque_prf_input)]) - AC_DEFINE_UNQUOTED(ENABLE_OPRFI, $ac_opaque_prf_input, + AC_DEFINE_UNQUOTED([ENABLE_OPRFI], $ac_opaque_prf_input, [enable Opaque PRF Input]) else AC_MSG_RESULT(no) @@ -133,12 +133,12 @@ AC_DEFUN([LIBGNUTLS_HOOKS], AC_MSG_CHECKING([whether to disable SRP authentication support]) AC_ARG_ENABLE(srp-authentication, - AS_HELP_STRING([--disable-srp-authentication], - [disable the SRP authentication support]), - ac_enable_srp=no) + AS_HELP_STRING([--disable-srp-authentication], + [disable the SRP authentication support]), + ac_enable_srp=no) if test x$ac_enable_srp != xno; then AC_MSG_RESULT(no) - AC_DEFINE(ENABLE_SRP, 1, [enable SRP authentication]) + AC_DEFINE([ENABLE_SRP], 1, [enable SRP authentication]) else ac_full=0 AC_MSG_RESULT(yes) @@ -147,12 +147,12 @@ AC_DEFUN([LIBGNUTLS_HOOKS], AC_MSG_CHECKING([whether to disable PSK authentication support]) AC_ARG_ENABLE(psk-authentication, - AS_HELP_STRING([--disable-psk-authentication], - [disable the PSK authentication support]), - ac_enable_psk=no) + AS_HELP_STRING([--disable-psk-authentication], + [disable the PSK authentication support]), + ac_enable_psk=no) if test x$ac_enable_psk != xno; then AC_MSG_RESULT(no) - AC_DEFINE(ENABLE_PSK, 1, [enable PSK authentication]) + AC_DEFINE([ENABLE_PSK], 1, [enable PSK authentication]) else ac_full=0 AC_MSG_RESULT(yes) @@ -161,12 +161,12 @@ AC_DEFUN([LIBGNUTLS_HOOKS], AC_MSG_CHECKING([whether to disable anonymous authentication support]) AC_ARG_ENABLE(anon-authentication, - AS_HELP_STRING([--disable-anon-authentication], - [disable the anonymous authentication support]), - ac_enable_anon=no) + AS_HELP_STRING([--disable-anon-authentication], + [disable the anonymous authentication support]), + ac_enable_anon=no) if test x$ac_enable_anon != xno; then AC_MSG_RESULT(no) - AC_DEFINE(ENABLE_ANON, 1, [enable anonymous authentication]) + AC_DEFINE([ENABLE_ANON], 1, [enable anonymous authentication]) else ac_full=0 AC_MSG_RESULT(yes) @@ -180,36 +180,36 @@ AC_DEFUN([LIBGNUTLS_HOOKS], AC_MSG_CHECKING([whether to disable Camellia cipher]) if test "$enable_camellia" != "no"; then AC_MSG_RESULT([no]) - AC_DEFINE(ENABLE_CAMELLIA, 1, [enable camellia block cipher]) + AC_DEFINE([ENABLE_CAMELLIA], 1, [enable camellia block cipher]) else AC_MSG_RESULT([yes]) fi AC_MSG_CHECKING([whether to disable extra PKI stuff]) AC_ARG_ENABLE(extra-pki, - AS_HELP_STRING([--disable-extra-pki], - [only enable the basic PKI stuff]), - enable_pki=$enableval, enable_pki=yes) + AS_HELP_STRING([--disable-extra-pki], + [only enable the basic PKI stuff]), + enable_pki=$enableval, enable_pki=yes) if test "$enable_pki" != "yes"; then ac_full=0 AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) - AC_DEFINE(ENABLE_PKI, 1, [whether to include all the PKCS/PKI stuff]) + AC_DEFINE([ENABLE_PKI], 1, [whether to include all the PKCS/PKI stuff]) fi AM_CONDITIONAL(ENABLE_PKI, test "$enable_pki" = "yes") ac_enable_openpgp=yes AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support]) AC_ARG_ENABLE(openpgp-authentication, - AS_HELP_STRING([--disable-openpgp-authentication], - [disable the OpenPGP authentication support]), - ac_enable_openpgp=no) + AS_HELP_STRING([--disable-openpgp-authentication], + [disable the OpenPGP authentication support]), + ac_enable_openpgp=no) if test x$ac_enable_openpgp = xno; then AC_MSG_RESULT(yes) ac_full=0 else - AC_DEFINE(ENABLE_OPENPGP, 1, [use openpgp authentication]) + AC_DEFINE([ENABLE_OPENPGP], 1, [use openpgp authentication]) AC_MSG_RESULT(no) fi AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes") @@ -221,11 +221,11 @@ AC_DEFUN([LIBGNUTLS_HOOKS], AC_CHECK_SIZEOF(int) case $ac_cv_sizeof_void_p in $ac_cv_sizeof_long) - AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, [(long)], + AC_DEFINE([GNUTLS_POINTER_TO_INT_CAST], [(long)], [Additional cast to bring void* to a type castable to int.]) ;; *) - AC_DEFINE(GNUTLS_POINTER_TO_INT_CAST, []) + AC_DEFINE([GNUTLS_POINTER_TO_INT_CAST], []) ;; esac ]) diff --git a/lib/openpgp/Makefile.am b/lib/openpgp/Makefile.am index 6210a9dc5..1cdfb1bf1 100644 --- a/lib/openpgp/Makefile.am +++ b/lib/openpgp/Makefile.am @@ -1,5 +1,5 @@ ## Process this file with automake to produce Makefile.in -# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation +# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation # # Author: Nikos Mavrogiannopoulos # @@ -24,7 +24,7 @@ AM_CFLAGS = $(WARN_CFLAGS) AM_CPPFLAGS = \ -I$(srcdir)/../gl \ -I$(builddir)/../gl \ - -I$(srcdir)/../includes \ + -I$(srcdir)/../includes \ -I$(builddir)/../includes \ -I$(srcdir)/.. \ -I$(srcdir)/../opencdk diff --git a/lib/pkix.asn b/lib/pkix.asn index ca6953e77..833f73d0c 100644 --- a/lib/pkix.asn +++ b/lib/pkix.asn @@ -220,16 +220,16 @@ X520telephoneNumber ::= PrintableString id-at-facsimileTelephoneNumber AttributeType ::= {id-at 23} X520facsimileTelephoneNumber ::= PrintableString -id-at-pseudonym AttributeType ::= {id-at 65} -X520pseudonym ::= DirectoryString +id-at-pseudonym AttributeType ::= {id-at 65} +X520pseudonym ::= DirectoryString -id-at-name AttributeType ::= {id-at 41} -X520name ::= DirectoryString +id-at-name AttributeType ::= {id-at 41} +X520name ::= DirectoryString -id-at-streetAddress AttributeType ::= {id-at 9} -X520streetAddress ::= DirectoryString +id-at-streetAddress AttributeType ::= {id-at 9} +X520streetAddress ::= DirectoryString -id-at-postalAddress AttributeType ::= {id-at 16} +id-at-postalAddress AttributeType ::= {id-at 16} X520postalAddress ::= PostalAddress PostalAddress ::= SEQUENCE OF DirectoryString @@ -532,35 +532,35 @@ pkcs-5-PBKDF2-params ::= SEQUENCE { -- PKCS #12 stuff pkcs-12-PFX ::= SEQUENCE { - version INTEGER {v3(3)}, - authSafe pkcs-7-ContentInfo, - macData pkcs-12-MacData OPTIONAL + version INTEGER {v3(3)}, + authSafe pkcs-7-ContentInfo, + macData pkcs-12-MacData OPTIONAL } pkcs-12-PbeParams ::= SEQUENCE { - salt OCTET STRING, - iterations INTEGER + salt OCTET STRING, + iterations INTEGER } pkcs-12-MacData ::= SEQUENCE { - mac pkcs-7-DigestInfo, - macSalt OCTET STRING, - iterations INTEGER DEFAULT 1 + mac pkcs-7-DigestInfo, + macSalt OCTET STRING, + iterations INTEGER DEFAULT 1 -- Note: The default is for historical reasons and its use is -- deprecated. A higher value, like 1024 is recommended. } pkcs-12-AuthenticatedSafe ::= SEQUENCE OF pkcs-7-ContentInfo - -- Data if unencrypted - -- EncryptedData if password-encrypted - -- EnvelopedData if public key-encrypted + -- Data if unencrypted + -- EncryptedData if password-encrypted + -- EnvelopedData if public key-encrypted pkcs-12-SafeContents ::= SEQUENCE OF pkcs-12-SafeBag pkcs-12-SafeBag ::= SEQUENCE { - bagId OBJECT IDENTIFIER, - bagValue [0] EXPLICIT ANY DEFINED BY badId, - bagAttributes SET OF pkcs-12-PKCS12Attribute OPTIONAL + bagId OBJECT IDENTIFIER, + bagValue [0] EXPLICIT ANY DEFINED BY badId, + bagAttributes SET OF pkcs-12-PKCS12Attribute OPTIONAL } -- Bag types @@ -574,20 +574,19 @@ pkcs-12-PKCS8ShroudedKeyBag ::= pkcs-8-EncryptedPrivateKeyInfo -- CertBag pkcs-12-CertBag ::= SEQUENCE { - certId OBJECT IDENTIFIER, - certValue [0] EXPLICIT ANY DEFINED BY certId + certId OBJECT IDENTIFIER, + certValue [0] EXPLICIT ANY DEFINED BY certId } -- x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-certTypes 1}} -- DER-encoded X.509 certificate stored in OCTET STRING pkcs-12-CRLBag ::= SEQUENCE { - crlId OBJECT IDENTIFIER, - crlValue [0] EXPLICIT ANY DEFINED BY crlId + crlId OBJECT IDENTIFIER, + crlValue [0] EXPLICIT ANY DEFINED BY crlId } --- x509CRL BAG-TYPE ::= --- {OCTET STRING IDENTIFIED BY {pkcs-9-crlTypes 1}} +-- x509CRL BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-crlTypes 1}} -- DER-encoded X.509 CRL stored in OCTET STRING pkcs-12-PKCS12Attribute ::= Attribute @@ -642,12 +641,12 @@ CountryOfResidence ::= PrintableString (SIZE (2)) -- rfc3820 ProxyCertInfo ::= SEQUENCE { - pCPathLenConstraint INTEGER (0..MAX) OPTIONAL, - proxyPolicy ProxyPolicy } + pCPathLenConstraint INTEGER (0..MAX) OPTIONAL, + proxyPolicy ProxyPolicy } ProxyPolicy ::= SEQUENCE { - policyLanguage OBJECT IDENTIFIER, - policy OCTET STRING OPTIONAL } + policyLanguage OBJECT IDENTIFIER, + policy OCTET STRING OPTIONAL } -- rfc3920 section 5.1.1 diff --git a/lib/x509/Makefile.am b/lib/x509/Makefile.am index 510d20268..3f145aae9 100644 --- a/lib/x509/Makefile.am +++ b/lib/x509/Makefile.am @@ -22,7 +22,7 @@ AM_CFLAGS = $(WARN_CFLAGS) AM_CPPFLAGS = \ -I$(srcdir)/../gl \ -I$(builddir)/../gl \ - -I$(srcdir)/../includes \ + -I$(srcdir)/../includes \ -I$(builddir)/../includes \ -I$(srcdir)/.. \ $(LIBOPENCDK_CFLAGS) diff --git a/libextra/m4/hooks.m4 b/libextra/m4/hooks.m4 index fdbd82f85..b9ee2dde6 100644 --- a/libextra/m4/hooks.m4 +++ b/libextra/m4/hooks.m4 @@ -1,4 +1,4 @@ -# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. # # Author: Nikos Mavrogiannopoulos, Simon Josefsson @@ -24,10 +24,9 @@ AC_DEFUN([LIBGNUTLS_EXTRA_HOOKS], [ AC_MSG_CHECKING([whether to disable OpenSSL compatibility layer]) AC_ARG_ENABLE(openssl-compatibility, - AS_HELP_STRING([--disable-openssl-compatibility], - [disable the OpenSSL compatibility support]), - enable_openssl=$withval, - enable_openssl=yes) + AS_HELP_STRING([--disable-openssl-compatibility], + [disable the OpenSSL compatibility support]), + enable_openssl=$withval, enable_openssl=yes) AC_MSG_RESULT($enable_openssl) AM_CONDITIONAL(ENABLE_OPENSSL, test "$enable_openssl" = "yes") ]) diff --git a/m4/valgrind.m4 b/m4/valgrind.m4 index 0cd106abe..5a8006a5c 100644 --- a/m4/valgrind.m4 +++ b/m4/valgrind.m4 @@ -1,5 +1,5 @@ # valgrind.m4 serial 1 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -20,11 +20,11 @@ AC_DEFUN([sj_VALGRIND], else opt_valgrind_tests=no VALGRIND= - fi + fi AC_MSG_CHECKING([whether self tests are run under valgrind]) AC_ARG_ENABLE(valgrind-tests, - AS_HELP_STRING([--enable-valgrind-tests], - [run self tests under valgrind]), + AS_HELP_STRING([--enable-valgrind-tests], + [run self tests under valgrind]), opt_valgrind_tests=$enableval) AC_MSG_RESULT($opt_valgrind_tests) ]) diff --git a/src/Makefile.am b/src/Makefile.am index 7138ef19d..90dea994f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -94,7 +94,7 @@ noinst_LTLIBRARIES += libcmd-certtool.la libcmd_certtool_la_CFLAGS = libcmd_certtool_la_SOURCES = certtool.gaa certtool-gaa.h \ certtool-gaa.c certtool-cfg.h certtool-cfg.c -libcmd_certtool_la_LIBADD = ../gl/libgnu.la @LTLIBREADLINE@ +libcmd_certtool_la_LIBADD = ../gl/libgnu.la $(LTLIBREADLINE) libcmd_certtool_la_LIBADD += ../lib/libgnutls.la ../libextra/libgnutls-extra.la libcmd_certtool_la_LIBADD += ../gl/libgnu.la diff --git a/src/certtool-cfg.c b/src/certtool-cfg.c index 074a0cc05..920dca94f 100644 --- a/src/certtool-cfg.c +++ b/src/certtool-cfg.c @@ -340,8 +340,7 @@ get_confirmed_pass (bool empty_ok) if (pass) printf ("Password missmatch, try again.\n"); - if (copy) - free (copy); + free (copy); pass = getpass ("Enter password: "); copy = strdup (pass); diff --git a/src/certtool.c b/src/certtool.c index 950c03d6a..f7342dd95 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -1040,9 +1040,8 @@ certificate_info (void) GNUTLS_X509_CRT_LIST_IMPORT_FAIL_IF_EXCEED); if (ret == GNUTLS_E_SHORT_MEMORY_BUFFER) { - error (0, 0, - "Too many certificates (%d), will only read the first %d.", - crt_num, MAX_CRTS); + error (0, 0, "too many certificates (%d); " + "will only read the first %d", crt_num, MAX_CRTS); crt_num = MAX_CRTS; ret = gnutls_x509_crt_list_import (crt, &crt_num, &pem, info.incert_format, 0); @@ -1056,8 +1055,8 @@ certificate_info (void) if (count > 1 && info.outcert_format == GNUTLS_X509_FMT_DER) { - error (0, 0, "cannot output multiple certificates in DER format, " - "using PEM instead."); + error (0, 0, "cannot output multiple certificates in DER format; " + "using PEM instead"); info.outcert_format = GNUTLS_X509_FMT_PEM; } @@ -2167,7 +2166,7 @@ _verify_x509_mem (const void *cert, int cert_size) fprintf (outfile, "\tIssued by: %s\n", name); if (strcmp (issuer_name, name) != 0) - error (EXIT_FAILURE, 0, "the last certificate is not self signed."); + error (EXIT_FAILURE, 0, "the last certificate is not self signed"); fprintf (outfile, "\tVerification output: "); print_verification_res (x509_cert_list[x509_ncerts - 1], diff --git a/src/crypt.c b/src/crypt.c index 8c53a0125..e7e872dca 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Simon Josefsson + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Simon Josefsson * Copyright (C) 2001,2003 Nikos Mavrogiannopoulos * Copyright (C) 2004 Free Software Foundation * @@ -42,6 +42,7 @@ /* Gnulib portability files. */ #include #include +#include #include /* This may need some rewrite. A lot of stuff which should be here @@ -396,6 +397,8 @@ main (int argc, char **argv) int salt, ret; struct passwd *pwd; + set_program_name (argv[0]); + if ((ret = gnutls_global_init ()) < 0) { fprintf (stderr, "global_init: %s\n", gnutls_strerror (ret)); diff --git a/src/psk.c b/src/psk.c index 1ae05d01f..b0047e08e 100644 --- a/src/psk.c +++ b/src/psk.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005, 2007, 2008 Free Software Foundation + * Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation * * This file is part of GNUTLS. * @@ -21,6 +21,7 @@ /* Gnulib portability files. */ #include +#include #ifndef ENABLE_PSK @@ -74,6 +75,8 @@ main (int argc, char **argv) gnutls_datum_t dkey; size_t hex_key_size = sizeof (hex_key); + set_program_name (argv[0]); + if ((ret = gnutls_global_init ()) < 0) { fprintf (stderr, "global_init: %s\n", gnutls_strerror (ret)); diff --git a/src/serv.c b/src/serv.c index 1ced4becf..0679dee29 100644 --- a/src/serv.c +++ b/src/serv.c @@ -140,10 +140,8 @@ static void listener_free (listener_item * j) { - if (j->http_request) - free (j->http_request); - if (j->http_response) - free (j->http_response); + free (j->http_request); + free (j->http_response); if (j->fd >= 0) { gnutls_bye (j->tls_session, GNUTLS_SHUT_WR); diff --git a/src/tls_test.c b/src/tls_test.c index 25a29854c..dae853c86 100644 --- a/src/tls_test.c +++ b/src/tls_test.c @@ -32,6 +32,7 @@ #include #include +#include #include #define ERR(err,s) if (err==-1) {perror(s);return(1);} @@ -164,6 +165,7 @@ main (int argc, char **argv) char portname[6]; struct addrinfo hints, *res, *ptr; + set_program_name (argv[0]); gaa_parser (argc, argv); #ifndef _WIN32 diff --git a/tests/Makefile.am b/tests/Makefile.am index 58a7f575d..3615226bb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -72,7 +72,7 @@ if ENABLE_OPENPGP ctests += openpgpself endif -tlsia_LDADD = ../libextra/libgnutls-extra.la $(LDADD) @LTLIBREADLINE@ +tlsia_LDADD = ../libextra/libgnutls-extra.la $(LDADD) $(LTLIBREADLINE) endif if ENABLE_OPRFI diff --git a/tests/resume.c b/tests/resume.c index b70bac444..92803bbbc 100644 --- a/tests/resume.c +++ b/tests/resume.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation + * Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation * * Author: Simon Josefsson * @@ -443,8 +443,7 @@ wrap_db_init (void) static void wrap_db_deinit (void) { - if (cache_db) - free (cache_db); + free (cache_db); cache_db = NULL; return; } diff --git a/tests/x509dn.c b/tests/x509dn.c index 27ad6f1cd..920e83600 100644 --- a/tests/x509dn.c +++ b/tests/x509dn.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation * * Author: Simon Josefsson * @@ -520,14 +520,15 @@ doit (void) server (); wait (&status); -#if defined(WIFEXITED) && defined(WEXITSTATUS) +#if defined WIFEXITED && defined WEXITSTATUS if (WIFEXITED (status) && WEXITSTATUS (status)) { fail ("server: client failed with exit status %d\n", WEXITSTATUS (status)); } #endif -#if defined(WIFSIGNALED) && defined(WTERMSIG) + +#if defined WIFSIGNALED && defined WTERMSIG if (WIFSIGNALED (status)) { fail ("server: client failed with fatal signal %d\n",