Imported Upstream version 4.12 upstream/4.12
authorDariusz Michaluk <d.michaluk@samsung.com>
Fri, 15 Jun 2018 09:13:52 +0000 (11:13 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Fri, 15 Jun 2018 09:13:52 +0000 (11:13 +0200)
44 files changed:
NEWS
configure
configure.ac
doc/asn1Coding.1
doc/asn1Decoding.1
doc/asn1Parser.1
doc/libtasn1.html
doc/libtasn1.info
doc/libtasn1.pdf
doc/libtasn1.ps
doc/reference/html/api-index-full.html
doc/reference/html/home.png
doc/reference/html/index.html
doc/reference/html/index.sgml [deleted file]
doc/reference/html/intro.html
doc/reference/html/ix02.html
doc/reference/html/ix03.html
doc/reference/html/ix04.html
doc/reference/html/left-insensitive.png
doc/reference/html/left.png
doc/reference/html/libtasn1-libtasn1.html
doc/reference/html/libtasn1.devhelp2
doc/reference/html/right-insensitive.png
doc/reference/html/right.png
doc/reference/html/up-insensitive.png
doc/reference/html/up.png
doc/stamp-vti
doc/version.texi
lib/ASN1.c
lib/ASN1.y
lib/decoding.c
lib/element.c
lib/errors.c
lib/libtasn1.h
lib/parser_aux.c
src/asn1Decoding.c
tests/Makefile.am
tests/Makefile.in
tests/cert-invalid-time.der [new file with mode: 0644]
tests/coding [new file with mode: 0755]
tests/decoding
tests/invalid-assignments1.txt [new file with mode: 0644]
tests/invalid-assignments2.txt [new file with mode: 0644]
tests/ocsp-basic-response.c

diff --git a/NEWS b/NEWS
index 65550aa..6d6a309 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,24 @@
 GNU Libtasn1 NEWS                                     -*- outline -*-
 
+* Noteworthy changes in release 4.12 (released 2017-05-29) [stable]
+- Corrected so-name version
+
+* Noteworthy changes in release 4.11 (released 2017-05-27) [stable]
+- Introduced the ASN1_TIME_ENCODING_ERROR error code to indicate
+  an invalid encoding in the DER time fields.
+- Introduced flag ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME. This flag
+  allows decoding errors in time fields even when in strict DER mode.
+  That is introduced in order to allow toleration of invalid times in
+  X.509 certificates (which are common) even though strict DER adherence
+  is enforced in other fields.
+- Added safety check in asn1_find_node(). That prevents a crash
+  when a very long variable name is provided by the developer.
+  Note that this to be exploited requires controlling the ASN.1
+  definitions used by the developer, i.e., the 'name' parameter of
+  asn1_write_value() or asn1_read_value(). The library is
+  not designed to protect against malicious manipulation of the
+  developer assigned variable names. Reported by Jakub Jirasek.
+
 * Noteworthy changes in release 4.10 (released 2017-01-16) [stable]
 - Updated gnulib
 - Removed -Werror from default compiler flags
index a6f4e72..ba0c9e0 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for GNU Libtasn1 4.10.
+# Generated by GNU Autoconf 2.69 for GNU Libtasn1 4.12.
 #
 # Report bugs to <help-libtasn1@gnu.org>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='GNU Libtasn1'
 PACKAGE_TARNAME='libtasn1'
-PACKAGE_VERSION='4.10'
-PACKAGE_STRING='GNU Libtasn1 4.10'
+PACKAGE_VERSION='4.12'
+PACKAGE_STRING='GNU Libtasn1 4.12'
 PACKAGE_BUGREPORT='help-libtasn1@gnu.org'
 PACKAGE_URL='http://www.gnu.org/software/libtasn1/'
 
@@ -1912,7 +1912,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures GNU Libtasn1 4.10 to adapt to many kinds of systems.
+\`configure' configures GNU Libtasn1 4.12 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1983,7 +1983,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of GNU Libtasn1 4.10:";;
+     short | recursive ) echo "Configuration of GNU Libtasn1 4.12:";;
    esac
   cat <<\_ACEOF
 
@@ -2113,7 +2113,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-GNU Libtasn1 configure 4.10
+GNU Libtasn1 configure 4.12
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2765,7 +2765,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by GNU Libtasn1 $as_me 4.10, which was
+It was created by GNU Libtasn1 $as_me 4.12, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3643,7 +3643,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='libtasn1'
- VERSION='4.10'
+ VERSION='4.12'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3782,7 +3782,7 @@ AM_BACKSLASH='\'
 # Interfaces removed:                           AGE=0
 LT_CURRENT=11
 
-LT_REVISION=3
+LT_REVISION=4
 
 LT_AGE=5
 
@@ -22656,7 +22656,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by GNU Libtasn1 $as_me 4.10, which was
+This file was extended by GNU Libtasn1 $as_me 4.12, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -22728,7 +22728,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-GNU Libtasn1 config.status 4.10
+GNU Libtasn1 config.status 4.12
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index 551ad3f..3b445c6 100644 (file)
@@ -17,7 +17,7 @@ dnl Process this file with autoconf to produce a configure script.
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 AC_PREREQ([2.61])
-AC_INIT([GNU Libtasn1],[4.10],[help-libtasn1@gnu.org])
+AC_INIT([GNU Libtasn1],[4.12],[help-libtasn1@gnu.org])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS(config.h)
@@ -29,7 +29,7 @@ AM_SILENT_RULES([yes])
 # Interfaces added:                             AGE++
 # Interfaces removed:                           AGE=0
 AC_SUBST(LT_CURRENT, 11)
-AC_SUBST(LT_REVISION, 3)
+AC_SUBST(LT_REVISION, 4)
 AC_SUBST(LT_AGE, 5)
 
 AC_PROG_CC
index 96ced73..74b60dc 100644 (file)
@@ -1,5 +1,5 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.3.
-.TH ASN1CODING "1" "October 2016" "asn1Coding (libtasn1) 4.10" "User Commands"
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.4.
+.TH ASN1CODING "1" "May 2017" "asn1Coding (libtasn1) 4.12" "User Commands"
 .SH NAME
 asn1Coding \- ASN.1 DER encoder
 .SH SYNOPSIS
@@ -31,7 +31,7 @@ GNU Libtasn1 home page: <http://www.gnu.org/software/libtasn1/>
 .br
 General help using GNU software: <http://www.gnu.org/gethelp/>
 .SH COPYRIGHT
-Copyright \(co 2016 Free Software Foundation, Inc.
+Copyright \(co 2017 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
 .br
 This is free software: you are free to change and redistribute it.
index 2e8063d..14f18e9 100644 (file)
@@ -1,5 +1,5 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.3.
-.TH ASN1DECODING "1" "October 2016" "asn1Decoding (libtasn1) 4.10" "User Commands"
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.4.
+.TH ASN1DECODING "1" "May 2017" "asn1Decoding (libtasn1) 4.12" "User Commands"
 .SH NAME
 asn1Decoding \- ASN.1 DER decoder
 .SH SYNOPSIS
@@ -15,6 +15,9 @@ perform a benchmark on decoding
 \fB\-s\fR, \fB\-\-strict\fR
 use strict DER decoding
 .TP
+\fB\-t\fR, \fB\-\-no\-time\-strict\fR
+use strict DER decoding but not in time fields
+.TP
 \fB\-h\fR, \fB\-\-help\fR
 display this help and exit
 .TP
@@ -29,7 +32,7 @@ GNU Libtasn1 home page: <http://www.gnu.org/software/libtasn1/>
 .br
 General help using GNU software: <http://www.gnu.org/gethelp/>
 .SH COPYRIGHT
-Copyright \(co 2016 Free Software Foundation, Inc.
+Copyright \(co 2017 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
 .br
 This is free software: you are free to change and redistribute it.
index aba1421..a638b89 100644 (file)
@@ -1,5 +1,5 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.3.
-.TH ASN1PARSER "1" "October 2016" "asn1Parser (libtasn1) 4.10" "User Commands"
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.4.
+.TH ASN1PARSER "1" "May 2017" "asn1Parser (libtasn1) 4.12" "User Commands"
 .SH NAME
 asn1Parser \- ASN.1 syntax tree generator for libtasn1
 .SH SYNOPSIS
@@ -34,7 +34,7 @@ GNU Libtasn1 home page: <http://www.gnu.org/software/libtasn1/>
 .br
 General help using GNU software: <http://www.gnu.org/gethelp/>
 .SH COPYRIGHT
-Copyright \(co 2016 Free Software Foundation, Inc.
+Copyright \(co 2017 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
 .br
 This is free software: you are free to change and redistribute it.
index 609d2bc..b0f3783 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <!-- This manual is for GNU Libtasn1
-(version 4.10, 4 April 2016),
+(version 4.12, 4 April 2016),
 which is a library for Abstract Syntax Notation One (ASN.1) and
 Distinguished Encoding Rules (DER) manipulation.
 
@@ -15,10 +15,10 @@ copy of the license is included in the section entitled "GNU Free
 Documentation License". -->
 <!-- Created by GNU Texinfo 6.3, http://www.gnu.org/software/texinfo/ -->
 <head>
-<title>GNU Libtasn1 4.10</title>
+<title>GNU Libtasn1 4.12</title>
 
-<meta name="description" content="GNU Libtasn1 4.10">
-<meta name="keywords" content="GNU Libtasn1 4.10">
+<meta name="description" content="GNU Libtasn1 4.12">
+<meta name="keywords" content="GNU Libtasn1 4.12">
 <meta name="resource-type" content="document">
 <meta name="distribution" content="global">
 <meta name="Generator" content="makeinfo">
@@ -104,7 +104,7 @@ dd, li {
 </head>
 
 <body lang="en">
-<h1 class="settitle" align="center">GNU Libtasn1 4.10</h1>
+<h1 class="settitle" align="center">GNU Libtasn1 4.12</h1>
 
 
 
@@ -158,7 +158,7 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Up: <a
 <h1 class="top">Libtasn1</h1>
 
 <p>This manual is for GNU Libtasn1
-(version 4.10, 4 April 2016),
+(version 4.12, 4 April 2016),
 which is a library for Abstract Syntax Notation One (ASN.1) and
 Distinguished Encoding Rules (DER) manipulation.
 </p>
index 1dd21e1..8c89651 100644 (file)
@@ -1,7 +1,7 @@
-This is libtasn1.info, produced by makeinfo version 6.1 from
+This is libtasn1.info, produced by makeinfo version 6.3 from
 libtasn1.texi.
 
-This manual is for GNU Libtasn1 (version 4.10, 4 April 2016), which is a
+This manual is for GNU Libtasn1 (version 4.12, 4 April 2016), which is a
 library for Abstract Syntax Notation One (ASN.1) and Distinguished
 Encoding Rules (DER) manipulation.
 
@@ -24,7 +24,7 @@ File: libtasn1.info,  Node: Top,  Next: Introduction,  Up: (dir)
 Libtasn1
 ********
 
-This manual is for GNU Libtasn1 (version 4.10, 4 April 2016), which is a
+This manual is for GNU Libtasn1 (version 4.12, 4 April 2016), which is a
 library for Abstract Syntax Notation One (ASN.1) and Distinguished
 Encoding Rules (DER) manipulation.
 
index ff69e94..7dc0b30 100644 (file)
Binary files a/doc/libtasn1.pdf and b/doc/libtasn1.pdf differ
index f7f2ca7..a7e7071 100644 (file)
@@ -1,7 +1,7 @@
 %!PS-Adobe-2.0
 %%Creator: dvips(k) 5.996 Copyright 2016 Radical Eye Software
 %%Title: libtasn1.dvi
-%%CreationDate: Mon Jan 16 18:51:48 2017
+%%CreationDate: Mon May 29 04:41:51 2017
 %%Pages: 36
 %%PageOrder: Ascend
 %%BoundingBox: 0 0 612 792
@@ -12,7 +12,7 @@
 %DVIPSWebPage: (www.radicaleye.com)
 %DVIPSCommandLine: dvips -q -o libtasn1.ps libtasn1.dvi
 %DVIPSParameters: dpi=600
-%DVIPSSource:  TeX output 2017.01.16:1851
+%DVIPSSource:  TeX output 2017.05.29:0641
 %%BeginProcSet: tex.pro 0 0
 %!
 /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
@@ -6127,13 +6127,13 @@ ifelse
 TeXDict begin 1 0 bop 150 1318 a Fs(Libtasn1)p 150 1385
 3600 34 v 1035 1486 a Fr(Abstract)31 b(Syn)m(tax)f(Notation)j(One)d
 (\(ASN.1\))h(library)f(for)g(the)h(GNU)g(system)2592
-1594 y(for)f(v)m(ersion)h(4.10,)h(4)f(April)f(2016)150
+1594 y(for)f(v)m(ersion)h(4.12,)h(4)f(April)f(2016)150
 4795 y Fq(F)-11 b(abio)45 b(Fiorina)150 4928 y(Simon)g(Josefsson)150
 5061 y(Nik)l(os)h(Ma)l(vrogiannop)t(oulos)g(\()p Fp(help-libtasn1@)o
 (gn)o(u.o)o(rg)o Fq(\))p 150 5141 3600 17 v eop end
 %%Page: 2 2
 TeXDict begin 2 1 bop 150 4523 a Fr(This)21 b(man)m(ual)i(is)f(for)g
-(GNU)h(Libtasn1)g(\(v)m(ersion)g(4.10,)j(4)c(April)g(2016\),)k(whic)m
+(GNU)h(Libtasn1)g(\(v)m(ersion)g(4.12,)j(4)c(April)g(2016\),)k(whic)m
 (h)c(is)h(a)f(library)g(for)g(Abstract)150 4633 y(Syn)m(tax)31
 b(Notation)h(One)e(\(ASN.1\))h(and)f(Distinguished)h(Enco)s(ding)e
 (Rules)i(\(DER\))g(manipulation.)150 4767 y(Cop)m(yrigh)m(t)602
index 3c1a4c5..066e19e 100644 (file)
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>API Index: GNU Libtasn1 API Reference Manual</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
 <link rel="home" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="up" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="prev" href="libtasn1-libtasn1.html" title="libtasn1">
 <link rel="next" href="ix02.html" title="Index of deprecated symbols">
-<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <dd></dd>
 </div>
 <div class="footer">
-<hr>Generated by GTK-Doc V1.24</div>
+<hr>Generated by GTK-Doc V1.25</div>
 </body>
 </html>
\ No newline at end of file
index 9346b33..c989d46 100644 (file)
Binary files a/doc/reference/html/home.png and b/doc/reference/html/home.png differ
index b768d18..a799e43 100644 (file)
@@ -3,10 +3,10 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>GNU Libtasn1 API Reference Manual: GNU Libtasn1 API Reference Manual</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
 <link rel="home" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="next" href="intro.html" title="GNU Libtasn1 API Reference Manual">
-<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -15,7 +15,7 @@
 <div>
 <div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">GNU Libtasn1 API Reference Manual</p></th></tr></table></div>
 <div><p class="releaseinfo">
-      for GNU Libtasn1 4.7
+      for GNU Libtasn1 4.10
 .
       The latest version of this documentation can be found on-line at
       <a class="ulink" href="https://www.gnu.org/software/libtasn1/reference/" target="_top">https://www.gnu.org/software/libtasn1/reference/</a>.
@@ -35,6 +35,6 @@
 </dl></div>
 </div>
 <div class="footer">
-<hr>Generated by GTK-Doc V1.24</div>
+<hr>Generated by GTK-Doc V1.25</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/doc/reference/html/index.sgml b/doc/reference/html/index.sgml
deleted file mode 100644 (file)
index 5b6a18f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<ONLINE href="https://www.gnu.org/software/libtasn1/reference/">
-<ANCHOR id="libtasn1-libtasn1" href="libtasn1/libtasn1-libtasn1.html">
-<ANCHOR id="libtasn1-libtasn1.other" href="libtasn1/libtasn1-libtasn1.html#libtasn1-libtasn1.other">
-<ANCHOR id="libtasn1-libtasn1.description" href="libtasn1/libtasn1-libtasn1.html#libtasn1-libtasn1.description">
-<ANCHOR id="libtasn1-libtasn1.functions_details" href="libtasn1/libtasn1-libtasn1.html#libtasn1-libtasn1.functions_details">
-<ANCHOR id="libtasn1-libtasn1.other_details" href="libtasn1/libtasn1-libtasn1.html#libtasn1-libtasn1.other_details">
-<ANCHOR id="ASN1-API:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-API:CAPS">
-<ANCHOR id="ASN1-VERSION:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-VERSION:CAPS">
-<ANCHOR id="ASN1-SUCCESS:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-SUCCESS:CAPS">
-<ANCHOR id="ASN1-FILE-NOT-FOUND:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-FILE-NOT-FOUND:CAPS">
-<ANCHOR id="ASN1-ELEMENT-NOT-FOUND:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-ELEMENT-NOT-FOUND:CAPS">
-<ANCHOR id="ASN1-IDENTIFIER-NOT-FOUND:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-IDENTIFIER-NOT-FOUND:CAPS">
-<ANCHOR id="ASN1-DER-ERROR:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-DER-ERROR:CAPS">
-<ANCHOR id="ASN1-VALUE-NOT-FOUND:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-VALUE-NOT-FOUND:CAPS">
-<ANCHOR id="ASN1-GENERIC-ERROR:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-GENERIC-ERROR:CAPS">
-<ANCHOR id="ASN1-VALUE-NOT-VALID:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-VALUE-NOT-VALID:CAPS">
-<ANCHOR id="ASN1-TAG-ERROR:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-ERROR:CAPS">
-<ANCHOR id="ASN1-TAG-IMPLICIT:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-IMPLICIT:CAPS">
-<ANCHOR id="ASN1-ERROR-TYPE-ANY:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-ERROR-TYPE-ANY:CAPS">
-<ANCHOR id="ASN1-SYNTAX-ERROR:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-SYNTAX-ERROR:CAPS">
-<ANCHOR id="ASN1-MEM-ERROR:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-MEM-ERROR:CAPS">
-<ANCHOR id="ASN1-MEM-ALLOC-ERROR:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-MEM-ALLOC-ERROR:CAPS">
-<ANCHOR id="ASN1-DER-OVERFLOW:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-DER-OVERFLOW:CAPS">
-<ANCHOR id="ASN1-NAME-TOO-LONG:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-NAME-TOO-LONG:CAPS">
-<ANCHOR id="ASN1-ARRAY-ERROR:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-ARRAY-ERROR:CAPS">
-<ANCHOR id="ASN1-ELEMENT-NOT-EMPTY:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-ELEMENT-NOT-EMPTY:CAPS">
-<ANCHOR id="ASN1-PRINT-NAME:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-PRINT-NAME:CAPS">
-<ANCHOR id="ASN1-PRINT-NAME-TYPE:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-PRINT-NAME-TYPE:CAPS">
-<ANCHOR id="ASN1-PRINT-NAME-TYPE-VALUE:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-PRINT-NAME-TYPE-VALUE:CAPS">
-<ANCHOR id="ASN1-PRINT-ALL:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-PRINT-ALL:CAPS">
-<ANCHOR id="ASN1-CLASS-UNIVERSAL:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-CLASS-UNIVERSAL:CAPS">
-<ANCHOR id="ASN1-CLASS-APPLICATION:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-CLASS-APPLICATION:CAPS">
-<ANCHOR id="ASN1-CLASS-CONTEXT-SPECIFIC:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-CLASS-CONTEXT-SPECIFIC:CAPS">
-<ANCHOR id="ASN1-CLASS-PRIVATE:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-CLASS-PRIVATE:CAPS">
-<ANCHOR id="ASN1-CLASS-STRUCTURED:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-CLASS-STRUCTURED:CAPS">
-<ANCHOR id="ASN1-TAG-BOOLEAN:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-BOOLEAN:CAPS">
-<ANCHOR id="ASN1-TAG-INTEGER:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-INTEGER:CAPS">
-<ANCHOR id="ASN1-TAG-SEQUENCE:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-SEQUENCE:CAPS">
-<ANCHOR id="ASN1-TAG-SET:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-SET:CAPS">
-<ANCHOR id="ASN1-TAG-OCTET-STRING:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-OCTET-STRING:CAPS">
-<ANCHOR id="ASN1-TAG-BIT-STRING:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-BIT-STRING:CAPS">
-<ANCHOR id="ASN1-TAG-UTCTime" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-UTCTime">
-<ANCHOR id="ASN1-TAG-GENERALIZEDTime" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-GENERALIZEDTime">
-<ANCHOR id="ASN1-TAG-OBJECT-ID:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-OBJECT-ID:CAPS">
-<ANCHOR id="ASN1-TAG-ENUMERATED:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-ENUMERATED:CAPS">
-<ANCHOR id="ASN1-TAG-NULL:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-NULL:CAPS">
-<ANCHOR id="ASN1-TAG-GENERALSTRING:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-GENERALSTRING:CAPS">
-<ANCHOR id="ASN1-TAG-NUMERIC-STRING:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-NUMERIC-STRING:CAPS">
-<ANCHOR id="ASN1-TAG-IA5-STRING:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-IA5-STRING:CAPS">
-<ANCHOR id="ASN1-TAG-TELETEX-STRING:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-TELETEX-STRING:CAPS">
-<ANCHOR id="ASN1-TAG-PRINTABLE-STRING:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-PRINTABLE-STRING:CAPS">
-<ANCHOR id="ASN1-TAG-UNIVERSAL-STRING:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-UNIVERSAL-STRING:CAPS">
-<ANCHOR id="ASN1-TAG-BMP-STRING:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-BMP-STRING:CAPS">
-<ANCHOR id="ASN1-TAG-UTF8-STRING:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-UTF8-STRING:CAPS">
-<ANCHOR id="ASN1-TAG-VISIBLE-STRING:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-TAG-VISIBLE-STRING:CAPS">
-<ANCHOR id="asn1-node-st" href="libtasn1/libtasn1-libtasn1.html#asn1-node-st">
-<ANCHOR id="asn1-node" href="libtasn1/libtasn1-libtasn1.html#asn1-node">
-<ANCHOR id="ASN1-MAX-NAME-SIZE:CAPS" href="libtasn1/libtasn1-libtasn1.html#ASN1-MAX-NAME-SIZE:CAPS">
index 8718185..aadd9b2 100644 (file)
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>GNU Libtasn1 API Reference Manual: GNU Libtasn1 API Reference Manual</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
 <link rel="home" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="up" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="prev" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="next" href="libtasn1-libtasn1.html" title="libtasn1">
-<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -37,6 +37,6 @@
     </p>
 </div>
 <div class="footer">
-<hr>Generated by GTK-Doc V1.24</div>
+<hr>Generated by GTK-Doc V1.25</div>
 </body>
 </html>
\ No newline at end of file
index cbaabcf..dc6a585 100644 (file)
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>Index of deprecated symbols: GNU Libtasn1 API Reference Manual</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
 <link rel="home" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="up" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="prev" href="api-index-full.html" title="API Index">
 <link rel="next" href="ix03.html" title="Index of new symbols in 1.6">
-<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -22,9 +22,9 @@
 <div class="index">
 <div class="titlepage"><div><div><h1 class="title">
 <a name="id-1.4"></a>Index of deprecated symbols</h1></div></div></div>
-<div class="index"></div>
+<div xmlns:xlink="http://www.w3.org/1999/xlink" class="index"></div>
 </div>
 <div class="footer">
-<hr>Generated by GTK-Doc V1.24</div>
+<hr>Generated by GTK-Doc V1.25</div>
 </body>
 </html>
\ No newline at end of file
index 6d9c0a0..ffd51d7 100644 (file)
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>Index of new symbols in 1.6: GNU Libtasn1 API Reference Manual</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
 <link rel="home" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="up" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="prev" href="ix02.html" title="Index of deprecated symbols">
 <link rel="next" href="ix04.html" title="Index of new symbols in 2.0">
-<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -22,9 +22,9 @@
 <div class="index">
 <div class="titlepage"><div><div><h1 class="title">
 <a name="id-1.5"></a>Index of new symbols in 1.6</h1></div></div></div>
-<div class="index"></div>
+<div xmlns:xlink="http://www.w3.org/1999/xlink" class="index"></div>
 </div>
 <div class="footer">
-<hr>Generated by GTK-Doc V1.24</div>
+<hr>Generated by GTK-Doc V1.25</div>
 </body>
 </html>
\ No newline at end of file
index 7b97412..316a9f9 100644 (file)
@@ -3,11 +3,11 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>Index of new symbols in 2.0: GNU Libtasn1 API Reference Manual</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
 <link rel="home" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="up" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="prev" href="ix03.html" title="Index of new symbols in 1.6">
-<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -21,9 +21,9 @@
 <div class="index">
 <div class="titlepage"><div><div><h1 class="title">
 <a name="id-1.6"></a>Index of new symbols in 2.0</h1></div></div></div>
-<div class="index"></div>
+<div xmlns:xlink="http://www.w3.org/1999/xlink" class="index"></div>
 </div>
 <div class="footer">
-<hr>Generated by GTK-Doc V1.24</div>
+<hr>Generated by GTK-Doc V1.25</div>
 </body>
 </html>
\ No newline at end of file
index 3269393..b1148fb 100644 (file)
Binary files a/doc/reference/html/left-insensitive.png and b/doc/reference/html/left-insensitive.png differ
index 2abde03..c164913 100644 (file)
Binary files a/doc/reference/html/left.png and b/doc/reference/html/left.png differ
index 74c0b59..6ae8d41 100644 (file)
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>libtasn1: GNU Libtasn1 API Reference Manual</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
 <link rel="home" href="index.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="up" href="intro.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="prev" href="intro.html" title="GNU Libtasn1 API Reference Manual">
 <link rel="next" href="api-index-full.html" title="API Index">
-<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -33,7 +33,7 @@
 </tr></table></div>
 <div class="refsect1">
 <a name="libtasn1-libtasn1.other"></a><h2>Types and Values</h2>
-<div class="informaltable"><table width="100%" border="0">
+<div class="informaltable"><table class="informaltable" width="100%" border="0">
 <colgroup>
 <col width="150px" class="name">
 <col class="description">
 <hr>
 <div class="refsect2">
 <a name="ASN1-VERSION:CAPS"></a><h3>ASN1_VERSION</h3>
-<pre class="programlisting">#define ASN1_VERSION "4.7"
+<pre class="programlisting">#define ASN1_VERSION "4.10"
 </pre>
 <p>
 </p>
 </div>
 </div>
 <div class="footer">
-<hr>Generated by GTK-Doc V1.24</div>
+<hr>Generated by GTK-Doc V1.25</div>
 </body>
 </html>
\ No newline at end of file
index ce4d54a..dcb8a42 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" standalone="no"?>
-<book xmlns="http://www.devhelp.net/book" title="GNU Libtasn1 API Reference Manual" link="index.html" author="" name="libtasn1" version="2" language="c">
+<book xmlns="http://www.devhelp.net/book" title="GNU Libtasn1 API Reference Manual" link="index.html" author="" name="libtasn1" version="2" language="c" online="https://www.gnu.org/software/libtasn1/reference/">
   <chapters>
     <sub name="GNU Libtasn1 API Reference Manual" link="intro.html">
       <sub name="libtasn1" link="libtasn1-libtasn1.html"/>
index 4c95785..c1efa27 100644 (file)
Binary files a/doc/reference/html/right-insensitive.png and b/doc/reference/html/right-insensitive.png differ
index 76260ec..83361a6 100644 (file)
Binary files a/doc/reference/html/right.png and b/doc/reference/html/right.png differ
index f404986..13e1a4f 100644 (file)
Binary files a/doc/reference/html/up-insensitive.png and b/doc/reference/html/up-insensitive.png differ
index 80b4b37..67a9054 100644 (file)
Binary files a/doc/reference/html/up.png and b/doc/reference/html/up.png differ
index 3c29e82..43269d8 100644 (file)
@@ -1,4 +1,4 @@
 @set UPDATED 4 April 2016
 @set UPDATED-MONTH April 2016
-@set EDITION 4.10
-@set VERSION 4.10
+@set EDITION 4.12
+@set VERSION 4.12
index 3c29e82..43269d8 100644 (file)
@@ -1,4 +1,4 @@
 @set UPDATED 4 April 2016
 @set UPDATED-MONTH April 2016
-@set EDITION 4.10
-@set VERSION 4.10
+@set EDITION 4.12
+@set VERSION 4.12
index 3d60e71..586dcca 100644 (file)
@@ -2685,7 +2685,7 @@ _asn1_yylex ()
 
       /* Is STRING a number? */
       for (k = 0; k < counter; k++)
-        if (!isdigit (string[k]))
+        if (!isdigit ((int)string[k]))
           break;
       if (k >= counter)
         {
index 174ffde..534a9f1 100644 (file)
@@ -575,7 +575,7 @@ _asn1_yylex ()
 
       /* Is STRING a number? */
       for (k = 0; k < counter; k++)
-        if (!isdigit (string[k]))
+        if (!isdigit ((int)string[k]))
           break;
       if (k >= counter)
         {
index c2e6027..2240b09 100644 (file)
@@ -329,10 +329,10 @@ _asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, int *r
   if (str_len < 8)
     {
       warn();
-      return ASN1_DER_ERROR;
+      return ASN1_TIME_ENCODING_ERROR;
     }
 
-  if (flags & ASN1_DECODE_FLAG_STRICT_DER)
+  if ((flags & ASN1_DECODE_FLAG_STRICT_DER) && !(flags & ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME))
     {
       p = &der[len_len];
       for (i=0;i<(unsigned)(str_len-1);i++)
@@ -359,14 +359,14 @@ _asn1_get_time_der (unsigned type, const unsigned char *der, int der_len, int *r
                  }
 
                warn();
-               return ASN1_DER_ERROR;
+               return ASN1_TIME_ENCODING_ERROR;
              }
          }
 
       if (sign_count == 0 && p[str_len-1] != 'Z')
         {
           warn();
-          return ASN1_DER_ERROR;
+          return ASN1_TIME_ENCODING_ERROR;
         }
     }
   memcpy (str, der + len_len, str_len);
@@ -1305,7 +1305,12 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len,
                    {           /* indefinite length method */
                      if (!HAVE_TWO(ider_len) || ((der[counter]) || der[counter + 1]))
                        {
-                         _asn1_append_sequence_set (p, &tcache);
+                         result = _asn1_append_sequence_set (p, &tcache);
+                         if (result != 0)
+                           {
+                              warn();
+                             goto cleanup;
+                           }
                          p = tcache.tail;
                          move = RIGHT;
                          continue;
@@ -1321,7 +1326,12 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len,
                    {           /* definite length method */
                      if (len2 > counter)
                        {
-                         _asn1_append_sequence_set (p, &tcache);
+                         result = _asn1_append_sequence_set (p, &tcache);
+                         if (result != 0)
+                           {
+                              warn();
+                             goto cleanup;
+                           }
                          p = tcache.tail;
                          move = RIGHT;
                          continue;
@@ -1375,7 +1385,14 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len,
                             || (type_field (p2->type) == ASN1_ETYPE_SIZE))
                        p2 = p2->right;
                      if (p2->right == NULL)
-                       _asn1_append_sequence_set (p, &tcache);
+                       {
+                         result = _asn1_append_sequence_set (p, &tcache);
+                         if (result != 0)
+                           {
+                              warn();
+                             goto cleanup;
+                           }
+                       }
                      p = p2;
                    }
                }
index 756e41a..b09f826 100644 (file)
@@ -128,7 +128,7 @@ _asn1_convert_integer (const unsigned char *value, unsigned char *value_out,
   return ASN1_SUCCESS;
 }
 
-/* Appends a new element into the sequent (or set) defined by this
+/* Appends a new element into the sequence (or set) defined by this
  * node. The new element will have a name of '?number', where number
  * is a monotonically increased serial number.
  *
index e9fa302..fef45ae 100644 (file)
@@ -52,6 +52,7 @@ static const libtasn1_error_entry error_algorithms[] = {
   LIBTASN1_ERROR_ENTRY (ASN1_NAME_TOO_LONG),
   LIBTASN1_ERROR_ENTRY (ASN1_ARRAY_ERROR),
   LIBTASN1_ERROR_ENTRY (ASN1_ELEMENT_NOT_EMPTY),
+  LIBTASN1_ERROR_ENTRY (ASN1_TIME_ENCODING_ERROR),
   {0, 0}
 };
 
index 4ad01e7..626b11e 100644 (file)
@@ -44,7 +44,7 @@ extern "C"
 {
 #endif
 
-#define ASN1_VERSION "4.10"
+#define ASN1_VERSION "4.12"
 
 #if defined(__GNUC__) && !defined(ASN1_INTERNAL_BUILD)
 # define _ASN1_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
@@ -78,6 +78,7 @@ extern "C"
 #define ASN1_NAME_TOO_LONG             15
 #define ASN1_ARRAY_ERROR               16
 #define ASN1_ELEMENT_NOT_EMPTY         17
+#define ASN1_TIME_ENCODING_ERROR       18
 
   /*************************************/
   /* Constants used in asn1_visit_tree */
@@ -190,6 +191,8 @@ extern "C"
 #define ASN1_DECODE_FLAG_ALLOW_PADDING 1
 /* This flag would ensure that no BER decoding takes place */
 #define ASN1_DECODE_FLAG_STRICT_DER (1<<1)
+/* This flag will tolerate Time encoding errors when in strict DER */
+#define ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME (1<<2)
 
 
   struct asn1_data_node_st
index b4a7370..976ab38 100644 (file)
@@ -120,6 +120,9 @@ asn1_find_node (asn1_node pointer, const char *name)
       if (n_end)
        {
          nsize = n_end - n_start;
+         if (nsize >= sizeof(n))
+               return NULL;
+
          memcpy (n, n_start, nsize);
          n[nsize] = 0;
          n_start = n_end;
@@ -158,6 +161,9 @@ asn1_find_node (asn1_node pointer, const char *name)
       if (n_end)
        {
          nsize = n_end - n_start;
+         if (nsize >= sizeof(n))
+               return NULL;
+
          memcpy (n, n_start, nsize);
          n[nsize] = 0;
          n_start = n_end;
index 20f91ac..65456bf 100644 (file)
@@ -59,6 +59,7 @@ described in ASN.1 DEFINITIONS file, and print decoded structures.\n\
       printf ("\
   -b, --benchmark       perform a benchmark on decoding\n\
   -s, --strict          use strict DER decoding\n\
+  -t, --no-time-strict  use strict DER decoding but not in time fields\n\
   -h, --help            display this help and exit\n\
   -v, --version         output version information and exit\n");
       emit_bug_reporting_address ();
@@ -72,6 +73,7 @@ main (int argc, char *argv[])
   static const struct option long_options[] = {
     {"help", no_argument, 0, 'h'},
     {"strict", no_argument, 0, 's'},
+    {"no-time-strict", no_argument, 0, 't'},
     {"debug", no_argument, 0, 'd'},
     {"benchmark", no_argument, 0, 'b'},
     {"version", no_argument, 0, 'v'},
@@ -87,7 +89,7 @@ main (int argc, char *argv[])
   int asn1_result = ASN1_SUCCESS;
   unsigned char *der;
   int der_len = 0, benchmark = 0;
-  int strict = 0, debug = 0;
+  int flags = 0, debug = 0;
   /* FILE *outputFile; */
 
   set_program_name (argv[0]);
@@ -98,7 +100,7 @@ main (int argc, char *argv[])
     {
 
       option_result =
-       getopt_long (argc, argv, "hbdsvc", long_options, &option_index);
+       getopt_long (argc, argv, "hbdsvtc", long_options, &option_index);
 
       if (option_result == -1)
        break;
@@ -115,7 +117,10 @@ main (int argc, char *argv[])
          debug = 1;
          break;
        case 's':
-         strict = 1;
+       case 't':
+         flags |= ASN1_DECODE_FLAG_STRICT_DER;
+         if (option_result == 't')
+           flags |= ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME;
          break;
        case 'v':               /* VERSION */
          version_etc (stdout, program_name, PACKAGE, VERSION,
@@ -223,7 +228,7 @@ main (int argc, char *argv[])
      fclose(inputFile);
    */
 
-  if (decode (definitions, typeName, der, der_len, benchmark, strict) != ASN1_SUCCESS)
+  if (decode (definitions, typeName, der, der_len, benchmark, flags) != ASN1_SUCCESS)
     {
       asn1_delete_structure (&definitions);
       free (inputFileAsnName);
@@ -249,7 +254,7 @@ main (int argc, char *argv[])
 
 static int
 simple_decode (asn1_node definitions, const char *typeName, void *der,
-              int der_len, int benchmark, int strict)
+              int der_len, int benchmark, int flags)
 {
 
   int asn1_result;
@@ -269,9 +274,9 @@ simple_decode (asn1_node definitions, const char *typeName, void *der,
       return asn1_result;
     }
 
-  if (strict != 0)
+  if (flags != 0)
     asn1_result =
-      asn1_der_decoding2(&structure, der, &der_len, ASN1_DECODE_FLAG_STRICT_DER, errorDescription);
+      asn1_der_decoding2(&structure, der, &der_len, flags, errorDescription);
   else
     asn1_result =
       asn1_der_decoding (&structure, der, der_len, errorDescription);
@@ -297,19 +302,19 @@ simple_decode (asn1_node definitions, const char *typeName, void *der,
 
 static int
 decode (asn1_node definitions, const char *typeName, void *der, int der_len,
-       int benchmark, int strict)
+       int benchmark, int flags)
 {
   struct benchmark_st st;
 
   if (benchmark == 0)
-    return simple_decode (definitions, typeName, der, der_len, benchmark, strict);
+    return simple_decode (definitions, typeName, der, der_len, benchmark, flags);
   else
     {
       start_benchmark (&st);
 
       do
        {
-         simple_decode (definitions, typeName, der, der_len, benchmark, strict);
+         simple_decode (definitions, typeName, der, der_len, benchmark, flags);
          st.size++;
        }
       while (benchmark_must_finish == 0);
index bea3310..be10bbb 100644 (file)
@@ -25,6 +25,7 @@ LDADD = ../lib/libtasn1.la ../gl/libgnu.la
 EXTRA_DIST = Test_parser.asn Test_tree.asn Test_tree_asn1_tab.c        mscat.asn \
        Test_encoding.asn pkix.asn TestIndef.p12 choice.asn coding-decoding2.asn \
        TestIndef2.p12 TestIndef3.der TestCertOctetOverflow.der \
+       cert-invalid-time.der \
        libtasn1.supp ocsp-basic-response.der spc_pe_image_data.der \
        invalid-x509/id-000000.der invalid-x509/id-000001.der \
        invalid-x509/id-000002.der invalid-x509/id-000003.der \
@@ -45,12 +46,13 @@ EXTRA_DIST = Test_parser.asn Test_tree.asn Test_tree_asn1_tab.c     mscat.asn \
        invalid-x509/id-000032.der invalid-x509/id-000033.der \
        invalid-x509/id-000034.der invalid-x509/id-000035.der \
        invalid-pkcs7/id-000001.der invalid-pkcs7/id-000002.der \
-       invalid-pkcs7/id-000003.der
+       invalid-pkcs7/id-000003.der invalid-assignments1.txt \
+       invalid-assignments2.txt
 
 # For crlf.
 EXTRA_DIST += crlf.cer crl.der ocsp.der
 dist_check_SCRIPTS = crlf benchmark threadsafety decoding decoding-invalid-x509 \
-       decoding-invalid-pkcs7
+       decoding-invalid-pkcs7 coding
 
 MOSTLYCLEANFILES = Test_parser_ERROR.asn
 
@@ -65,7 +67,7 @@ TESTS = Test_parser Test_tree Test_encoding Test_indefinite   \
        Test_strings Test_choice Test_encdec copynode coding-decoding2 \
        strict-der Test_choice_ocsp decoding decoding-invalid-x509 \
        ocsp-basic-response octet-string coding-long-oid object-id-decoding \
-       spc_pe_image_data decoding-invalid-pkcs7
+       spc_pe_image_data decoding-invalid-pkcs7 coding
 
 TESTS_ENVIRONMENT = \
        ASN1PARSER=$(srcdir)/Test_parser.asn \
index fdc6452..5f33db8 100644 (file)
@@ -122,7 +122,7 @@ TESTS = Test_parser$(EXEEXT) Test_tree$(EXEEXT) Test_encoding$(EXEEXT) \
        Test_choice_ocsp$(EXEEXT) decoding decoding-invalid-x509 \
        ocsp-basic-response$(EXEEXT) octet-string$(EXEEXT) \
        coding-long-oid$(EXEEXT) object-id-decoding$(EXEEXT) \
-       spc_pe_image_data$(EXEEXT) decoding-invalid-pkcs7
+       spc_pe_image_data$(EXEEXT) decoding-invalid-pkcs7 coding
 subdir = tests
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/lib/glm4/gnulib-comp.m4 \
@@ -1212,7 +1212,7 @@ LDADD = ../lib/libtasn1.la ../gl/libgnu.la
 EXTRA_DIST = Test_parser.asn Test_tree.asn Test_tree_asn1_tab.c \
        mscat.asn Test_encoding.asn pkix.asn TestIndef.p12 choice.asn \
        coding-decoding2.asn TestIndef2.p12 TestIndef3.der \
-       TestCertOctetOverflow.der libtasn1.supp \
+       TestCertOctetOverflow.der cert-invalid-time.der libtasn1.supp \
        ocsp-basic-response.der spc_pe_image_data.der \
        invalid-x509/id-000000.der invalid-x509/id-000001.der \
        invalid-x509/id-000002.der invalid-x509/id-000003.der \
@@ -1233,9 +1233,10 @@ EXTRA_DIST = Test_parser.asn Test_tree.asn Test_tree_asn1_tab.c \
        invalid-x509/id-000032.der invalid-x509/id-000033.der \
        invalid-x509/id-000034.der invalid-x509/id-000035.der \
        invalid-pkcs7/id-000001.der invalid-pkcs7/id-000002.der \
-       invalid-pkcs7/id-000003.der crlf.cer crl.der ocsp.der
+       invalid-pkcs7/id-000003.der invalid-assignments1.txt \
+       invalid-assignments2.txt crlf.cer crl.der ocsp.der
 dist_check_SCRIPTS = crlf benchmark threadsafety decoding decoding-invalid-x509 \
-       decoding-invalid-pkcs7
+       decoding-invalid-pkcs7 coding
 
 MOSTLYCLEANFILES = Test_parser_ERROR.asn
 TESTS_ENVIRONMENT = \
@@ -1793,6 +1794,13 @@ decoding-invalid-pkcs7.log: decoding-invalid-pkcs7
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+coding.log: coding
+       @p='coding'; \
+       b='coding'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 .test.log:
        @p='$<'; \
        $(am__set_b); \
diff --git a/tests/cert-invalid-time.der b/tests/cert-invalid-time.der
new file mode 100644 (file)
index 0000000..994ea3f
Binary files /dev/null and b/tests/cert-invalid-time.der differ
diff --git a/tests/coding b/tests/coding
new file mode 100755 (executable)
index 0000000..922629b
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+# Copyright (C) 2017 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+srcdir="${srcdir:-.}"
+
+ASAN_OPTIONS="detect_leaks=0:exitcode=6"
+export ASAN_OPTIONS
+
+if ! test -z "${VALGRIND}";then
+VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=7 --leak-check=no"
+fi
+
+ASN1CODING="${ASN1CODING:-../src/asn1Coding$EXEEXT}"
+ASN1PKIX="${ASN1PKIX:-pkix.asn}"
+TMPFILE="asn1.$$.tmp"
+
+cat <<EOF >$TMPFILE
+PKIX1 { }
+
+DEFINITIONS IMPLICIT TAGS ::=
+
+BEGIN
+
+Dss-Sig-Value ::= SEQUENCE {
+     r       INTEGER,
+     s       INTEGER
+}
+
+END
+EOF
+
+$VALGRIND $ASN1CODING -c $TMPFILE ${srcdir}/invalid-assignments1.txt
+if test $? != 1;then
+       echo "Encoding failed (1)"
+       exit 1
+fi
+
+$VALGRIND $ASN1CODING -c $TMPFILE ${srcdir}/invalid-assignments2.txt
+if test $? != 1;then
+       echo "Encoding failed (2)"
+       exit 1
+fi
+
+rm -f $TMPFILE
+
+exit 0
index dd2c685..6dccb1c 100755 (executable)
@@ -15,6 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+srcdir="${srcdir:-.}"
+
 if ! test -z "${VALGRIND}";then
 VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=7 --leak-check=no"
 fi
@@ -22,10 +24,24 @@ fi
 ASN1DECODING="${ASN1DECODING:-../src/asn1Decoding$EXEEXT}"
 ASN1PKIX="${ASN1PKIX:-pkix.asn}"
 
-$VALGRIND $ASN1DECODING $ASN1PKIX TestCertOctetOverflow.der PKIX1.Certificate
+$VALGRIND $ASN1DECODING $ASN1PKIX ${srcdir}/TestCertOctetOverflow.der PKIX1.Certificate
 if test $? != 1;then
        echo "Decoding failed"
        exit 1
 fi
 
+# test decoding of certificate with invalid time field
+$VALGRIND $ASN1DECODING -s $ASN1PKIX ${srcdir}/cert-invalid-time.der PKIX1.Certificate
+if test $? != 1;then
+       echo "Decoding with invalid time succeeded when not expected"
+       exit 1
+fi
+
+# test decoding of certificate with invalid time field
+$VALGRIND $ASN1DECODING -t $ASN1PKIX ${srcdir}/cert-invalid-time.der PKIX1.Certificate
+if test $? != 0;then
+       echo "Decoding with invalid time failed when not expected"
+       exit 1
+fi
+
 exit 0
diff --git a/tests/invalid-assignments1.txt b/tests/invalid-assignments1.txt
new file mode 100644 (file)
index 0000000..4b78266
--- /dev/null
@@ -0,0 +1 @@
+dp ?CIX1-V÷÷\1aKçrú÷÷÷alxeKIX1\e\e\e\eãããi\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89\89g-VãþãããããKIX1.ãããããã\e\eIsÿg-V÷÷\1aKçr÷÷÷÷-V
\ No newline at end of file
diff --git a/tests/invalid-assignments2.txt b/tests/invalid-assignments2.txt
new file mode 100644 (file)
index 0000000..49933e5
Binary files /dev/null and b/tests/invalid-assignments2.txt differ
index 18ec394..3a190a8 100644 (file)
@@ -96,7 +96,7 @@ main (int argc, char** argv)
 
   if (etype != ASN1_ETYPE_OCTET_STRING)
     {
-      fprintf (stderr, "error in %d: The type (%d) doesn't match octet string.\n", __LINE__, etype);
+      fprintf (stderr, "error in %d: The type (%d) doesn't match octet string.\n", __LINE__, (int)etype);
       exit (1);
     }