[svn] ksba - r249 - in trunk: . src tests

svn author wk cvs at cvs.gnupg.org
Tue Aug 1 12:29:37 CEST 2006


Author: wk
Date: 2006-08-01 12:29:36 +0200 (Tue, 01 Aug 2006)
New Revision: 249

Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/README
   trunk/configure.ac
   trunk/src/ChangeLog
   trunk/src/dn.c
   trunk/tests/ChangeLog
   trunk/tests/Makefile.am
   trunk/tests/t-dnparser.c
Log:
Fixed a problem in the ksba_dn_teststr. Added a new test.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-07-19 08:47:18 UTC (rev 248)
+++ trunk/ChangeLog	2006-08-01 10:29:36 UTC (rev 249)
@@ -1,3 +1,11 @@
+2006-08-01  Werner Koch  <wk at g10code.com>
+
+	Released 0.9.16.
+	
+	* configure.ac: Bumped LT version to C16/A8/R0.
+
+	* configure.ac: Changed to new style auto-svn init.
+
 2006-06-20  Werner Koch  <wk at g10code.com>
 
 	Released 0.9.15.

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2006-07-19 08:47:18 UTC (rev 248)
+++ trunk/NEWS	2006-08-01 10:29:36 UTC (rev 249)
@@ -1,8 +1,10 @@
-Noteworthy changes in version 0.9.16
+Noteworthy changes in version 0.9.16 (2006-08-01)
 -------------------------------------------------
 
  * Fixed a character set conversion bug in BMPStrings.
 
+ * New function for better error reporting of DNs.
+
  * Interface changes relative to the 0.9.13 release:
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ksba_dn_teststr                NEW

Modified: trunk/README
===================================================================
--- trunk/README	2006-07-19 08:47:18 UTC (rev 248)
+++ trunk/README	2006-08-01 10:29:36 UTC (rev 249)
@@ -1,8 +1,96 @@
-KSBA = rot13(digit_to_letter(x509)) to be pronounced as Kasbah
+                               LIBKSBA
+                              ---------
 
-See ksba-overview.txt in the aegypten-specs module for a brief
-overview of the problem domain.  A reference manual is included.
+                     Copyright 2001 g10 Code GmbH
 
+This file is free software; as a special exception the author gives
+unlimited permission to copy and/or distribute it, with or without
+modifications, as long as this notice is preserved.
 
-The ocsp feature has not yet been documented.  See the comments in
-src/ocsp.c and the example tests/t-ocsp.c
+This file is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE.
+
+
+Libksba itself is distributed under the trms of the GNU General Public
+License, see the file COPYING for details.
+
+
+                            KSBA Overview
+                            -------------
+
+KSBA (pronounced Kasbah) is a library to make X.509 certificates as
+well as the CMS easily accessible by other applications.  Both
+specifications are building blocks of S/MIME and TLS.
+
+In the first step we will concentrate on providing the profile
+required by the Aegypten project (i.e. the MailTrusT based BSI profile
+for SPHINX).  However, the architecture will be flexible enough to
+easily support other profiles too.
+
+KSBA will be made available as a standard shared library and reserves
+identifiers starting with "ksba" and "_ksba" (also uppercase and mixed
+case).  It does not rely on another cryptographic library but will
+provide hooks for easy integration with Libgcrypt.
+
+
+
+                            Documentation
+                            -------------
+
+A standard info format reference manual is included.  However the OCSP
+feature has not yet been documented.  See the comments in src/ocsp.c
+and the example tests/t-ocsp.c
+
+
+
+
+         Old Information which might not be correct anymore:
+         ---------------------------------------------------
+
+KSBA  provides these subsystems:
+
+
+* ASN.1 Parser  (ksba_asn_*)
+
+  KSBA provides a simple ASN.1 parser which can be used to read
+  definitions directly from an ASN.1 module without the need of
+  generating extra tables.  For ease of maintenance it also comes with
+  a tool to create static data structures to avoid that overhead and
+  the need to include ASN.1 modules.
+
+  The primary goal of this parser is to provide the ASN.1 syntax tree
+  to be used by other library modules.
+
+* BER Decoder (ksba_ber_decoder_*)
+
+  This is a decoder for the ASN.1 Basic Encoding Rules with a facility
+  to detect valid DER encoding (DER is a subset of BER).  By using
+  thresholds and pre-registered callout function it is possible to
+  work on indefinite length data stream and limiting the memory usage
+  to a fixed upper bound.
+
+* BER Encoder (ksba_ber_encoder_*)
+
+  This is the counterpart to the DER Decoder with the ability to
+  restrict the encoding to DER.
+
+* Certificate Handling (ksba_cert_*)
+
+  The main bulk of the provided functions are used to give a clean
+  interface to X.509 certificates by translating X.509 data types to
+  more standard data types.
+
+* CMS Handling (ksba_cms_*)
+
+  The Cryptographic Message Syntax is the core data type for S/MIME
+  and therefore KSBA provides an interface to parse and create these
+  objects without the need to cope with ASN.1.
+
+* Reader and Writer (ksba_reader_*, ksba_writer_*)
+
+  Abstraction objects to access memory areas, files or file
+  descriptor.
+
+

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2006-07-19 08:47:18 UTC (rev 248)
+++ trunk/configure.ac	2006-08-01 10:29:36 UTC (rev 249)
@@ -22,17 +22,26 @@
 AC_PREREQ(2.57)
 min_automake_version="1.9.3"
 
-# Version number: Remember to change immediately *after* a release.
-#                 Append a "-cvs" for non-released versions.
-AC_INIT(libksba, 0.9.16-cvs, gpa-dev at gnupg.org)
+
+# Remember to change the version number immediately *after* a release.
+# Set my_issvn to "yes" for non-released code.  Remember to run an
+# "svn up" and "autogen.sh" right before creating a distribution.
+m4_define([my_version], [0.9.16])
+m4_define([my_issvn], [no])
+
+m4_define([svn_revision], m4_esyscmd([echo -n $((svn info 2>/dev/null \
+          || echo 'Revision: 0')|sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)]))
+AC_INIT([libksba], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]),
+        [gpa-dev at gnupg.org])
+
 # LT Version numbers: Remember to change them just *before* a release.
 #   (Interfaces removed:    CURRENT++, AGE=0, REVISION=0)
 #   (Interfaces added:      CURRENT++, AGE++, REVISION=0)
 #   (No interfaces changed:                   REVISION++)
 # Please remember to document interface changes in the NEWS file.
-LIBKSBA_LT_CURRENT=15
-LIBKSBA_LT_AGE=7
-LIBKSBA_LT_REVISION=2
+LIBKSBA_LT_CURRENT=16
+LIBKSBA_LT_AGE=8
+LIBKSBA_LT_REVISION=0
 #-------------------
 
 # fixme: When bouncing this to a newer version, you check whether the

Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2006-07-19 08:47:18 UTC (rev 248)
+++ trunk/src/ChangeLog	2006-08-01 10:29:36 UTC (rev 249)
@@ -1,3 +1,9 @@
+2006-08-01  Werner Koch  <wk at g10code.com>
+
+	* dn.c (ksba_dn_teststr): Bump nparts to actually allow returning
+	without an error.  Hmmm, why did did t-dnparser didn't caught this
+	problem?
+
 2006-07-19  Werner Koch  <wk at g10code.com>
 
 	* dn.c (put_stringbuf_mem_skip): New.

Modified: trunk/src/dn.c
===================================================================
--- trunk/src/dn.c	2006-07-19 08:47:18 UTC (rev 248)
+++ trunk/src/dn.c	2006-08-01 10:29:36 UTC (rev 249)
@@ -1286,7 +1286,7 @@
 
   *rerrlen = *rerroff = 0;
 
-  for (nparts=0, s=string; s && *s;)
+  for (nparts=0, s=string; s && *s; nparts++)
     {
       err = parse_rdn (s, &endp, NULL, &off, &len);
       if (err && !seq--)

Modified: trunk/tests/ChangeLog
===================================================================
--- trunk/tests/ChangeLog	2006-07-19 08:47:18 UTC (rev 248)
+++ trunk/tests/ChangeLog	2006-08-01 10:29:36 UTC (rev 249)
@@ -1,3 +1,9 @@
+2006-08-01  Werner Koch  <wk at g10code.com>
+
+	* Makefile.am (TESTS): Add t-dnparser.
+
+	* t-dnparser.c (test_0): New.  We need this good case test.
+
 2006-07-03  Werner Koch  <wk at g10code.com>
 
 	* t-dnparser.c: Use ksba_dn_str2der isntead of internal functions.

Modified: trunk/tests/Makefile.am
===================================================================
--- trunk/tests/Makefile.am	2006-07-19 08:47:18 UTC (rev 248)
+++ trunk/tests/Makefile.am	2006-08-01 10:29:36 UTC (rev 249)
@@ -39,7 +39,7 @@
 BUILT_SOURCES = oidtranstbl.h
 CLEANFILES = oidtranstbl.h
 
-TESTS = cert-basic t-crl-parser
+TESTS = cert-basic t-crl-parser t-dnparser
 
 AM_CFLAGS = $(GPG_ERROR_CFLAGS)
 

Modified: trunk/tests/t-dnparser.c
===================================================================
--- trunk/tests/t-dnparser.c	2006-07-19 08:47:18 UTC (rev 248)
+++ trunk/tests/t-dnparser.c	2006-08-01 10:29:36 UTC (rev 249)
@@ -30,7 +30,43 @@
 #include "t-common.h"
 
 
+static void
+test_0 (void)
+{
+  static char *good_strings[] = {
+    "C=de,O=g10 Code,OU=qa,CN=Pépé le Moko",
+    "C= de,   O=g10 Code  ,  OU=qa ,CN=Pépé le Moko",
+    "CN=www.gnupg.org",
+    "   CN=www.gnupg.org  ",
+    "C=fr,L=Paris,CN=Julien Duvivier,EMAIL=julien at example.org",
+    NULL
+  };
+  gpg_error_t err;
+  int i;
+  unsigned char *buf;
+  size_t off, len;
 
+  for (i=0; good_strings[i]; i++)
+    {
+      err = ksba_dn_str2der (good_strings[i], &buf, &len);
+      if (err)
+        {
+          fprintf (stderr, "%s:%d: ksba_dn_str2der failed for `%s': %s\n",
+                   __FILE__,__LINE__, good_strings[i], gpg_strerror (err));
+          exit (1);
+        } 
+      err = ksba_dn_teststr (good_strings[i], 0, &off, &len);
+      if (err)
+        {
+          fprintf (stderr, "%s:%d: ksba_dn_teststr failed for `%s': %s\n",
+                   __FILE__,__LINE__, good_strings[i], gpg_strerror (err));
+          exit (1);
+        } 
+      xfree (buf);
+    }
+}
+
+
 static void
 test_1 (void)
 {
@@ -125,6 +161,7 @@
     }
   else if (argc == 1)
     {
+      test_0 ();
       test_1 ();
       test_2 ();
     }




More information about the Gnupg-commits mailing list