...
 
Commits (115)
*.gcda
*.gcno
*.gcov
*~
ChangeLog
INSTALL
Makefile
Makefile.in
aclocal.m4
aminclude_static.am
autom4te.cache/
build-aux/ar-lib
build-aux/compile
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
......@@ -16,22 +11,23 @@ build-aux/install-sh
build-aux/ltmain.sh
build-aux/mdate-sh
build-aux/missing
build-aux/test-driver
build-aux/texinfo.tex
build-aux/ylwrap
ChangeLog
config.h
config.h.in
config.log
config.status
configure
doc/Makefile
doc/Makefile.in
.deps
doc/asn1Coding.1
doc/asn1Decoding.1
doc/asn1Parser.1
doc/coverage/
doc/cyclo/cyclo-libtasn1.html
doc/cyclo/Makefile
doc/cyclo/Makefile.in
doc/cyclo/cyclo-libtasn1.html
doc/libtasn1.aux
doc/libtasn1.cp
doc/libtasn1.cps
......@@ -45,139 +41,105 @@ doc/libtasn1.log
doc/libtasn1.pdf
doc/libtasn1.pg
doc/libtasn1.ps
doc/libtasn1.t2d/
doc/libtasn1.t2p/
doc/libtasn1.toc
doc/libtasn1.tp
doc/libtasn1.vr
doc/Makefile
doc/Makefile.in
doc/man/
doc/reference/Makefile
doc/reference/Makefile.in
doc/reference/html/
doc/reference/html-build.stamp
doc/reference/html.stamp
doc/reference/html/
doc/reference/libtasn1.args
doc/reference/libtasn1-decl-list.txt
doc/reference/libtasn1-decl.txt
doc/reference/libtasn1-overrides.txt
doc/reference/libtasn1-sections.txt
doc/reference/libtasn1-undeclared.txt
doc/reference/libtasn1-undocumented.txt
doc/reference/libtasn1-unused.txt
doc/reference/libtasn1.args
doc/reference/libtasn1.hierarchy
doc/reference/libtasn1.interfaces
doc/reference/libtasn1-overrides.txt
doc/reference/libtasn1.pdf
doc/reference/libtasn1.prerequisites
doc/reference/libtasn1-sections.txt
doc/reference/libtasn1.signals
doc/reference/libtasn1.types
doc/reference/libtasn1-undeclared.txt
doc/reference/libtasn1-undocumented.txt
doc/reference/libtasn1-unused.txt
doc/reference/Makefile
doc/reference/Makefile.in
doc/reference/pdf-build.stamp
doc/reference/pdf.stamp
doc/reference/scan-build.stamp
doc/reference/setup-build.stamp
doc/reference/sgml-build.stamp
doc/reference/sgml.stamp
doc/reference/tmpl/
doc/reference/tmpl-build.stamp
doc/reference/tmpl.stamp
doc/reference/tmpl/
doc/reference/version.xml
doc/reference/xml/
doc/stamp_docs
doc/stamp-vti
doc/texi/
doc/version.texi
examples/.deps/
examples/.libs/
examples/CertificateExample
examples/CertificateExample.o
examples/CrlExample
examples/CrlExample.o
examples/.deps/
examples/.libs/
examples/Makefile
examples/Makefile.in
examples/pkix_asn1_tab.c
examples/pkix_asn1_tab.o
gl/.deps/
gl/.libs/
gl/Makefile
gl/Makefile.in
gl/arg-nonnull.h
gl/c++defs.h
gl/getopt.h
gl/getopt.lo
gl/getopt.o
gl/getopt1.lo
gl/getopt1.o
gl/gettime.lo
gl/gettime.o
gl/libgnu.la
gl/progname.lo
gl/progname.o
gl/read-file.lo
gl/read-file.o
gl/stdio.h
gl/stdlib.h
gl/sys/
gl/sys/stat.h
gl/time.h
gl/timespec.lo
gl/timespec.o
gl/unistd.h
gl/unistd.lo
gl/unistd.o
gl/version-etc-fsf.lo
gl/version-etc-fsf.o
gl/version-etc.lo
gl/version-etc.o
gl/warn-on-use.h
gl/wchar.h
lib/.deps/
lib/.libs/
*.gcda
*.gcno
*.gcov
gtk-doc.m4
INSTALL
lib/ASN1.c
lib/ASN1.lo
lib/ASN1.o
lib/ASN1.tab.c
lib/Makefile
lib/Makefile.in
lib/coding.lo
lib/coding.o
lib/decoding.lo
lib/decoding.o
lib/.deps/
lib/element.lo
lib/element.o
lib/errors.lo
lib/errors.o
lib/gllib/.deps/
lib/gllib/.libs/
lib/gllib/Makefile
lib/gllib/Makefile.in
lib/gllib/arg-nonnull.h
lib/gllib/c++defs.h
lib/gllib/dummy.lo
lib/gllib/dummy.o
lib/gllib/hash-pjw-bare.lo
lib/gllib/hash-pjw-bare.o
lib/gllib/libgnu.la
lib/gllib/string.h
lib/gllib/warn-on-use.h
lib/gllib/wchar.h
lib/gl/
lib/gstr.lo
lib/gstr.o
lib/.libs/
lib/includes/libtasn1.h
lib/libtasn1.la
lib/libtasn1.pc
lib/Makefile
lib/Makefile.in
lib/parser_aux.lo
lib/parser_aux.o
lib/structure.lo
lib/structure.o
lib/version.lo
lib/version.o
libtasn1-*.tar.gz
libtasn1-*.tar.gz.sig
libtool
lib/version.lo
lib/version.o
m4-gl/
m4/.gitignore
m4/libtool.m4
m4/lt~obsolete.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
Makefile
Makefile.in
README
scan.tmp
src/.deps/
src/.libs/
src/Makefile
src/Makefile.in
src/asn1Coding
src/asn1Coding.o
src/asn1Decoding
......@@ -185,11 +147,34 @@ src/asn1Decoding.o
src/asn1Parser
src/asn1Parser.o
src/benchmark.o
src/.deps/
src/.libs/
src/Makefile
src/Makefile.in
stamp-h1
tags
tests/coding-decoding2
tests/coding-long-oid
tests/copynode
tests/CVE-2018-1000654
tests/CVE-2018-1000654-1_asn1_tab.h
tests/CVE-2018-1000654-2_asn1_tab.h
tests/.deps/
tests-gl/
tests/*.log
tests/Makefile
tests/Makefile.in
tests/*.o
tests/object-id-decoding
tests/ocsp-basic-response
tests/octet-string
tests/setof
tests/spc_pe_image_data
tests/strict-der
tests/Test_choice
tests/Test_choice.o
tests/Test_choice_ocsp
tests/Test_encdec
tests/Test_encoding
tests/Test_encoding.o
tests/Test_errors
......@@ -199,17 +184,14 @@ tests/Test_indefinite.o
tests/Test_overflow
tests/Test_overflow.o
tests/Test_parser
tests/Test_parser.o
tests/Test_parser_ERROR.asn
tests/Test_parser.o
tests/Test_simple
tests/Test_simple.o
tests/Test_strings
tests/Test_strings.o
tests/Test_tree
tests/Test_tree.o
tests/Test_choice
tests/Test_choice.o
tests/*.trs
windows/libtasn1-*-win??.zip
windows/tmp
tests/*.log
tests/*.trs
image: centos:7
before_script:
- yum install -y git make bison autoconf libtool automake gettext-devel glibc-devel gcc valgrind clang libasan-static libubsan
variables:
BUILD_IMAGES_PROJECT: gnutls/build-images
FEDORA_BUILD: buildenv-f30
DEBIAN_X86_CROSS_BUILD: buildenv-debian-x86-cross
GET_SOURCES_ATTEMPTS: "3"
# See http://doc.gitlab.com/ce/ci/yaml/ for documentation.
Build and Check (x86-64):
x86-64:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- git submodule update --init && make autoreconf && ./configure --disable-doc && make -j4 && make -j4 check
- yum remove -y libtasn1-devel
- ./bootstrap
- ./configure --disable-doc && make -j$(nproc)
- make -j$(nproc) check
- make abi-check
- make distcheck
except:
- tags
tags:
- shared
Build and Check (x86):
valgrind/werror:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- yum install -y libgcc.i686 glibc-devel.i686
- git submodule update --init && make autoreconf &&
PKG_CONFIG_PATH="/usr/lib/pkgconfig/" CFLAGS="-O2 -g -m32" LDFLAGS="-m32" ./configure --build=i686-redhat-linux --target=i686-redhat-linux --disable-doc && make -j4 && make -j4 check
- yum remove -y libtasn1-devel
- ./bootstrap
- CFLAGS="-O2 -g -Werror" ./configure --disable-doc --enable-valgrind-tests && make -j$(nproc)
- make -j$(nproc) check
except:
- tags
tags:
- shared
Build and Check with clang:
x86:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_X86_CROSS_BUILD
script:
- git submodule update --init && make autoreconf && CC=clang
./configure --disable-doc --disable-valgrind-tests && make -j4 && make check -j4
- build=$(dpkg-architecture -qDEB_HOST_GNU_TYPE)
- host=i686-linux-gnu
- export CC_FOR_BUILD="gcc"
- export CC="$host-gcc"
- ./bootstrap
- mkdir -p build
- cd build
- dash ../configure --build=$build --host=$host --disable-doc
- make -j$(nproc)
- make check -j$(nproc)
- cd ..
tags:
- shared
- docker
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- build/guile/tests/*.log
- build/*.log
- build/tests/*.log
- build/tests/*/*.log
- build/tests/suite/*/*.log
retry: 1
clang:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- yum remove -y libtasn1-devel
- ./bootstrap
- CC=clang ./configure --disable-doc --disable-valgrind-tests && make -j$(nproc)
- make check -j$(nproc)
except:
- tags
tags:
- shared
Build and Check with asan:
asan:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- git submodule update --init && make autoreconf && CFLAGS="-fsanitize=address -g
-O2" LDFLAGS="-static-libasan" ./configure --disable-doc --disable-valgrind-tests && make -j4 && make check -j4
- yum remove -y libtasn1-devel
- ./bootstrap
- CFLAGS="-fsanitize=address -g -O2" LDFLAGS="-static-libasan" ./configure --disable-doc --disable-valgrind-tests && make -j$(nproc) && make check -j$(nproc)
except:
- tags
tags:
- shared
Build and Check with ubsan:
image: fedora:24
ubsan:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- yum install -y git make autoconf libtool automake gettext-devel glibc-devel gcc valgrind clang libasan-static libubsan
- git submodule update --init && make autoreconf && CFLAGS="-fsanitize=undefined -fno-sanitize-recover -g
-O2" ./configure --disable-doc --disable-valgrind-tests && make -j4 && make check -j4
- yum remove -y libtasn1-devel
- ./bootstrap
- CFLAGS="-fsanitize=undefined -fno-sanitize-recover -g -O2" ./configure --disable-doc --disable-valgrind-tests && make -j$(nproc) && make check -j$(nproc)
tags:
- shared
except:
- tags
MinGW32:
image: fedora:24
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- dnf install -y wine.i686 mingw32-gcc util-linux
- dnf remove -y mingw32-libtasn1
- mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
- echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
- make autoreconf && rm -f tests/suite/mini-eagain2.c && mkdir -p build && cd build &&
- ./bootstrap && rm -f tests/suite/mini-eagain2.c && mkdir -p build && cd build &&
mingw32-configure --disable-doc --disable-valgrind-tests &&
mingw32-make -j$(nproc) && mingw32-make -C tests check -j$(nproc)
tags:
......@@ -68,3 +118,88 @@ MinGW32:
- build/tests/*.log
- build/tests/*/*.log
gnutls:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- yum remove -y libtasn1-devel
- ./bootstrap
- ./configure --disable-doc --prefix=/usr --libdir=/usr/lib64 &&
make -j$(nproc) && make install
- git clone --depth 1 --branch master https://gitlab.com/gnutls/gnutls.git gnutls-git
- cd gnutls-git && git submodule update --init && ./bootstrap &&
./configure --disable-cxx --disable-guile --disable-doc && make -j$(nproc) &&
make -j $(nproc) check
tags:
- shared
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- gnutls-git/guile/tests/*.log
- gnutls-git/tests/*.log
- gnutls-git/*.log
- gnutls-git/tests/*/*.log
- gnutls-git/tests/suite/*/*.log
static-analyzers:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- ./bootstrap
- scan-build ./configure --disable-doc
- make -j$(nproc) syntax-check
- make -j$(nproc) -C lib/gl
- make -j$(nproc) -C lib ASN1.lo
- scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C lib
tags:
- shared
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- scan-build-lib/
# Target to run code coverage on non-master branches. That is intended
# to ensure that compilation in master will not break the pages rule.
pages-test:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- ./bootstrap
- ./configure --enable-gtk-doc --disable-gcc-warnings --enable-code-coverage
- mkdir -p public
- make -j$(nproc)
- make -j$(nproc) check
- make local-code-coverage-output || true
- make -C doc libtasn1.html libtasn1.pdf
- mv doc/libtasn1.pdf doc/libtasn1.html public/
- cp -ar GNU*-coverage/ public/coverage
- cp public/libtasn1.html public/index.html
tags:
- shared
except:
- master
pages:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- ./bootstrap
- CFLAGS="-g -Og" dash ./configure --disable-doc --enable-code-coverage --enable-gtk-doc --disable-gcc-warnings
- mkdir -p public
- make -j$(nproc)
- make -j$(nproc) check
- make local-code-coverage-output || true
- make -C doc libtasn1.html libtasn1.pdf
- mv doc/libtasn1.pdf doc/libtasn1.html public/
- cp -ar GNU*-coverage/ public/coverage
- cp public/libtasn1.html public/index.html
tags:
- shared
artifacts:
when: on_success
paths:
- public
only:
- master
[submodule "gnulib"]
path = gnulib
url = https://gitlab.com/libidn/gnulib-mirror.git
# libtasn1 -- Information about our contribution rules and coding style
Unless otherwise stated or implied the [GnuTLS contribution rules apply](https://gitlab.com/gnutls/gnutls/blob/master/CONTRIBUTING.md).
The following sections document any differences that apply:
# Function names
All the function names use underscore `_`, to separate words, functions like
asn1DoThat are not used. The exported function names start with the
`asn1_` prefix.
......@@ -5,7 +5,7 @@
# It is necessary if you want to build targets usually of interest
# only to the maintainer.
# Copyright (C) 2001, 2003, 2006-2017 Free Software Foundation, Inc.
# Copyright (C) 2001, 2003, 2006-2019 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
......@@ -18,7 +18,7 @@
# 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/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# If the user runs GNU make but has not yet run ./configure,
# give them a diagnostic.
......
LICENSING
=========
The libtasn1 library is released under the GNU Lesser General Public
License (LGPL) version 2.1 or later; see [COPYING.LESSER](doc/COPYING.LESSER)
for the license terms.
The GNU LGPL applies to the main libtasn1 library, while the
included applications library are under the GNU GPL version 3.
The libtasn1 library is located in the lib directory, while the applications
in src/.
The documentation in doc/ is under the GNU FDL license 1.3.
For any copyright year range specified as YYYY-ZZZZ in this package
note that the range specifies every single year in that closed interval.
......@@ -24,42 +24,80 @@ EXTRA_DIST = windows/asn1-parser/asn1-parser.vcproj \
windows/gnulib/getopt.h windows/gnulib/gnulib.vcproj \
windows/libtasn1/libtasn1.vcproj \
windows/test-parser/test-parser.vcproj \
windows/test-tree/test-tree.vcproj windows/libtasn14win.mk
windows/test-tree/test-tree.vcproj windows/libtasn14win.mk \
CONTRIBUTING.md cfg.mk maint.mk AUTHORS NEWS ChangeLog \
THANKS LICENSE
SUBDIRS = gl lib src tests
SUBDIRS = lib src tests
if ENABLE_DOC
SUBDIRS += doc examples
endif
ACLOCAL_AMFLAGS = -I m4 -I gl/m4 -I lib/glm4
include $(top_srcdir)/aminclude_static.am
EXTRA_DIST += cfg.mk maint.mk .clcopying
ACLOCAL_AMFLAGS = -I m4 -I m4-gl
gnulib-update:
gnulib-tool --add-import --dir=. --lib=libgnu --source-base=lib/gllib --m4-base=lib/glm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=lgl --no-vc-files
EXTRA_DIST += cfg.mk maint.mk .clcopying README.md
TMPFILE="abi-temp.xml"
ABIDW_COMMON = --no-show-locs --no-corpus-path
ABIGNORE_FILE = "$(top_srcdir)/devel/libtasn1.abignore"
LIBGNUTLS_ABI_LAST_FILE = "$(top_srcdir)/devel/libtasn1-latest-$$(uname -m).abi"
abi-check:
@rm -f $(TMPFILE)
@echo "Checking libtasn1 ABI"
@echo "<version>$(VERSION)</version>" >$(TMPFILE)
@echo "<headers>$(srcdir)/lib/libtasn1.h" >>$(TMPFILE)
@echo "$(builddir)/lib/libtasn1.h</headers>" >>$(TMPFILE)
@echo "<libs>$(builddir)/lib/.libs</libs>" >>$(TMPFILE)
test ! -f "$(srcdir)/devel/ABI-$$(uname -m).dump" || \
abi-compliance-checker -abi -lib libtasn1 -old "$(srcdir)/devel/ABI-$$(uname -m).dump" -new $(TMPFILE)
@rm -f $(TMPFILE)
abi-dump-versioned: lib/libtasn1.la
@echo "**************************************************"
@echo "Generating versioned ABI files of current libtasn1"
@echo "**************************************************"
@abidw lib/.libs/libtasn1.so $(ABIDW_COMMON) --suppressions $(ABIGNORE_FILE) --out-file "$(srcdir)/devel/libtasn1-$(VERSION)-$$(uname -m).abi"
abi-dump:
@mkdir -p devel/headers-tmp
@cp lib/libtasn1.h devel/headers-tmp
@abi-dumper lib/.libs/libtasn1.so -o "./devel/ABI-$$(uname -m).dump" -public-headers devel/headers-tmp
@rm -rf devel/headers-tmp
abi-dump-latest: lib/libtasn1.la
@echo "****************************************"
@echo "Generating ABI files of current libtasn1"
@echo "****************************************"
@abidw lib/.libs/libtasn1.so $(ABIDW_COMMON) --suppressions $(ABIGNORE_FILE) --out-file $(LIBGNUTLS_ABI_LAST_FILE)
@rm -f "./devel/libtasn1-latest-$$(uname -m).tmp"
abi-check-latest: lib/libtasn1.la
@echo "Checking whether the latest ABI dump matches"
@abidiff --suppressions $(ABIGNORE_FILE) lib/.libs/libtasn1.so $(LIBGNUTLS_ABI_LAST_FILE) --hd2 "$(srcdir)/lib/includes/"; if test $$? != 0;then \
echo "*********************************************************"; \
echo "libtasn1 ABI has changed; use 'make files-update' "; \
echo "and use 'git diff' to check correctness before committing"; \
echo "*********************************************************"; \
false; \
fi
@echo "********************************"
@echo "Current release matches ABI dump"
@echo "********************************"
dist-hook: abi-check
make -C doc/ compare-makefile
ABICHECK_COMMON = --no-added-syms
abi-check: lib/libtasn1.la
@for file in $$(echo $(srcdir)/devel/libtasn1-*-$$(uname -m).abi);do \
echo "Comparing libtasn1 with $$file"; \
abidiff $${file} lib/.libs/libtasn1.so $(ABICHECK_COMMON) --suppressions $(ABIGNORE_FILE) --hd2 "$(srcdir)/lib/includes//"; \
if test $$? != 0;then \
echo "****************************************************************************"; \
echo "ABI check failed; If intentional add suppression in devel/libtasn1.abignore"; \
echo "****************************************************************************"; \
false; \
fi; \
done
@echo "********************"
@echo "ABI checks completed"
@echo "********************"
.PHONY: abi-dump abi-check
files-update: abi-dump-latest
local-code-coverage-output: code-coverage-capture
cat "GNU Libtasn1-$(VERSION)-coverage/index.html"|grep headerCovTableEntry|grep '%'|head -1|sed 's/^.*>\([0-9]\+\.[0-9]\+\s*%\)<.*$$/ coverage lines: \1/' || true
clean-local: code-coverage-clean
distclean-local: code-coverage-dist-clean
dist-hook:
if test -d "$(top_srcdir)/devel";then \
$(MAKE) -C $(top_srcdir) abi-check-latest; \
make -C doc/ compare-makefile; \
fi
.PHONY: abi-check abi-dump-versioned abi-dump-latest
GNU Libtasn1 NEWS -*- outline -*-
* Noteworthy changes in release 4.14 (released 2019-07-21) [stable]
- New #defines for version checking: ASN1_VERSION_MAJOR, ASN1_VERSION_MINOR,
ASN1_VERSION_PATCH, ASN1_VERSION_NUMBER. The next release will switch
to semantic version semantics.
- Simplify ordering of SET OF elements by using qsort().
- Marked explicitly const uses of asn1_node with the introduction
of the (compatible) asn1_node_const type.
- Limit recursion in _asn1_expand_object_id() to detect infinite
recursion in incorrect .asn files (#4).
- asn1_array2tree(): fixed thread safety issues.
- Several fixes in gtk-doc generation.
* Noteworthy changes in release 4.13 (released 2018-01-16) [stable]
- On indefinite string decoding, set a maximum level of allowed recursions
(3) to protect the BER decoder from a stack exhaustion.
......
This is GNU Libtasn1, a small ASN.1 library.
The C library (libtasn1.*) is licensed under the GNU Lesser General
Public License version 2.1 or later. See the file COPYING.LIB.
The command line tool, self tests, examples, and other auxilliary
files, are licensed under the GNU General Public License version 3.0
or later. See the file COPYING.
The manual is in doc/. You can also browse the manual and see updates
about the project on the homepage:
http://www.gnu.org/software/libtasn1/
For any copyright year range specified as YYYY-ZZZZ in this package
note that the range specifies every single year in that closed interval.
----------------------------------------------------------------------
Copyright (C) 2002-2014 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
This file contains instructions for developers and advanced users that
wants to build from version controlled sources.
We require several tools to build the software, including:
- Make <http://www.gnu.org/software/make/>
- Automake <http://www.gnu.org/software/automake/>
- Autoconf <http://www.gnu.org/software/autoconf/>
- Libtool <http://www.gnu.org/software/libtool/>
- Texinfo <http://www.gnu.org/software/texinfo/>
- help2man <http://www.gnu.org/software/help2man/>
- Tar <http://www.gnu.org/software/tar/>
- Gzip <http://www.gnu.org/software/gzip/>
- Texlive & epsf <http://www.tug.org/texlive/> (for PDF manual)
- GTK-DOC <http://www.gtk.org/gtk-doc/> (for API manual)
- Git <http://git.or.cz/>
- Perl <http://www.cpan.org/>
- Valgrind <http://valgrind.org/> (optional)
The required software is typically distributed with your operating
system, and the instructions for installing them differ. Here are
some hints:
gNewSense/Debian/Ubuntu:
sudo apt-get install make git-core autoconf automake libtool
sudo apt-get install texinfo texlive texlive-generic-recommended texlive-extra-utils
sudo apt-get install help2man gtk-doc-tools valgrind
To download the version controlled sources:
$ git clone git://git.savannah.gnu.org/libtasn1.git
$ cd libtasn1
The next step is to run autoreconf, ./configure, etc:
$ make bootstrap
Then build the project normally:
$ make
$ make check
Happy hacking!
----------------------------------------------------------------------
Copyright (C) 2009-2014 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
|Branch|CI system|Status|
|:----:|:-------:|-----:|
|Master|Gitlab|[![build status](https://gitlab.com/gnutls/libtasn1/badges/master/build.svg)](https://gitlab.com/gnutls/libtasn1/commits/master)[![coverage report](https://gitlab.com/gnutls/libtasn1/badges/master/coverage.svg)](https://gnutls.gitlab.io/libtasn1/coverage)|
# libtasn1
This is GNU Libtasn1, a small ASN.1 library.
The C library (libtasn1.*) is licensed under the GNU Lesser General
Public License version 2.1 or later. See the file COPYING.LIB.
The command line tool, self tests, examples, and other auxilliary
files, are licensed under the GNU General Public License version 3.0
or later. See the file COPYING.
## Building the library
We require several tools to build the software, including:
* [Make](https://www.gnu.org/software/make/)
* [Automake](https://www.gnu.org/software/automake/) (use 1.11.3 or later)
* [Autoconf](https://www.gnu.org/software/autoconf/)
* [Libtool](https://www.gnu.org/software/libtool/)
* [Texinfo](https://www.gnu.org/software/texinfo/)
* [help2man](http://www.gnu.org/software/help2man/)
* [Tar](https://www.gnu.org/software/tar/)
* [Gzip](https://www.gnu.org/software/gzip/)
* [bison](https://www.gnu.org/software/bison/)
* [Texlive & epsf](https://www.tug.org/texlive/) (for PDF manual)
* [GTK-DOC](https://www.gtk.org/gtk-doc/) (for API manual)
* [Git](https://git-scm.com/)
* [libabigail](https://pagure.io/libabigail/) (for abi comparison in make dist)
* [Valgrind](https://valgrind.org/) (optional)
The required software is typically distributed with your operating
system, and the instructions for installing them differ. Here are
some hints:
gNewSense/Debian/Ubuntu:
```
sudo apt-get install make git-core autoconf automake libtool
sudo apt-get install texinfo texlive texlive-generic-recommended texlive-extra-utils
sudo apt-get install help2man gtk-doc-tools valgrind abigail-tools
```
The next step is to run autoreconf, ./configure, etc:
```
$ ./bootstrap
```
Then build the project normally:
```
$ make
$ make check
```
Happy hacking!
## Manual
The manual is in the `doc/` directory of the release. You can also browse
the manual online at:
- https://gnutls.gitlab.io/libtasn1/
## Code coverage report
The coverage report is at:
- https://gnutls.gitlab.io/libtasn1/coverage
## Homepage
The project homepage at the gnu site is at:
http://www.gnu.org/software/libtasn1/
For any copyright year range specified as YYYY-ZZZZ in this package
note that the range specifies every single year in that closed interval.
#! /bin/sh
# Print a version string.
scriptversion=2019-01-04.17; # UTC
# Bootstrap this package from checked-out sources.
# Copyright (C) 2003-2019 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 <https://www.gnu.org/licenses/>.
# Originally written by Paul Eggert. The canonical version of this
# script is maintained as build-aux/bootstrap in gnulib, however, to
# be useful to your project, you should place a copy of it under
# version control in the top-level directory of your project. The
# intent is that all customization can be done with a bootstrap.conf
# file also maintained in your version control; gnulib comes with a
# template build-aux/bootstrap.conf to get you started.
# Please report bugs or propose patches to bug-gnulib@gnu.org.
nl='
'
# Ensure file names are sorted consistently across platforms.
LC_ALL=C
export LC_ALL
# Ensure that CDPATH is not set. Otherwise, the output from cd
# would cause trouble in at least one use below.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
local_gl_dir=gl
# Honor $PERL, but work even if there is none.
PERL="${PERL-perl}"
me=$0
default_gnulib_url=git://git.sv.gnu.org/gnulib
usage() {
cat <<EOF
Usage: $me [OPTION]...
Bootstrap this package from the checked-out sources.
Options:
--gnulib-srcdir=DIRNAME specify the local directory where gnulib
sources reside. Use this if you already
have gnulib sources on your machine, and
do not want to waste your bandwidth downloading
them again. Defaults to \$GNULIB_SRCDIR
--bootstrap-sync if this bootstrap script is not identical to
the version in the local gnulib sources,
update this script, and then restart it with
/bin/sh or the shell \$CONFIG_SHELL
--no-bootstrap-sync do not check whether bootstrap is out of sync
--copy copy files instead of creating symbolic links
--force attempt to bootstrap even if the sources seem
not to have been checked out
--no-git do not use git to update gnulib. Requires that
--gnulib-srcdir point to a correct gnulib snapshot
--skip-po do not download po files
If the file $me.conf exists in the same directory as this script, its
contents are read as shell variables to configure the bootstrap.
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
are honored.
Gnulib sources can be fetched in various ways:
* If this package is in a git repository with a 'gnulib' submodule
configured, then that submodule is initialized and updated and sources
are fetched from there. If \$GNULIB_SRCDIR is set (directly or via
--gnulib-srcdir) and is a git repository, then it is used as a reference.
* Otherwise, if \$GNULIB_SRCDIR is set (directly or via --gnulib-srcdir),
then sources are fetched from that local directory. If it is a git
repository and \$GNULIB_REVISION is set, then that revision is checked
out.
* Otherwise, if this package is in a git repository with a 'gnulib'
submodule configured, then that submodule is initialized and updated and
sources are fetched from there.
* Otherwise, if the 'gnulib' directory does not exist, Gnulib sources are
cloned into that directory using git from \$GNULIB_URL, defaulting to
$default_gnulib_url.
If \$GNULIB_REVISION is set, then that revision is checked out.
* Otherwise, the existing Gnulib sources in the 'gnulib' directory are
used. If it is a git repository and \$GNULIB_REVISION is set, then that
revision is checked out.
If you maintain a package and want to pin a particular revision of the
Gnulib sources that has been tested with your package, then there are two
possible approaches: either configure a 'gnulib' submodule with the
appropriate revision, or set \$GNULIB_REVISION (and if necessary
\$GNULIB_URL) in $me.conf.
Running without arguments will suffice in most cases.
EOF
}
# warnf_ FORMAT-STRING ARG1...
warnf_ ()
{
warnf_format_=$1
shift
nl='
'
case $* in
*$nl*) me_=$(printf "$me"|tr "$nl|" '??')
printf "$warnf_format_" "$@" | sed "s|^|$me_: |" ;;
*) printf "$me: $warnf_format_" "$@" ;;
esac >&2
}
# warn_ WORD1...
warn_ ()
{
# If IFS does not start with ' ', set it and emit the warning in a subshell.
case $IFS in
' '*) warnf_ '%s\n' "$*";;
*) (IFS=' '; warn_ "$@");;
esac
}
# die WORD1...
die() { warn_ "$@"; exit 1; }
# Configuration.
# Name of the Makefile.am
gnulib_mk=gnulib.mk
# List of gnulib modules needed.
gnulib_modules=
# Any gnulib files needed that are not in modules.
gnulib_files=
: ${AUTOPOINT=autopoint}
: ${AUTORECONF=autoreconf}
# A function to be called right after gnulib-tool is run.
# Override it via your own definition in bootstrap.conf.
bootstrap_post_import_hook() { :; }
# A function to be called after everything else in this script.
# Override it via your own definition in bootstrap.conf.
bootstrap_epilogue() { :; }
# The command to download all .po files for a specified domain into a
# specified directory. Fill in the first %s with the destination
# directory and the second with the domain name.
po_download_command_format=\
"wget --mirror --level=1 -nd -q -A.po -P '%s' \
https://translationproject.org/latest/%s/"
# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
# fall back to the package name (1st argument with munging)
extract_package_name='
/^AC_INIT(\[*/{
s///
/^[^,]*,[^,]*,[^,]*,[ []*\([^][ ,)]\)/{
s//\1/
s/[],)].*//
p
q
}
s/[],)].*//
s/^GNU //
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g
p
}
'
package=$(sed -n "$extract_package_name" configure.ac) \
|| die 'cannot find package name in configure.ac'
gnulib_name=lib$package
build_aux=build-aux
source_base=lib
m4_base=m4
doc_base=doc
tests_base=tests
gnulib_extra_files="
build-aux/install-sh
build-aux/mdate-sh
build-aux/texinfo.tex
build-aux/depcomp
build-aux/config.guess
build-aux/config.sub
doc/INSTALL
"
# Additional gnulib-tool options to use. Use "\newline" to break lines.
gnulib_tool_option_extras=
# Other locale categories that need message catalogs.
EXTRA_LOCALE_CATEGORIES=
# Additional xgettext options to use. Use "\\\newline" to break lines.
XGETTEXT_OPTIONS='\\\
--flag=_:1:pass-c-format\\\
--flag=N_:1:pass-c-format\\\
--flag=error:3:c-format --flag=error_at_line:5:c-format\\\
'
# Package bug report address and copyright holder for gettext files
COPYRIGHT_HOLDER='Free Software Foundation, Inc.'
MSGID_BUGS_ADDRESS=bug-$package@gnu.org
# Files we don't want to import.
excluded_files=
# File that should exist in the top directory of a checked out hierarchy,
# but not in a distribution tarball.
checkout_only_file=README-hacking
# Whether to use copies instead of symlinks.
copy=false
# Set this to '.cvsignore .gitignore' in bootstrap.conf if you want
# those files to be generated in directories like lib/, m4/, and po/.
# Or set it to 'auto' to make this script select which to use based
# on which version control system (if any) is used in the source directory.
vc_ignore=auto
# Set this to true in bootstrap.conf to enable --bootstrap-sync by
# default.
bootstrap_sync=false
# Use git to update gnulib sources
use_git=true
check_exists() {
if test "$1" = "--verbose"; then
($2 --version </dev/null) >/dev/null 2>&1
if test $? -ge 126; then
# If not found, run with diagnostics as one may be
# presented with env variables to set to find the right version
($2 --version </dev/null)
fi
else
($1 --version </dev/null) >/dev/null 2>&1
fi
test $? -lt 126
}
# find_tool ENVVAR NAMES...
# -------------------------
# Search for a required program. Use the value of ENVVAR, if set,
# otherwise find the first of the NAMES that can be run.
# If found, set ENVVAR to the program name, die otherwise.
#
# FIXME: code duplication, see also gnu-web-doc-update.
find_tool ()
{
find_tool_envvar=$1
shift
find_tool_names=$@
eval "find_tool_res=\$$find_tool_envvar"
if test x"$find_tool_res" = x; then
for i; do
if check_exists $i; then
find_tool_res=$i
break
fi
done
fi
if test x"$find_tool_res" = x; then
warn_ "one of these is required: $find_tool_names;"
die "alternatively set $find_tool_envvar to a compatible tool"
fi
eval "$find_tool_envvar=\$find_tool_res"
eval "export $find_tool_envvar"
}
# Override the default configuration, if necessary.
# Make sure that bootstrap.conf is sourced from the current directory
# if we were invoked as "sh bootstrap".
case "$0" in
*/*) test -r "$0.conf" && . "$0.conf" ;;
*) test -r "$0.conf" && . ./"$0.conf" ;;
esac
if test "$vc_ignore" = auto; then
vc_ignore=
test -d .git && vc_ignore=.gitignore
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
fi
if test x"$gnulib_modules$gnulib_files$gnulib_extra_files" = x; then
use_gnulib=false
else
use_gnulib=true
fi
# Translate configuration into internal form.
# Parse options.
for option
do
case $option in
--help)
usage
exit;;
--gnulib-srcdir=*)
GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
--skip-po)
SKIP_PO=t;;
--force)
checkout_only_file=;;
--copy)
copy=true;;
--bootstrap-sync)
bootstrap_sync=true;;
--no-bootstrap-sync)
bootstrap_sync=false;;
--no-git)
use_git=false;;
*)
die "$option: unknown option";;
esac
done
$use_git || test -d "$GNULIB_SRCDIR" \
|| die "Error: --no-git requires --gnulib-srcdir"
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
die "Bootstrapping from a non-checked-out distribution is risky."
fi
# Strip blank and comment lines to leave significant entries.
gitignore_entries() {
sed '/^#/d; /^$/d' "$@"
}
# If $STR is not already on a line by itself in $FILE, insert it at the start.
# Entries are inserted at the start of the ignore list to ensure existing
# entries starting with ! are not overridden. Such entries support
# whitelisting exceptions after a more generic blacklist pattern.
insert_if_absent() {
file=$1
str=$2
test -f $file || touch $file
test -r $file || die "Error: failed to read ignore file: $file"
duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
if [ "$duplicate_entries" ] ; then
die "Error: Duplicate entries in $file: " $duplicate_entries
fi
linesold=$(gitignore_entries $file | wc -l)
linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
if [ $linesold != $linesnew ] ; then
{ echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
|| die "insert_if_absent $file $str: failed"
fi
}
# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
# insert_if_absent.
insert_vc_ignore() {
vc_ignore_file="$1"
pattern="$2"
case $vc_ignore_file in
*.gitignore)
# A .gitignore entry that does not start with '/' applies
# recursively to subdirectories, so prepend '/' to every
# .gitignore entry.
pattern=$(echo "$pattern" | sed s,^,/,);;
esac
insert_if_absent "$vc_ignore_file" "$pattern"
}
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
found_aux_dir=no
grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
>/dev/null && found_aux_dir=yes
grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
>/dev/null && found_aux_dir=yes
test $found_aux_dir = yes \
|| die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it"
# If $build_aux doesn't exist, create it now, otherwise some bits
# below will malfunction. If creating it, also mark it as ignored.
if test ! -d $build_aux; then
mkdir $build_aux
for dot_ig in x $vc_ignore; do
test $dot_ig = x && continue
insert_vc_ignore $dot_ig $build_aux
done
fi
# Note this deviates from the version comparison in automake
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
# but this should suffice as we won't be specifying old
# version formats or redundant trailing .0 in bootstrap.conf.
# If we did want full compatibility then we should probably
# use m4_version_compare from autoconf.
sort_ver() { # sort -V is not generally available
ver1="$1"
ver2="$2"
# split on '.' and compare each component
i=1
while : ; do
p1=$(echo "$ver1" | cut -d. -f$i)
p2=$(echo "$ver2" | cut -d. -f$i)
if [ ! "$p1" ]; then
echo "$1 $2"
break
elif [ ! "$p2" ]; then
echo "$2 $1"
break
elif [ ! "$p1" = "$p2" ]; then
if [ "$p1" -gt "$p2" ] 2>/dev/null; then # numeric comparison
echo "$2 $1"
elif [ "$p2" -gt "$p1" ] 2>/dev/null; then # numeric comparison
echo "$1 $2"
else # numeric, then lexicographic comparison
lp=$(printf "$p1\n$p2\n" | LANG=C sort -n | tail -n1)
if [ "$lp" = "$p2" ]; then
echo "$1 $2"
else
echo "$2 $1"
fi
fi
break
fi
i=$(($i+1))
done
}
get_version_sed='
# Move version to start of line.
s/.*[v ]\([0-9]\)/\1/
# Skip lines that do not start with version.
/^[0-9]/!d
# Remove characters after the version.
s/[^.a-z0-9-].*//
# The first component must be digits only.
s/^\([0-9]*\)[a-z-].*/\1/
#the following essentially does s/5.005/5.5/
s/\.0*\([1-9]\)/.\1/g
p
q'
get_version() {
app=$1
$app --version >/dev/null 2>&1 || { $app --version; return 1; }
$app --version 2>&1 | sed -n "$get_version_sed"
}
check_versions() {
ret=0
while read app req_ver; do
# We only need libtoolize from the libtool package.
if test "$app" = libtool; then
app=libtoolize
fi
# Exempt git if --no-git is in effect.
if test "$app" = git; then
$use_git || continue
fi
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
appvar=$(echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_')
test "$appvar" = TAR && appvar=AMTAR
case $appvar in
GZIP) ;; # Do not use $GZIP: it contains gzip options.
PERL::*) ;; # Keep perl modules as-is
*) eval "app=\${$appvar-$app}" ;;
esac
# Handle the still-experimental Automake-NG programs specially.
# They remain named as the mainstream Automake programs ("automake",
# and "aclocal") to avoid gratuitous incompatibilities with
# pre-existing usages (by, say, autoreconf, or custom autogen.sh
# scripts), but correctly identify themselves (as being part of
# "GNU automake-ng") when asked their version.
case $app in
automake-ng|aclocal-ng)
app=${app%-ng}
($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || {
warn_ "Error: '$app' not found or not from Automake-NG"
ret=1
continue
} ;;
# Another check is for perl modules. These can be written as
# e.g. perl::XML::XPath in case of XML::XPath module, etc.
perl::*)
# Extract module name
app="${app#perl::}"
if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
warn_ "Error: perl module '$app' not found"
ret=1
fi
continue
;;
esac
if [ "$req_ver" = "-" ]; then
# Merely require app to exist; not all prereq apps are well-behaved
# so we have to rely on $? rather than get_version.
if ! check_exists --verbose $app; then
warn_ "Error: '$app' not found"
ret=1
fi
else
# Require app to produce a new enough version string.
inst_ver=$(get_version $app)
if [ ! "$inst_ver" ]; then
warn_ "Error: '$app' not found"
ret=1
else
latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
if [ ! "$latest_ver" = "$inst_ver" ]; then
warnf_ '%s\n' \
"Error: '$app' version == $inst_ver is too old" \
" '$app' version >= $req_ver is required"
ret=1
fi
fi
fi
done
return $ret
}
print_versions() {
echo "Program Min_version"
echo "----------------------"
printf %s "$buildreq"
echo "----------------------"
# can't depend on column -t
}
# Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6.
# Also find the compatible sha1 utility on the BSDs
if test x"$SKIP_PO" = x; then
find_tool SHA1SUM sha1sum gsha1sum shasum sha1
fi
use_libtool=0
# We'd like to use grep -E, to see if any of LT_INIT,
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
# but that's not portable enough (e.g., for Solaris).
grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \
&& use_libtool=1
grep '^[ ]*LT_INIT' configure.ac >/dev/null \
&& use_libtool=1
if test $use_libtool = 1; then
find_tool LIBTOOLIZE glibtoolize libtoolize
fi
# gnulib-tool requires at least automake and autoconf.
# If either is not listed, add it (with minimum version) as a prerequisite.
case $buildreq in
*automake*) ;;
*) buildreq="automake 1.9
$buildreq" ;;
esac
case $buildreq in
*autoconf*) ;;
*) buildreq="autoconf 2.59
$buildreq" ;;
esac
# When we can deduce that gnulib-tool will require patch,
# and when patch is not already listed as a prerequisite, add it, too.
if test -d "$local_gl_dir" \
&& ! find "$local_gl_dir" -name '*.diff' -exec false {} +; then
case $buildreq in
*patch*) ;;
*) buildreq="patch -
$buildreq" ;;
esac
fi