summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-12-23 10:56:12 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-12-23 10:56:12 +0900
commit0f94cbc5a5428ac4948b9ece8c57ffc93d0e555d (patch)
tree38db3fc0703cd3dcfacf2382270f0ea39ceb1fac
parent3665537392fecfd5061130b6622351db4dea3499 (diff)
downloadlibksba-0f94cbc5a5428ac4948b9ece8c57ffc93d0e555d.tar.gz
libksba-0f94cbc5a5428ac4948b9ece8c57ffc93d0e555d.tar.bz2
libksba-0f94cbc5a5428ac4948b9ece8c57ffc93d0e555d.zip
Imported Upstream version 1.4.0upstream/1.4.0
-rw-r--r--AUTHORS2
-rw-r--r--ChangeLog626
-rw-r--r--Makefile.am33
-rw-r--r--Makefile.in125
-rw-r--r--NEWS57
-rw-r--r--aclocal.m4204
-rw-r--r--autogen.rc8
-rwxr-xr-xautogen.sh64
-rw-r--r--config.h.in7
-rwxr-xr-xconfigure806
-rw-r--r--configure.ac92
-rw-r--r--doc/Makefile.in60
-rw-r--r--doc/ksba.info125
-rw-r--r--doc/ksba.texi19
-rw-r--r--doc/stamp-vti8
-rw-r--r--doc/version.texi8
-rw-r--r--gl/Makefile.in43
-rw-r--r--m4/Makefile.am2
-rw-r--r--m4/Makefile.in43
-rw-r--r--m4/ax_prog_bison.m464
-rw-r--r--m4/gcov.m493
-rw-r--r--m4/gpg-error.m495
-rw-r--r--m4/libgcrypt.m446
-rw-r--r--src/Makefile.am25
-rw-r--r--src/Makefile.in367
-rw-r--r--src/asn1-constants.h66
-rwxr-xr-xsrc/asn1-func.c18
-rwxr-xr-xsrc/asn1-func.h53
-rw-r--r--src/asn1-gentables.c13
-rw-r--r--src/asn1-parse.c978
-rwxr-xr-xsrc/asn1-parse.y10
-rw-r--r--src/asn1-tables.c2510
-rw-r--r--src/ber-decoder.c22
-rw-r--r--src/ber-help.c245
-rw-r--r--src/ber-help.h60
-rw-r--r--src/cert.c42
-rw-r--r--src/cert.h3
-rw-r--r--src/certreq.c314
-rw-r--r--src/certreq.h1
-rw-r--r--src/cms-parser.c22
-rw-r--r--src/cms.c987
-rw-r--r--src/cms.h17
-rw-r--r--src/crl.c159
-rw-r--r--src/der-builder.c667
-rw-r--r--src/der-builder.h51
-rw-r--r--src/dn.c135
-rw-r--r--src/gen-help.h4
-rw-r--r--src/keyinfo.c1285
-rw-r--r--src/keyinfo.h12
-rw-r--r--src/ksba-config.in13
-rw-r--r--src/ksba.h88
-rw-r--r--src/ksba.h.in637
-rw-r--r--src/ksba.m464
-rw-r--r--src/ksba.pc.in14
-rw-r--r--src/libksba.def13
-rw-r--r--src/libksba.vers6
-rw-r--r--src/ocsp.c198
-rw-r--r--src/oid.c4
-rw-r--r--src/reader.c42
-rw-r--r--src/sexp-parse.h2
-rw-r--r--src/stringbuf.h183
-rw-r--r--src/util.c49
-rw-r--r--src/util.h1
-rw-r--r--src/versioninfo.rc.in2
-rw-r--r--src/visibility.c80
-rw-r--r--src/visibility.h39
-rw-r--r--tests/Makefile.am30
-rw-r--r--tests/Makefile.in178
-rw-r--r--tests/cert-basic.c256
-rw-r--r--tests/samples/README41
-rw-r--r--tests/samples/cert_dfn_pca01.der (renamed from tests/cert_dfn_pca01.der)bin1224 -> 1224 bytes
-rw-r--r--tests/samples/cert_dfn_pca15.der (renamed from tests/cert_dfn_pca15.der)bin1560 -> 1560 bytes
-rw-r--r--tests/samples/cert_g10code_test1.der (renamed from tests/cert_g10code_test1.der)bin793 -> 793 bytes
-rw-r--r--tests/samples/crl_testpki_testpca.der (renamed from tests/crl_testpki_testpca.der)bin861 -> 861 bytes
-rw-r--r--tests/samples/detached-sig.cmsbin0 -> 556 bytes
-rw-r--r--tests/samples/ecdh-sample1.p7mbin0 -> 447 bytes
-rw-r--r--tests/samples/ecdh-sample1.p7m.asn95
-rw-r--r--tests/samples/ed25519-ossl-1.crtbin0 -> 454 bytes
-rw-r--r--tests/samples/ed25519-rfc8410.crtbin0 -> 304 bytes
-rw-r--r--tests/samples/ed448-ossl-1.crtbin0 -> 536 bytes
-rw-r--r--tests/samples/openssl-secp256r1ca.cert.crtbin0 -> 825 bytes
-rw-r--r--tests/samples/rsa-sample1.p7mbin0 -> 750 bytes
-rw-r--r--tests/samples/rsa-sample1.p7m.asn96
-rw-r--r--tests/samples/secp256r1-sha384_cert.crtbin0 -> 634 bytes
-rw-r--r--tests/samples/secp256r1-sha512_cert.crtbin0 -> 633 bytes
-rw-r--r--tests/samples/secp384r1-sha512_cert.crtbin0 -> 696 bytes
-rw-r--r--tests/t-cms-parser.c140
-rw-r--r--tests/t-crl-parser.c150
-rw-r--r--tests/t-der-builder.c202
-rw-r--r--tests/t-dnparser.c46
-rw-r--r--tests/t-reader.c211
91 files changed, 9379 insertions, 4197 deletions
diff --git a/AUTHORS b/AUTHORS
index b18904c..c161951 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -24,7 +24,7 @@ Copyright
=========
| Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2011
- | 2012, 2013, 2014, 2015 g10 Code GmbH
+ | 2012, 2013, 2014, 2015, 2018, 2019 g10 Code GmbH
| Copyright (C) 2001, 2002, 2003, 2007 Free Software Foundation, Inc.
| Copyright (C) 2000, 2001 Fabio Fiorina
diff --git a/ChangeLog b/ChangeLog
index 302cb71..c137a84 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,579 @@
+2020-05-19 Werner Koch <wk@gnupg.org>
+
+ Release 1.4.0.
+ + commit f30f604700d37f1932d399ab2fb552713007117f
+
+
+2020-05-18 Werner Koch <wk@gnupg.org>
+
+ Finish creation of ECDSA and EdDSA certificates.
+ + commit 71a2f1e87790cc4fccd4e5e60ffd368fbfd85bb2
+ * src/keyinfo.c (_ksba_keyinfo_from_sexp): Skip writing curve
+ parameter in algoinfo mode.
+ (PKALGO_NONE): New.
+ (curve_names): Add field pkalgo and set for rfc8410 algos.
+ (get_ecc_curve_oid): New arg r_pkalgo.
+ (_ksba_keyinfo_from_sexp): Take are of a forced algo. Add code path
+ for rfc8410 public key.
+ * src/certreq.h (struct ksba_certreq_s): Add flag 'is_ecc'.
+ * src/certreq.c (ksba_certreq_add_extension): Set that flag.
+ (ksba_certreq_set_sig_val): Use sig_val.is_ecc also for EdDSA.
+ (build_cri): Rewrite using the DER builder.
+
+2020-05-15 Werner Koch <wk@gnupg.org>
+
+ Allow direct construction of encapsulated octet and bit strings.
+ + commit 2605a994a2c7a4c06e7a2efb69e620fd687359ba
+ * src/ksba.h.in (KSBA_CLASS_ENCAPSULATE): New pseudo class.
+ * src/der-builder.c (struct item_s): Add field 'encapsulate'. Change
+ 'class' to a 2 bit field. Decrease size of 'hdrlen' to 10 bits which
+ is more than enough.
+ (_ksba_der_builder_reset): Clear 'encapsulate'.
+ (_ksba_der_add_ptr): Mask CLASS to avoid possible compiler warnings.
+ (add_val_core): Ditto.
+ (_ksba_der_add_tag): Ditto. Set ENCAPSULATE.
+ (compute_lengths): Account for extra octet.
+ (_ksba_der_builder_get): Implement encapsulated data.
+
+ * tests/t-der-builder.c (test_der_builder): Add test cases for
+ encapsulated data.
+
+2020-05-14 Werner Koch <wk@gnupg.org>
+
+ Publish constants for the DER builder.
+ + commit 0e0fad9335ba8afe319fdb36e735533cff71a2b4
+ * src/ksba.h.in (KSBA_CLASS_): New constants.
+ (KSBA_TYPE_): New constants.
+ * src/der-builder.c (struct item_s): Increase size of HDRLEN and TAG.
+ (count_tl, write_tl): Support tags > 30.
+
+ * tests/t-der-builder.c: New
+ * tests/Makefile.am (TESTS): Add file.
+
+ Simplify the ksba_keyinfo_from_sexp function.
+ + commit 88647cd33059129dca6d17434208d5f68108daf3
+ * src/keyinfo.c: Include der-builder.h
+ (get_ecc_curve_oid): Change to return a string.
+ (oid_from_buffer): Ditto.
+ (_ksba_keyinfo_from_sexp): Rewrite.
+
+ Fix DER builder to a allow a single primitive element.
+ + commit 31c42e7568a7532f8fb5d291f5c4a26594d74ad4
+ * src/der-builder.c (_ksba_der_builder_get): Allow a single item.
+
+ Fold duplicated code in keyinfo.c into one function.
+ + commit fae738f23b5bfde8fa25b6759fd1aac6809b40ca
+ * src/keyinfo.c (_ksba_algoinfo_from_sexp): Remove.
+ (_ksba_keyinfo_from_sexp): Add arg algoinfomode
+ * src/certreq.c (ksba_certreq_add_subject): Adjust for change.
+ (ksba_certreq_set_serial): Use _ksba_keyinfo_from_sexp in
+ algoinfomode.
+
+ * tests/cert-basic.c (one_file): Adjust for change.
+
+2020-05-14 Trammell Hudson <hudson@trmm.net>
+
+ Fix qsort handler to reproducible sort the string table.
+ + commit cdbced98819dd0b1478db1bb82bbc249d52e32ae
+ * src/asn1-gentables.c (cmp_string): Comapre the strings if they have
+ the same length.
+
+2020-05-12 Werner Koch <wk@gnupg.org>
+
+ New API to construct arbitrary DER objects in memory.
+ + commit 30d35448cd585156a0461f02934a356894e6867b
+ * src/der-builder.h (struct ksba_der_s, ksba_der_t): Move to ...
+ * src/ksba.h.in: here.
+ (ksba_der_release): New.
+ (ksba_der_builder_new): New.
+ (ksba_der_builder_reset): New.
+ (ksba_der_add_ptr): New.
+ (ksba_der_add_val): New.
+ (ksba_der_add_int): New.
+ (ksba_der_add_oid): New.
+ (ksba_der_add_bts): New.
+ (ksba_der_add_der): New.
+ (ksba_der_add_tag): New.
+ (ksba_der_add_end): New.
+ (ksba_der_builder_get): New.
+ * src/libksba.def: Add new functions.
+ * src/libksba.vers: Ditto.
+ * src/visibility.c: Add wrapper.
+ * src/visibility.h (ksba_der_add_val): Add usual macro magic.
+
+ Allow parsing of EdDSA certificates.
+ + commit 60943d9f18162c7a55a635b122888b9f53690e77
+ * src/keyinfo.c (sig_algo_table): Remove unused params for EdDSA
+ algos.
+ (_ksba_keyinfo_to_sexp): Add curve to EdDSA algos.
+ (cryptval_to_sexp): Add special handling for EdDSA algos.
+
+2020-05-11 Werner Koch <wk@gnupg.org>
+
+ Support creation of ECDSA signed data.
+ + commit cda81bec2e141f67e6ee905eac0e719abb7ef20c
+ * src/der-builder.c (_ksba_der_add_int): New.
+ * src/cms.h (struct sig_val_s): Add struct ecc.
+ * src/cms.c (ksba_cms_release): Release ecc.
+ (ksba_cms_set_sig_val): Support ecdsa.
+ (build_signed_data_rest): Ditto.
+
+ * tests/samples/ecdsa-sample1.p7s: New.
+ * tests/samples/ecdsa-sample1.p7s.asn: New.
+ * tests/samples/rsa-sample1.p7s: New.
+ * tests/samples/rsa-sample1.p7s.asn: New.
+
+2020-05-04 Werner Koch <wk@gnupg.org>
+
+ Support creation of ECDH enveloped data object (part 2 of 2)
+ + commit 8ade151b10480cb03998669e928cfd2e159531c0
+ * src/cms.c (build_enveloped_data_header): Write out ECDH info.
+
+ Add a dedicated BIT STRING function to the new DER builder.
+ + commit be1b4416afc3d646b43c5541b2d79036b6e7cdaf
+ * src/der-builder.c (_ksba_der_add_bts): New.
+
+2020-05-01 Werner Koch <wk@gnupg.org>
+
+ Support creation of ECDH enveloped data object (part 1)
+ + commit 0ddfbb464e0a86164768bd42e3e02a07f06dca62
+ * src/cms.h (struct enc_val_s): Add new fields for ECDH.
+ * src/cms.c: Include der-builder.h
+ (log_sexp): New but commented debug helper.
+ (ksba_cms_release): Free new ECDH values.
+ (ksba_cms_set_enc_val): Support ECDH.
+ (build_enveloped_data_header): Rewrite to make use of the new DER
+ builder.
+
+ Add a new DER builder for internal use.
+ + commit cf49d3e60a67180fcb1b9005d910f015b388cf3c
+ * src/der-builder.c: New.
+ * src/der-builder.h: New.
+ * src/util.c (_ksba_reallocarray): New.
+
+ Add new internal function to get the encoded issuer.
+ + commit 9c52d0787e0d0e78c8f10523a1c12fd83126393b
+ * src/cert.c (_ksba_cert_get_issuer_dn_ptr): New.
+ (_ksba_cert_get_serial_ptr): Return the full DER encoding and not just
+ the value.
+ * src/ocsp.c (ksba_ocsp_prepare_request): Adjust for this change.
+
+ Add RSA encrypted sample file.
+ + commit 0aee4bf128097cbce7e26b76a06d41045fd9d26a
+
+
+ Move ASN.1 constants to a separate header.
+ + commit d1ca2c8b65da20f5c407a1c9aad721ace4de460e
+ * src/asn1-func.h: Factor constants out to ...
+ * src/asn1-constants.h: new.
+ * src/Makefile.am (libksba_la_SOURCES): Add new file.
+
+2020-04-21 Werner Koch <wk@gnupg.org>
+
+ Support parsing of the CMS KeyAgreeRecipientInfo.
+ + commit 401dc58d3d55ed58a0ac4e1f286a7e19ed9e956c
+ * src/cms-parser.c (_ksba_cms_parse_enveloped_data_part_1): Decode at
+ the RecipientInfo level.
+ * src/cms.c (ksba_cms_get_issuer_serial): Adjust for this change.
+ Support KeyAgreeRecipientInfo.
+ (ksba_cms_get_enc_val): Ditto.
+ (dbg_print_sexp): New commented debug helper.
+ * src/keyinfo.c (enc_algo_table): Add and entry of ECDH.
+ (_ksba_parse_algorithm_identifier2): Make R_NREAD optional.
+ (cryptval_to_sexp): Add args to support ECDH.
+ (_ksba_sigval_to_sexp): Adjust for this.
+ (_ksba_encval_to_sexp): Ditto.
+ (_ksba_encval_kari_to_sexp): New.
+
+ * tests/t-cms-parser.c (one_file): Print the enc-val.
+
+ * tests/samples/ecdh-sample1.p7m: New sample.
+ * tests/samples/ecdh-sample1.p7m.asn: And a dump with some comments.
+
+ Extend the parser to better handle CHOICE elements.
+ + commit d07733cf94a255ae804f1964e0fd769f2b337965
+ * src/asn1-func.c (find_node): Support '+' operator.
+ * src/ber-decoder.c (find_anchor_node): Support CHOICE tag.
+ (decoder_next): Set the outer sequence length also for context tags.
+
+2020-04-14 Werner Koch <wk@gnupg.org>
+
+ Allow for Null hash algo parameters on rsaPSS and add pss flag.
+ + commit 17a09f41fc4b26b7af839be2b9666c94e5a22097
+ * src/ber-help.c (_ksba_parse_optional_null): New.
+ * src/ber-help.h (parse_optional_null): New macro.
+ * src/crl.c (ksba_crl_get_sig_val): Insert a "pss" flag.
+ * src/keyinfo.c (cryptval_to_sexp): Ditto.
+ (_ksba_keyinfo_get_pss_info): Allow for NULL parameter.
+
+2020-04-09 Werner Koch <wk@gnupg.org>
+
+ Support rsaPSS also for CRLs.
+ + commit e6e9858970ed37f4d1b82b63868f2f855b4509fe
+ * src/crl.c: Include stringbuf.h
+ (ksba_crl_get_sig_val): Extend to return PSS parameter.
+
+ * tests/t-crl-parser.c (one_file): Print parameter.
+
+ Refactor PSS parameter parsing.
+ + commit 5c08d7ea8e0f6945082c1c6947aa333b6d36d789
+ * src/keyinfo.c (cryptval_to_sexp): Move pssRSA parser to ...
+ (_ksba_keyinfo_get_pss_info): new.
+
+ Merge copies of stringbuf functions into one new header.
+ + commit 641fc8b6deac2262978c5212fd0d41b6d0a07277
+ * src/stringbuf.h: New.
+ * src/Makefile.am (libksba_la_SOURCES): Add it.
+ * src/dn.c: Move stringbuf functions to new file.
+ * src/keyinfo.c: Ditto.
+
+2020-04-08 Werner Koch <wk@gnupg.org>
+
+ Add read-only support for rsaPSS.
+ + commit f5695be600abe905476f45808ef7df850d9a4dae
+ * src/ber-help.c (_ksba_parse_context_tag): Minor tweak in the
+ returned error codes.
+ * src/keyinfo.c (SUPPORTED_RSAPSS): New.
+ (pk_algo_table): Add rsaPSS.
+ (sig_algo_table): Add rsaPSS.
+ (put_stringbuf_uint): New.
+ (cryptval_to_sexp): Parse out the rsaPSS parameters.
+
+ Remove duplicated code and make parse wrappers internally available.
+ + commit 152d04749cceeaccf309a3b150000da09aa503b5
+ * src/ber-help.c (_ksba_parse_sequence): New. Code taken from ocsp.c
+ or crl.c and function name prefixed with _ksba_.
+ (_ksba_parse_context_tag): Ditto.
+ (_ksba_parse_enumerated): Ditto.
+ (_ksba_parse_integer): Ditto.
+ (_ksba_parse_octet_string): Ditto.
+ (_ksba_parse_optional_boolean): Ditto.
+ (_ksba_parse_object_id_into_str): Ditto.
+ (_ksba_parse_asntime_into_isotime): Ditto.
+ * src/ber-help.h: Add new prototypes and macros fro easier use.
+ (parse_skip): Moved from ocsp.c and crl.c as inline to here.
+ * src/crl.c: Remove parse fucntions.
+ * src/ocsp.c: Remove parse fucntions.
+
+ * src/Makefile.am (ber_dump_SOURCES): Add time.c
+
+2020-04-03 Werner Koch <wk@gnupg.org>
+
+ Very minor patch cleanup.
+ + commit 1119068b2e9f3bc1555dcc78fa54716733470b01
+ * src/keyinfo.c (pkalgo_t): Remove trailing comma
+
+2020-03-31 NIIBE Yutaka <gniibe@fsij.org>
+
+ ecc: Add Ed25519 and Ed448 public key support.
+ + commit 2625e13bc9d5ed1292eacba38683e5f3b1371237
+ * src/keyinfo.c (PKALGO_ED25519, PKALGO_ED448): New.
+ (PKALGO_X25519, PKALGO_X448): New for future.
+ (pk_algo_table): Add
+ (sig_algo_table): New entries for Ed25519 and Ed448 for future.
+ (_ksba_keyinfo_from_sexp): Add handling for Ed25519 and Ed448.
+
+2020-03-30 Werner Koch <wk@gnupg.org>
+
+ Allow optional elements in keyinfo objects.
+ + commit 1e903fe558bd6583c5447fbebe2ef019229dbfdc
+ * src/keyinfo.c (_ksba_keyinfo_from_sexp): Allow for optiona elements.
+ (_ksba_algoinfo_from_sexp): Ditto.
+
+2020-01-21 Werner Koch <wk@gnupg.org>
+
+ tests: Implement option --to-str for t-dn-parser.
+ + commit bf52cfb8f2b624fb4e24b4bc1089f74429b70b5a
+ * tests/t-dnparser.c (main): Implement option.
+
+2019-08-20 NIIBE Yutaka <gniibe@fsij.org>
+
+ pkgconfig: Fix ksba.pc.
+ + commit 3df0cd32e3b21b7da96a93d1f84d6cb6a77b89be
+ * src/ksba.pc.in (Cflags, Libs): Have flags.
+
+2019-07-22 NIIBE Yutaka <gniibe@fsij.org>
+
+ build: Use {CFLAGS,CPPFLAGS,LDFLAGS}_FOR_BUILD for helper program.
+ + commit b92ec7f502d9a1107ac69dacce9ff684f5ae1c07
+ * src/Makefile.am: Add {CFLAGS,CPPFLAGS,LDFLAGS}_FOR_BUILD for
+ asn1-gentables.
+
+2019-04-26 Werner Koch <wk@gnupg.org>
+
+ Add support for authenticode signing.
+ + commit 1f0afa452e1276c98c2932e7247e36e0d74cc306
+ * src/cms.c (content_handlers): Add KSBA_CT_SPC_IND_DATA_CTX.
+
+ Add constants KSBA_VERSION and KSBA_VERSION_NUMBER.
+ + commit 158539fd0c82522665fc4be86ba32f7f8553bc9b
+ * src/ksba.h: Rename to ...
+ * src/ksba.h.in: this.
+ (KSBA_VERSION, KSBA_VERSION_NUMBER): New.
+ * configure.ac (VERSION_NUMBER): Set it.
+ (AC_CONFIG_FILES): Add ksba.h
+
+2019-03-06 NIIBE Yutaka <gniibe@fsij.org>
+
+ Update libgcrypt.m4.
+ + commit 09a4cfae14397605bb32ddd4449b47d32e5090ab
+ * m4/libgcrypt.m4: Update from libgcrypt master.
+
+2019-02-27 NIIBE Yutaka <gniibe@fsij.org>
+
+ Revert wrong fix for ECDSA.
+ + commit f37361f86d2228aa5c5b09db188b8c6ba33cc435
+ * src/certreq.c (ksba_certreq_set_sig_val): Add back MSB handling of
+ 0x80 for ECDSA.
+
+ Don't remove leading zero byte.
+ + commit 9fea74575085352daec89b64bd36db5df9a05fb8
+ * src/cms.c (ksba_cms_set_sig_val): Don't remove leading zero byte.
+ (ksba_cms_set_enc_val): Likewise.
+ * src/certreq.c (ksba_certreq_set_sig_val): Likewise for RSA.
+
+2019-02-26 NIIBE Yutaka <gniibe@fsij.org>
+
+ Fixing ECDSA, support EdDSA signatures in CSRs.
+ + commit 5d9278f3d13050eddd68d8a1c490274a4f631f5f
+ * src/certreq.c (ksba_certreq_set_sig_val): Remove MSB handling of
+ 0x80 for ECDSA, because it is done by GnuPG.
+
+ Distinguishing EdDSA signature in libgcrypt format, make a signature
+ simply concatinate r and s.
+
+2019-02-14 Damien Goutte-Gattat via Gnupg-devel <gnupg-devel@gnupg.org>
+
+ Support multi-valued signatures in CSRs.
+ + commit 98882064f45778927d38c6fdbe008f5858b36813
+ * src/certreq.c (ksba_certreq_set_sig_val): Support signatures
+ made of several values.
+
+2019-01-16 NIIBE Yutaka <gniibe@fsij.org>
+
+ build: With LD_LIBRARY_PATH defined, use --disable-new-dtags.
+ + commit 3f99f332ada603468eb30d77649c4fdf84b383e6
+ * configure.ac (LDADD_FOR_TESTS_KLUDGE): New for --disable-new-dtags.
+ * tests/Makefile.am (LDADD): Use LDADD_FOR_TESTS_KLUDGE.
+
+2018-11-13 NIIBE Yutaka <gniibe@fsij.org>
+
+ build: Update autogen.rc.
+ + commit c37cdbd0f1b4a682799e0661178e392227cca938
+ * autogen.rc: Remove obsolete --with-gpg-error-prefix option.
+
+2018-11-08 NIIBE Yutaka <gniibe@fsij.org>
+
+ Add annotation for fall through path.
+ + commit 3f5dcb5ff6721b0c70c8b0e320e4fd58f1c2cada
+ * src/ber-decoder.c (decoder_next): Add FALLTHROUGH.
+
+2018-11-02 NIIBE Yutaka <gniibe@fsij.org>
+
+ build: Update gpg-error.m4 and ksba.m4.
+ + commit 5a7c0d8667ceddf7820131865dad0ab850e5c3a4
+ * m4/gpg-error.m4: Update to 2018-11-02.
+ * src/ksba.m4: Add AC_MSG_NOTICE.
+
+2018-10-29 NIIBE Yutaka <gniibe@fsij.org>
+
+ build: Update gpg-error.m4 and ksba.m4.
+ + commit 9917a23a6c8177f79bdd8da031d3b7135b597c91
+ * m4/gpg-error.m4: Update to 2018-10-29.
+ * src/ksba.m4: Follow the change of gpgrt-config.
+
+2018-10-26 NIIBE Yutaka <gniibe@fsij.org>
+
+ ksba.m4: Fix calling by gpgrt-config.
+ + commit 825a4a9e93655b136dd2eee685e0e67aca912a01
+ * src/ksba.m4: Fix condition and use "ksba" for *.pc.
+
+ ksba.m4: Better backward compatibility.
+ + commit d3fdae7a299a0514b90dbb7f45a0d08ee5d93078
+ * m4/gpg-error.m4: Update.
+ * src/ksba.m4: Don't assume ksba-config is newer.
+ Fix KSBA_CONFIG which used LIBKSBA_CONFIG wrongly.
+
+ build: Fix ksba.m4.
+ + commit 910c148825d50798689998ed760b658f2aeeee64
+ * src/ksba.m4: Use AC_PATH_PROG to detect ksba-config.
+
+ build: Improve ksba.m4.
+ + commit f0116c07d0d89fc7114dedeb3fc638ab9dae2254
+ * src/ksba.m4: Don't try gpgrt-config when LIBKSBA_CONFIG set. Fall
+ back to detecting ksba-config, when gpgrt-config doesn't work well.
+
+ build: Relax build requirements.
+ + commit a32a50c7726ee7c6ac320d99b9ab42f073960cc9
+ * m4/gpg-error.m4: Update from libgpg-error 1.33.
+ * src/ksba.m4: Don't require AM_PATH_GPG_ERROR. Use GPGRT_CONFIG when
+ it is confirmed that it is available and working well.
+ * configure.ac (AM_PATH_GPG_ERROR): No requirement for newer version
+ (It was because of new gpgrt-config which supports *.pc files).
+
+2018-10-25 NIIBE Yutaka <gniibe@fsij.org>
+
+ build: Require libgpg-error >= 1.33.
+ + commit 07cf4a9ab6f1a7b68aeda39ba03691e713254418
+ * configure.ac (NEED_GPG_ERROR_VERSION): Require >= 1.33.
+ * m4/gpg-error.m4: Update from libgpg-error 1.33.
+ * src/ksba.m4: Fix to support --with-libksba-prefix.
+
+2018-10-24 NIIBE Yutaka <gniibe@fsij.org>
+
+ build: Fix ksba.pc.
+ + commit 4754816d10a38ebe97acd2f3bfaa835055566696
+ * src/ksba.pc.in: Fix typo.
+
+ build: Fix previous commit.
+ + commit 5a21f7465ca2aadfb3877a53f6536859b6973463
+
+
+ build: Compatibility to pkg-config.
+ + commit dfc3ad5c6e97cc11de4faa19de59203ae8d5eb1a
+ * src/ksba-config.in: Support --variable and --modversion.
+
+ build: Make ksba.m4 use gpg-error-config.
+ + commit ce5247c0f3fcbe8a1e70c33ab4c83d807aecce63
+ * src/ksba.m4: Use gpg-error-config.
+
+ build: Provide libassuan.pc, generated by configure.
+ + commit d0016a76942eb58748182ad282c03d5cd7a0dc86
+ * configure.ac (PACKAGE, VERSION): Remove.
+ Generate src/ksba.pc.
+ * src/Makefile.am (pkgconfigdir, pkgconfig_DATA): New.
+ * src/ksba-config.in: Use @PACKAGE_VERSION@.
+ * src/ksba.pc.in: New.
+
+ build: Update gpg-error.m4 from libgpg-error.
+ + commit ec4e838ca91849b493f7ea77074e4415ed6a2d4a
+ * m4/gpg-error.m4: Update from libgpg-error 1.33.
+
+2018-10-23 Werner Koch <wk@gnupg.org>
+
+ Fix error detection in the CMS parser which may led to a NULL-deref.
+ + commit a1ce3c17ee0d44ba8c7c9553824ba55b7950e930
+ * src/cms.c (build_signed_data_rest): Fix c+p bug.
+
+ Use only one .PHONY target in a Makefile.
+ + commit d56bddc68db86878e1b3497362407c994c2841ca
+ * Makefile.am (.PHONY): Move to the end.
+
+ Fix test for existence of the signing_time.
+ + commit a0bbba1c49286f09c5f2eb3cd788938fac2ed252
+ * src/cms.c (build_signed_data_attributes): Fix test.
+
+2017-08-22 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
+
+ Fix make distcheck.
+ + commit af99234b21c98ad1a4eaf2b72fb52de67beba9d3
+ * configure.ac: Revert last change and define HAVE_GCOV if not
+ in maintainer mode.
+ * tests/detached-sig.csm: New file.
+ * tests/Makefile.am (EXTRA_DIST): Add detached-sig.csm.
+ * tests/t-cms-parser.c (main): Use detached-sig.csm as test file.
+
+2017-08-18 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
+
+ Fix non-maintainer build.
+ + commit 457d2f0c6a1fea394de6d48afb1c1c0189c52878
+ * configure.ac: Always check for gcov program to make sure
+ the automake variable is defined.
+
+ Fix all compiler warnings.
+ + commit 982faa2c354a2d23ffd4a0bad584e145faf809bc
+ * src/asn1-parse.y (import_defs, identifier_list): Comment out unused part
+ of the grammar that causes a shift-reduce conflict.
+ * src/cms-parser.c (_ksba_cms_parse_enveloped_data_part_1): Initialize
+ some variables to help suppress uninitialized use warning.
+ * src/crl.c (oidstr_issuingDistributionPoint): Comment out unused OID.
+ * src/gen-help.h (ksba_asn_parse_file, ksba_asn_tree_dump): Add declarations.
+
+2017-08-15 Kai Michaelis <kai@gnupg.org>
+
+ Fix memory leaks in ksba_cms_identify and tests.
+ + commit a1d9b046aec8cedda16a9e24eb8d2ed021f68d5d
+ * tests/t-reader.c: free prepend_srcdir() result.
+ * tests/t-cms-parser: ditto & release writer instance.
+ * src/cms.c: fix mem leak in ksba_cms_identify().
+
+2017-08-10 Kai Michaelis <kai@gnupg.org>
+
+ Enable CMS parser test.
+ + commit 39e633d6d224cafa83d884865ac4e372709d91b7
+ * tests/Makefile.am: add t-cms-parser to the list of tests.
+ * tests/t-cms-parser.c: change default test file to something that
+ exists.
+
+ Generate coverage information.
+ + commit 3e029a4ed0059116febe05924a14009ca622e3c5
+ * autogen.sh: add options --coverage and --report to help w/ coverage
+ info collection and reporting.
+ * m4/gcov.m4: new file. Boilerplate for locating gcov et.al.
+ * Makefile.am: add coverage-report target
+
+ GnuPG-Bud-Id: 3050
+
+2017-08-09 Kai Michaelis <kai@gnupg.org>
+
+ Add missing include.
+ + commit ad36a28e3a0580c1a9547843c03e1af172681efc
+ * src/reader.c: include unistd.h
+
+ Don't use decls in for-loop headers.
+ + commit 707862ab44fb6cca79dacbf866a7066d941b92fc
+ libksba compiles w/ C90
+
+ Add missing fd support to ksba_reader_t.
+ + commit c7f4ef5b5ebc8d6be2c56f14da999a36735a2eba
+ * src/reader.c: add branches for READER_TYPE_FD
+ * tests/t-reader.c: tests for above
+
+2017-06-19 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
+
+ configure: Add flag to disable documentation build.
+ + commit ab23f39a91b5c16eda2d9d581f9bf2ab2da39cf2
+ * configure.ac: Add new option --disable-doc.
+ (BUILD_DOC): New automake conditional.
+ * Makefile.am (SUBDIRS): Make doc optional based on BUILD_DOC.
+ (DISTCHECK_CONFIGURE_FLAGS): New variable.
+
+ Signed-Off-By: Marcus Brinkmann <mb@g10code.com>
+
+2017-04-20 Andre Heinecke <aheinecke@intevation.de>
+
+ tests: Open testfile in binary mode.
+ + commit 3bb0c54fe47eb72e1e7be93de8775b37045de34d
+ * tests/t-crl-parser.c (one_file): Read file in binary mode.
+
+2017-03-08 Justus Winter <justus@g10code.com>
+
+ build: Use macOS' compatibility macros to enable all features.
+ + commit 561d03a008150c201ece22b29c97b24a1f6bf590
+ * configure.ac: On macOS, use the compatibility macros to expose every
+ feature of the libc. This is the equivalent of _GNU_SOURCE on GNU
+ libc.
+
+2016-10-14 Werner Koch <wk@gnupg.org>
+
+ Let configure print a note if Yacc is not Bison.
+ + commit 100ed5092aec0afe16ca7a4fe660602745e92a36
+ * m4/ax_prog_bison.m4: New.
+ * m4/Makefile.am (EXTRA_DIST): Add it.
+ * configure.ac: Test for Bison and print a note.
+
2016-08-22 Werner Koch <wk@gnupg.org>
Release 1.3.5.
+ + commit 25cc42cf61a56e01f1bd72883e452f691dda8309
* configure.ac: Set LT version to C19/A/11/R6.
Use size_t for the result of fread.
+ + commit 68fba3d8d7757b7f7ed75fdebd2b91299943503b
* src/reader.c (ksba_reader_read): Make 'n' and size_t.
Limit allocation in the BER decoder to 16 MiB.
+ + commit 89d898346b75337ec2546c672ea720c5c956b53a
* src/ber-decoder.c (MAX_IMAGE_LENGTH): New.
(decoder_next): Limit allcoation to MAX_IMAGE_LENGTH.
(_ksba_ber_decoder_dump, _ksba_ber_decoder_decode): Ditto.
@@ -14,6 +581,7 @@
2016-07-17 Tomáš Trnka <tomastrnka@gmx.com>
Encode OCSP nonce value as an octet string (RFC 6960)
+ + commit eb7833b8720cd0831c78d42e993ca878cecf27bc
* src/ocsp.c (ksba_ocsp_set_nonce): Stop removing the sign bit.
(write_request_extensions): Encode nonce as octet string.
(parse_response_extensions): Decode nonce as octet string.
@@ -21,15 +589,18 @@
2016-07-13 Werner Koch <wk@gnupg.org>
build: Update config.{guess,sub} to {2016-05-15,2016-06-20}.
+ + commit ee203f948a6573809672d9e61177145a13b3987d
* build-aux/config.guess: Update.
* build-aux/config.sub: Update.
2016-06-27 Werner Koch <wk@gnupg.org>
tests: Fix a memory leak.
+ + commit 995d2e34932143cc9888db779cb3ecd92ae6e32e
* tests/t-oid.c (test_oid_to_str): Free STR.
Use modern error macros and fix a missing assignment.
+ + commit b60e5140f85fc00cd131ab635d4202693759abe1
* src/ocsp.c: Remove errno.h. Replace gpg_error_from_errno(errno) by
gpg_error_from_syserror ().
(parse_response): Ditto. Return direct becuase static analyzer may
@@ -37,41 +608,50 @@
(ksba_ocsp_get_responder_id): Actually return an error for NO_DATA.
Detect invalid RDN names and avoid a read from uninitialized variable.
+ + commit 7243a3c6ed1635eef45b567b37a025e4a5e0dc51
* src/dn.c (parse_rdn): Bail out for an invalid name.
2016-05-25 Werner Koch <wk@gnupg.org>
Pascal Cuoq <cuoq@trust-in-soft.com>
Fix OOB read in parse_distribution_point.
+ + commit 43f890f37b514757db5653608ec59b5a74e8e092
* src/cert.c (parse_distribution_point): Check TI.length.
2016-05-11 Werner Koch <wk@gnupg.org>
Make sure that ASN.1 data is stored in an all-initialized buffer.
+ + commit 2a9fc5654df497b91ab9b64e946c1e19371888e5
* src/ber-decoder.c (decoder_next): Clear the image buffer.
2016-05-03 Werner Koch <wk@gnupg.org>
Release 1.3.4.
+ + commit 3a92e8c8939767d19aaa48f051d721d582ab0eff
* configure.ac: Set LT version to C19/A11/R5.
Update config.{guess,sub} to 2016-04-02 and 2016-03-30.
+ + commit 8290fabdb260e228c3b89706c88caf90da77358b
* build-aux/config.guess: Update.
* build-aux/config.sub: Update.
Create an SWDB file during "make distcheck"
+ + commit ec820ebbb05cbc0d5ee00f086364ecaf3efa54cb
* Makefile.am (distcheck-hook): New.
Fix an undefined return value in ksba_cert_get_digest_algo.
+ + commit 3f74c2cc0068d0b3584627af73c8c42ce720a826
* src/cert.c (ksba_cert_get_digest_algo): Set ALGO in the error case.
* tests/cert-basic.c (one_file): Take care of printf which does not
handle NULL for %s
Fix an OOB read access in _ksba_dn_to_str.
+ + commit 6be61daac047d8e6aa941eb103f8e71a1d4e3c75
* src/dn.c (append_utf8_value): Use a straightforward check to fix an
off-by-one.
Fix possible read access beyond the buffer.
+ + commit a7eed17a0b2a1c09ef986f3b4b323cd31cea2b64
* src/ber-help.c (_ksba_ber_parse_tl): Add extra sanity check.
* src/cert.c (ksba_cert_get_cert_policies): Check TLV given length
against buffer length.
@@ -81,31 +661,38 @@
2015-10-28 Werner Koch <wk@gnupg.org>
Add more curves to the name->OID table.
+ + commit 3d968bbffc3a0acda890e342fbbfa5b34a26085e
* src/keyinfo.c (curve_names): Add more curves.
Fix lookup of ECC OIDs by name.
+ + commit 9df0ac3a4afa0272dbff08d17e9064f13be95814
* src/keyinfo.c (get_ecc_curve_oid): Fix obviously never tested table
lookup.
2015-08-25 Werner Koch <wk@gnupg.org>
Add configure option --enable-build-timestamp.
+ + commit 538188812ace9594aad92a9b0f73b75e5ffc4526
* configure.ac (BUILD_TIMESTAMP): Set to "<none>" by default. Add
ac_define_unquoted.
2015-04-10 Werner Koch <wk@gnupg.org>
Release 1.3.3.
+ + commit b46ea28e82d67a2072817294115360fd3e1ab20c
+
2015-04-09 Werner Koch <wk@gnupg.org>
Do not abort on decoder stack overflow.
+ + commit 07116a314f4dcd4d96990bbd74db95a03a9f650a
* src/ber-decoder.c (push_decoder_state, pop_decoder_state): Return an
error code.
(set_error): Prefix error message with "ksba:". Act on new return code.
(decoder_next): Act on new return code.
Fix integer overflow in the BER decoder.
+ + commit aea7b6032865740478ca4b706850a5217f1c3887
* src/ber-decoder.c (ber_decoder_s): Change val.length from int to
size_t.
(sum_a1_a2_gt_b, sum_a1_a2_ge_b): New.
@@ -121,16 +708,19 @@
2015-04-08 Werner Koch <wk@gnupg.org>
Fix encoding of invalid utf-8 strings in dn.c.
+ + commit 243d12fdec66a4360fbb3e307a046b39b5b4ffc3
* src/dn.c (append_quoted, append_atv): Use snprintf.
(append_utf8_value): Fix invalid encoding handling.
2015-01-30 Werner Koch <wk@gnupg.org>
w32: Use -static-libgcc to avoid linking to libgcc_s_sjlj-1.dll.
+ + commit 792f4b36f998beba3515b776e8ca76ecbf20e468
* src/Makefile.am (extra_ltoptions): New.
(libksba_la_LDFLAGS): Use it.
Update ASN.1 grammar for newer Bison versions.
+ + commit 569f3da664de81638bcb322d6e9380f3ff16f70c
* src/asn1-parse.y (YYERROR_VERBOSE): Replace by ...
(%define parse.error.verbose): this.
(YYPARSE_PARM, YYLEX_PARM): Replace by ...
@@ -142,20 +732,24 @@
2015-01-28 Werner Koch <wk@gnupg.org>
Require automake 1.14 and update build-aux files.
+ + commit 32b3a47a358d694332450f9c2487a88aedc46ca7
* Makefile.am (AUTOMAKE_OPTIONS): Move to ...
* configure.ac (AM_INIT_AUTOMAKE: here. Add serial-tests.
2014-11-25 Werner Koch <wk@gnupg.org>
Release 1.3.2.
+ + commit 02079b56b8d0d922bb84981270fafbc36637b417
* configure.ac: Set LT version to C19/A11/R3.
build: Update version number magic.
+ + commit 00ef765bc1aff709e990f9fd984e25aa8e09f482
* autogen.sh: Update from gnupg master.
* configure.ac: Change for new init style. Create VERSION.
* Makefile.am (dist-hook): Do no create VERSION
Fix buffer overflow in ksba_oid_to_str.
+ + commit f715b9e156dfa99ae829fc694e5a0abd23ef97d7
* src/oid.c (ksba_oid_to_str): Fix unsigned underflow.
* tests/Makefile.am (noinst_PROGRAMS): Move t-oid to ..
@@ -167,56 +761,69 @@
2014-09-25 Werner Koch <wk@gnupg.org>
Strip CRs while building the oid translation table.
+ + commit 6692de1398629061d405099bb22e9480475928af
* tests/Makefile.am (oidtranstbl.h): Strip CRs
2014-09-18 Werner Koch <wk@gnupg.org>
Release 1.3.1.
+ + commit 447784c718c817ab8036af7d81ce5a6bbb1f1df0
* configure.ac: Set LT version to C19/A11/R2.
2014-07-22 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Fix two memory leaks in cert-basic test.
+ + commit 4486cb8228eeaefccc800e550cae4cd4701967c1
* tests/cert-basic.c (one_file): always free public key and der2.
Enable optional valgrind for testsuite.
+ + commit 64902148236af8f39397bfaf6b5494b342027948
* configure.ac: Enable gnulib valgrind module.
* gl/m4/gnulib.m4: Enable valgrind module.
* tests/Makefile.am: Enable valgrind as LOG_COMPILER.
* gl/m4/valgrind-tests.m4: New
Fix memory leak in crl parsing code.
+ + commit 42aca4c9e575d44436e82e2e6bad6c967f12f21b
* src/crl.c (store_one_entry_extension): Free memory at oid variable -
otherwise libksba leaks memory on crl parsing.
Adapt mkoidtbl script to newer dumpasn1 database format.
+ + commit 21cf824e1547d94f898946715b525e7d41de5899
* tests/mkoidtbl.awk: optionally parse oid at OID line.
Reuse common test functions in cert-basic test.
+ + commit 70bb73e5da9be83ec170829d7cdab5a1da89d408
* tests/cert-basic.c (xmalloc, print_hex, print_sexp, print_time,
print_dn): Drop.
tests: fix print_sexp and print_sexp_hex functions.
+ + commit ce85db73a9330371d456ccd6a49a8682c31d0ed4
* tests/t-common.h (print_sexp, print_sexp_hex): advance pointer on
closing brace.
tests: Pass -no-install to libtool.
+ + commit 7f9e09611fce8466a98f53c5dfe4bebb398c708f
* tests/Makefile.am: add AM_LDFLAGS = -no-install
2014-04-15 Werner Koch <wk@gnupg.org>
tests: Fix warning about unused var.
+ + commit 5b79ad34ea2d7a86cfe465c81ff6bcd7fc1c06fc
* tests/t-dnparser.c (main): Drop unneeded var INPUTLEN.
Fix possible segv if NULL is passed as cert.
+ + commit 6fd166870237d5b913fb59cb2a4356fed1734efa
* src/cert.c (ksba_cert_get_digest_algo): Fix !cert case.
2014-01-10 Werner Koch <wk@gnupg.org>
Remove cruft.
+ + commit f73e671406eefa96aba98f609cb68a9caae6bb7a
* autogen.rc: Remove cruft.
Use the generic autogen.sh script.
+ + commit 3943ea7f7dd739dc2c259b76a569a46259d47c43
* Makefile.am (EXTRA_DIST): Add autogen.rc.
* autogen.rc: New.
* autogen.sh: Update from current GnuPG.
@@ -235,9 +842,11 @@
2014-01-08 Werner Koch <wk@gnupg.org>
Add --enable-silent-rules stuff.
+ + commit 629c1f0b16b12418711516de3bef5298ab45fe12
* configure.ac: Add AM_SILENT_RULES.
Fix libtool 2.4.2 to correctly detect .def files.
+ + commit a7b75d6e8e8af79eab9ece7a4061ea48eab8a81d
* ltmain.sh (sed_uncomment_deffile): New.
(orig_export_symbols): Uncomment def file before testing for EXPORTS.
* m4/libtool.m4: Do the same for the generated code.
@@ -245,16 +854,19 @@
2013-12-10 David 'Digit' Turner <digit@google.com>
Update libtool to support Android.
+ + commit d69cde444b2a4b106b4d8c6857efe7d5e8ce18fc
* m4/libtool.m4: Add "linux*android*" case. Taken from the libtool
repository.
2013-12-10 Werner Koch <wk@gnupg.org>
Add build support for ppc64le.
+ + commit a34986a19b2d597cfa3fac099abe243ce1a896a5
* config.guess, config.sub: Update to latest version (2013-11-29).
* m4/libtool.m4: Add patches for ppc64le.
Fix duplicate definition of TRUE and FALSE in grammar file.
+ + commit ab3fe5dccd5bd814f9e2db943380b28598f8cb7a
* src/asn1-parse.y (YYPRINT): Define.
(%token-table): Define.
(TRUE,FALSE,BOOLEAN): Prefix these tokens with "ksba_" to avoid name
@@ -266,59 +878,73 @@
2012-11-16 Werner Koch <wk@gnupg.org>
Improve parsing of the GIT revision number.
+ + commit 7b9662f2bf28feb575c4b2b181d88ca61ad43d53
* configure.ac (mmm4_revision): Use git rev-parse.
Fix non-portable use of chmod in autogen.sh.
+ + commit c18bf9d08d95a73192e12580ce5eae3454c07c0d
* autogen.sh: Remove option -c from chmod.
2012-09-27 Werner Koch <wk@gnupg.org>
Release 1.3.0.
+ + commit ea8487406ecafbcf190008b6c8a5c8e7c63ed6b8
* configure.ac: Set LT version to C19/A11/R1.
2012-09-26 Werner Koch <wk@gnupg.org>
Update build helper scripts.
+ + commit 1533a9662128fca669eeb661308939cdc8e5d74b
* config.guess, config.sub: Update to version 2012-07-31.
* ltmain.sh: Update to version 2.4.2.
* install-sh, m4/libtool.m4, m4/ltoptions.m4, m4/ltversion.m4
* m4/lt~obsolete.m4: Update to autoconf 2.69 versions.
Adjust for stricter autoconf requirements.
+ + commit 3e71347052593f4ba3312eb31e932765be1c93ec
* configure.ac: Fix usage of AC_LANG_PROGRAM.
Do not distribute a copy of gitlog-to-changelog.
+ + commit 5d60c0f340584b280762864fc1cb65013c55503d
* Makefile.am (AUTOMAKE_OPTIONS): Do not create a tar.gz.
(gen-ChangeLog): Require an installed gitlog-to-changelog.
* build-aux/gitlog-to-changelog: Remove.
Allow building with w64-mingw32.
+ + commit 3776ae8f4ea642ad6ac0af726e90492e6f82eb5f
* autogen.sh <--build-w32>: Support the w64-mingw32 toolchain. Also
prepare for 64 bit building.
Switch to the new automagic beta numbering scheme.
+ + commit 120d58757d43d10278d4f5ec4126bc18d2ccd28a
* configure.ac: Add all the required m4 magic.
Change library license to LGPLv3+/GPLv2+.
+ + commit d4333eefc945750613ac9483a41793b5971e3cfe
* COPYING.GPLv2, COPYING.GPLv3, COPYING.LGPLv3: New.
* COPYING: Replace text by a reference to the new files.
* AUTHORS: Update copyright, license, and maintainer information.
* Makefile.am (EXTRA_DIST): Distribute the new files.
Remove unused or useless files.
+ + commit 9abb7c027e9501012f96393c80607c4ad6a8a38f
* src/asn1-parse.h: Remove empty file.
* src/asn1-parse.y: Do not include asn1-parse.h.
2011-12-06 Werner Koch <wk@gnupg.org>
Allow to set subject and issuer.
+ + commit aa6cbc8332e59ad94b104b51ea59784f17e522f6
* src/certreq.c (ksba_certreq_set_issuer): Do not check the subject.
2011-12-01 Werner Koch <wk@gnupg.org>
Post release updates.
+ + commit 3f957f48388756732b5795b77b65d5ab7c0c8298
+
Generate the ChangeLog from commit logs.
+ + commit 1120a33155aa3246b6aeed2dcd6a1315969c632d
* build-aux/gitlog-to-changelog: New script. Taken from gnulib.
* build-aux/git-log-fix: New file.
* build-aux/git-log-footer: New file.
diff --git a/Makefile.am b/Makefile.am
index f16e128..e8e16bc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,6 +19,7 @@
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4 -I gl/m4
+DISTCHECK_CONFIGURE_FLAGS = --enable-doc
# (A suitable gitlog-to-changelog script can be found in GnuPG master.)
GITLOG_TO_CHANGELOG=gitlog-to-changelog
@@ -36,8 +37,13 @@ else
tests = tests
endif
+if BUILD_DOC
+doc = doc
+else
+doc =
+endif
-SUBDIRS = m4 gl src ${tests} doc
+SUBDIRS = m4 gl src $(tests) $(doc)
dist-hook: gen-ChangeLog
@@ -57,7 +63,6 @@ distcheck-hook:
gen_start_date = 2011-12-01T00:00:00
-.PHONY: gen-ChangeLog
gen-ChangeLog:
if test -d $(top_srcdir)/.git; then \
(cd $(top_srcdir) && \
@@ -73,3 +78,27 @@ gen-ChangeLog:
stowinstall:
$(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/libksba
+
+
+
+# Coverage targets
+if HAVE_GCOV
+
+clean-coverage:
+ @echo Removing old coverage results
+ -find -name '*.gcda' -print | xargs -r rm
+ -find -name '*.gcno' -print | xargs -r rm
+ -rm -rf coverage.info coveragereport
+
+coverage-html: check
+ @echo Collecting coverage data with lcov
+ $(top_srcdir)/autogen.sh --coverage $(LCOV) $(GCOV) $(abs_builddir) \
+ tests src
+ $(top_srcdir)/autogen.sh --report $(LCOV) $(GENHTML) $(abs_builddir) \
+ '*/tests/*' '*/asn1-parse.c' '*/asn1-parse.y'
+
+clean-local: clean-coverage
+
+endif # HAVE_GCOV
+
+.PHONY: gen-ChangeLog clean-coverage coverage-html
diff --git a/Makefile.in b/Makefile.in
index dd54de4..7edc7cd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,7 +32,17 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -96,24 +106,12 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
-DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
- $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/config.h.in COPYING THANKS TODO build-aux/compile \
- build-aux/config.guess build-aux/config.sub build-aux/depcomp \
- build-aux/install-sh build-aux/mdate-sh build-aux/missing \
- mkinstalldirs build-aux/texinfo.tex build-aux/ylwrap \
- build-aux/ltmain.sh $(top_srcdir)/build-aux/compile \
- $(top_srcdir)/build-aux/config.guess \
- $(top_srcdir)/build-aux/config.sub \
- $(top_srcdir)/build-aux/install-sh \
- $(top_srcdir)/build-aux/ltmain.sh \
- $(top_srcdir)/build-aux/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/gl/m4/gnulib.m4 \
$(top_srcdir)/gl/m4/valgrind-tests.m4 \
$(top_srcdir)/m4/autobuild.m4 \
+ $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
$(top_srcdir)/m4/gnupg-typedef.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -121,6 +119,8 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@@ -161,7 +161,7 @@ am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- cscope distdir dist dist-all distcheck
+ cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
# Read a list of newline-separated strings from the standard input,
@@ -184,6 +184,18 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = m4 gl src tests doc
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(top_srcdir)/build-aux/compile \
+ $(top_srcdir)/build-aux/config.guess \
+ $(top_srcdir)/build-aux/config.sub \
+ $(top_srcdir)/build-aux/install-sh \
+ $(top_srcdir)/build-aux/ltmain.sh \
+ $(top_srcdir)/build-aux/missing AUTHORS COPYING ChangeLog \
+ INSTALL NEWS README THANKS TODO build-aux/compile \
+ build-aux/config.guess build-aux/config.sub build-aux/depcomp \
+ build-aux/install-sh build-aux/ltmain.sh build-aux/mdate-sh \
+ build-aux/missing build-aux/texinfo.tex build-aux/ylwrap \
+ mkinstalldirs
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -244,6 +256,8 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_FOR_BUILD = @CC_FOR_BUILD@
CFLAGS = @CFLAGS@
+COVERAGE_CFLAGS = @COVERAGE_CFLAGS@
+COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -258,6 +272,9 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
+GCOV = @GCOV@
+GENHTML = @GENHTML@
+GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@@ -273,7 +290,9 @@ KSBA_CONFIG_API_VERSION = @KSBA_CONFIG_API_VERSION@
KSBA_CONFIG_CFLAGS = @KSBA_CONFIG_CFLAGS@
KSBA_CONFIG_HOST = @KSBA_CONFIG_HOST@
KSBA_CONFIG_LIBS = @KSBA_CONFIG_LIBS@
+LCOV = @LCOV@
LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
LDFLAGS = @LDFLAGS@
LIBKSBA_LT_AGE = @LIBKSBA_LT_AGE@
LIBKSBA_LT_CURRENT = @LIBKSBA_LT_CURRENT@
@@ -308,9 +327,11 @@ RC = @RC@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SHTOOL = @SHTOOL@
STRIP = @STRIP@
VALGRIND = @VALGRIND@
VERSION = @VERSION@
+VERSION_NUMBER = @VERSION_NUMBER@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
@@ -366,6 +387,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4 -I gl/m4
+DISTCHECK_CONFIGURE_FLAGS = --enable-doc
# (A suitable gitlog-to-changelog script can be found in GnuPG master.)
GITLOG_TO_CHANGELOG = gitlog-to-changelog
@@ -377,7 +399,9 @@ EXTRA_DIST = autogen.sh autogen.rc \
@CROSS_COMPILING_FALSE@tests = tests
@CROSS_COMPILING_TRUE@tests =
-SUBDIRS = m4 gl src ${tests} doc
+@BUILD_DOC_FALSE@doc =
+@BUILD_DOC_TRUE@doc = doc
+SUBDIRS = m4 gl src $(tests) $(doc)
gen_start_date = 2011-12-01T00:00:00
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -398,15 +422,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -548,7 +571,10 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -616,7 +642,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
@@ -631,17 +657,17 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@@ -659,7 +685,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@@ -669,24 +695,24 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
&& am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=.. --prefix="$$dc_install_base" \
+ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -774,9 +800,10 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+@HAVE_GCOV_FALSE@clean-local:
clean: clean-recursive
-clean-am: clean-generic clean-libtool mostlyclean-am
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
@@ -848,9 +875,9 @@ uninstall-am:
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
- clean-libtool cscope cscopelist-am ctags ctags-am dist \
- dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
- dist-tarZ dist-xz dist-zip distcheck distclean \
+ clean-libtool clean-local cscope cscopelist-am ctags ctags-am \
+ dist dist-all dist-bzip2 dist-gzip dist-hook dist-lzip \
+ dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
@@ -863,6 +890,8 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
+.PRECIOUS: Makefile
+
dist-hook: gen-ChangeLog
@@ -879,7 +908,6 @@ distcheck-hook:
echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\
esac;\
done ) | tee $(distdir).swdb
-.PHONY: gen-ChangeLog
gen-ChangeLog:
if test -d $(top_srcdir)/.git; then \
(cd $(top_srcdir) && \
@@ -894,6 +922,25 @@ gen-ChangeLog:
stowinstall:
$(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/libksba
+# Coverage targets
+
+@HAVE_GCOV_TRUE@clean-coverage:
+@HAVE_GCOV_TRUE@ @echo Removing old coverage results
+@HAVE_GCOV_TRUE@ -find -name '*.gcda' -print | xargs -r rm
+@HAVE_GCOV_TRUE@ -find -name '*.gcno' -print | xargs -r rm
+@HAVE_GCOV_TRUE@ -rm -rf coverage.info coveragereport
+
+@HAVE_GCOV_TRUE@coverage-html: check
+@HAVE_GCOV_TRUE@ @echo Collecting coverage data with lcov
+@HAVE_GCOV_TRUE@ $(top_srcdir)/autogen.sh --coverage $(LCOV) $(GCOV) $(abs_builddir) \
+@HAVE_GCOV_TRUE@ tests src
+@HAVE_GCOV_TRUE@ $(top_srcdir)/autogen.sh --report $(LCOV) $(GENHTML) $(abs_builddir) \
+@HAVE_GCOV_TRUE@ '*/tests/*' '*/asn1-parse.c' '*/asn1-parse.y'
+
+@HAVE_GCOV_TRUE@clean-local: clean-coverage
+
+.PHONY: gen-ChangeLog clean-coverage coverage-html
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/NEWS b/NEWS
index 22aeead..f4b235f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,60 @@
+Noteworthy changes in version 1.4.0 (2020-05-19) [C20/A12/R0]
+------------------------------------------------
+
+ * Supports ECDSA and EdDSA certificate creation and parsing. [#4896]
+
+ * Supports ECDH enveloped data. [#4920]
+
+ * Supports ECDSA and EdDSA signed data. [#4920]
+
+ * Supports rsaPSS signature verification. [#4538]
+
+ * Supports standard file descriptors in ksba_reader_read. [#3072]
+
+ * New configure flag --disable-doc.
+
+ * Improves supports for reproducible builds. [#4801]
+
+ * Allows for optional elements in keyinfo objects. [#4892]
+
+ * Updates the config and M4 scripts to the latest version.
+
+ * Fixes error detection in the CMS parser. [#4207]
+
+ * Fixes memory leak in ksba_cms_identify.
+
+ * Fixes build warnings on macOS. [#2910]
+
+ * Uses --disable-new-dtags if LD_LIBRARY_PATH is defined. [#4298]
+
+ * New constants KSBA_VERSION and KSBA_VERSION_NUMBER.
+
+ * New API to make creation of DER objects easy.
+
+ * Interface changes relative to the 1.3.5 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ KSBA_VERSION NEW.
+ KSBA_VERSION_NUMBER NEW.
+ KSBA_CT_SPC_IND_DATA_CTX NEW.
+ KSBA_CLASS_* NEW.
+ KSBA_TYPE_* NEW.
+ ksba_der_t NEW.
+ ksba_der_release NEW.
+ ksba_der_builder_new NEW.
+ ksba_der_builder_reset NEW.
+ ksba_der_add_ptr NEW.
+ ksba_der_add_val NEW.
+ ksba_der_add_int NEW.
+ ksba_der_add_oid NEW.
+ ksba_der_add_bts NEW.
+ ksba_der_add_der NEW.
+ ksba_der_add_tag NEW.
+ ksba_der_add_end NEW.
+ ksba_der_builder_get NEW.
+
+ Release-info: https://dev.gnupg.org/T4943
+
+
Noteworthy changes in version 1.3.5 (2016-08-22) [C19/A11/R6]
------------------------------------------------
diff --git a/aclocal.m4 b/aclocal.m4
index 707e195..92f814f 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
+[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.14.1], [],
+m4_if([$1], [1.16.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.16.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -332,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -346,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ AS_CASE([$CONFIG_FILES],
+ [*\'*], [eval set x "$CONFIG_FILES"],
+ [*], [set x $CONFIG_FILES])
shift
- for mf
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
do
# Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
+ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`AS_DIRNAME(["$am_mf"])`
+ am_filepart=`AS_BASENAME(["$am_mf"])`
+ AM_RUN_LOG([cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles]) || am_rc=$?
done
+ if test $am_rc -ne 0; then
+ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. Try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).])
+ fi
+ AS_UNSET([am_dirpart])
+ AS_UNSET([am_filepart])
+ AS_UNSET([am_mf])
+ AS_UNSET([am_rc])
+ rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@@ -397,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -495,11 +485,11 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -563,7 +553,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -573,6 +563,9 @@ END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
@@ -602,7 +595,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -613,7 +606,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -623,7 +616,7 @@ if test x"${install_sh}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -645,7 +638,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -680,7 +673,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -688,49 +681,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# AM_MAKE_INCLUDE()
# -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
am__doit:
- @echo this is the am__doit target
+ @echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+ AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+ ['0:this is the am__doit target'],
+ [AS_CASE([$s],
+ [BSD], [am__include='.include' am__quote='"'],
+ [am__include='include' am__quote=''])])
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -771,7 +757,7 @@ fi
# Obsolete and "removed" macros, that must however still report explicit
# error messages when used, to smooth transition.
#
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -798,7 +784,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -827,7 +813,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -874,7 +860,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -893,7 +879,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -974,7 +960,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1034,7 +1020,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1062,7 +1048,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1081,7 +1067,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1216,6 +1202,8 @@ m4_include([gl/m4/alloca.m4])
m4_include([gl/m4/gnulib.m4])
m4_include([gl/m4/valgrind-tests.m4])
m4_include([m4/autobuild.m4])
+m4_include([m4/ax_prog_bison.m4])
+m4_include([m4/gcov.m4])
m4_include([m4/gnupg-typedef.m4])
m4_include([m4/gpg-error.m4])
m4_include([m4/libtool.m4])
diff --git a/autogen.rc b/autogen.rc
index 850d4e7..396794a 100644
--- a/autogen.rc
+++ b/autogen.rc
@@ -11,15 +11,11 @@ esac
case "$myhost" in
w32)
- configure_opts="
- --with-gpg-error-prefix=@SYSROOT@
- "
+ configure_opts=""
;;
amd64)
- configure_opts="
- --with-gpg-error-prefix=@SYSROOT@
- "
+ configure_opts=""
;;
esac
diff --git a/autogen.sh b/autogen.sh
index 7effd56..3771c58 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -171,6 +171,14 @@ case "$1" in
fatal "**Error**: invalid build option $1"
shift
;;
+ --coverage)
+ myhost="coverage"
+ shift
+ ;;
+ --report)
+ myhost="report"
+ shift
+ ;;
*)
;;
esac
@@ -239,6 +247,62 @@ if [ "$myhost" = "find-version" ]; then
fi
# **** end FIND VERSION ****
+# **** COVERAGE ****
+# This is a helper for the code coverage collection
+# Called
+# ./autogen.sh --coverage lcov gcov [dirs...]
+if [ "$myhost" = "coverage" ]; then
+ LCOV="$1"
+ GCOV="$2"
+ BASE=`realpath "$3"`
+ COVINFO=""
+
+ shift 3
+
+ while [ x"$1" != "x" ]; do
+ P="$1"
+ $LCOV --gcov-tool $GCOV \
+ --base-directory "$BASE"/"$P" \
+ --directory "$P" \
+ --output-file coverage.info.`basename "$P"` \
+ --capture --no-checksum --compat-libtool \
+ --rc lcov_branch_coverage=1
+ COVINFO="$COVINFO -a coverage.info."`basename "$P"`
+ shift
+ done
+
+ $LCOV $COVINFO --base-directory "$BASE" --output-file coverage.info \
+ --no-checksum \
+ --rc lcov_branch_coverage=1
+
+ exit 0
+fi
+# **** end COVERAGE ****
+
+# **** COVERAGE_REPORT ****
+# This is a helper for the code coverage report
+# Called
+# ./autogen.sh --report lcov genhtml [exclude...]
+if [ "$myhost" = "report" ]; then
+ LCOV="$1"
+ GENHTML="$2"
+
+ shift 2
+
+ while [ x"$1" != "x" ]; do
+ P="$1"
+ $LCOV --remove coverage.info "$P" -o coverage.info \
+ --rc lcov_branch_coverage=1
+ shift
+ done
+
+ LANG=C $GENHTML --output-directory coveragereport --title "Code Coverage" \
+ --legend --show-details coverage.info \
+ --rc lcov_branch_coverage=1
+
+ exit 0
+fi
+# **** end COVERAGE_REPORT ****
if [ ! -f "$tsdir/build-aux/config.guess" ]; then
fatal "$tsdir/build-aux/config.guess not found"
diff --git a/config.h.in b/config.h.in
index 0c418ee..c89d72d 100644
--- a/config.h.in
+++ b/config.h.in
@@ -103,7 +103,7 @@
*/
#undef LT_OBJDIR
-/* Name of this package */
+/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
@@ -163,7 +163,7 @@
#endif
-/* Version of this package */
+/* Version number of package */
#undef VERSION
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
@@ -178,6 +178,9 @@
# endif
#endif
+/* Expose all libc features (__DARWIN_C_FULL). */
+#undef _DARWIN_C_SOURCE
+
/* Define to 1 if on MINIX. */
#undef _MINIX
diff --git a/configure b/configure
index 8f35533..f632ccb 100755
--- 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 libksba 1.3.5.
+# Generated by GNU Autoconf 2.69 for libksba 1.4.0.
#
# Report bugs to <http://bugs.gnupg.org>.
#
@@ -590,12 +590,12 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libksba'
PACKAGE_TARNAME='libksba'
-PACKAGE_VERSION='1.3.5'
-PACKAGE_STRING='libksba 1.3.5'
+PACKAGE_VERSION='1.4.0'
+PACKAGE_STRING='libksba 1.4.0'
PACKAGE_BUGREPORT='http://bugs.gnupg.org'
PACKAGE_URL=''
-ac_unique_file="src/ksba.h"
+ac_unique_file="src/ksba.h.in"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
@@ -636,6 +636,8 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
+BUILD_DOC_FALSE
+BUILD_DOC_TRUE
BUILD_TIMESTAMP
BUILD_FILEVERSION
BUILD_REVISION
@@ -653,6 +655,7 @@ GPG_ERROR_MT_LIBS
GPG_ERROR_MT_CFLAGS
GPG_ERROR_LIBS
GPG_ERROR_CFLAGS
+GPGRT_CONFIG
GPG_ERROR_CONFIG
HAVE_LD_VERSION_SCRIPT_FALSE
HAVE_LD_VERSION_SCRIPT_TRUE
@@ -661,8 +664,17 @@ HAVE_W32CE_SYSTEM_TRUE
HAVE_W32_SYSTEM_FALSE
HAVE_W32_SYSTEM_TRUE
CC_FOR_BUILD
+COVERAGE_LDFLAGS
+COVERAGE_CFLAGS
+GENHTML
+LCOV
+SHTOOL
+HAVE_GCOV_FALSE
+HAVE_GCOV_TRUE
+GCOV
YFLAGS
YACC
+VERSION_NUMBER
LIBKSBA_LT_REVISION
LIBKSBA_LT_AGE
LIBKSBA_LT_CURRENT
@@ -690,6 +702,7 @@ LIBTOOL
OBJDUMP
DLLTOOL
AS
+LDADD_FOR_TESTS_KLUDGE
EGREP
GREP
CPP
@@ -700,7 +713,6 @@ am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
-am__quote
am__include
DEPDIR
OBJEXT
@@ -782,7 +794,8 @@ PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
ac_subst_files=''
ac_user_opts='
enable_option_checking
@@ -796,12 +809,14 @@ with_gnu_ld
with_sysroot
enable_libtool_lock
enable_maintainer_mode
+enable_gcov
enable_optimization
enable_ld_version_script
with_libgpg_error_prefix
with_gpg_error_prefix
enable_valgrind_tests
enable_build_timestamp
+enable_doc
'
ac_precious_vars='build_alias
host_alias
@@ -1355,7 +1370,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 libksba 1.3.5 to adapt to many kinds of systems.
+\`configure' configures libksba 1.4.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1425,7 +1440,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libksba 1.3.5:";;
+ short | recursive ) echo "Configuration of libksba 1.4.0:";;
esac
cat <<\_ACEOF
@@ -1447,6 +1462,7 @@ Optional Features:
--enable-maintainer-mode
enable make rules and dependencies not useful (and
sometimes confusing) to the casual installer
+ --enable-gcov enable coverage testing with gcov
--disable-optimization disable compiler optimization
--enable-ld-version-script
enable/disable use of linker version script.
@@ -1455,6 +1471,7 @@ Optional Features:
--enable-build-timestamp
set an explicit build timestamp for reproducibility.
(default is the current time in ISO-8601 format)
+ --disable-doc do not build the documentation
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1552,7 +1569,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libksba configure 1.3.5
+libksba configure 1.4.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2158,7 +2175,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 libksba $as_me 1.3.5, which was
+It was created by libksba $as_me 1.4.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2512,9 +2529,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# (Interfaces added: CURRENT++, AGE++, REVISION=0)
# (No interfaces changed: REVISION++)
# Please remember to document interface changes in the NEWS file.
-LIBKSBA_LT_CURRENT=19
-LIBKSBA_LT_AGE=11
-LIBKSBA_LT_REVISION=6
+LIBKSBA_LT_CURRENT=20
+LIBKSBA_LT_AGE=12
+LIBKSBA_LT_REVISION=0
#-------------------
# If the API is changed in an incompatible way: increment the next counter.
KSBA_CONFIG_API_VERSION=1
@@ -2523,9 +2540,6 @@ KSBA_CONFIG_API_VERSION=1
NEED_GPG_ERROR_VERSION=1.8
-PACKAGE=$PACKAGE_NAME
-VERSION=$PACKAGE_VERSION
-
ac_aux_dir=
for ac_dir in build-aux "$srcdir"/build-aux; do
if test -f "$ac_dir/install-sh"; then
@@ -2556,7 +2570,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-am__api_version='1.14'
+am__api_version='1.16'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -2748,7 +2762,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -3042,7 +3056,7 @@ fi
# Define the identity of the package.
PACKAGE='libksba'
- VERSION='1.3.5'
+ VERSION='1.4.0'
cat >>confdefs.h <<_ACEOF
@@ -3072,12 +3086,12 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@@ -3124,7 +3138,7 @@ END
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -3237,45 +3251,45 @@ DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
am__doit:
- @echo this is the am__doit target
+ @echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ case $?:`cat confinc.out 2>/dev/null` in #(
+ '0:this is the am__doit target') :
+ case $s in #(
+ BSD) :
+ am__include='.include' am__quote='"' ;; #(
+ *) :
+ am__include='include' am__quote='' ;;
+esac ;; #(
+ *) :
;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then :
@@ -4733,6 +4747,38 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+# Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE
+case $host in
+ *-*-linux*)
+ if test -n "$LD_LIBRARY_PATH"; then
+ saved_LDFLAGS="$LDFLAGS"
+ LDADD_FOR_TESTS_KLUDGE="-Wl,--disable-new-dtags"
+ LDFLAGS="$LDFLAGS $LDADD_FOR_TESTS_KLUDGE"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --disable-new-dtags is supported by the linker" >&5
+$as_echo_n "checking whether --disable-new-dtags is supported by the linker... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int main (void) { return 0; }
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (use it since LD_LIBRARY_PATH is set)" >&5
+$as_echo "yes (use it since LD_LIBRARY_PATH is set)" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ LDADD_FOR_TESTS_KLUDGE=""
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$saved_LDFLAGS"
+ fi
+ ;;
+esac
+
+
case `pwd` in
*\ * | *\ *)
@@ -12387,17 +12433,9 @@ fi
+VERSION_NUMBER=0x010400
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
@@ -13459,6 +13497,292 @@ fi
done
test -n "$YACC" || YACC="yacc"
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if bison is the parser generator" >&5
+$as_echo_n "checking if bison is the parser generator... " >&6; }
+if ${ax_cv_prog_bison+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if $YACC --version 2>/dev/null | $EGREP -q '^bison '; then :
+ ax_cv_prog_bison=yes
+else
+ ax_cv_prog_bison=no
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_prog_bison" >&5
+$as_echo "$ax_cv_prog_bison" >&6; }
+ if test "$ax_cv_prog_bison" = "yes"; then :
+
+ YACC="${YACC% -y} -o y.tab.c"
+ have_bison=yes
+else
+ have_bison=no
+
+fi
+
+
+if test "$USE_MAINTAINER_MODE" = "yes"; then
+ for ac_prog in gcov
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_GCOV+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$GCOV"; then
+ ac_cv_prog_GCOV="$GCOV" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_GCOV="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+GCOV=$ac_cv_prog_GCOV
+if test -n "$GCOV"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5
+$as_echo "$GCOV" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$GCOV" && break
+done
+test -n "$GCOV" || GCOV="gcov"
+
+ # gcov coverage reporting
+
+ # Check whether --enable-gcov was given.
+if test "${enable_gcov+set}" = set; then :
+ enableval=$enable_gcov; use_gcov=yes
+else
+ use_gcov=no
+fi
+
+
+ if test "x$use_gcov" = "xyes"; then
+ HAVE_GCOV_TRUE=
+ HAVE_GCOV_FALSE='#'
+else
+ HAVE_GCOV_TRUE='#'
+ HAVE_GCOV_FALSE=
+fi
+
+
+ if test "x$use_gcov" = "xyes"; then
+ # we need gcc:
+ if test "$GCC" != "yes"; then
+ as_fn_error $? "GCC is required for --enable-gcov" "$LINENO" 5
+ fi
+
+ # Check if ccache is being used
+ # Extract the first word of "shtool", so it can be a program name with args.
+set dummy shtool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_SHTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$SHTOOL"; then
+ ac_cv_prog_SHTOOL="$SHTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_SHTOOL="shtool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+SHTOOL=$ac_cv_prog_SHTOOL
+if test -n "$SHTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHTOOL" >&5
+$as_echo "$SHTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "$SHTOOL"; then
+ case `$SHTOOL path $CC` in #(
+ *ccache*) :
+ gcc_ccache=yes ;; #(
+ *) :
+ gcc_ccache=no ;;
+esac
+ fi
+
+ if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
+ as_fn_error $? "ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1." "$LINENO" 5
+ fi
+
+ lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13"
+ # Extract the first word of "lcov", so it can be a program name with args.
+set dummy lcov; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LCOV+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LCOV"; then
+ ac_cv_prog_LCOV="$LCOV" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_LCOV="lcov"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LCOV=$ac_cv_prog_LCOV
+if test -n "$LCOV"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5
+$as_echo "$LCOV" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ # Extract the first word of "genhtml", so it can be a program name with args.
+set dummy genhtml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_GENHTML+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$GENHTML"; then
+ ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_GENHTML="genhtml"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+GENHTML=$ac_cv_prog_GENHTML
+if test -n "$GENHTML"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5
+$as_echo "$GENHTML" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+ if test "$LCOV"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lcov version" >&5
+$as_echo_n "checking for lcov version... " >&6; }
+if ${glib_cv_lcov_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ glib_cv_lcov_version=invalid
+ lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
+ for lcov_check_version in $lcov_version_list; do
+ if test "$lcov_version" = "$lcov_check_version"; then
+ glib_cv_lcov_version="$lcov_check_version (ok)"
+ fi
+ done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_lcov_version" >&5
+$as_echo "$glib_cv_lcov_version" >&6; }
+ else
+ lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
+ as_fn_error $? "$lcov_msg" "$LINENO" 5
+ fi
+
+ case $glib_cv_lcov_version in
+ ""|invalid)
+ lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
+ as_fn_error $? "$lcov_msg" "$LINENO" 5
+ LCOV="exit 0;"
+ ;;
+ esac
+
+ if test -z "$GENHTML"; then
+ as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5
+ fi
+
+ # Remove all optimization flags from CFLAGS
+
+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+ CPPFLAGS=`echo "$CPPFLAGS" | $SED -e 's/-O[0-9]*//g'`
+
+
+ # Add the special gcc flags
+ COVERAGE_CFLAGS="--coverage -DDEBUG"
+ COVERAGE_CXXFLAGS="--coverage -DDEBUG"
+ COVERAGE_LDFLAGS="--coverage -lgcov"
+
+fi
+
+
+
+else
+ if false; then
+ HAVE_GCOV_TRUE=
+ HAVE_GCOV_FALSE='#'
+else
+ HAVE_GCOV_TRUE='#'
+ HAVE_GCOV_FALSE=
+fi
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
$as_echo_n "checking for inline... " >&6; }
if ${ac_cv_c_inline+:} false; then :
@@ -13661,6 +13985,11 @@ case "${host}" in
*-*-mingw32*)
have_w32_system=yes
;;
+ *-apple-darwin*)
+
+$as_echo "#define _DARWIN_C_SOURCE 900000L" >>confdefs.h
+
+ ;;
*)
;;
esac
@@ -13929,16 +14258,95 @@ fi
min_gpg_error_version="$NEED_GPG_ERROR_VERSION"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPG Error - version >= $min_gpg_error_version" >&5
-$as_echo_n "checking for GPG Error - version >= $min_gpg_error_version... " >&6; }
ok=no
- if test "$GPG_ERROR_CONFIG" != "no" \
- && test -f "$GPG_ERROR_CONFIG" ; then
+
+ if test "$prefix" = NONE ; then
+ prefix_option_expanded=/usr/local
+ else
+ prefix_option_expanded="$prefix"
+ fi
+ if test "$exec_prefix" = NONE ; then
+ exec_prefix_option_expanded=$prefix_option_expanded
+ else
+ exec_prefix_option_expanded=$(prefix=$prefix_option_expanded eval echo $exec_prefix)
+ fi
+ libdir_option_expanded=$(prefix=$prefix_option_expanded exec_prefix=$exec_prefix_option_expanded eval echo $libdir)
+
+ if test -f $libdir_option_expanded/pkgconfig/gpg-error.pc; then
+ gpgrt_libdir=$libdir_option_expanded
+ else
+ if crt1_path=$(${CC:-cc} -print-file-name=crt1.o 2>/dev/null); then
+ if possible_libdir=$(cd ${crt1_path%/*} && pwd 2>/dev/null); then
+ if test -f $possible_libdir/pkgconfig/gpg-error.pc; then
+ gpgrt_libdir=$possible_libdir
+ fi
+ fi
+ fi
+ fi
+
+ if test "$GPG_ERROR_CONFIG" = "no" -a -n "$gpgrt_libdir"; then
+ # Extract the first word of "gpgrt-config", so it can be a program name with args.
+set dummy gpgrt-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GPGRT_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GPGRT_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GPGRT_CONFIG="$GPGRT_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GPGRT_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_GPGRT_CONFIG" && ac_cv_path_GPGRT_CONFIG="no"
+ ;;
+esac
+fi
+GPGRT_CONFIG=$ac_cv_path_GPGRT_CONFIG
+if test -n "$GPGRT_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPGRT_CONFIG" >&5
+$as_echo "$GPGRT_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "$GPGRT_CONFIG" = "no"; then
+ unset GPGRT_CONFIG
+ else
+ GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
+ if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then
+ GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Use gpgrt-config with $gpgrt_libdir as gpg-error-config" >&5
+$as_echo "$as_me: Use gpgrt-config with $gpgrt_libdir as gpg-error-config" >&6;}
+ gpg_error_config_version=`$GPG_ERROR_CONFIG --modversion`
+ else
+ unset GPGRT_CONFIG
+ fi
+ fi
+ else
+ gpg_error_config_version=`$GPG_ERROR_CONFIG --version`
+ fi
+ if test "$GPG_ERROR_CONFIG" != "no"; then
req_major=`echo $min_gpg_error_version | \
sed 's/\([0-9]*\)\.\([0-9]*\)/\1/'`
req_minor=`echo $min_gpg_error_version | \
sed 's/\([0-9]*\)\.\([0-9]*\)/\2/'`
- gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
major=`echo $gpg_error_config_version | \
sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'`
minor=`echo $gpg_error_config_version | \
@@ -13952,32 +14360,102 @@ $as_echo_n "checking for GPG Error - version >= $min_gpg_error_version... " >&6;
fi
fi
fi
+ if test -z "$GPGRT_CONFIG" -a -n "$gpgrt_libdir"; then
+ if test "$major" -gt 1 -o "$major" -eq 1 -a "$minor" -ge 33; then
+ # Extract the first word of "gpgrt-config", so it can be a program name with args.
+set dummy gpgrt-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GPGRT_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GPGRT_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GPGRT_CONFIG="$GPGRT_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GPGRT_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_GPGRT_CONFIG" && ac_cv_path_GPGRT_CONFIG="no"
+ ;;
+esac
+fi
+GPGRT_CONFIG=$ac_cv_path_GPGRT_CONFIG
+if test -n "$GPGRT_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPGRT_CONFIG" >&5
+$as_echo "$GPGRT_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "$GPGRT_CONFIG" = "no"; then
+ unset GPGRT_CONFIG
+ else
+ GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
+ if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then
+ GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Use gpgrt-config with $gpgrt_libdir as gpg-error-config" >&5
+$as_echo "$as_me: Use gpgrt-config with $gpgrt_libdir as gpg-error-config" >&6;}
+ else
+ unset GPGRT_CONFIG
+ fi
+ fi
+ fi
+ fi
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPG Error - version >= $min_gpg_error_version" >&5
+$as_echo_n "checking for GPG Error - version >= $min_gpg_error_version... " >&6; }
if test $ok = yes; then
- GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
- GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
- GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null`
- GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null`
+ GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG --cflags`
+ GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG --libs`
+ if test -z "$GPGRT_CONFIG"; then
+ GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --mt --cflags 2>/dev/null`
+ GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --mt --libs 2>/dev/null`
+ else
+ GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --variable=mtcflags 2>/dev/null`
+ GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS"
+ GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --variable=mtlibs 2>/dev/null`
+ GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS"
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($gpg_error_config_version)" >&5
$as_echo "yes ($gpg_error_config_version)" >&6; }
:
- gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
+ if test -z "$GPGRT_CONFIG"; then
+ gpg_error_config_host=`$GPG_ERROR_CONFIG --host 2>/dev/null || echo none`
+ else
+ gpg_error_config_host=`$GPG_ERROR_CONFIG --variable=host 2>/dev/null || echo none`
+ fi
if test x"$gpg_error_config_host" != xnone ; then
if test x"$gpg_error_config_host" != x"$host" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
***
-*** The config script $GPG_ERROR_CONFIG was
+*** The config script \"$GPG_ERROR_CONFIG\" was
*** built for $gpg_error_config_host and thus may not match the
*** used host $host.
-*** You may want to use the configure option --with-gpg-error-prefix
+*** You may want to use the configure option --with-libgpg-error-prefix
*** to specify a matching config script or use \$SYSROOT.
***" >&5
$as_echo "$as_me: WARNING:
***
-*** The config script $GPG_ERROR_CONFIG was
+*** The config script \"$GPG_ERROR_CONFIG\" was
*** built for $gpg_error_config_host and thus may not match the
*** used host $host.
-*** You may want to use the configure option --with-gpg-error-prefix
+*** You may want to use the configure option --with-libgpg-error-prefix
*** to specify a matching config script or use \$SYSROOT.
***" >&2;}
gpg_config_script_warn="$gpg_config_script_warn libgpg-error"
@@ -14900,11 +15378,11 @@ fi
# Generate extended version information for W32.
if test "$have_w32_system" = yes; then
BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
- BUILD_FILEVERSION="${BUILD_FILEVERSION}9676"
+ BUILD_FILEVERSION="${BUILD_FILEVERSION}62223"
fi
-BUILD_REVISION="25cc42c"
+BUILD_REVISION="f30f604"
cat >>confdefs.h <<_ACEOF
@@ -14930,8 +15408,25 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+build_doc=yes
+# Check whether --enable-doc was given.
+if test "${enable_doc+set}" = set; then :
+ enableval=$enable_doc; build_doc=$enableval
+else
+ build_doc=yes
+fi
+
+ if test "x$build_doc" != xno; then
+ BUILD_DOC_TRUE=
+ BUILD_DOC_FALSE='#'
+else
+ BUILD_DOC_TRUE='#'
+ BUILD_DOC_FALSE=
+fi
+
-ac_config_files="$ac_config_files Makefile m4/Makefile gl/Makefile src/Makefile src/ksba-config src/versioninfo.rc tests/Makefile doc/Makefile"
+
+ac_config_files="$ac_config_files Makefile m4/Makefile gl/Makefile src/Makefile src/ksba.h src/ksba-config src/ksba.pc src/versioninfo.rc tests/Makefile doc/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -15073,6 +15568,14 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${HAVE_GCOV_TRUE}" && test -z "${HAVE_GCOV_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_GCOV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_GCOV_TRUE}" && test -z "${HAVE_GCOV_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_GCOV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${HAVE_W32_SYSTEM_TRUE}" && test -z "${HAVE_W32_SYSTEM_FALSE}"; then
as_fn_error $? "conditional \"HAVE_W32_SYSTEM\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15090,6 +15593,10 @@ if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then
as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${BUILD_DOC_TRUE}" && test -z "${BUILD_DOC_FALSE}"; then
+ as_fn_error $? "conditional \"BUILD_DOC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
@@ -15487,7 +15994,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 libksba $as_me 1.3.5, which was
+This file was extended by libksba $as_me 1.4.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15553,7 +16060,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="\\
-libksba config.status 1.3.5
+libksba config.status 1.4.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -15672,7 +16179,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
# The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -16042,7 +16549,9 @@ do
"m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
"gl/Makefile") CONFIG_FILES="$CONFIG_FILES gl/Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "src/ksba.h") CONFIG_FILES="$CONFIG_FILES src/ksba.h" ;;
"src/ksba-config") CONFIG_FILES="$CONFIG_FILES src/ksba-config" ;;
+ "src/ksba.pc") CONFIG_FILES="$CONFIG_FILES src/ksba.pc" ;;
"src/versioninfo.rc") CONFIG_FILES="$CONFIG_FILES src/versioninfo.rc" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
@@ -16645,29 +17154,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ case $CONFIG_FILES in #(
+ *\'*) :
+ eval set x "$CONFIG_FILES" ;; #(
+ *) :
+ set x $CONFIG_FILES ;; #(
+ *) :
+ ;;
+esac
shift
- for mf
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
do
# Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
+ am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$am_mf" : 'X\(//\)[^/]' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -16685,53 +17200,48 @@ $as_echo X"$mf" |
q
}
s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
+ am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
- /^X\(\/\/\)$/{
+ /^X\/\(\/\/\)$/{
s//\1/
q
}
- /^X\(\/\).*/{
+ /^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
+ { echo "$as_me:$LINENO: cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles" >&5
+ (cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } || am_rc=$?
done
+ if test $am_rc -ne 0; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. Try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ { am_dirpart=; unset am_dirpart;}
+ { am_filepart=; unset am_filepart;}
+ { am_mf=; unset am_mf;}
+ { am_rc=; unset am_rc;}
+ rm -f conftest-deps.mk
}
;;
"libtool":C)
@@ -17545,11 +18055,23 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
+if test x"$have_bison" = xno; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}:
+***
+*** Note: The installed yacc version is not GNU Bison. You need
+*** to install Bison if you want to change any grammar (.y) file.
+***" >&5
+$as_echo "$as_me:
+***
+*** Note: The installed yacc version is not GNU Bison. You need
+*** to install Bison if you want to change any grammar (.y) file.
+***" >&6;}
+fi
echo "
Libksba v${VERSION} has been configured as follows:
- Revision: 25cc42c (9676)
+ Revision: f30f604 (62223)
Platform: $host
"
diff --git a/configure.ac b/configure.ac
index e5e8764..46c98e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
# configure.ac - for libksba
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-# 2010, 2011, 2012 g10 Code GmbH
+# 2010, 2011, 2012, 2018, 2019 g10 Code GmbH
#
# This file is part of KSBA
#
@@ -29,8 +29,8 @@ min_automake_version="1.14"
# for the LT versions.
m4_define([mym4_package],[libksba])
m4_define([mym4_major], [1])
-m4_define([mym4_minor], [3])
-m4_define([mym4_micro], [5])
+m4_define([mym4_minor], [4])
+m4_define([mym4_micro], [0])
# Below is m4 magic to extract and compute the git revision number,
# the decimalized short revision number, a beta version string and a
@@ -50,9 +50,9 @@ AC_INIT([mym4_package],[mym4_version], [http://bugs.gnupg.org])
# (Interfaces added: CURRENT++, AGE++, REVISION=0)
# (No interfaces changed: REVISION++)
# Please remember to document interface changes in the NEWS file.
-LIBKSBA_LT_CURRENT=19
-LIBKSBA_LT_AGE=11
-LIBKSBA_LT_REVISION=6
+LIBKSBA_LT_CURRENT=20
+LIBKSBA_LT_AGE=12
+LIBKSBA_LT_REVISION=0
#-------------------
# If the API is changed in an incompatible way: increment the next counter.
KSBA_CONFIG_API_VERSION=1
@@ -61,11 +61,8 @@ KSBA_CONFIG_API_VERSION=1
NEED_GPG_ERROR_VERSION=1.8
-PACKAGE=$PACKAGE_NAME
-VERSION=$PACKAGE_VERSION
-
AC_CONFIG_AUX_DIR([build-aux])
-AC_CONFIG_SRCDIR([src/ksba.h])
+AC_CONFIG_SRCDIR([src/ksba.h.in])
AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
@@ -74,6 +71,41 @@ AB_INIT
AC_GNU_SOURCE
+# Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE
+dnl Under Linux, make sure that the old dtags are used if LD_LIBRARY_PATH
+dnl is defined. The issue is that with the new dtags, LD_LIBRARY_PATH has
+dnl the precedence over the run path, so that if a compatible MPFR library
+dnl is installed in some directory from $LD_LIBRARY_PATH, then the tested
+dnl MPFR library will be this library instead of the MPFR library from the
+dnl build tree. Other OS with the same issue might be added later.
+dnl
+dnl References:
+dnl https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859732
+dnl http://lists.gnu.org/archive/html/libtool/2017-05/msg00000.html
+dnl
+dnl We need to check whether --disable-new-dtags is supported as alternate
+dnl linkers may be used (e.g., with tcc: CC=tcc LD=tcc).
+dnl
+case $host in
+ *-*-linux*)
+ if test -n "$LD_LIBRARY_PATH"; then
+ saved_LDFLAGS="$LDFLAGS"
+ LDADD_FOR_TESTS_KLUDGE="-Wl,--disable-new-dtags"
+ LDFLAGS="$LDFLAGS $LDADD_FOR_TESTS_KLUDGE"
+ AC_MSG_CHECKING(whether --disable-new-dtags is supported by the linker)
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[
+int main (void) { return 0; }
+ ]])],
+ [AC_MSG_RESULT(yes (use it since LD_LIBRARY_PATH is set))],
+ [AC_MSG_RESULT(no)
+ LDADD_FOR_TESTS_KLUDGE=""
+ ])
+ LDFLAGS="$saved_LDFLAGS"
+ fi
+ ;;
+esac
+AC_SUBST([LDADD_FOR_TESTS_KLUDGE])
+
LT_PREREQ([2.2.6])
LT_INIT([win32-dll disable-static])
LT_LANG([Windows Resource])
@@ -84,10 +116,11 @@ AM_MAINTAINER_MODE
AC_SUBST(LIBKSBA_LT_CURRENT)
AC_SUBST(LIBKSBA_LT_AGE)
AC_SUBST(LIBKSBA_LT_REVISION)
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
+
+VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_major \
+ mym4_minor mym4_micro)
+AC_SUBST(VERSION_NUMBER)
+
AH_TOP([
#ifndef _KSBA_CONFIG_H_INCLUDED
@@ -125,6 +158,18 @@ AC_PROG_MAKE_SET
gl_EARLY
#AC_ARG_PROGRAM
AC_PROG_YACC
+AX_PROG_BISON([have_bison=yes],[have_bison=no])
+
+if test "$USE_MAINTAINER_MODE" = "yes"; then
+ AC_CHECK_PROGS(GCOV, [gcov], gcov)
+ # gcov coverage reporting
+ AC_TDD_GCOV
+ AC_SUBST(COVERAGE_CFLAGS)
+ AC_SUBST(COVERAGE_LDFLAGS)
+else
+ AM_CONDITIONAL(HAVE_GCOV, false)
+fi
+
AC_C_INLINE
# We need to compile and run a program on the build machine.
@@ -211,6 +256,10 @@ case "${host}" in
*-*-mingw32*)
have_w32_system=yes
;;
+ *-apple-darwin*)
+ AC_DEFINE(_DARWIN_C_SOURCE, 900000L,
+ Expose all libc features (__DARWIN_C_FULL).)
+ ;;
*)
;;
esac
@@ -406,19 +455,34 @@ AC_SUBST(BUILD_TIMESTAMP)
AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
[The time this package was configured for a build])
+build_doc=yes
+AC_ARG_ENABLE([doc], AC_HELP_STRING([--disable-doc],
+ [do not build the documentation]),
+ build_doc=$enableval, build_doc=yes)
+AM_CONDITIONAL([BUILD_DOC], [test "x$build_doc" != xno])
+
AC_CONFIG_FILES([
Makefile
m4/Makefile
gl/Makefile
src/Makefile
+src/ksba.h
src/ksba-config
+src/ksba.pc
src/versioninfo.rc
tests/Makefile
doc/Makefile
])
AC_OUTPUT
+if test x"$have_bison" = xno; then
+ AC_MSG_NOTICE([[
+***
+*** Note: The installed yacc version is not GNU Bison. You need
+*** to install Bison if you want to change any grammar (.y) file.
+***]])
+fi
echo "
Libksba v${VERSION} has been configured as follows:
diff --git a/doc/Makefile.in b/doc/Makefile.in
index ade040b..3879b97 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,7 +32,17 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -96,15 +106,12 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(ksba_TEXINFOS) $(top_srcdir)/build-aux/mdate-sh \
- $(srcdir)/version.texi $(srcdir)/stamp-vti \
- $(top_srcdir)/build-aux/texinfo.tex
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/gl/m4/gnulib.m4 \
$(top_srcdir)/gl/m4/valgrind-tests.m4 \
$(top_srcdir)/m4/autobuild.m4 \
+ $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
$(top_srcdir)/m4/gnupg-typedef.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -112,6 +119,8 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \
+ $(srcdir)/stamp-vti $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -205,6 +214,9 @@ am__uninstall_files_from_dir = { \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(ksba_TEXINFOS) $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/mdate-sh \
+ $(top_srcdir)/build-aux/texinfo.tex
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
@@ -224,6 +236,8 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_FOR_BUILD = @CC_FOR_BUILD@
CFLAGS = @CFLAGS@
+COVERAGE_CFLAGS = @COVERAGE_CFLAGS@
+COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -238,6 +252,9 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
+GCOV = @GCOV@
+GENHTML = @GENHTML@
+GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@@ -253,7 +270,9 @@ KSBA_CONFIG_API_VERSION = @KSBA_CONFIG_API_VERSION@
KSBA_CONFIG_CFLAGS = @KSBA_CONFIG_CFLAGS@
KSBA_CONFIG_HOST = @KSBA_CONFIG_HOST@
KSBA_CONFIG_LIBS = @KSBA_CONFIG_LIBS@
+LCOV = @LCOV@
LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
LDFLAGS = @LDFLAGS@
LIBKSBA_LT_AGE = @LIBKSBA_LT_AGE@
LIBKSBA_LT_CURRENT = @LIBKSBA_LT_CURRENT@
@@ -288,9 +307,11 @@ RC = @RC@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SHTOOL = @SHTOOL@
STRIP = @STRIP@
VALGRIND = @VALGRIND@
VERSION = @VERSION@
+VERSION_NUMBER = @VERSION_NUMBER@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
@@ -365,14 +386,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -444,15 +464,16 @@ $(srcdir)/stamp-vti: ksba.texi $(top_srcdir)/configure
echo "@set UPDATED $$1 $$2 $$3"; \
echo "@set UPDATED-MONTH $$2 $$3"; \
echo "@set EDITION $(VERSION)"; \
- echo "@set VERSION $(VERSION)") > vti.tmp
- @cmp -s vti.tmp $(srcdir)/version.texi \
- || (echo "Updating $(srcdir)/version.texi"; \
- cp vti.tmp $(srcdir)/version.texi)
- -@rm -f vti.tmp
+ echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
+ (cmp -s vti.tmp$$$$ $(srcdir)/version.texi \
+ || (echo "Updating $(srcdir)/version.texi" && \
+ cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \
+ mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \
+ rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$
@cp $(srcdir)/version.texi $@
mostlyclean-vti:
- -rm -f vti.tmp
+ -rm -f vti.tmp* $(srcdir)/version.texi.tmp*
maintainer-clean-vti:
@MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
@@ -556,7 +577,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -805,6 +829,8 @@ uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
uninstall-dvi-am uninstall-html-am uninstall-info-am \
uninstall-pdf-am uninstall-ps-am
+.PRECIOUS: Makefile
+
online: ksba.html ksba.pdf
set -e; \
diff --git a/doc/ksba.info b/doc/ksba.info
index dc6677a..6a95639 100644
--- a/doc/ksba.info
+++ b/doc/ksba.info
@@ -1,4 +1,4 @@
-This is ksba.info, produced by makeinfo version 5.2 from ksba.texi.
+This is ksba.info, produced by makeinfo version 6.5 from ksba.texi.
INFO-DIR-SECTION GNU libraries
START-INFO-DIR-ENTRY
@@ -8,8 +8,8 @@ END-INFO-DIR-ENTRY
This file documents the KSBA library to access X.509 and CMS data
structures.
- This is edition 1.3.5, last updated 15 March 2013, of 'The KSBA
-Reference Manual', for Version 1.3.5.
+ This is edition 1.4.0, last updated 12 May 2020, of 'The KSBA
+Reference Manual', for Version 1.4.0.
Copyright (C) 2002, 2003, 2004 g10 Code GmbH
@@ -25,8 +25,8 @@ File: ksba.info, Node: Top, Next: Introduction, Up: (dir)
Main Menu
*********
-This is edition 1.3.5, last updated 15 March 2013, of 'The KSBA
-Reference Manual', for Version 1.3.5 of the KSBA library.
+This is edition 1.4.0, last updated 12 May 2020, of 'The KSBA Reference
+Manual', for Version 1.4.0 of the KSBA library.
Copyright (C) 2002, 2003, 2004 g10 Code GmbH
@@ -379,7 +379,21 @@ certificate object has not yet been initialized by means of
Figure out the the digest algorithm used for the signature and
return its OID in dotted decimal format. This function is most
likely used to setup the hash context before calling
- 'ksba_cert_hash'.
+ 'ksba_cert_hash'. For some certificate types the returned OID has
+ a special meaning:
+
+ '1.2.840.113549.1.1.10'
+ This indicates the RSASSA-PSS algorithm. The digest algorithm
+ needs to be extracted from the S-expression returned by
+ 'ksba_cert_get_sig_val'.
+
+ '1.3.101.112'
+ This is the Ed25519 algorithm which does not use a separate
+ digest algorithm. See RFC-8410.
+
+ '1.3.101.113'
+ This is the Ed448 algorithm which does not use a separate
+ digest algorithm. See RFC-8410.
The function returns 'NULL' for an error; on success a constant
string with the OID is returned. This string is valid as long the
@@ -660,8 +674,9 @@ mechanism for this by means of two functions:
*Caution:* This function is definitely not thread safe because we
don't employ any locking mechanisms.
- -- Function: gpg_error_t ksba_cert_get_user_data (ksba_cert_t CERT, const char *KEY,
- void *BUFFER, size_t BUFFERLEN, size_t *DATALEN)
+ -- Function: gpg_error_t ksba_cert_get_user_data (ksba_cert_t CERT,
+ const char *KEY, void *BUFFER, size_t BUFFERLEN,
+ size_t *DATALEN)
Return user data for certificate CERT stored under the string KEY.
The caller needs to provide a suitable large BUFFER and the usable
@@ -1781,46 +1796,46 @@ Function and Data Index
* Menu:
* ksba_cert_get_authority_info_access: Retrieving attributes.
- (line 263)
+ (line 279)
* ksba_cert_get_auth_key_id: Retrieving attributes.
- (line 254)
+ (line 270)
* ksba_cert_get_cert_policies: Retrieving attributes.
- (line 216)
+ (line 232)
* ksba_cert_get_crl_dist_point: Retrieving attributes.
- (line 226)
+ (line 242)
* ksba_cert_get_digest_algo: Retrieving attributes.
- (line 39)
+ (line 41)
* ksba_cert_get_extension: Retrieving attributes.
- (line 164)
+ (line 180)
* ksba_cert_get_ext_key_usages: Retrieving attributes.
- (line 210)
+ (line 226)
* ksba_cert_get_image: Retrieving attributes.
(line 11)
* ksba_cert_get_issuer: Retrieving attributes.
- (line 57)
+ (line 73)
* ksba_cert_get_key_usage: Retrieving attributes.
- (line 177)
+ (line 193)
* ksba_cert_get_public_key: Retrieving attributes.
- (line 156)
+ (line 172)
* ksba_cert_get_serial: Retrieving attributes.
- (line 50)
+ (line 66)
* ksba_cert_get_sig_val: Retrieving attributes.
- (line 160)
+ (line 176)
* ksba_cert_get_subject: Retrieving attributes.
- (line 84)
+ (line 100)
* ksba_cert_get_subject_info_access: Retrieving attributes.
- (line 277)
+ (line 293)
* ksba_cert_get_subj_key_id: Retrieving attributes.
- (line 245)
+ (line 261)
* ksba_cert_get_user_data: User data. (line 26)
* ksba_cert_get_validity: Retrieving attributes.
- (line 145)
+ (line 161)
* ksba_cert_hash: Retrieving attributes.
- (line 24)
+ (line 25)
* ksba_cert_init_from_mem: Creating certificates.
(line 41)
* ksba_cert_is_ca: Retrieving attributes.
- (line 169)
+ (line 185)
* ksba_cert_new: Creating certificates.
(line 9)
* ksba_cert_read_der: Creating certificates.
@@ -1843,7 +1858,7 @@ Function and Data Index
* ksba_content_t: CMS Parser. (line 61)
* ksba_dn_teststr: DNs. (line 9)
* ksba_isotime_t: Retrieving attributes.
- (line 109)
+ (line 125)
* ksba_name_enum: Names. (line 17)
* ksba_name_get_uri: Names. (line 36)
* ksba_name_release: Names. (line 13)
@@ -1855,33 +1870,33 @@ Function and Data Index

Tag Table:
-Node: Top740
-Node: Introduction2772
-Node: Getting Started3050
-Node: Features3916
-Node: Overview5007
-Node: Preparation5256
-Node: Header5739
-Node: Version Check6335
-Node: Building the source7427
-Node: Certificate Handling9271
-Node: Creating certificates10252
-Node: Retrieving attributes12713
-Node: Setting attributes26390
-Node: User data26655
-Node: CMS28565
-Node: CMS Basics29024
-Node: CMS Parser31087
-Node: CRLs35065
-Node: PKCS1035348
-Node: Utilities35609
-Node: Names36013
-Node: OIDs38325
-Node: DNs38529
-Node: Error Handling39660
-Node: Component Labels41015
-Node: Copying42578
-Node: Concept Index80105
-Node: Function and Data Index80233
+Node: Top738
+Node: Introduction2768
+Node: Getting Started3046
+Node: Features3912
+Node: Overview5003
+Node: Preparation5252
+Node: Header5735
+Node: Version Check6331
+Node: Building the source7423
+Node: Certificate Handling9267
+Node: Creating certificates10248
+Node: Retrieving attributes12709
+Node: Setting attributes26927
+Node: User data27192
+Node: CMS29112
+Node: CMS Basics29571
+Node: CMS Parser31634
+Node: CRLs35612
+Node: PKCS1035895
+Node: Utilities36156
+Node: Names36560
+Node: OIDs38872
+Node: DNs39076
+Node: Error Handling40207
+Node: Component Labels41562
+Node: Copying43125
+Node: Concept Index80652
+Node: Function and Data Index80780

End Tag Table
diff --git a/doc/ksba.texi b/doc/ksba.texi
index 31ad02b..65cf10c 100644
--- a/doc/ksba.texi
+++ b/doc/ksba.texi
@@ -415,7 +415,24 @@ function is in general not expected to yield errors anyway.
Figure out the the digest algorithm used for the signature and return
its @acronym{OID} in dotted decimal format. This function is most
likely used to setup the hash context before calling
-@code{ksba_cert_hash}.
+@code{ksba_cert_hash}. For some certificate types the returned OID
+has a special meaning:
+
+@table @code
+@item 1.2.840.113549.1.1.10
+This indicates the RSASSA-PSS algorithm. The digest algorithm needs
+to be extracted from the S-expression returned by
+@code{ksba_cert_get_sig_val}.
+
+@item 1.3.101.112
+This is the Ed25519 algorithm which does not use a separate digest
+algorithm. See RFC-8410.
+
+@item 1.3.101.113
+This is the Ed448 algorithm which does not use a separate digest
+algorithm. See RFC-8410.
+
+@end table
The function returns @code{NULL} for an error; on success a constant
string with the @acronym{OID} is returned. This string is valid as long
diff --git a/doc/stamp-vti b/doc/stamp-vti
index 294851a..b8f2f82 100644
--- a/doc/stamp-vti
+++ b/doc/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 15 March 2013
-@set UPDATED-MONTH March 2013
-@set EDITION 1.3.5
-@set VERSION 1.3.5
+@set UPDATED 12 May 2020
+@set UPDATED-MONTH May 2020
+@set EDITION 1.4.0
+@set VERSION 1.4.0
diff --git a/doc/version.texi b/doc/version.texi
index 294851a..b8f2f82 100644
--- a/doc/version.texi
+++ b/doc/version.texi
@@ -1,4 +1,4 @@
-@set UPDATED 15 March 2013
-@set UPDATED-MONTH March 2013
-@set EDITION 1.3.5
-@set VERSION 1.3.5
+@set UPDATED 12 May 2020
+@set UPDATED-MONTH May 2020
+@set EDITION 1.4.0
+@set VERSION 1.4.0
diff --git a/gl/Makefile.in b/gl/Makefile.in
index ae2a9cc..b6e9343 100644
--- a/gl/Makefile.in
+++ b/gl/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -27,7 +27,17 @@
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --aux-dir=. --libtool alloca alloca-opt valgrind-tests
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -91,12 +101,12 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = gl
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am alloca.c
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/gl/m4/gnulib.m4 \
$(top_srcdir)/gl/m4/valgrind-tests.m4 \
$(top_srcdir)/m4/autobuild.m4 \
+ $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
$(top_srcdir)/m4/gnupg-typedef.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -104,6 +114,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -130,7 +141,7 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp =
-am__depfiles_maybe =
+am__maybe_remake_depfiles =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -175,6 +186,7 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in alloca.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
@@ -194,6 +206,8 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_FOR_BUILD = @CC_FOR_BUILD@
CFLAGS = @CFLAGS@
+COVERAGE_CFLAGS = @COVERAGE_CFLAGS@
+COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -208,6 +222,9 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
+GCOV = @GCOV@
+GENHTML = @GENHTML@
+GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@@ -223,7 +240,9 @@ KSBA_CONFIG_API_VERSION = @KSBA_CONFIG_API_VERSION@
KSBA_CONFIG_CFLAGS = @KSBA_CONFIG_CFLAGS@
KSBA_CONFIG_HOST = @KSBA_CONFIG_HOST@
KSBA_CONFIG_LIBS = @KSBA_CONFIG_LIBS@
+LCOV = @LCOV@
LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
LDFLAGS = @LDFLAGS@
LIBKSBA_LT_AGE = @LIBKSBA_LT_AGE@
LIBKSBA_LT_CURRENT = @LIBKSBA_LT_CURRENT@
@@ -258,9 +277,11 @@ RC = @RC@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SHTOOL = @SHTOOL@
STRIP = @STRIP@
VALGRIND = @VALGRIND@
VERSION = @VERSION@
+VERSION_NUMBER = @VERSION_NUMBER@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
@@ -343,14 +364,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits gl/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnits gl/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -449,7 +469,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -605,6 +628,8 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
+.PRECIOUS: Makefile
+
# We need the following in order to create an <alloca.h> when the system
# doesn't have one that works with the given compiler.
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 3a1716c..fdbffdd 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -1,5 +1,5 @@
EXTRA_DIST = autobuild.m4 gnupg-typedef.m4 gpg-error.m4 libgcrypt.m4 \
- libtool.m4
+ libtool.m4 ax_prog_bison.m4 gcov.m4
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 796e13d..0c7097b 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
@SET_MAKE@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -78,12 +88,12 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = m4
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/gl/m4/gnulib.m4 \
$(top_srcdir)/gl/m4/valgrind-tests.m4 \
$(top_srcdir)/m4/autobuild.m4 \
+ $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
$(top_srcdir)/m4/gnupg-typedef.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -91,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -115,6 +126,7 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
@@ -134,6 +146,8 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_FOR_BUILD = @CC_FOR_BUILD@
CFLAGS = @CFLAGS@
+COVERAGE_CFLAGS = @COVERAGE_CFLAGS@
+COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -148,6 +162,9 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
+GCOV = @GCOV@
+GENHTML = @GENHTML@
+GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@@ -163,7 +180,9 @@ KSBA_CONFIG_API_VERSION = @KSBA_CONFIG_API_VERSION@
KSBA_CONFIG_CFLAGS = @KSBA_CONFIG_CFLAGS@
KSBA_CONFIG_HOST = @KSBA_CONFIG_HOST@
KSBA_CONFIG_LIBS = @KSBA_CONFIG_LIBS@
+LCOV = @LCOV@
LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
LDFLAGS = @LDFLAGS@
LIBKSBA_LT_AGE = @LIBKSBA_LT_AGE@
LIBKSBA_LT_CURRENT = @LIBKSBA_LT_CURRENT@
@@ -198,9 +217,11 @@ RC = @RC@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SHTOOL = @SHTOOL@
STRIP = @STRIP@
VALGRIND = @VALGRIND@
VERSION = @VERSION@
+VERSION_NUMBER = @VERSION_NUMBER@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
@@ -256,7 +277,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = autobuild.m4 gnupg-typedef.m4 gpg-error.m4 libgcrypt.m4 \
- libtool.m4
+ libtool.m4 ax_prog_bison.m4 gcov.m4
all: all-am
@@ -273,14 +294,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu m4/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -304,7 +324,10 @@ ctags CTAGS:
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -448,6 +471,8 @@ uninstall-am:
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags-am uninstall uninstall-am
+.PRECIOUS: Makefile
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/m4/ax_prog_bison.m4 b/m4/ax_prog_bison.m4
new file mode 100644
index 0000000..b7ba31d
--- /dev/null
+++ b/m4/ax_prog_bison.m4
@@ -0,0 +1,64 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_prog_bison.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_BISON(ACTION-IF-TRUE,ACTION-IF-FALSE)
+#
+# DESCRIPTION
+#
+# Check whether bison is the parser generator. Run ACTION-IF-TRUE if
+# successful, ACTION-IF-FALSE otherwise
+#
+# LICENSE
+#
+# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
+# Copyright (c) 2010 Diego Elio Petteno` <flameeyes@gmail.com>
+#
+# 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 2 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/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 9
+
+AC_DEFUN([AX_PROG_BISON], [
+ AC_REQUIRE([AC_PROG_YACC])
+ AC_REQUIRE([AC_PROG_EGREP])
+
+ AC_CACHE_CHECK([if bison is the parser generator],[ax_cv_prog_bison],[
+ AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
+ [ax_cv_prog_bison=yes], [ax_cv_prog_bison=no])
+ ])
+ AS_IF([test "$ax_cv_prog_bison" = "yes"], [
+ dnl replace the yacc-compatible compiler with the real bison, as
+ dnl otherwise autoconf limits us to the POSIX yacc.
+ dnl We also change the generated filename to the old one, so that
+ dnl automake's ylwrap can deal with it.
+ YACC="${YACC% -y} -o y.tab.c"
+ ] m4_ifnblank([$1], [[$1]]),
+ m4_ifnblank([$2], [[$2]])
+ )
+])
diff --git a/m4/gcov.m4 b/m4/gcov.m4
new file mode 100644
index 0000000..ad1d3ec
--- /dev/null
+++ b/m4/gcov.m4
@@ -0,0 +1,93 @@
+# Copyright 2012 Canonical Ltd.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 3, as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranties of
+# MERCHANTABILITY, SATISFACTORY QUALITY, 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/>.
+
+# Checks for existence of coverage tools:
+# * gcov
+# * lcov
+# * genhtml
+# * gcovr
+#
+# Sets ac_cv_check_gcov to yes if tooling is present
+# and reports the executables to the variables LCOV, GCOVR and GENHTML.
+AC_DEFUN([AC_TDD_GCOV],
+[
+ AC_ARG_ENABLE(gcov,
+ AS_HELP_STRING([--enable-gcov],
+ [enable coverage testing with gcov]),
+ [use_gcov=yes], [use_gcov=no])
+
+ AM_CONDITIONAL(HAVE_GCOV, test "x$use_gcov" = "xyes")
+
+ if test "x$use_gcov" = "xyes"; then
+ # we need gcc:
+ if test "$GCC" != "yes"; then
+ AC_MSG_ERROR([GCC is required for --enable-gcov])
+ fi
+
+ # Check if ccache is being used
+ AC_CHECK_PROG(SHTOOL, shtool, shtool)
+ if test "$SHTOOL"; then
+ AS_CASE([`$SHTOOL path $CC`],
+ [*ccache*], [gcc_ccache=yes],
+ [gcc_ccache=no])
+ fi
+
+ if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
+ AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
+ fi
+
+ lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13"
+ AC_CHECK_PROG(LCOV, lcov, lcov)
+ AC_CHECK_PROG(GENHTML, genhtml, genhtml)
+
+ if test "$LCOV"; then
+ AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [
+ glib_cv_lcov_version=invalid
+ lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
+ for lcov_check_version in $lcov_version_list; do
+ if test "$lcov_version" = "$lcov_check_version"; then
+ glib_cv_lcov_version="$lcov_check_version (ok)"
+ fi
+ done
+ ])
+ else
+ lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
+ AC_MSG_ERROR([$lcov_msg])
+ fi
+
+ case $glib_cv_lcov_version in
+ ""|invalid[)]
+ lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
+ AC_MSG_ERROR([$lcov_msg])
+ LCOV="exit 0;"
+ ;;
+ esac
+
+ if test -z "$GENHTML"; then
+ AC_MSG_ERROR([Could not find genhtml from the lcov package])
+ fi
+
+ # Remove all optimization flags from CFLAGS
+ changequote({,})
+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+ CPPFLAGS=`echo "$CPPFLAGS" | $SED -e 's/-O[0-9]*//g'`
+ changequote([,])
+
+ # Add the special gcc flags
+ COVERAGE_CFLAGS="--coverage -DDEBUG"
+ COVERAGE_CXXFLAGS="--coverage -DDEBUG"
+ COVERAGE_LDFLAGS="--coverage -lgcov"
+
+fi
+]) # AC_TDD_GCOV
diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4
index 1661204..a9d572f 100644
--- a/m4/gpg-error.m4
+++ b/m4/gpg-error.m4
@@ -1,5 +1,5 @@
# gpg-error.m4 - autoconf macro to detect libgpg-error.
-# Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH
+# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018 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
@@ -9,7 +9,7 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# Last-changed: 2014-10-02
+# Last-changed: 2018-11-02
dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
@@ -61,16 +61,55 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
fi
AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
- min_gpg_error_version=ifelse([$1], ,0.0,$1)
- AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
+ min_gpg_error_version=ifelse([$1], ,1.33,$1)
ok=no
- if test "$GPG_ERROR_CONFIG" != "no" \
- && test -f "$GPG_ERROR_CONFIG" ; then
+
+ if test "$prefix" = NONE ; then
+ prefix_option_expanded=/usr/local
+ else
+ prefix_option_expanded="$prefix"
+ fi
+ if test "$exec_prefix" = NONE ; then
+ exec_prefix_option_expanded=$prefix_option_expanded
+ else
+ exec_prefix_option_expanded=$(prefix=$prefix_option_expanded eval echo $exec_prefix)
+ fi
+ libdir_option_expanded=$(prefix=$prefix_option_expanded exec_prefix=$exec_prefix_option_expanded eval echo $libdir)
+
+ if test -f $libdir_option_expanded/pkgconfig/gpg-error.pc; then
+ gpgrt_libdir=$libdir_option_expanded
+ else
+ if crt1_path=$(${CC:-cc} -print-file-name=crt1.o 2>/dev/null); then
+ if possible_libdir=$(cd ${crt1_path%/*} && pwd 2>/dev/null); then
+ if test -f $possible_libdir/pkgconfig/gpg-error.pc; then
+ gpgrt_libdir=$possible_libdir
+ fi
+ fi
+ fi
+ fi
+
+ if test "$GPG_ERROR_CONFIG" = "no" -a -n "$gpgrt_libdir"; then
+ AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no)
+ if test "$GPGRT_CONFIG" = "no"; then
+ unset GPGRT_CONFIG
+ else
+ GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
+ if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then
+ GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error"
+ AC_MSG_NOTICE([Use gpgrt-config with $gpgrt_libdir as gpg-error-config])
+ gpg_error_config_version=`$GPG_ERROR_CONFIG --modversion`
+ else
+ unset GPGRT_CONFIG
+ fi
+ fi
+ else
+ gpg_error_config_version=`$GPG_ERROR_CONFIG --version`
+ fi
+ if test "$GPG_ERROR_CONFIG" != "no"; then
req_major=`echo $min_gpg_error_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
req_minor=`echo $min_gpg_error_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
- gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
major=`echo $gpg_error_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $gpg_error_config_version | \
@@ -84,23 +123,51 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
fi
fi
fi
+ if test -z "$GPGRT_CONFIG" -a -n "$gpgrt_libdir"; then
+ if test "$major" -gt 1 -o "$major" -eq 1 -a "$minor" -ge 33; then
+ AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no)
+ if test "$GPGRT_CONFIG" = "no"; then
+ unset GPGRT_CONFIG
+ else
+ GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
+ if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then
+ GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error"
+ AC_MSG_NOTICE([Use gpgrt-config with $gpgrt_libdir as gpg-error-config])
+ else
+ unset GPGRT_CONFIG
+ fi
+ fi
+ fi
+ fi
fi
+ AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
if test $ok = yes; then
- GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
- GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
- GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null`
- GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null`
+ GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG --cflags`
+ GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG --libs`
+ if test -z "$GPGRT_CONFIG"; then
+ GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --mt --cflags 2>/dev/null`
+ GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --mt --libs 2>/dev/null`
+ else
+ GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --variable=mtcflags 2>/dev/null`
+ GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS"
+ GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --variable=mtlibs 2>/dev/null`
+ GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS"
+ fi
AC_MSG_RESULT([yes ($gpg_error_config_version)])
ifelse([$2], , :, [$2])
- gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
+ if test -z "$GPGRT_CONFIG"; then
+ gpg_error_config_host=`$GPG_ERROR_CONFIG --host 2>/dev/null || echo none`
+ else
+ gpg_error_config_host=`$GPG_ERROR_CONFIG --variable=host 2>/dev/null || echo none`
+ fi
if test x"$gpg_error_config_host" != xnone ; then
if test x"$gpg_error_config_host" != x"$host" ; then
AC_MSG_WARN([[
***
-*** The config script $GPG_ERROR_CONFIG was
+*** The config script "$GPG_ERROR_CONFIG" was
*** built for $gpg_error_config_host and thus may not match the
*** used host $host.
-*** You may want to use the configure option --with-gpg-error-prefix
+*** You may want to use the configure option --with-libgpg-error-prefix
*** to specify a matching config script or use \$SYSROOT.
***]])
gpg_config_script_warn="$gpg_config_script_warn libgpg-error"
diff --git a/m4/libgcrypt.m4 b/m4/libgcrypt.m4
index c67cfec..37dfbea 100644
--- a/m4/libgcrypt.m4
+++ b/m4/libgcrypt.m4
@@ -1,5 +1,5 @@
# libgcrypt.m4 - Autoconf macros to detect libgcrypt
-# Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH
+# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018 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
@@ -9,7 +9,7 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# Last-changed: 2014-10-02
+# Last-changed: 2018-11-13
dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
@@ -36,8 +36,20 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
if test x"${LIBGCRYPT_CONFIG}" = x ; then
if test x"${libgcrypt_config_prefix}" != x ; then
LIBGCRYPT_CONFIG="${libgcrypt_config_prefix}/bin/libgcrypt-config"
- else
- case "${SYSROOT}" in
+ fi
+ fi
+
+ use_gpgrt_config=""
+ if test x"${LIBGCRYPT_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
+ if $GPGRT_CONFIG libgcrypt --exists; then
+ LIBGCRYPT_CONFIG="$GPGRT_CONFIG libgcrypt"
+ AC_MSG_NOTICE([Use gpgrt-config as libgcrypt-config])
+ use_gpgrt_config=yes
+ fi
+ fi
+ if test -z "$use_gpgrt_config"; then
+ if test x"${LIBGCRYPT_CONFIG}" = x ; then
+ case "${SYSROOT}" in
/*)
if test -x "${SYSROOT}/bin/libgcrypt-config" ; then
LIBGCRYPT_CONFIG="${SYSROOT}/bin/libgcrypt-config"
@@ -48,11 +60,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
*)
AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
;;
- esac
- fi
+ esac
+ fi
+ AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
fi
- AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
tmp=ifelse([$1], ,1:1.2.0,$1)
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
@@ -71,7 +83,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
req_micro=`echo $min_libgcrypt_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
- libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
+ if test -z "$use_gpgrt_config"; then
+ libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
+ else
+ libgcrypt_config_version=`$LIBGCRYPT_CONFIG --modversion`
+ fi
major=`echo $libgcrypt_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $libgcrypt_config_version | \
@@ -103,7 +119,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
# If we have a recent libgcrypt, we should also check that the
# API is compatible
if test "$req_libgcrypt_api" -gt 0 ; then
- tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
+ if test -z "$use_gpgrt_config"; then
+ tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
+ else
+ tmp=`$LIBGCRYPT_CONFIG --variable=api_version 2>/dev/null || echo 0`
+ fi
if test "$tmp" -gt 0 ; then
AC_MSG_CHECKING([LIBGCRYPT API version])
if test "$req_libgcrypt_api" -eq "$tmp" ; then
@@ -119,12 +139,16 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
ifelse([$2], , :, [$2])
- libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
+ if test -z "$use_gpgrt_config"; then
+ libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
+ else
+ libgcrypt_config_host=`$LIBGCRYPT_CONFIG --variable=host 2>/dev/null || echo none`
+ fi
if test x"$libgcrypt_config_host" != xnone ; then
if test x"$libgcrypt_config_host" != x"$host" ; then
AC_MSG_WARN([[
***
-*** The config script $LIBGCRYPT_CONFIG was
+*** The config script "$LIBGCRYPT_CONFIG" was
*** built for $libgcrypt_config_host and thus may not match the
*** used host $host.
*** You may want to use the configure option --with-libgcrypt-prefix
diff --git a/src/Makefile.am b/src/Makefile.am
index 7e3f06b..0eedae7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,14 +18,18 @@
## Process this file with automake to produce Makefile.in
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = ksba.pc
+
asn1_modules = tmttv2.asn cms.asn
buildtool_src = asn1-gentables.c gen-help.c gen-help.h
-EXTRA_DIST = ksba-config.in $(asn1_modules) ksba.m4 libksba.vers libksba.def \
- asn1-parse.c asn1-tables.c $(buildtool_src)
+EXTRA_DIST = ksba.h.in ksba-config.in $(asn1_modules) ksba.m4 \
+ libksba.vers libksba.def \
+ asn1-parse.c asn1-tables.c $(buildtool_src) ksba.pc.in
BUILT_SOURCES = asn1-parse.c asn1-tables.c
bin_SCRIPTS = ksba-config
-include_HEADERS = ksba.h
+nodist_include_HEADERS = ksba.h
lib_LTLIBRARIES = libksba.la
noinst_PROGRAMS = ber-dump
@@ -36,7 +40,7 @@ CLEANFILES = asn1-gentables
DISTCLEANFILES = asn1-tables.c
AM_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl
-AM_CFLAGS = $(GPG_ERROR_CFLAGS)
+AM_CFLAGS = $(GPG_ERROR_CFLAGS) $(COVERAGE_CFLAGS)
if HAVE_LD_VERSION_SCRIPT
@@ -82,7 +86,8 @@ endif !HAVE_W32_SYSTEM
libksba_la_LDFLAGS = $(no_undefined) $(export_symbols) $(extra_ltoptions) \
$(libksba_version_script_cmd) -version-info \
- @LIBKSBA_LT_CURRENT@:@LIBKSBA_LT_REVISION@:@LIBKSBA_LT_AGE@
+ @LIBKSBA_LT_CURRENT@:@LIBKSBA_LT_REVISION@:@LIBKSBA_LT_AGE@ \
+ $(COVERAGE_LDFLAGS)
libksba_la_INCLUDES = -I$(top_srcdir)/lib
libksba_la_DEPENDENCIES = $(srcdir)/libksba.vers $(ksba_deps)
libksba_la_LIBADD = $(ksba_res) @LTLIBOBJS@ @GPG_ERROR_LIBS@
@@ -94,31 +99,33 @@ libksba_la_SOURCES = \
reader.c reader.h \
writer.c writer.h \
asn1-parse.y \
- asn1-func.c asn1-func2.c asn1-func.h \
+ asn1-func.c asn1-func2.c asn1-func.h asn1-constants.h \
ber-help.c ber-help.h \
ber-decoder.c ber-decoder.h \
der-encoder.c der-encoder.h \
+ der-builder.c der-builder.h \
cert.c cert.h \
cms.c cms.h cms-parser.c \
crl.c crl.h \
certreq.c certreq.h \
ocsp.c ocsp.h \
keyinfo.c keyinfo.h \
- oid.c name.c dn.c time.c convert.h \
+ oid.c name.c dn.c time.c convert.h stringbuf.h \
version.c util.c util.h shared.h \
sexp-parse.h \
asn1-tables.c
ber_dump_SOURCES = ber-dump.c \
ber-decoder.c ber-help.c reader.c writer.c asn1-parse.c \
- asn1-func.c oid.c util.c
+ asn1-func.c oid.c time.c util.c
ber_dump_LDADD = $(GPG_ERROR_LIBS) ../gl/libgnu.la
ber_dump_CFLAGS = $(AM_CFLAGS)
asn1-parse.c : asn1-func.h gen-help.h
asn1-gentables: asn1-gentables.c asn1-parse.c asn1-func.c gen-help.c gen-help.h
- $(CC_FOR_BUILD) -I$(srcdir) -DBUILD_GENTOOLS -o $@ \
+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
+ $(CPPFLAGS_FOR_BUILD) -I$(srcdir) -DBUILD_GENTOOLS -o $@ \
$(srcdir)/asn1-gentables.c \
`test -f 'asn1-parse.c' || echo '$(srcdir)/'`asn1-parse.c \
$(srcdir)/asn1-func.c \
diff --git a/src/Makefile.in b/src/Makefile.in
index c97b83f..99899ee 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -37,7 +37,17 @@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -102,15 +112,12 @@ build_triplet = @build@
host_triplet = @host@
noinst_PROGRAMS = ber-dump$(EXEEXT)
subdir = src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(srcdir)/ksba-config.in $(srcdir)/versioninfo.rc.in \
- asn1-parse.c $(top_srcdir)/build-aux/depcomp \
- $(top_srcdir)/build-aux/ylwrap $(include_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/gl/m4/gnulib.m4 \
$(top_srcdir)/gl/m4/valgrind-tests.m4 \
$(top_srcdir)/m4/autobuild.m4 \
+ $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
$(top_srcdir)/m4/gnupg-typedef.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -118,10 +125,12 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = ksba-config versioninfo.rc
+CONFIG_CLEAN_FILES = ksba.h ksba-config ksba.pc versioninfo.rc
CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -150,14 +159,15 @@ am__uninstall_files_from_dir = { \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
- "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(includedir)"
+ "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)" \
+ "$(DESTDIR)$(includedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
@HAVE_W32_SYSTEM_TRUE@am__DEPENDENCIES_1 = versioninfo.lo
am_libksba_la_OBJECTS = visibility.lo reader.lo writer.lo \
asn1-parse.lo asn1-func.lo asn1-func2.lo ber-help.lo \
- ber-decoder.lo der-encoder.lo cert.lo cms.lo cms-parser.lo \
- crl.lo certreq.lo ocsp.lo keyinfo.lo oid.lo name.lo dn.lo \
- time.lo version.lo util.lo asn1-tables.lo
+ ber-decoder.lo der-encoder.lo der-builder.lo cert.lo cms.lo \
+ cms-parser.lo crl.lo certreq.lo ocsp.lo keyinfo.lo oid.lo \
+ name.lo dn.lo time.lo version.lo util.lo asn1-tables.lo
libksba_la_OBJECTS = $(am_libksba_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -166,12 +176,12 @@ am__v_lt_1 =
libksba_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libksba_la_LDFLAGS) $(LDFLAGS) -o $@
-PROGRAMS = $(noinst_PROGRAMS)
am_ber_dump_OBJECTS = ber_dump-ber-dump.$(OBJEXT) \
ber_dump-ber-decoder.$(OBJEXT) ber_dump-ber-help.$(OBJEXT) \
ber_dump-reader.$(OBJEXT) ber_dump-writer.$(OBJEXT) \
ber_dump-asn1-parse.$(OBJEXT) ber_dump-asn1-func.$(OBJEXT) \
- ber_dump-oid.$(OBJEXT) ber_dump-util.$(OBJEXT)
+ ber_dump-oid.$(OBJEXT) ber_dump-time.$(OBJEXT) \
+ ber_dump-util.$(OBJEXT)
ber_dump_OBJECTS = $(am_ber_dump_OBJECTS)
am__DEPENDENCIES_2 =
ber_dump_DEPENDENCIES = $(am__DEPENDENCIES_2) ../gl/libgnu.la
@@ -193,7 +203,26 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/asn1-func.Plo \
+ ./$(DEPDIR)/asn1-func2.Plo ./$(DEPDIR)/asn1-parse.Plo \
+ ./$(DEPDIR)/asn1-tables.Plo ./$(DEPDIR)/ber-decoder.Plo \
+ ./$(DEPDIR)/ber-help.Plo ./$(DEPDIR)/ber_dump-asn1-func.Po \
+ ./$(DEPDIR)/ber_dump-asn1-parse.Po \
+ ./$(DEPDIR)/ber_dump-ber-decoder.Po \
+ ./$(DEPDIR)/ber_dump-ber-dump.Po \
+ ./$(DEPDIR)/ber_dump-ber-help.Po ./$(DEPDIR)/ber_dump-oid.Po \
+ ./$(DEPDIR)/ber_dump-reader.Po ./$(DEPDIR)/ber_dump-time.Po \
+ ./$(DEPDIR)/ber_dump-util.Po ./$(DEPDIR)/ber_dump-writer.Po \
+ ./$(DEPDIR)/cert.Plo ./$(DEPDIR)/certreq.Plo \
+ ./$(DEPDIR)/cms-parser.Plo ./$(DEPDIR)/cms.Plo \
+ ./$(DEPDIR)/crl.Plo ./$(DEPDIR)/der-builder.Plo \
+ ./$(DEPDIR)/der-encoder.Plo ./$(DEPDIR)/dn.Plo \
+ ./$(DEPDIR)/keyinfo.Plo ./$(DEPDIR)/name.Plo \
+ ./$(DEPDIR)/ocsp.Plo ./$(DEPDIR)/oid.Plo \
+ ./$(DEPDIR)/reader.Plo ./$(DEPDIR)/time.Plo \
+ ./$(DEPDIR)/util.Plo ./$(DEPDIR)/version.Plo \
+ ./$(DEPDIR)/visibility.Plo ./$(DEPDIR)/writer.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -231,8 +260,8 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
-DATA = $(m4data_DATA)
-HEADERS = $(include_HEADERS)
+DATA = $(m4data_DATA) $(pkgconfig_DATA)
+HEADERS = $(nodist_include_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
@@ -252,6 +281,10 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/ksba-config.in \
+ $(srcdir)/ksba.h.in $(srcdir)/ksba.pc.in \
+ $(srcdir)/versioninfo.rc.in $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/ylwrap asn1-parse.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
@@ -271,6 +304,8 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_FOR_BUILD = @CC_FOR_BUILD@
CFLAGS = @CFLAGS@
+COVERAGE_CFLAGS = @COVERAGE_CFLAGS@
+COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -285,6 +320,9 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
+GCOV = @GCOV@
+GENHTML = @GENHTML@
+GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@@ -300,7 +338,9 @@ KSBA_CONFIG_API_VERSION = @KSBA_CONFIG_API_VERSION@
KSBA_CONFIG_CFLAGS = @KSBA_CONFIG_CFLAGS@
KSBA_CONFIG_HOST = @KSBA_CONFIG_HOST@
KSBA_CONFIG_LIBS = @KSBA_CONFIG_LIBS@
+LCOV = @LCOV@
LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
LDFLAGS = @LDFLAGS@
LIBKSBA_LT_AGE = @LIBKSBA_LT_AGE@
LIBKSBA_LT_CURRENT = @LIBKSBA_LT_CURRENT@
@@ -335,9 +375,11 @@ RC = @RC@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SHTOOL = @SHTOOL@
STRIP = @STRIP@
VALGRIND = @VALGRIND@
VERSION = @VERSION@
+VERSION_NUMBER = @VERSION_NUMBER@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
@@ -392,21 +434,24 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = ksba.pc
asn1_modules = tmttv2.asn cms.asn
buildtool_src = asn1-gentables.c gen-help.c gen-help.h
-EXTRA_DIST = ksba-config.in $(asn1_modules) ksba.m4 libksba.vers libksba.def \
- asn1-parse.c asn1-tables.c $(buildtool_src)
+EXTRA_DIST = ksba.h.in ksba-config.in $(asn1_modules) ksba.m4 \
+ libksba.vers libksba.def \
+ asn1-parse.c asn1-tables.c $(buildtool_src) ksba.pc.in
BUILT_SOURCES = asn1-parse.c asn1-tables.c
bin_SCRIPTS = ksba-config
-include_HEADERS = ksba.h
+nodist_include_HEADERS = ksba.h
lib_LTLIBRARIES = libksba.la
m4datadir = $(datadir)/aclocal
m4data_DATA = ksba.m4
CLEANFILES = asn1-gentables
DISTCLEANFILES = asn1-tables.c
AM_CPPFLAGS = -I$(top_builddir)/gl -I$(top_srcdir)/gl
-AM_CFLAGS = $(GPG_ERROR_CFLAGS)
+AM_CFLAGS = $(GPG_ERROR_CFLAGS) $(COVERAGE_CFLAGS)
@HAVE_LD_VERSION_SCRIPT_FALSE@libksba_version_script_cmd =
@HAVE_LD_VERSION_SCRIPT_TRUE@libksba_version_script_cmd = -Wl,--version-script=$(srcdir)/libksba.vers
@HAVE_W32_SYSTEM_TRUE@RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
@@ -426,7 +471,8 @@ AM_CFLAGS = $(GPG_ERROR_CFLAGS)
@HAVE_W32_SYSTEM_TRUE@ksba_deps = $(ksba_res) libksba.def
libksba_la_LDFLAGS = $(no_undefined) $(export_symbols) $(extra_ltoptions) \
$(libksba_version_script_cmd) -version-info \
- @LIBKSBA_LT_CURRENT@:@LIBKSBA_LT_REVISION@:@LIBKSBA_LT_AGE@
+ @LIBKSBA_LT_CURRENT@:@LIBKSBA_LT_REVISION@:@LIBKSBA_LT_AGE@ \
+ $(COVERAGE_LDFLAGS)
libksba_la_INCLUDES = -I$(top_srcdir)/lib
libksba_la_DEPENDENCIES = $(srcdir)/libksba.vers $(ksba_deps)
@@ -437,24 +483,25 @@ libksba_la_SOURCES = \
reader.c reader.h \
writer.c writer.h \
asn1-parse.y \
- asn1-func.c asn1-func2.c asn1-func.h \
+ asn1-func.c asn1-func2.c asn1-func.h asn1-constants.h \
ber-help.c ber-help.h \
ber-decoder.c ber-decoder.h \
der-encoder.c der-encoder.h \
+ der-builder.c der-builder.h \
cert.c cert.h \
cms.c cms.h cms-parser.c \
crl.c crl.h \
certreq.c certreq.h \
ocsp.c ocsp.h \
keyinfo.c keyinfo.h \
- oid.c name.c dn.c time.c convert.h \
+ oid.c name.c dn.c time.c convert.h stringbuf.h \
version.c util.c util.h shared.h \
sexp-parse.h \
asn1-tables.c
ber_dump_SOURCES = ber-dump.c \
ber-decoder.c ber-help.c reader.c writer.c asn1-parse.c \
- asn1-func.c oid.c util.c
+ asn1-func.c oid.c time.c util.c
ber_dump_LDADD = $(GPG_ERROR_LIBS) ../gl/libgnu.la
ber_dump_CFLAGS = $(AM_CFLAGS)
@@ -475,14 +522,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -493,11 +539,24 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+ksba.h: $(top_builddir)/config.status $(srcdir)/ksba.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
ksba-config: $(top_builddir)/config.status $(srcdir)/ksba-config.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+ksba.pc: $(top_builddir)/config.status $(srcdir)/ksba.pc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
versioninfo.rc: $(top_builddir)/config.status $(srcdir)/versioninfo.rc.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
@@ -536,15 +595,6 @@ clean-libLTLIBRARIES:
libksba.la: $(libksba_la_OBJECTS) $(libksba_la_DEPENDENCIES) $(EXTRA_libksba_la_DEPENDENCIES)
$(AM_V_CCLD)$(libksba_la_LINK) -rpath $(libdir) $(libksba_la_OBJECTS) $(libksba_la_LIBADD) $(LIBS)
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-
ber-dump$(EXEEXT): $(ber_dump_OBJECTS) $(ber_dump_DEPENDENCIES) $(EXTRA_ber_dump_DEPENDENCIES)
@rm -f ber-dump$(EXEEXT)
$(AM_V_CCLD)$(ber_dump_LINK) $(ber_dump_OBJECTS) $(ber_dump_LDADD) $(LIBS)
@@ -590,38 +640,46 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1-func.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1-func2.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1-parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1-tables.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber-decoder.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber-help.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-asn1-func.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-asn1-parse.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-ber-decoder.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-ber-dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-ber-help.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-oid.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-util.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-writer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cert.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/certreq.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cms-parser.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cms.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crl.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/der-encoder.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dn.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyinfo.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocsp.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oid.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reader.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/visibility.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/writer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1-func.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1-func2.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1-parse.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1-tables.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber-decoder.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber-help.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-asn1-func.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-asn1-parse.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-ber-decoder.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-ber-dump.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-ber-help.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-oid.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-reader.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-util.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ber_dump-writer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cert.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/certreq.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cms-parser.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cms.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crl.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/der-builder.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/der-encoder.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dn.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyinfo.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ocsp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oid.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reader.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/visibility.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/writer.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -756,6 +814,20 @@ ber_dump-oid.obj: oid.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ber_dump_CFLAGS) $(CFLAGS) -c -o ber_dump-oid.obj `if test -f 'oid.c'; then $(CYGPATH_W) 'oid.c'; else $(CYGPATH_W) '$(srcdir)/oid.c'; fi`
+ber_dump-time.o: time.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ber_dump_CFLAGS) $(CFLAGS) -MT ber_dump-time.o -MD -MP -MF $(DEPDIR)/ber_dump-time.Tpo -c -o ber_dump-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ber_dump-time.Tpo $(DEPDIR)/ber_dump-time.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='time.c' object='ber_dump-time.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ber_dump_CFLAGS) $(CFLAGS) -c -o ber_dump-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c
+
+ber_dump-time.obj: time.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ber_dump_CFLAGS) $(CFLAGS) -MT ber_dump-time.obj -MD -MP -MF $(DEPDIR)/ber_dump-time.Tpo -c -o ber_dump-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ber_dump-time.Tpo $(DEPDIR)/ber_dump-time.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='time.c' object='ber_dump-time.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ber_dump_CFLAGS) $(CFLAGS) -c -o ber_dump-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi`
+
ber_dump-util.o: util.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ber_dump_CFLAGS) $(CFLAGS) -MT ber_dump-util.o -MD -MP -MF $(DEPDIR)/ber_dump-util.Tpo -c -o ber_dump-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ber_dump-util.Tpo $(DEPDIR)/ber_dump-util.Po
@@ -799,9 +871,30 @@ uninstall-m4dataDATA:
@list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(m4datadir)'; $(am__uninstall_files_from_dir)
-install-includeHEADERS: $(include_HEADERS)
+install-pkgconfigDATA: $(pkgconfig_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
+ done
+
+uninstall-pkgconfigDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
+install-nodist_includeHEADERS: $(nodist_include_HEADERS)
@$(NORMAL_INSTALL)
- @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
$(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
@@ -815,9 +908,9 @@ install-includeHEADERS: $(include_HEADERS)
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
done
-uninstall-includeHEADERS:
+uninstall-nodist_includeHEADERS:
@$(NORMAL_UNINSTALL)
- @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+ @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
@@ -873,7 +966,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -906,10 +1002,10 @@ distdir: $(DISTFILES)
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \
+all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(DATA) \
$(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(includedir)"; do \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
@@ -953,7 +1049,40 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/asn1-func.Plo
+ -rm -f ./$(DEPDIR)/asn1-func2.Plo
+ -rm -f ./$(DEPDIR)/asn1-parse.Plo
+ -rm -f ./$(DEPDIR)/asn1-tables.Plo
+ -rm -f ./$(DEPDIR)/ber-decoder.Plo
+ -rm -f ./$(DEPDIR)/ber-help.Plo
+ -rm -f ./$(DEPDIR)/ber_dump-asn1-func.Po
+ -rm -f ./$(DEPDIR)/ber_dump-asn1-parse.Po
+ -rm -f ./$(DEPDIR)/ber_dump-ber-decoder.Po
+ -rm -f ./$(DEPDIR)/ber_dump-ber-dump.Po
+ -rm -f ./$(DEPDIR)/ber_dump-ber-help.Po
+ -rm -f ./$(DEPDIR)/ber_dump-oid.Po
+ -rm -f ./$(DEPDIR)/ber_dump-reader.Po
+ -rm -f ./$(DEPDIR)/ber_dump-time.Po
+ -rm -f ./$(DEPDIR)/ber_dump-util.Po
+ -rm -f ./$(DEPDIR)/ber_dump-writer.Po
+ -rm -f ./$(DEPDIR)/cert.Plo
+ -rm -f ./$(DEPDIR)/certreq.Plo
+ -rm -f ./$(DEPDIR)/cms-parser.Plo
+ -rm -f ./$(DEPDIR)/cms.Plo
+ -rm -f ./$(DEPDIR)/crl.Plo
+ -rm -f ./$(DEPDIR)/der-builder.Plo
+ -rm -f ./$(DEPDIR)/der-encoder.Plo
+ -rm -f ./$(DEPDIR)/dn.Plo
+ -rm -f ./$(DEPDIR)/keyinfo.Plo
+ -rm -f ./$(DEPDIR)/name.Plo
+ -rm -f ./$(DEPDIR)/ocsp.Plo
+ -rm -f ./$(DEPDIR)/oid.Plo
+ -rm -f ./$(DEPDIR)/reader.Plo
+ -rm -f ./$(DEPDIR)/time.Plo
+ -rm -f ./$(DEPDIR)/util.Plo
+ -rm -f ./$(DEPDIR)/version.Plo
+ -rm -f ./$(DEPDIR)/visibility.Plo
+ -rm -f ./$(DEPDIR)/writer.Plo
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -970,8 +1099,8 @@ info: info-am
info-am:
-install-data-am: install-data-local install-includeHEADERS \
- install-m4dataDATA
+install-data-am: install-data-local install-m4dataDATA \
+ install-nodist_includeHEADERS install-pkgconfigDATA
install-dvi: install-dvi-am
@@ -1000,7 +1129,40 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/asn1-func.Plo
+ -rm -f ./$(DEPDIR)/asn1-func2.Plo
+ -rm -f ./$(DEPDIR)/asn1-parse.Plo
+ -rm -f ./$(DEPDIR)/asn1-tables.Plo
+ -rm -f ./$(DEPDIR)/ber-decoder.Plo
+ -rm -f ./$(DEPDIR)/ber-help.Plo
+ -rm -f ./$(DEPDIR)/ber_dump-asn1-func.Po
+ -rm -f ./$(DEPDIR)/ber_dump-asn1-parse.Po
+ -rm -f ./$(DEPDIR)/ber_dump-ber-decoder.Po
+ -rm -f ./$(DEPDIR)/ber_dump-ber-dump.Po
+ -rm -f ./$(DEPDIR)/ber_dump-ber-help.Po
+ -rm -f ./$(DEPDIR)/ber_dump-oid.Po
+ -rm -f ./$(DEPDIR)/ber_dump-reader.Po
+ -rm -f ./$(DEPDIR)/ber_dump-time.Po
+ -rm -f ./$(DEPDIR)/ber_dump-util.Po
+ -rm -f ./$(DEPDIR)/ber_dump-writer.Po
+ -rm -f ./$(DEPDIR)/cert.Plo
+ -rm -f ./$(DEPDIR)/certreq.Plo
+ -rm -f ./$(DEPDIR)/cms-parser.Plo
+ -rm -f ./$(DEPDIR)/cms.Plo
+ -rm -f ./$(DEPDIR)/crl.Plo
+ -rm -f ./$(DEPDIR)/der-builder.Plo
+ -rm -f ./$(DEPDIR)/der-encoder.Plo
+ -rm -f ./$(DEPDIR)/dn.Plo
+ -rm -f ./$(DEPDIR)/keyinfo.Plo
+ -rm -f ./$(DEPDIR)/name.Plo
+ -rm -f ./$(DEPDIR)/ocsp.Plo
+ -rm -f ./$(DEPDIR)/oid.Plo
+ -rm -f ./$(DEPDIR)/reader.Plo
+ -rm -f ./$(DEPDIR)/time.Plo
+ -rm -f ./$(DEPDIR)/util.Plo
+ -rm -f ./$(DEPDIR)/version.Plo
+ -rm -f ./$(DEPDIR)/visibility.Plo
+ -rm -f ./$(DEPDIR)/writer.Plo
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -1017,28 +1179,32 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS \
- uninstall-libLTLIBRARIES uninstall-local uninstall-m4dataDATA
+uninstall-am: uninstall-binSCRIPTS uninstall-libLTLIBRARIES \
+ uninstall-local uninstall-m4dataDATA \
+ uninstall-nodist_includeHEADERS uninstall-pkgconfigDATA
.MAKE: all check install install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \
- cscopelist-am ctags ctags-am distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-binSCRIPTS install-data install-data-am \
- install-data-local install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am \
- install-includeHEADERS install-info install-info-am \
- install-libLTLIBRARIES install-m4dataDATA install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
- uninstall-binSCRIPTS uninstall-includeHEADERS \
- uninstall-libLTLIBRARIES uninstall-local uninstall-m4dataDATA
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libLTLIBRARIES clean-libtool \
+ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-binSCRIPTS install-data \
+ install-data-am install-data-local install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-libLTLIBRARIES \
+ install-m4dataDATA install-man install-nodist_includeHEADERS \
+ install-pdf install-pdf-am install-pkgconfigDATA install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am uninstall-binSCRIPTS uninstall-libLTLIBRARIES \
+ uninstall-local uninstall-m4dataDATA \
+ uninstall-nodist_includeHEADERS uninstall-pkgconfigDATA
+
+.PRECIOUS: Makefile
@HAVE_W32_SYSTEM_TRUE@.rc.lo:
@@ -1055,7 +1221,8 @@ uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS \
asn1-parse.c : asn1-func.h gen-help.h
asn1-gentables: asn1-gentables.c asn1-parse.c asn1-func.c gen-help.c gen-help.h
- $(CC_FOR_BUILD) -I$(srcdir) -DBUILD_GENTOOLS -o $@ \
+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
+ $(CPPFLAGS_FOR_BUILD) -I$(srcdir) -DBUILD_GENTOOLS -o $@ \
$(srcdir)/asn1-gentables.c \
`test -f 'asn1-parse.c' || echo '$(srcdir)/'`asn1-parse.c \
$(srcdir)/asn1-func.c \
diff --git a/src/asn1-constants.h b/src/asn1-constants.h
new file mode 100644
index 0000000..ed819fb
--- /dev/null
+++ b/src/asn1-constants.h
@@ -0,0 +1,66 @@
+/* asn1-constants.h
+ * Copyright (C) 2020 g10 Code GmbH
+ *
+ * This file is free software; the authors give unlimited permission
+ * to copy, distribute and modify it.
+ *
+ * SPDX-License-Identifier: FSFUL
+ */
+
+#ifndef ASN1_CONSTANTS_H
+#define ASN1_CONSTANTS_H
+
+typedef enum {
+ TYPE_NONE = 0,
+ TYPE_BOOLEAN = 1,
+ TYPE_INTEGER = 2,
+ TYPE_BIT_STRING = 3,
+ TYPE_OCTET_STRING = 4,
+ TYPE_NULL = 5,
+ TYPE_OBJECT_ID = 6,
+ TYPE_OBJECT_DESCRIPTOR = 7,
+ TYPE_EXTERNAL = 8,
+ TYPE_REAL = 9,
+ TYPE_ENUMERATED = 10,
+ TYPE_EMBEDDED_PDV = 11,
+ TYPE_UTF8_STRING = 12,
+ TYPE_REALTIVE_OID = 13,
+ TYPE_SEQUENCE = 16,
+ TYPE_SET = 17,
+ TYPE_NUMERIC_STRING = 18,
+ TYPE_PRINTABLE_STRING = 19,
+ TYPE_TELETEX_STRING = 20,
+ TYPE_VIDEOTEX_STRING = 21,
+ TYPE_IA5_STRING = 22,
+ TYPE_UTC_TIME = 23,
+ TYPE_GENERALIZED_TIME = 24,
+ TYPE_GRAPHIC_STRING = 25,
+ TYPE_VISIBLE_STRING = 26,
+ TYPE_GENERAL_STRING = 27,
+ TYPE_UNIVERSAL_STRING = 28,
+ TYPE_CHARACTER_STRING = 29,
+ TYPE_BMP_STRING = 30,
+ /* the following values do not correspond to an Universal tag */
+ TYPE_CONSTANT = 128,
+ TYPE_IDENTIFIER,
+ TYPE_TAG,
+ TYPE_DEFAULT,
+ TYPE_SIZE,
+ TYPE_SEQUENCE_OF,
+ TYPE_ANY,
+ TYPE_SET_OF,
+ TYPE_DEFINITIONS,
+ TYPE_CHOICE,
+ TYPE_IMPORTS,
+ TYPE_PRE_SEQUENCE /* premanufactured Seqences as used by the DER encoder. */
+} node_type_t;
+
+
+enum tag_class {
+ CLASS_UNIVERSAL = 0,
+ CLASS_APPLICATION = 1,
+ CLASS_CONTEXT = 2,
+ CLASS_PRIVATE =3
+};
+
+#endif /*ASN1_CONSTANTS_H*/
diff --git a/src/asn1-func.c b/src/asn1-func.c
index f93300b..e64c479 100755
--- a/src/asn1-func.c
+++ b/src/asn1-func.c
@@ -47,6 +47,10 @@
#include "asn1-func.h"
+#ifdef BUILD_GENTOOLS
+#define gpgrt_log_debug(...) /**/
+#endif
+
static AsnNode resolve_identifier (AsnNode root, AsnNode node, int nestlevel);
@@ -289,7 +293,8 @@ _ksba_asn_remove_node (AsnNode node)
/* find the node with the given name. A name part of "?LAST" matches
- the last element of a set of */
+ the last element of a SET_OF. A "+" matches the CHOICE with values
+ set. */
static AsnNode
find_node (AsnNode root, const char *name, int resolve)
{
@@ -301,6 +306,7 @@ find_node (AsnNode root, const char *name, int resolve)
if (!name || !name[0])
return NULL;
+ /* gpgrt_log_debug ("%s: looking for '%s'\n", __func__, name); */
/* find the first part */
s = name;
for (i=0; *s && *s != '.' && i < DIM(buf)-1; s++)
@@ -331,6 +337,7 @@ find_node (AsnNode root, const char *name, int resolve)
/* a double dot can be used to get over an unnamed sequence
in a set - Actually a hack to workaround a bug. We should
rethink the entire node naming issue */
+ /* gpgrt_log_debug ("%s: .. to '%s'\n", __func__, p?p->name:""); */
}
else if (!strcmp (buf, "?LAST"))
{
@@ -339,10 +346,19 @@ find_node (AsnNode root, const char *name, int resolve)
while (p->right)
p = p->right;
}
+ else if (*buf == '+' && !buf[1])
+ {
+ for (; p ; p = p->right)
+ if (p->off != -1)
+ break;
+ /* gpgrt_log_debug ("%s: + to '%s'\n", __func__, p?p->name:""); */
+ }
else
{
for (; p ; p = p->right)
{
+ /* gpgrt_log_debug ("%s: '%s' to '%s'\n", */
+ /* __func__, buf, p?p->name:""); */
if (p->name && !strcmp (p->name, buf))
break;
if (resolve && p->name && p->type == TYPE_IDENTIFIER)
diff --git a/src/asn1-func.h b/src/asn1-func.h
index cc34736..fa7b7ee 100755
--- a/src/asn1-func.h
+++ b/src/asn1-func.h
@@ -33,58 +33,7 @@
#ifndef ASN1_FUNC_H
#define ASN1_FUNC_H
-typedef enum {
- TYPE_NONE = 0,
- TYPE_BOOLEAN = 1,
- TYPE_INTEGER = 2,
- TYPE_BIT_STRING = 3,
- TYPE_OCTET_STRING = 4,
- TYPE_NULL = 5,
- TYPE_OBJECT_ID = 6,
- TYPE_OBJECT_DESCRIPTOR = 7,
- TYPE_EXTERNAL = 8,
- TYPE_REAL = 9,
- TYPE_ENUMERATED = 10,
- TYPE_EMBEDDED_PDV = 11,
- TYPE_UTF8_STRING = 12,
- TYPE_REALTIVE_OID = 13,
- TYPE_SEQUENCE = 16,
- TYPE_SET = 17,
- TYPE_NUMERIC_STRING = 18,
- TYPE_PRINTABLE_STRING = 19,
- TYPE_TELETEX_STRING = 20,
- TYPE_VIDEOTEX_STRING = 21,
- TYPE_IA5_STRING = 22,
- TYPE_UTC_TIME = 23,
- TYPE_GENERALIZED_TIME = 24,
- TYPE_GRAPHIC_STRING = 25,
- TYPE_VISIBLE_STRING = 26,
- TYPE_GENERAL_STRING = 27,
- TYPE_UNIVERSAL_STRING = 28,
- TYPE_CHARACTER_STRING = 29,
- TYPE_BMP_STRING = 30,
- /* the following values do not correspond to an Universal tag */
- TYPE_CONSTANT = 128,
- TYPE_IDENTIFIER,
- TYPE_TAG,
- TYPE_DEFAULT,
- TYPE_SIZE,
- TYPE_SEQUENCE_OF,
- TYPE_ANY,
- TYPE_SET_OF,
- TYPE_DEFINITIONS,
- TYPE_CHOICE,
- TYPE_IMPORTS,
- TYPE_PRE_SEQUENCE /* premanufactured Seqences as used by the DER encoder. */
-} node_type_t;
-
-
-enum tag_class {
- CLASS_UNIVERSAL = 0,
- CLASS_APPLICATION = 1,
- CLASS_CONTEXT = 2,
- CLASS_PRIVATE =3
-};
+#include "asn1-constants.h"
/* Important: this must match the code in asn1-gentables.c */
struct node_flag_s {
diff --git a/src/asn1-gentables.c b/src/asn1-gentables.c
index c418fe1..aba642c 100644
--- a/src/asn1-gentables.c
+++ b/src/asn1-gentables.c
@@ -109,10 +109,17 @@ insert_string (const char *name)
static int
cmp_string (const void *aptr, const void *bptr)
{
- const struct name_list_s **a = (const struct name_list_s **)aptr;
- const struct name_list_s **b = (const struct name_list_s **)bptr;
+ const char *a = (*(const struct name_list_s **)aptr)->name;
+ const char *b = (*(const struct name_list_s **)bptr)->name;
- return strlen ((*a)->name) < strlen ((*b)->name);
+ const size_t len_a = strlen(a);
+ const size_t len_b = strlen(b);
+
+ if (len_a < len_b)
+ return -1;
+ if (len_a > len_b)
+ return +1;
+ return strcmp(a, b);
}
static void
diff --git a/src/asn1-parse.c b/src/asn1-parse.c
index 36e0103..29bf4d6 100644
--- a/src/asn1-parse.c
+++ b/src/asn1-parse.c
@@ -189,51 +189,6 @@ extern int yydebug;
BMPSTRING = 301
};
#endif
-/* Tokens. */
-#define ASSIG 258
-#define NUM 259
-#define IDENTIFIER 260
-#define OPTIONAL 261
-#define INTEGER 262
-#define SIZE 263
-#define OCTET 264
-#define STRING 265
-#define SEQUENCE 266
-#define BIT 267
-#define UNIVERSAL 268
-#define PRIVATE 269
-#define DEFAULT 270
-#define CHOICE 271
-#define OF 272
-#define OBJECT 273
-#define STR_IDENTIFIER 274
-#define ksba_BOOLEAN 275
-#define ksba_TRUE 276
-#define ksba_FALSE 277
-#define APPLICATION 278
-#define ANY 279
-#define DEFINED 280
-#define SET 281
-#define BY 282
-#define EXPLICIT 283
-#define IMPLICIT 284
-#define DEFINITIONS 285
-#define TAGS 286
-#define ksba_BEGIN 287
-#define ksba_END 288
-#define UTCTime 289
-#define GeneralizedTime 290
-#define FROM 291
-#define IMPORTS 292
-#define TOKEN_NULL 293
-#define ENUMERATED 294
-#define UTF8STRING 295
-#define NUMERICSTRING 296
-#define PRINTABLESTRING 297
-#define TELETEXSTRING 298
-#define IA5STRING 299
-#define UNIVERSALSTRING 300
-#define BMPSTRING 301
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
@@ -246,7 +201,7 @@ union YYSTYPE
char str[MAX_STRING_LENGTH];
AsnNode node;
-#line 250 "asn1-parse.c" /* yacc.c:355 */
+#line 205 "asn1-parse.c" /* yacc.c:355 */
};
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
@@ -274,7 +229,7 @@ static void set_down (AsnNode node, AsnNode down);
static int yylex (YYSTYPE *lvalp, void *parm);
static void yyerror (void *parm, const char *s);
-#line 278 "asn1-parse.c" /* yacc.c:358 */
+#line 233 "asn1-parse.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -516,16 +471,16 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 2
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 202
+#define YYLAST 195
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 57
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 52
+#define YYNNTS 51
/* YYNRULES -- Number of rules. */
-#define YYNRULES 119
+#define YYNRULES 116
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 210
+#define YYNSTATES 203
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
by yylex, with out-of-bounds checking. */
@@ -577,17 +532,17 @@ static const yytype_uint8 yytranslate[] =
static const yytype_uint16 yyrline[] =
{
0, 184, 184, 185, 188, 189, 192, 199, 200, 203,
- 204, 207, 208, 211, 216, 224, 225, 232, 237, 248,
- 253, 261, 263, 270, 271, 272, 275, 281, 289, 291,
- 296, 303, 308, 313, 320, 324, 330, 341, 347, 351,
- 357, 363, 372, 376, 382, 386, 394, 395, 402, 403,
- 410, 412, 419, 421, 428, 429, 436, 438, 445, 446,
- 455, 456, 457, 458, 459, 460, 461, 467, 475, 479,
- 486, 490, 498, 506, 512, 517, 524, 525, 526, 527,
- 528, 529, 530, 531, 532, 533, 534, 535, 536, 542,
- 546, 557, 561, 568, 575, 582, 584, 591, 596, 601,
- 610, 615, 620, 629, 636, 640, 652, 659, 666, 675,
- 684, 685, 688, 690, 697, 706, 707, 720, 721, 724
+ 204, 207, 208, 211, 216, 224, 225, 250, 255, 263,
+ 265, 272, 273, 274, 277, 283, 291, 293, 298, 305,
+ 310, 315, 322, 326, 332, 343, 349, 353, 359, 365,
+ 374, 378, 384, 388, 396, 397, 404, 405, 412, 414,
+ 421, 423, 430, 431, 438, 440, 447, 448, 457, 458,
+ 459, 460, 461, 462, 463, 469, 477, 481, 488, 492,
+ 500, 508, 514, 519, 526, 527, 528, 529, 530, 531,
+ 532, 533, 534, 535, 536, 537, 538, 544, 548, 559,
+ 563, 570, 577, 584, 586, 593, 598, 603, 612, 617,
+ 622, 631, 638, 642, 654, 661, 668, 677, 686, 687,
+ 690, 692, 699, 708, 724, 725, 728
};
#endif
@@ -609,13 +564,13 @@ static const char *const yytname[] =
"\"BMPString\"", "'+'", "'-'", "'('", "')'", "','", "'['", "']'", "'{'",
"'}'", "'.'", "$accept", "input", "pos_num", "neg_num", "pos_neg_num",
"num_identifier", "pos_neg_identifier", "constant", "constant_list",
- "identifier_list", "obj_constant", "obj_constant_list", "class",
- "tag_type", "tag", "default", "integer_def", "boolean_def", "Time",
- "size_def2", "size_def", "octet_string_def", "utf8_string_def",
- "numeric_string_def", "printable_string_def", "teletex_string_def",
- "ia5_string_def", "universal_string_def", "bmp_string_def", "string_def",
- "bit_element", "bit_element_list", "bit_string_def", "enumerated_def",
- "object_def", "type_assig_right", "type_assig_right_tag",
+ "obj_constant", "obj_constant_list", "class", "tag_type", "tag",
+ "default", "integer_def", "boolean_def", "Time", "size_def2", "size_def",
+ "octet_string_def", "utf8_string_def", "numeric_string_def",
+ "printable_string_def", "teletex_string_def", "ia5_string_def",
+ "universal_string_def", "bmp_string_def", "string_def", "bit_element",
+ "bit_element_list", "bit_string_def", "enumerated_def", "object_def",
+ "type_assig_right", "type_assig_right_tag",
"type_assig_right_tag_default", "type_assig", "type_assig_list",
"sequence_def", "set_def", "choise_def", "any_def", "type_def",
"constant_def", "type_constant", "type_constant_list", "definitions_id",
@@ -637,10 +592,10 @@ static const yytype_uint16 yytoknum[] =
};
# endif
-#define YYPACT_NINF -120
+#define YYPACT_NINF -137
#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-120)))
+ (!!((Yystate) == (-137)))
#define YYTABLE_NINF -1
@@ -651,27 +606,27 @@ static const yytype_uint16 yytoknum[] =
STATE-NUM. */
static const yytype_int16 yypact[] =
{
- -120, 26, -120, -31, 7, -120, 42, 67, -120, 31,
- -120, -120, 1, -120, -120, 54, 105, -120, -120, 49,
- 70, 93, -120, 90, 124, 126, -120, 22, 100, -120,
- -120, -120, 38, -120, 130, 48, 134, 136, 125, -120,
- -120, 42, 24, 89, 135, 13, 138, 95, 140, -120,
- 137, 16, -120, -120, -120, 106, 24, 24, 24, 24,
- 24, 24, 24, 25, 83, 112, 114, -120, -120, -120,
- -120, -120, -120, -120, -120, -120, -120, -120, -120, -120,
- -120, -120, -120, -120, -120, -120, -120, 107, 160, 162,
- 42, 117, 159, -120, -120, 20, 24, 112, 163, 153,
- 118, 163, -120, 144, 112, 163, 156, 169, -120, -120,
- -120, -120, -120, -120, -120, 122, -120, -120, -120, 172,
- -120, -120, -120, 129, 42, -120, 123, 129, 128, 131,
- 3, -120, -15, -120, -120, 48, -120, -6, 112, 169,
- 46, 174, -120, 51, 112, 132, -120, 53, -120, 133,
- -120, 127, 6, 42, -28, -120, 3, -120, 178, 180,
- -120, -120, 139, 20, -120, 29, -120, 163, -120, -120,
- 59, -120, -120, -120, -120, 181, 169, -120, -120, 141,
- -120, 8, -120, 142, 143, -120, -120, -120, -120, -120,
- 94, -120, -120, -120, 145, -120, 129, -120, 129, -120,
- -120, -120, -120, -120, -120, -120, 146, 149, -120, -120
+ -137, 33, -137, -39, 0, -137, 76, 115, -137, 4,
+ -137, -137, -1, -137, -137, 15, 63, -137, -137, 59,
+ 77, 86, -137, -137, 105, 24, -137, -137, -137, 18,
+ 52, 126, 129, 128, -137, -137, 16, 94, 139, 17,
+ 140, 97, 133, -137, 130, 20, -137, -137, -137, 99,
+ 16, 16, 16, 16, 16, 16, 16, 22, 117, 96,
+ 107, -137, -137, -137, -137, -137, -137, -137, -137, -137,
+ -137, -137, -137, -137, -137, -137, -137, -137, -137, -137,
+ -137, 100, 153, 155, 110, 152, -137, -137, 7, 16,
+ 96, 156, 146, 111, 156, -137, 137, 96, 156, 149,
+ 162, -137, -137, -137, -137, -137, -137, -137, 116, -137,
+ -137, -137, 164, -137, -137, -137, 84, 76, -137, 118,
+ 84, 120, 122, 37, -137, -3, -137, -137, 52, -137,
+ 51, 96, 162, 58, 168, -137, 60, 96, 125, -137,
+ 66, -137, 123, -137, 119, 3, 76, -6, -137, 37,
+ -137, 173, 174, -137, -137, 131, 7, -137, 34, -137,
+ 156, -137, -137, 68, -137, -137, -137, -137, 175, 162,
+ -137, -137, 124, -137, 5, -137, 127, 132, -137, -137,
+ -137, -137, -137, 78, -137, -137, -137, 134, -137, 84,
+ -137, 84, -137, -137, -137, -137, -137, -137, -137, 135,
+ 136, -137, -137
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -680,48 +635,48 @@ static const yytype_int16 yypact[] =
static const yytype_uint8 yydefact[] =
{
2, 0, 1, 0, 0, 3, 0, 0, 9, 10,
- 19, 21, 0, 117, 118, 0, 0, 114, 22, 0,
- 0, 0, 20, 115, 0, 0, 17, 0, 0, 110,
- 111, 112, 0, 18, 0, 0, 0, 0, 0, 119,
- 113, 0, 74, 34, 0, 0, 0, 0, 0, 37,
- 104, 0, 38, 39, 88, 0, 46, 48, 50, 52,
- 54, 56, 58, 0, 28, 0, 76, 78, 80, 81,
- 60, 61, 62, 63, 64, 65, 66, 79, 82, 77,
- 84, 89, 106, 83, 87, 85, 86, 0, 0, 0,
- 0, 0, 0, 42, 75, 0, 44, 0, 0, 0,
- 70, 0, 73, 0, 0, 0, 0, 0, 47, 49,
- 51, 53, 55, 57, 59, 0, 23, 24, 25, 0,
- 29, 30, 90, 0, 0, 109, 0, 0, 0, 0,
- 0, 15, 0, 45, 98, 0, 95, 0, 0, 0,
- 0, 0, 101, 0, 0, 0, 68, 0, 26, 0,
- 10, 0, 0, 0, 0, 43, 0, 4, 0, 0,
- 7, 8, 0, 0, 35, 91, 94, 0, 97, 99,
- 0, 103, 105, 100, 102, 0, 0, 72, 27, 0,
- 108, 0, 40, 0, 0, 5, 6, 13, 16, 93,
- 0, 92, 96, 71, 0, 69, 0, 107, 0, 14,
- 12, 32, 33, 11, 31, 67, 0, 0, 36, 41
+ 17, 19, 0, 114, 115, 0, 0, 112, 20, 0,
+ 0, 0, 18, 113, 0, 0, 108, 109, 110, 0,
+ 0, 0, 0, 0, 116, 111, 72, 32, 0, 0,
+ 0, 0, 0, 35, 102, 0, 36, 37, 86, 0,
+ 44, 46, 48, 50, 52, 54, 56, 0, 26, 0,
+ 74, 76, 78, 79, 58, 59, 60, 61, 62, 63,
+ 64, 77, 80, 75, 82, 87, 104, 81, 85, 83,
+ 84, 0, 0, 0, 0, 0, 40, 73, 0, 42,
+ 0, 0, 0, 68, 0, 71, 0, 0, 0, 0,
+ 0, 45, 47, 49, 51, 53, 55, 57, 0, 21,
+ 22, 23, 0, 27, 28, 88, 0, 0, 107, 0,
+ 0, 0, 0, 0, 15, 0, 43, 96, 0, 93,
+ 0, 0, 0, 0, 0, 99, 0, 0, 0, 66,
+ 0, 24, 0, 10, 0, 0, 0, 0, 41, 0,
+ 4, 0, 0, 7, 8, 0, 0, 33, 89, 92,
+ 0, 95, 97, 0, 101, 103, 98, 100, 0, 0,
+ 70, 25, 0, 106, 0, 38, 0, 0, 5, 6,
+ 13, 16, 91, 0, 90, 94, 69, 0, 67, 0,
+ 105, 0, 14, 12, 30, 31, 11, 29, 65, 0,
+ 0, 34, 39
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -120, -120, -120, -120, -114, -119, -120, 27, -120, -120,
- -12, -40, -120, -120, -120, -120, -120, -120, -120, 96,
- -42, -120, -120, -120, -120, -120, -120, -120, -120, -120,
- 11, 52, -120, -120, -120, -63, 57, -120, 33, 21,
- -120, -120, -120, -120, -120, -120, 170, -120, -120, -120,
- -120, -120
+ -137, -137, -137, -137, -136, -114, -137, 31, -137, -12,
+ -103, -137, -137, -137, -137, -137, -137, -137, 103, -34,
+ -137, -137, -137, -137, -137, -137, -137, -137, -137, 21,
+ 57, -137, -137, -137, -58, 64, -137, 35, 30, -137,
+ -137, -137, -137, -137, -137, 165, -137, -137, -137, -137,
+ -137
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 1, 160, 161, 162, 10, 204, 131, 132, 27,
- 11, 12, 119, 64, 65, 191, 66, 67, 68, 93,
- 94, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 146, 147, 78, 79, 80, 81, 82, 166, 136, 137,
- 83, 84, 85, 86, 29, 30, 31, 32, 4, 25,
- 15, 5
+ -1, 1, 153, 154, 155, 10, 197, 124, 125, 11,
+ 12, 112, 58, 59, 184, 60, 61, 62, 86, 87,
+ 63, 64, 65, 66, 67, 68, 69, 70, 71, 139,
+ 140, 72, 73, 74, 75, 76, 159, 129, 130, 77,
+ 78, 79, 80, 26, 27, 28, 29, 4, 24, 15,
+ 5
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
@@ -729,79 +684,77 @@ static const yytype_int16 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_uint8 yytable[] =
{
- 18, 90, 122, 99, 151, 8, 9, 157, 154, 106,
- 8, 9, 8, 9, 108, 109, 110, 111, 112, 113,
- 114, 91, 182, 6, 91, 129, 2, 33, 183, 115,
- 97, 3, 91, 104, 134, 189, 163, 7, 116, 117,
- 164, 142, 184, 28, 190, 167, 8, 9, 118, 168,
- 158, 159, 21, 42, 133, 43, 17, 44, 34, 45,
- 46, 180, 92, 197, 47, 92, 48, 98, 49, 130,
- 105, 39, 50, 92, 51, 169, 203, 206, 18, 207,
- 16, 174, 52, 53, 152, 19, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 13, 14, 167, 157, 200,
- 63, 171, 167, 35, 176, 36, 173, 37, 177, 20,
- 176, 120, 121, 181, 193, 201, 202, 42, 38, 43,
- 22, 44, 140, 45, 46, 23, 143, 24, 47, 26,
- 48, 28, 49, 8, 150, 41, 50, 87, 51, 88,
- 18, 158, 159, 95, 89, 96, 52, 53, 100, 101,
- 54, 55, 56, 57, 58, 59, 60, 61, 62, 102,
- 107, 124, 103, 123, 125, 126, 127, 91, 135, 18,
- 138, 141, 139, 144, 145, 148, 149, 153, 155, 172,
- 156, 175, 185, 179, 186, 194, 178, 195, 128, 187,
- 188, 170, 165, 199, 0, 205, 208, 196, 198, 209,
- 192, 0, 40
+ 18, 115, 144, 8, 9, 92, 147, 8, 9, 8,
+ 9, 99, 122, 177, 145, 6, 101, 102, 103, 104,
+ 105, 106, 107, 25, 84, 84, 108, 30, 84, 31,
+ 7, 32, 127, 2, 90, 109, 110, 97, 3, 135,
+ 182, 150, 33, 174, 175, 111, 19, 196, 156, 183,
+ 176, 34, 157, 16, 17, 126, 123, 36, 173, 37,
+ 190, 38, 21, 39, 40, 85, 85, 20, 41, 85,
+ 42, 91, 43, 162, 98, 199, 44, 200, 45, 167,
+ 8, 9, 150, 193, 151, 152, 46, 47, 8, 143,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 194,
+ 195, 36, 160, 37, 57, 38, 161, 39, 40, 160,
+ 25, 160, 41, 164, 42, 166, 43, 169, 23, 169,
+ 44, 170, 45, 186, 133, 151, 152, 22, 136, 81,
+ 46, 47, 82, 18, 48, 49, 50, 51, 52, 53,
+ 54, 55, 56, 13, 14, 113, 114, 83, 88, 89,
+ 93, 94, 95, 100, 117, 96, 116, 118, 119, 120,
+ 84, 128, 18, 131, 134, 132, 137, 138, 142, 141,
+ 148, 149, 146, 165, 168, 172, 171, 178, 179, 187,
+ 189, 180, 192, 191, 198, 201, 202, 181, 121, 163,
+ 188, 0, 158, 0, 35, 185
};
static const yytype_int16 yycheck[] =
{
- 12, 41, 65, 45, 123, 4, 5, 4, 127, 51,
- 4, 5, 4, 5, 56, 57, 58, 59, 60, 61,
- 62, 8, 50, 54, 8, 5, 0, 5, 56, 4,
- 17, 5, 8, 17, 97, 6, 51, 30, 13, 14,
- 55, 104, 156, 5, 15, 51, 4, 5, 23, 55,
- 47, 48, 3, 5, 96, 7, 55, 9, 36, 11,
- 12, 55, 49, 55, 16, 49, 18, 54, 20, 49,
- 54, 33, 24, 49, 26, 138, 190, 196, 90, 198,
- 49, 144, 34, 35, 124, 31, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 28, 29, 51, 4, 5,
- 52, 55, 51, 3, 51, 5, 55, 7, 55, 4,
- 51, 28, 29, 153, 55, 21, 22, 5, 18, 7,
- 50, 9, 101, 11, 12, 32, 105, 37, 16, 5,
- 18, 5, 20, 4, 5, 5, 24, 3, 26, 3,
- 152, 47, 48, 54, 19, 10, 34, 35, 10, 54,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 19,
- 54, 54, 25, 49, 4, 3, 49, 8, 5, 181,
- 17, 27, 54, 17, 5, 53, 4, 54, 50, 5,
- 49, 49, 4, 56, 4, 4, 53, 176, 92, 50,
- 163, 139, 135, 50, -1, 50, 50, 56, 56, 50,
- 167, -1, 32
+ 12, 59, 116, 4, 5, 39, 120, 4, 5, 4,
+ 5, 45, 5, 149, 117, 54, 50, 51, 52, 53,
+ 54, 55, 56, 5, 8, 8, 4, 3, 8, 5,
+ 30, 7, 90, 0, 17, 13, 14, 17, 5, 97,
+ 6, 4, 18, 146, 50, 23, 31, 183, 51, 15,
+ 56, 33, 55, 49, 55, 89, 49, 5, 55, 7,
+ 55, 9, 3, 11, 12, 49, 49, 4, 16, 49,
+ 18, 54, 20, 131, 54, 189, 24, 191, 26, 137,
+ 4, 5, 4, 5, 47, 48, 34, 35, 4, 5,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 21,
+ 22, 5, 51, 7, 52, 9, 55, 11, 12, 51,
+ 5, 51, 16, 55, 18, 55, 20, 51, 32, 51,
+ 24, 55, 26, 55, 94, 47, 48, 50, 98, 3,
+ 34, 35, 3, 145, 38, 39, 40, 41, 42, 43,
+ 44, 45, 46, 28, 29, 28, 29, 19, 54, 10,
+ 10, 54, 19, 54, 54, 25, 49, 4, 3, 49,
+ 8, 5, 174, 17, 27, 54, 17, 5, 4, 53,
+ 50, 49, 54, 5, 49, 56, 53, 4, 4, 4,
+ 56, 50, 50, 56, 50, 50, 50, 156, 85, 132,
+ 169, -1, 128, -1, 29, 160
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
- 0, 58, 0, 5, 105, 108, 54, 30, 4, 5,
- 62, 67, 68, 28, 29, 107, 49, 55, 67, 31,
- 4, 3, 50, 32, 37, 106, 5, 66, 5, 101,
- 102, 103, 104, 5, 36, 3, 5, 7, 18, 33,
- 103, 5, 5, 7, 9, 11, 12, 16, 18, 20,
- 24, 26, 34, 35, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 52, 70, 71, 73, 74, 75, 78,
- 79, 80, 81, 82, 83, 84, 85, 86, 89, 90,
- 91, 92, 93, 97, 98, 99, 100, 3, 3, 19,
- 68, 8, 49, 76, 77, 54, 10, 17, 54, 77,
- 10, 54, 19, 25, 17, 54, 77, 54, 77, 77,
- 77, 77, 77, 77, 77, 4, 13, 14, 23, 69,
- 28, 29, 92, 49, 54, 4, 3, 49, 76, 5,
- 49, 64, 65, 77, 92, 5, 95, 96, 17, 54,
- 96, 27, 92, 96, 17, 5, 87, 88, 53, 4,
- 5, 62, 68, 54, 62, 50, 49, 4, 47, 48,
- 59, 60, 61, 51, 55, 93, 94, 51, 55, 92,
- 88, 55, 5, 55, 92, 49, 51, 55, 53, 56,
- 55, 68, 50, 56, 61, 4, 4, 50, 64, 6,
- 15, 72, 95, 55, 4, 87, 56, 55, 56, 50,
- 5, 21, 22, 61, 63, 50, 62, 62, 50, 50
+ 0, 58, 0, 5, 104, 107, 54, 30, 4, 5,
+ 62, 66, 67, 28, 29, 106, 49, 55, 66, 31,
+ 4, 3, 50, 32, 105, 5, 100, 101, 102, 103,
+ 3, 5, 7, 18, 33, 102, 5, 7, 9, 11,
+ 12, 16, 18, 20, 24, 26, 34, 35, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 52, 69, 70,
+ 72, 73, 74, 77, 78, 79, 80, 81, 82, 83,
+ 84, 85, 88, 89, 90, 91, 92, 96, 97, 98,
+ 99, 3, 3, 19, 8, 49, 75, 76, 54, 10,
+ 17, 54, 76, 10, 54, 19, 25, 17, 54, 76,
+ 54, 76, 76, 76, 76, 76, 76, 76, 4, 13,
+ 14, 23, 68, 28, 29, 91, 49, 54, 4, 3,
+ 49, 75, 5, 49, 64, 65, 76, 91, 5, 94,
+ 95, 17, 54, 95, 27, 91, 95, 17, 5, 86,
+ 87, 53, 4, 5, 62, 67, 54, 62, 50, 49,
+ 4, 47, 48, 59, 60, 61, 51, 55, 92, 93,
+ 51, 55, 91, 87, 55, 5, 55, 91, 49, 51,
+ 55, 53, 56, 55, 67, 50, 56, 61, 4, 4,
+ 50, 64, 6, 15, 71, 94, 55, 4, 86, 56,
+ 55, 56, 50, 5, 21, 22, 61, 63, 50, 62,
+ 62, 50, 50
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
@@ -809,33 +762,33 @@ static const yytype_uint8 yyr1[] =
{
0, 57, 58, 58, 59, 59, 60, 61, 61, 62,
62, 63, 63, 64, 64, 65, 65, 66, 66, 67,
- 67, 68, 68, 69, 69, 69, 70, 70, 71, 71,
- 71, 72, 72, 72, 73, 73, 73, 74, 75, 75,
+ 67, 68, 68, 68, 69, 69, 70, 70, 70, 71,
+ 71, 71, 72, 72, 72, 73, 74, 74, 75, 75,
76, 76, 77, 77, 78, 78, 79, 79, 80, 80,
81, 81, 82, 82, 83, 83, 84, 84, 85, 85,
- 86, 86, 86, 86, 86, 86, 86, 87, 88, 88,
- 89, 89, 90, 91, 92, 92, 92, 92, 92, 92,
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 93,
- 93, 94, 94, 94, 95, 96, 96, 97, 97, 97,
- 98, 98, 98, 99, 100, 100, 101, 102, 102, 102,
- 103, 103, 104, 104, 105, 106, 106, 107, 107, 108
+ 85, 85, 85, 85, 85, 86, 87, 87, 88, 88,
+ 89, 90, 91, 91, 91, 91, 91, 91, 91, 91,
+ 91, 91, 91, 91, 91, 91, 91, 92, 92, 93,
+ 93, 93, 94, 95, 95, 96, 96, 96, 97, 97,
+ 97, 98, 99, 99, 100, 101, 101, 101, 102, 102,
+ 103, 103, 104, 105, 106, 106, 107
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 0, 2, 1, 2, 2, 1, 1, 1,
- 1, 1, 1, 3, 4, 1, 3, 1, 2, 1,
- 4, 1, 2, 1, 1, 1, 3, 4, 1, 2,
- 2, 2, 2, 2, 1, 4, 7, 1, 1, 1,
- 4, 7, 1, 3, 2, 3, 1, 2, 1, 2,
- 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
- 1, 1, 1, 1, 1, 1, 1, 4, 1, 3,
- 2, 5, 4, 2, 1, 2, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 1, 2, 2, 2, 1, 3, 4, 3, 4,
- 4, 3, 4, 4, 1, 4, 3, 7, 6, 4,
- 1, 1, 1, 2, 4, 0, 5, 1, 1, 9
+ 1, 1, 1, 3, 4, 1, 3, 1, 4, 1,
+ 2, 1, 1, 1, 3, 4, 1, 2, 2, 2,
+ 2, 2, 1, 4, 7, 1, 1, 1, 4, 7,
+ 1, 3, 2, 3, 1, 2, 1, 2, 1, 2,
+ 1, 2, 1, 2, 1, 2, 1, 2, 1, 1,
+ 1, 1, 1, 1, 1, 4, 1, 3, 2, 5,
+ 4, 2, 1, 2, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
+ 2, 2, 2, 1, 3, 4, 3, 4, 4, 3,
+ 4, 4, 1, 4, 3, 7, 6, 4, 1, 1,
+ 1, 2, 4, 0, 1, 1, 9
};
@@ -1520,13 +1473,13 @@ yyreduce:
case 4:
#line 188 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ strcpy((yyval.str),(yyvsp[0].str)); }
-#line 1524 "asn1-parse.c" /* yacc.c:1646 */
+#line 1477 "asn1-parse.c" /* yacc.c:1646 */
break;
case 5:
#line 189 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ strcpy((yyval.str),(yyvsp[0].str)); }
-#line 1530 "asn1-parse.c" /* yacc.c:1646 */
+#line 1483 "asn1-parse.c" /* yacc.c:1646 */
break;
case 6:
@@ -1535,43 +1488,43 @@ yyreduce:
strcpy((yyval.str),"-");
strcat((yyval.str),(yyvsp[0].str));
}
-#line 1539 "asn1-parse.c" /* yacc.c:1646 */
+#line 1492 "asn1-parse.c" /* yacc.c:1646 */
break;
case 7:
#line 199 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ strcpy((yyval.str),(yyvsp[0].str)); }
-#line 1545 "asn1-parse.c" /* yacc.c:1646 */
+#line 1498 "asn1-parse.c" /* yacc.c:1646 */
break;
case 8:
#line 200 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ strcpy((yyval.str),(yyvsp[0].str)); }
-#line 1551 "asn1-parse.c" /* yacc.c:1646 */
+#line 1504 "asn1-parse.c" /* yacc.c:1646 */
break;
case 9:
#line 203 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{strcpy((yyval.str),(yyvsp[0].str));}
-#line 1557 "asn1-parse.c" /* yacc.c:1646 */
+#line 1510 "asn1-parse.c" /* yacc.c:1646 */
break;
case 10:
#line 204 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{strcpy((yyval.str),(yyvsp[0].str));}
-#line 1563 "asn1-parse.c" /* yacc.c:1646 */
+#line 1516 "asn1-parse.c" /* yacc.c:1646 */
break;
case 11:
#line 207 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{strcpy((yyval.str),(yyvsp[0].str));}
-#line 1569 "asn1-parse.c" /* yacc.c:1646 */
+#line 1522 "asn1-parse.c" /* yacc.c:1646 */
break;
case 12:
#line 208 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{strcpy((yyval.str),(yyvsp[0].str));}
-#line 1575 "asn1-parse.c" /* yacc.c:1646 */
+#line 1528 "asn1-parse.c" /* yacc.c:1646 */
break;
case 13:
@@ -1580,7 +1533,7 @@ yyreduce:
(yyval.node) = NEW_NODE (TYPE_CONSTANT);
set_str_value ((yyval.node), (yyvsp[-1].str));
}
-#line 1584 "asn1-parse.c" /* yacc.c:1646 */
+#line 1537 "asn1-parse.c" /* yacc.c:1646 */
break;
case 14:
@@ -1590,13 +1543,13 @@ yyreduce:
set_name ((yyval.node), (yyvsp[-3].str));
set_str_value ((yyval.node), (yyvsp[-1].str));
}
-#line 1594 "asn1-parse.c" /* yacc.c:1646 */
+#line 1547 "asn1-parse.c" /* yacc.c:1646 */
break;
case 15:
#line 224 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node)=(yyvsp[0].node); }
-#line 1600 "asn1-parse.c" /* yacc.c:1646 */
+#line 1553 "asn1-parse.c" /* yacc.c:1646 */
break;
case 16:
@@ -1605,174 +1558,152 @@ yyreduce:
(yyval.node) = (yyvsp[-2].node);
append_right ((yyvsp[-2].node), (yyvsp[0].node));
}
-#line 1609 "asn1-parse.c" /* yacc.c:1646 */
+#line 1562 "asn1-parse.c" /* yacc.c:1646 */
break;
case 17:
-#line 233 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
- {
- (yyval.node) = NEW_NODE (TYPE_IDENTIFIER);
- set_name((yyval.node),(yyvsp[0].str));
- }
-#line 1618 "asn1-parse.c" /* yacc.c:1646 */
- break;
-
- case 18:
-#line 238 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
- {
- AsnNode node;
-
- (yyval.node)=(yyvsp[-1].node);
- node = NEW_NODE (TYPE_IDENTIFIER);
- set_name (node, (yyvsp[0].str));
- append_right ((yyval.node), node);
- }
-#line 1631 "asn1-parse.c" /* yacc.c:1646 */
- break;
-
- case 19:
-#line 249 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+#line 251 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_CONSTANT);
set_str_value ((yyval.node), (yyvsp[0].str));
}
-#line 1640 "asn1-parse.c" /* yacc.c:1646 */
+#line 1571 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 20:
-#line 254 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 18:
+#line 256 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_CONSTANT);
set_name ((yyval.node), (yyvsp[-3].str));
set_str_value ((yyval.node), (yyvsp[-1].str));
}
-#line 1650 "asn1-parse.c" /* yacc.c:1646 */
+#line 1581 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 21:
-#line 262 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 19:
+#line 264 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node)=(yyvsp[0].node);}
-#line 1656 "asn1-parse.c" /* yacc.c:1646 */
+#line 1587 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 22:
-#line 264 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 20:
+#line 266 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node)=(yyvsp[-1].node);
append_right ((yyval.node), (yyvsp[0].node));
}
-#line 1665 "asn1-parse.c" /* yacc.c:1646 */
+#line 1596 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 23:
-#line 270 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 21:
+#line 272 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.constant) = CLASS_UNIVERSAL; }
-#line 1671 "asn1-parse.c" /* yacc.c:1646 */
+#line 1602 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 24:
-#line 271 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 22:
+#line 273 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.constant) = CLASS_PRIVATE; }
-#line 1677 "asn1-parse.c" /* yacc.c:1646 */
+#line 1608 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 25:
-#line 272 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 23:
+#line 274 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.constant) = CLASS_APPLICATION; }
-#line 1683 "asn1-parse.c" /* yacc.c:1646 */
+#line 1614 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 26:
-#line 276 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 24:
+#line 278 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_TAG);
(yyval.node)->flags.class = CLASS_CONTEXT;
set_ulong_value ((yyval.node), (yyvsp[-1].str));
}
-#line 1693 "asn1-parse.c" /* yacc.c:1646 */
+#line 1624 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 27:
-#line 282 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 25:
+#line 284 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_TAG);
(yyval.node)->flags.class = (yyvsp[-2].constant);
set_ulong_value ((yyval.node), (yyvsp[-1].str));
}
-#line 1703 "asn1-parse.c" /* yacc.c:1646 */
+#line 1634 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 28:
-#line 290 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 26:
+#line 292 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node) = (yyvsp[0].node); }
-#line 1709 "asn1-parse.c" /* yacc.c:1646 */
+#line 1640 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 29:
-#line 292 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 27:
+#line 294 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = (yyvsp[-1].node);
(yyval.node)->flags.explicit = 1;
}
-#line 1718 "asn1-parse.c" /* yacc.c:1646 */
+#line 1649 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 30:
-#line 297 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 28:
+#line 299 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = (yyvsp[-1].node);
(yyval.node)->flags.implicit = 1;
}
-#line 1727 "asn1-parse.c" /* yacc.c:1646 */
+#line 1658 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 31:
-#line 304 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 29:
+#line 306 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_DEFAULT);
set_str_value ((yyval.node), (yyvsp[0].str));
}
-#line 1736 "asn1-parse.c" /* yacc.c:1646 */
+#line 1667 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 32:
-#line 309 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 30:
+#line 311 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_DEFAULT);
(yyval.node)->flags.is_true = 1;
}
-#line 1745 "asn1-parse.c" /* yacc.c:1646 */
+#line 1676 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 33:
-#line 314 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 31:
+#line 316 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_DEFAULT);
(yyval.node)->flags.is_false = 1;
}
-#line 1754 "asn1-parse.c" /* yacc.c:1646 */
+#line 1685 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 34:
-#line 321 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 32:
+#line 323 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_INTEGER);
}
-#line 1762 "asn1-parse.c" /* yacc.c:1646 */
+#line 1693 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 35:
-#line 325 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 33:
+#line 327 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_INTEGER);
(yyval.node)->flags.has_list = 1;
set_down ((yyval.node), (yyvsp[-1].node));
}
-#line 1772 "asn1-parse.c" /* yacc.c:1646 */
+#line 1703 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 36:
-#line 331 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 34:
+#line 333 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_INTEGER);
(yyval.node)->flags.has_min_max = 1;
@@ -1781,367 +1712,367 @@ yyreduce:
set_str_value ((yyval.node)->down, (yyvsp[-1].str));
set_name ((yyval.node)->down, (yyvsp[-4].str));
}
-#line 1785 "asn1-parse.c" /* yacc.c:1646 */
+#line 1716 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 37:
-#line 342 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 35:
+#line 344 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_BOOLEAN);
}
-#line 1793 "asn1-parse.c" /* yacc.c:1646 */
+#line 1724 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 38:
-#line 348 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 36:
+#line 350 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_UTC_TIME);
}
-#line 1801 "asn1-parse.c" /* yacc.c:1646 */
+#line 1732 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 39:
-#line 352 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 37:
+#line 354 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_GENERALIZED_TIME);
}
-#line 1809 "asn1-parse.c" /* yacc.c:1646 */
+#line 1740 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 40:
-#line 358 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 38:
+#line 360 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_SIZE);
(yyval.node)->flags.one_param = 1;
set_str_value ((yyval.node), (yyvsp[-1].str));
}
-#line 1819 "asn1-parse.c" /* yacc.c:1646 */
+#line 1750 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 41:
-#line 364 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 39:
+#line 366 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_SIZE);
(yyval.node)->flags.has_min_max = 1;
set_str_value ((yyval.node), (yyvsp[-4].str));
set_name ((yyval.node), (yyvsp[-1].str));
}
-#line 1830 "asn1-parse.c" /* yacc.c:1646 */
+#line 1761 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 42:
-#line 373 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 40:
+#line 375 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node)=(yyvsp[0].node);
}
-#line 1838 "asn1-parse.c" /* yacc.c:1646 */
+#line 1769 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 43:
-#line 377 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 41:
+#line 379 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node)=(yyvsp[-1].node);
}
-#line 1846 "asn1-parse.c" /* yacc.c:1646 */
+#line 1777 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 44:
-#line 383 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 42:
+#line 385 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_OCTET_STRING);
}
-#line 1854 "asn1-parse.c" /* yacc.c:1646 */
+#line 1785 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 45:
-#line 387 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 43:
+#line 389 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_OCTET_STRING);
(yyval.node)->flags.has_size = 1;
set_down ((yyval.node),(yyvsp[0].node));
}
-#line 1864 "asn1-parse.c" /* yacc.c:1646 */
+#line 1795 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 46:
-#line 394 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 44:
+#line 396 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node) = NEW_NODE (TYPE_UTF8_STRING); }
-#line 1870 "asn1-parse.c" /* yacc.c:1646 */
+#line 1801 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 47:
-#line 396 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 45:
+#line 398 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_UTF8_STRING);
(yyval.node)->flags.has_size = 1;
set_down ((yyval.node),(yyvsp[0].node));
}
-#line 1880 "asn1-parse.c" /* yacc.c:1646 */
+#line 1811 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 48:
-#line 402 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 46:
+#line 404 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node) = NEW_NODE (TYPE_NUMERIC_STRING); }
-#line 1886 "asn1-parse.c" /* yacc.c:1646 */
+#line 1817 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 49:
-#line 404 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 47:
+#line 406 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_NUMERIC_STRING);
(yyval.node)->flags.has_size = 1;
set_down ((yyval.node),(yyvsp[0].node));
}
-#line 1896 "asn1-parse.c" /* yacc.c:1646 */
+#line 1827 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 50:
-#line 411 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 48:
+#line 413 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node) = NEW_NODE (TYPE_PRINTABLE_STRING); }
-#line 1902 "asn1-parse.c" /* yacc.c:1646 */
+#line 1833 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 51:
-#line 413 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 49:
+#line 415 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_PRINTABLE_STRING);
(yyval.node)->flags.has_size = 1;
set_down ((yyval.node),(yyvsp[0].node));
}
-#line 1912 "asn1-parse.c" /* yacc.c:1646 */
+#line 1843 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 52:
-#line 420 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 50:
+#line 422 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node) = NEW_NODE (TYPE_TELETEX_STRING); }
-#line 1918 "asn1-parse.c" /* yacc.c:1646 */
+#line 1849 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 53:
-#line 422 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 51:
+#line 424 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_TELETEX_STRING);
(yyval.node)->flags.has_size = 1;
set_down ((yyval.node),(yyvsp[0].node));
}
-#line 1928 "asn1-parse.c" /* yacc.c:1646 */
+#line 1859 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 54:
-#line 428 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 52:
+#line 430 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node) = NEW_NODE (TYPE_IA5_STRING); }
-#line 1934 "asn1-parse.c" /* yacc.c:1646 */
+#line 1865 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 55:
-#line 430 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 53:
+#line 432 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_IA5_STRING);
(yyval.node)->flags.has_size = 1;
set_down ((yyval.node),(yyvsp[0].node));
}
-#line 1944 "asn1-parse.c" /* yacc.c:1646 */
+#line 1875 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 56:
-#line 437 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 54:
+#line 439 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node) = NEW_NODE (TYPE_UNIVERSAL_STRING); }
-#line 1950 "asn1-parse.c" /* yacc.c:1646 */
+#line 1881 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 57:
-#line 439 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 55:
+#line 441 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_UNIVERSAL_STRING);
(yyval.node)->flags.has_size = 1;
set_down ((yyval.node),(yyvsp[0].node));
}
-#line 1960 "asn1-parse.c" /* yacc.c:1646 */
+#line 1891 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 58:
-#line 445 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 56:
+#line 447 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node) = NEW_NODE (TYPE_BMP_STRING); }
-#line 1966 "asn1-parse.c" /* yacc.c:1646 */
+#line 1897 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 59:
-#line 447 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 57:
+#line 449 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_BMP_STRING);
(yyval.node)->flags.has_size = 1;
set_down ((yyval.node),(yyvsp[0].node));
}
-#line 1976 "asn1-parse.c" /* yacc.c:1646 */
+#line 1907 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 67:
-#line 468 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 65:
+#line 470 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_CONSTANT);
set_name ((yyval.node), (yyvsp[-3].str));
set_str_value ((yyval.node), (yyvsp[-1].str));
}
-#line 1986 "asn1-parse.c" /* yacc.c:1646 */
+#line 1917 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 68:
-#line 476 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 66:
+#line 478 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node)=(yyvsp[0].node);
}
-#line 1994 "asn1-parse.c" /* yacc.c:1646 */
+#line 1925 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 69:
-#line 480 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 67:
+#line 482 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node)=(yyvsp[-2].node);
append_right ((yyval.node), (yyvsp[0].node));
}
-#line 2003 "asn1-parse.c" /* yacc.c:1646 */
+#line 1934 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 70:
-#line 487 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 68:
+#line 489 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_BIT_STRING);
}
-#line 2011 "asn1-parse.c" /* yacc.c:1646 */
+#line 1942 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 71:
-#line 491 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 69:
+#line 493 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_BIT_STRING);
(yyval.node)->flags.has_list = 1;
set_down ((yyval.node), (yyvsp[-1].node));
}
-#line 2021 "asn1-parse.c" /* yacc.c:1646 */
+#line 1952 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 72:
-#line 499 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 70:
+#line 501 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_ENUMERATED);
(yyval.node)->flags.has_list = 1;
set_down ((yyval.node), (yyvsp[-1].node));
}
-#line 2031 "asn1-parse.c" /* yacc.c:1646 */
+#line 1962 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 73:
-#line 507 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 71:
+#line 509 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_OBJECT_ID);
}
-#line 2039 "asn1-parse.c" /* yacc.c:1646 */
+#line 1970 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 74:
-#line 513 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 72:
+#line 515 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_IDENTIFIER);
set_str_value ((yyval.node), (yyvsp[0].str));
}
-#line 2048 "asn1-parse.c" /* yacc.c:1646 */
+#line 1979 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 75:
-#line 518 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 73:
+#line 520 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_IDENTIFIER);
(yyval.node)->flags.has_size = 1;
set_str_value ((yyval.node), (yyvsp[-1].str));
set_down ((yyval.node), (yyvsp[0].node));
}
-#line 2059 "asn1-parse.c" /* yacc.c:1646 */
+#line 1990 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 76:
-#line 524 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
- {(yyval.node)=(yyvsp[0].node);}
-#line 2065 "asn1-parse.c" /* yacc.c:1646 */
- break;
-
- case 77:
-#line 525 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
- {(yyval.node)=(yyvsp[0].node);}
-#line 2071 "asn1-parse.c" /* yacc.c:1646 */
- break;
-
- case 78:
+ case 74:
#line 526 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{(yyval.node)=(yyvsp[0].node);}
-#line 2077 "asn1-parse.c" /* yacc.c:1646 */
+#line 1996 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 79:
+ case 75:
#line 527 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{(yyval.node)=(yyvsp[0].node);}
-#line 2083 "asn1-parse.c" /* yacc.c:1646 */
+#line 2002 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 81:
-#line 529 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 76:
+#line 528 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{(yyval.node)=(yyvsp[0].node);}
-#line 2089 "asn1-parse.c" /* yacc.c:1646 */
+#line 2008 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 82:
-#line 530 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 77:
+#line 529 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{(yyval.node)=(yyvsp[0].node);}
-#line 2095 "asn1-parse.c" /* yacc.c:1646 */
+#line 2014 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 83:
+ case 79:
#line 531 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{(yyval.node)=(yyvsp[0].node);}
-#line 2101 "asn1-parse.c" /* yacc.c:1646 */
+#line 2020 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 84:
+ case 80:
#line 532 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{(yyval.node)=(yyvsp[0].node);}
-#line 2107 "asn1-parse.c" /* yacc.c:1646 */
+#line 2026 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 85:
+ case 81:
#line 533 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{(yyval.node)=(yyvsp[0].node);}
-#line 2113 "asn1-parse.c" /* yacc.c:1646 */
+#line 2032 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 86:
+ case 82:
#line 534 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{(yyval.node)=(yyvsp[0].node);}
-#line 2119 "asn1-parse.c" /* yacc.c:1646 */
+#line 2038 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 87:
+ case 83:
#line 535 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{(yyval.node)=(yyvsp[0].node);}
-#line 2125 "asn1-parse.c" /* yacc.c:1646 */
+#line 2044 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 88:
+ case 84:
+#line 536 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ {(yyval.node)=(yyvsp[0].node);}
+#line 2050 "asn1-parse.c" /* yacc.c:1646 */
+ break;
+
+ case 85:
#line 537 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ {(yyval.node)=(yyvsp[0].node);}
+#line 2056 "asn1-parse.c" /* yacc.c:1646 */
+ break;
+
+ case 86:
+#line 539 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE(TYPE_NULL);
}
-#line 2133 "asn1-parse.c" /* yacc.c:1646 */
+#line 2064 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 89:
-#line 543 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 87:
+#line 545 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = (yyvsp[0].node);
}
-#line 2141 "asn1-parse.c" /* yacc.c:1646 */
+#line 2072 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 90:
-#line 547 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 88:
+#line 549 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
/* $2->flags.has_tag = 1; */
/* $$ = $2; */
@@ -2150,138 +2081,138 @@ yyreduce:
(yyval.node) = (yyvsp[-1].node);
set_down ((yyval.node), (yyvsp[0].node));
}
-#line 2154 "asn1-parse.c" /* yacc.c:1646 */
+#line 2085 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 91:
-#line 558 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 89:
+#line 560 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = (yyvsp[0].node);
}
-#line 2162 "asn1-parse.c" /* yacc.c:1646 */
+#line 2093 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 92:
-#line 562 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 90:
+#line 564 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyvsp[-1].node)->flags.has_default = 1;
(yyval.node) = (yyvsp[-1].node);
set_right ((yyvsp[0].node), (yyval.node)->down);
set_down ((yyval.node), (yyvsp[0].node));
}
-#line 2173 "asn1-parse.c" /* yacc.c:1646 */
+#line 2104 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 93:
-#line 569 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 91:
+#line 571 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyvsp[-1].node)->flags.is_optional = 1;
(yyval.node) = (yyvsp[-1].node);
}
-#line 2182 "asn1-parse.c" /* yacc.c:1646 */
+#line 2113 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 94:
-#line 576 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 92:
+#line 578 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
set_name ((yyvsp[0].node), (yyvsp[-1].str));
(yyval.node) = (yyvsp[0].node);
}
-#line 2191 "asn1-parse.c" /* yacc.c:1646 */
+#line 2122 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 95:
-#line 583 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 93:
+#line 585 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node)=(yyvsp[0].node); }
-#line 2197 "asn1-parse.c" /* yacc.c:1646 */
+#line 2128 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 96:
-#line 585 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 94:
+#line 587 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node)=(yyvsp[-2].node);
append_right ((yyval.node), (yyvsp[0].node));
}
-#line 2206 "asn1-parse.c" /* yacc.c:1646 */
+#line 2137 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 97:
-#line 592 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 95:
+#line 594 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_SEQUENCE);
set_down ((yyval.node), (yyvsp[-1].node));
}
-#line 2215 "asn1-parse.c" /* yacc.c:1646 */
+#line 2146 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 98:
-#line 597 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 96:
+#line 599 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_SEQUENCE_OF);
set_down ((yyval.node), (yyvsp[0].node));
}
-#line 2224 "asn1-parse.c" /* yacc.c:1646 */
+#line 2155 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 99:
-#line 602 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 97:
+#line 604 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_SEQUENCE_OF);
(yyval.node)->flags.has_size = 1;
set_right ((yyvsp[-2].node),(yyvsp[0].node));
set_down ((yyval.node),(yyvsp[-2].node));
}
-#line 2235 "asn1-parse.c" /* yacc.c:1646 */
+#line 2166 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 100:
-#line 611 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 98:
+#line 613 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_SET);
set_down ((yyval.node), (yyvsp[-1].node));
}
-#line 2244 "asn1-parse.c" /* yacc.c:1646 */
+#line 2175 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 101:
-#line 616 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 99:
+#line 618 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_SET_OF);
set_down ((yyval.node), (yyvsp[0].node));
}
-#line 2253 "asn1-parse.c" /* yacc.c:1646 */
+#line 2184 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 102:
-#line 621 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 100:
+#line 623 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_SET_OF);
(yyval.node)->flags.has_size = 1;
set_right ((yyvsp[-2].node), (yyvsp[0].node));
set_down ((yyval.node), (yyvsp[-2].node));
}
-#line 2264 "asn1-parse.c" /* yacc.c:1646 */
+#line 2195 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 103:
-#line 630 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 101:
+#line 632 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_CHOICE);
set_down ((yyval.node), (yyvsp[-1].node));
}
-#line 2273 "asn1-parse.c" /* yacc.c:1646 */
+#line 2204 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 104:
-#line 637 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 102:
+#line 639 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_ANY);
}
-#line 2281 "asn1-parse.c" /* yacc.c:1646 */
+#line 2212 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 105:
-#line 641 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 103:
+#line 643 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
AsnNode node;
@@ -2291,31 +2222,31 @@ yyreduce:
set_name (node, (yyvsp[0].str));
set_down((yyval.node), node);
}
-#line 2295 "asn1-parse.c" /* yacc.c:1646 */
+#line 2226 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 106:
-#line 653 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 104:
+#line 655 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
set_name ((yyvsp[0].node), (yyvsp[-2].str));
(yyval.node) = (yyvsp[0].node);
}
-#line 2304 "asn1-parse.c" /* yacc.c:1646 */
+#line 2235 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 107:
-#line 660 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 105:
+#line 662 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_OBJECT_ID);
(yyval.node)->flags.assignment = 1;
set_name ((yyval.node), (yyvsp[-6].str));
set_down ((yyval.node), (yyvsp[-1].node));
}
-#line 2315 "asn1-parse.c" /* yacc.c:1646 */
+#line 2246 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 108:
-#line 667 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 106:
+#line 669 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_OBJECT_ID);
(yyval.node)->flags.assignment = 1;
@@ -2324,92 +2255,77 @@ yyreduce:
set_str_value ((yyval.node), (yyvsp[-4].str));
set_down ((yyval.node), (yyvsp[-1].node));
}
-#line 2328 "asn1-parse.c" /* yacc.c:1646 */
+#line 2259 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 109:
-#line 676 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 107:
+#line 678 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_INTEGER);
(yyval.node)->flags.assignment = 1;
set_name ((yyval.node), (yyvsp[-3].str));
set_str_value ((yyval.node), (yyvsp[0].str));
}
-#line 2339 "asn1-parse.c" /* yacc.c:1646 */
+#line 2270 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 110:
-#line 684 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 108:
+#line 686 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node) = (yyvsp[0].node); }
-#line 2345 "asn1-parse.c" /* yacc.c:1646 */
+#line 2276 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 111:
-#line 685 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 109:
+#line 687 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node) = (yyvsp[0].node); }
-#line 2351 "asn1-parse.c" /* yacc.c:1646 */
+#line 2282 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 112:
-#line 689 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 110:
+#line 691 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.node) = (yyvsp[0].node); }
-#line 2357 "asn1-parse.c" /* yacc.c:1646 */
+#line 2288 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 113:
-#line 691 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 111:
+#line 693 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = (yyvsp[-1].node);
append_right ((yyval.node), (yyvsp[0].node));
}
-#line 2366 "asn1-parse.c" /* yacc.c:1646 */
+#line 2297 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 114:
-#line 698 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 112:
+#line 700 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
(yyval.node) = NEW_NODE (TYPE_OBJECT_ID);
set_down ((yyval.node), (yyvsp[-1].node));
set_name ((yyval.node), (yyvsp[-3].str));
}
-#line 2376 "asn1-parse.c" /* yacc.c:1646 */
- break;
-
- case 115:
-#line 706 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
- { (yyval.node)=NULL;}
-#line 2382 "asn1-parse.c" /* yacc.c:1646 */
+#line 2307 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 116:
+ case 113:
#line 708 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
- {
- AsnNode node;
-
- (yyval.node) = NEW_NODE (TYPE_IMPORTS);
- node = NEW_NODE (TYPE_OBJECT_ID);
- set_name (node, (yyvsp[-1].str));
- set_down (node, (yyvsp[0].node));
- set_down ((yyval.node), node);
- set_right ((yyval.node), (yyvsp[-3].node));
- }
-#line 2397 "asn1-parse.c" /* yacc.c:1646 */
+ { (yyval.node)=NULL;}
+#line 2313 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 117:
-#line 720 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 114:
+#line 724 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.constant) = CONST_EXPLICIT; }
-#line 2403 "asn1-parse.c" /* yacc.c:1646 */
+#line 2319 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 118:
-#line 721 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 115:
+#line 725 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{ (yyval.constant) = CONST_IMPLICIT; }
-#line 2409 "asn1-parse.c" /* yacc.c:1646 */
+#line 2325 "asn1-parse.c" /* yacc.c:1646 */
break;
- case 119:
-#line 727 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
+ case 116:
+#line 731 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1646 */
{
AsnNode node;
@@ -2441,11 +2357,11 @@ yyreduce:
PARSECTL->result_parse = _ksba_asn_check_identifier((yyval.node));
PARSECTL->parse_tree=(yyval.node);
}
-#line 2445 "asn1-parse.c" /* yacc.c:1646 */
+#line 2361 "asn1-parse.c" /* yacc.c:1646 */
break;
-#line 2449 "asn1-parse.c" /* yacc.c:1646 */
+#line 2365 "asn1-parse.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -2673,7 +2589,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 760 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1906 */
+#line 764 "/home/wk/s/libksba/src/asn1-parse.y" /* yacc.c:1906 */
diff --git a/src/asn1-parse.y b/src/asn1-parse.y
index 3336c43..5bff15c 100755
--- a/src/asn1-parse.y
+++ b/src/asn1-parse.y
@@ -92,7 +92,7 @@ struct parser_control_s {
%param {void *parm}
%define api.pure full
%define parse.error verbose
-%expect 1
+ //%expect 1
%union {
unsigned int constant;
@@ -170,7 +170,7 @@ static void yyerror (void *parm, const char *s);
%type <node> boolean_def any_def size_def2 obj_constant obj_constant_list
%type <node> constant_def type_constant type_constant_list definitions
%type <node> definitions_id Time bit_element bit_element_list set_def
-%type <node> identifier_list imports_def tag_type tag type_assig_right_tag
+%type <node> /* identifier_list */ imports_def tag_type tag type_assig_right_tag
%type <node> type_assig_right_tag_default enumerated_def string_def
%type <node> utf8_string_def numeric_string_def printable_string_def
%type <node> teletex_string_def ia5_string_def universal_string_def
@@ -229,6 +229,7 @@ constant_list: constant { $$=$1; }
}
;
+/*
identifier_list : IDENTIFIER
{
$$ = NEW_NODE (TYPE_IDENTIFIER);
@@ -244,6 +245,7 @@ identifier_list : IDENTIFIER
append_right ($$, node);
}
;
+*/
obj_constant: num_identifier
{
@@ -704,7 +706,8 @@ definitions_id : IDENTIFIER '{' obj_constant_list '}'
imports_def : /* empty */
{ $$=NULL;}
- | IMPORTS identifier_list FROM IDENTIFIER obj_constant_list
+/*
+ | IMPORTS identifier_list FROM IDENTIFIER
{
AsnNode node;
@@ -715,6 +718,7 @@ imports_def : /* empty */
set_down ($$, node);
set_right ($$, $2);
}
+*/
;
explicit_implicit : EXPLICIT { $$ = CONST_EXPLICIT; }
diff --git a/src/asn1-tables.c b/src/asn1-tables.c
index f589f25..17b9fc9 100644
--- a/src/asn1-tables.c
+++ b/src/asn1-tables.c
@@ -6,1299 +6,1335 @@
#include "asn1-func.h"
static const static_asn tmttv2_asn1_tab[] = {
- {5339,136, {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
+ {246,136, {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
{0,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {1182,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {5536,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5488},
- {5104,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5113,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5578},
- {4750,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5578},
- {4904,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5540,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5584},
- {5430,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {3412,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5587,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5578},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5590},
- {2397,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {3668,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3683},
- {2509,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {2499,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {99,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4914,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {4761,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,1,0},0},
- {4914,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {3683,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},5482},
- {0,131, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5593},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},2461},
- {4250,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1206},
- {2499,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {5346,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},792},
- {5122,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5131},
- {5211,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},792},
- {1917,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1938},
- {3698,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2970},
- {3428,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5092},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2970},
- {4772,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5597},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},2574},
- {2461,2, {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5593,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5482},
- {5343,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5596,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5092},
- {1206,2, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {792,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4510,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},4522},
- {4522,133, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},771},
- {771,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},1631},
- {370,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1177,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3998},
- {5353,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},3713},
- {277,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},370},
- {1631,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1177,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3998},
- {947,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3713},
- {3998,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {3713,134, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1},0},
- {3444,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {3460,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
- {5219,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {4012,20, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
- {5219,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {4783,12, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
- {5219,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {4924,30, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
- {5219,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {3476,28, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},0},
- {5219,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {5131,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4934,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3993},
- {5140,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3993},
- {3993,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5227,23, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},0},
- {4534,24, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},0},
- {1938,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4914,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {2987,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {2574,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},4944},
- {4944,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5360,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {5149,1, {0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {4641,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {73,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},11},
+ {537,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {555,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},9},
+ {902,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},9},
+ {793,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {77,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},21},
+ {172,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {2300,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {36,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},9},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},27},
+ {990,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {2157,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1992},
+ {3311,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {783,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {3349,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {633,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {935,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,1,0},0},
+ {633,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {1992,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},1},
+ {0,131, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},48},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},330},
+ {1563,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4449},
+ {783,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {267,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},109},
+ {564,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},483},
+ {434,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},109},
+ {3960,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3792},
+ {2067,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2598},
+ {2380,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},251},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2598},
+ {880,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},825},
+ {330,2, {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {48,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1},
+ {250,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {51,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},251},
+ {4449,2, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {109,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1218,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},1050},
+ {1050,133, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},4990},
+ {4990,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},4002},
+ {573,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {144,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1576},
+ {323,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},1842},
+ {803,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},573},
+ {4002,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {144,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1576},
+ {220,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1842},
+ {1576,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {1842,134, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1},0},
+ {2188,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {2364,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
+ {378,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {1800,20, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
+ {378,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {979,12, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
+ {378,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {653,30, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
+ {378,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {2396,28, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},0},
+ {378,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {483,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {723,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},114},
+ {546,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},114},
+ {114,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {458,23, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},0},
+ {1146,24, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},0},
+ {3792,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {633,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {2836,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {825,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},593},
+ {593,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {260,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {501,1, {0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},0},
{0,131, {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0},0},
- {4954,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {2970,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {1470,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4026,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1479},
- {2169,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4263},
- {797,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5092},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1206},
- {1479,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {5158,3, {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {3004,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5482},
- {3728,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {3492,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {3021,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {4276,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5612},
- {4546,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5578},
- {5235,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5488},
- {4289,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5476},
- {4302,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5626},
- {2189,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},2718},
- {2718,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {3038,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4315},
- {3055,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},2209},
- {4315,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {2209,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {2736,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},2754},
- {2075,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0},0},
- {2736,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {2754,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {1959,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
+ {683,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {2598,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {4288,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1730,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3778},
+ {3529,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1368},
+ {5016,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},251},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4449},
+ {3778,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {474,3, {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {2666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1},
+ {2082,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {2316,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {2615,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {1511,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},7},
+ {1182,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},9},
+ {338,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},11},
+ {1485,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},22},
+ {1433,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},13},
+ {3389,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},2942},
+ {2942,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {2802,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1316},
+ {2819,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},3469},
+ {1316,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {3469,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {3104,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},2960},
+ {773,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0},0},
+ {3104,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {2960,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {3750,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
{0,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0},0},
- {2528,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4315},
- {2229,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},4315},
- {3743,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4263},
- {4263,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},4558},
- {4558,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4964,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4974},
- {4794,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},3308},
+ {3292,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1316},
+ {3689,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1316},
+ {1977,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1368},
+ {1368,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},1038},
+ {1038,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {733,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},613},
+ {946,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},3},
{0,22, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},0},
- {5243,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},5092},
+ {354,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},251},
{0,22, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},0},
- {4570,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},5597},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4984},
- {4040,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},5612},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},792},
- {4328,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},5578},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4341},
- {823,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},5488},
+ {1278,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},5},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},603},
+ {1688,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},7},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},109},
+ {1472,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},9},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1342},
+ {5146,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},11},
{0,22, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},0},
- {4994,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},5476},
+ {703,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},22},
{0,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},0},
- {4354,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},5626},
+ {1550,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},13},
{0,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},0},
- {4974,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5251,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {947,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},5482},
+ {613,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {450,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {220,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},1},
{0,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0},0},
- {5251,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {4341,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4367,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3444},
- {5004,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3444},
- {609,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},370},
- {4054,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {450,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {1342,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1537,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2188},
+ {743,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2188},
+ {5253,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},573},
+ {1590,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
{0,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0},0},
- {5367,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {947,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0},0},
- {5367,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {3072,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5599,1, {0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},0},
+ {309,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {220,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0},0},
+ {309,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {2428,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {33,1, {0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},0},
{0,131, {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0},0},
- {2772,2, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0},0},
- {5482,132, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5544},
- {3508,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {2790,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3524},
- {3089,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3524},
- {3524,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},3758},
- {3758,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5502,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4558},
- {5259,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},5482},
- {0,131, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},4380},
- {5267,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4380},
- {4380,2, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5482,132, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5544},
- {1230,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
+ {3068,2, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0},0},
+ {1,132, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},61},
+ {2220,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {3086,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2204},
+ {2717,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2204},
+ {2204,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},1887},
+ {1887,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {119,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1038},
+ {394,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},1},
+ {0,131, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1290},
+ {386,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1290},
+ {1290,2, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1,132, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},61},
+ {4545,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
{0,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0},0},
- {1653,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},5014},
- {1980,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},5014},
- {5014,2, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5482,132, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5544},
- {2249,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},391},
- {391,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {2808,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1675},
- {5275,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4582},
- {5024,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5092},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4263},
- {1675,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5167,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4263},
- {1254,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},771},
- {4582,3, {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5374,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5482},
- {4068,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4393,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {2547,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {4805,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5612},
- {2001,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5578},
- {3540,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5488},
- {525,22, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {380,22, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {1278,22, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {3773,12, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {3556,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4594,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4606},
- {2509,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {3788,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {4606,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},2461},
- {2499,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {5346,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},792},
- {4816,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3993},
- {4827,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},3993},
- {2269,133, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},0},
+ {4222,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},623},
+ {3897,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},623},
+ {623,2, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1,132, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},61},
+ {3369,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},2906},
+ {2906,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {2996,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4024},
+ {426,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1062},
+ {663,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},251},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1368},
+ {4024,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {519,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1368},
+ {4665,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4990},
+ {1062,3, {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {316,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1},
+ {1716,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1394,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {3235,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {957,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},7},
+ {3813,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},9},
+ {2252,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},11},
+ {5334,22, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {5447,22, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {4569,22, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {2007,12, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {2172,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1254,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1098},
+ {3311,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {2142,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {1098,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},330},
+ {783,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {267,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},109},
+ {968,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},114},
+ {913,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},114},
+ {3669,133, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},0},
{0,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0},0},
- {3572,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1206},
- {3803,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3993},
- {2566,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},2574},
- {4082,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},2574},
- {5034,10, {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4618,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5482},
- {4068,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4393,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {2547,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {4805,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5612},
- {2001,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5578},
- {3540,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5488},
- {4096,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5626},
- {3818,24, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {2826,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4263},
- {5044,2, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {3308,132, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5544},
- {1057,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {2808,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1675},
- {1697,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},3308},
+ {2412,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4449},
+ {2127,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},114},
+ {3254,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},825},
+ {1674,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},825},
+ {583,10, {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1266,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1},
+ {1716,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1394,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {3235,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {957,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},7},
+ {3813,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},9},
+ {2252,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},11},
+ {1772,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},13},
+ {1902,24, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {2888,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1368},
+ {673,2, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {3,132, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},61},
+ {4861,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {2996,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4024},
+ {4200,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},3},
{0,131, {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1},0},
{0,1, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {2289,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},5092},
+ {3609,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1},251},
{0,131, {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1},0},
{0,1, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {3588,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5597},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4582},
- {4630,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0},5612},
+ {2348,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1062},
+ {1170,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0},7},
{0,131, {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1},0},
{0,1, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {1082,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1107,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},2461},
- {5211,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},792},
- {1917,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1938},
- {143,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},277},
- {4984,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {409,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},849},
- {119,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},257},
- {1377,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},2309},
- {849,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4406,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},4642},
- {636,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},1132},
- {3604,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3833},
- {2329,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},2585},
- {2349,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5092},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},2844},
- {2862,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5597},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3106},
- {1302,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5612},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1719},
- {4110,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5578},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},4419},
- {875,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5488},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1326},
- {4642,130, {1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},3308},
+ {4786,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {4811,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},330},
+ {434,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},109},
+ {3960,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3792},
+ {869,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},803},
+ {603,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {5476,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4886},
+ {5754,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},5593},
+ {3855,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},3429},
+ {4886,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1420,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},1026},
+ {5280,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},4761},
+ {2332,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1917},
+ {3709,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3178},
+ {3629,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},251},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},2978},
+ {3050,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},2513},
+ {4689,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},7},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},4112},
+ {1758,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},9},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1381},
+ {5068,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},11},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},4521},
+ {1026,130, {1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},3},
{0,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
- {4124,18, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
- {0,132, {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},288},
- {2022,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},0},
- {0,132, {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},438},
- {1132,130, {1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},5092},
+ {1828,18, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
+ {0,132, {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5624},
+ {3918,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},0},
+ {0,132, {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5505},
+ {4761,130, {1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},251},
{0,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
- {5283,18, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
- {1741,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},5482},
- {5054,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},0},
- {1741,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},5482},
- {3833,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4654},
- {4654,18, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1493,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {2585,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1763,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {2844,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5283,18, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
- {1741,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {5054,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},0},
- {1741,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {3106,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {553,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {1719,18, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {901,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {4419,17, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5291,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},5482},
+ {410,18, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
+ {4244,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},1},
+ {753,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},0},
+ {4244,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},1},
+ {1917,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1110},
+ {1110,18, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {4426,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {3178,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {4266,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {2978,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {410,18, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},0},
+ {4244,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {753,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},0},
+ {4244,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {2513,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {5390,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {4112,18, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {5094,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {1381,17, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {442,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},1},
{0,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0},0},
- {2880,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {4838,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3308},
+ {3122,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {891,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3},
{0,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0},0},
- {2043,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {5176,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5092},
+ {3981,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {528,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},251},
{0,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0},0},
- {2604,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {2064,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5597},
+ {3330,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {3876,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5},
{0,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0},0},
- {319,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {1326,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1350,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},1516},
- {1516,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {154,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {257,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {467,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},350},
- {350,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1177,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {42,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {947,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
- {1,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {2309,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1374,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},2623},
- {2623,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
- {1157,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},5482},
+ {5655,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {4521,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {4737,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},4311},
+ {4311,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {5789,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {5593,133, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {5534,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},5563},
+ {5563,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {144,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {5861,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {220,19, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
+ {5901,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {3429,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {4713,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},3159},
+ {3159,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
+ {4836,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},1},
{0,2, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
- {5482,132, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1374},
- {927,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},3308},
+ {1,132, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},4713},
+ {5042,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},3},
{0,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0},0},
- {1157,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {4836,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
{0,0}
};
static const static_asn cms_asn1_tab[] = {
- {663,136, {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
+ {5199,136, {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
{0,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5395,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5393},
- {5436,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5605},
- {5299,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5482},
- {5552,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {1410,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {3971,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4446},
- {5307,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},5482},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {281,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},28},
+ {214,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},18},
+ {402,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1},
+ {69,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {1002,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1134,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1014},
+ {346,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},1},
{0,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0},0},
- {3971,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {4446,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {4849,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4860},
- {3123,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},690},
- {3140,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1398},
- {4432,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3848},
- {5512,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},717},
- {4678,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},4690},
- {690,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},953},
- {4690,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},4871},
- {1398,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4445,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4446},
- {5185,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5482},
+ {1134,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {1014,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {836,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},814},
+ {2649,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5226},
+ {2683,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4473},
+ {1407,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1872},
+ {124,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},5172},
+ {1242,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1074},
+ {5226,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},4912},
+ {1074,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},847},
+ {4473,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1459,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1014},
+ {510,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},1},
{0,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {4871,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4860},
- {5556,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3157},
- {3620,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},953},
- {4140,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3174},
- {2509,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},496},
- {2499,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3863},
- {4138,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2642},
- {3157,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1785,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},1807},
- {2085,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2106},
- {3174,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},370},
- {2642,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},370},
- {370,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5194,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {4882,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},3713},
- {3713,134, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1},0},
- {3863,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {4152,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4860},
- {3878,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3893},
- {3908,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3923},
- {2127,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},2148},
- {3191,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1829},
- {3893,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5442,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3848},
- {5512,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},717},
- {3923,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},1859},
- {2148,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {3971,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4446},
- {744,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},82},
- {3208,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3225},
- {3225,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {1829,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},370},
- {1859,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5517,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},1851},
- {5522,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1873},
- {5448,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},5092},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3242},
- {1904,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {1851,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4860},
- {5560,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},589},
- {1539,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},224},
- {4458,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1904},
- {589,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1785,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},1807},
- {2085,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2106},
- {1873,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4860},
- {4893,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},979},
- {5564,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},2661},
- {1539,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},224},
- {1562,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1585},
- {979,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1785,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},1807},
- {2085,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2106},
- {4166,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2369},
- {2369,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4914,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {5064,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {1585,133, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},1895},
- {1895,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5560,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},581},
- {4458,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1904},
- {581,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1785,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},1807},
- {5402,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1608},
- {1608,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {2085,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},2106},
- {4822,24, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},0},
- {5454,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},2898},
- {2106,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {3242,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4860},
- {5460,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4180},
- {1539,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},224},
- {4458,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1904},
- {4180,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4026,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {4822,24, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},0},
- {5454,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},2898},
- {4471,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4860},
- {3620,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},953},
- {3140,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1398},
- {5409,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3405},
- {3405,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {4194,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4860},
- {2127,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},2148},
- {3191,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1829},
- {2916,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4860},
- {3878,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3893},
- {3908,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3923},
- {4484,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},189},
- {3620,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},953},
- {3140,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1398},
- {1033,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},5092},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3938},
- {5568,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1005},
- {1031,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5597},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3259},
- {3938,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},370},
- {3259,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5544,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3308},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},370},
- {1005,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {953,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {496,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {224,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {82,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {189,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {717,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},3556},
- {2680,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4702,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},2397},
- {2389,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},5482},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2409},
- {3848,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},2680},
- {1807,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5346,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},792},
- {4250,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1206},
- {4860,2, {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5608,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5482},
- {5593,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5343,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5596,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {5611,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5612},
- {2661,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {2898,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5074,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {5315,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,1,0},0},
- {5074,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {4208,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {4714,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3993},
- {3993,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5227,23, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},0},
- {4534,24, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},0},
- {3276,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4871},
- {5466,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {1182,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {5572,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5614},
- {5416,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {4914,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5617},
- {5576,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {3620,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5578},
- {3293,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5472,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5478},
- {5527,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5612},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5597},
- {4222,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5423,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {3310,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5084,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5484},
- {4726,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {4738,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5395,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5393},
- {5436,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5605},
- {5580,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5578},
- {2699,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5395,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5393},
- {5436,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5605},
- {5580,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5488},
- {2934,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5395,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5393},
- {5436,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5605},
- {5580,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5476},
- {4497,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {2429,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5476},
- {5323,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {2429,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5092},
- {5094,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {1182,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5597},
- {5536,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5488},
- {5104,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5113,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5578},
- {4750,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5578},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5626},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5092},
- {3327,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},99},
- {3344,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},2449},
- {2449,2, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {3639,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5620},
- {5620,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {3636,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {2469,2, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {5623,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {2952,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5395,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5393},
- {5436,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5605},
- {5216,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5488},
- {5331,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5490,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5476},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3308},
- {4236,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5490,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5476},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5092},
- {3361,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5490,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5476},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5597},
- {3652,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5490,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5476},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5578},
- {3378,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5490,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5476},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5488},
- {3953,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5395,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5393},
- {5436,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5605},
- {5216,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5092},
- {3968,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5496,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5393},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5597},
- {3395,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5496,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5393},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5612},
- {3983,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5496,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5393},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5578},
- {2489,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5532,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {4666,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5092},
- {5602,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5548},
- {5381,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5388},
- {5507,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3308},
- {5496,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5393},
- {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5488},
- {2409,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1422,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1446},
- {2509,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},496},
- {2499,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3011},
- {1446,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {5203,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4860},
- {4702,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},2397},
- {143,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3259},
- {3011,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {792,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4510,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},4522},
- {4522,133, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},771},
- {771,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},1631},
- {1631,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {1177,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3998},
- {947,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3713},
- {3998,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {3713,134, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1},0},
- {99,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
- {4914,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
- {4761,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,1,0},0},
- {4914,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
- {2397,134, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1},0},
- {3556,134, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1},0},
- {1206,2, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {847,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},814},
+ {101,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},2564},
+ {2268,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4912},
+ {1230,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2547},
+ {3311,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5418},
+ {783,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1962},
+ {1814,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3197},
+ {2564,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {4178,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},4046},
+ {3939,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3771},
+ {2547,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},573},
+ {3197,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},573},
+ {573,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {492,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {858,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},1842},
+ {1842,134, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1},0},
+ {1962,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {1618,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},814},
+ {2097,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1932},
+ {2112,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1947},
+ {3834,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3729},
+ {2853,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4156},
+ {1932,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {166,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1872},
+ {124,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},5172},
+ {1947,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},1660},
+ {3729,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1134,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1014},
+ {5307,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5824},
+ {2700,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2462},
+ {2462,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {4156,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},573},
+ {1660,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {134,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},4090},
+ {129,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4068},
+ {184,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},251},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2479},
+ {1355,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {4090,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},814},
+ {97,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3509},
+ {4380,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5686},
+ {1498,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1355},
+ {3509,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {4178,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},4046},
+ {3939,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3771},
+ {4068,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},814},
+ {924,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},4964},
+ {105,130, {2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3216},
+ {4380,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5686},
+ {4403,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},4334},
+ {4964,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {4178,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},4046},
+ {3939,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3771},
+ {1744,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3449},
+ {3449,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {633,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {763,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {4334,133, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},4134},
+ {4134,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {97,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5362},
+ {1498,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1355},
+ {5362,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {4178,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},4046},
+ {288,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4357},
+ {4357,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {3939,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3771},
+ {919,24, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},0},
+ {190,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},2924},
+ {3771,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {2479,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},814},
+ {178,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1632},
+ {4380,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5686},
+ {1498,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1355},
+ {1632,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1730,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {919,24, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1},0},
+ {190,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0},2924},
+ {1329,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},814},
+ {2268,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4912},
+ {2683,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4473},
+ {253,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},239},
+ {239,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {1604,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},814},
+ {3834,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3729},
+ {2853,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4156},
+ {2870,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},814},
+ {2097,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1932},
+ {2112,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1947},
+ {1524,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5719},
+ {2268,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},4912},
+ {2683,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4473},
+ {4593,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1},251},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},1857},
+ {85,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4938},
+ {5120,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0},5},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},2581},
+ {1857,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},573},
+ {2581,135, {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {61,132, {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1},3},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},573},
+ {4938,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {4912,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {5418,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {5686,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {5824,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {5719,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {5172,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},2172},
+ {3140,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1122,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},990},
+ {3569,130, {2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0},1},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0},3409},
+ {1872,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},3140},
+ {4046,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {267,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},109},
+ {1563,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},4449},
+ {814,2, {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {45,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1},
+ {48,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {250,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {51,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {54,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},7},
+ {3216,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {2924,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {713,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {370,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,1,0},0},
+ {713,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {1646,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {1086,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},114},
+ {114,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {458,23, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},0},
+ {1146,24, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},0},
+ {2445,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},847},
+ {208,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {4641,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {93,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},15},
+ {302,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {633,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},24},
+ {89,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {2268,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},9},
+ {2734,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {226,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},154},
+ {149,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},7},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5},
+ {1786,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {274,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {2632,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {643,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},160},
+ {1206,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {1158,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {281,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},28},
+ {214,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},18},
+ {65,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},9},
+ {3273,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {281,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},28},
+ {214,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},18},
+ {65,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},11},
+ {3014,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {281,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},28},
+ {214,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},18},
+ {65,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},22},
+ {1446,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {3549,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},22},
+ {418,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {3549,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},251},
+ {693,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {4641,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5},
+ {73,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},11},
+ {537,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {555,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},9},
+ {902,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},9},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},13},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},251},
+ {2496,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3349},
+ {2530,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3489},
+ {3489,2, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {1303,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},30},
+ {30,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {2236,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {3649,2, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {39,4, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {3032,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {281,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},28},
+ {214,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},18},
+ {439,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},11},
+ {362,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {196,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},22},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},3},
+ {1702,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {196,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},22},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},251},
+ {2768,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {196,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},22},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5},
+ {2284,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {196,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},22},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},9},
+ {2751,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {196,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},22},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},11},
+ {2037,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {281,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},28},
+ {214,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},18},
+ {439,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},251},
+ {2022,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {202,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},28},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},5},
+ {2785,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {202,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},28},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},7},
+ {2052,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {202,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},28},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},9},
+ {3589,6, {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {81,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {1194,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},251},
+ {42,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},57},
+ {295,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},232},
+ {139,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},3},
+ {202,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},28},
+ {0,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},11},
+ {3409,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {4617,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},4497},
+ {3311,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},5418},
+ {783,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},2673},
+ {4497,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {466,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},814},
+ {1122,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},990},
+ {869,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},2581},
+ {2673,3, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {109,137, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {1218,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},1050},
+ {1050,133, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},4990},
+ {4990,135, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {0,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},4002},
+ {4002,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {144,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},1576},
+ {220,129, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},1842},
+ {1576,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {1842,134, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1},0},
+ {3349,16, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},0},
+ {633,6, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},0},
+ {935,134, {0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,1,0},0},
+ {633,128, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
+ {990,134, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1},0},
+ {2172,134, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1},0},
+ {4449,2, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},0},
{0,0}
};
static const char string_table[] = {
'\0',
- 'u','b','-','d','o','m','a','i','n','-','d','e','f','i','n','e',
- 'd','-','a','t','t','r','i','b','u','t','e','-','v','a','l','u',
- 'e','-','l','e','n','g','t','h','\0',
- 'u','b','-','d','o','m','a','i','n','-','d','e','f','i','n','e',
- 'd','-','a','t','t','r','i','b','u','t','e','-','t','y','p','e',
- '-','l','e','n','g','t','h','\0',
- 'C','o','n','t','e','n','t','E','n','c','r','y','p','t','i','o',
- 'n','A','l','g','o','r','i','t','h','m','I','d','e','n','t','i',
- 'f','i','e','r','\0',
- 'b','u','i','l','t','-','i','n','-','d','o','m','a','i','n','-',
- 'd','e','f','i','n','e','d','-','a','t','t','r','i','b','u','t',
+ '0','\0',
+ '1','\0',
+ '3','\0',
+ '4','\0',
+ '5','\0',
+ '6','\0',
+ '8','\0',
+ '1','4','\0',
+ '1','6','\0',
+ '1','7','\0',
+ '2','6','\0',
+ '2','9','\0',
+ 'I','V','\0',
+ 'c','A','\0',
+ 'd','s','\0',
+ 'i','v','\0',
+ 'u','s','\0',
+ 'v','0','\0',
+ 'v','1','\0',
+ 'v','3','\0',
+ 'v','4','\0',
+ '8','4','0','\0',
+ 'M','A','X','\0',
+ 'a','l','g','\0',
+ 'c','m','s','\0',
+ 'd','o','d','\0',
+ 'f','o','o','\0',
+ 'i','s','o','\0',
+ 'm','a','c','\0',
+ 'm','d','5','\0',
+ 'o','i','w','\0',
+ 'r','i','d','\0',
+ 's','i','d','\0',
+ 'u','k','m','\0',
+ 'N','a','m','e','\0',
+ 'T','i','m','e','\0',
+ 'b','a','s','e','\0',
+ 'c','r','l','s','\0',
+ 'k','a','r','i','\0',
+ 'k','t','r','i','\0',
+ 'p','k','c','s','\0',
+ 't','y','p','e','\0',
+ 'x','9','c','m','\0',
+ '1','0','0','4','0','\0',
+ '1','0','0','4','6','\0',
+ 'c','e','r','t','s','\0',
+ 'i','d','-','c','e','\0',
+ 'k','e','k','i','d','\0',
+ 'k','e','k','r','i','\0',
+ 'o','t','h','e','r','\0',
+ 'p','k','c','s','7','\0',
+ 'p','k','c','s','9','\0',
+ 's','h','a','-','1','\0',
+ 's','m','i','m','e','\0',
+ 'v','a','l','u','e','\0',
+ 'x','9','-','5','7','\0',
+ '1','1','3','5','4','9','\0',
+ 'D','i','g','e','s','t','\0',
+ 'T','M','T','T','v','2','\0',
+ 'd','i','g','e','s','t','\0',
+ 'e','x','t','n','I','D','\0',
+ 'i','s','s','u','e','r','\0',
+ 'p','k','c','s','-','1','\0',
+ 'p','k','c','s','-','9','\0',
+ 'r','K','e','y','I','d','\0',
+ 'r','s','a','d','s','i','\0',
+ 's','e','c','s','i','g','\0',
+ 't','y','p','e','I','d','\0',
+ 'u','n','u','s','e','d','\0',
+ 'v','a','l','u','e','s','\0',
+ 'V','e','r','s','i','o','n','\0',
+ 'c','R','L','S','i','g','n','\0',
+ 'c','o','n','t','e','n','t','\0',
+ 'd','N','S','N','a','m','e','\0',
+ 'i','d','-','d','a','t','a','\0',
+ 'k','e','y','A','t','t','r','\0',
+ 'm','a','x','S','i','z','e','\0',
+ 'm','a','x','i','m','u','m','\0',
+ 'm','i','n','i','m','u','m','\0',
+ 'm','o','d','u','l','e','s','\0',
+ 'n','u','m','e','r','i','c','\0',
+ 'r','c','2','-','c','b','c','\0',
+ 'r','e','a','s','o','n','s','\0',
+ 's','u','b','j','e','c','t','\0',
+ 's','u','r','n','a','m','e','\0',
+ 't','y','p','e','-','i','d','\0',
+ 'u','t','c','T','i','m','e','\0',
+ 'v','e','r','s','i','o','n','\0',
+ 'K','e','y','U','s','a','g','e','\0',
+ 'V','a','l','i','d','i','t','y','\0',
+ 'a','t','t','r','T','y','p','e','\0',
+ 'c','r','i','t','i','c','a','l','\0',
+ 'e','C','o','n','t','e','n','t','\0',
+ 'f','u','l','l','N','a','m','e','\0',
+ 'i','n','i','t','i','a','l','s','\0',
+ 'i','n','t','e','r','n','e','t','\0',
+ 'n','o','t','A','f','t','e','r','\0',
+ 's','e','c','u','r','i','t','y','\0',
+ 'v','a','l','i','d','i','t','y','\0',
+ 'A','t','t','r','i','b','u','t','e','\0',
+ 'C','R','L','R','e','a','s','o','n','\0',
+ 'E','x','t','e','n','s','i','o','n','\0',
+ 'O','R','A','d','d','r','e','s','s','\0',
+ 'O','t','h','e','r','N','a','m','e','\0',
+ 'S','k','i','p','C','e','r','t','s','\0',
+ 'a','l','g','o','r','i','t','h','m','\0',
+ 'a','n','s','i','-','x','9','4','2','\0',
+ 'b','m','p','S','t','r','i','n','g','\0',
+ 'c','R','L','I','s','s','u','e','r','\0',
+ 'c','R','L','N','u','m','b','e','r','\0',
+ 'e','x','t','n','V','a','l','u','e','\0',
+ 'h','M','A','C','-','S','H','A','1','\0',
+ 'i','P','A','d','d','r','e','s','s','\0',
+ 'k','e','y','A','t','t','r','I','d','\0',
+ 'n','o','t','B','e','f','o','r','e','\0',
+ 'o','t','h','e','r','N','a','m','e','\0',
+ 'p','a','r','t','y','N','a','m','e','\0',
+ 'p','r','i','n','t','a','b','l','e','\0',
+ 'p','u','b','l','i','c','K','e','y','\0',
+ 'q','u','a','l','i','f','i','e','r','\0',
+ 's','i','g','n','a','t','u','r','e','\0',
+ 't','e','l','e','t','r','u','s','t','\0',
+ 'A','t','t','r','i','b','u','t','e','s','\0',
+ 'C','M','S','V','e','r','s','i','o','n','\0',
+ 'E','x','t','e','n','s','i','o','n','s','\0',
+ 'S','i','g','n','e','d','D','a','t','a','\0',
+ 'S','i','g','n','e','r','I','n','f','o','\0',
+ 'a','t','t','r','V','a','l','u','e','s','\0',
+ 'a','t','t','r','i','b','u','t','e','s','\0',
+ 'e','x','t','e','n','s','i','o','n','s','\0',
+ 'g','i','v','e','n','-','n','a','m','e','\0',
+ 'm','e','c','h','a','n','i','s','m','s','\0',
+ 'n','e','x','t','U','p','d','a','t','e','\0',
+ 'o','r','i','g','i','n','a','t','o','r','\0',
+ 'p','a','r','a','m','e','t','e','r','s','\0',
+ 'r','f','c','8','2','2','N','a','m','e','\0',
+ 's','u','p','e','r','s','e','d','e','d','\0',
+ 't','h','i','s','U','p','d','a','t','e','\0',
+ 'u','t','f','8','S','t','r','i','n','g','\0',
+ 'C','e','r','t','i','f','i','c','a','t','e','\0',
+ 'C','o','n','t','e','n','t','I','n','f','o','\0',
+ 'C','o','n','t','e','n','t','T','y','p','e','\0',
+ 'C','o','u','n','t','r','y','N','a','m','e','\0',
+ 'G','e','n','e','r','a','l','N','a','m','e','\0',
+ 'R','D','N','S','e','q','u','e','n','c','e','\0',
+ 'R','e','a','s','o','n','F','l','a','g','s','\0',
+ 'S','i','g','n','e','r','I','n','f','o','s','\0',
+ 'S','i','g','n','i','n','g','T','i','m','e','\0',
+ 'T','B','S','C','e','r','t','L','i','s','t','\0',
+ 'X','1','2','1','A','d','d','r','e','s','s','\0',
+ 'c','e','r','t','i','f','i','c','a','t','e','\0',
+ 'c','o','n','t','e','n','t','T','y','p','e','\0',
+ 'g','e','n','e','r','a','l','T','i','m','e','\0',
+ 'i','d','-','a','l','g','-','E','S','D','H','\0',
+ 'i','n','d','i','r','e','c','t','C','R','L','\0',
+ 'k','e','y','C','e','r','t','S','i','g','n','\0',
+ 'm','e','m','b','e','r','-','b','o','d','y','\0',
+ 'n','u','m','b','e','r','-','t','y','p','e','\0',
+ 'r','d','n','S','e','q','u','e','n','c','e','\0',
+ 's','i','g','n','e','d','A','t','t','r','s','\0',
+ 's','i','g','n','e','r','I','n','f','o','s','\0',
+ 't','b','s','C','e','r','t','L','i','s','t','\0',
+ 'u','n','s','p','e','c','i','f','i','e','d','\0',
+ 'x','4','0','0','A','d','d','r','e','s','s','\0',
+ 'B','a','s','e','D','i','s','t','a','n','c','e','\0',
+ 'C','B','C','P','a','r','a','m','e','t','e','r','\0',
+ 'C','e','r','t','P','o','l','i','c','y','I','d','\0',
+ 'D','i','g','e','s','t','e','d','D','a','t','a','\0',
+ 'E','D','I','P','a','r','t','y','N','a','m','e','\0',
+ 'E','n','c','r','y','p','t','e','d','K','e','y','\0',
+ 'G','e','n','e','r','a','l','N','a','m','e','s','\0',
+ 'P','e','r','s','o','n','a','l','N','a','m','e','\0',
+ 'c','A','C','o','m','p','r','o','m','i','s','e','\0',
+ 'c','e','r','t','i','f','i','c','a','t','e','s','\0',
+ 'c','o','u','n','t','r','y','-','n','a','m','e','\0',
+ 'd','e','c','i','p','h','e','r','O','n','l','y','\0',
+ 'd','e','s','-','e','d','e','3','-','c','b','c','\0',
+ 'e','C','o','n','t','e','n','t','T','y','p','e','\0',
+ 'e','d','i','P','a','r','t','y','N','a','m','e','\0',
+ 'e','n','c','i','p','h','e','r','O','n','l','y','\0',
+ 'e','n','c','r','y','p','t','e','d','K','e','y','\0',
+ 'k','e','y','A','g','r','e','e','m','e','n','t','\0',
+ 'm','a','c','A','l','g','o','r','i','t','h','m','\0',
+ 'n','a','m','e','A','s','s','i','g','n','e','r','\0',
+ 'r','e','g','i','s','t','e','r','e','d','I','D','\0',
+ 's','e','r','i','a','l','N','u','m','b','e','r','\0',
+ 'A','t','t','r','i','b','u','t','e','T','y','p','e','\0',
+ 'B','i','o','m','e','t','r','i','c','D','a','t','a','\0',
+ 'E','n','c','r','y','p','t','e','d','D','a','t','a','\0',
+ 'E','n','v','e','l','o','p','e','d','D','a','t','a','\0',
+ 'K','E','K','I','d','e','n','t','i','f','i','e','r','\0',
+ 'M','e','s','s','a','g','e','D','i','g','e','s','t','\0',
+ 'R','e','c','i','p','i','e','n','t','I','n','f','o','\0',
+ 'c','r','l','E','x','t','e','n','s','i','o','n','s','\0',
+ 'd','i','r','e','c','t','o','r','y','N','a','m','e','\0',
+ 'i','d','-','s','i','g','n','e','d','D','a','t','a','\0',
+ 'k','e','y','C','o','m','p','r','o','m','i','s','e','\0',
+ 'k','e','y','I','d','e','n','t','i','f','i','e','r','\0',
+ 'o','r','i','g','i','n','a','t','o','r','K','e','y','\0',
+ 'p','e','r','s','o','n','a','l','-','n','a','m','e','\0',
+ 'r','e','m','o','v','e','F','r','o','m','C','R','L','\0',
+ 'r','s','a','E','n','c','r','y','p','t','i','o','n','\0',
+ 't','e','l','e','t','e','x','S','t','r','i','n','g','\0',
+ 'u','n','s','i','g','n','e','d','A','t','t','r','s','\0',
+ 'x','1','2','1','-','d','c','c','-','c','o','d','e','\0',
+ 'A','t','t','r','i','b','u','t','e','V','a','l','u','e','\0',
+ 'A','u','t','h','A','t','t','r','i','b','u','t','e','s','\0',
+ 'C','e','r','t','i','f','i','c','a','t','e','S','e','t','\0',
+ 'G','e','n','e','r','a','l','S','u','b','t','r','e','e','\0',
+ 'I','n','v','a','l','i','d','i','t','y','D','a','t','e','\0',
+ 'N','e','t','w','o','r','k','A','d','d','r','e','s','s','\0',
+ 'O','r','i','g','i','n','a','t','o','r','I','n','f','o','\0',
+ 'R','e','c','i','p','i','e','n','t','I','n','f','o','s','\0',
+ 'S','i','g','n','a','t','u','r','e','V','a','l','u','e','\0',
+ 'S','u','b','j','e','c','t','A','l','t','N','a','m','e','\0',
+ 'T','B','S','C','e','r','t','i','f','i','c','a','t','e','\0',
+ 'T','e','s','t','I','d','e','n','t','i','f','i','e','r','\0',
+ 'i','d','-','c','o','n','t','e','n','t','T','y','p','e','\0',
+ 'i','d','-','c','t','-','a','u','t','h','D','a','t','a','\0',
+ 'i','d','-','s','i','g','n','i','n','g','T','i','m','e','\0',
+ 'i','s','s','u','e','r','U','n','i','q','u','e','I','D','\0',
+ 'n','o','n','R','e','p','u','d','i','a','t','i','o','n','\0',
+ 'o','r','i','g','i','n','a','t','o','r','I','n','f','o','\0',
+ 'r','e','c','i','p','i','e','n','t','I','n','f','o','s','\0',
+ 'r','e','v','o','c','a','t','i','o','n','D','a','t','e','\0',
+ 's','i','g','n','a','t','u','r','e','V','a','l','u','e','\0',
+ 't','b','s','C','e','r','t','i','f','i','c','a','t','e','\0',
+ 'C','e','r','t','i','f','i','c','a','t','e','L','i','s','t','\0',
+ 'D','i','r','e','c','t','o','r','y','S','t','r','i','n','g','\0',
+ 'G','e','n','e','r','a','l','S','u','b','t','r','e','e','s','\0',
+ 'N','a','m','e','C','o','n','s','t','r','a','i','n','t','s','\0',
+ 'R','C','2','C','B','C','P','a','r','a','m','e','t','e','r','\0',
+ 'c','e','r','t','i','f','i','c','a','t','e','H','o','l','d','\0',
+ 'd','i','g','e','s','t','A','l','g','o','r','i','t','h','m','\0',
+ 'i','d','-','d','i','g','e','s','t','e','d','D','a','t','a','\0',
+ 'j','o','i','n','t','-','i','s','o','-','c','c','i','t','t','\0',
+ 'k','e','y','E','n','c','i','p','h','e','r','m','e','n','t','\0',
+ 'n','e','t','w','o','r','k','-','a','d','d','r','e','s','s','\0',
+ 'o','n','l','y','S','o','m','e','R','e','a','s','o','n','s','\0',
+ 'p','r','i','n','t','a','b','l','e','S','t','r','i','n','g','\0',
+ 's','u','b','j','e','c','t','U','n','i','q','u','e','I','D','\0',
+ 'u','n','i','v','e','r','s','a','l','S','t','r','i','n','g','\0',
+ 'u','s','e','r','C','e','r','t','i','f','i','c','a','t','e','\0',
+ 'B','a','s','i','c','C','o','n','s','t','r','a','i','n','t','s','\0',
+ 'C','o','u','n','t','e','r','s','i','g','n','a','t','u','r','e','\0',
+ 'E','n','c','r','y','p','t','e','d','C','o','n','t','e','n','t','\0',
+ 'K','E','K','R','e','c','i','p','i','e','n','t','I','n','f','o','\0',
+ 'K','e','y','W','r','a','p','A','l','g','o','r','i','t','h','m','\0',
+ 'O','r','g','a','n','i','z','a','t','i','o','n','N','a','m','e','\0',
+ 'R','C','2','w','r','a','p','P','a','r','a','m','e','t','e','r','\0',
+ 'S','i','g','n','e','d','A','t','t','r','i','b','u','t','e','s','\0',
+ 'S','i','g','n','e','r','I','d','e','n','t','i','f','i','e','r','\0',
+ 'U','n','a','u','t','h','A','t','t','r','i','b','u','t','e','s','\0',
+ 'U','n','i','q','u','e','I','d','e','n','t','i','f','i','e','r','\0',
+ 'd','a','t','a','E','n','c','i','p','h','e','r','m','e','n','t','\0',
+ 'd','h','-','p','u','b','l','i','c','-','n','u','m','b','e','r','\0',
+ 'd','i','g','e','s','t','A','l','g','o','r','i','t','h','m','s','\0',
+ 'd','i','g','i','t','a','l','S','i','g','n','a','t','u','r','e','\0',
+ 'e','n','c','a','p','C','o','n','t','e','n','t','I','n','f','o','\0',
+ 'e','n','c','r','y','p','t','e','d','C','o','n','t','e','n','t','\0',
+ 'e','x','c','l','u','d','e','d','S','u','b','t','r','e','e','s','\0',
+ 'i','d','-','d','s','a','-','w','i','t','h','-','s','h','a','1','\0',
+ 'i','d','-','e','n','c','r','y','p','t','e','d','D','a','t','a','\0',
+ 'i','d','-','e','n','v','e','l','o','p','e','d','D','a','t','a','\0',
+ 'i','d','-','m','e','s','s','a','g','e','D','i','g','e','s','t','\0',
+ 'p','o','l','i','c','y','I','d','e','n','t','i','f','i','e','r','\0',
+ 'p','o','l','i','c','y','Q','u','a','l','i','f','i','e','r','s','\0',
+ 's','u','b','j','e','c','t','P','u','b','l','i','c','K','e','y','\0',
+ 'u','n','p','r','o','t','e','c','t','e','d','A','t','t','r','s','\0',
+ 'A','u','t','h','e','n','t','i','c','a','t','e','d','D','a','t',
+ 'a','\0',
+ 'C','e','r','t','i','f','i','c','a','t','e','I','s','s','u','e',
+ 'r','\0',
+ 'D','i','s','t','r','i','b','u','t','i','o','n','P','o','i','n',
+ 't','\0',
+ 'O','t','h','e','r','K','e','y','A','t','t','r','i','b','u','t',
+ 'e','\0',
+ 'P','o','l','i','c','y','I','n','f','o','r','m','a','t','i','o',
+ 'n','\0',
+ 'P','o','l','i','c','y','Q','u','a','l','i','f','i','e','r','I',
+ 'd','\0',
+ 'P','r','i','v','a','t','e','D','o','m','a','i','n','N','a','m',
+ 'e','\0',
+ 'd','i','s','t','r','i','b','u','t','i','o','n','P','o','i','n',
+ 't','\0',
+ 'i','d','-','a','l','g','-','C','M','S','R','C','2','w','r','a',
+ 'p','\0',
+ 'i','d','-','c','t','-','c','o','n','t','e','n','t','I','n','f',
+ 'o','\0',
+ 'o','r','g','a','n','i','z','a','t','i','o','n','-','n','a','m',
+ 'e','\0',
+ 'p','a','t','h','L','e','n','C','o','n','s','t','r','a','i','n',
+ 't','\0',
+ 'p','e','r','m','i','t','t','e','d','S','u','b','t','r','e','e',
+ 's','\0',
+ 'p','o','l','i','c','y','Q','u','a','l','i','f','i','e','r','I',
+ 'd','\0',
+ 'u','b','-','s','u','r','n','a','m','e','-','l','e','n','g','t',
+ 'h','\0',
+ 'C','e','r','t','i','f','i','c','a','t','e','C','h','o','i','c',
'e','s','\0',
- 'u','b','-','o','r','g','a','n','i','z','a','t','i','o','n','a',
- 'l','-','u','n','i','t','-','n','a','m','e','-','l','e','n','g',
- 't','h','\0',
- 'M','e','s','s','a','g','e','A','u','t','h','e','n','t','i','c',
- 'a','t','i','o','n','C','o','d','e','A','l','g','o','r','i','t',
+ 'E','x','t','e','n','s','i','o','n','A','t','t','r','i','b','u',
+ 't','e','\0',
+ 'T','e','r','m','i','n','a','l','I','d','e','n','t','i','f','i',
+ 'e','r','\0',
+ 'U','n','s','i','g','n','e','d','A','t','t','r','i','b','u','t',
+ 'e','s','\0',
+ 'U','s','e','r','K','e','y','i','n','g','M','a','t','e','r','i',
+ 'a','l','\0',
+ 'a','f','f','i','l','i','a','t','i','o','n','C','h','a','n','g',
+ 'e','d','\0',
+ 'c','r','l','E','n','t','r','y','E','x','t','e','n','s','i','o',
+ 'n','s','\0',
+ 'i','d','-','a','l','g','-','C','M','S','3','D','E','S','w','r',
+ 'a','p','\0',
+ 'i','s','s','u','e','r','D','o','m','a','i','n','P','o','l','i',
+ 'c','y','\0',
+ 's','i','g','n','a','t','u','r','e','A','l','g','o','r','i','t',
'h','m','\0',
- 'K','e','y','E','n','c','r','y','p','t','i','o','n','A','l','g',
- 'o','r','i','t','h','m','I','d','e','n','t','i','f','i','e','r','\0',
- 'B','u','i','l','t','I','n','D','o','m','a','i','n','D','e','f',
- 'i','n','e','d','A','t','t','r','i','b','u','t','e','s','\0',
- 'u','b','-','c','o','u','n','t','r','y','-','n','a','m','e','-',
- 'n','u','m','e','r','i','c','-','l','e','n','g','t','h','\0',
- 'u','b','-','g','e','n','e','r','a','t','i','o','n','-','q','u',
- 'a','l','i','f','i','e','r','-','l','e','n','g','t','h','\0',
- 'B','u','i','l','t','I','n','D','o','m','a','i','n','D','e','f',
- 'i','n','e','d','A','t','t','r','i','b','u','t','e','\0',
- 'S','u','b','j','e','c','t','C','e','r','t','D','i','s','t','r',
- 'i','b','u','t','i','o','n','P','o','i','n','t','\0',
- 'b','u','i','l','t','-','i','n','-','s','t','a','n','d','a','r',
- 'd','-','a','t','t','r','i','b','u','t','e','s','\0',
- 'u','b','-','c','o','u','n','t','r','y','-','n','a','m','e','-',
- 'a','l','p','h','a','-','l','e','n','g','t','h','\0',
- 'u','b','-','d','o','m','a','i','n','-','d','e','f','i','n','e',
- 'd','-','a','t','t','r','i','b','u','t','e','s','\0',
- 'S','i','g','n','a','t','u','r','e','A','l','g','o','r','i','t',
- 'h','m','I','d','e','n','t','i','f','i','e','r','\0',
- 'I','s','s','u','e','r','C','e','r','t','D','i','s','t','r','i',
- 'b','u','t','i','o','n','P','o','i','n','t','\0',
- 'u','b','-','o','r','g','a','n','i','z','a','t','i','o','n','-',
- 'n','a','m','e','-','l','e','n','g','t','h','\0',
- 'K','e','y','A','g','r','e','e','R','e','c','i','p','i','e','n',
- 't','I','d','e','n','t','i','f','i','e','r','\0',
- 'S','u','b','j','e','c','t','D','i','r','e','c','t','o','r','y',
- 'A','t','t','r','i','b','u','t','e','s','\0',
- 'a','d','m','i','n','i','s','t','r','a','t','i','o','n','-','d',
- 'o','m','a','i','n','-','n','a','m','e','\0',
- 'C','r','y','p','t','o','g','r','a','p','h','i','c','M','e','s',
- 's','a','g','e','S','y','n','t','a','x','\0',
- 'D','i','g','e','s','t','A','l','g','o','r','i','t','h','m','I',
- 'd','e','n','t','i','f','i','e','r','s','\0',
- 'C','e','r','t','i','f','i','c','a','t','e','R','e','v','o','c',
- 'a','t','i','o','n','L','i','s','t','s','\0',
- 'c','o','n','t','e','n','t','E','n','c','r','y','p','t','i','o',
- 'n','A','l','g','o','r','i','t','h','m','\0',
- 'R','e','l','a','t','i','v','e','D','i','s','t','i','n','g','u',
- 'i','s','h','e','d','N','a','m','e','\0',
- 'a','u','t','h','o','r','i','t','y','C','e','r','t','S','e','r',
- 'i','a','l','N','u','m','b','e','r','\0',
- 'u','n','i','f','o','r','m','R','e','s','o','u','r','c','e','I',
- 'd','e','n','t','i','f','i','e','r','\0',
- 'B','u','i','l','t','I','n','S','t','a','n','d','a','r','d','A',
- 't','t','r','i','b','u','t','e','s','\0',
- 'o','r','g','a','n','i','z','a','t','i','o','n','a','l','-','u',
- 'n','i','t','-','n','a','m','e','s','\0',
- 'u','b','-','n','u','m','e','r','i','c','-','u','s','e','r','-',
- 'i','d','-','l','e','n','g','t','h','\0',
- 'e','x','t','e','n','s','i','o','n','-','a','t','t','r','i','b',
- 'u','t','e','-','v','a','l','u','e','\0',
- 'D','i','g','e','s','t','A','l','g','o','r','i','t','h','m','I',
- 'd','e','n','t','i','f','i','e','r','\0',
- 'O','r','i','g','i','n','a','t','o','r','I','d','e','n','t','i',
- 'f','i','e','r','O','r','K','e','y','\0',
- 'M','e','s','s','a','g','e','A','u','t','h','e','n','t','i','c',
- 'a','t','i','o','n','C','o','d','e','\0',
- 'u','n','a','u','t','h','e','n','t','i','c','a','t','e','d','A',
- 't','t','r','i','b','u','t','e','s','\0',
- 'i','s','s','u','i','n','g','D','i','s','t','r','i','b','u','t',
- 'i','o','n','P','o','i','n','t','\0',
- 'C','e','r','t','i','f','i','c','a','t','i','o','n','R','e','q',
- 'u','e','s','t','I','n','f','o','\0',
- 'c','e','r','t','i','f','i','c','a','t','i','o','n','R','e','q',
- 'u','e','s','t','I','n','f','o','\0',
- 'A','d','m','i','n','i','s','t','r','a','t','i','o','n','D','o',
- 'm','a','i','n','N','a','m','e','\0',
- 'e','x','t','e','n','s','i','o','n','-','a','t','t','r','i','b',
- 'u','t','e','-','t','y','p','e','\0',
- 'i','d','e','n','t','i','f','i','e','d','-','o','r','g','a','n',
- 'i','z','a','t','i','o','n','\0',
- 'C','e','r','t','i','f','i','c','a','t','e','S','e','r','i','a',
- 'l','N','u','m','b','e','r','\0',
- 'P','o','l','i','c','y','C','o','n','s','t','r','a','i','n','t',
- 's','S','y','n','t','a','x','\0',
- 'n','a','m','e','R','e','l','a','t','i','v','e','T','o','C','R',
- 'L','I','s','s','u','e','r','\0',
- 'P','o','l','i','c','y','D','i','s','t','r','i','b','u','t','i',
- 'o','n','P','o','i','n','t','\0',
- 'n','u','m','e','r','i','c','-','u','s','e','r','-','i','d','e',
- 'n','t','i','f','i','e','r','\0',
- 'O','r','g','a','n','i','z','a','t','i','o','n','a','l','U','n',
- 'i','t','N','a','m','e','s','\0',
- 'u','b','-','o','r','g','a','n','i','z','a','t','i','o','n','a',
- 'l','-','u','n','i','t','s','\0',
- 'u','b','-','e','x','t','e','n','s','i','o','n','-','a','t','t',
- 'r','i','b','u','t','e','s','\0',
- 'E','n','c','a','p','s','u','l','a','t','e','d','C','o','n','t',
- 'e','n','t','I','n','f','o','\0',
- 'e','x','t','e','n','d','e','d','C','e','r','t','i','f','i','c',
- 'a','t','e','I','n','f','o','\0',
+ 'u','b','-','i','n','i','t','i','a','l','s','-','l','e','n','g',
+ 't','h','\0',
+ 'A','l','g','o','r','i','t','h','m','I','d','e','n','t','i','f',
+ 'i','e','r','\0',
+ 'C','R','L','D','i','s','t','P','o','i','n','t','s','S','y','n',
+ 't','a','x','\0',
+ 'C','e','r','t','i','f','i','c','a','t','e','P','o','l','i','c',
+ 'i','e','s','\0',
'E','x','t','e','n','d','e','d','C','e','r','t','i','f','i','c',
- 'a','t','e','I','n','f','o','\0',
- 'A','u','t','h','o','r','i','t','y','K','e','y','I','d','e','n',
- 't','i','f','i','e','r','\0',
- 'u','b','-','x','1','2','1','-','a','d','d','r','e','s','s','-',
- 'l','e','n','g','t','h','\0',
- 'O','r','g','a','n','i','z','a','t','i','o','n','a','l','U','n',
- 'i','t','N','a','m','e','\0',
- 'k','e','y','E','n','c','r','y','p','t','i','o','n','A','l','g',
- 'o','r','i','t','h','m','\0',
- 'r','e','c','i','p','i','e','n','t','E','n','c','r','y','p','t',
- 'e','d','K','e','y','s','\0',
- 'R','e','c','i','p','i','e','n','t','E','n','c','r','y','p','t',
- 'e','d','K','e','y','s','\0',
- 'R','e','c','i','p','i','e','n','t','K','e','y','I','d','e','n',
- 't','i','f','i','e','r','\0',
+ 'a','t','e','\0',
+ 'E','x','t','e','n','s','i','o','n','A','t','t','r','i','b','u',
+ 't','e','s','\0',
+ 'O','r','i','g','i','n','a','t','o','r','P','u','b','l','i','c',
+ 'K','e','y','\0',
+ 'P','o','l','i','c','y','Q','u','a','l','i','f','i','e','r','I',
+ 'n','f','o','\0',
+ 'R','C','2','P','a','r','a','m','e','t','e','r','V','e','r','s',
+ 'i','o','n','\0',
+ 'R','e','c','i','p','i','e','n','t','I','d','e','n','t','i','f',
+ 'i','e','r','\0',
+ 'a','u','t','h','o','r','i','t','y','C','e','r','t','I','s','s',
+ 'u','e','r','\0',
+ 'e','n','c','r','y','p','t','i','o','n','A','l','g','o','r','i',
+ 't','h','m','\0',
+ 'e','x','t','e','n','d','e','d','C','e','r','t','i','f','i','c',
+ 'a','t','e','\0',
+ 'i','d','-','c','o','u','n','t','e','r','s','i','g','n','a','t',
+ 'u','r','e','\0',
+ 'o','n','l','y','C','o','n','t','a','i','n','s','C','A','C','e',
+ 'r','t','s','\0',
+ 'p','r','i','v','a','t','e','-','d','o','m','a','i','n','-','n',
+ 'a','m','e','\0',
+ 'r','c','2','P','a','r','a','m','e','t','e','r','V','e','r','s',
+ 'i','o','n','\0',
+ 'r','e','v','o','k','e','d','C','e','r','t','i','f','i','c','a',
+ 't','e','s','\0',
+ 's','u','b','j','e','c','t','D','o','m','a','i','n','P','o','l',
+ 'i','c','y','\0',
+ 't','e','r','m','i','n','a','l','-','i','d','e','n','t','i','f',
+ 'i','e','r','\0',
+ 'E','n','c','r','y','p','t','e','d','C','o','n','t','e','n','t',
+ 'I','n','f','o','\0',
+ 'P','o','l','i','c','y','M','a','p','p','i','n','g','s','S','y',
+ 'n','t','a','x','\0',
+ 'S','u','b','j','e','c','t','K','e','y','I','d','e','n','t','i',
+ 'f','i','e','r','\0',
+ 'S','u','b','j','e','c','t','P','u','b','l','i','c','K','e','y',
+ 'I','n','f','o','\0',
+ 'c','e','s','s','a','t','i','o','n','O','f','O','p','e','r','a',
+ 't','i','o','n','\0',
+ 'e','n','c','r','y','p','t','e','d','C','o','n','t','e','n','t',
+ 'I','n','f','o','\0',
+ 'e','x','t','e','n','s','i','o','n','-','a','t','t','r','i','b',
+ 'u','t','e','s','\0',
+ 'g','e','n','e','r','a','t','i','o','n','-','q','u','a','l','i',
+ 'f','i','e','r','\0',
+ 'i','n','h','i','b','i','t','P','o','l','i','c','y','M','a','p',
+ 'p','i','n','g','\0',
+ 'i','s','o','-','3','1','6','6','-','a','l','p','h','a','2','-',
+ 'c','o','d','e','\0',
+ 's','u','b','j','e','c','t','K','e','y','I','d','e','n','t','i',
+ 'f','i','e','r','\0',
+ 's','u','b','j','e','c','t','P','u','b','l','i','c','K','e','y',
+ 'I','n','f','o','\0',
+ 'u','b','-','g','i','v','e','n','-','n','a','m','e','-','l','e',
+ 'n','g','t','h','\0',
'A','t','t','r','i','b','u','t','e','T','y','p','e','A','n','d',
'V','a','l','u','e','\0',
- 'r','e','q','u','i','r','e','E','x','p','l','i','c','i','t','P',
- 'o','l','i','c','y','\0',
'D','i','s','t','r','i','b','u','t','i','o','n','P','o','i','n',
't','N','a','m','e','\0',
- 'o','n','l','y','C','o','n','t','a','i','n','s','U','s','e','r',
- 'C','e','r','t','s','\0',
+ 'I','s','s','u','e','r','A','n','d','S','e','r','i','a','l','N',
+ 'u','m','b','e','r','\0',
+ 'K','e','y','A','g','r','e','e','R','e','c','i','p','i','e','n',
+ 't','I','n','f','o','\0',
+ 'K','e','y','T','r','a','n','s','R','e','c','i','p','i','e','n',
+ 't','I','n','f','o','\0',
'N','u','m','e','r','i','c','U','s','e','r','I','d','e','n','t',
'i','f','i','e','r','\0',
+ 'R','e','c','i','p','i','e','n','t','E','n','c','r','y','p','t',
+ 'e','d','K','e','y','\0',
+ 'U','n','p','r','o','t','e','c','t','e','d','A','t','t','r','i',
+ 'b','u','t','e','s','\0',
+ 'i','s','s','u','e','r','A','n','d','S','e','r','i','a','l','N',
+ 'u','m','b','e','r','\0',
+ 'o','n','l','y','C','o','n','t','a','i','n','s','U','s','e','r',
+ 'C','e','r','t','s','\0',
+ 'r','e','q','u','i','r','e','E','x','p','l','i','c','i','t','P',
+ 'o','l','i','c','y','\0',
'u','b','-','d','o','m','a','i','n','-','n','a','m','e','-','l',
'e','n','g','t','h','\0',
'u','b','-','t','e','r','m','i','n','a','l','-','i','d','-','l',
'e','n','g','t','h','\0',
- 'i','s','s','u','e','r','A','n','d','S','e','r','i','a','l','N',
- 'u','m','b','e','r','\0',
- 'I','s','s','u','e','r','A','n','d','S','e','r','i','a','l','N',
- 'u','m','b','e','r','\0',
- 'U','n','p','r','o','t','e','c','t','e','d','A','t','t','r','i',
- 'b','u','t','e','s','\0',
- 'K','e','y','T','r','a','n','s','R','e','c','i','p','i','e','n',
- 't','I','n','f','o','\0',
- 'K','e','y','A','g','r','e','e','R','e','c','i','p','i','e','n',
- 't','I','n','f','o','\0',
+ 'A','u','t','h','o','r','i','t','y','K','e','y','I','d','e','n',
+ 't','i','f','i','e','r','\0',
+ 'O','r','g','a','n','i','z','a','t','i','o','n','a','l','U','n',
+ 'i','t','N','a','m','e','\0',
'R','e','c','i','p','i','e','n','t','E','n','c','r','y','p','t',
- 'e','d','K','e','y','\0',
- 's','u','b','j','e','c','t','P','u','b','l','i','c','K','e','y',
- 'I','n','f','o','\0',
- 'S','u','b','j','e','c','t','P','u','b','l','i','c','K','e','y',
- 'I','n','f','o','\0',
- 'P','o','l','i','c','y','M','a','p','p','i','n','g','s','S','y',
- 'n','t','a','x','\0',
- 'i','n','h','i','b','i','t','P','o','l','i','c','y','M','a','p',
- 'p','i','n','g','\0',
- 'c','e','s','s','a','t','i','o','n','O','f','O','p','e','r','a',
- 't','i','o','n','\0',
- 'i','s','o','-','3','1','6','6','-','a','l','p','h','a','2','-',
- 'c','o','d','e','\0',
- 'u','b','-','g','i','v','e','n','-','n','a','m','e','-','l','e',
- 'n','g','t','h','\0',
- 'g','e','n','e','r','a','t','i','o','n','-','q','u','a','l','i',
- 'f','i','e','r','\0',
- 's','u','b','j','e','c','t','K','e','y','I','d','e','n','t','i',
- 'f','i','e','r','\0',
- 'S','u','b','j','e','c','t','K','e','y','I','d','e','n','t','i',
- 'f','i','e','r','\0',
- 'e','n','c','r','y','p','t','e','d','C','o','n','t','e','n','t',
- 'I','n','f','o','\0',
- 'E','n','c','r','y','p','t','e','d','C','o','n','t','e','n','t',
- 'I','n','f','o','\0',
- 'a','u','t','h','o','r','i','t','y','C','e','r','t','I','s','s',
- 'u','e','r','\0',
- 'C','e','r','t','i','f','i','c','a','t','e','P','o','l','i','c',
- 'i','e','s','\0',
- 'P','o','l','i','c','y','Q','u','a','l','i','f','i','e','r','I',
- 'n','f','o','\0',
- 's','u','b','j','e','c','t','D','o','m','a','i','n','P','o','l',
- 'i','c','y','\0',
- 'C','R','L','D','i','s','t','P','o','i','n','t','s','S','y','n',
- 't','a','x','\0',
- 'r','e','v','o','k','e','d','C','e','r','t','i','f','i','c','a',
- 't','e','s','\0',
- 'o','n','l','y','C','o','n','t','a','i','n','s','C','A','C','e',
- 'r','t','s','\0',
- 'E','x','t','e','n','s','i','o','n','A','t','t','r','i','b','u',
- 't','e','s','\0',
- 't','e','r','m','i','n','a','l','-','i','d','e','n','t','i','f',
- 'i','e','r','\0',
- 'p','r','i','v','a','t','e','-','d','o','m','a','i','n','-','n',
- 'a','m','e','\0',
- 'O','r','i','g','i','n','a','t','o','r','P','u','b','l','i','c',
- 'K','e','y','\0',
- 'e','x','t','e','n','d','e','d','C','e','r','t','i','f','i','c',
- 'a','t','e','\0',
+ 'e','d','K','e','y','s','\0',
+ 'R','e','c','i','p','i','e','n','t','K','e','y','I','d','e','n',
+ 't','i','f','i','e','r','\0',
+ 'k','e','y','E','n','c','r','y','p','t','i','o','n','A','l','g',
+ 'o','r','i','t','h','m','\0',
+ 'r','e','c','i','p','i','e','n','t','E','n','c','r','y','p','t',
+ 'e','d','K','e','y','s','\0',
+ 'u','b','-','x','1','2','1','-','a','d','d','r','e','s','s','-',
+ 'l','e','n','g','t','h','\0',
+ 'C','e','r','t','i','f','i','c','a','t','e','S','e','r','i','a',
+ 'l','N','u','m','b','e','r','\0',
+ 'E','n','c','a','p','s','u','l','a','t','e','d','C','o','n','t',
+ 'e','n','t','I','n','f','o','\0',
'E','x','t','e','n','d','e','d','C','e','r','t','i','f','i','c',
- 'a','t','e','\0',
- 'e','n','c','r','y','p','t','i','o','n','A','l','g','o','r','i',
- 't','h','m','\0',
- 'R','C','2','P','a','r','a','m','e','t','e','r','V','e','r','s',
- 'i','o','n','\0',
- 'r','c','2','P','a','r','a','m','e','t','e','r','V','e','r','s',
- 'i','o','n','\0',
- 'i','d','-','c','o','u','n','t','e','r','s','i','g','n','a','t',
- 'u','r','e','\0',
- 's','i','g','n','a','t','u','r','e','A','l','g','o','r','i','t',
+ 'a','t','e','I','n','f','o','\0',
+ 'O','r','g','a','n','i','z','a','t','i','o','n','a','l','U','n',
+ 'i','t','N','a','m','e','s','\0',
+ 'P','o','l','i','c','y','C','o','n','s','t','r','a','i','n','t',
+ 's','S','y','n','t','a','x','\0',
+ 'P','o','l','i','c','y','D','i','s','t','r','i','b','u','t','i',
+ 'o','n','P','o','i','n','t','\0',
+ 'a','u','t','h','e','n','t','i','c','a','t','e','d','A','t','t',
+ 'r','i','b','u','t','e','s','\0',
+ 'e','x','t','e','n','d','e','d','C','e','r','t','i','f','i','c',
+ 'a','t','e','I','n','f','o','\0',
+ 'i','d','e','n','t','i','f','i','e','d','-','o','r','g','a','n',
+ 'i','z','a','t','i','o','n','\0',
+ 'n','a','m','e','R','e','l','a','t','i','v','e','T','o','C','R',
+ 'L','I','s','s','u','e','r','\0',
+ 'n','u','m','e','r','i','c','-','u','s','e','r','-','i','d','e',
+ 'n','t','i','f','i','e','r','\0',
+ 'u','b','-','e','x','t','e','n','s','i','o','n','-','a','t','t',
+ 'r','i','b','u','t','e','s','\0',
+ 'u','b','-','o','r','g','a','n','i','z','a','t','i','o','n','a',
+ 'l','-','u','n','i','t','s','\0',
+ 'A','d','m','i','n','i','s','t','r','a','t','i','o','n','D','o',
+ 'm','a','i','n','N','a','m','e','\0',
+ 'C','e','r','t','i','f','i','c','a','t','i','o','n','R','e','q',
+ 'u','e','s','t','I','n','f','o','\0',
+ 'c','e','r','t','i','f','i','c','a','t','i','o','n','R','e','q',
+ 'u','e','s','t','I','n','f','o','\0',
+ 'e','x','t','e','n','s','i','o','n','-','a','t','t','r','i','b',
+ 'u','t','e','-','t','y','p','e','\0',
+ 'i','s','s','u','i','n','g','D','i','s','t','r','i','b','u','t',
+ 'i','o','n','P','o','i','n','t','\0',
+ 'B','u','i','l','t','I','n','S','t','a','n','d','a','r','d','A',
+ 't','t','r','i','b','u','t','e','s','\0',
+ 'D','i','g','e','s','t','A','l','g','o','r','i','t','h','m','I',
+ 'd','e','n','t','i','f','i','e','r','\0',
+ 'M','e','s','s','a','g','e','A','u','t','h','e','n','t','i','c',
+ 'a','t','i','o','n','C','o','d','e','\0',
+ 'O','r','i','g','i','n','a','t','o','r','I','d','e','n','t','i',
+ 'f','i','e','r','O','r','K','e','y','\0',
+ 'R','e','l','a','t','i','v','e','D','i','s','t','i','n','g','u',
+ 'i','s','h','e','d','N','a','m','e','\0',
+ 'a','u','t','h','o','r','i','t','y','C','e','r','t','S','e','r',
+ 'i','a','l','N','u','m','b','e','r','\0',
+ 'e','x','t','e','n','s','i','o','n','-','a','t','t','r','i','b',
+ 'u','t','e','-','v','a','l','u','e','\0',
+ 'o','r','g','a','n','i','z','a','t','i','o','n','a','l','-','u',
+ 'n','i','t','-','n','a','m','e','s','\0',
+ 'u','b','-','n','u','m','e','r','i','c','-','u','s','e','r','-',
+ 'i','d','-','l','e','n','g','t','h','\0',
+ 'u','n','a','u','t','h','e','n','t','i','c','a','t','e','d','A',
+ 't','t','r','i','b','u','t','e','s','\0',
+ 'u','n','i','f','o','r','m','R','e','s','o','u','r','c','e','I',
+ 'd','e','n','t','i','f','i','e','r','\0',
+ 'C','e','r','t','i','f','i','c','a','t','e','R','e','v','o','c',
+ 'a','t','i','o','n','L','i','s','t','s','\0',
+ 'C','r','y','p','t','o','g','r','a','p','h','i','c','M','e','s',
+ 's','a','g','e','S','y','n','t','a','x','\0',
+ 'D','i','g','e','s','t','A','l','g','o','r','i','t','h','m','I',
+ 'd','e','n','t','i','f','i','e','r','s','\0',
+ 'S','u','b','j','e','c','t','D','i','r','e','c','t','o','r','y',
+ 'A','t','t','r','i','b','u','t','e','s','\0',
+ 'a','d','m','i','n','i','s','t','r','a','t','i','o','n','-','d',
+ 'o','m','a','i','n','-','n','a','m','e','\0',
+ 'c','o','n','t','e','n','t','E','n','c','r','y','p','t','i','o',
+ 'n','A','l','g','o','r','i','t','h','m','\0',
+ 'I','s','s','u','e','r','C','e','r','t','D','i','s','t','r','i',
+ 'b','u','t','i','o','n','P','o','i','n','t','\0',
+ 'K','e','y','A','g','r','e','e','R','e','c','i','p','i','e','n',
+ 't','I','d','e','n','t','i','f','i','e','r','\0',
+ 'u','b','-','o','r','g','a','n','i','z','a','t','i','o','n','-',
+ 'n','a','m','e','-','l','e','n','g','t','h','\0',
+ 'S','i','g','n','a','t','u','r','e','A','l','g','o','r','i','t',
+ 'h','m','I','d','e','n','t','i','f','i','e','r','\0',
+ 'S','u','b','j','e','c','t','C','e','r','t','D','i','s','t','r',
+ 'i','b','u','t','i','o','n','P','o','i','n','t','\0',
+ 'b','u','i','l','t','-','i','n','-','s','t','a','n','d','a','r',
+ 'd','-','a','t','t','r','i','b','u','t','e','s','\0',
+ 'u','b','-','c','o','u','n','t','r','y','-','n','a','m','e','-',
+ 'a','l','p','h','a','-','l','e','n','g','t','h','\0',
+ 'u','b','-','d','o','m','a','i','n','-','d','e','f','i','n','e',
+ 'd','-','a','t','t','r','i','b','u','t','e','s','\0',
+ 'B','u','i','l','t','I','n','D','o','m','a','i','n','D','e','f',
+ 'i','n','e','d','A','t','t','r','i','b','u','t','e','\0',
+ 'B','u','i','l','t','I','n','D','o','m','a','i','n','D','e','f',
+ 'i','n','e','d','A','t','t','r','i','b','u','t','e','s','\0',
+ 'u','b','-','c','o','u','n','t','r','y','-','n','a','m','e','-',
+ 'n','u','m','e','r','i','c','-','l','e','n','g','t','h','\0',
+ 'u','b','-','g','e','n','e','r','a','t','i','o','n','-','q','u',
+ 'a','l','i','f','i','e','r','-','l','e','n','g','t','h','\0',
+ 'K','e','y','E','n','c','r','y','p','t','i','o','n','A','l','g',
+ 'o','r','i','t','h','m','I','d','e','n','t','i','f','i','e','r','\0',
+ 'M','e','s','s','a','g','e','A','u','t','h','e','n','t','i','c',
+ 'a','t','i','o','n','C','o','d','e','A','l','g','o','r','i','t',
'h','m','\0',
- 'i','s','s','u','e','r','D','o','m','a','i','n','P','o','l','i',
- 'c','y','\0',
- 'a','f','f','i','l','i','a','t','i','o','n','C','h','a','n','g',
- 'e','d','\0',
- 'c','r','l','E','n','t','r','y','E','x','t','e','n','s','i','o',
- 'n','s','\0',
- 'T','e','r','m','i','n','a','l','I','d','e','n','t','i','f','i',
- 'e','r','\0',
- 'u','b','-','i','n','i','t','i','a','l','s','-','l','e','n','g',
- 't','h','\0',
- 'E','x','t','e','n','s','i','o','n','A','t','t','r','i','b','u',
- 't','e','\0',
- 'U','n','s','i','g','n','e','d','A','t','t','r','i','b','u','t',
- 'e','s','\0',
- 'U','s','e','r','K','e','y','i','n','g','M','a','t','e','r','i',
- 'a','l','\0',
- 'C','e','r','t','i','f','i','c','a','t','e','C','h','o','i','c',
+ 'b','u','i','l','t','-','i','n','-','d','o','m','a','i','n','-',
+ 'd','e','f','i','n','e','d','-','a','t','t','r','i','b','u','t',
'e','s','\0',
- 'i','d','-','a','l','g','-','C','M','S','3','D','E','S','w','r',
- 'a','p','\0',
- 'P','o','l','i','c','y','I','n','f','o','r','m','a','t','i','o',
- 'n','\0',
- 'p','o','l','i','c','y','Q','u','a','l','i','f','i','e','r','I',
- 'd','\0',
- 'P','o','l','i','c','y','Q','u','a','l','i','f','i','e','r','I',
- 'd','\0',
- 'p','a','t','h','L','e','n','C','o','n','s','t','r','a','i','n',
- 't','\0',
- 'p','e','r','m','i','t','t','e','d','S','u','b','t','r','e','e',
- 's','\0',
- 'd','i','s','t','r','i','b','u','t','i','o','n','P','o','i','n',
- 't','\0',
- 'C','e','r','t','i','f','i','c','a','t','e','I','s','s','u','e',
- 'r','\0',
- 'P','r','i','v','a','t','e','D','o','m','a','i','n','N','a','m',
- 'e','\0',
- 'o','r','g','a','n','i','z','a','t','i','o','n','-','n','a','m',
- 'e','\0',
- 'u','b','-','s','u','r','n','a','m','e','-','l','e','n','g','t',
- 'h','\0',
- 'O','t','h','e','r','K','e','y','A','t','t','r','i','b','u','t',
- 'e','\0',
- 'A','u','t','h','e','n','t','i','c','a','t','e','d','D','a','t',
- 'a','\0',
- 'i','d','-','a','l','g','-','C','M','S','R','C','2','w','r','a',
- 'p','\0',
- 'i','d','-','c','t','-','c','o','n','t','e','n','t','I','n','f',
- 'o','\0',
- 'U','n','i','q','u','e','I','d','e','n','t','i','f','i','e','r','\0',
- 's','u','b','j','e','c','t','P','u','b','l','i','c','K','e','y','\0',
- 'd','i','g','i','t','a','l','S','i','g','n','a','t','u','r','e','\0',
- 'd','a','t','a','E','n','c','i','p','h','e','r','m','e','n','t','\0',
- 'p','o','l','i','c','y','I','d','e','n','t','i','f','i','e','r','\0',
- 'p','o','l','i','c','y','Q','u','a','l','i','f','i','e','r','s','\0',
- 'B','a','s','i','c','C','o','n','s','t','r','a','i','n','t','s','\0',
- 'e','x','c','l','u','d','e','d','S','u','b','t','r','e','e','s','\0',
- 'O','r','g','a','n','i','z','a','t','i','o','n','N','a','m','e','\0',
- 'd','i','g','e','s','t','A','l','g','o','r','i','t','h','m','s','\0',
- 'e','n','c','a','p','C','o','n','t','e','n','t','I','n','f','o','\0',
- 'S','i','g','n','e','r','I','d','e','n','t','i','f','i','e','r','\0',
- 'S','i','g','n','e','d','A','t','t','r','i','b','u','t','e','s','\0',
- 'u','n','p','r','o','t','e','c','t','e','d','A','t','t','r','s','\0',
- 'e','n','c','r','y','p','t','e','d','C','o','n','t','e','n','t','\0',
- 'E','n','c','r','y','p','t','e','d','C','o','n','t','e','n','t','\0',
- 'K','E','K','R','e','c','i','p','i','e','n','t','I','n','f','o','\0',
- 'U','n','a','u','t','h','A','t','t','r','i','b','u','t','e','s','\0',
- 'C','o','u','n','t','e','r','s','i','g','n','a','t','u','r','e','\0',
- 'i','d','-','d','s','a','-','w','i','t','h','-','s','h','a','1','\0',
- 'd','h','-','p','u','b','l','i','c','-','n','u','m','b','e','r','\0',
- 'K','e','y','W','r','a','p','A','l','g','o','r','i','t','h','m','\0',
- 'R','C','2','w','r','a','p','P','a','r','a','m','e','t','e','r','\0',
- 'i','d','-','e','n','v','e','l','o','p','e','d','D','a','t','a','\0',
- 'i','d','-','e','n','c','r','y','p','t','e','d','D','a','t','a','\0',
- 'i','d','-','m','e','s','s','a','g','e','D','i','g','e','s','t','\0',
- 'j','o','i','n','t','-','i','s','o','-','c','c','i','t','t','\0',
- 's','u','b','j','e','c','t','U','n','i','q','u','e','I','D','\0',
- 'D','i','r','e','c','t','o','r','y','S','t','r','i','n','g','\0',
- 'p','r','i','n','t','a','b','l','e','S','t','r','i','n','g','\0',
- 'u','n','i','v','e','r','s','a','l','S','t','r','i','n','g','\0',
- 'k','e','y','E','n','c','i','p','h','e','r','m','e','n','t','\0',
- 'N','a','m','e','C','o','n','s','t','r','a','i','n','t','s','\0',
- 'G','e','n','e','r','a','l','S','u','b','t','r','e','e','s','\0',
- 'c','e','r','t','i','f','i','c','a','t','e','H','o','l','d','\0',
- 'C','e','r','t','i','f','i','c','a','t','e','L','i','s','t','\0',
- 'u','s','e','r','C','e','r','t','i','f','i','c','a','t','e','\0',
- 'o','n','l','y','S','o','m','e','R','e','a','s','o','n','s','\0',
- 'n','e','t','w','o','r','k','-','a','d','d','r','e','s','s','\0',
- 'd','i','g','e','s','t','A','l','g','o','r','i','t','h','m','\0',
- 'R','C','2','C','B','C','P','a','r','a','m','e','t','e','r','\0',
- 'i','d','-','d','i','g','e','s','t','e','d','D','a','t','a','\0',
- 't','b','s','C','e','r','t','i','f','i','c','a','t','e','\0',
- 'T','B','S','C','e','r','t','i','f','i','c','a','t','e','\0',
- 'i','s','s','u','e','r','U','n','i','q','u','e','I','D','\0',
- 'A','t','t','r','i','b','u','t','e','V','a','l','u','e','\0',
- 'n','o','n','R','e','p','u','d','i','a','t','i','o','n','\0',
- 'S','u','b','j','e','c','t','A','l','t','N','a','m','e','\0',
- 'G','e','n','e','r','a','l','S','u','b','t','r','e','e','\0',
- 'T','e','s','t','I','d','e','n','t','i','f','i','e','r','\0',
- 's','i','g','n','a','t','u','r','e','V','a','l','u','e','\0',
- 'r','e','v','o','c','a','t','i','o','n','D','a','t','e','\0',
- 'I','n','v','a','l','i','d','i','t','y','D','a','t','e','\0',
- 'N','e','t','w','o','r','k','A','d','d','r','e','s','s','\0',
- 'C','e','r','t','i','f','i','c','a','t','e','S','e','t','\0',
- 'S','i','g','n','a','t','u','r','e','V','a','l','u','e','\0',
- 'o','r','i','g','i','n','a','t','o','r','I','n','f','o','\0',
- 'O','r','i','g','i','n','a','t','o','r','I','n','f','o','\0',
- 'r','e','c','i','p','i','e','n','t','I','n','f','o','s','\0',
- 'R','e','c','i','p','i','e','n','t','I','n','f','o','s','\0',
- 'A','u','t','h','A','t','t','r','i','b','u','t','e','s','\0',
- 'i','d','-','c','t','-','a','u','t','h','D','a','t','a','\0',
- 'i','d','-','c','o','n','t','e','n','t','T','y','p','e','\0',
- 'i','d','-','s','i','g','n','i','n','g','T','i','m','e','\0',
- 'A','t','t','r','i','b','u','t','e','T','y','p','e','\0',
- 't','e','l','e','t','e','x','S','t','r','i','n','g','\0',
- 'k','e','y','I','d','e','n','t','i','f','i','e','r','\0',
- 'd','i','r','e','c','t','o','r','y','N','a','m','e','\0',
- 'B','i','o','m','e','t','r','i','c','D','a','t','a','\0',
- 'k','e','y','C','o','m','p','r','o','m','i','s','e','\0',
- 'c','r','l','E','x','t','e','n','s','i','o','n','s','\0',
- 'r','e','m','o','v','e','F','r','o','m','C','R','L','\0',
- 'p','e','r','s','o','n','a','l','-','n','a','m','e','\0',
- 'x','1','2','1','-','d','c','c','-','c','o','d','e','\0',
- 'u','n','s','i','g','n','e','d','A','t','t','r','s','\0',
- 'E','n','v','e','l','o','p','e','d','D','a','t','a','\0',
- 'o','r','i','g','i','n','a','t','o','r','K','e','y','\0',
- 'K','E','K','I','d','e','n','t','i','f','i','e','r','\0',
- 'E','n','c','r','y','p','t','e','d','D','a','t','a','\0',
- 'M','e','s','s','a','g','e','D','i','g','e','s','t','\0',
- 'r','s','a','E','n','c','r','y','p','t','i','o','n','\0',
- 'i','d','-','s','i','g','n','e','d','D','a','t','a','\0',
- 's','e','r','i','a','l','N','u','m','b','e','r','\0',
- 'G','e','n','e','r','a','l','N','a','m','e','s','\0',
- 'k','e','y','A','g','r','e','e','m','e','n','t','\0',
- 'e','n','c','i','p','h','e','r','O','n','l','y','\0',
- 'd','e','c','i','p','h','e','r','O','n','l','y','\0',
- 'C','e','r','t','P','o','l','i','c','y','I','d','\0',
- 'e','d','i','P','a','r','t','y','N','a','m','e','\0',
- 'E','D','I','P','a','r','t','y','N','a','m','e','\0',
- 'r','e','g','i','s','t','e','r','e','d','I','D','\0',
- 'n','a','m','e','A','s','s','i','g','n','e','r','\0',
- 'B','a','s','e','D','i','s','t','a','n','c','e','\0',
- 'c','A','C','o','m','p','r','o','m','i','s','e','\0',
- 'c','o','u','n','t','r','y','-','n','a','m','e','\0',
- 'P','e','r','s','o','n','a','l','N','a','m','e','\0',
- 'c','e','r','t','i','f','i','c','a','t','e','s','\0',
- 'e','C','o','n','t','e','n','t','T','y','p','e','\0',
- 'e','n','c','r','y','p','t','e','d','K','e','y','\0',
- 'D','i','g','e','s','t','e','d','D','a','t','a','\0',
- 'm','a','c','A','l','g','o','r','i','t','h','m','\0',
- 'd','e','s','-','e','d','e','3','-','c','b','c','\0',
- 'r','d','n','S','e','q','u','e','n','c','e','\0',
- 'R','D','N','S','e','q','u','e','n','c','e','\0',
- 'g','e','n','e','r','a','l','T','i','m','e','\0',
- 'k','e','y','C','e','r','t','S','i','g','n','\0',
- 'G','e','n','e','r','a','l','N','a','m','e','\0',
- 'x','4','0','0','A','d','d','r','e','s','s','\0',
- 'R','e','a','s','o','n','F','l','a','g','s','\0',
- 't','b','s','C','e','r','t','L','i','s','t','\0',
- 'T','B','S','C','e','r','t','L','i','s','t','\0',
- 'u','n','s','p','e','c','i','f','i','e','d','\0',
- 'i','n','d','i','r','e','c','t','C','R','L','\0',
- 'C','o','u','n','t','r','y','N','a','m','e','\0',
- 'X','1','2','1','A','d','d','r','e','s','s','\0',
- 'm','e','m','b','e','r','-','b','o','d','y','\0',
- 's','i','g','n','e','r','I','n','f','o','s','\0',
- 'S','i','g','n','e','r','I','n','f','o','s','\0',
- 'c','e','r','t','i','f','i','c','a','t','e','\0',
- 'S','i','g','n','i','n','g','T','i','m','e','\0',
- 'n','u','m','b','e','r','-','t','y','p','e','\0',
- 'i','d','-','a','l','g','-','E','S','D','H','\0',
- 'm','e','c','h','a','n','i','s','m','s','\0',
- 'p','a','r','a','m','e','t','e','r','s','\0',
- 'e','x','t','e','n','s','i','o','n','s','\0',
- 'u','t','f','8','S','t','r','i','n','g','\0',
- 'r','f','c','8','2','2','N','a','m','e','\0',
- 's','u','p','e','r','s','e','d','e','d','\0',
- 't','h','i','s','U','p','d','a','t','e','\0',
- 'n','e','x','t','U','p','d','a','t','e','\0',
- 'g','i','v','e','n','-','n','a','m','e','\0',
- 'S','i','g','n','e','d','D','a','t','a','\0',
- 'C','M','S','V','e','r','s','i','o','n','\0',
- 'S','i','g','n','e','r','I','n','f','o','\0',
- 'a','t','t','r','V','a','l','u','e','s','\0',
- 'o','r','i','g','i','n','a','t','o','r','\0',
- 't','e','l','e','t','r','u','s','t','\0',
- 'a','l','g','o','r','i','t','h','m','\0',
- 'b','m','p','S','t','r','i','n','g','\0',
- 'n','o','t','B','e','f','o','r','e','\0',
- 'E','x','t','e','n','s','i','o','n','\0',
- 'e','x','t','n','V','a','l','u','e','\0',
- 'o','t','h','e','r','N','a','m','e','\0',
- 'O','t','h','e','r','N','a','m','e','\0',
- 'O','R','A','d','d','r','e','s','s','\0',
- 'i','P','A','d','d','r','e','s','s','\0',
- 'p','a','r','t','y','N','a','m','e','\0',
- 'S','k','i','p','C','e','r','t','s','\0',
- 'c','R','L','I','s','s','u','e','r','\0',
- 'C','R','L','R','e','a','s','o','n','\0',
- 'c','R','L','N','u','m','b','e','r','\0',
- 'p','r','i','n','t','a','b','l','e','\0',
- 'p','u','b','l','i','c','K','e','y','\0',
- 'k','e','y','A','t','t','r','I','d','\0',
- 'a','n','s','i','-','x','9','4','2','\0',
- 'h','M','A','C','-','S','H','A','1','\0',
- 'i','n','t','e','r','n','e','t','\0',
- 's','e','c','u','r','i','t','y','\0',
- 'v','a','l','i','d','i','t','y','\0',
- 'V','a','l','i','d','i','t','y','\0',
- 'n','o','t','A','f','t','e','r','\0',
- 'c','r','i','t','i','c','a','l','\0',
- 'K','e','y','U','s','a','g','e','\0',
- 'f','u','l','l','N','a','m','e','\0',
- 'i','n','i','t','i','a','l','s','\0',
- 'e','C','o','n','t','e','n','t','\0',
- 'a','t','t','r','T','y','p','e','\0',
- 'v','e','r','s','i','o','n','\0',
- 's','u','b','j','e','c','t','\0',
- 'm','a','x','S','i','z','e','\0',
- 'u','t','c','T','i','m','e','\0',
- 'c','R','L','S','i','g','n','\0',
- 'd','N','S','N','a','m','e','\0',
- 't','y','p','e','-','i','d','\0',
- 'm','i','n','i','m','u','m','\0',
- 'm','a','x','i','m','u','m','\0',
- 'r','e','a','s','o','n','s','\0',
- 'n','u','m','e','r','i','c','\0',
- 's','u','r','n','a','m','e','\0',
- 'm','o','d','u','l','e','s','\0',
- 'c','o','n','t','e','n','t','\0',
- 'k','e','y','A','t','t','r','\0',
- 'r','c','2','-','c','b','c','\0',
- 'i','d','-','d','a','t','a','\0',
- 'T','M','T','T','v','2','\0',
- 'i','s','s','u','e','r','\0',
- 'v','a','l','u','e','s','\0',
- 'e','x','t','n','I','D','\0',
- 't','y','p','e','I','d','\0',
- 'u','n','u','s','e','d','\0',
- 'r','s','a','d','s','i','\0',
- '1','1','3','5','4','9','\0',
- 'p','k','c','s','-','9','\0',
- 'r','K','e','y','I','d','\0',
- 'd','i','g','e','s','t','\0',
- 's','e','c','s','i','g','\0',
- 'p','k','c','s','-','1','\0',
- 'i','d','-','c','e','\0',
- 's','m','i','m','e','\0',
- 'c','e','r','t','s','\0',
- 'k','e','k','r','i','\0',
- 'o','t','h','e','r','\0',
- 'k','e','k','i','d','\0',
- 's','h','a','-','1','\0',
- 'x','9','-','5','7','\0',
- '1','0','0','4','0','\0',
- '1','0','0','4','6','\0',
- 'p','k','c','s','7','\0',
- 'p','k','c','s','9','\0',
- 'b','a','s','e','\0',
- 'p','k','c','s','\0',
- 'c','r','l','s','\0',
- 'k','t','r','i','\0',
- 'k','a','r','i','\0',
- 'x','9','c','m','\0',
- 'i','s','o','\0',
- 'd','o','d','\0',
- 'f','o','o','\0',
- 'M','A','X','\0',
- '8','4','0','\0',
- 'c','m','s','\0',
- 's','i','d','\0',
- 'r','i','d','\0',
- 'u','k','m','\0',
- 'm','a','c','\0',
- 'o','i','w','\0',
- 'm','d','5','\0',
- 'a','l','g','\0',
- '1','7','\0',
- 'd','s','\0',
- '2','9','\0',
- 'v','1','\0',
- 'v','3','\0',
- 'c','A','\0',
- 'u','s','\0',
- '1','6','\0',
- 'v','0','\0',
- 'v','4','\0',
- '1','4','\0',
- '2','6','\0',
- 'I','V','\0',
- 'i','v','\0',
- '8','\0',
+ 'u','b','-','o','r','g','a','n','i','z','a','t','i','o','n','a',
+ 'l','-','u','n','i','t','-','n','a','m','e','-','l','e','n','g',
+ 't','h','\0',
+ 'C','o','n','t','e','n','t','E','n','c','r','y','p','t','i','o',
+ 'n','A','l','g','o','r','i','t','h','m','I','d','e','n','t','i',
+ 'f','i','e','r','\0',
+ 'u','b','-','d','o','m','a','i','n','-','d','e','f','i','n','e',
+ 'd','-','a','t','t','r','i','b','u','t','e','-','t','y','p','e',
+ '-','l','e','n','g','t','h','\0',
+ 'u','b','-','d','o','m','a','i','n','-','d','e','f','i','n','e',
+ 'd','-','a','t','t','r','i','b','u','t','e','-','v','a','l','u',
+ 'e','-','l','e','n','g','t','h','\0',
'\0' };
-/* (371 strings) */
+/* (402 strings) */
const static_asn *
diff --git a/src/ber-decoder.c b/src/ber-decoder.c
index 20a91b1..755c1d7 100644
--- a/src/ber-decoder.c
+++ b/src/ber-decoder.c
@@ -483,12 +483,26 @@ static AsnNode
find_anchor_node (AsnNode root, const struct tag_info *ti)
{
AsnNode node = root;
+ AsnNode n;
while (node)
{
- if (cmp_tag (node, ti))
+ if (node->type == TYPE_CHOICE)
{
- return node; /* found */
+ for (n = node->down; n; n = n->right)
+ {
+ if (cmp_tag (n, ti))
+ {
+ return n; /* found */
+ }
+ }
+ }
+ else
+ {
+ if (cmp_tag (node, ti))
+ {
+ return node; /* found */
+ }
}
if (node->down)
@@ -854,6 +868,9 @@ decoder_next (BerDecoder d)
d->first_tag_seen = 1;
if (ti.tag == TYPE_SEQUENCE && ti.length && !ti.ndef)
d->outer_sequence_length = ti.length;
+ else if (ti.class == CLASS_CONTEXT && ti.is_constructed
+ && ti.length && !ti.ndef)
+ d->outer_sequence_length = ti.length;
}
/* Store stuff in the image buffer. */
@@ -933,6 +950,7 @@ decoder_next (BerDecoder d)
if (debug)
fprintf (stderr, " ANY");
ds->cur.in_any = 1;
+ /* FALLTHROUGH */
case 3: /* match */
case 5: /* end tag */
if (debug)
diff --git a/src/ber-help.c b/src/ber-help.c
index 87109f3..1b72bf0 100644
--- a/src/ber-help.c
+++ b/src/ber-help.c
@@ -36,6 +36,7 @@
#include "util.h"
#include "asn1-func.h" /* need some constants */
+#include "convert.h"
#include "ber-help.h"
/* Fixme: The parser functions should check that primitive types don't
@@ -59,7 +60,7 @@ read_byte (ksba_reader_t reader)
static int
premature_eof (struct tag_info *ti)
{
- /* Note: We do an strcmp on this string at othyer places. */
+ /* Note: We do an strcmp on this string at other places. */
ti->err_string = "premature EOF";
return gpg_error (GPG_ERR_BAD_BER);
}
@@ -188,10 +189,13 @@ _ksba_ber_read_tl (ksba_reader_t reader, struct tag_info *ti)
return 0;
}
-/*
- Parse the buffer at the address BUFFER which of SIZE and return
- the tag and the length part from the TLV triplet. Update BUFFER
- and SIZE on success. */
+
+/* Parse the buffer at the address BUFFER which of SIZE and return the
+ * tag and the length part from the TLV triplet. Update BUFFER and
+ * SIZE on success. Note that this function will never return
+ * GPG_ERR_INV_OBJ so that this error code can be used by the parse_foo
+ * functions below to return an error for unexpected tags and the
+ * caller is able to backoff in that case. */
gpg_error_t
_ksba_ber_parse_tl (unsigned char const **buffer, size_t *size,
struct tag_info *ti)
@@ -475,3 +479,234 @@ _ksba_ber_count_tl (unsigned long tag,
return buflen;
}
+
+
+gpg_error_t
+_ksba_parse_sequence (unsigned char const **buf, size_t *len,
+ struct tag_info *ti)
+{
+ gpg_error_t err;
+
+ err = _ksba_ber_parse_tl (buf, len, ti);
+ if (err)
+ ;
+ else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_SEQUENCE
+ && ti->is_constructed) )
+ err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti->length > *len)
+ err = gpg_error (GPG_ERR_BAD_BER);
+ return err;
+}
+
+
+/* Note that this function returns GPG_ERR_FALSE if the TLV is valid
+ * but the tag does not match. The caller may thus check for this
+ * error code and compare against other tag values. */
+gpg_error_t
+_ksba_parse_context_tag (unsigned char const **buf, size_t *len,
+ struct tag_info *ti, int tag)
+{
+ gpg_error_t err;
+
+ err = _ksba_ber_parse_tl (buf, len, ti);
+ if (err)
+ ;
+ else if (!(ti->class == CLASS_CONTEXT && ti->is_constructed))
+ err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti->length > *len)
+ err = gpg_error (GPG_ERR_BAD_BER);
+ else if (ti->tag != tag)
+ err = gpg_error (GPG_ERR_FALSE);
+
+ return err;
+}
+
+
+gpg_error_t
+_ksba_parse_enumerated (unsigned char const **buf, size_t *len,
+ struct tag_info *ti, size_t maxlen)
+{
+ gpg_error_t err;
+
+ err = _ksba_ber_parse_tl (buf, len, ti);
+ if (err)
+ ;
+ else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_ENUMERATED
+ && !ti->is_constructed) )
+ err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (!ti->length)
+ err = gpg_error (GPG_ERR_TOO_SHORT);
+ else if (maxlen && ti->length > maxlen)
+ err = gpg_error (GPG_ERR_TOO_LARGE);
+ else if (ti->length > *len)
+ err = gpg_error (GPG_ERR_BAD_BER);
+
+ return err;
+}
+
+
+gpg_error_t
+_ksba_parse_integer (unsigned char const **buf, size_t *len,
+ struct tag_info *ti)
+{
+ gpg_error_t err;
+
+ err = _ksba_ber_parse_tl (buf, len, ti);
+ if (err)
+ ;
+ else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_INTEGER
+ && !ti->is_constructed) )
+ err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (!ti->length)
+ err = gpg_error (GPG_ERR_TOO_SHORT);
+ else if (ti->length > *len)
+ err = gpg_error (GPG_ERR_BAD_BER);
+
+ return err;
+}
+
+
+gpg_error_t
+_ksba_parse_octet_string (unsigned char const **buf, size_t *len,
+ struct tag_info *ti)
+{
+ gpg_error_t err;
+
+ err= _ksba_ber_parse_tl (buf, len, ti);
+ if (err)
+ ;
+ else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_OCTET_STRING
+ && !ti->is_constructed) )
+ err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (!ti->length)
+ err = gpg_error (GPG_ERR_TOO_SHORT);
+ else if (ti->length > *len)
+ err = gpg_error (GPG_ERR_BAD_BER);
+
+ return err;
+}
+
+
+/* Note that R_BOOL will only be set if a value has been given. Thus
+ the caller should set it to the default value prior to calling this
+ function. Obviously no call to parse_skip is required after
+ calling this function. */
+gpg_error_t
+_ksba_parse_optional_boolean (unsigned char const **buf, size_t *len,
+ int *r_bool)
+{
+ gpg_error_t err;
+ struct tag_info ti;
+
+ err = _ksba_ber_parse_tl (buf, len, &ti);
+ if (err)
+ ;
+ else if (!ti.length)
+ err = gpg_error (GPG_ERR_TOO_SHORT);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_BAD_BER);
+ else if (ti.class == CLASS_UNIVERSAL && ti.tag == TYPE_BOOLEAN
+ && !ti.is_constructed)
+ {
+ if (ti.length != 1)
+ err = gpg_error (GPG_ERR_BAD_BER);
+ *r_bool = !!**buf;
+ parse_skip (buf, len, &ti);
+ }
+ else
+ { /* Undo the read. */
+ *buf -= ti.nhdr;
+ *len += ti.nhdr;
+ }
+
+ return err;
+}
+
+
+/* Parse an optional Null tag. Ir R_SEEN is not NULL it is set to
+ * true if a NULL tag was encountered. */
+gpg_error_t
+_ksba_parse_optional_null (unsigned char const **buf, size_t *len,
+ int *r_seen)
+{
+ gpg_error_t err;
+ struct tag_info ti;
+
+ if (r_seen)
+ *r_seen = 0;
+ err = _ksba_ber_parse_tl (buf, len, &ti);
+ if (err)
+ ;
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_BAD_BER);
+ else if (ti.class == CLASS_UNIVERSAL && ti.tag == TYPE_NULL
+ && !ti.is_constructed)
+ {
+ if (ti.length)
+ err = gpg_error (GPG_ERR_BAD_BER);
+ if (r_seen)
+ *r_seen = 1;
+ parse_skip (buf, len, &ti);
+ }
+ else
+ { /* Undo the read. */
+ *buf -= ti.nhdr;
+ *len += ti.nhdr;
+ }
+
+ return err;
+}
+
+
+
+gpg_error_t
+_ksba_parse_object_id_into_str (unsigned char const **buf, size_t *len,
+ char **oid)
+{
+ struct tag_info ti;
+ gpg_error_t err;
+
+ *oid = NULL;
+ err = _ksba_ber_parse_tl (buf, len, &ti);
+ if (err)
+ ;
+ else if (!(ti.class == CLASS_UNIVERSAL && ti.tag == TYPE_OBJECT_ID
+ && !ti.is_constructed) )
+ err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (!ti.length)
+ err = gpg_error (GPG_ERR_TOO_SHORT);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_BAD_BER);
+ else if (!(*oid = ksba_oid_to_str (*buf, ti.length)))
+ err = gpg_error_from_syserror ();
+ else
+ {
+ *buf += ti.length;
+ *len -= ti.length;
+ }
+ return err;
+}
+
+
+gpg_error_t
+_ksba_parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
+ ksba_isotime_t isotime)
+{
+ struct tag_info ti;
+ gpg_error_t err;
+
+ err = _ksba_ber_parse_tl (buf, len, &ti);
+ if (err)
+ ;
+ else if ( !(ti.class == CLASS_UNIVERSAL
+ && (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
+ && !ti.is_constructed) )
+ err = gpg_error (GPG_ERR_INV_OBJ);
+ else if (ti.length > *len)
+ err = gpg_error (GPG_ERR_INV_BER);
+ else if (!(err = _ksba_asntime_to_iso (*buf, ti.length,
+ ti.tag == TYPE_UTC_TIME, isotime)))
+ parse_skip (buf, len, &ti);
+
+ return err;
+}
diff --git a/src/ber-help.h b/src/ber-help.h
index 286347d..8223a90 100644
--- a/src/ber-help.h
+++ b/src/ber-help.h
@@ -64,4 +64,64 @@ size_t _ksba_ber_count_tl (unsigned long tag,
unsigned long length);
+static inline void
+parse_skip (unsigned char const **buf, size_t *len, struct tag_info *ti)
+{
+ if (ti->length)
+ {
+ assert (ti->length <= *len);
+ *len -= ti->length;
+ *buf += ti->length;
+ }
+}
+
+gpg_error_t _ksba_parse_sequence (unsigned char const **buf, size_t *len,
+ struct tag_info *ti);
+#define parse_sequence(buf,len,ti) \
+ _ksba_parse_sequence ((buf),(len),(ti))
+
+gpg_error_t _ksba_parse_context_tag (unsigned char const **buf, size_t *len,
+ struct tag_info *ti, int tag);
+#define parse_context_tag(buf,len,ti,tag) \
+ _ksba_parse_context_tag ((buf),(len),(ti),(tag))
+
+gpg_error_t _ksba_parse_enumerated (unsigned char const **buf, size_t *len,
+ struct tag_info *ti, size_t maxlen);
+#define parse_enumerated(buf,len,ti,maxlen) \
+ _ksba_parse_enumerated ((buf),(len),(ti),(maxlen))
+
+gpg_error_t _ksba_parse_integer (unsigned char const **buf, size_t *len,
+ struct tag_info *ti);
+#define parse_integer(buf,len,ti) \
+ _ksba_parse_integer ((buf),(len),(ti))
+
+gpg_error_t _ksba_parse_octet_string (unsigned char const **buf, size_t *len,
+ struct tag_info *ti);
+#define parse_octet_string(buf,len,ti) \
+ _ksba_parse_octet_string ((buf),(len),(ti))
+
+gpg_error_t _ksba_parse_optional_boolean (unsigned char const **buf,
+ size_t *len, int *r_bool);
+#define parse_optional_boolean(buf,len,r_bool) \
+ _ksba_parse_optional_boolean ((buf),(len),(r_bool))
+
+gpg_error_t _ksba_parse_optional_null (unsigned char const **buf, size_t *len,
+ int *r_seen);
+#define parse_optional_null(buf,len,r_seen) \
+ _ksba_parse_optional_null ((buf),(len),(r_seen))
+
+gpg_error_t _ksba_parse_object_id_into_str (unsigned char const **buf,
+ size_t *len, char **oid);
+#define parse_object_id_into_str(buf,len,r_oid) \
+ _ksba_parse_object_id_into_str ((buf),(len),(r_oid))
+
+
+gpg_error_t _ksba_parse_asntime_into_isotime (unsigned char const **buf,
+ size_t *len,
+ ksba_isotime_t isotime);
+#define parse_asntime_into_isotime(buf,len,isotime) \
+ _ksba_parse_asntime_into_isotime ((buf),(len),(isotime))
+
+
+
#endif /*BER_HELP_H*/
diff --git a/src/cert.c b/src/cert.c
index d8dabb6..198030a 100644
--- a/src/cert.c
+++ b/src/cert.c
@@ -426,8 +426,11 @@ ksba_cert_hash (ksba_cert_t cert, int what,
* ksba_cert_get_digest_algo:
* @cert: Initialized certificate object
*
- * Figure out the the digest algorithm used for the signature and
- * return its OID
+ * Figure out the digest algorithm used for the signature and return
+ * its OID. Note that in the case of rsaPSS the returned value is the
+ * OID of rsaPSS (1.2.840.113549.1.1.10) and not the hash algorithm to
+ * use. The hash algorithm needs to be extracted from the S-expression
+ * returned by ksba_cert_get_sig_val.
*
* This function is intended as a helper for the ksba_cert_hash().
*
@@ -543,8 +546,32 @@ _ksba_cert_get_serial_ptr (ksba_cert_t cert,
if (!n || n->off == -1)
return gpg_error (GPG_ERR_NO_VALUE);
- *ptr = cert->image + n->off + n->nhdr;
- *length = n->len;
+ *ptr = cert->image + n->off;
+ *length = n->nhdr + n->len;
+ return 0;
+}
+
+
+
+/* Return a pointer to the DER encoding of the issuer's DN in CERT in
+ PTR and the length of that object in LENGTH. */
+gpg_error_t
+_ksba_cert_get_issuer_dn_ptr (ksba_cert_t cert,
+ unsigned char const **ptr, size_t *length)
+{
+ asn_node_t n;
+
+ if (!cert || !cert->initialized || !ptr || !length)
+ return gpg_error (GPG_ERR_INV_VALUE);
+
+ n = _ksba_asn_find_node (cert->root, "Certificate.tbsCertificate.issuer");
+ if (!n || !n->down)
+ return gpg_error (GPG_ERR_NO_VALUE); /* oops - should be there */
+ n = n->down; /* dereference the choice node */
+ if (n->off == -1)
+ return gpg_error (GPG_ERR_NO_VALUE);
+ *ptr = cert->image + n->off;
+ *length = n->nhdr + n->len;
return 0;
}
@@ -1999,7 +2026,7 @@ get_simple_octet_string_ext (ksba_cert_t cert, const char *oid,
/* Return the subjectKeyIdentifier extension as a simple allocated
S-expression at the address of R_KEYID. 0 is returned on success,
GPG_ERR_NO_DATA if no such extension is available or any other
- error code. If R_CRIT is not passed as NULL, the criticla flag of
+ error code. If R_CRIT is not passed as NULL, the critical flag of
this is extension is stored there. */
gpg_error_t
ksba_cert_get_subj_key_id (ksba_cert_t cert, int *r_crit, ksba_sexp_t *r_keyid)
@@ -2141,7 +2168,7 @@ get_info_access (ksba_cert_t cert, int idx, int mode,
R_METHOD and R_LOCATION must be released by the caller unless the
function returned an error; the function will however make sure
that R_METHOD and R_LOCATION will point to NULL if the function
- returns an error. See RFC 2459, section 4.2.2.1 */
+ returns an error. See RFC 5280, section 4.2.2.1 */
gpg_error_t
ksba_cert_get_authority_info_access (ksba_cert_t cert, int idx,
char **r_method, ksba_name_t *r_location)
@@ -2151,6 +2178,7 @@ ksba_cert_get_authority_info_access (ksba_cert_t cert, int idx,
return get_info_access (cert, idx, 0, r_method, r_location);
}
+
/* Return the subjectInfoAccess attributes. IDX should be iterated
starting from 0 until the function returns GPG_ERR_EOF. R_METHOD
returns an allocated string with the OID of one item and R_LOCATION
@@ -2158,7 +2186,7 @@ ksba_cert_get_authority_info_access (ksba_cert_t cert, int idx,
R_METHOD and R_LOCATION must be released by the caller unless the
function returned an error; the function will however make sure
that R_METHOD and R_LOCATION will point to NULL if the function
- returns an error. See RFC 2459, section 4.2.2.2 */
+ returns an error. See RFC 5280, section 4.2.2.2 */
gpg_error_t
ksba_cert_get_subject_info_access (ksba_cert_t cert, int idx,
char **r_method, ksba_name_t *r_location)
diff --git a/src/cert.h b/src/cert.h
index cf9a52d..be784de 100644
--- a/src/cert.h
+++ b/src/cert.h
@@ -111,6 +111,9 @@ int _ksba_cert_cmp (ksba_cert_t a, ksba_cert_t b);
gpg_error_t _ksba_cert_get_serial_ptr (ksba_cert_t cert,
unsigned char const **ptr,
size_t *length);
+gpg_error_t _ksba_cert_get_issuer_dn_ptr (ksba_cert_t cert,
+ unsigned char const **ptr,
+ size_t *length);
gpg_error_t _ksba_cert_get_subject_dn_ptr (ksba_cert_t cert,
unsigned char const **ptr,
size_t *length);
diff --git a/src/certreq.c b/src/certreq.c
index 46fca44..9fba0c8 100644
--- a/src/certreq.c
+++ b/src/certreq.c
@@ -42,11 +42,81 @@
#include "keyinfo.h"
#include "der-encoder.h"
#include "ber-help.h"
+#include "sexp-parse.h"
#include "certreq.h"
static const char oidstr_subjectAltName[] = "2.5.29.17";
static const char oidstr_extensionReq[] = "1.2.840.113549.1.9.14";
+#if 0 /* Set to 1 to use this debug helper. */
+static void
+log_sexp (const char *text, ksba_const_sexp_t p)
+{
+ int level = 0;
+
+ gpgrt_log_debug ("%s: ", text);
+ if (!p)
+ gpgrt_log_printf ("[none]");
+ else
+ {
+ for (;;)
+ {
+ if (*p == '(')
+ {
+ gpgrt_log_printf ("%c", *p);
+ p++;
+ level++;
+ }
+ else if (*p == ')')
+ {
+ gpgrt_log_printf ("%c", *p);
+ p++;
+ if (--level <= 0 )
+ return;
+ }
+ else if (!digitp (p))
+ {
+ gpgrt_log_printf ("[invalid s-exp]");
+ return;
+ }
+ else
+ {
+ char *endp;
+ const unsigned char *s;
+ unsigned long len, n;
+
+ len = strtoul (p, &endp, 10);
+ p = endp;
+ if (*p != ':')
+ {
+ gpgrt_log_printf ("[invalid s-exp]");
+ return;
+ }
+ p++;
+ for (s=p,n=0; n < len; n++, s++)
+ if ( !((*s >= 'a' && *s <= 'z')
+ || (*s >= 'A' && *s <= 'Z')
+ || (*s >= '0' && *s <= '9')
+ || *s == '-' || *s == '.'))
+ break;
+ if (n < len)
+ {
+ gpgrt_log_printf ("#");
+ for (n=0; n < len; n++, p++)
+ gpgrt_log_printf ("%02X", *p);
+ gpgrt_log_printf ("#");
+ }
+ else
+ {
+ for (n=0; n < len; n++, p++)
+ gpgrt_log_printf ("%c", *p);
+ }
+ }
+ }
+ }
+ gpgrt_log_printf ("\n");
+}
+#endif /* debug helper */
/**
@@ -215,8 +285,8 @@ ksba_certreq_set_siginfo (ksba_certreq_t cr, ksba_const_sexp_t siginfo)
xfree (cr->x509.siginfo.der);
cr->x509.siginfo.der = NULL;
- return _ksba_algoinfo_from_sexp (siginfo, &cr->x509.siginfo.der,
- &cr->x509.siginfo.derlen);
+ return _ksba_keyinfo_from_sexp (siginfo, 1, &cr->x509.siginfo.der,
+ &cr->x509.siginfo.derlen);
}
@@ -350,9 +420,10 @@ ksba_certreq_set_public_key (ksba_certreq_t cr, ksba_const_sexp_t key)
{
if (!cr)
return gpg_error (GPG_ERR_INV_VALUE);
+
xfree (cr->key.der);
cr->key.der = NULL;
- return _ksba_keyinfo_from_sexp (key, &cr->key.der, &cr->key.derlen);
+ return _ksba_keyinfo_from_sexp (key, 0, &cr->key.der, &cr->key.derlen);
}
@@ -406,8 +477,10 @@ ksba_certreq_add_extension (ksba_certreq_t cr,
gpg_error_t
ksba_certreq_set_sig_val (ksba_certreq_t cr, ksba_const_sexp_t sigval)
{
- const char *s, *endp;
- unsigned long n;
+ const unsigned char *s, *saved;
+ char *buf = NULL;
+ unsigned long n, len;
+ int pass, nparam;
if (!cr)
return gpg_error (GPG_ERR_INV_VALUE);
@@ -417,24 +490,17 @@ ksba_certreq_set_sig_val (ksba_certreq_t cr, ksba_const_sexp_t sigval)
return gpg_error (GPG_ERR_INV_SEXP);
s++;
- n = strtoul (s, (char**)&endp, 10);
- s = endp;
- if (!n || *s!=':')
- return gpg_error (GPG_ERR_INV_SEXP); /* we don't allow empty lengths */
- s++;
- if (n != 7 || memcmp (s, "sig-val", 7))
+ if (!(n = snext (&s)))
+ return gpg_error (GPG_ERR_INV_SEXP);
+ if (!smatch (&s, 7, "sig-val"))
return gpg_error (GPG_ERR_UNKNOWN_SEXP);
- s += 7;
if (*s != '(')
return gpg_error (digitp (s)? GPG_ERR_UNKNOWN_SEXP : GPG_ERR_INV_SEXP);
s++;
/* break out the algorithm ID */
- n = strtoul (s, (char**)&endp, 10);
- s = endp;
- if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP); /* we don't allow empty lengths */
- s++;
+ if (!(n = snext (&s)))
+ return gpg_error (GPG_ERR_INV_SEXP);
xfree (cr->sig_val.algo);
if (n==3 && s[0] == 'r' && s[1] == 's' && s[2] == 'a')
{ /* kludge to allow "rsa" to be passed as algorithm name */
@@ -449,45 +515,111 @@ ksba_certreq_set_sig_val (ksba_certreq_t cr, ksba_const_sexp_t sigval)
return gpg_error (GPG_ERR_ENOMEM);
memcpy (cr->sig_val.algo, s, n);
cr->sig_val.algo[n] = 0;
+ if (!memcmp (s, "eddsa", 5))
+ cr->sig_val.is_ecc = 2;
}
s += n;
- /* And now the values - FIXME: For now we only support one */
- /* fixme: start loop */
- if (*s != '(')
- return gpg_error (digitp (s)? GPG_ERR_UNKNOWN_SEXP : GPG_ERR_INV_SEXP);
- s++;
- n = strtoul (s, (char**)&endp, 10);
- s = endp;
- if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP);
- s++;
- s += n; /* ignore the name of the parameter */
+ if (cr->sig_val.is_ecc == 2
+ || !strcmp (cr->sig_val.algo, "1.3.101.112") /* Ed25519 */
+ || !strcmp (cr->sig_val.algo, "1.3.101.113")) /* Ed448 */
+ cr->sig_val.is_ecc = 2;
+ else if (!strcmp (cr->sig_val.algo, "1.2.840.10045.4.1") /* with-sha1 */
+ || !strcmp (cr->sig_val.algo, "1.2.840.10045.4.3.1") /* with-sha224 */
+ || !strcmp (cr->sig_val.algo, "1.2.840.10045.4.3.2") /* with-sha256 */
+ || !strcmp (cr->sig_val.algo, "1.2.840.10045.4.3.3") /* with-sha384 */
+ || !strcmp (cr->sig_val.algo, "1.2.840.10045.4.3.4"))/* with-sha512 */
+ cr->sig_val.is_ecc = 1;
+ else
+ cr->sig_val.is_ecc = 0;
+
+ /* And now the values.
+ *
+ * If there is only one value, the signature is simply
+ * that value. Otherwise, the signature is a DER-encoded
+ * SEQUENCE of INTEGERs representing the different values.
+ *
+ * We need three passes over the values:
+ * - first pass is to get the number of values (nparam);
+ * - second pass is to compute the total length (len);
+ * - third pass is to build the final signature. */
+ for (pass = 1, nparam = len = 0, saved = s; pass < 4; pass++)
+ {
+ s = saved;
- if (!digitp(s))
- return gpg_error (GPG_ERR_UNKNOWN_SEXP); /* but may also be an invalid one */
- n = strtoul (s, (char**)&endp, 10);
- s = endp;
- if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP);
- s++;
- if (n > 1 && !*s)
- { /* We might have a leading zero due to the way we encode
- MPIs - this zero should not go into the BIT STRING. */
- s++;
- n--;
+ if (pass == 3)
+ {
+ size_t needed = len;
+ if (cr->sig_val.is_ecc != 2 && nparam > 1)
+ needed += _ksba_ber_count_tl (TYPE_SEQUENCE, CLASS_UNIVERSAL,
+ 1, len);
+
+ xfree (cr->sig_val.value);
+ cr->sig_val.value = xtrymalloc (needed);
+ if (!cr->sig_val.value)
+ return gpg_error (GPG_ERR_ENOMEM);
+ cr->sig_val.valuelen = needed;
+ buf = cr->sig_val.value;
+
+ if (cr->sig_val.is_ecc != 2 && nparam > 1)
+ buf += _ksba_ber_encode_tl (buf, TYPE_SEQUENCE,
+ CLASS_UNIVERSAL, 1, len);
+ }
+
+ while (*s != ')')
+ {
+ if (*s != '(')
+ return gpg_error (digitp (s)? GPG_ERR_UNKNOWN_SEXP : GPG_ERR_INV_SEXP);
+ s++;
+ if (!(n = snext (&s)))
+ return gpg_error (GPG_ERR_INV_SEXP);
+ s += n; /* Ignore the name of the parameter. */
+
+ if (!digitp (s))
+ return gpg_error (GPG_ERR_UNKNOWN_SEXP);
+ if (!(n = snext (&s)))
+ return gpg_error (GPG_ERR_INV_SEXP);
+
+ if (pass == 1)
+ nparam++;
+ else if (pass == 2)
+ {
+ if (cr->sig_val.is_ecc == 2 || nparam == 1)
+ len += n;
+ else
+ len += _ksba_ber_count_tl (TYPE_INTEGER, CLASS_UNIVERSAL, 0,
+ *s >= 0x80? n + 1 : n)
+ + (*s >= 0x80? n + 1 : n);
+ }
+ else if (pass == 3)
+ {
+ if (cr->sig_val.is_ecc == 2 || nparam == 1)
+ {
+ memcpy (buf, s, n);
+ buf += n;
+ }
+ else
+ {
+ if (*s >= 0x80)
+ { /* Add leading zero byte. */
+ buf += _ksba_ber_encode_tl (buf, TYPE_INTEGER,
+ CLASS_UNIVERSAL, 0, n + 1);
+ *buf++ = 0;
+ }
+ else
+ buf += _ksba_ber_encode_tl (buf, TYPE_INTEGER,
+ CLASS_UNIVERSAL, 0, n);
+ memcpy (buf, s, n);
+ buf += n;
+ }
+ }
+
+ s += n;
+ if (*s != ')')
+ return gpg_error (GPG_ERR_UNKNOWN_SEXP);
+ s++;
+ }
}
- xfree (cr->sig_val.value);
- cr->sig_val.value = xtrymalloc (n);
- if (!cr->sig_val.value)
- return gpg_error (GPG_ERR_ENOMEM);
- memcpy (cr->sig_val.value, s, n);
- cr->sig_val.valuelen = n;
- s += n;
- if ( *s != ')')
- return gpg_error (GPG_ERR_UNKNOWN_SEXP); /* but may also be an invalid one */
- s++;
- /* fixme: end loop over parameters */
/* we need 2 closing parenthesis */
if ( *s != ')' || s[1] != ')')
@@ -915,83 +1047,63 @@ static gpg_error_t
sign_and_write (ksba_certreq_t cr)
{
gpg_error_t err;
- ksba_writer_t writer;
- void *value = NULL;
+ ksba_der_t dbld;
+ unsigned char *value = NULL;
size_t valuelen;
- err = ksba_writer_new (&writer);
- if (err)
- goto leave;
- err = ksba_writer_set_mem (writer, 2048);
- if (err)
- goto leave;
+ dbld = _ksba_der_builder_new (0);
+ if (!dbld)
+ {
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
+
+ /* Start outer sequence. */
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE);
- /* store the cri */
+ /* Store the cri */
if (!cr->cri.der)
{
err = gpg_error (GPG_ERR_MISSING_VALUE);
goto leave;
}
- err = ksba_writer_write (writer, cr->cri.der, cr->cri.derlen);
- if (err)
- goto leave;
+ _ksba_der_add_der (dbld, cr->cri.der, cr->cri.derlen);
- /* store the signatureAlgorithm */
+ /* Store the signatureAlgorithm */
if (!cr->sig_val.algo)
return gpg_error (GPG_ERR_MISSING_VALUE);
- err = _ksba_der_write_algorithm_identifier (writer,
- cr->sig_val.algo, NULL, 0);
- if (err)
- goto leave;
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE);
+ _ksba_der_add_oid (dbld, cr->sig_val.algo);
+ if (!cr->sig_val.is_ecc)
+ _ksba_der_add_ptr (dbld, 0, TYPE_NULL, NULL, 0);
+ _ksba_der_add_end (dbld);
- /* write the signature */
- err = _ksba_ber_write_tl (writer, TYPE_BIT_STRING, CLASS_UNIVERSAL, 0,
- 1 + cr->sig_val.valuelen);
- if (!err)
- err = ksba_writer_write (writer, "", 1);
- if (!err)
- err = ksba_writer_write (writer, cr->sig_val.value, cr->sig_val.valuelen);
- if (err)
- goto leave;
+ /* Write the signature */
+ _ksba_der_add_bts (dbld, cr->sig_val.value, cr->sig_val.valuelen, 0);
- /* pack it into the outer sequence */
- value = ksba_writer_snatch_mem (writer, &valuelen);
- if (!value)
- {
- err = gpg_error (GPG_ERR_ENOMEM);
- goto leave;
- }
- err = ksba_writer_set_mem (writer, valuelen+10);
- if (err)
- goto leave;
- /* write outer sequence */
- err = _ksba_ber_write_tl (writer, TYPE_SEQUENCE, CLASS_UNIVERSAL,
- 1, valuelen);
- if (!err)
- err = ksba_writer_write (writer, value, valuelen);
+ /* End outer sequence. */
+ _ksba_der_add_end (dbld);
+
+ /* and finally write the result */
+ err = _ksba_der_builder_get (dbld, &value, &valuelen);
if (err)
goto leave;
- /* and finally write the result */
- xfree (value);
- value = ksba_writer_snatch_mem (writer, &valuelen);
- if (!value)
- err = gpg_error (GPG_ERR_ENOMEM);
- else if (!cr->writer)
+ if (!cr->writer)
err = gpg_error (GPG_ERR_MISSING_ACTION);
else
err = ksba_writer_write (cr->writer, value, valuelen);
leave:
- ksba_writer_release (writer);
+ ksba_der_release (dbld);
xfree (value);
return err;
}
-/* The main function to build a certificate request. It used used in
- a loop so allow for interaction between the function and the caller */
+/* The main function to build a certificate request. It is used in a
+ * loop to allow for interaction between the function and the caller */
gpg_error_t
ksba_certreq_build (ksba_certreq_t cr, ksba_stop_reason_t *r_stopreason)
{
diff --git a/src/certreq.h b/src/certreq.h
index 43388b6..2a9503c 100644
--- a/src/certreq.h
+++ b/src/certreq.h
@@ -111,6 +111,7 @@ struct ksba_certreq_s
struct {
char *algo;
+ int is_ecc; /* 1 = plain ecc, 2 = EdDSA */
unsigned char *value;
size_t valuelen;
} sig_val;
diff --git a/src/cms-parser.c b/src/cms-parser.c
index e4da08c..b0ba8ee 100644
--- a/src/cms-parser.c
+++ b/src/cms-parser.c
@@ -823,14 +823,14 @@ _ksba_cms_parse_enveloped_data_part_1 (ksba_cms_t cms)
gpg_error_t err;
int env_data_ndef;
unsigned long env_data_len;
- int encr_cont_ndef;
- unsigned long encr_cont_len;
- int has_content;
+ int encr_cont_ndef = 0;
+ unsigned long encr_cont_len = 0;
+ int has_content = 0;
unsigned long off, len;
char *cont_oid = NULL;
char *algo_oid = NULL;
char *algo_parm = NULL;
- size_t algo_parmlen;
+ size_t algo_parmlen = 0;
struct value_tree_s *vt, **vtend;
/* get the version */
@@ -851,11 +851,17 @@ _ksba_cms_parse_enveloped_data_part_1 (ksba_cms_t cms)
return gpg_error (GPG_ERR_UNSUPPORTED_CMS_OBJ);
}
- /* Next one is the SET OF recipientInfos */
+ /* Next one is the SET OF RecipientInfo:
+ * RecipientInfo ::= CHOICE {
+ * ktri KeyTransRecipientInfo,
+ * kari [1] KeyAgreeRecipientInfo,
+ * kekri [2] KEKRecipientInfo
+ * } */
if ( !(ti.class == CLASS_UNIVERSAL
&& ti.tag == TYPE_SET && ti.is_constructed))
return gpg_error (GPG_ERR_INV_CMS_OBJ);
+
vtend = &cms->recp_info;
if (ti.ndef)
{
@@ -881,7 +887,7 @@ _ksba_cms_parse_enveloped_data_part_1 (ksba_cms_t cms)
err = create_and_run_decoder
(cms->reader,
- "CryptographicMessageSyntax.KeyTransRecipientInfo",
+ "CryptographicMessageSyntax.RecipientInfo",
BER_DECODER_FLAG_FAST_STOP,
&vt->root, &vt->image, &vt->imagelen);
if (err)
@@ -907,8 +913,8 @@ _ksba_cms_parse_enveloped_data_part_1 (ksba_cms_t cms)
err = create_and_run_decoder
(cms->reader,
- "CryptographicMessageSyntax.KeyTransRecipientInfo",
- 0,
+ "CryptographicMessageSyntax.RecipientInfo",
+ BER_DECODER_FLAG_FAST_STOP,
&vt->root, &vt->image, &vt->imagelen);
if (err)
{
diff --git a/src/cms.c b/src/cms.c
index 57927a3..881443f 100644
--- a/src/cms.c
+++ b/src/cms.c
@@ -1,5 +1,5 @@
/* cms.c - cryptographic message syntax main functions
- * Copyright (C) 2001, 2003, 2004, 2008, 2012 g10 Code GmbH
+ * Copyright (C) 2001, 2003, 2004, 2008, 2012, 2020 g10 Code GmbH
*
* This file is part of KSBA.
*
@@ -28,6 +28,13 @@
* if not, see <http://www.gnu.org/licenses/>.
*/
+/* References:
+ * RFC-5652 := Cryptographic Message Syntax (CMS) (aka STD0070)
+ * SPHINX := CMS profile developed by the German BSI.
+ * (see also https://lwn.net/2001/1011/a/german-smime.php3)
+ * PKCS#7 := Original specification of CMS
+ */
+
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
@@ -43,7 +50,9 @@
#include "der-encoder.h"
#include "ber-help.h"
#include "sexp-parse.h"
-#include "cert.h" /* need to access cert->root and cert->image */
+#include "cert.h"
+#include "der-builder.h"
+
static gpg_error_t ct_parse_data (ksba_cms_t cms);
static gpg_error_t ct_parse_signed_data (ksba_cms_t cms);
@@ -73,6 +82,8 @@ static struct {
{ "1.2.840.113549.1.7.6", KSBA_CT_ENCRYPTED_DATA,
ct_parse_encrypted_data, ct_build_encrypted_data },
{ "1.2.840.113549.1.9.16.1.2", KSBA_CT_AUTH_DATA },
+ { "1.3.6.1.4.1.311.2.1.4", KSBA_CT_SPC_IND_DATA_CTX,
+ ct_parse_data , ct_build_data },
{ NULL }
};
@@ -87,7 +98,78 @@ static const char oid_signingTime[9] = "\x2A\x86\x48\x86\xF7\x0D\x01\x09\x05";
static const char oidstr_smimeCapabilities[] = "1.2.840.113549.1.9.15";
+
+#if 0 /* Set to 1 to use this debug helper. */
+static void
+log_sexp (const char *text, ksba_const_sexp_t p)
+{
+ int level = 0;
+
+ gpgrt_log_debug ("%s: ", text);
+ if (!p)
+ gpgrt_log_printf ("[none]");
+ else
+ {
+ for (;;)
+ {
+ if (*p == '(')
+ {
+ gpgrt_log_printf ("%c", *p);
+ p++;
+ level++;
+ }
+ else if (*p == ')')
+ {
+ gpgrt_log_printf ("%c", *p);
+ p++;
+ if (--level <= 0 )
+ return;
+ }
+ else if (!digitp (p))
+ {
+ gpgrt_log_printf ("[invalid s-exp]");
+ return;
+ }
+ else
+ {
+ char *endp;
+ const unsigned char *s;
+ unsigned long len, n;
+
+ len = strtoul (p, &endp, 10);
+ p = endp;
+ if (*p != ':')
+ {
+ gpgrt_log_printf ("[invalid s-exp]");
+ return;
+ }
+ p++;
+ for (s=p,n=0; n < len; n++, s++)
+ if ( !((*s >= 'a' && *s <= 'z')
+ || (*s >= 'A' && *s <= 'Z')
+ || (*s >= '0' && *s <= '9')
+ || *s == '-' || *s == '.'))
+ break;
+ if (n < len)
+ {
+ gpgrt_log_printf ("#");
+ for (n=0; n < len; n++, p++)
+ gpgrt_log_printf ("%02X", *p);
+ gpgrt_log_printf ("#");
+ }
+ else
+ {
+ for (n=0; n < len; n++, p++)
+ gpgrt_log_printf ("%c", *p);
+ }
+ }
+ }
+ }
+ gpgrt_log_printf ("\n");
+}
+#endif /* debug helper */
+
/* Helper for read_and_hash_cont(). */
static gpg_error_t
@@ -435,6 +517,7 @@ ksba_cms_identify (ksba_reader_t reader)
if (!strcmp (content_handlers[i].oid, oid))
break;
}
+ ksba_free(oid);
if (!content_handlers[i].oid)
return KSBA_CT_NONE; /* unknown */
if (maybe_p12 && (content_handlers[i].ct == KSBA_CT_DATA
@@ -500,6 +583,9 @@ ksba_cms_release (ksba_cms_t cms)
ksba_cert_release (cms->cert_list->cert);
xfree (cms->cert_list->enc_val.algo);
xfree (cms->cert_list->enc_val.value);
+ xfree (cms->cert_list->enc_val.ecdh.e);
+ xfree (cms->cert_list->enc_val.ecdh.wrap_algo);
+ xfree (cms->cert_list->enc_val.ecdh.encr_algo);
xfree (cms->cert_list);
cms->cert_list = cl;
}
@@ -531,6 +617,7 @@ ksba_cms_release (ksba_cms_t cms)
struct sig_val_s *tmp = cms->sig_val->next;
xfree (cms->sig_val->algo);
xfree (cms->sig_val->value);
+ xfree (cms->sig_val->ecc.r);
xfree (cms->sig_val);
cms->sig_val = tmp;
}
@@ -765,8 +852,6 @@ ksba_cms_get_issuer_serial (ksba_cms_t cms, int idx,
if (!si)
return -1;
- issuer_path = "SignerInfo.sid.issuerAndSerialNumber.issuer";
- serial_path = "SignerInfo.sid.issuerAndSerialNumber.serialNumber";
root = si->root;
image = si->image;
}
@@ -774,8 +859,6 @@ ksba_cms_get_issuer_serial (ksba_cms_t cms, int idx,
{
struct value_tree_s *tmp;
- issuer_path = "KeyTransRecipientInfo.rid.issuerAndSerialNumber.issuer";
- serial_path = "KeyTransRecipientInfo.rid.issuerAndSerialNumber.serialNumber";
for (tmp=cms->recp_info; tmp && idx; tmp=tmp->next, idx-- )
;
if (!tmp)
@@ -786,6 +869,38 @@ ksba_cms_get_issuer_serial (ksba_cms_t cms, int idx,
else
return gpg_error (GPG_ERR_NO_DATA);
+
+ if (cms->signer_info)
+ {
+ issuer_path = "SignerInfo.sid.issuerAndSerialNumber.issuer";
+ serial_path = "SignerInfo.sid.issuerAndSerialNumber.serialNumber";
+ }
+ else if (cms->recp_info)
+ {
+ /* Find the choice to use. */
+ n = _ksba_asn_find_node (root, "RecipientInfo.+");
+ if (!n || !n->name)
+ return gpg_error (GPG_ERR_NO_VALUE);
+
+ if (!strcmp (n->name, "ktri"))
+ {
+ issuer_path = "ktri.rid.issuerAndSerialNumber.issuer";
+ serial_path = "ktri.rid.issuerAndSerialNumber.serialNumber";
+ }
+ else if (!strcmp (n->name, "kari"))
+ {
+ issuer_path = ("kari..recipientEncryptedKeys"
+ "..rid.issuerAndSerialNumber.issuer");
+ serial_path = ("kari..recipientEncryptedKeys"
+ "..rid.issuerAndSerialNumber.serialNumber");
+ }
+ else if (!strcmp (n->name, "kekri"))
+ return gpg_error (GPG_ERR_UNSUPPORTED_CMS_OBJ);
+ else
+ return gpg_error (GPG_ERR_INV_CMS_OBJ);
+ root = n;
+ }
+
if (r_issuer)
{
n = _ksba_asn_find_node (root, issuer_path);
@@ -1175,6 +1290,81 @@ ksba_cms_get_sig_val (ksba_cms_t cms, int idx)
}
+/* Helper to dump a S-expression. */
+#if 0
+static void
+dbg_print_sexp (ksba_const_sexp_t p)
+{
+ int level = 0;
+
+ if (!p)
+ fputs ("[none]", stdout);
+ else
+ {
+ for (;;)
+ {
+ if (*p == '(')
+ {
+ putchar (*p);
+ p++;
+ level++;
+ }
+ else if (*p == ')')
+ {
+ putchar (*p);
+ p++;
+ if (--level <= 0 )
+ {
+ putchar ('\n');
+ return;
+ }
+ }
+ else if (!digitp (p))
+ {
+ fputs ("[invalid s-exp]\n", stdout);
+ return;
+ }
+ else
+ {
+ const unsigned char *s;
+ char *endp;
+ unsigned long len, n;
+
+ len = strtoul (p, &endp, 10);
+ p = endp;
+ if (*p != ':')
+ {
+ fputs ("[invalid s-exp]\n", stdout);
+ return;
+ }
+ p++;
+ for (s=p,n=0; n < len; n++, s++)
+ if ( !((*s >= 'a' && *s <= 'z')
+ || (*s >= 'A' && *s <= 'Z')
+ || (*s >= '0' && *s <= '9')
+ || *s == '-' || *s == '.'))
+ break;
+ if (n < len)
+ {
+ putchar('#');
+ for (n=0; n < len; n++, p++)
+ printf ("%02X", *p);
+ putchar('#');
+ }
+ else
+ {
+ for (n=0; n < len; n++, p++)
+ putchar (*p);
+ }
+ }
+ }
+ }
+ putchar ('\n');
+}
+#endif /* 0 */
+
+
+
/**
* ksba_cms_get_enc_val:
* @cms: CMS object
@@ -1189,10 +1379,17 @@ ksba_cms_get_sig_val (ksba_cms_t cms, int idx)
ksba_sexp_t
ksba_cms_get_enc_val (ksba_cms_t cms, int idx)
{
- AsnNode n, n2;
+ AsnNode root, n, n2;
gpg_error_t err;
ksba_sexp_t string;
struct value_tree_s *vt;
+ char *keyencralgo = NULL; /* Key encryption algo. */
+ char *parm = NULL; /* Helper to get the parms of kencralgo. */
+ size_t parmlen;
+ char *keywrapalgo = NULL; /* Key wrap algo. */
+ struct tag_info ti;
+ const unsigned char *der;
+ size_t derlen;
if (!cms)
return NULL;
@@ -1206,25 +1403,97 @@ ksba_cms_get_enc_val (ksba_cms_t cms, int idx)
if (!vt)
return NULL; /* No value at this IDX */
+ /* Find the choice to use. */
+ root = _ksba_asn_find_node (vt->root, "RecipientInfo.+");
+ if (!root || !root->name)
+ return NULL;
- n = _ksba_asn_find_node (vt->root,
- "KeyTransRecipientInfo.keyEncryptionAlgorithm");
- if (!n)
- return NULL;
- if (n->off == -1)
+ if (!strcmp (root->name, "ktri"))
{
-/* fputs ("ksba_cms_get_enc_val problem at node:\n", stderr); */
-/* _ksba_asn_node_dump_all (n, stderr); */
- return NULL;
+ n = _ksba_asn_find_node (root, "ktri.keyEncryptionAlgorithm");
+ if (!n || n->off == -1)
+ return NULL;
+ n2 = n->right; /* point to the actual value */
+ err = _ksba_encval_to_sexp
+ (vt->image + n->off,
+ n->nhdr + n->len + ((!n2||n2->off == -1)? 0:(n2->nhdr+n2->len)),
+ &string);
}
+ else if (!strcmp (root->name, "kari"))
+ {
+ /* _ksba_asn_node_dump_all (root, stderr); */
- n2 = n->right; /* point to the actual value */
- err = _ksba_encval_to_sexp (vt->image + n->off,
- n->nhdr + n->len
- + ((!n2||n2->off == -1)? 0:(n2->nhdr+n2->len)),
- &string);
+ /* Get the encrypted key. Result is in (DER,DERLEN) */
+ n = _ksba_asn_find_node (root, ("kari..recipientEncryptedKeys"
+ "..encryptedKey"));
+ if (!n || n->off == -1)
+ {
+ err = gpg_error (GPG_ERR_INV_KEYINFO);
+ goto leave;
+ }
+
+ der = vt->image + n->off;
+ derlen = n->nhdr + n->len;
+ err = parse_octet_string (&der, &derlen, &ti);
+ if (err)
+ goto leave;
+ derlen = ti.length;
+ /* gpgrt_log_printhex (der, derlen, "%s: encryptedKey", __func__); */
+
+ /* Get the KEK algos. */
+ n = _ksba_asn_find_node (root, "kari..keyEncryptionAlgorithm");
+ if (!n || n->off == -1)
+ {
+ err = gpg_error (GPG_ERR_INV_KEYINFO);
+ goto leave;
+ }
+ err = _ksba_parse_algorithm_identifier2 (vt->image + n->off,
+ n->nhdr + n->len, NULL,
+ &keyencralgo, &parm, &parmlen);
+ if (err)
+ goto leave;
+ if (!parm)
+ {
+ err = gpg_error (GPG_ERR_INV_KEYINFO);
+ goto leave;
+ }
+ err = _ksba_parse_algorithm_identifier (parm, parmlen,NULL, &keywrapalgo);
+ if (err)
+ goto leave;
+
+ /* gpgrt_log_debug ("%s: keyencralgo='%s'\n", __func__, keyencralgo); */
+ /* gpgrt_log_debug ("%s: keywrapalgo='%s'\n", __func__, keywrapalgo); */
+
+ /* Get the ephemeral public key. */
+ n = _ksba_asn_find_node (root, "kari..originator..originatorKey");
+ if (!n || n->off == -1)
+ {
+ err = gpg_error (GPG_ERR_INV_KEYINFO);
+ goto leave;
+ }
+ err = _ksba_encval_kari_to_sexp (vt->image + n->off, n->nhdr + n->len,
+ keyencralgo, keywrapalgo, der, derlen,
+ &string);
+ if (err)
+ goto leave;
+
+ /* gpgrt_log_debug ("%s: encryptedKey:\n", __func__); */
+ /* dbg_print_sexp (string); */
+ }
+ else if (!strcmp (n->name, "kekri"))
+ return NULL; /*GPG_ERR_UNSUPPORTED_CMS_OBJ*/
+ else
+ return NULL; /*GPG_ERR_INV_CMS_OBJ*/
+
+ leave:
+ xfree (keyencralgo);
+ xfree (keywrapalgo);
+ xfree (parm);
if (err)
+ {
+ /* gpgrt_log_debug ("%s: error: %s\n", __func__, gpg_strerror (err)); */
return NULL;
+ }
return string;
}
@@ -1288,7 +1557,7 @@ ksba_cms_hash_signed_attrs (ksba_cms_t cms, int idx)
* ksba_cms_set_content_type:
* @cms: A CMS object
* @what: 0 for content type, 1 for inner content type
- * @type: Tyep constant
+ * @type: Type constant
*
* Set the content type used for build operations. This should be the
* first operation before starting to create a CMS message.
@@ -1568,25 +1837,29 @@ ksba_cms_set_signing_time (ksba_cms_t cms, int idx, const ksba_isotime_t sigtime
}
-/*
- r_sig = (sig-val
- (<algo>
- (<param_name1> <mpi>)
- ...
- (<param_namen> <mpi>)
- ))
- The sexp must be in canonical form.
- Note the <algo> must be given as a stringified OID or the special
- string "rsa".
-
- Note that IDX is only used for consistency checks.
+/* Set the signature value as a canonical encoded s-expression.
+ *
+ * r_sig = (sig-val
+ * (<algo>
+ * (<param_name1> <mpi>)
+ * ...
+ * (<param_namen> <mpi>)
+ * ))
+ *
+ * <algo> must be given as a stringified OID or the special string
+ * "rsa". For ECC <algo> must either be "ecdsa" or the OID matching the used
+ * hash algorithm; the expected parameters are "r" and "s".
+ *
+ * Note that IDX is only used for consistency checks.
*/
gpg_error_t
ksba_cms_set_sig_val (ksba_cms_t cms, int idx, ksba_const_sexp_t sigval)
{
- const unsigned char *s;
- unsigned long n;
+ gpg_error_t err;
+ unsigned long n, namelen;
struct sig_val_s *sv, **sv_tail;
+ const unsigned char *s, *endp, *name;
+ int ecc; /* True for ECC algos. */
int i;
if (!cms)
@@ -1594,6 +1867,7 @@ ksba_cms_set_sig_val (ksba_cms_t cms, int idx, ksba_const_sexp_t sigval)
if (idx < 0)
return gpg_error (GPG_ERR_INV_INDEX); /* only one signer for now */
+ /* log_sexp ("sigval:", sigval); */
s = sigval;
if (*s != '(')
return gpg_error (GPG_ERR_INV_SEXP);
@@ -1619,9 +1893,20 @@ ksba_cms_set_sig_val (ksba_cms_t cms, int idx, ksba_const_sexp_t sigval)
sv = xtrycalloc (1, sizeof *sv);
if (!sv)
return gpg_error (GPG_ERR_ENOMEM);
+
if (n==3 && s[0] == 'r' && s[1] == 's' && s[2] == 'a')
- { /* kludge to allow "rsa" to be passed as algorithm name */
- sv->algo = xtrystrdup ("1.2.840.113549.1.1.1");
+ {
+ sv->algo = xtrystrdup ("1.2.840.113549.1.1.1"); /* rsa */
+ if (!sv->algo)
+ {
+ xfree (sv);
+ return gpg_error (GPG_ERR_ENOMEM);
+ }
+ }
+ else if (n==5 && !memcmp (s, "ecdsa", 5))
+ {
+ /* Use a placeholder for later fixup. */
+ sv->algo = xtrystrdup ("ecdsa");
if (!sv->algo)
{
xfree (sv);
@@ -1641,76 +1926,114 @@ ksba_cms_set_sig_val (ksba_cms_t cms, int idx, ksba_const_sexp_t sigval)
}
s += n;
- /* And now the values - FIXME: For now we only support one */
- /* fixme: start loop */
- if (*s != '(')
- {
- xfree (sv->algo);
- xfree (sv);
- return gpg_error (digitp (s)? GPG_ERR_UNKNOWN_SEXP : GPG_ERR_INV_SEXP);
- }
- s++;
+ ecc = (!strcmp (sv->algo, "ecdsa") /* placeholder */
+ || !strcmp (sv->algo, "1.2.840.10045.4.3.2") /* ecdsa-with-SHA256 */
+ || !strcmp (sv->algo, "1.2.840.10045.4.3.3") /* ecdsa-with-SHA384 */
+ || !strcmp (sv->algo, "1.2.840.10045.4.3.4") /* ecdsa-with-SHA512 */
+ );
- if (!(n = snext (&s)))
- {
- xfree (sv->algo);
- xfree (sv);
- return gpg_error (GPG_ERR_INV_SEXP);
- }
- s += n; /* ignore the name of the parameter */
+ xfree (sv->value); sv->value = NULL;
+ xfree (sv->ecc.r); sv->ecc.r = NULL;
- if (!digitp(s))
+ while (*s == '(')
{
- xfree (sv->algo);
- xfree (sv);
- /* May also be an invalid S-EXP. */
- return gpg_error (GPG_ERR_UNKNOWN_SEXP);
- }
+ s++;
+ n = strtoul (s, (char**)&endp, 10);
+ s = endp;
+ if (!n || *s != ':')
+ {
+ err = gpg_error (GPG_ERR_INV_SEXP);
+ goto leave;
+ }
+ s++;
+ name = s;
+ namelen = n;
+ s += n;
- if (!(n = snext (&s)))
- {
- xfree (sv->algo);
- xfree (sv);
- return gpg_error (GPG_ERR_INV_SEXP);
- }
+ if (!digitp(s))
+ {
+ err = gpg_error (GPG_ERR_UNKNOWN_SEXP); /* or invalid sexp */
+ goto leave;
+ }
+ n = strtoul (s, (char**)&endp, 10);
+ s = endp;
+ if (!n || *s != ':')
+ {
+ err = gpg_error (GPG_ERR_INV_SEXP);
+ goto leave;
+ }
+ s++;
+
+ if (namelen == 1 && *name == 's')
+ {
+ /* Store the "main" parameter into value. */
+ xfree (sv->value);
+ sv->value = xtrymalloc (n);
+ if (!sv->value)
+ {
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
+ memcpy (sv->value, s, n);
+ sv->valuelen = n;
+ }
+ else if (ecc && namelen == 1 && *name == 'r')
+ {
+ xfree (sv->ecc.r);
+ sv->ecc.r = xtrymalloc (n);
+ if (!sv->ecc.r)
+ {
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
+ memcpy (sv->ecc.r, s, n);
+ sv->ecc.rlen = n;
+ }
+ /* (We ignore all other parameter of the (key value) form.) */
- if (n > 1 && !*s)
- { /* We might have a leading zero due to the way we encode
- MPIs - this zero should not go into the OCTECT STRING. */
+ s += n;
+ if ( *s != ')')
+ {
+ err = gpg_error (GPG_ERR_UNKNOWN_SEXP); /* or invalid sexp */
+ goto leave;
+ }
s++;
- n--;
}
- sv->value = xtrymalloc (n);
- if (!sv->value)
+
+ /* Expect two closing parenthesis. */
+ if (*s != ')')
{
- xfree (sv->algo);
- xfree (sv);
- return gpg_error (GPG_ERR_ENOMEM);
+ err = gpg_error (digitp (s)? GPG_ERR_UNKNOWN_SEXP : GPG_ERR_INV_SEXP);
+ goto leave;
}
- memcpy (sv->value, s, n);
- sv->valuelen = n;
- s += n;
+ s++;
if ( *s != ')')
{
- xfree (sv->value);
- xfree (sv->algo);
- xfree (sv);
- return gpg_error (GPG_ERR_UNKNOWN_SEXP); /* but may also be an invalid one */
+ err = gpg_error (GPG_ERR_INV_SEXP);
+ goto leave;
}
- s++;
- /* fixme: end loop over parameters */
- /* we need 2 closing parenthesis */
- if ( *s != ')' || s[1] != ')')
+ /* Check that we have all required data. */
+ if (!sv->value)
+ {
+ err = gpg_error (GPG_ERR_INV_SEXP);
+ goto leave;
+ }
+ if (ecc && (!sv->ecc.r || !sv->ecc.rlen))
{
- xfree (sv->value);
- xfree (sv->algo);
- xfree (sv);
- return gpg_error (GPG_ERR_INV_SEXP);
+ err = gpg_error (GPG_ERR_INV_SEXP);
+ goto leave;
}
*sv_tail = sv;
- return 0;
+ return 0; /* Success. */
+
+ leave: /* Note: This is an error-only label. */
+ xfree (sv->value);
+ xfree (sv->algo);
+ xfree (sv->ecc.r);
+ xfree (sv);
+ return err;
}
@@ -1751,17 +2074,24 @@ ksba_cms_set_content_enc_algo (ksba_cms_t cms,
* (<param_name1> <mpi>)
* ...
* (<param_namen> <mpi>)
+ * (encr-algo <oid>)
+ * (wrap-algo <oid>)
* ))
*
* Note the <algo> must be given as a stringified OID or the special
- * string "rsa" */
+ * string "rsa". For RSA there is just one parameter named "a";
+ * encr-algo and wrap-algo are also not used. For ECC <algo> must be
+ * "ecdh", the parameter "s" gives the encrypted key, "e" specified
+ * the ephemeral public key, and wrap-algo algo and encr-algo are the
+ * stringified OIDs for the ECDH algorithm parameters. */
gpg_error_t
ksba_cms_set_enc_val (ksba_cms_t cms, int idx, ksba_const_sexp_t encval)
{
/*FIXME: This shares most code with ...set_sig_val */
struct certlist_s *cl;
- const char *s, *endp;
- unsigned long n;
+ const char *s, *endp, *name;
+ unsigned long n, namelen;
+ int ecdh = 0; /* We expect ECC parameters. */
if (!cms)
return gpg_error (GPG_ERR_INV_VALUE);
@@ -1770,8 +2100,9 @@ ksba_cms_set_enc_val (ksba_cms_t cms, int idx, ksba_const_sexp_t encval)
for (cl=cms->cert_list; cl && idx; cl = cl->next, idx--)
;
if (!cl)
- return gpg_error (GPG_ERR_INV_INDEX); /* no certificate to store the value */
+ return gpg_error (GPG_ERR_INV_INDEX); /* No cert to store the value. */
+ /* log_sexp ("encval", encval); */
s = encval;
if (*s != '(')
return gpg_error (GPG_ERR_INV_SEXP);
@@ -1796,12 +2127,18 @@ ksba_cms_set_enc_val (ksba_cms_t cms, int idx, ksba_const_sexp_t encval)
return gpg_error (GPG_ERR_INV_SEXP); /* we don't allow empty lengths */
s++;
xfree (cl->enc_val.algo);
- if (n==3 && s[0] == 'r' && s[1] == 's' && s[2] == 'a')
+ if (n==3 && !memcmp (s, "rsa", 3))
{ /* kludge to allow "rsa" to be passed as algorithm name */
cl->enc_val.algo = xtrystrdup ("1.2.840.113549.1.1.1");
if (!cl->enc_val.algo)
return gpg_error (GPG_ERR_ENOMEM);
}
+ else if (n==4 && !memcmp (s, "ecdh", 4))
+ {
+ cl->enc_val.algo = xtrystrdup ("1.2.840.10045.2.1"); /* ecPublicKey */
+ if (!cl->enc_val.algo)
+ return gpg_error (GPG_ERR_ENOMEM);
+ }
else
{
cl->enc_val.algo = xtrymalloc (n+1);
@@ -1812,47 +2149,96 @@ ksba_cms_set_enc_val (ksba_cms_t cms, int idx, ksba_const_sexp_t encval)
}
s += n;
- /* And now the values - FIXME: For now we only support one */
- /* fixme: start loop */
- if (*s != '(')
- return gpg_error (digitp (s)? GPG_ERR_UNKNOWN_SEXP : GPG_ERR_INV_SEXP);
- s++;
- n = strtoul (s, (char**)&endp, 10);
- s = endp;
- if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP);
- s++;
- s += n; /* ignore the name of the parameter */
+ ecdh = !strcmp (cl->enc_val.algo, "1.2.840.10045.2.1");
- if (!digitp(s))
- return gpg_error (GPG_ERR_UNKNOWN_SEXP); /* but may also be an invalid one */
- n = strtoul (s, (char**)&endp, 10);
- s = endp;
- if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP);
- s++;
- if (n > 1 && !*s)
- { /* We might have a leading zero due to the way we encode
- MPIs - this zero should not go into the OCTECT STRING. */
+ xfree (cl->enc_val.value); cl->enc_val.value = NULL;
+ xfree (cl->enc_val.ecdh.e); cl->enc_val.ecdh.e = NULL;
+ xfree (cl->enc_val.ecdh.encr_algo); cl->enc_val.ecdh.encr_algo = NULL;
+ xfree (cl->enc_val.ecdh.wrap_algo); cl->enc_val.ecdh.wrap_algo = NULL;
+
+ while (*s == '(')
+ {
+ s++;
+ n = strtoul (s, (char**)&endp, 10);
+ s = endp;
+ if (!n || *s != ':')
+ return gpg_error (GPG_ERR_INV_SEXP);
+ s++;
+ name = s;
+ namelen = n;
+ s += n;
+
+ if (!digitp(s))
+ return gpg_error (GPG_ERR_UNKNOWN_SEXP); /* or invalid sexp */
+ n = strtoul (s, (char**)&endp, 10);
+ s = endp;
+ if (!n || *s != ':')
+ return gpg_error (GPG_ERR_INV_SEXP);
+ s++;
+
+ if (namelen == 1 && ((!ecdh && *name == 'a') || (ecdh && *name == 's')))
+ {
+ /* Store the "main" parameter into value. */
+ xfree (cl->enc_val.value);
+ cl->enc_val.value = xtrymalloc (n);
+ if (!cl->enc_val.value)
+ return gpg_error (GPG_ERR_ENOMEM);
+ memcpy (cl->enc_val.value, s, n);
+ cl->enc_val.valuelen = n;
+ }
+ else if (!ecdh)
+ ; /* Ignore all other parameters for RSA. */
+ else if (namelen == 1 && *name == 'e')
+ {
+ xfree (cl->enc_val.ecdh.e);
+ cl->enc_val.ecdh.e = xtrymalloc (n);
+ if (!cl->enc_val.ecdh.e)
+ return gpg_error (GPG_ERR_ENOMEM);
+ memcpy (cl->enc_val.ecdh.e, s, n);
+ cl->enc_val.ecdh.elen = n;
+ }
+ else if (namelen == 9 && !memcmp (name, "encr-algo", 9))
+ {
+ xfree (cl->enc_val.ecdh.encr_algo);
+ cl->enc_val.ecdh.encr_algo = xtrymalloc (n+1);
+ if (!cl->enc_val.ecdh.encr_algo)
+ return gpg_error (GPG_ERR_ENOMEM);
+ memcpy (cl->enc_val.ecdh.encr_algo, s, n);
+ cl->enc_val.ecdh.encr_algo[n] = 0;
+ }
+ else if (namelen == 9 && !memcmp (name, "wrap-algo", 9))
+ {
+ xfree (cl->enc_val.ecdh.wrap_algo);
+ cl->enc_val.ecdh.wrap_algo = xtrymalloc (n+1);
+ if (!cl->enc_val.ecdh.wrap_algo)
+ return gpg_error (GPG_ERR_ENOMEM);
+ memcpy (cl->enc_val.ecdh.wrap_algo, s, n);
+ cl->enc_val.ecdh.wrap_algo[n] = 0;
+ }
+ /* (We ignore all other parameter of the (key value) form.) */
+
+ s += n;
+ if ( *s != ')')
+ return gpg_error (GPG_ERR_UNKNOWN_SEXP); /* or invalid sexp */
s++;
- n--;
}
- xfree (cl->enc_val.value);
- cl->enc_val.value = xtrymalloc (n);
- if (!cl->enc_val.value)
- return gpg_error (GPG_ERR_ENOMEM);
- memcpy (cl->enc_val.value, s, n);
- cl->enc_val.valuelen = n;
- s += n;
- if ( *s != ')')
- return gpg_error (GPG_ERR_UNKNOWN_SEXP); /* but may also be an invalid one */
+ /* Expect two closing parenthesis. */
+ if (*s != ')')
+ return gpg_error (digitp (s)? GPG_ERR_UNKNOWN_SEXP : GPG_ERR_INV_SEXP);
s++;
- /* fixme: end loop over parameters */
+ if ( *s != ')')
+ return gpg_error (GPG_ERR_INV_SEXP);
- /* we need 2 closing parenthesis */
- if ( *s != ')' || s[1] != ')')
+ /* Check that we have all required data. */
+ if (!cl->enc_val.value)
+ return gpg_error (GPG_ERR_INV_SEXP);
+ if (ecdh && (!cl->enc_val.ecdh.e
+ || !cl->enc_val.ecdh.elen
+ || !cl->enc_val.ecdh.encr_algo
+ || !cl->enc_val.ecdh.wrap_algo))
return gpg_error (GPG_ERR_INV_SEXP);
+
return 0;
}
@@ -2509,7 +2895,7 @@ build_signed_data_attributes (ksba_cms_t cms)
attridx++;
/* Include the signing time */
- if (certlist->signing_time)
+ if (*certlist->signing_time)
{
attr = _ksba_asn_expand_tree (cms_tree->parse_tree,
"CryptographicMessageSyntax.Attribute");
@@ -2673,6 +3059,7 @@ build_signed_data_rest (ksba_cms_t cms)
struct sig_val_s *sv;
ksba_writer_t tmpwrt = NULL;
AsnNode root = NULL;
+ ksba_der_t dbld = NULL;
/* Now we can really write the signer info */
err = ksba_asn_create_tree ("cms", &cms_tree);
@@ -2708,6 +3095,7 @@ build_signed_data_rest (ksba_cms_t cms)
AsnNode n, n2;
unsigned char *image;
size_t imagelen;
+ const char *oid;
if (!digestlist || !si || !sv)
{
@@ -2776,7 +3164,7 @@ build_signed_data_rest (ksba_cms_t cms)
assert (si->root);
assert (si->image);
n2 = _ksba_asn_find_node (si->root, "SignerInfo.signedAttrs");
- if (!n2 || !n->down)
+ if (!n2 || !n2->down)
{
err = gpg_error (GPG_ERR_ELEMENT_NOT_FOUND);
goto leave;
@@ -2799,7 +3187,26 @@ build_signed_data_rest (ksba_cms_t cms)
err = gpg_error (GPG_ERR_MISSING_VALUE);
goto leave;
}
- err = _ksba_der_store_oid (n, sv->algo);
+
+ if (!strcmp (sv->algo, "ecdsa"))
+ {
+ /* Look at the digest algorithm and replace accordingly. */
+ if (!strcmp (digestlist->oid, "2.16.840.1.101.3.4.2.1"))
+ oid = "1.2.840.10045.4.3.2"; /* ecdsa-with-SHA256 */
+ else if (!strcmp (digestlist->oid, "2.16.840.1.101.3.4.2.2"))
+ oid = "1.2.840.10045.4.3.3"; /* ecdsa-with-SHA384 */
+ else if (!strcmp (digestlist->oid, "2.16.840.1.101.3.4.2.3"))
+ oid = "1.2.840.10045.4.3.4"; /* ecdsa-with-SHA512 */
+ else
+ {
+ err = gpg_error (GPG_ERR_DIGEST_ALGO);
+ goto leave;
+ }
+ }
+ else
+ oid = sv->algo;
+
+ err = _ksba_der_store_oid (n, oid);
if (err)
goto leave;
n = _ksba_asn_find_node (root,
@@ -2825,9 +3232,38 @@ build_signed_data_rest (ksba_cms_t cms)
err = gpg_error (GPG_ERR_ELEMENT_NOT_FOUND);
goto leave;
}
- err = _ksba_der_store_octet_string (n, sv->value, sv->valuelen);
- if (err)
- goto leave;
+
+ if (sv->ecc.r) /* ECDSA */
+ {
+ unsigned char *tmpder;
+ size_t tmpderlen;
+
+ _ksba_der_release (dbld);
+ dbld = _ksba_der_builder_new (0);
+ if (!dbld)
+ {
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE);
+ _ksba_der_add_int (dbld, sv->ecc.r, sv->ecc.rlen, 1);
+ _ksba_der_add_int (dbld, sv->value, sv->valuelen, 1);
+ _ksba_der_add_end (dbld);
+
+ err = _ksba_der_builder_get (dbld, &tmpder, &tmpderlen);
+ if (err)
+ goto leave;
+ err = _ksba_der_store_octet_string (n, tmpder, tmpderlen);
+ xfree (tmpder);
+ if (err)
+ goto leave;
+ }
+ else /* RSA */
+ {
+ err = _ksba_der_store_octet_string (n, sv->value, sv->valuelen);
+ if (err)
+ goto leave;
+ }
/* Make the DER encoding and write it out. */
err = _ksba_der_encode_tree (root, &image, &imagelen);
@@ -2871,7 +3307,7 @@ build_signed_data_rest (ksba_cms_t cms)
ksba_asn_tree_release (cms_tree);
_ksba_asn_release_nodes (root);
ksba_writer_release (tmpwrt);
-
+ _ksba_der_release (dbld);
return err;
}
@@ -2969,12 +3405,20 @@ build_enveloped_data_header (ksba_cms_t cms)
{
gpg_error_t err;
int recpno;
- ksba_asn_tree_t cms_tree = NULL;
struct certlist_s *certlist;
unsigned char *buf;
const char *s;
size_t len;
- ksba_writer_t tmpwrt = NULL;
+ ksba_der_t dbld = NULL;
+ int any_ecdh = 0;
+
+ /* See whether we have any ECDH recipients. */
+ for (certlist = cms->cert_list; certlist; certlist = certlist->next)
+ if (certlist->enc_val.ecdh.e)
+ {
+ any_ecdh = 1;
+ break;
+ }
/* Write the outer contentInfo */
/* fixme: code is shared with signed_data_header */
@@ -3012,7 +3456,9 @@ build_enveloped_data_header (ksba_cms_t cms)
For SPHINX the version number must be 0.
*/
- s = "\x00";
+
+
+ s = any_ecdh? "\x02" :"\x00";
err = _ksba_ber_write_tl (cms->writer, TYPE_INTEGER, CLASS_UNIVERSAL, 0, 1);
if (err)
return err;
@@ -3023,11 +3469,6 @@ build_enveloped_data_header (ksba_cms_t cms)
/* Note: originatorInfo is not yet implemented and must not be used
for SPHINX */
- /* Now we write the recipientInfo */
- err = ksba_asn_create_tree ("cms", &cms_tree);
- if (err)
- return err;
-
certlist = cms->cert_list;
if (!certlist)
{
@@ -3035,19 +3476,19 @@ build_enveloped_data_header (ksba_cms_t cms)
goto leave;
}
- /* To construct the set we use a temporary writer object */
- err = ksba_writer_new (&tmpwrt);
- if (err)
- goto leave;
- err = ksba_writer_set_mem (tmpwrt, 2048);
- if (err)
- goto leave;
+ dbld = _ksba_der_builder_new (0);
+ if (!dbld)
+ {
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
+
+ _ksba_der_add_tag (dbld, 0, TYPE_SET);
for (recpno=0; certlist; recpno++, certlist = certlist->next)
{
- AsnNode root, n;
- unsigned char *image;
- size_t imagelen;
+ const unsigned char *der;
+ size_t derlen;
if (!certlist->cert)
{
@@ -3055,141 +3496,140 @@ build_enveloped_data_header (ksba_cms_t cms)
goto leave;
}
- root = _ksba_asn_expand_tree (cms_tree->parse_tree,
- "CryptographicMessageSyntax.RecipientInfo");
-
- /* We store a version of 0 because we are only allowed to use
- the issuerAndSerialNumber for SPHINX */
- n = _ksba_asn_find_node (root, "RecipientInfo.ktri.version");
- if (!n)
- {
- err = gpg_error (GPG_ERR_ELEMENT_NOT_FOUND);
- goto leave;
- }
- err = _ksba_der_store_integer (n, "\x00\x00\x00\x01\x00");
- if (err)
- goto leave;
-
- /* Store the rid */
- n = _ksba_asn_find_node (root, "RecipientInfo.ktri.rid");
- if (!n)
+ if (!certlist->enc_val.ecdh.e) /* RSA (ktri) */
{
- err = gpg_error (GPG_ERR_ELEMENT_NOT_FOUND);
- goto leave;
- }
-
- err = set_issuer_serial (n, certlist->cert, 1);
- if (err)
- goto leave;
-
- /* store the keyEncryptionAlgorithm */
- if (!certlist->enc_val.algo || !certlist->enc_val.value)
- return gpg_error (GPG_ERR_MISSING_VALUE);
- n = _ksba_asn_find_node (root,
- "RecipientInfo.ktri.keyEncryptionAlgorithm.algorithm");
- if (!n)
- {
- err = gpg_error (GPG_ERR_ELEMENT_NOT_FOUND);
- goto leave;
- }
- err = _ksba_der_store_oid (n, certlist->enc_val.algo);
- if (err)
- goto leave;
- n = _ksba_asn_find_node (root,
- "RecipientInfo.ktri.keyEncryptionAlgorithm.parameters");
- if (!n)
- {
- err = gpg_error (GPG_ERR_ELEMENT_NOT_FOUND);
- goto leave;
- }
-
- /* Now store NULL for the optional parameters. From Peter
- * Gutmann's X.509 style guide:
- *
- * Another pitfall to be aware of is that algorithms which
- * have no parameters have this specified as a NULL value
- * rather than omitting the parameters field entirely. The
- * reason for this is that when the 1988 syntax for
- * AlgorithmIdentifier was translated into the 1997 syntax,
- * the OPTIONAL associated with the AlgorithmIdentifier
- * parameters got lost. Later it was recovered via a defect
- * report, but by then everyone thought that algorithm
- * parameters were mandatory. Because of this the algorithm
- * parameters should be specified as NULL, regardless of what
- * you read elsewhere.
- *
- * The trouble is that things *never* get better, they just
- * stay the same, only more so
- * -- Terry Pratchett, "Eric"
- *
- * Although this is about signing, we always do it. Versions of
- * Libksba before 1.0.6 had a bug writing out the NULL tag here,
- * thus in reality we used to be correct according to the
- * standards despite we didn't intended so.
- */
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE);
+ /* We store a version of 0 because we are only allowed to
+ * use the issuerAndSerialNumber for SPHINX */
+ _ksba_der_add_ptr (dbld, 0, TYPE_INTEGER, "", 1);
+ /* rid.issuerAndSerialNumber */
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE);
+ /* rid.issuerAndSerialNumber.issuer */
+ err = _ksba_cert_get_issuer_dn_ptr (certlist->cert, &der, &derlen);
+ if (err)
+ goto leave;
+ _ksba_der_add_der (dbld, der, derlen);
+ /* rid.issuerAndSerialNumber.serialNumber */
+ err = _ksba_cert_get_serial_ptr (certlist->cert, &der, &derlen);
+ if (err)
+ goto leave;
+ _ksba_der_add_der (dbld, der, derlen);
+ _ksba_der_add_end (dbld);
- err = _ksba_der_store_null (n);
- if (err)
- goto leave;
+ /* Store the keyEncryptionAlgorithm */
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE);
+ if (!certlist->enc_val.algo || !certlist->enc_val.value)
+ {
+ err = gpg_error (GPG_ERR_MISSING_VALUE);
+ goto leave;
+ }
+ _ksba_der_add_oid (dbld, certlist->enc_val.algo);
+ /* Now store NULL for the optional parameters. From Peter
+ * Gutmann's X.509 style guide:
+ *
+ * Another pitfall to be aware of is that algorithms which
+ * have no parameters have this specified as a NULL value
+ * rather than omitting the parameters field entirely. The
+ * reason for this is that when the 1988 syntax for
+ * AlgorithmIdentifier was translated into the 1997 syntax,
+ * the OPTIONAL associated with the AlgorithmIdentifier
+ * parameters got lost. Later it was recovered via a defect
+ * report, but by then everyone thought that algorithm
+ * parameters were mandatory. Because of this the algorithm
+ * parameters should be specified as NULL, regardless of what
+ * you read elsewhere.
+ *
+ * The trouble is that things *never* get better, they just
+ * stay the same, only more so
+ * -- Terry Pratchett, "Eric"
+ *
+ * Although this is about signing, we always do it. Versions of
+ * Libksba before 1.0.6 had a bug writing out the NULL tag here,
+ * thus in reality we used to be correct according to the
+ * standards despite we didn't intended so.
+ */
+ _ksba_der_add_ptr (dbld, 0, TYPE_NULL, NULL, 0);
+ _ksba_der_add_end (dbld);
+
+ /* Store the encryptedKey */
+ if (!certlist->enc_val.value)
+ {
+ err = gpg_error (GPG_ERR_MISSING_VALUE);
+ goto leave;
+ }
+ _ksba_der_add_ptr (dbld, 0, TYPE_OCTET_STRING,
+ certlist->enc_val.value,
+ certlist->enc_val.valuelen);
- /* store the encryptedKey */
- if (!certlist->enc_val.value)
- {
- err = gpg_error (GPG_ERR_MISSING_VALUE);
- goto leave;
}
- n = _ksba_asn_find_node (root, "RecipientInfo.ktri.encryptedKey");
- if (!n)
+ else /* ECDH */
{
- err = gpg_error (GPG_ERR_ELEMENT_NOT_FOUND);
- goto leave;
- }
- err = _ksba_der_store_octet_string (n,
- certlist->enc_val.value,
- certlist->enc_val.valuelen);
- if (err)
- goto leave;
-
+ _ksba_der_add_tag (dbld, CLASS_CONTEXT, 1); /* kari */
+ _ksba_der_add_ptr (dbld, 0, TYPE_INTEGER, "\x03", 1);
+
+ _ksba_der_add_tag (dbld, CLASS_CONTEXT, 0); /* originator */
+ _ksba_der_add_tag (dbld, CLASS_CONTEXT, 1); /* originatorKey */
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE); /* algorithm */
+ _ksba_der_add_oid (dbld, certlist->enc_val.algo);
+ _ksba_der_add_end (dbld);
+ _ksba_der_add_bts (dbld, certlist->enc_val.ecdh.e,
+ certlist->enc_val.ecdh.elen, 0);
+ _ksba_der_add_end (dbld); /* end originatorKey */
+ _ksba_der_add_end (dbld); /* end originator */
+
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE); /* keyEncrAlgo */
+ _ksba_der_add_oid (dbld, certlist->enc_val.ecdh.encr_algo);
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE);
+ _ksba_der_add_oid (dbld, certlist->enc_val.ecdh.wrap_algo);
+ _ksba_der_add_end (dbld);
+ _ksba_der_add_end (dbld); /* end keyEncrAlgo */
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE); /* recpEncrKeys */
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE); /* recpEncrKey */
+
+ /* rid.issuerAndSerialNumber */
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE);
+ err = _ksba_cert_get_issuer_dn_ptr (certlist->cert, &der, &derlen);
+ if (err)
+ goto leave;
+ _ksba_der_add_der (dbld, der, derlen);
+ err = _ksba_cert_get_serial_ptr (certlist->cert, &der, &derlen);
+ if (err)
+ goto leave;
+ _ksba_der_add_der (dbld, der, derlen);
+ _ksba_der_add_end (dbld);
- /* Make the DER encoding and write it out */
- err = _ksba_der_encode_tree (root, &image, &imagelen);
- if (err)
- goto leave;
+ /* encryptedKey */
+ if (!certlist->enc_val.value)
+ {
+ err = gpg_error (GPG_ERR_MISSING_VALUE);
+ goto leave;
+ }
+ _ksba_der_add_ptr (dbld, 0, TYPE_OCTET_STRING,
+ certlist->enc_val.value,
+ certlist->enc_val.valuelen);
- err = ksba_writer_write (tmpwrt, image, imagelen);
- if (err)
- goto leave;
+ _ksba_der_add_end (dbld); /* end recpEncrKey */
+ _ksba_der_add_end (dbld); /* end recpEncrKeys */
+ }
- xfree (image);
- _ksba_asn_release_nodes (root);
+ _ksba_der_add_end (dbld); /* End SEQUENCE (ktri or kari) */
}
-
- ksba_asn_tree_release (cms_tree);
- cms_tree = NULL;
+ _ksba_der_add_end (dbld); /* End SET */
/* Write out the SET filled with all recipient infos */
{
- unsigned char *value;
- size_t valuelen;
+ unsigned char *image;
+ size_t imagelen;
- value = ksba_writer_snatch_mem (tmpwrt, &valuelen);
- if (!value)
- {
- err = gpg_error (GPG_ERR_ENOMEM);
- goto leave;
- }
- ksba_writer_release (tmpwrt);
- tmpwrt = NULL;
- err = _ksba_ber_write_tl (cms->writer, TYPE_SET, CLASS_UNIVERSAL,
- 1, valuelen);
- if (!err)
- err = ksba_writer_write (cms->writer, value, valuelen);
- xfree (value);
+ err = _ksba_der_builder_get (dbld, &image, &imagelen);
+ if (err)
+ goto leave;
+ err = ksba_writer_write (cms->writer, image, imagelen);
+ xfree (image);
if (err)
goto leave;
}
-
/* Write the (inner) encryptedContentInfo */
err = _ksba_ber_write_tl (cms->writer, TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, 0);
if (err)
@@ -3222,8 +3662,7 @@ build_enveloped_data_header (ksba_cms_t cms)
/* Now the encrypted data should be written */
leave:
- ksba_writer_release (tmpwrt);
- ksba_asn_tree_release (cms_tree);
+ _ksba_der_release (dbld);
return err;
}
diff --git a/src/cms.h b/src/cms.h
index 8efcc5e..f1d7149 100644
--- a/src/cms.h
+++ b/src/cms.h
@@ -50,8 +50,14 @@ struct value_tree_s {
struct enc_val_s {
char *algo;
- unsigned char *value;
+ unsigned char *value; /* RSA's "a" or ECDH's "s". (malloced) */
size_t valuelen;
+ struct {
+ unsigned char *e; /* Malloced buffer. */
+ size_t elen; /* Length of E. */
+ char *encr_algo; /* Malloced OID string. */
+ char *wrap_algo; /* Malloced OID string. */
+ } ecdh;
};
@@ -96,10 +102,15 @@ struct signer_info_s {
struct sig_val_s {
struct sig_val_s *next;
char *algo;
- unsigned char *value;
- size_t valuelen;
+ unsigned char *value; /* Malloced buffer for parameter "s". */
+ size_t valuelen; /* Used length of VALUE. */
+ struct {
+ unsigned char *r; /* Malloced buffer for parameter "r". */
+ size_t rlen; /* Length of R. */
+ } ecc;
};
+
struct ksba_cms_s {
gpg_error_t last_error;
diff --git a/src/crl.c b/src/crl.c
index 87a3fa3..9f71c85 100644
--- a/src/crl.c
+++ b/src/crl.c
@@ -43,11 +43,14 @@
#include "ber-help.h"
#include "ber-decoder.h"
#include "crl.h"
+#include "stringbuf.h"
static const char oidstr_crlNumber[] = "2.5.29.20";
static const char oidstr_crlReason[] = "2.5.29.21";
+#if 0
static const char oidstr_issuingDistributionPoint[] = "2.5.29.28";
+#endif
static const char oidstr_certificateIssuer[] = "2.5.29.29";
static const char oidstr_authorityKeyIdentifier[] = "2.5.29.35";
@@ -78,101 +81,6 @@ do_hash (ksba_crl_t crl, const void *buffer, size_t length)
#define HASH(a,b) do_hash (crl, (a), (b))
-
-static void
-parse_skip (unsigned char const **buf, size_t *len, struct tag_info *ti)
-{
- if (ti->length)
- {
- assert (ti->length <= *len);
- *len -= ti->length;
- *buf += ti->length;
- }
-}
-
-static gpg_error_t
-parse_sequence (unsigned char const **buf, size_t *len, struct tag_info *ti)
-{
- gpg_error_t err;
-
- err = _ksba_ber_parse_tl (buf, len, ti);
- if (err)
- ;
- else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_SEQUENCE
- && ti->is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (ti->length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
- return err;
-}
-
-static gpg_error_t
-parse_integer (unsigned char const **buf, size_t *len, struct tag_info *ti)
-{
- gpg_error_t err;
-
- err = _ksba_ber_parse_tl (buf, len, ti);
- if (err)
- ;
- else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_INTEGER
- && !ti->is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (!ti->length)
- err = gpg_error (GPG_ERR_TOO_SHORT);
- else if (ti->length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
-
- return err;
-}
-
-static gpg_error_t
-parse_octet_string (unsigned char const **buf, size_t *len, struct tag_info *ti)
-{
- gpg_error_t err;
-
- err= _ksba_ber_parse_tl (buf, len, ti);
- if (err)
- ;
- else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_OCTET_STRING
- && !ti->is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (!ti->length)
- err = gpg_error (GPG_ERR_TOO_SHORT);
- else if (ti->length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
-
- return err;
-}
-
-static gpg_error_t
-parse_object_id_into_str (unsigned char const **buf, size_t *len, char **oid)
-{
- struct tag_info ti;
- gpg_error_t err;
-
- *oid = NULL;
- err = _ksba_ber_parse_tl (buf, len, &ti);
- if (err)
- ;
- else if (!(ti.class == CLASS_UNIVERSAL && ti.tag == TYPE_OBJECT_ID
- && !ti.is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (!ti.length)
- err = gpg_error (GPG_ERR_TOO_SHORT);
- else if (ti.length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
- else if (!(*oid = ksba_oid_to_str (*buf, ti.length)))
- err = gpg_error_from_errno (errno);
- else
- {
- *buf += ti.length;
- *len -= ti.length;
- }
- return err;
-}
-
-
-
/**
* ksba_crl_new:
@@ -631,7 +539,17 @@ ksba_crl_get_item (ksba_crl_t crl, ksba_sexp_t *r_serial,
*
* Return the actual signature in a format suitable to be used as
* input to Libgcrypt's verification function. The caller must free
- * the returned string.
+ * the returned string. For a rsaPSS signed CRLs this function may
+ * also be called right after rsaPSS has been detected using
+ * ksba_crl_get_digest_algo and before the the signature value can be
+ * retrieved. In this case an S-expression of the form
+ *
+ * (sig-val (hash-algo OID)(salt-length N))
+ *
+ * is returned. The caller should extract the actual to be used hash
+ * algorithm from that S-expression. Note that after the actual
+ * signature as been seen, a similar S-expression is returned but in
+ * this case also with the (rsa(s XXX)) list.
*
* Return value: NULL or a string with an S-Exp.
**/
@@ -643,6 +561,28 @@ ksba_crl_get_sig_val (ksba_crl_t crl)
if (!crl)
return NULL;
+ if (!crl->sigval
+ && crl->algo.oid && !strcmp (crl->algo.oid, "1.2.840.113549.1.1.10")
+ && crl->algo.parm && crl->algo.parmlen)
+ {
+ char *pss_hash;
+ unsigned int salt_length;
+ struct stringbuf sb;
+
+ if (_ksba_keyinfo_get_pss_info (crl->algo.parm, crl->algo.parmlen,
+ &pss_hash, &salt_length))
+ return NULL;
+
+ init_stringbuf (&sb, 100);
+ put_stringbuf (&sb,"(7:sig-val(5:flags3:pss)(9:hash-algo");
+ put_stringbuf_sexp (&sb, pss_hash);
+ put_stringbuf (&sb, ")(11:salt-length");
+ put_stringbuf_uint (&sb, salt_length);
+ put_stringbuf (&sb, "))");
+
+ return get_stringbuf (&sb);
+ }
+
if (!crl->sigval)
return NULL;
@@ -1076,33 +1016,8 @@ parse_to_next_update (ksba_crl_t crl)
return 0;
}
-
-/* Parse an enumerated value. Note that this code is duplication of
- the one at ocsp.c. */
-static gpg_error_t
-parse_enumerated (unsigned char const **buf, size_t *len, struct tag_info *ti,
- size_t maxlen)
-{
- gpg_error_t err;
-
- err = _ksba_ber_parse_tl (buf, len, ti);
- if (err)
- ;
- else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_ENUMERATED
- && !ti->is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (!ti->length)
- err = gpg_error (GPG_ERR_TOO_SHORT);
- else if (maxlen && ti->length > maxlen)
- err = gpg_error (GPG_ERR_TOO_LARGE);
- else if (ti->length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
-
- return err;
-}
-
-
+
/* Store an entry extension into the current item. */
static gpg_error_t
store_one_entry_extension (ksba_crl_t crl,
diff --git a/src/der-builder.c b/src/der-builder.c
new file mode 100644
index 0000000..e7f52cc
--- /dev/null
+++ b/src/der-builder.c
@@ -0,0 +1,667 @@
+/* der-builder.c - Straightforward DER object builder
+ * Copyright (C) 2020 g10 Code GmbH
+ *
+ * This file is part of KSBA.
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This file 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 Lesser General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* This is a new way in KSBA to build DER objects without the need and
+ * overhead of using an ASN.1 module. It further avoids a lot of error
+ * checking because the error checking is delayed to the last call.
+ *
+ * For an example on how to use it see cms.c
+ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#include "util.h"
+#include "asn1-constants.h"
+#include "convert.h"
+#include "ber-help.h"
+#include "der-builder.h"
+
+
+
+struct item_s
+{
+ unsigned int tag;
+ unsigned int class:2;
+ unsigned int hdrlen:10; /* Computed size of tag+length field. */
+ unsigned int is_constructed:1; /* This is a constructed element. */
+ unsigned int encapsulate:1; /* This encapsulates other objects. */
+ unsigned int verbatim:1; /* Copy the value verbatim. */
+ unsigned int is_stop:1; /* This is a STOP item. */
+ const void *value;
+ size_t valuelen;
+ char *buffer; /* Malloced space or NULL. */
+};
+
+
+/* Our DER context object; it may eventually be extended to also
+ * feature a parser. */
+struct ksba_der_s
+{
+ gpg_error_t error; /* Last error. */
+ size_t nallocateditems; /* Number of allocated items. */
+ size_t nitems; /* Number of used items. */
+ struct item_s *items; /* Array of items. */
+ int laststop; /* Used as return value of compute_length. */
+ unsigned int finished:1;/* The object has been constructed. */
+};
+
+
+/* Release a DER object. */
+void
+_ksba_der_release (ksba_der_t d)
+{
+ int idx;
+
+ if (!d)
+ return;
+
+ for (idx=0; idx < d->nitems; idx++)
+ xfree (d->items[idx].buffer);
+ xfree (d->items);
+ xfree (d);
+}
+
+
+/* Allocate a new DER builder instance. Returns NULL on error.
+ * NITEMS can be used to tell the number of DER items needed so to
+ * reduce the number of automatic reallocations. */
+ksba_der_t
+_ksba_der_builder_new (unsigned int nitems)
+{
+ ksba_der_t d;
+
+ d = xtrycalloc (1, sizeof *d);
+ if (!d)
+ return NULL;
+ if (nitems)
+ {
+ d->nallocateditems = nitems;
+ d->items = xtrycalloc (d->nallocateditems, sizeof *d->items);
+ if (!d->items)
+ {
+ xfree (d);
+ return NULL;
+ }
+ }
+
+ return d;
+}
+
+
+/* Reset a DER build context so that a new sequence can be build. */
+void
+_ksba_der_builder_reset (ksba_der_t d)
+{
+ int idx;
+
+ if (!d)
+ return; /* Oops. */
+ for (idx=0; idx < d->nitems; idx++)
+ {
+ if (d->items[idx].buffer)
+ {
+ xfree (d->items[idx].buffer);
+ d->items[idx].buffer = NULL;
+ }
+ d->items[idx].hdrlen = 0;
+ d->items[idx].is_constructed = 0;
+ d->items[idx].encapsulate = 0;
+ d->items[idx].verbatim = 0;
+ d->items[idx].is_stop = 0;
+ d->items[idx].value = NULL;
+ }
+ d->nitems = 0;
+ d->finished = 0;
+ d->error = 0;
+}
+
+
+/* Make sure the array of items is large enough for one new item.
+ * Records any error in D and returns true in that case. True is also
+ * returned if D is in finished state. */
+static int
+ensure_space (ksba_der_t d)
+{
+ struct item_s *newitems;
+
+ if (!d || d->error || d->finished)
+ return 1;
+
+ if (d->nitems == d->nallocateditems)
+ {
+ d->nallocateditems += 32;
+ newitems = _ksba_reallocarray (d->items, d->nitems,
+ d->nallocateditems, sizeof *newitems);
+ if (!newitems)
+ d->error = gpg_error_from_syserror ();
+ else
+ d->items = newitems;
+ }
+ return !!d->error;
+}
+
+
+/* Add a new primitive element to the builder instance D. The element
+ * is described by CLASS, TAG, VALUE, and VALUELEN. CLASS and TAG
+ * must describe a primitive element and (VALUE,VALUELEN) specify its
+ * value. The value is a pointer and its object must not be changed
+ * as long as the instance D exists. For a TYPE_NULL tag no value is
+ * expected. Errors are not returned but recorded for later
+ * retrieval. */
+void
+_ksba_der_add_ptr (ksba_der_t d, int class, int tag,
+ void *value, size_t valuelen)
+{
+ if (ensure_space (d))
+ return;
+ d->items[d->nitems].class = class & 0x03;
+ d->items[d->nitems].tag = tag;
+ d->items[d->nitems].value = value;
+ d->items[d->nitems].valuelen = valuelen;
+ d->nitems++;
+}
+
+
+/* This is a low level function which assumes that D has been
+ * validated, VALUE is not NULL and enough space for a new item is
+ * available. It takes ownership of VALUE. VERBATIM is usually
+ * passed as false */
+static void
+add_val_core (ksba_der_t d, int class, int tag, void *value, size_t valuelen,
+ int verbatim)
+{
+ d->items[d->nitems].buffer = value;
+ d->items[d->nitems].class = class & 0x03;
+ d->items[d->nitems].tag = tag;
+ d->items[d->nitems].value = value;
+ d->items[d->nitems].valuelen = valuelen;
+ d->items[d->nitems].verbatim = !!verbatim;
+ d->nitems++;
+}
+
+
+/* This is the same as ksba_der_add_ptr but it takes a copy of the
+ * value and thus the caller does not need to care about keeping the
+ * value. */
+void
+_ksba_der_add_val (ksba_der_t d, int class, int tag,
+ const void *value, size_t valuelen)
+{
+ void *p;
+
+ if (ensure_space (d))
+ return;
+ if (!value || !valuelen)
+ {
+ d->error = gpg_error (GPG_ERR_INV_VALUE);
+ return;
+ }
+ p = xtrymalloc (valuelen);
+ if (!p)
+ {
+ d->error = gpg_error_from_syserror ();
+ return;
+ }
+ memcpy (p, value, valuelen);
+ add_val_core (d, class, tag, p, valuelen, 0);
+}
+
+
+/* Add an OBJECT ID element to D. The OID is given in decimal dotted
+ * format as OIDSTR. */
+void
+_ksba_der_add_oid (ksba_der_t d, const char *oidstr)
+{
+ gpg_error_t err;
+ unsigned char *buf;
+ size_t len;
+
+ if (ensure_space (d))
+ return;
+
+ err = ksba_oid_from_str (oidstr, &buf, &len);
+ if (err)
+ d->error = err;
+ else
+ add_val_core (d, 0, TYPE_OBJECT_ID, buf, len, 0);
+}
+
+
+/* Add a BIT STRING to D. Using a separate function allows to easily
+ * pass the number of unused bits. */
+void
+_ksba_der_add_bts (ksba_der_t d, const void *value, size_t valuelen,
+ unsigned int unusedbits)
+{
+ unsigned char *p;
+
+ if (ensure_space (d))
+ return;
+ if (!value || !valuelen || unusedbits > 7)
+ {
+ d->error = gpg_error (GPG_ERR_INV_VALUE);
+ return;
+ }
+ p = xtrymalloc (1+valuelen);
+ if (!p)
+ {
+ d->error = gpg_error_from_syserror ();
+ return;
+ }
+ p[0] = unusedbits;
+ memcpy (p+1, value, valuelen);
+ add_val_core (d, 0, TYPE_BIT_STRING, p, 1+valuelen, 0);
+}
+
+
+/* Add (VALUE, VALUELEN) as an INTEGER to D. If FORCE_POSITIVE iset
+ * set a 0 or positive number is stored regardless of what is in
+ * (VALUE, VALUELEN). */
+void
+_ksba_der_add_int (ksba_der_t d, const void *value, size_t valuelen,
+ int force_positive)
+{
+ unsigned char *p;
+ int need_extra;
+
+ if (ensure_space (d))
+ return;
+ if (!value || !valuelen)
+ need_extra = 1; /* Assume the integer value 0 was meant. */
+ else
+ need_extra = (force_positive && (*(const unsigned char*)value & 0x80));
+
+ p = xtrymalloc (need_extra+valuelen);
+ if (!p)
+ {
+ d->error = gpg_error_from_syserror ();
+ return;
+ }
+ if (need_extra)
+ p[0] = 0;
+ if (valuelen)
+ memcpy (p+need_extra, value, valuelen);
+ add_val_core (d, 0, TYPE_INTEGER, p, need_extra+valuelen, 0);
+}
+
+
+/* This function allows to add a pre-constructed DER object to the
+ * builder. It should be a valid DER object but its values is not
+ * further checked and copied verbatim to the final DER object
+ * constructed for the handle D. */
+void
+_ksba_der_add_der (ksba_der_t d, const void *der, size_t derlen)
+{
+ void *p;
+
+ if (ensure_space (d))
+ return;
+ if (!der || !derlen)
+ {
+ d->error = gpg_error (GPG_ERR_INV_VALUE);
+ return;
+ }
+ p = xtrymalloc (derlen);
+ if (!p)
+ {
+ d->error = gpg_error_from_syserror ();
+ return;
+ }
+ memcpy (p, der, derlen);
+ add_val_core (d, 0, 0, p, derlen, 1);
+}
+
+
+/* Add a new constructed object to the builder instance D. The object
+ * is described by CLASS and TAG which must describe a constructed
+ * object. The elements of the constructed objects are added with
+ * more call using the add functions. To close a constructed element
+ * a call to tlv_builer_add_end is required. Errors are not returned
+ * but recorded for later retrieval. */
+void
+_ksba_der_add_tag (ksba_der_t d, int class, int tag)
+{
+ if (ensure_space (d))
+ return;
+ d->items[d->nitems].class = class & 0x03;
+ d->items[d->nitems].tag = tag;
+ d->items[d->nitems].is_constructed = 1;
+ d->items[d->nitems].encapsulate = !!(class & 0x80);
+ d->nitems++;
+}
+
+
+/* A call to this function closes a constructed element. This must be
+ * called even for an empty constructed element. */
+void
+_ksba_der_add_end (ksba_der_t d)
+{
+ if (ensure_space (d))
+ return;
+ d->items[d->nitems].is_stop = 1;
+ d->nitems++;
+}
+
+
+/* Return the length of the TL header of a to be constructed TLV.
+ * LENGTH gives the length of the value, if it is 0 indefinite length
+ * is assumed. LENGTH is ignored for the NULL tag. On error 0 is
+ * returned. Note that this function is similar to _ksba_ber_count_tl
+ * but we want our own copy here. */
+static unsigned int
+count_tl (int class, int tag, size_t length)
+{
+ unsigned int hdrlen = 0;
+ int i, t;
+
+ if (tag < 0x1f)
+ hdrlen++;
+ else
+ {
+ hdrlen++;
+
+ for (i = 0, t = tag; t > 0; i++)
+ t >>= 7;
+ hdrlen += i;
+ }
+
+ if (!tag && !class)
+ hdrlen++; /* end tag */
+ else if (tag == TYPE_NULL && !class)
+ hdrlen++; /* NULL tag */
+ else if (!length)
+ hdrlen++; /* indefinite length */
+ else if (length < 128)
+ hdrlen++;
+ else
+ {
+ i = (length <= 0xff ? 1:
+ length <= 0xffff ? 2:
+ length <= 0xffffff ? 3: 4);
+
+ hdrlen++;
+ if (i > 3)
+ hdrlen++;
+ if (i > 2)
+ hdrlen++;
+ if (i > 1)
+ hdrlen++;
+ hdrlen++;
+ }
+
+ return hdrlen;
+}
+
+
+/* Write TAG of CLASS to BUFFER. CONSTRUCTED is a flag telling
+ * whether the value is constructed. LENGTH gives the length of the
+ * value, if it is 0 undefinite length is assumed. LENGTH is ignored
+ * for the NULL tag. TAG must be less that 0x1f. The caller must
+ * make sure that the written TL field does not overflow the
+ * buffer. */
+static void
+write_tl (unsigned char *buffer, int class, int tag,
+ int constructed, size_t length)
+{
+ int i, savei, t;
+
+ if (tag < 0x1f)
+ {
+ *buffer = (class << 6) | tag;
+ if (constructed)
+ *buffer |= 0x20;
+ buffer++;
+ }
+ else
+ {
+ *buffer = (class << 6) | 0x1f;
+ if (constructed)
+ *buffer |= 0x20;
+ buffer++;
+
+ for (i = 0, t = tag; t > 0; i++)
+ t >>= 7;
+ savei = i;
+ t = tag;
+ while (i-- > 0)
+ {
+ buffer[i] = t & 0x7f;
+ if (i != savei - 1)
+ buffer[i] |= 0x80;
+ t >>= 7;
+ }
+ buffer += savei;
+ }
+
+ if (!tag && !class)
+ *buffer++ = 0; /* end tag */
+ else if (tag == TYPE_NULL && !class)
+ *buffer++ = 0; /* NULL tag */
+ else if (!length)
+ *buffer++ = 0x80; /* indefinite length */
+ else if (length < 128)
+ *buffer++ = length;
+ else
+ {
+ /* If we know the sizeof a size_t we could support larger
+ * objects - however this is pretty ridiculous */
+ i = (length <= 0xff ? 1:
+ length <= 0xffff ? 2:
+ length <= 0xffffff ? 3: 4);
+
+ *buffer++ = (0x80 | i);
+ if (i > 3)
+ *buffer++ = length >> 24;
+ if (i > 2)
+ *buffer++ = length >> 16;
+ if (i > 1)
+ *buffer++ = length >> 8;
+ *buffer++ = length;
+ }
+}
+
+
+/* Compute and set the length of all constructed elements in the item
+ * array of D starting at IDX up to the corresponding stop item. On
+ * error d->error is set. */
+static size_t
+compute_lengths (ksba_der_t d, int idx)
+{
+ size_t total = 0;
+
+ if (d->error)
+ return 0;
+
+ for (; idx < d->nitems; idx++)
+ {
+ if (d->items[idx].is_stop)
+ {
+ d->laststop = idx;
+ break;
+ }
+ if (d->items[idx].verbatim)
+ {
+ total += d->items[idx].valuelen;
+ continue;
+ }
+ if (d->items[idx].is_constructed)
+ {
+ d->items[idx].valuelen = compute_lengths (d, idx+1);
+ if (d->error)
+ return 0;
+ /* Note: The last processed IDX is stored at d->LASTSTOP. */
+ }
+ d->items[idx].hdrlen = count_tl (d->items[idx].class,
+ d->items[idx].tag,
+ d->items[idx].valuelen);
+ if (!d->items[idx].hdrlen)
+ {
+ if (d->error)
+ d->error = gpg_error (GPG_ERR_ENCODING_PROBLEM);
+ return 0; /* Error. */
+ }
+
+ total += d->items[idx].hdrlen + d->items[idx].valuelen;
+ if (d->items[idx].is_constructed)
+ {
+ if (d->items[idx].encapsulate && d->items[idx].tag == TYPE_BIT_STRING)
+ total++; /* Account for the unused bits octet. */
+ idx = d->laststop;
+ }
+ }
+ return total;
+}
+
+
+/* Return the constructed DER object at D. On success the object is
+ * stored at R_OBJ and its length at R_OBJLEN. The caller needs to
+ * release that memory. On error NULL is stored at R_OBJ and an error
+ * code is returned. Further the number of successful calls prior to
+ * the error are stored at R_OBJLEN. Note than an error may stem from
+ * any of the previous call made to this object or from constructing
+ * the DER object. If this function is called with NULL for R_OBJ
+ * only the current error state is returned and no further processing
+ * is done. This can be used to figure which of the add calls induced
+ * the error.
+ */
+gpg_error_t
+_ksba_der_builder_get (ksba_der_t d, unsigned char **r_obj, size_t *r_objlen)
+{
+ gpg_error_t err;
+ int idx;
+ unsigned char *buffer = NULL;
+ unsigned char *p;
+ size_t bufsize, buflen;
+ int encap_bts;
+
+ *r_obj = NULL;
+ *r_objlen = 0;
+
+ if (!d)
+ return gpg_error (GPG_ERR_INV_ARG);
+ if (d->error)
+ {
+ err = d->error;
+ if (r_objlen)
+ *r_objlen = d->nitems;
+ goto leave;
+ }
+ if (!r_obj)
+ return 0;
+
+ if (!d->finished)
+ {
+ if (d->nitems == 1)
+ ; /* Single item does not need an end tag. */
+ else if (!d->nitems || !d->items[d->nitems-1].is_stop)
+ {
+ err = gpg_error (GPG_ERR_NO_OBJ);
+ goto leave;
+ }
+
+ compute_lengths (d, 0);
+ err = d->error;
+ if (err)
+ goto leave;
+
+ d->finished = 1;
+ }
+
+ /* If the first element is a primitive element we rightly assume no
+ * other elements follow. It is the user's duty to build a valid
+ * ASN.1 object. */
+ bufsize = d->items[0].hdrlen + d->items[0].valuelen;
+
+ /* for (idx=0; idx < d->nitems; idx++) */
+ /* gpgrt_log_debug ("DERB[%2d]: c=%d t=%2d %s p=%p h=%u l=%zu\n", */
+ /* idx, */
+ /* d->items[idx].class, */
+ /* d->items[idx].tag, */
+ /* d->items[idx].verbatim? "verbatim": */
+ /* d->items[idx].is_stop? "stop": */
+ /* d->items[idx].is_constructed? "cons":"prim", */
+ /* d->items[idx].value, */
+ /* d->items[idx].hdrlen, */
+ /* d->items[idx].valuelen); */
+
+ buffer = xtrymalloc (bufsize);
+ if (!buffer)
+ {
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
+ buflen = 0;
+ p = buffer;
+
+ for (idx=0; idx < d->nitems; idx++)
+ {
+ if (d->items[idx].is_stop)
+ continue;
+ if (!d->items[idx].verbatim)
+ {
+ /* For data encapsulated in a bit string we need to adjust
+ * for the unused bits octet. */
+ encap_bts = (d->items[idx].encapsulate && !d->items[idx].class
+ && d->items[idx].tag == TYPE_BIT_STRING);
+
+ if (buflen + d->items[idx].hdrlen + encap_bts > bufsize)
+ {
+ err = gpg_error (GPG_ERR_BUG);
+ goto leave;
+ }
+ write_tl (p, d->items[idx].class, d->items[idx].tag,
+ (d->items[idx].is_constructed
+ && !d->items[idx].encapsulate),
+ d->items[idx].valuelen + encap_bts);
+ p += d->items[idx].hdrlen;
+ buflen += d->items[idx].hdrlen;
+ if (encap_bts)
+ {
+ *p++ = 0;
+ buflen++;
+ }
+ }
+ if (d->items[idx].value)
+ {
+ if (buflen + d->items[idx].valuelen > bufsize)
+ {
+ err = gpg_error (GPG_ERR_BUG);
+ goto leave;
+ }
+ memcpy (p, d->items[idx].value, d->items[idx].valuelen);
+ p += d->items[idx].valuelen;
+ buflen += d->items[idx].valuelen;
+ }
+ }
+ assert (buflen == bufsize);
+
+ *r_obj = buffer;
+ *r_objlen = buflen;
+ buffer = NULL;
+
+ leave:
+ xfree (buffer);
+ return err;
+}
diff --git a/src/der-builder.h b/src/der-builder.h
new file mode 100644
index 0000000..faff4ce
--- /dev/null
+++ b/src/der-builder.h
@@ -0,0 +1,51 @@
+/* der-builder.h - Straightforward DER object builder
+ * Copyright (C) 2020 g10 Code GmbH
+ *
+ * This file is part of KSBA.
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This file 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 Lesser General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef DER_BUILDER_H
+#define DER_BUILDER_H 1
+
+/* A generic release function. If we add a DER parser we will use the
+ * same object and then it does not make sense to have several release
+ * functions. */
+void _ksba_der_release (ksba_der_t hd);
+
+/* Create a new builder context. */
+ksba_der_t _ksba_der_builder_new (unsigned int nitems);
+/* Reset a builder context. */
+void _ksba_der_builder_reset (ksba_der_t d);
+
+void _ksba_der_add_ptr (ksba_der_t d, int class, int tag,
+ void *value, size_t valuelen);
+void _ksba_der_add_val (ksba_der_t d, int class, int tag,
+ const void *value, size_t valuelen);
+void _ksba_der_add_oid (ksba_der_t d, const char *oidstr);
+void _ksba_der_add_bts (ksba_der_t d, const void *value, size_t valuelen,
+ unsigned int unusedbits);
+void _ksba_der_add_int (ksba_der_t d, const void *value, size_t valuelen,
+ int force_positive);
+void _ksba_der_add_der (ksba_der_t d, const void *der, size_t derlen);
+void _ksba_der_add_tag (ksba_der_t d, int class, int tag);
+void _ksba_der_add_end (ksba_der_t d);
+
+gpg_error_t _ksba_der_builder_get (ksba_der_t d,
+ unsigned char **r_obj, size_t *r_objlen);
+
+
+#endif /*DER_BUILDER_H*/
diff --git a/src/dn.c b/src/dn.c
index 958850b..6510772 100644
--- a/src/dn.c
+++ b/src/dn.c
@@ -40,6 +40,8 @@
#include "asn1-func.h"
#include "ber-help.h"
#include "ber-decoder.h"
+#include "stringbuf.h"
+
static const struct {
const char *name;
@@ -95,139 +97,6 @@ static unsigned char charclasses[128] = {
#undef N
#undef P
-struct stringbuf {
- size_t len;
- size_t size;
- char *buf;
- int out_of_core;
-};
-
-
-
-static void
-init_stringbuf (struct stringbuf *sb, int initiallen)
-{
- sb->len = 0;
- sb->size = initiallen;
- sb->out_of_core = 0;
- /* allocate one more, so that get_stringbuf can append a nul */
- sb->buf = xtrymalloc (initiallen+1);
- if (!sb->buf)
- sb->out_of_core = 1;
-}
-
-static void
-deinit_stringbuf (struct stringbuf *sb)
-{
- xfree (sb->buf);
- sb->buf = NULL;
- sb->out_of_core = 1; /* make sure the caller does an init before reuse */
-}
-
-
-static void
-put_stringbuf (struct stringbuf *sb, const char *text)
-{
- size_t n = strlen (text);
-
- if (sb->out_of_core)
- return;
-
- if (sb->len + n >= sb->size)
- {
- char *p;
-
- sb->size += n + 100;
- p = xtryrealloc (sb->buf, sb->size);
- if ( !p)
- {
- sb->out_of_core = 1;
- return;
- }
- sb->buf = p;
- }
- memcpy (sb->buf+sb->len, text, n);
- sb->len += n;
-}
-
-static void
-put_stringbuf_mem (struct stringbuf *sb, const char *text, size_t n)
-{
- if (sb->out_of_core)
- return;
-
- if (sb->len + n >= sb->size)
- {
- char *p;
-
- sb->size += n + 100;
- p = xtryrealloc (sb->buf, sb->size);
- if ( !p)
- {
- sb->out_of_core = 1;
- return;
- }
- sb->buf = p;
- }
- memcpy (sb->buf+sb->len, text, n);
- sb->len += n;
-}
-
-static void
-put_stringbuf_mem_skip (struct stringbuf *sb, const char *text, size_t n,
- int skip)
-{
- char *p;
-
- if (!skip)
- {
- put_stringbuf_mem (sb, text, n);
- return;
- }
- if (sb->out_of_core)
- return;
-
- if (sb->len + n >= sb->size)
- {
- /* Note: we allocate too much here, but we don't care. */
- sb->size += n + 100;
- p = xtryrealloc (sb->buf, sb->size);
- if ( !p)
- {
- sb->out_of_core = 1;
- return;
- }
- sb->buf = p;
- }
- p = sb->buf+sb->len;
- while (n > skip)
- {
- text += skip;
- n -= skip;
- *p++ = *text++;
- n--;
- sb->len++;
- }
-}
-
-static char *
-get_stringbuf (struct stringbuf *sb)
-{
- char *p;
-
- if (sb->out_of_core)
- {
- xfree (sb->buf); sb->buf = NULL;
- return NULL;
- }
-
- sb->buf[sb->len] = 0;
- p = sb->buf;
- sb->buf = NULL;
- sb->out_of_core = 1; /* make sure the caller does an init before reuse */
- return p;
-}
-
/* This function is used for 1 byte encodings to insert any required
quoting. It does not do the quoting for a space or hash mark at
diff --git a/src/gen-help.h b/src/gen-help.h
index c0a3776..05641f9 100644
--- a/src/gen-help.h
+++ b/src/gen-help.h
@@ -90,6 +90,8 @@ const char *gpg_strerror (int err);
/* Duplicated type definitions from ksba.h. */
typedef struct ksba_asn_tree_s *ksba_asn_tree_t;
-
+int ksba_asn_parse_file (const char *filename, ksba_asn_tree_t *result,
+ int debug);
+void ksba_asn_tree_dump (ksba_asn_tree_t tree, const char *name, FILE *fp);
#endif /*GEN_HELP_H*/
diff --git a/src/keyinfo.c b/src/keyinfo.c
index 265b475..666726f 100644
--- a/src/keyinfo.c
+++ b/src/keyinfo.c
@@ -1,5 +1,5 @@
/* keyinfo.c - Parse and build a keyInfo structure
- * Copyright (C) 2001, 2002, 2007, 2008, 2012 g10 Code GmbH
+ * Copyright (C) 2001, 2002, 2007, 2008, 2012, 2020 g10 Code GmbH
*
* This file is part of KSBA.
*
@@ -44,14 +44,21 @@
#include "shared.h"
#include "convert.h"
#include "ber-help.h"
-
+#include "sexp-parse.h"
+#include "stringbuf.h"
+#include "der-builder.h"
/* Constants used for the public key algorithms. */
typedef enum
{
+ PKALGO_NONE,
PKALGO_RSA,
PKALGO_DSA,
- PKALGO_ECC
+ PKALGO_ECC,
+ PKALGO_X25519,
+ PKALGO_X448,
+ PKALGO_ED25519,
+ PKALGO_ED448
}
pkalgo_t;
@@ -60,7 +67,7 @@ struct algo_table_s {
const char *oidstring;
const unsigned char *oid; /* NULL indicattes end of table */
int oidlen;
- int supported;
+ int supported; /* Values > 1 are also used to indicate hacks. */
pkalgo_t pkalgo;
const char *algo_string;
const char *elem_string; /* parameter name or '-' */
@@ -70,6 +77,8 @@ struct algo_table_s {
const char *digest_string; /* The digest algo if included in the OID. */
};
+/* Special values for the supported field. */
+#define SUPPORTED_RSAPSS 2
static const struct algo_table_s pk_algo_table[] = {
@@ -82,7 +91,12 @@ static const struct algo_table_s pk_algo_table[] = {
{ /* iso.member-body.us.rsadsi.pkcs.pkcs-1.7 */
"1.2.840.113549.1.1.7", /* RSAES-OAEP */
"\x2a\x86\x48\x86\xf7\x0d\x01\x01\x07", 9,
- 0, PKALGO_RSA, "rsa", "-ne", "\x30\x02\x02"}, /* (patent problems) */
+ 0, PKALGO_RSA, "rsa", "-ne", "\x30\x02\x02"},
+
+ { /* iso.member-body.us.rsadsi.pkcs.pkcs-1.10 */
+ "1.2.840.113549.1.1.10", /* rsaPSS */
+ "\x2a\x86\x48\x86\xf7\x0d\x01\x01\x0a", 9,
+ SUPPORTED_RSAPSS, PKALGO_RSA, "rsa", "-ne", "\x30\x02\x02"},
{ /* */
"2.5.8.1.1", /* rsa (ambiguous due to missing padding rules)*/
@@ -99,6 +113,26 @@ static const struct algo_table_s pk_algo_table[] = {
"\x2a\x86\x48\xce\x3d\x02\x01", 7,
1, PKALGO_ECC, "ecc", "q", "\x80" },
+ { /* iso.identified-organization.thawte.110 */
+ "1.3.101.110", /* X25519 */
+ "\x2b\x65\x6e", 3,
+ 1, PKALGO_X25519, "ecc", "q", "\x80" },
+
+ { /* iso.identified-organization.thawte.111 */
+ "1.3.101.111", /* X448 */
+ "\x2b\x65\x6f", 3,
+ 1, PKALGO_X448, "ecc", "q", "\x80" },
+
+ { /* iso.identified-organization.thawte.112 */
+ "1.3.101.112", /* Ed25519 */
+ "\x2b\x65\x70", 3,
+ 1, PKALGO_ED25519, "ecc", "q", "\x80" },
+
+ { /* iso.identified-organization.thawte.113 */
+ "1.3.101.113", /* Ed448 */
+ "\x2b\x65\x71", 3,
+ 1, PKALGO_ED448, "ecc", "q", "\x80" },
+
{NULL}
};
@@ -203,6 +237,11 @@ static const struct algo_table_s sig_algo_table[] = {
"\x2a\x86\x48\x86\xf7\x0d\x01\x01\x0d", 9,
1, PKALGO_RSA, "rsa", "s", "\x82", NULL, NULL, "sha512" },
+ { /* iso.member-body.us.rsadsi.pkcs.pkcs-1.10 */
+ "1.2.840.113549.1.1.10", /* rsaPSS */
+ "\x2a\x86\x48\x86\xf7\x0d\x01\x01\x0a", 9,
+ SUPPORTED_RSAPSS, PKALGO_RSA, "rsa", "s", "\x82", NULL, NULL, NULL},
+
{ /* TeleTrust signature scheme with RSA signature and DSI according
to ISO/IEC 9796-2 with random number and RIPEMD-160. I am not
sure for what this is good; thus disabled. */
@@ -210,28 +249,47 @@ static const struct algo_table_s sig_algo_table[] = {
"\x2B\x24\x03\x04\x03\x02\x02", 7,
0, PKALGO_RSA, "rsa", "s", "\x82", NULL, NULL, "rmd160" },
+
+ { /* iso.identified-organization.thawte.112 */
+ "1.3.101.112", /* Ed25519 */
+ "\x2b\x65\x70", 3,
+ 1, PKALGO_ED25519, "eddsa", "", "", NULL, NULL, NULL },
+ { /* iso.identified-organization.thawte.113 */
+ "1.3.101.113", /* Ed448 */
+ "\x2b\x65\x71", 3,
+ 1, PKALGO_ED448, "eddsa", "", "", NULL, NULL, NULL },
+
{NULL}
};
static const struct algo_table_s enc_algo_table[] = {
- { /* iso.member-body.us.rsadsi.pkcs.pkcs-1.1 */
- "1.2.840.113549.1.1.1", /* rsaEncryption (RSAES-PKCA1-v1.5) */
- "\x2A\x86\x48\x86\xF7\x0D\x01\x01\x01", 9,
- 1, PKALGO_RSA, "rsa", "a", "\x82" },
+ {/* iso.member-body.us.rsadsi.pkcs.pkcs-1.1 */
+ "1.2.840.113549.1.1.1", /* rsaEncryption (RSAES-PKCA1-v1.5) */
+ "\x2A\x86\x48\x86\xF7\x0D\x01\x01\x01", 9,
+ 1, PKALGO_RSA, "rsa", "a", "\x82" },
+ {/* iso.member-body.us.ansi-x9-62.2.1 */
+ "1.2.840.10045.2.1", /* ecPublicKey */
+ "\x2a\x86\x48\xce\x3d\x02\x01", 7,
+ 1, PKALGO_ECC, "ecdh", "e", "\x80" },
{NULL}
};
/* This tables maps names of ECC curves names to OIDs. A similar
- table is used by lib gcrypt. */
+ table is used by Libgcrypt. */
static const struct
{
const char *oid;
const char *name;
+ unsigned char pkalgo; /* If not 0 force the use of ALGO. */
} curve_names[] =
{
- { "1.3.6.1.4.1.3029.1.5.1", "Curve25519" },
- { "1.3.6.1.4.1.11591.15.1", "Ed25519" },
+ { "1.3.101.112", "Ed25519", PKALGO_ED25519},
+ { "1.3.101.110", "Curve25519", PKALGO_X25519},
+ { "1.3.101.110", "X25519", PKALGO_X25519},
+
+ { "1.3.101.113", "Ed448", PKALGO_ED448 },
+ { "1.3.101.111", "X448", PKALGO_X448 },
{ "1.2.840.10045.3.1.1", "NIST P-192" },
{ "1.2.840.10045.3.1.1", "nistp192" },
@@ -277,16 +335,6 @@ static const struct
-
-
-struct stringbuf {
- size_t len;
- size_t size;
- char *buf;
- int out_of_core;
-};
-
-
#define TLV_LENGTH(prefix) do { \
if (!prefix ## len) \
return gpg_error (GPG_ERR_INV_KEYINFO); \
@@ -316,13 +364,16 @@ struct stringbuf {
} while (0)
-/* Given a string BUF of length BUFLEN with either the name of an ECC
- curve or its OID in dotted form return the DER encoding of the OID.
- The caller must free the result. On error NULL is returned. */
-static unsigned char *
-get_ecc_curve_oid (const unsigned char *buf, size_t buflen, size_t *r_oidlen)
+/* Given a string BUF of length BUFLEN with either a curve name or its
+ * OID in dotted form return a string in dotted form of the name. The
+ * caller must free the result. On error NULL is returned. If a
+ * curve requires the use of a certain algorithm, that algorithm is
+ * stored at R_PKALGO. */
+static char *
+get_ecc_curve_oid (const unsigned char *buf, size_t buflen, pkalgo_t *r_pkalgo)
{
- unsigned char *der_oid;
+ unsigned char *result;
+ int i, find_pkalgo;
/* Skip an optional "oid." prefix. */
if (buflen > 4 && buf[3] == '.' && digitp (buf+4)
@@ -336,8 +387,6 @@ get_ecc_curve_oid (const unsigned char *buf, size_t buflen, size_t *r_oidlen)
/* If it does not look like an OID - map it through the table. */
if (buflen && !digitp (buf))
{
- int i;
-
for (i=0; curve_names[i].oid; i++)
if (buflen == strlen (curve_names[i].name)
&& !memcmp (buf, curve_names[i].name, buflen))
@@ -346,11 +395,30 @@ get_ecc_curve_oid (const unsigned char *buf, size_t buflen, size_t *r_oidlen)
return NULL; /* Not found. */
buf = curve_names[i].oid;
buflen = strlen (curve_names[i].oid);
+ *r_pkalgo = curve_names[i].pkalgo;
+ find_pkalgo = 0;
}
+ else
+ find_pkalgo = 1;
- if (_ksba_oid_from_buf (buf, buflen, &der_oid, r_oidlen))
- return NULL;
- return der_oid;
+ result = xtrymalloc (buflen + 1);
+ if (!result)
+ return NULL; /* Ooops */
+ memcpy (result, buf, buflen);
+ result[buflen] = 0;
+
+ if (find_pkalgo)
+ {
+ /* We still need to check whether the OID requires a certain ALGO. */
+ for (i=0; curve_names[i].oid; i++)
+ if (!strcmp (curve_names[i].oid, result))
+ {
+ *r_pkalgo = curve_names[i].pkalgo;
+ break;
+ }
+ }
+
+ return result;
}
@@ -401,11 +469,6 @@ get_algorithm (int mode, const unsigned char *der, size_t derlen,
/* der does now point to an oid of length LEN */
*r_pos = der - start;
*r_len = len;
-/* { */
-/* char *p = ksba_oid_to_str (der, len); */
-/* printf ("algorithm: %s\n", p); */
-/* xfree (p); */
-/* } */
der += len;
derlen -= len;
seqlen -= der - startseq;;
@@ -420,7 +483,7 @@ get_algorithm (int mode, const unsigned char *der, size_t derlen,
c = *der++; derlen--;
if ( c == 0x05 )
{
- /*printf ("parameter: NULL \n"); the usual case */
+ /* gpgrt_log_debug ("%s: parameter: NULL \n", __func__); */
if (!derlen)
return gpg_error (GPG_ERR_INV_KEYINFO);
c = *der++; derlen--;
@@ -512,6 +575,8 @@ _ksba_parse_algorithm_identifier (const unsigned char *der, size_t derlen,
r_nread, r_oid, NULL, NULL);
}
+
+/* Note that R_NREAD, R_PARM, and R_PARMLEN are optional. */
gpg_error_t
_ksba_parse_algorithm_identifier2 (const unsigned char *der, size_t derlen,
size_t *r_nread, char **r_oid,
@@ -525,13 +590,15 @@ _ksba_parse_algorithm_identifier2 (const unsigned char *der, size_t derlen,
/* fixme: get_algorithm might return the error invalid keyinfo -
this should be invalid algorithm identifier */
*r_oid = NULL;
- *r_nread = 0;
+ if (r_nread)
+ *r_nread = 0;
off2 = len2 = 0;
err = get_algorithm (0, der, derlen, &nread, &off, &len, &is_bitstr,
&off2, &len2, &parm_type);
if (err)
return err;
- *r_nread = nread;
+ if (r_nread)
+ *r_nread = nread;
*r_oid = ksba_oid_to_str (der+off, len);
if (!*r_oid)
return gpg_error (GPG_ERR_ENOMEM);
@@ -547,13 +614,15 @@ _ksba_parse_algorithm_identifier2 (const unsigned char *der, size_t derlen,
NULL, NULL, NULL);
if (err)
{
- *r_nread = 0;
+ if (r_nread)
+ *r_nread = 0;
return err;
}
*r_oid = ksba_oid_to_str (der+off2+off, len);
if (!*r_oid)
{
- *r_nread = 0;
+ if (r_nread)
+ *r_nread = 0;
return gpg_error (GPG_ERR_ENOMEM);
}
@@ -585,84 +654,8 @@ _ksba_parse_algorithm_identifier2 (const unsigned char *der, size_t derlen,
-static void
-init_stringbuf (struct stringbuf *sb, int initiallen)
-{
- sb->len = 0;
- sb->size = initiallen;
- sb->out_of_core = 0;
- /* allocate one more, so that get_stringbuf can append a nul */
- sb->buf = xtrymalloc (initiallen+1);
- if (!sb->buf)
- sb->out_of_core = 1;
-}
-
-static void
-put_stringbuf_mem (struct stringbuf *sb, const char *text, size_t n)
-{
- if (sb->out_of_core)
- return;
-
- if (sb->len + n >= sb->size)
- {
- char *p;
-
- sb->size += n + 100;
- p = xtryrealloc (sb->buf, sb->size);
- if ( !p)
- {
- sb->out_of_core = 1;
- return;
- }
- sb->buf = p;
- }
- memcpy (sb->buf+sb->len, text, n);
- sb->len += n;
-}
-
-static void
-put_stringbuf (struct stringbuf *sb, const char *text)
-{
- put_stringbuf_mem (sb, text,strlen (text));
-}
-
-static void
-put_stringbuf_mem_sexp (struct stringbuf *sb, const char *text, size_t length)
-{
- char buf[20];
- sprintf (buf,"%u:", (unsigned int)length);
- put_stringbuf (sb, buf);
- put_stringbuf_mem (sb, text, length);
-}
-
-static void
-put_stringbuf_sexp (struct stringbuf *sb, const char *text)
-{
- put_stringbuf_mem_sexp (sb, text, strlen (text));
-}
-
-
-static char *
-get_stringbuf (struct stringbuf *sb)
-{
- char *p;
-
- if (sb->out_of_core)
- {
- xfree (sb->buf); sb->buf = NULL;
- return NULL;
- }
-
- sb->buf[sb->len] = 0;
- p = sb->buf;
- sb->buf = NULL;
- sb->out_of_core = 1; /* make sure the caller does an init before reuse */
- return p;
-}
-
-
/* Assume that der is a buffer of length DERLEN with a DER encoded
- Asn.1 structure like this:
+ ASN.1 structure like this:
keyInfo ::= SEQUENCE {
SEQUENCE {
@@ -763,6 +756,16 @@ _ksba_keyinfo_to_sexp (const unsigned char *der, size_t derlen,
put_stringbuf_sexp (&sb, parm_oid);
put_stringbuf (&sb, ")");
}
+ else if (pk_algo_table[algoidx].pkalgo == PKALGO_ED25519
+ || pk_algo_table[algoidx].pkalgo == PKALGO_ED448
+ || pk_algo_table[algoidx].pkalgo == PKALGO_X25519
+ || pk_algo_table[algoidx].pkalgo == PKALGO_X448)
+ {
+ put_stringbuf (&sb, "(");
+ put_stringbuf_sexp (&sb, "curve");
+ put_stringbuf_sexp (&sb, pk_algo_table[algoidx].oidstring);
+ put_stringbuf (&sb, ")");
+ }
/* If parameters are given and we have a description for them, parse
them. */
@@ -869,11 +872,11 @@ _ksba_keyinfo_to_sexp (const unsigned char *der, size_t derlen,
/* Match the algorithm string given in BUF which is of length BUFLEN
- with the known algorithms from our table and returns the table
- entries for the DER encoded OID. If WITH_SIG is true, the table of
- signature algorithms is consulted first. */
-static const unsigned char *
-oid_from_buffer (const unsigned char *buf, int buflen, int *oidlen,
+ * with the known algorithms from our table and return the table
+ * entriy with the OID string. If WITH_SIG is true, the table of
+ * signature algorithms is consulted first. */
+static const char *
+oid_from_buffer (const unsigned char *buf, unsigned int buflen,
pkalgo_t *r_pkalgo, int with_sig)
{
int i;
@@ -904,8 +907,7 @@ oid_from_buffer (const unsigned char *buf, int buflen, int *oidlen,
if (sig_algo_table[i].oid)
{
*r_pkalgo = sig_algo_table[i].pkalgo;
- *oidlen = sig_algo_table[i].oidlen;
- return sig_algo_table[i].oid;
+ return sig_algo_table[i].oidstring;
}
}
@@ -925,26 +927,26 @@ oid_from_buffer (const unsigned char *buf, int buflen, int *oidlen,
return NULL;
*r_pkalgo = pk_algo_table[i].pkalgo;
- *oidlen = pk_algo_table[i].oidlen;
- return pk_algo_table[i].oid;
+ return pk_algo_table[i].oidstring;
}
-/* Take a public-key S-Exp and convert it into a DER encoded
- publicKeyInfo */
+/* If ALGOINFOMODE is false: Take the "public-key" s-expression SEXP
+ * and convert it into a DER encoded publicKeyInfo.
+ *
+ * If ALGOINFOMODE is true: Take the "sig-val" s-expression SEXP and
+ * convert it into a DER encoded algorithmInfo. */
gpg_error_t
-_ksba_keyinfo_from_sexp (ksba_const_sexp_t sexp,
+_ksba_keyinfo_from_sexp (ksba_const_sexp_t sexp, int algoinfomode,
unsigned char **r_der, size_t *r_derlen)
{
gpg_error_t err;
const unsigned char *s;
char *endp;
- unsigned long n, n1;
- const unsigned char *oid;
- int oidlen;
- unsigned char *curve_oid = NULL;
- size_t curve_oidlen;
- pkalgo_t pkalgo;
+ unsigned long n;
+ const char *algo_oid;
+ char *curve_oid = NULL;
+ pkalgo_t pkalgo, force_pkalgo;
int i;
struct {
const char *name;
@@ -953,14 +955,11 @@ _ksba_keyinfo_from_sexp (ksba_const_sexp_t sexp,
int valuelen;
} parm[10];
int parmidx;
- int idxtbl[10];
- int idxtbllen;
const char *parmdesc, *algoparmdesc;
- ksba_writer_t writer = NULL;
- void *algoparmseq_value = NULL;
- size_t algoparmseq_len;
- void *bitstr_value = NULL;
- size_t bitstr_len;
+ ksba_der_t dbld = NULL;
+ ksba_der_t dbld2 = NULL;
+ unsigned char *tmpder;
+ size_t tmpderlen;
if (!sexp)
return gpg_error (GPG_ERR_INV_VALUE);
@@ -973,11 +972,16 @@ _ksba_keyinfo_from_sexp (ksba_const_sexp_t sexp,
n = strtoul (s, &endp, 10);
s = endp;
if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP); /* we don't allow empty lengths */
+ return gpg_error (GPG_ERR_INV_SEXP); /* We don't allow empty lengths. */
s++;
- if (n != 10 || memcmp (s, "public-key", 10))
+
+ if (algoinfomode && n == 7 && !memcmp (s, "sig-val", 7))
+ s += 7;
+ else if (n == 10 || !memcmp (s, "public-key", 10))
+ s += 10;
+ else
return gpg_error (GPG_ERR_UNKNOWN_SEXP);
- s += 10;
+
if (*s != '(')
return gpg_error (digitp (s)? GPG_ERR_UNKNOWN_SEXP : GPG_ERR_INV_SEXP);
s++;
@@ -986,31 +990,45 @@ _ksba_keyinfo_from_sexp (ksba_const_sexp_t sexp,
n = strtoul (s, &endp, 10);
s = endp;
if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP); /* we don't allow empty lengths */
+ return gpg_error (GPG_ERR_INV_SEXP); /* We don't allow empty lengths. */
s++;
- oid = oid_from_buffer (s, n, &oidlen, &pkalgo, 0);
- if (!oid)
+
+ algo_oid = oid_from_buffer (s, n, &pkalgo, algoinfomode);
+ if (!algo_oid)
return gpg_error (GPG_ERR_UNSUPPORTED_ALGORITHM);
s += n;
- /* Collect all the values */
+ /* Collect all the values. */
+ force_pkalgo = 0;
for (parmidx = 0; *s != ')' ; parmidx++)
{
if (parmidx >= DIM(parm))
- return gpg_error (GPG_ERR_GENERAL);
+ {
+ err = gpg_error (GPG_ERR_GENERAL);
+ goto leave;
+ }
if (*s != '(')
- return gpg_error (digitp(s)? GPG_ERR_UNKNOWN_SEXP:GPG_ERR_INV_SEXP);
+ {
+ err = gpg_error (digitp(s)? GPG_ERR_UNKNOWN_SEXP:GPG_ERR_INV_SEXP);
+ goto leave;
+ }
s++;
n = strtoul (s, &endp, 10);
s = endp;
if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP);
+ {
+ err = gpg_error (GPG_ERR_INV_SEXP);
+ goto leave;
+ }
s++;
parm[parmidx].name = s;
parm[parmidx].namelen = n;
s += n;
if (!digitp(s))
- return gpg_error (GPG_ERR_UNKNOWN_SEXP); /* ... or invalid S-Exp. */
+ {
+ err = gpg_error (GPG_ERR_UNKNOWN_SEXP); /* ... or invalid S-Exp. */
+ goto leave;
+ }
n = strtoul (s, &endp, 10);
s = endp;
@@ -1021,580 +1039,318 @@ _ksba_keyinfo_from_sexp (ksba_const_sexp_t sexp,
parm[parmidx].valuelen = n;
s += n;
if ( *s != ')')
- return gpg_error (GPG_ERR_UNKNOWN_SEXP); /* ... or invalid S-Exp. */
+ {
+ err = gpg_error (GPG_ERR_UNKNOWN_SEXP); /* ... or invalid S-Exp. */
+ goto leave;
+ }
s++;
+
+ if (parm[parmidx].namelen == 5
+ && !memcmp (parm[parmidx].name, "curve", 5)
+ && !curve_oid)
+ {
+ curve_oid = get_ecc_curve_oid (parm[parmidx].value,
+ parm[parmidx].valuelen, &force_pkalgo);
+ parmidx--; /* No need to store this parameter. */
+ }
}
s++;
+ /* Allow for optional elements. */
+ if (*s == '(')
+ {
+ int depth = 1;
+ err = sskip (&s, &depth);
+ if (err)
+ goto leave;
+ }
/* We need another closing parenthesis. */
if ( *s != ')' )
- return gpg_error (GPG_ERR_INV_SEXP);
-
- /* Describe the parameters in the order we want them and construct
- IDXTBL to access them. For DSA wie also set algoparmdesc so
- that we can later build the parameters for the
- algorithmIdentifier. */
- algoparmdesc = NULL;
- switch (pkalgo)
{
- case PKALGO_RSA: parmdesc = "ne"; break;
- case PKALGO_DSA: parmdesc = "y" ; algoparmdesc = "pqg"; break;
- case PKALGO_ECC: parmdesc = "Cq"; break;
- default: return gpg_error (GPG_ERR_UNKNOWN_ALGORITHM);
+ err = gpg_error (GPG_ERR_INV_SEXP);
+ goto leave;
}
- idxtbllen = 0;
- for (s = parmdesc; *s; s++)
+ if (force_pkalgo)
+ pkalgo = force_pkalgo;
+
+ /* Describe the parameters in the order we want them. For DSA wie
+ * also set algoparmdesc so that we can later build the parameters
+ * for the algorithmIdentifier. */
+ algoparmdesc = NULL;
+ switch (pkalgo)
{
- for (i=0; i < parmidx; i++)
- {
- assert (idxtbllen < DIM (idxtbl));
- switch (*s)
- {
- case 'C': /* Magic value for "curve". */
- if (parm[i].namelen == 5 && !memcmp (parm[i].name, "curve", 5))
- {
- idxtbl[idxtbllen++] = i;
- i = parmidx; /* Break inner loop. */
- }
- break;
- default:
- if (parm[i].namelen == 1 && parm[i].name[0] == *s)
- {
- idxtbl[idxtbllen++] = i;
- i = parmidx; /* Break inner loop. */
- }
- break;
- }
- }
+ case PKALGO_RSA:
+ parmdesc = algoinfomode? "" : "ne";
+ break;
+ case PKALGO_DSA:
+ parmdesc = algoinfomode? "" : "y";
+ algoparmdesc = "pqg";
+ break;
+ case PKALGO_ECC:
+ parmdesc = algoinfomode? "" : "q";
+ break;
+ case PKALGO_ED25519:
+ case PKALGO_X25519:
+ case PKALGO_ED448:
+ case PKALGO_X448:
+ parmdesc = algoinfomode? "" : "q";
+ if (curve_oid)
+ algo_oid = curve_oid;
+ break;
+ default:
+ err = gpg_error (GPG_ERR_UNKNOWN_ALGORITHM);
+ goto leave;
}
- if (idxtbllen != strlen (parmdesc))
- return gpg_error (GPG_ERR_UNKNOWN_SEXP);
- if (pkalgo == PKALGO_ECC)
+ /* Create a builder. */
+ dbld = _ksba_der_builder_new (0);
+ if (!dbld)
{
- curve_oid = get_ecc_curve_oid (parm[idxtbl[0]].value,
- parm[idxtbl[0]].valuelen,
- &curve_oidlen);
- if (!curve_oid)
- return gpg_error (GPG_ERR_UNKNOWN_SEXP);
+ err = gpg_error_from_syserror ();
+ goto leave;
}
+ /* The outer sequence. */
+ if (!algoinfomode)
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE);
+ /* The sequence. */
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE);
+ /* The object id. */
+ _ksba_der_add_oid (dbld, algo_oid);
- /* Create write object. */
- err = ksba_writer_new (&writer);
- if (err)
- goto leave;
- err = ksba_writer_set_mem (writer, 1024);
- if (err)
- goto leave;
-
- /* We create the keyinfo in 2 steps:
-
- 1. We build the inner one and encapsulate it in a bit string.
-
- 2. We create the outer sequence include the algorithm identifier
- and the bit string from step 1.
- */
- if (pkalgo == PKALGO_ECC)
+ /* The parameter. */
+ if (algoparmdesc)
{
- /* Write the bit string header and the number of unused bits. */
- err = _ksba_ber_write_tl (writer, TYPE_BIT_STRING, CLASS_UNIVERSAL,
- 0, parm[idxtbl[1]].valuelen + 1);
- if (!err)
- err = ksba_writer_write (writer, "", 1);
- /* And the actual raw value. */
- if (!err)
- err = ksba_writer_write (writer, parm[idxtbl[1]].value,
- parm[idxtbl[1]].valuelen);
- if (err)
- goto leave;
-
+ /* Write the sequence tag followed by the integers. */
+ _ksba_der_add_tag (dbld, 0, TYPE_SEQUENCE);
+ for (s = algoparmdesc; *s; s++)
+ for (i=0; i < parmidx; i++)
+ if (parm[i].namelen == 1 && parm[i].name[0] == *s)
+ {
+ _ksba_der_add_int (dbld, parm[i].value, parm[i].valuelen, 1);
+ break; /* inner loop */
+ }
+ _ksba_der_add_end (dbld);
}
- else /* RSA and DSA */
+ else if (pkalgo == PKALGO_ECC && !algoinfomode)
{
- /* Calculate the size of the sequence value and the size of the
- bit string value. NOt ethat in case there is only one
- integer to write, no sequence is used. */
- for (n=0, i=0; i < idxtbllen; i++ )
- {
- n += _ksba_ber_count_tl (TYPE_INTEGER, CLASS_UNIVERSAL, 0,
- parm[idxtbl[i]].valuelen);
- n += parm[idxtbl[i]].valuelen;
- }
-
- n1 = 1; /* # of unused bits. */
- if (idxtbllen > 1)
- n1 += _ksba_ber_count_tl (TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, n);
- n1 += n;
-
- /* Write the bit string header and the number of unused bits. */
- err = _ksba_ber_write_tl (writer, TYPE_BIT_STRING, CLASS_UNIVERSAL,
- 0, n1);
- if (!err)
- err = ksba_writer_write (writer, "", 1);
- if (err)
- goto leave;
-
- /* Write the sequence tag and the integers. */
- if (idxtbllen > 1)
- err = _ksba_ber_write_tl (writer, TYPE_SEQUENCE, CLASS_UNIVERSAL, 1,n);
- if (err)
- goto leave;
- for (i=0; i < idxtbllen; i++)
+ /* We only support the namedCurve choice for ECC parameters. */
+ if (!curve_oid)
{
- /* fixme: we should make sure that the integer conforms to the
- ASN.1 encoding rules. */
- err = _ksba_ber_write_tl (writer, TYPE_INTEGER, CLASS_UNIVERSAL, 0,
- parm[idxtbl[i]].valuelen);
- if (!err)
- err = ksba_writer_write (writer, parm[idxtbl[i]].value,
- parm[idxtbl[i]].valuelen);
- if (err)
- goto leave;
+ err = gpg_error (GPG_ERR_UNKNOWN_CURVE);
+ goto leave;
}
+ _ksba_der_add_oid (dbld, curve_oid);
}
-
- /* Get the encoded bit string. */
- bitstr_value = ksba_writer_snatch_mem (writer, &bitstr_len);
- if (!bitstr_value)
+ else if (pkalgo == PKALGO_RSA)
{
- err = gpg_error (GPG_ERR_ENOMEM);
- goto leave;
+ _ksba_der_add_ptr (dbld, 0, TYPE_NULL, NULL, 0);
}
- /* If the algorithmIdentifier requires a sequence with parameters,
- build them now. We can reuse the IDXTBL for that. */
- if (algoparmdesc)
+ _ksba_der_add_end (dbld); /* sequence. */
+
+ /* Add the bit string if we are not in algoinfomode. */
+ if (!algoinfomode)
{
- idxtbllen = 0;
- for (s = algoparmdesc; *s; s++)
+ if (*parmdesc == 'q' && !parmdesc[1])
{
+ /* This is ECC - Q is directly written as a bit string. */
for (i=0; i < parmidx; i++)
+ if (parm[i].namelen == 1 && parm[i].name[0] == 'q')
+ {
+ if ((parm[i].valuelen & 1) && parm[i].valuelen > 32
+ && (parm[i].value[0] == 0x40
+ || parm[i].value[0] == 0x41
+ || parm[i].value[0] == 0x42))
+ {
+ /* Odd length and prefixed with 0x40 - this is the
+ * rfc4880bis indicator octet for extended point
+ * formats - we may not emit that octet here. */
+ _ksba_der_add_bts (dbld, parm[i].value+1,
+ parm[i].valuelen-1, 0);
+ }
+ else
+ _ksba_der_add_bts (dbld, parm[i].value, parm[i].valuelen, 0);
+ break;
+ }
+ }
+ else /* Non-ECC - embed the values. */
+ {
+ dbld2 = _ksba_der_builder_new (10);
+ if (!dbld2)
{
- assert (idxtbllen < DIM (idxtbl));
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
+
+ /* Note that no sequence is used if only one integer is written. */
+ if (parmdesc[0] && parmdesc[1])
+ _ksba_der_add_tag (dbld2, 0, TYPE_SEQUENCE);
+
+ for (s = parmdesc; *s; s++)
+ for (i=0; i < parmidx; i++)
if (parm[i].namelen == 1 && parm[i].name[0] == *s)
{
- idxtbl[idxtbllen++] = i;
- break;
+ _ksba_der_add_int (dbld2, parm[i].value, parm[i].valuelen, 1);
+ break; /* inner loop */
}
- }
- }
- if (idxtbllen != strlen (algoparmdesc))
- return gpg_error (GPG_ERR_UNKNOWN_SEXP);
-
- err = ksba_writer_set_mem (writer, 1024);
- if (err)
- goto leave;
- /* Calculate the size of the sequence. */
- for (n=0, i=0; i < idxtbllen; i++ )
- {
- n += _ksba_ber_count_tl (TYPE_INTEGER, CLASS_UNIVERSAL, 0,
- parm[idxtbl[i]].valuelen);
- n += parm[idxtbl[i]].valuelen;
- }
- /* n += _ksba_ber_count_tl (TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, n); */
+ if (parmdesc[0] && parmdesc[1])
+ _ksba_der_add_end (dbld2);
- /* Write the sequence tag followed by the integers. */
- err = _ksba_ber_write_tl (writer, TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, n);
- if (err)
- goto leave;
- for (i=0; i < idxtbllen; i++)
- {
- err = _ksba_ber_write_tl (writer, TYPE_INTEGER, CLASS_UNIVERSAL, 0,
- parm[idxtbl[i]].valuelen);
- if (!err)
- err = ksba_writer_write (writer, parm[idxtbl[i]].value,
- parm[idxtbl[i]].valuelen);
+ err = _ksba_der_builder_get (dbld2, &tmpder, &tmpderlen);
if (err)
goto leave;
+ _ksba_der_add_bts (dbld, tmpder, tmpderlen, 0);
+ xfree (tmpder);
}
- /* Get the encoded sequence. */
- algoparmseq_value = ksba_writer_snatch_mem (writer, &algoparmseq_len);
- if (!algoparmseq_value)
- {
- err = gpg_error (GPG_ERR_ENOMEM);
- goto leave;
- }
- }
- else
- algoparmseq_len = 0;
-
- /* Reinitialize the buffer to create the outer sequence. */
- err = ksba_writer_set_mem (writer, 1024);
- if (err)
- goto leave;
-
- /* Calulate lengths. */
- n = _ksba_ber_count_tl (TYPE_OBJECT_ID, CLASS_UNIVERSAL, 0, oidlen);
- n += oidlen;
- if (algoparmseq_len)
- {
- n += algoparmseq_len;
- }
- else if (pkalgo == PKALGO_ECC)
- {
- n += _ksba_ber_count_tl (TYPE_OBJECT_ID, CLASS_UNIVERSAL,
- 0, curve_oidlen);
- n += curve_oidlen;
- }
- else if (pkalgo == PKALGO_RSA)
- {
- n += _ksba_ber_count_tl (TYPE_NULL, CLASS_UNIVERSAL, 0, 0);
- }
-
- n1 = n;
- n1 += _ksba_ber_count_tl (TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, n);
- n1 += bitstr_len;
-
- /* The outer sequence. */
- err = _ksba_ber_write_tl (writer, TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, n1);
- if (err)
- goto leave;
-
- /* The sequence. */
- err = _ksba_ber_write_tl (writer, TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, n);
- if (err)
- goto leave;
-
- /* The object id. */
- err = _ksba_ber_write_tl (writer, TYPE_OBJECT_ID,CLASS_UNIVERSAL, 0, oidlen);
- if (!err)
- err = ksba_writer_write (writer, oid, oidlen);
- if (err)
- goto leave;
-
- /* The parameter. */
- if (algoparmseq_len)
- {
- err = ksba_writer_write (writer, algoparmseq_value, algoparmseq_len);
- }
- else if (pkalgo == PKALGO_ECC)
- {
- err = _ksba_ber_write_tl (writer, TYPE_OBJECT_ID, CLASS_UNIVERSAL,
- 0, curve_oidlen);
- if (!err)
- err = ksba_writer_write (writer, curve_oid, curve_oidlen);
- }
- else if (pkalgo == PKALGO_RSA)
- {
- err = _ksba_ber_write_tl (writer, TYPE_NULL, CLASS_UNIVERSAL, 0, 0);
+ _ksba_der_add_end (dbld); /* Outer sequence. */
}
- if (err)
- goto leave;
-
- /* Append the pre-constructed bit string. */
- err = ksba_writer_write (writer, bitstr_value, bitstr_len);
- if (err)
- goto leave;
/* Get the result. */
- *r_der = ksba_writer_snatch_mem (writer, r_derlen);
- if (!*r_der)
- err = gpg_error (GPG_ERR_ENOMEM);
+ err = _ksba_der_builder_get (dbld, r_der, r_derlen);
leave:
- ksba_writer_release (writer);
- xfree (bitstr_value);
+ _ksba_der_release (dbld2);
+ _ksba_der_release (dbld);
xfree (curve_oid);
return err;
}
-/* Take a sig-val s-expression and convert it into a DER encoded
- algorithmInfo. Unfortunately this function clones a lot of code
- from _ksba_keyinfo_from_sexp. */
+/* Helper function to parse the parameters used for rsaPSS.
+ * Given this sample DER object in (DER,DERLEN):
+ *
+ * SEQUENCE {
+ * [0] {
+ * SEQUENCE {
+ * OBJECT IDENTIFIER sha-512 (2 16 840 1 101 3 4 2 3)
+ * }
+ * }
+ * [1] {
+ * SEQUENCE {
+ * OBJECT IDENTIFIER pkcs1-MGF (1 2 840 113549 1 1 8)
+ * SEQUENCE {
+ * OBJECT IDENTIFIER sha-512 (2 16 840 1 101 3 4 2 3)
+ * }
+ * }
+ * }
+ * [2] {
+ * INTEGER 64
+ * }
+ * }
+ *
+ * The function returns the first OID at R_PSSHASH and the salt length
+ * at R_SALTLEN. If the salt length is missing its default value is
+ * returned. In case object does not resemble a the expected rsaPSS
+ * parameters GPG_ERR_INV_OBJ is returned; other errors are returned
+ * for an syntatically invalid object. On error NULL is stored at
+ * R_PSSHASH.
+ */
gpg_error_t
-_ksba_algoinfo_from_sexp (ksba_const_sexp_t sexp,
- unsigned char **r_der, size_t *r_derlen)
+_ksba_keyinfo_get_pss_info (const unsigned char *der, size_t derlen,
+ char **r_psshash, unsigned int *r_saltlen)
{
gpg_error_t err;
- const unsigned char *s;
- char *endp;
- unsigned long n;
- const unsigned char *oid;
- int oidlen;
- unsigned char *curve_oid = NULL;
- size_t curve_oidlen;
- pkalgo_t pkalgo;
- int i;
- struct {
- const char *name;
- int namelen;
- const unsigned char *value;
- int valuelen;
- } parm[10];
- int parmidx;
- int idxtbl[10];
- int idxtbllen;
- const char *parmdesc, *algoparmdesc;
- ksba_writer_t writer = NULL;
- void *algoparmseq_value = NULL;
- size_t algoparmseq_len;
-
- if (!sexp)
- return gpg_error (GPG_ERR_INV_VALUE);
-
- s = sexp;
- if (*s != '(')
- return gpg_error (GPG_ERR_INV_SEXP);
- s++;
-
- n = strtoul (s, &endp, 10);
- s = endp;
- if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP); /* We don't allow empty lengths. */
- s++;
- if (n == 7 && !memcmp (s, "sig-val", 7))
- s += 7;
- else if (n == 10 && !memcmp (s, "public-key", 10))
- s += 10;
- else
- return gpg_error (GPG_ERR_UNKNOWN_SEXP);
-
- if (*s != '(')
- return gpg_error (digitp (s)? GPG_ERR_UNKNOWN_SEXP : GPG_ERR_INV_SEXP);
- s++;
-
- /* Break out the algorithm ID */
- n = strtoul (s, &endp, 10);
- s = endp;
- if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP); /* We don't allow empty lengths. */
- s++;
- oid = oid_from_buffer (s, n, &oidlen, &pkalgo, 1);
- if (!oid)
- return gpg_error (GPG_ERR_UNSUPPORTED_ALGORITHM);
- s += n;
-
- /* Collect all the values */
- for (parmidx = 0; *s != ')' ; parmidx++)
- {
- if (parmidx >= DIM(parm))
- return gpg_error (GPG_ERR_GENERAL);
- if (*s != '(')
- return gpg_error (digitp(s)? GPG_ERR_UNKNOWN_SEXP:GPG_ERR_INV_SEXP);
- s++;
- n = strtoul (s, &endp, 10);
- s = endp;
- if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP);
- s++;
- parm[parmidx].name = s;
- parm[parmidx].namelen = n;
- s += n;
- if (!digitp(s))
- return gpg_error (GPG_ERR_UNKNOWN_SEXP); /* ... or invalid S-Exp. */
-
- n = strtoul (s, &endp, 10);
- s = endp;
- if (!n || *s != ':')
- return gpg_error (GPG_ERR_INV_SEXP);
- s++;
- parm[parmidx].value = s;
- parm[parmidx].valuelen = n;
- s += n;
- if ( *s != ')')
- return gpg_error (GPG_ERR_UNKNOWN_SEXP); /* ... or invalid S-Exp. */
- s++;
- }
- s++;
- /* We need another closing parenthesis. */
- if ( *s != ')' )
- return gpg_error (GPG_ERR_INV_SEXP);
+ struct tag_info ti;
+ char *psshash = NULL;
+ char *tmpoid = NULL;
+ unsigned int saltlen;
- /* Describe the parameters in the order we want them and construct
- IDXTBL to access them. For DSA wie also set algoparmdesc so
- that we can later build the parameters for the
- algorithmIdentifier. */
- algoparmdesc = NULL;
- switch (pkalgo)
- {
- case PKALGO_RSA: parmdesc = ""; break;
- case PKALGO_DSA: parmdesc = "" ; algoparmdesc = "pqg"; break;
- case PKALGO_ECC: parmdesc = "C"; break;
- default: return gpg_error (GPG_ERR_UNKNOWN_ALGORITHM);
- }
-
- idxtbllen = 0;
- for (s = parmdesc; *s; s++)
- {
- for (i=0; i < parmidx; i++)
- {
- assert (idxtbllen < DIM (idxtbl));
- switch (*s)
- {
- case 'C': /* Magic value for "curve". */
- if (parm[i].namelen == 5 && !memcmp (parm[i].name, "curve", 5))
- {
- idxtbl[idxtbllen++] = i;
- i = parmidx; /* Break inner loop. */
- }
- break;
- default:
- if (parm[i].namelen == 1 && parm[i].name[0] == *s)
- {
- idxtbl[idxtbllen++] = i;
- i = parmidx; /* Break inner loop. */
- }
- break;
- }
- }
- }
- if (idxtbllen != strlen (parmdesc))
- return gpg_error (GPG_ERR_UNKNOWN_SEXP);
+ *r_psshash = NULL;
+ *r_saltlen = 0;
- if (pkalgo == PKALGO_ECC)
- {
- curve_oid = get_ecc_curve_oid (parm[idxtbl[0]].value,
- parm[idxtbl[0]].valuelen,
- &curve_oidlen);
- if (!curve_oid)
- return gpg_error (GPG_ERR_UNKNOWN_SEXP);
- }
+ err = parse_sequence (&der, &derlen, &ti);
+ if (err)
+ goto leave;
+ /* Get the hash algo. */
+ err = parse_context_tag (&der, &derlen, &ti, 0);
+ if (err)
+ goto unknown_parms;
+ err = parse_sequence (&der, &derlen, &ti);
+ if (err)
+ goto unknown_parms;
+ err = parse_object_id_into_str (&der, &derlen, &psshash);
+ if (err)
+ goto unknown_parms;
+ err = parse_optional_null (&der, &derlen, NULL);
+ if (err)
+ goto unknown_parms;
- /* Create write object. */
- err = ksba_writer_new (&writer);
+ /* Check the MGF OID and that its hash algo matches. */
+ err = parse_context_tag (&der, &derlen, &ti, 1);
+ if (err)
+ goto unknown_parms;
+ err = parse_sequence (&der, &derlen, &ti);
if (err)
goto leave;
- err = ksba_writer_set_mem (writer, 1024);
+ err = parse_object_id_into_str (&der, &derlen, &tmpoid);
+ if (err)
+ goto unknown_parms;
+ if (strcmp (tmpoid, "1.2.840.113549.1.1.8")) /* MGF1 */
+ goto unknown_parms;
+ err = parse_sequence (&der, &derlen, &ti);
if (err)
goto leave;
-
- /* Create the sequence of the algorithm identifier. */
-
- /* If the algorithmIdentifier requires a sequence with parameters,
- build them now. We can reuse the IDXTBL for that. */
- if (algoparmdesc)
+ xfree (tmpoid);
+ err = parse_object_id_into_str (&der, &derlen, &tmpoid);
+ if (err)
+ goto unknown_parms;
+ if (strcmp (tmpoid, psshash))
+ goto unknown_parms;
+ err = parse_optional_null (&der, &derlen, NULL);
+ if (err)
+ goto unknown_parms;
+
+ /* Get the optional saltLength. */
+ err = parse_context_tag (&der, &derlen, &ti, 2);
+ if (gpg_err_code (err) == GPG_ERR_INV_OBJ
+ || gpg_err_code (err) == GPG_ERR_FALSE)
+ saltlen = 20; /* Optional element - use default value */
+ else if (err)
+ goto unknown_parms;
+ else
{
- idxtbllen = 0;
- for (s = algoparmdesc; *s; s++)
- {
- for (i=0; i < parmidx; i++)
- {
- assert (idxtbllen < DIM (idxtbl));
- if (parm[i].namelen == 1 && parm[i].name[0] == *s)
- {
- idxtbl[idxtbllen++] = i;
- break;
- }
- }
- }
- if (idxtbllen != strlen (algoparmdesc))
- return gpg_error (GPG_ERR_UNKNOWN_SEXP);
-
- err = ksba_writer_set_mem (writer, 1024);
+ err = parse_integer (&der, &derlen, &ti);
if (err)
goto leave;
-
- /* Calculate the size of the sequence. */
- for (n=0, i=0; i < idxtbllen; i++ )
- {
- n += _ksba_ber_count_tl (TYPE_INTEGER, CLASS_UNIVERSAL, 0,
- parm[idxtbl[i]].valuelen);
- n += parm[idxtbl[i]].valuelen;
- }
-
- /* Write the sequence tag followed by the integers. */
- err = _ksba_ber_write_tl (writer, TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, n);
- if (err)
- goto leave;
- for (i=0; i < idxtbllen; i++)
- {
- err = _ksba_ber_write_tl (writer, TYPE_INTEGER, CLASS_UNIVERSAL, 0,
- parm[idxtbl[i]].valuelen);
- if (!err)
- err = ksba_writer_write (writer, parm[idxtbl[i]].value,
- parm[idxtbl[i]].valuelen);
- if (err)
- goto leave;
- }
-
- /* Get the encoded sequence. */
- algoparmseq_value = ksba_writer_snatch_mem (writer, &algoparmseq_len);
- if (!algoparmseq_value)
+ for (saltlen=0; ti.length; ti.length--)
{
- err = gpg_error (GPG_ERR_ENOMEM);
- goto leave;
+ saltlen <<= 8;
+ saltlen |= (*der++) & 0xff;
+ derlen--;
}
}
- else
- algoparmseq_len = 0;
-
- /* Reinitialize the buffer to create the sequence. */
- err = ksba_writer_set_mem (writer, 1024);
- if (err)
- goto leave;
-
- /* Calulate lengths. */
- n = _ksba_ber_count_tl (TYPE_OBJECT_ID, CLASS_UNIVERSAL, 0, oidlen);
- n += oidlen;
- if (algoparmseq_len)
- {
- n += algoparmseq_len;
- }
- else if (pkalgo == PKALGO_ECC)
- {
- n += _ksba_ber_count_tl (TYPE_OBJECT_ID, CLASS_UNIVERSAL,
- 0, curve_oidlen);
- n += curve_oidlen;
- }
- else if (pkalgo == PKALGO_RSA)
- {
- n += _ksba_ber_count_tl (TYPE_NULL, CLASS_UNIVERSAL, 0, 0);
- }
-
- /* Write the sequence. */
- err = _ksba_ber_write_tl (writer, TYPE_SEQUENCE, CLASS_UNIVERSAL, 1, n);
- if (err)
- goto leave;
-
- /* Write the object id. */
- err = _ksba_ber_write_tl (writer, TYPE_OBJECT_ID, CLASS_UNIVERSAL, 0, oidlen);
- if (!err)
- err = ksba_writer_write (writer, oid, oidlen);
- if (err)
- goto leave;
- /* Write the parameters. */
- if (algoparmseq_len)
- {
- err = ksba_writer_write (writer, algoparmseq_value, algoparmseq_len);
- }
- else if (pkalgo == PKALGO_ECC)
- {
- /* We only support the namedCuve choice for ECC parameters. */
- err = _ksba_ber_write_tl (writer, TYPE_OBJECT_ID, CLASS_UNIVERSAL,
- 0, curve_oidlen);
- if (!err)
- err = ksba_writer_write (writer, curve_oid, curve_oidlen);
- }
- else if (pkalgo == PKALGO_RSA)
- {
- err = _ksba_ber_write_tl (writer, TYPE_NULL, CLASS_UNIVERSAL, 0, 0);
- }
- if (err)
- goto leave;
+ /* All fine. */
+ *r_psshash = psshash;
+ psshash = NULL;
+ *r_saltlen = saltlen;
+ err = 0;
+ goto leave;
- /* Get the result. */
- *r_der = ksba_writer_snatch_mem (writer, r_derlen);
- if (!*r_der)
- err = gpg_error (GPG_ERR_ENOMEM);
+ unknown_parms:
+ err = gpg_error (GPG_ERR_INV_OBJ);
leave:
- ksba_writer_release (writer);
- xfree (curve_oid);
+ xfree (psshash);
+ xfree (tmpoid);
return err;
}
-
/* Mode 0: work as described under _ksba_sigval_to_sexp
- mode 1: work as described under _ksba_encval_to_sexp */
+ * mode 1: work as described under _ksba_encval_to_sexp
+ * mode 2: same as mode 1 but for ECDH; in this mode
+ * KEYENCRYALO, KEYWRAPALGO, ENCRKEY, ENCRYKLEYLEN
+ * are also required.
+ */
static gpg_error_t
cryptval_to_sexp (int mode, const unsigned char *der, size_t derlen,
+ const char *keyencralgo, const char *keywrapalgo,
+ const void *encrkey, size_t encrkeylen,
ksba_sexp_t *r_string)
{
gpg_error_t err;
@@ -1606,6 +1362,10 @@ cryptval_to_sexp (int mode, const unsigned char *der, size_t derlen,
const unsigned char *ctrl;
const char *elem;
struct stringbuf sb;
+ size_t parm_off, parm_len;
+ int parm_type;
+ char *pss_hash = NULL;
+ unsigned int salt_length = 0;
/* FIXME: The entire function is very similar to keyinfo_to_sexp */
*r_string = NULL;
@@ -1615,9 +1375,8 @@ cryptval_to_sexp (int mode, const unsigned char *der, size_t derlen,
else
algo_table = enc_algo_table;
-
err = get_algorithm (1, der, derlen, &nread, &off, &len, &is_bitstr,
- NULL, NULL, NULL);
+ &parm_off, &parm_len, &parm_type);
if (err)
return err;
@@ -1628,11 +1387,27 @@ cryptval_to_sexp (int mode, const unsigned char *der, size_t derlen,
&& !memcmp (der+off, algo_table[algoidx].oid, len))
break;
}
+
if (!algo_table[algoidx].oid)
return gpg_error (GPG_ERR_UNKNOWN_ALGORITHM);
if (!algo_table[algoidx].supported)
return gpg_error (GPG_ERR_UNSUPPORTED_ALGORITHM);
+ if (parm_type == TYPE_SEQUENCE
+ && algo_table[algoidx].supported == SUPPORTED_RSAPSS)
+ {
+ /* This is rsaPSS and we collect the parameters. We simplify
+ * this by assuming that pkcs1-MGF is used with an identical
+ * hash algorithm. All other kinds of parameters are ignored. */
+ err = _ksba_keyinfo_get_pss_info (der + parm_off, parm_len,
+ &pss_hash, &salt_length);
+ if (gpg_err_code (err) == GPG_ERR_INV_OBJ)
+ err = 0;
+ if (err)
+ return err;
+ }
+
+
der += nread;
derlen -= nread;
@@ -1655,40 +1430,62 @@ cryptval_to_sexp (int mode, const unsigned char *der, size_t derlen,
/* FIXME: We don't release the stringbuf in case of error
better let the macro jump to a label */
- elem = algo_table[algoidx].elem_string;
- ctrl = algo_table[algoidx].ctrl_string;
- for (; *elem; ctrl++, elem++)
+ if (!mode && (algo_table[algoidx].pkalgo == PKALGO_ED25519
+ ||algo_table[algoidx].pkalgo == PKALGO_ED448))
{
- int is_int;
-
- if ( (*ctrl & 0x80) && !elem[1] )
- { /* Hack to allow a raw value */
- is_int = 1;
- len = derlen;
- }
- else
+ /* EdDSA is special: R and S are simply concatenated; see rfc8410. */
+ put_stringbuf (&sb, "(1:r");
+ put_stringbuf_mem_sexp (&sb, der, derlen/2);
+ put_stringbuf (&sb, ")");
+ der += derlen/2;
+ derlen /= 2;
+ put_stringbuf (&sb, "(1:s");
+ put_stringbuf_mem_sexp (&sb, der, derlen);
+ put_stringbuf (&sb, ")");
+ }
+ else
+ {
+ elem = algo_table[algoidx].elem_string;
+ ctrl = algo_table[algoidx].ctrl_string;
+ for (; *elem; ctrl++, elem++)
{
- if (!derlen)
- return gpg_error (GPG_ERR_INV_KEYINFO);
- c = *der++; derlen--;
- if ( c != *ctrl )
- return gpg_error (GPG_ERR_UNEXPECTED_TAG);
- is_int = c == 0x02;
- TLV_LENGTH (der);
- }
- if (is_int && *elem != '-')
- { /* take this integer */
- char tmp[2];
+ int is_int;
- put_stringbuf (&sb, "(");
- tmp[0] = *elem; tmp[1] = 0;
- put_stringbuf_sexp (&sb, tmp);
- put_stringbuf_mem_sexp (&sb, der, len);
- der += len;
- derlen -= len;
- put_stringbuf (&sb, ")");
+ if ( (*ctrl & 0x80) && !elem[1] )
+ { /* Hack to allow a raw value */
+ is_int = 1;
+ len = derlen;
+ }
+ else
+ {
+ if (!derlen)
+ return gpg_error (GPG_ERR_INV_KEYINFO);
+ c = *der++; derlen--;
+ if ( c != *ctrl )
+ return gpg_error (GPG_ERR_UNEXPECTED_TAG);
+ is_int = c == 0x02;
+ TLV_LENGTH (der);
+ }
+ if (is_int && *elem != '-')
+ { /* take this integer */
+ char tmp[2];
+
+ put_stringbuf (&sb, "(");
+ tmp[0] = *elem; tmp[1] = 0;
+ put_stringbuf_sexp (&sb, tmp);
+ put_stringbuf_mem_sexp (&sb, der, len);
+ der += len;
+ derlen -= len;
+ put_stringbuf (&sb, ")");
+ }
}
}
+ if (mode == 2) /* ECDH */
+ {
+ put_stringbuf (&sb, "(1:s");
+ put_stringbuf_mem_sexp (&sb, encrkey, encrkeylen);
+ put_stringbuf (&sb, ")");
+ }
put_stringbuf (&sb, ")");
if (!mode && algo_table[algoidx].digest_string)
{
@@ -1697,12 +1494,31 @@ cryptval_to_sexp (int mode, const unsigned char *der, size_t derlen,
put_stringbuf_sexp (&sb, algo_table[algoidx].digest_string);
put_stringbuf (&sb, ")");
}
+ if (!mode && pss_hash)
+ {
+ put_stringbuf (&sb, "(5:flags3:pss)");
+ put_stringbuf (&sb, "(9:hash-algo");
+ put_stringbuf_sexp (&sb, pss_hash);
+ put_stringbuf (&sb, ")");
+ put_stringbuf (&sb, "(11:salt-length");
+ put_stringbuf_uint (&sb, salt_length);
+ put_stringbuf (&sb, ")");
+ }
+ if (mode == 2) /* ECDH */
+ {
+ put_stringbuf (&sb, "(9:encr-algo");
+ put_stringbuf_sexp (&sb, keyencralgo);
+ put_stringbuf (&sb, ")(9:wrap-algo");
+ put_stringbuf_sexp (&sb, keywrapalgo);
+ put_stringbuf (&sb, ")");
+ }
put_stringbuf (&sb, ")");
*r_string = get_stringbuf (&sb);
if (!*r_string)
return gpg_error (GPG_ERR_ENOMEM);
+ xfree (pss_hash);
return 0;
}
@@ -1732,35 +1548,86 @@ gpg_error_t
_ksba_sigval_to_sexp (const unsigned char *der, size_t derlen,
ksba_sexp_t *r_string)
{
- return cryptval_to_sexp (0, der, derlen, r_string);
+ return cryptval_to_sexp (0, der, derlen, NULL, NULL, NULL, 0, r_string);
}
/* Assume that der is a buffer of length DERLEN with a DER encoded
- Asn.1 structure like this:
-
- SEQUENCE {
- algorithm OBJECT IDENTIFIER,
- parameters ANY DEFINED BY algorithm OPTIONAL }
- encryptedKey OCTET STRING
-
- We only allow parameters == NULL.
-
- The function parses this structure and creates a S-Exp suitable to be
- used as encrypted value in Libgcrypt's public key functions:
-
- (enc-val
- (<algo>
- (<param_name1> <mpi>)
- ...
- (<param_namen> <mpi>)
- ))
-
- The S-Exp will be returned in a string which the caller must free.
- We don't pass an ASN.1 node here but a plain memory block. */
+ * ASN.1 structure like this:
+ *
+ * SEQUENCE {
+ * algorithm OBJECT IDENTIFIER,
+ * parameters ANY DEFINED BY algorithm OPTIONAL
+ * }
+ * encryptedKey OCTET STRING
+ *
+ * The function parses this structure and creates a S-expression
+ * suitable to be used as encrypted value in Libgcrypt's public key
+ * functions:
+ *
+ * (enc-val
+ * (<algo>
+ * (<param_name1> <mpi>)
+ * ...
+ * (<param_namen> <mpi>)
+ * ))
+ *
+ * The S-expression will be returned in a string which the caller must
+ * free. Note that the input buffer may not a proper ASN.1 object but
+ * a plain memory block; this is becuase the SEQUENCE is followed by
+ * an OCTET STRING or BIT STRING.
+ */
gpg_error_t
_ksba_encval_to_sexp (const unsigned char *der, size_t derlen,
ksba_sexp_t *r_string)
{
- return cryptval_to_sexp (1, der, derlen, r_string);
+ return cryptval_to_sexp (1, der, derlen, NULL, NULL, NULL, 0, r_string);
+}
+
+
+/* Assume that der is a buffer of length DERLEN with a DER encoded
+ * ASN.1 structure like this:
+ *
+ * [1] {
+ * SEQUENCE {
+ * algorithm OBJECT IDENTIFIER,
+ * parameters ANY DEFINED BY algorithm OPTIONAL
+ * }
+ * encryptedKey BIT STRING
+ * }
+ *
+ * The function parses this structure and creates an S-expression
+ * conveying all parameters required for ECDH:
+ *
+ * (enc-val
+ * (ecdh
+ * (e <octetstring>)
+ * (s <octetstring>)
+ * (ukm <octetstring>)
+ * (encr-algo <oid>)
+ * (wrap-algo <oid>)))
+ *
+ * E is the ephemeral public key and S is the encrypted key. The user
+ * keying material (ukm) is optional. The S-expression will be
+ * returned in a string which the caller must free.
+ */
+gpg_error_t
+_ksba_encval_kari_to_sexp (const unsigned char *der, size_t derlen,
+ const char *keyencralgo, const char *keywrapalgo,
+ const void *enckey, size_t enckeylen,
+ ksba_sexp_t *r_string)
+{
+ gpg_error_t err;
+ struct tag_info ti;
+ size_t save_derlen = derlen;
+
+ err = parse_context_tag (&der, &derlen, &ti, 1);
+ if (err)
+ return err;
+ if (save_derlen < ti.nhdr)
+ return gpg_error (GPG_ERR_INV_BER);
+ derlen = save_derlen - ti.nhdr;
+ return cryptval_to_sexp (2, der, derlen,
+ keyencralgo, keywrapalgo, enckey, enckeylen,
+ r_string);
}
diff --git a/src/keyinfo.h b/src/keyinfo.h
index a9c1b30..66f5805 100644
--- a/src/keyinfo.h
+++ b/src/keyinfo.h
@@ -49,17 +49,27 @@ gpg_error_t _ksba_keyinfo_to_sexp (const unsigned char *der, size_t derlen,
ksba_sexp_t *r_string)
_KSBA_VISIBILITY_DEFAULT;
-gpg_error_t _ksba_keyinfo_from_sexp (ksba_const_sexp_t sexp,
+gpg_error_t _ksba_keyinfo_from_sexp (ksba_const_sexp_t sexp, int algoinfomode,
unsigned char **r_der, size_t *r_derlen)
_KSBA_VISIBILITY_DEFAULT;
gpg_error_t _ksba_algoinfo_from_sexp (ksba_const_sexp_t sexp,
unsigned char **r_der, size_t *r_derlen);
+gpg_error_t _ksba_keyinfo_get_pss_info (const unsigned char *der,
+ size_t derlen,
+ char **r_psshash,
+ unsigned int *r_saltlen);
+
gpg_error_t _ksba_sigval_to_sexp (const unsigned char *der, size_t derlen,
ksba_sexp_t *r_string);
gpg_error_t _ksba_encval_to_sexp (const unsigned char *der, size_t derlen,
ksba_sexp_t *r_string);
+gpg_error_t _ksba_encval_kari_to_sexp (const unsigned char *der, size_t derlen,
+ const char *keyencralgo,
+ const char *keywrapalgo,
+ const void *enckey, size_t enckeylen,
+ ksba_sexp_t *r_string);
int _ksba_node_with_oid_to_digest_algo (const unsigned char *image,
AsnNode node);
diff --git a/src/ksba-config.in b/src/ksba-config.in
index 55f4fcb..76d038d 100644
--- a/src/ksba-config.in
+++ b/src/ksba-config.in
@@ -71,8 +71,17 @@ while test $# -gt 0; do
--exec-prefix)
echo_exec_prefix=yes
;;
- --version)
- echo "@VERSION@"
+ --variable=*)
+ case "${1#*=}" in
+ prefix) echo "$prefix" ;;
+ exec_prefix) echo "$exec_prefix" ;;
+ host) echo "$my_host" ;;
+ api_version) echo "$api_version" ;;
+ esac
+ exit 0
+ ;;
+ --modversion|--version)
+ echo "@PACKAGE_VERSION@"
exit 0
;;
--api-version)
diff --git a/src/ksba.h b/src/ksba.h
index 955dc06..3c12ba3 100644
--- a/src/ksba.h
+++ b/src/ksba.h
@@ -1,6 +1,6 @@
/* ksba.h - X.509 library used by GnuPG
* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2011
- * 2012, 2013, 2104, 2015 g10 Code GmbH
+ * 2012, 2013, 2104, 2015, 2019 g10 Code GmbH
*
* This file is part of KSBA.
*
@@ -42,6 +42,16 @@ extern "C" {
#endif
#endif
+/* The version of this header should match the one of the library. Do
+ * not use this symbol in your application; use assuan_check_version
+ * instead. */
+#define KSBA_VERSION "1.4.0"
+
+/* The version number of this header. It may be used to handle minor
+ * API incompatibilities. */
+#define KSBA_VERSION_NUMBER 0x010400
+
+
/* Check for compiler features. */
#ifdef __GNUC__
@@ -58,6 +68,50 @@ extern "C" {
#endif
+#define KSBA_CLASS_UNIVERSAL 0
+#define KSBA_CLASS_APPLICATION 1
+#define KSBA_CLASS_CONTEXT 2
+#define KSBA_CLASS_PRIVATE 3
+#define KSBA_CLASS_ENCAPSULATE 0x80 /* Pseudo class. */
+
+#define KSBA_TYPE_BOOLEAN 1
+#define KSBA_TYPE_INTEGER 2
+#define KSBA_TYPE_BIT_STRING 3
+#define KSBA_TYPE_OCTET_STRING 4
+#define KSBA_TYPE_NULL 5
+#define KSBA_TYPE_OBJECT_ID 6
+#define KSBA_TYPE_OBJECT_DESCRIPTOR 7
+#define KSBA_TYPE_EXTERNAL 8
+#define KSBA_TYPE_REAL 9
+#define KSBA_TYPE_ENUMERATED 10
+#define KSBA_TYPE_EMBEDDED_PDV 11
+#define KSBA_TYPE_UTF8_STRING 12
+#define KSBA_TYPE_RELATIVE_OID 13
+#define KSBA_TYPE_TIME 14
+#define KSBA_TYPE_SEQUENCE 16
+#define KSBA_TYPE_SET 17
+#define KSBA_TYPE_NUMERIC_STRING 18
+#define KSBA_TYPE_PRINTABLE_STRING 19
+#define KSBA_TYPE_TELETEX_STRING 20
+#define KSBA_TYPE_VIDEOTEX_STRING 21
+#define KSBA_TYPE_IA5_STRING 22
+#define KSBA_TYPE_UTC_TIME 23
+#define KSBA_TYPE_GENERALIZED_TIME 24
+#define KSBA_TYPE_GRAPHIC_STRING 25
+#define KSBA_TYPE_VISIBLE_STRING 26
+#define KSBA_TYPE_GENERAL_STRING 27
+#define KSBA_TYPE_UNIVERSAL_STRING 28
+#define KSBA_TYPE_CHARACTER_STRING 29
+#define KSBA_TYPE_BMP_STRING 30
+#define KSBA_TYPE_DATE 31
+#define KSBA_TYPE_TIME_OF_DAY 32
+#define KSBA_TYPE_DATE_TIME 33
+#define KSBA_TYPE_DURATION 34
+#define KSBA_TYPE_OID_IRI 35
+#define KSBA_TYPE_RELATIVE_OID_IRI 36
+
+
+
typedef gpg_error_t KsbaError _KSBA_DEPRECATED;
typedef enum
@@ -69,7 +123,8 @@ typedef enum
KSBA_CT_DIGESTED_DATA = 4,
KSBA_CT_ENCRYPTED_DATA = 5,
KSBA_CT_AUTH_DATA = 6,
- KSBA_CT_PKCS12 = 7
+ KSBA_CT_PKCS12 = 7,
+ KSBA_CT_SPC_IND_DATA_CTX = 8
}
ksba_content_type_t;
typedef ksba_content_type_t KsbaContentType _KSBA_DEPRECATED;
@@ -218,6 +273,11 @@ typedef const unsigned char *ksba_const_sexp_t;
typedef const unsigned char *KsbaConstSexp _KSBA_DEPRECATED;
+/* This is a generic object used by various functions. */
+struct ksba_der_s;
+typedef struct ksba_der_s *ksba_der_t;
+
+
/*-- cert.c --*/
gpg_error_t ksba_cert_new (ksba_cert_t *acert);
void ksba_cert_ref (ksba_cert_t cert);
@@ -527,6 +587,30 @@ const char *ksba_name_enum (ksba_name_t name, int idx);
char *ksba_name_get_uri (ksba_name_t name, int idx);
+/*-- der-builder.c --*/
+void ksba_der_release (ksba_der_t d);
+
+ksba_der_t ksba_der_builder_new (unsigned int nitems);
+void ksba_der_builder_reset (ksba_der_t d);
+
+void ksba_der_add_ptr (ksba_der_t d, int cls, int tag,
+ void *value, size_t valuelen);
+void ksba_der_add_val (ksba_der_t d, int cls, int tag,
+ const void *value, size_t valuelen);
+void ksba_der_add_int (ksba_der_t d, const void *value, size_t valuelen,
+ int force_positive);
+void ksba_der_add_oid (ksba_der_t d, const char *oidstr);
+void ksba_der_add_bts (ksba_der_t d, const void *value, size_t valuelen,
+ unsigned int unusedbits);
+void ksba_der_add_der (ksba_der_t d, const void *der, size_t derlen);
+void ksba_der_add_tag (ksba_der_t d, int cls, int tag);
+void ksba_der_add_end (ksba_der_t d);
+
+gpg_error_t ksba_der_builder_get (ksba_der_t d,
+ unsigned char **r_obj, size_t *r_objlen);
+
+
+
/*-- util.c --*/
void ksba_set_malloc_hooks ( void *(*new_alloc_func)(size_t n),
void *(*new_realloc_func)(void *p, size_t n),
diff --git a/src/ksba.h.in b/src/ksba.h.in
new file mode 100644
index 0000000..78efc81
--- /dev/null
+++ b/src/ksba.h.in
@@ -0,0 +1,637 @@
+/* ksba.h - X.509 library used by GnuPG
+ * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2010, 2011
+ * 2012, 2013, 2104, 2015, 2019 g10 Code GmbH
+ *
+ * This file is part of KSBA.
+ *
+ * KSBA is free software; you can redistribute it and/or modify
+ * it under the terms of either
+ *
+ * - the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * or
+ *
+ * - the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * or both in parallel, as here.
+ *
+ * KSBA 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 copies of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef KSBA_H
+#define KSBA_H 1
+
+#include <gpg-error.h>
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+ }
+#endif
+#endif
+
+/* The version of this header should match the one of the library. Do
+ * not use this symbol in your application; use assuan_check_version
+ * instead. */
+#define KSBA_VERSION "@VERSION@"
+
+/* The version number of this header. It may be used to handle minor
+ * API incompatibilities. */
+#define KSBA_VERSION_NUMBER @VERSION_NUMBER@
+
+
+
+/* Check for compiler features. */
+#ifdef __GNUC__
+#define _KSBA_GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+#if _KSBA_GCC_VERSION > 30100
+#define _KSBA_DEPRECATED __attribute__ ((__deprecated__))
+#endif
+#endif /*__GNUC__*/
+
+#ifndef _KSBA_DEPRECATED
+#define _KSBA_DEPRECATED
+#endif
+
+
+#define KSBA_CLASS_UNIVERSAL 0
+#define KSBA_CLASS_APPLICATION 1
+#define KSBA_CLASS_CONTEXT 2
+#define KSBA_CLASS_PRIVATE 3
+#define KSBA_CLASS_ENCAPSULATE 0x80 /* Pseudo class. */
+
+#define KSBA_TYPE_BOOLEAN 1
+#define KSBA_TYPE_INTEGER 2
+#define KSBA_TYPE_BIT_STRING 3
+#define KSBA_TYPE_OCTET_STRING 4
+#define KSBA_TYPE_NULL 5
+#define KSBA_TYPE_OBJECT_ID 6
+#define KSBA_TYPE_OBJECT_DESCRIPTOR 7
+#define KSBA_TYPE_EXTERNAL 8
+#define KSBA_TYPE_REAL 9
+#define KSBA_TYPE_ENUMERATED 10
+#define KSBA_TYPE_EMBEDDED_PDV 11
+#define KSBA_TYPE_UTF8_STRING 12
+#define KSBA_TYPE_RELATIVE_OID 13
+#define KSBA_TYPE_TIME 14
+#define KSBA_TYPE_SEQUENCE 16
+#define KSBA_TYPE_SET 17
+#define KSBA_TYPE_NUMERIC_STRING 18
+#define KSBA_TYPE_PRINTABLE_STRING 19
+#define KSBA_TYPE_TELETEX_STRING 20
+#define KSBA_TYPE_VIDEOTEX_STRING 21
+#define KSBA_TYPE_IA5_STRING 22
+#define KSBA_TYPE_UTC_TIME 23
+#define KSBA_TYPE_GENERALIZED_TIME 24
+#define KSBA_TYPE_GRAPHIC_STRING 25
+#define KSBA_TYPE_VISIBLE_STRING 26
+#define KSBA_TYPE_GENERAL_STRING 27
+#define KSBA_TYPE_UNIVERSAL_STRING 28
+#define KSBA_TYPE_CHARACTER_STRING 29
+#define KSBA_TYPE_BMP_STRING 30
+#define KSBA_TYPE_DATE 31
+#define KSBA_TYPE_TIME_OF_DAY 32
+#define KSBA_TYPE_DATE_TIME 33
+#define KSBA_TYPE_DURATION 34
+#define KSBA_TYPE_OID_IRI 35
+#define KSBA_TYPE_RELATIVE_OID_IRI 36
+
+
+
+typedef gpg_error_t KsbaError _KSBA_DEPRECATED;
+
+typedef enum
+ {
+ KSBA_CT_NONE = 0,
+ KSBA_CT_DATA = 1,
+ KSBA_CT_SIGNED_DATA = 2,
+ KSBA_CT_ENVELOPED_DATA = 3,
+ KSBA_CT_DIGESTED_DATA = 4,
+ KSBA_CT_ENCRYPTED_DATA = 5,
+ KSBA_CT_AUTH_DATA = 6,
+ KSBA_CT_PKCS12 = 7,
+ KSBA_CT_SPC_IND_DATA_CTX = 8
+ }
+ksba_content_type_t;
+typedef ksba_content_type_t KsbaContentType _KSBA_DEPRECATED;
+
+
+
+typedef enum
+ {
+ KSBA_SR_NONE = 0, /* Never seen by libksba user. */
+ KSBA_SR_RUNNING = 1, /* Never seen by libksba user. */
+ KSBA_SR_GOT_CONTENT = 2,
+ KSBA_SR_NEED_HASH = 3,
+ KSBA_SR_BEGIN_DATA = 4,
+ KSBA_SR_END_DATA = 5,
+ KSBA_SR_READY = 6,
+ KSBA_SR_NEED_SIG = 7,
+ KSBA_SR_DETACHED_DATA = 8,
+ KSBA_SR_BEGIN_ITEMS = 9,
+ KSBA_SR_GOT_ITEM = 10,
+ KSBA_SR_END_ITEMS = 11
+ }
+ksba_stop_reason_t;
+typedef ksba_stop_reason_t KsbaStopReason _KSBA_DEPRECATED;
+
+typedef enum
+ {
+ KSBA_CRLREASON_UNSPECIFIED = 1,
+ KSBA_CRLREASON_KEY_COMPROMISE = 2,
+ KSBA_CRLREASON_CA_COMPROMISE = 4,
+ KSBA_CRLREASON_AFFILIATION_CHANGED = 8,
+ KSBA_CRLREASON_SUPERSEDED = 16,
+ KSBA_CRLREASON_CESSATION_OF_OPERATION = 32,
+ KSBA_CRLREASON_CERTIFICATE_HOLD = 64,
+ KSBA_CRLREASON_REMOVE_FROM_CRL = 256,
+ KSBA_CRLREASON_PRIVILEGE_WITHDRAWN = 512,
+ KSBA_CRLREASON_AA_COMPROMISE = 1024,
+ KSBA_CRLREASON_OTHER = 32768
+ }
+ksba_crl_reason_t;
+typedef ksba_crl_reason_t KsbaCRLReason _KSBA_DEPRECATED;
+
+typedef enum
+ {
+ KSBA_OCSP_RSPSTATUS_SUCCESS = 0,
+ KSBA_OCSP_RSPSTATUS_MALFORMED = 1,
+ KSBA_OCSP_RSPSTATUS_INTERNAL = 2,
+ KSBA_OCSP_RSPSTATUS_TRYLATER = 3,
+ KSBA_OCSP_RSPSTATUS_SIGREQUIRED = 5,
+ KSBA_OCSP_RSPSTATUS_UNAUTHORIZED = 6,
+ KSBA_OCSP_RSPSTATUS_REPLAYED = 253,
+ KSBA_OCSP_RSPSTATUS_OTHER = 254,
+ KSBA_OCSP_RSPSTATUS_NONE = 255
+ }
+ksba_ocsp_response_status_t;
+
+typedef enum
+ {
+ KSBA_STATUS_NONE = 0,
+ KSBA_STATUS_UNKNOWN = 1,
+ KSBA_STATUS_GOOD = 2,
+ KSBA_STATUS_REVOKED = 4
+ }
+ksba_status_t;
+
+
+typedef enum
+ {
+ KSBA_KEYUSAGE_DIGITAL_SIGNATURE = 1,
+ KSBA_KEYUSAGE_NON_REPUDIATION = 2,
+ KSBA_KEYUSAGE_KEY_ENCIPHERMENT = 4,
+ KSBA_KEYUSAGE_DATA_ENCIPHERMENT = 8,
+ KSBA_KEYUSAGE_KEY_AGREEMENT = 16,
+ KSBA_KEYUSAGE_KEY_CERT_SIGN = 32,
+ KSBA_KEYUSAGE_CRL_SIGN = 64,
+ KSBA_KEYUSAGE_ENCIPHER_ONLY = 128,
+ KSBA_KEYUSAGE_DECIPHER_ONLY = 256
+ }
+ksba_key_usage_t;
+typedef ksba_key_usage_t KsbaKeyUsage _KSBA_DEPRECATED;
+
+/* ISO format, e.g. "19610711T172059", assumed to be UTC. */
+typedef char ksba_isotime_t[16];
+
+
+/* X.509 certificates are represented by this object.
+ ksba_cert_new() creates such an object */
+struct ksba_cert_s;
+typedef struct ksba_cert_s *ksba_cert_t;
+typedef struct ksba_cert_s *KsbaCert _KSBA_DEPRECATED;
+
+/* CMS objects are controlled by this object.
+ ksba_cms_new() creates it */
+struct ksba_cms_s;
+typedef struct ksba_cms_s *ksba_cms_t;
+typedef struct ksba_cms_s *KsbaCMS _KSBA_DEPRECATED;
+
+/* CRL objects are controlled by this object.
+ ksba_crl_new() creates it */
+struct ksba_crl_s;
+typedef struct ksba_crl_s *ksba_crl_t;
+typedef struct ksba_crl_s *KsbaCRL _KSBA_DEPRECATED;
+
+/* OCSP objects are controlled by this object.
+ ksba_ocsp_new() creates it. */
+struct ksba_ocsp_s;
+typedef struct ksba_ocsp_s *ksba_ocsp_t;
+
+/* PKCS-10 creation is controlled by this object.
+ ksba_certreq_new() creates it */
+struct ksba_certreq_s;
+typedef struct ksba_certreq_s *ksba_certreq_t;
+typedef struct ksba_certreq_s *KsbaCertreq _KSBA_DEPRECATED;
+
+/* This is a reader object for various purposes
+ see ksba_reader_new et al. */
+struct ksba_reader_s;
+typedef struct ksba_reader_s *ksba_reader_t;
+typedef struct ksba_reader_s *KsbaReader _KSBA_DEPRECATED;
+
+/* This is a writer object for various purposes
+ see ksba_writer_new et al. */
+struct ksba_writer_s;
+typedef struct ksba_writer_s *ksba_writer_t;
+typedef struct ksba_writer_s *KsbaWriter _KSBA_DEPRECATED;
+
+/* This is an object to store an ASN.1 parse tree as
+ create by ksba_asn_parse_file() */
+struct ksba_asn_tree_s;
+typedef struct ksba_asn_tree_s *ksba_asn_tree_t;
+typedef struct ksba_asn_tree_s *KsbaAsnTree _KSBA_DEPRECATED;
+
+/* This is an object to reference a General Name. Such an object is
+ returned by several functions. */
+struct ksba_name_s;
+typedef struct ksba_name_s *ksba_name_t;
+typedef struct ksba_name_s *KsbaName _KSBA_DEPRECATED;
+
+/* KsbaSexp is just an unsigned char * which should be used for
+ documentation purpose. The S-expressions returned by libksba are
+ always in canonical representation with an extra 0 byte at the end,
+ so that one can print the values in the debugger and at least see
+ the first bytes */
+typedef unsigned char *ksba_sexp_t;
+typedef unsigned char *KsbaSexp _KSBA_DEPRECATED;
+typedef const unsigned char *ksba_const_sexp_t;
+typedef const unsigned char *KsbaConstSexp _KSBA_DEPRECATED;
+
+
+/* This is a generic object used by various functions. */
+struct ksba_der_s;
+typedef struct ksba_der_s *ksba_der_t;
+
+
+/*-- cert.c --*/
+gpg_error_t ksba_cert_new (ksba_cert_t *acert);
+void ksba_cert_ref (ksba_cert_t cert);
+void ksba_cert_release (ksba_cert_t cert);
+gpg_error_t ksba_cert_set_user_data (ksba_cert_t cert, const char *key,
+ const void *data, size_t datalen);
+gpg_error_t ksba_cert_get_user_data (ksba_cert_t cert, const char *key,
+ void *buffer, size_t bufferlen,
+ size_t *datalen);
+
+gpg_error_t ksba_cert_read_der (ksba_cert_t cert, ksba_reader_t reader);
+gpg_error_t ksba_cert_init_from_mem (ksba_cert_t cert,
+ const void *buffer, size_t length);
+const unsigned char *ksba_cert_get_image (ksba_cert_t cert, size_t *r_length);
+gpg_error_t ksba_cert_hash (ksba_cert_t cert,
+ int what,
+ void (*hasher)(void *,
+ const void *,
+ size_t length),
+ void *hasher_arg);
+const char *ksba_cert_get_digest_algo (ksba_cert_t cert);
+ksba_sexp_t ksba_cert_get_serial (ksba_cert_t cert);
+char *ksba_cert_get_issuer (ksba_cert_t cert, int idx);
+gpg_error_t ksba_cert_get_validity (ksba_cert_t cert, int what,
+ ksba_isotime_t r_time);
+char *ksba_cert_get_subject (ksba_cert_t cert, int idx);
+ksba_sexp_t ksba_cert_get_public_key (ksba_cert_t cert);
+ksba_sexp_t ksba_cert_get_sig_val (ksba_cert_t cert);
+
+gpg_error_t ksba_cert_get_extension (ksba_cert_t cert, int idx,
+ char const **r_oid, int *r_crit,
+ size_t *r_deroff, size_t *r_derlen);
+
+gpg_error_t ksba_cert_is_ca (ksba_cert_t cert, int *r_ca, int *r_pathlen);
+gpg_error_t ksba_cert_get_key_usage (ksba_cert_t cert, unsigned int *r_flags);
+gpg_error_t ksba_cert_get_cert_policies (ksba_cert_t cert, char **r_policies);
+gpg_error_t ksba_cert_get_ext_key_usages (ksba_cert_t cert, char **result);
+gpg_error_t ksba_cert_get_crl_dist_point (ksba_cert_t cert, int idx,
+ ksba_name_t *r_distpoint,
+ ksba_name_t *r_issuer,
+ ksba_crl_reason_t *r_reason);
+gpg_error_t ksba_cert_get_auth_key_id (ksba_cert_t cert,
+ ksba_sexp_t *r_keyid,
+ ksba_name_t *r_name,
+ ksba_sexp_t *r_serial);
+gpg_error_t ksba_cert_get_subj_key_id (ksba_cert_t cert,
+ int *r_crit,
+ ksba_sexp_t *r_keyid);
+gpg_error_t ksba_cert_get_authority_info_access (ksba_cert_t cert, int idx,
+ char **r_method,
+ ksba_name_t *r_location);
+gpg_error_t ksba_cert_get_subject_info_access (ksba_cert_t cert, int idx,
+ char **r_method,
+ ksba_name_t *r_location);
+
+
+/*-- cms.c --*/
+ksba_content_type_t ksba_cms_identify (ksba_reader_t reader);
+
+gpg_error_t ksba_cms_new (ksba_cms_t *r_cms);
+void ksba_cms_release (ksba_cms_t cms);
+gpg_error_t ksba_cms_set_reader_writer (ksba_cms_t cms,
+ ksba_reader_t r, ksba_writer_t w);
+
+gpg_error_t ksba_cms_parse (ksba_cms_t cms, ksba_stop_reason_t *r_stopreason);
+gpg_error_t ksba_cms_build (ksba_cms_t cms, ksba_stop_reason_t *r_stopreason);
+
+ksba_content_type_t ksba_cms_get_content_type (ksba_cms_t cms, int what);
+const char *ksba_cms_get_content_oid (ksba_cms_t cms, int what);
+gpg_error_t ksba_cms_get_content_enc_iv (ksba_cms_t cms, void *iv,
+ size_t maxivlen, size_t *ivlen);
+const char *ksba_cms_get_digest_algo_list (ksba_cms_t cms, int idx);
+gpg_error_t ksba_cms_get_issuer_serial (ksba_cms_t cms, int idx,
+ char **r_issuer,
+ ksba_sexp_t *r_serial);
+const char *ksba_cms_get_digest_algo (ksba_cms_t cms, int idx);
+ksba_cert_t ksba_cms_get_cert (ksba_cms_t cms, int idx);
+gpg_error_t ksba_cms_get_message_digest (ksba_cms_t cms, int idx,
+ char **r_digest, size_t *r_digest_len);
+gpg_error_t ksba_cms_get_signing_time (ksba_cms_t cms, int idx,
+ ksba_isotime_t r_sigtime);
+gpg_error_t ksba_cms_get_sigattr_oids (ksba_cms_t cms, int idx,
+ const char *reqoid, char **r_value);
+ksba_sexp_t ksba_cms_get_sig_val (ksba_cms_t cms, int idx);
+ksba_sexp_t ksba_cms_get_enc_val (ksba_cms_t cms, int idx);
+
+void ksba_cms_set_hash_function (ksba_cms_t cms,
+ void (*hash_fnc)(void *, const void *, size_t),
+ void *hash_fnc_arg);
+
+gpg_error_t ksba_cms_hash_signed_attrs (ksba_cms_t cms, int idx);
+
+
+gpg_error_t ksba_cms_set_content_type (ksba_cms_t cms, int what,
+ ksba_content_type_t type);
+gpg_error_t ksba_cms_add_digest_algo (ksba_cms_t cms, const char *oid);
+gpg_error_t ksba_cms_add_signer (ksba_cms_t cms, ksba_cert_t cert);
+gpg_error_t ksba_cms_add_cert (ksba_cms_t cms, ksba_cert_t cert);
+gpg_error_t ksba_cms_add_smime_capability (ksba_cms_t cms, const char *oid,
+ const unsigned char *der,
+ size_t derlen);
+gpg_error_t ksba_cms_set_message_digest (ksba_cms_t cms, int idx,
+ const unsigned char *digest,
+ size_t digest_len);
+gpg_error_t ksba_cms_set_signing_time (ksba_cms_t cms, int idx,
+ const ksba_isotime_t sigtime);
+gpg_error_t ksba_cms_set_sig_val (ksba_cms_t cms,
+ int idx, ksba_const_sexp_t sigval);
+
+gpg_error_t ksba_cms_set_content_enc_algo (ksba_cms_t cms,
+ const char *oid,
+ const void *iv,
+ size_t ivlen);
+gpg_error_t ksba_cms_add_recipient (ksba_cms_t cms, ksba_cert_t cert);
+gpg_error_t ksba_cms_set_enc_val (ksba_cms_t cms,
+ int idx, ksba_const_sexp_t encval);
+
+
+/*-- crl.c --*/
+gpg_error_t ksba_crl_new (ksba_crl_t *r_crl);
+void ksba_crl_release (ksba_crl_t crl);
+gpg_error_t ksba_crl_set_reader (ksba_crl_t crl, ksba_reader_t r);
+void ksba_crl_set_hash_function (ksba_crl_t crl,
+ void (*hash_fnc)(void *,
+ const void *, size_t),
+ void *hash_fnc_arg);
+const char *ksba_crl_get_digest_algo (ksba_crl_t crl);
+gpg_error_t ksba_crl_get_issuer (ksba_crl_t crl, char **r_issuer);
+gpg_error_t ksba_crl_get_extension (ksba_crl_t crl, int idx,
+ char const **oid, int *critical,
+ unsigned char const **der, size_t *derlen);
+gpg_error_t ksba_crl_get_auth_key_id (ksba_crl_t crl,
+ ksba_sexp_t *r_keyid,
+ ksba_name_t *r_name,
+ ksba_sexp_t *r_serial);
+gpg_error_t ksba_crl_get_crl_number (ksba_crl_t crl, ksba_sexp_t *number);
+gpg_error_t ksba_crl_get_update_times (ksba_crl_t crl,
+ ksba_isotime_t this_update,
+ ksba_isotime_t next_update);
+gpg_error_t ksba_crl_get_item (ksba_crl_t crl,
+ ksba_sexp_t *r_serial,
+ ksba_isotime_t r_revocation_date,
+ ksba_crl_reason_t *r_reason);
+ksba_sexp_t ksba_crl_get_sig_val (ksba_crl_t crl);
+gpg_error_t ksba_crl_parse (ksba_crl_t crl, ksba_stop_reason_t *r_stopreason);
+
+
+
+/*-- ocsp.c --*/
+gpg_error_t ksba_ocsp_new (ksba_ocsp_t *r_oscp);
+void ksba_ocsp_release (ksba_ocsp_t ocsp);
+gpg_error_t ksba_ocsp_set_digest_algo (ksba_ocsp_t ocsp, const char *oid);
+gpg_error_t ksba_ocsp_set_requestor (ksba_ocsp_t ocsp, ksba_cert_t cert);
+gpg_error_t ksba_ocsp_add_target (ksba_ocsp_t ocsp,
+ ksba_cert_t cert, ksba_cert_t issuer_cert);
+size_t ksba_ocsp_set_nonce (ksba_ocsp_t ocsp,
+ unsigned char *nonce, size_t noncelen);
+
+gpg_error_t ksba_ocsp_prepare_request (ksba_ocsp_t ocsp);
+gpg_error_t ksba_ocsp_hash_request (ksba_ocsp_t ocsp,
+ void (*hasher)(void *, const void *,
+ size_t length),
+ void *hasher_arg);
+gpg_error_t ksba_ocsp_set_sig_val (ksba_ocsp_t ocsp,
+ ksba_const_sexp_t sigval);
+gpg_error_t ksba_ocsp_add_cert (ksba_ocsp_t ocsp, ksba_cert_t cert);
+gpg_error_t ksba_ocsp_build_request (ksba_ocsp_t ocsp,
+ unsigned char **r_buffer,
+ size_t *r_buflen);
+
+gpg_error_t ksba_ocsp_parse_response (ksba_ocsp_t ocsp,
+ const unsigned char *msg, size_t msglen,
+ ksba_ocsp_response_status_t *resp_status);
+
+const char *ksba_ocsp_get_digest_algo (ksba_ocsp_t ocsp);
+gpg_error_t ksba_ocsp_hash_response (ksba_ocsp_t ocsp,
+ const unsigned char *msg, size_t msglen,
+ void (*hasher)(void *, const void *,
+ size_t length),
+ void *hasher_arg);
+ksba_sexp_t ksba_ocsp_get_sig_val (ksba_ocsp_t ocsp,
+ ksba_isotime_t produced_at);
+gpg_error_t ksba_ocsp_get_responder_id (ksba_ocsp_t ocsp,
+ char **r_name,
+ ksba_sexp_t *r_keyid);
+ksba_cert_t ksba_ocsp_get_cert (ksba_ocsp_t ocsp, int idx);
+gpg_error_t ksba_ocsp_get_status (ksba_ocsp_t ocsp, ksba_cert_t cert,
+ ksba_status_t *r_status,
+ ksba_isotime_t r_this_update,
+ ksba_isotime_t r_next_update,
+ ksba_isotime_t r_revocation_time,
+ ksba_crl_reason_t *r_reason);
+gpg_error_t ksba_ocsp_get_extension (ksba_ocsp_t ocsp, ksba_cert_t cert,
+ int idx,
+ char const **r_oid, int *r_crit,
+ unsigned char const **r_der,
+ size_t *r_derlen);
+
+
+/*-- certreq.c --*/
+gpg_error_t ksba_certreq_new (ksba_certreq_t *r_cr);
+void ksba_certreq_release (ksba_certreq_t cr);
+gpg_error_t ksba_certreq_set_writer (ksba_certreq_t cr, ksba_writer_t w);
+void ksba_certreq_set_hash_function (
+ ksba_certreq_t cr,
+ void (*hash_fnc)(void *, const void *, size_t),
+ void *hash_fnc_arg);
+gpg_error_t ksba_certreq_add_subject (ksba_certreq_t cr, const char *name);
+gpg_error_t ksba_certreq_set_public_key (ksba_certreq_t cr,
+ ksba_const_sexp_t key);
+gpg_error_t ksba_certreq_add_extension (ksba_certreq_t cr,
+ const char *oid, int is_crit,
+ const void *der,
+ size_t derlen);
+gpg_error_t ksba_certreq_set_sig_val (ksba_certreq_t cr,
+ ksba_const_sexp_t sigval);
+gpg_error_t ksba_certreq_build (ksba_certreq_t cr,
+ ksba_stop_reason_t *r_stopreason);
+
+/* The functions below are used to switch to X.509 certificate creation. */
+gpg_error_t ksba_certreq_set_serial (ksba_certreq_t cr, ksba_const_sexp_t sn);
+gpg_error_t ksba_certreq_set_issuer (ksba_certreq_t cr, const char *name);
+gpg_error_t ksba_certreq_set_validity (ksba_certreq_t cr, int what,
+ const ksba_isotime_t timebuf);
+gpg_error_t ksba_certreq_set_siginfo (ksba_certreq_t cr,
+ ksba_const_sexp_t siginfo);
+
+
+
+/*-- reader.c --*/
+gpg_error_t ksba_reader_new (ksba_reader_t *r_r);
+void ksba_reader_release (ksba_reader_t r);
+gpg_error_t ksba_reader_set_release_notify (ksba_reader_t r,
+ void (*notify)(void*,ksba_reader_t),
+ void *notify_value);
+gpg_error_t ksba_reader_clear (ksba_reader_t r,
+ unsigned char **buffer, size_t *buflen);
+gpg_error_t ksba_reader_error (ksba_reader_t r);
+
+gpg_error_t ksba_reader_set_mem (ksba_reader_t r,
+ const void *buffer, size_t length);
+gpg_error_t ksba_reader_set_fd (ksba_reader_t r, int fd);
+gpg_error_t ksba_reader_set_file (ksba_reader_t r, FILE *fp);
+gpg_error_t ksba_reader_set_cb (ksba_reader_t r,
+ int (*cb)(void*,char *,size_t,size_t*),
+ void *cb_value );
+
+gpg_error_t ksba_reader_read (ksba_reader_t r,
+ char *buffer, size_t length, size_t *nread);
+gpg_error_t ksba_reader_unread (ksba_reader_t r, const void *buffer, size_t count);
+unsigned long ksba_reader_tell (ksba_reader_t r);
+
+/*-- writer.c --*/
+gpg_error_t ksba_writer_new (ksba_writer_t *r_w);
+void ksba_writer_release (ksba_writer_t w);
+gpg_error_t ksba_writer_set_release_notify (ksba_writer_t w,
+ void (*notify)(void*,ksba_writer_t),
+ void *notify_value);
+int ksba_writer_error (ksba_writer_t w);
+unsigned long ksba_writer_tell (ksba_writer_t w);
+gpg_error_t ksba_writer_set_fd (ksba_writer_t w, int fd);
+gpg_error_t ksba_writer_set_file (ksba_writer_t w, FILE *fp);
+gpg_error_t ksba_writer_set_cb (ksba_writer_t w,
+ int (*cb)(void*,const void *,size_t),
+ void *cb_value);
+gpg_error_t ksba_writer_set_mem (ksba_writer_t w, size_t initial_size);
+const void *ksba_writer_get_mem (ksba_writer_t w, size_t *nbytes);
+void * ksba_writer_snatch_mem (ksba_writer_t w, size_t *nbytes);
+gpg_error_t ksba_writer_set_filter (ksba_writer_t w,
+ gpg_error_t (*filter)(void*,
+ const void *,size_t, size_t *,
+ void *, size_t, size_t *),
+ void *filter_arg);
+
+gpg_error_t ksba_writer_write (ksba_writer_t w, const void *buffer, size_t length);
+gpg_error_t ksba_writer_write_octet_string (ksba_writer_t w,
+ const void *buffer, size_t length,
+ int flush);
+
+/*-- asn1-parse.y --*/
+int ksba_asn_parse_file (const char *filename, ksba_asn_tree_t *result,
+ int debug);
+void ksba_asn_tree_release (ksba_asn_tree_t tree);
+
+/*-- asn1-func.c --*/
+void ksba_asn_tree_dump (ksba_asn_tree_t tree, const char *name, FILE *fp);
+gpg_error_t ksba_asn_create_tree (const char *mod_name, ksba_asn_tree_t *result);
+
+/*-- oid.c --*/
+char *ksba_oid_to_str (const char *buffer, size_t length);
+gpg_error_t ksba_oid_from_str (const char *string,
+ unsigned char **rbuf, size_t *rlength);
+
+/*-- dn.c --*/
+gpg_error_t ksba_dn_der2str (const void *der, size_t derlen, char **r_string);
+gpg_error_t ksba_dn_str2der (const char *string,
+ unsigned char **rder, size_t *rderlen);
+gpg_error_t ksba_dn_teststr (const char *string, int seq,
+ size_t *rerroff, size_t *rerrlen);
+
+
+/*-- name.c --*/
+gpg_error_t ksba_name_new (ksba_name_t *r_name);
+void ksba_name_ref (ksba_name_t name);
+void ksba_name_release (ksba_name_t name);
+const char *ksba_name_enum (ksba_name_t name, int idx);
+char *ksba_name_get_uri (ksba_name_t name, int idx);
+
+
+/*-- der-builder.c --*/
+void ksba_der_release (ksba_der_t d);
+
+ksba_der_t ksba_der_builder_new (unsigned int nitems);
+void ksba_der_builder_reset (ksba_der_t d);
+
+void ksba_der_add_ptr (ksba_der_t d, int cls, int tag,
+ void *value, size_t valuelen);
+void ksba_der_add_val (ksba_der_t d, int cls, int tag,
+ const void *value, size_t valuelen);
+void ksba_der_add_int (ksba_der_t d, const void *value, size_t valuelen,
+ int force_positive);
+void ksba_der_add_oid (ksba_der_t d, const char *oidstr);
+void ksba_der_add_bts (ksba_der_t d, const void *value, size_t valuelen,
+ unsigned int unusedbits);
+void ksba_der_add_der (ksba_der_t d, const void *der, size_t derlen);
+void ksba_der_add_tag (ksba_der_t d, int cls, int tag);
+void ksba_der_add_end (ksba_der_t d);
+
+gpg_error_t ksba_der_builder_get (ksba_der_t d,
+ unsigned char **r_obj, size_t *r_objlen);
+
+
+
+/*-- util.c --*/
+void ksba_set_malloc_hooks ( void *(*new_alloc_func)(size_t n),
+ void *(*new_realloc_func)(void *p, size_t n),
+ void (*new_free_func)(void*) );
+void ksba_set_hash_buffer_function ( gpg_error_t (*fnc)
+ (void *arg, const char *oid,
+ const void *buffer, size_t length,
+ size_t resultsize,
+ unsigned char *result,
+ size_t *resultlen),
+ void *fnc_arg);
+void *ksba_malloc (size_t n );
+void *ksba_calloc (size_t n, size_t m );
+void *ksba_realloc (void *p, size_t n);
+char *ksba_strdup (const char *p);
+void ksba_free ( void *a );
+
+/*--version.c --*/
+const char *ksba_check_version (const char *req_version);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /*KSBA_H*/
diff --git a/src/ksba.m4 b/src/ksba.m4
index 73b2e26..ad8de4f 100644
--- a/src/ksba.m4
+++ b/src/ksba.m4
@@ -1,5 +1,5 @@
# ksba.m4 - autoconf macro to detect ksba
-# Copyright (C) 2002 g10 Code GmbH
+# Copyright (C) 2002, 2018 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
@@ -21,19 +21,39 @@ dnl this features allows to prevent build against newer versions of libksba
dnl with a changed API.
dnl
AC_DEFUN([AM_PATH_KSBA],
-[AC_REQUIRE([AC_CANONICAL_HOST])
- AC_ARG_WITH(ksba-prefix,
- AC_HELP_STRING([--with-ksba-prefix=PFX],
- [prefix where KSBA is installed (optional)]),
+[ AC_REQUIRE([AC_CANONICAL_HOST])
+ dnl --with-libksba-prefix=PFX is the preferred name for this option,
+ dnl since that is consistent with how our three siblings use the directory/
+ dnl package name in --with-$dir_name-prefix=PFX.
+ AC_ARG_WITH(libksba-prefix,
+ AC_HELP_STRING([--with-libksba-prefix=PFX],
+ [prefix where KSBA is installed (optional)]),
ksba_config_prefix="$withval", ksba_config_prefix="")
+
+ dnl Accept --with-ksba-prefix and make it work the same as
+ dnl --with-libksba-prefix above, for backwards compatibility,
+ dnl but do not document this old, inconsistently-named option.
+ AC_ARG_WITH(ksba-prefix,,
+ ksba_config_prefix="$withval", ksba_config_prefix="")
+
if test x$ksba_config_prefix != x ; then
- ksba_config_args="$ksba_config_args --prefix=$ksba_config_prefix"
- if test x${KSBA_CONFIG+set} != xset ; then
- KSBA_CONFIG=$ksba_config_prefix/bin/ksba-config
- fi
+ if test x${KSBA_CONFIG+set} != xset ; then
+ KSBA_CONFIG=$ksba_config_prefix/bin/ksba-config
+ fi
+ fi
+
+ use_gpgrt_config=""
+ if test x"$KSBA_CONFIG" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
+ if $GPGRT_CONFIG ksba --exists; then
+ KSBA_CONFIG="$GPGRT_CONFIG ksba"
+ AC_MSG_NOTICE([Use gpgrt-config as ksba-config])
+ use_gpgrt_config=yes
+ fi
+ fi
+ if test -z "$use_gpgrt_config"; then
+ AC_PATH_PROG(KSBA_CONFIG, ksba-config, no)
fi
- AC_PATH_PROG(KSBA_CONFIG, ksba-config, no)
tmp=ifelse([$1], ,1:1.0.0,$1)
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
req_ksba_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
@@ -52,7 +72,11 @@ AC_DEFUN([AM_PATH_KSBA],
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
req_micro=`echo $min_ksba_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
- ksba_config_version=`$KSBA_CONFIG $ksba_config_args --version`
+ if test -z "$use_gpgrt_config"; then
+ ksba_config_version=`$KSBA_CONFIG --version`
+ else
+ ksba_config_version=`$KSBA_CONFIG --modversion`
+ fi
major=`echo $ksba_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $ksba_config_version | \
@@ -84,7 +108,11 @@ AC_DEFUN([AM_PATH_KSBA],
# Even if we have a recent libksba, we should check that the
# API is compatible.
if test "$req_ksba_api" -gt 0 ; then
- tmp=`$KSBA_CONFIG --api-version 2>/dev/null || echo 0`
+ if test -z "$use_gpgrt_config"; then
+ tmp=`$KSBA_CONFIG --api-version 2>/dev/null || echo 0`
+ else
+ tmp=`$KSBA_CONFIG --variable=api_version 2>/dev/null || echo 0`
+ fi
if test "$tmp" -gt 0 ; then
AC_MSG_CHECKING([KSBA API version])
if test "$req_ksba_api" -eq "$tmp" ; then
@@ -97,15 +125,19 @@ AC_DEFUN([AM_PATH_KSBA],
fi
fi
if test $ok = yes; then
- KSBA_CFLAGS=`$KSBA_CONFIG $ksba_config_args --cflags`
- KSBA_LIBS=`$KSBA_CONFIG $ksba_config_args --libs`
+ KSBA_CFLAGS=`$KSBA_CONFIG --cflags`
+ KSBA_LIBS=`$KSBA_CONFIG --libs`
ifelse([$2], , :, [$2])
- libksba_config_host=`$LIBKSBA_CONFIG $ksba_config_args --host 2>/dev/null || echo none`
+ if test -z "$use_gpgrt_config"; then
+ libksba_config_host=`$KSBA_CONFIG --host 2>/dev/null || echo none`
+ else
+ libksba_config_host=`$KSBA_CONFIG --variable=host 2>/dev/null || echo none`
+ fi
if test x"$libksba_config_host" != xnone ; then
if test x"$libksba_config_host" != x"$host" ; then
AC_MSG_WARN([[
***
-*** The config script $LIBKSBA_CONFIG was
+*** The config script "$KSBA_CONFIG" was
*** built for $libksba_config_host and thus may not match the
*** used host $host.
*** You may want to use the configure option --with-libksba-prefix
diff --git a/src/ksba.pc.in b/src/ksba.pc.in
new file mode 100644
index 0000000..96b5d7d
--- /dev/null
+++ b/src/ksba.pc.in
@@ -0,0 +1,14 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+libdir=@libdir@
+host=@KSBA_CONFIG_HOST@
+api_version=@KSBA_CONFIG_API_VERSION@
+
+Name: ksba
+Description: X.509 and CMS support library
+Requires: gpg-error
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir} @KSBA_CONFIG_CFLAGS@
+Libs: -L${libdir} @KSBA_CONFIG_LIBS@
+URL: http://www.gnupg.org/related_software/libksba/
diff --git a/src/libksba.def b/src/libksba.def
index 004ba3a..cd2d81c 100644
--- a/src/libksba.def
+++ b/src/libksba.def
@@ -194,3 +194,16 @@ EXPORTS
ksba_certreq_set_issuer @149
ksba_certreq_set_validity @150
ksba_certreq_set_siginfo @151
+
+ ksba_der_release @152
+ ksba_der_builder_new @153
+ ksba_der_builder_reset @154
+ ksba_der_add_ptr @155
+ ksba_der_add_val @156
+ ksba_der_add_int @157
+ ksba_der_add_oid @158
+ ksba_der_add_bts @159
+ ksba_der_add_der @160
+ ksba_der_add_tag @161
+ ksba_der_add_end @162
+ ksba_der_builder_get @163
diff --git a/src/libksba.vers b/src/libksba.vers
index dd6080f..271eedb 100644
--- a/src/libksba.vers
+++ b/src/libksba.vers
@@ -108,6 +108,12 @@ KSBA_0.9 {
ksba_writer_snatch_mem; ksba_writer_tell; ksba_writer_write;
ksba_writer_write_octet_string; ksba_writer_set_release_notify;
+ ksba_der_release; ksba_der_builder_new; ksba_der_builder_reset;
+ ksba_der_add_ptr; ksba_der_add_val; ksba_der_add_int;
+ ksba_der_add_oid; ksba_der_add_bts; ksba_der_add_der;
+ ksba_der_add_tag; ksba_der_add_end;
+ ksba_der_builder_get;
+
local:
*;
};
diff --git a/src/ocsp.c b/src/ocsp.c
index 4b26f8d..e813166 100644
--- a/src/ocsp.c
+++ b/src/ocsp.c
@@ -63,202 +63,6 @@ dump_hex (const unsigned char *p, size_t n)
}
#endif
-
-static void
-parse_skip (unsigned char const **buf, size_t *len, struct tag_info *ti)
-{
- if (ti->length)
- {
- assert (ti->length <= *len);
- *len -= ti->length;
- *buf += ti->length;
- }
-}
-
-static gpg_error_t
-parse_sequence (unsigned char const **buf, size_t *len, struct tag_info *ti)
-{
- gpg_error_t err;
-
- err = _ksba_ber_parse_tl (buf, len, ti);
- if (err)
- ;
- else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_SEQUENCE
- && ti->is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (ti->length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
- return err;
-}
-
-static gpg_error_t
-parse_enumerated (unsigned char const **buf, size_t *len, struct tag_info *ti,
- size_t maxlen)
-{
- gpg_error_t err;
-
- err = _ksba_ber_parse_tl (buf, len, ti);
- if (err)
- ;
- else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_ENUMERATED
- && !ti->is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (!ti->length)
- err = gpg_error (GPG_ERR_TOO_SHORT);
- else if (maxlen && ti->length > maxlen)
- err = gpg_error (GPG_ERR_TOO_LARGE);
- else if (ti->length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
-
- return err;
-}
-
-static gpg_error_t
-parse_integer (unsigned char const **buf, size_t *len, struct tag_info *ti)
-{
- gpg_error_t err;
-
- err = _ksba_ber_parse_tl (buf, len, ti);
- if (err)
- ;
- else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_INTEGER
- && !ti->is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (!ti->length)
- err = gpg_error (GPG_ERR_TOO_SHORT);
- else if (ti->length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
-
- return err;
-}
-
-static gpg_error_t
-parse_octet_string (unsigned char const **buf, size_t *len, struct tag_info *ti)
-{
- gpg_error_t err;
-
- err= _ksba_ber_parse_tl (buf, len, ti);
- if (err)
- ;
- else if (!(ti->class == CLASS_UNIVERSAL && ti->tag == TYPE_OCTET_STRING
- && !ti->is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (!ti->length)
- err = gpg_error (GPG_ERR_TOO_SHORT);
- else if (ti->length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
-
- return err;
-}
-
-
-/* Note that R_BOOL will only be set if a value has been given. Thus
- the caller should set it to the default value prior to calling this
- function. Obviously no call to parse_skip is required after
- calling this function. */
-static gpg_error_t
-parse_optional_boolean (unsigned char const **buf, size_t *len, int *r_bool)
-{
- gpg_error_t err;
- struct tag_info ti;
-
- err = _ksba_ber_parse_tl (buf, len, &ti);
- if (err)
- ;
- else if (!ti.length)
- err = gpg_error (GPG_ERR_TOO_SHORT);
- else if (ti.length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
- else if (ti.class == CLASS_UNIVERSAL && ti.tag == TYPE_BOOLEAN
- && !ti.is_constructed)
- {
- if (ti.length != 1)
- err = gpg_error (GPG_ERR_BAD_BER);
- *r_bool = !!**buf;
- parse_skip (buf, len, &ti);
- }
- else
- { /* Undo the read. */
- *buf -= ti.nhdr;
- *len += ti.nhdr;
- }
-
- return err;
-}
-
-
-
-static gpg_error_t
-parse_object_id_into_str (unsigned char const **buf, size_t *len, char **oid)
-{
- struct tag_info ti;
- gpg_error_t err;
-
- *oid = NULL;
- err = _ksba_ber_parse_tl (buf, len, &ti);
- if (err)
- ;
- else if (!(ti.class == CLASS_UNIVERSAL && ti.tag == TYPE_OBJECT_ID
- && !ti.is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (!ti.length)
- err = gpg_error (GPG_ERR_TOO_SHORT);
- else if (ti.length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
- else if (!(*oid = ksba_oid_to_str (*buf, ti.length)))
- err = gpg_error_from_syserror ();
- else
- {
- *buf += ti.length;
- *len -= ti.length;
- }
- return err;
-}
-
-
-static gpg_error_t
-parse_asntime_into_isotime (unsigned char const **buf, size_t *len,
- ksba_isotime_t isotime)
-{
- struct tag_info ti;
- gpg_error_t err;
-
- err = _ksba_ber_parse_tl (buf, len, &ti);
- if (err)
- ;
- else if ( !(ti.class == CLASS_UNIVERSAL
- && (ti.tag == TYPE_UTC_TIME || ti.tag == TYPE_GENERALIZED_TIME)
- && !ti.is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (ti.length > *len)
- err = gpg_error (GPG_ERR_INV_BER);
- else if (!(err = _ksba_asntime_to_iso (*buf, ti.length,
- ti.tag == TYPE_UTC_TIME, isotime)))
- parse_skip (buf, len, &ti);
-
- return err;
-}
-
-
-static gpg_error_t
-parse_context_tag (unsigned char const **buf, size_t *len, struct tag_info *ti,
- int tag)
-{
- gpg_error_t err;
-
- err = _ksba_ber_parse_tl (buf, len, ti);
- if (err)
- ;
- else if (!(ti->class == CLASS_CONTEXT && ti->tag == tag
- && ti->is_constructed) )
- err = gpg_error (GPG_ERR_INV_OBJ);
- else if (ti->length > *len)
- err = gpg_error (GPG_ERR_BAD_BER);
-
- return err;
-}
-
-
/* Create a new OCSP object and retrun it in R_OCSP. Return 0 on
success or an error code.
@@ -616,8 +420,6 @@ ksba_ocsp_prepare_request (ksba_ocsp_t ocsp)
/* Write the serialNumber of the certificate to be checked. */
err = _ksba_cert_get_serial_ptr (ri->cert, &der, &derlen);
if (!err)
- err = _ksba_ber_write_tl (w1, TYPE_INTEGER, CLASS_UNIVERSAL, 0, derlen);
- if (!err)
err = ksba_writer_write (w1, der, derlen);
if (err)
goto leave;
diff --git a/src/oid.c b/src/oid.c
index 9061a4a..b642986 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -171,9 +171,9 @@ make_flagged_int (unsigned long value, char *buf, size_t buflen)
*
* Convertes the OID given in dotted decimal form to an DER encoding
* and returns it in allocated buffer rbuf and its length in rlength.
- * rbuf is set to NULL in case of an error is returned.
+ * rbuf is set to NULL in case an error is returned.
* Scanning stops at the first white space.
-
+ *
* The caller must free the returned buffer using ksba_free() or the
* function he has registered as a replacement.
*
diff --git a/src/reader.c b/src/reader.c
index c59978d..475054e 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -31,6 +31,7 @@
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
@@ -101,12 +102,12 @@ ksba_reader_set_release_notify (ksba_reader_t r,
/* Clear the error and eof indicators for READER, so that it can be
- continued to use. Also dicards any unread bytes. This is usually
- required if the upper layer want to send to send an EOF to indicate
+ continued to use. Also discards any unread bytes. This is usually
+ required if the upper layer wants to send an EOF to indicate
the logical end of one part of a file. If BUFFER and BUFLEN are
not NULL, possible unread data is copied to a newly allocated
buffer and this buffer is assigned to BUFFER, BUFLEN will be set to
- the length of the unread bytes. */
+ the length of the unread bytes. */
gpg_error_t
ksba_reader_clear (ksba_reader_t r, unsigned char **buffer, size_t *buflen)
{
@@ -407,6 +408,41 @@ ksba_reader_read (ksba_reader_t r, char *buffer, size_t length, size_t *nread)
}
r->nread += *nread;
}
+ else if (r->type == READER_TYPE_FD)
+ {
+ ssize_t n;
+
+ if (r->eof)
+ return gpg_error (GPG_ERR_EOF);
+
+ if (!length)
+ {
+ *nread = 0;
+ return 0;
+ }
+
+ n = read (r->u.fd, buffer, length);
+ if (n > 0)
+ {
+ r->nread += n;
+ *nread = n;
+ }
+ else
+ {
+ *nread = 0;
+
+ if (n < 0)
+ {
+ r->error = errno;
+ return gpg_error_from_errno (errno);
+ }
+ else
+ {
+ r->eof = 1;
+ return gpg_error (GPG_ERR_EOF);
+ }
+ }
+ }
else
return gpg_error (GPG_ERR_BUG);
diff --git a/src/sexp-parse.h b/src/sexp-parse.h
index 61d77b3..e211a0d 100644
--- a/src/sexp-parse.h
+++ b/src/sexp-parse.h
@@ -52,7 +52,7 @@ snext (unsigned char const **buf)
}
/* Skip over the S-Expression BUF points to and update BUF to point to
- the chacter right behind. DEPTH gives the initial number of open
+ the byte right behind. DEPTH gives the initial number of open
lists and may be passed as a positive number to skip over the
remainder of an S-Expression if the current position is somewhere
in an S-Expression. The function may return an error code if it
diff --git a/src/stringbuf.h b/src/stringbuf.h
new file mode 100644
index 0000000..197f153
--- /dev/null
+++ b/src/stringbuf.h
@@ -0,0 +1,183 @@
+/* stringbuf.h - Inline functions for building strings.
+ * Copyright (C) 2001, 2002, 2007, 2008, 2012, 2020 g10 Code GmbH
+ *
+ * This file is part of KSBA.
+ *
+ * KSBA is free software; you can redistribute it and/or modify
+ * it under the terms of either
+ *
+ * - the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * or
+ *
+ * - the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * or both in parallel, as here.
+ *
+ * KSBA 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 copies of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef STRINGBUF_H
+#define STRINGBUF_H 1
+
+#include "util.h"
+#include "errno.h"
+
+struct stringbuf
+{
+ size_t len;
+ size_t size;
+ char *buf;
+ gpg_error_t out_of_core;
+};
+
+
+static inline void
+init_stringbuf (struct stringbuf *sb, int initiallen)
+{
+ sb->len = 0;
+ sb->size = initiallen;
+ sb->out_of_core = 0;
+ /* allocate one more, so that get_stringbuf can append a nul */
+ sb->buf = xtrymalloc (initiallen+1);
+ if (!sb->buf)
+ sb->out_of_core = errno? errno : ENOMEM;
+}
+
+
+static inline void
+deinit_stringbuf (struct stringbuf *sb)
+{
+ xfree (sb->buf);
+ sb->buf = NULL;
+ sb->out_of_core = ENOMEM; /* make sure the caller does an init before reuse */
+}
+
+
+static inline void
+put_stringbuf_mem (struct stringbuf *sb, const char *text, size_t n)
+{
+ if (sb->out_of_core)
+ return;
+
+ if (sb->len + n >= sb->size)
+ {
+ char *p;
+
+ sb->size += n + 100;
+ p = xtryrealloc (sb->buf, sb->size + 1);
+ if (!p)
+ {
+ sb->out_of_core = errno? errno : ENOMEM;
+ return;
+ }
+ sb->buf = p;
+ }
+ memcpy (sb->buf+sb->len, text, n);
+ sb->len += n;
+}
+
+
+static inline void
+put_stringbuf_mem_skip (struct stringbuf *sb, const char *text, size_t n,
+ int skip)
+{
+ char *p;
+
+ if (!skip)
+ {
+ put_stringbuf_mem (sb, text, n);
+ return;
+ }
+ if (sb->out_of_core)
+ return;
+
+ if (sb->len + n >= sb->size)
+ {
+ /* Note: we allocate too much here, but we don't care. */
+ sb->size += n + 100;
+ p = xtryrealloc (sb->buf, sb->size + 1);
+ if ( !p)
+ {
+ sb->out_of_core = errno? errno : ENOMEM;
+ return;
+ }
+ sb->buf = p;
+ }
+ p = sb->buf+sb->len;
+ while (n > skip)
+ {
+ text += skip;
+ n -= skip;
+ *p++ = *text++;
+ n--;
+ sb->len++;
+ }
+}
+
+
+static inline void
+put_stringbuf (struct stringbuf *sb, const char *text)
+{
+ put_stringbuf_mem (sb, text,strlen (text));
+}
+
+
+static inline void
+put_stringbuf_mem_sexp (struct stringbuf *sb, const char *text, size_t length)
+{
+ char buf[20];
+ sprintf (buf,"%u:", (unsigned int)length);
+ put_stringbuf (sb, buf);
+ put_stringbuf_mem (sb, text, length);
+}
+
+
+static inline void
+put_stringbuf_sexp (struct stringbuf *sb, const char *text)
+{
+ put_stringbuf_mem_sexp (sb, text, strlen (text));
+}
+
+
+static inline void
+put_stringbuf_uint (struct stringbuf *sb, unsigned int value)
+{
+ char buf[35];
+ snprintf (buf, sizeof buf, "%u", (unsigned int)value);
+ put_stringbuf_sexp (sb, buf);
+}
+
+
+static inline char *
+get_stringbuf (struct stringbuf *sb)
+{
+ char *p;
+
+ if (sb->out_of_core)
+ {
+ xfree (sb->buf); sb->buf = NULL;
+ gpg_err_set_errno (sb->out_of_core);
+ return NULL;
+ }
+
+ sb->buf[sb->len] = 0;
+ p = sb->buf;
+ sb->buf = NULL;
+ sb->out_of_core = ENOMEM; /* make sure the caller does an init before reuse */
+ return p;
+}
+
+
+#endif /*STRINGBUF_H*/
diff --git a/src/util.c b/src/util.c
index 026c339..7200904 100644
--- a/src/util.c
+++ b/src/util.c
@@ -166,6 +166,55 @@ ksba_strdup (const char *str)
}
+/* This is safe version of realloc useful for reallocing a calloced
+ * array. There are two ways to call it: The first example
+ * reallocates the array A to N elements each of SIZE but does not
+ * clear the newly allocated elements:
+ *
+ * p = _ksba_reallocarray (a, n, n, nsize);
+ *
+ * Note that when NOLD is larger than N no cleaning is needed anyway.
+ * The second example reallocates an array of size NOLD to N elements
+ * each of SIZE but clear the newly allocated elements:
+ *
+ * p = _ksba_reallocarray (a, nold, n, nsize);
+ *
+ * Note that gpgrt_reallocarray (NULL, 0, n, nsize) is equivalent to
+ * _ksba_calloc (n, nsize).
+ *
+ */
+void *
+_ksba_reallocarray (void *a, size_t oldnmemb, size_t nmemb, size_t size)
+{
+ size_t oldbytes, bytes;
+ char *p;
+
+ bytes = nmemb * size; /* size_t is unsigned so the behavior on overflow
+ * is defined. */
+ if (size && bytes / size != nmemb)
+ {
+ gpg_err_set_errno (ENOMEM);
+ return NULL;
+ }
+
+ p = ksba_realloc (a, bytes);
+ if (p && oldnmemb < nmemb)
+ {
+ /* OLDNMEMBS is lower than NMEMB thus the user asked for a
+ calloc. Clear all newly allocated members. */
+ oldbytes = oldnmemb * size;
+ if (size && oldbytes / size != oldnmemb)
+ {
+ xfree (p);
+ gpg_err_set_errno (ENOMEM);
+ return NULL;
+ }
+ memset (p + oldbytes, 0, bytes - oldbytes);
+ }
+ return p;
+}
+
+
void
ksba_free ( void *a )
{
diff --git a/src/util.h b/src/util.h
index 557b413..6c1911f 100644
--- a/src/util.h
+++ b/src/util.h
@@ -44,6 +44,7 @@ gpg_error_t _ksba_hash_buffer (const char *oid,
size_t resultsize,
unsigned char *result, size_t *resultlen);
+void *_ksba_reallocarray (void *a, size_t oldnmemb, size_t nmemb, size_t size);
void *_ksba_xmalloc (size_t n );
void *_ksba_xcalloc (size_t n, size_t m );
diff --git a/src/versioninfo.rc.in b/src/versioninfo.rc.in
index ef25eb8..9318e8b 100644
--- a/src/versioninfo.rc.in
+++ b/src/versioninfo.rc.in
@@ -40,7 +40,7 @@ BEGIN
VALUE "FileDescription", "Libksba - X.509 and CMS Library\0"
VALUE "FileVersion", "@LIBKSBA_LT_CURRENT@.@LIBKSBA_LT_AGE@.@LIBKSBA_LT_REVISION@.@BUILD_REVISION@\0"
VALUE "InternalName", "libksba\0"
- VALUE "LegalCopyright", "Copyright © 2015 g10 Code GmbH\0"
+ VALUE "LegalCopyright", "Copyright © 2019 g10 Code GmbH\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "libksba.dll\0"
VALUE "PrivateBuild", "\0"
diff --git a/src/visibility.c b/src/visibility.c
index 7a76e16..c4bf397 100644
--- a/src/visibility.c
+++ b/src/visibility.c
@@ -34,6 +34,7 @@
#define _KSBA_INCLUDED_BY_VISIBILITY_C
#include "util.h"
+
/*--version.c --*/
const char *
ksba_check_version (const char *req_version)
@@ -1237,3 +1238,82 @@ ksba_name_get_uri (ksba_name_t name, int idx)
{
return _ksba_name_get_uri (name, idx);
}
+
+
+/*-- der-encoder.c --*/
+void
+ksba_der_release (ksba_der_t d)
+{
+ if (d)
+ _ksba_der_release (d);
+}
+
+ksba_der_t
+ksba_der_builder_new (unsigned int nitems)
+{
+ return _ksba_der_builder_new (nitems);
+}
+
+void
+ksba_der_builder_reset (ksba_der_t d)
+{
+ _ksba_der_builder_reset (d);
+}
+
+void
+ksba_der_add_ptr (ksba_der_t d, int cls, int tag,
+ void *value, size_t valuelen)
+{
+ _ksba_der_add_ptr (d, cls, tag, value, valuelen);
+}
+
+void
+ksba_der_add_val (ksba_der_t d, int cls, int tag,
+ const void *value, size_t valuelen)
+{
+ _ksba_der_add_val (d, cls, tag, value, valuelen);
+}
+
+void
+ksba_der_add_int (ksba_der_t d, const void *value, size_t valuelen,
+ int force_positive)
+{
+ _ksba_der_add_int (d, value, valuelen, force_positive);
+}
+
+void
+ksba_der_add_oid (ksba_der_t d, const char *oidstr)
+{
+ _ksba_der_add_oid (d, oidstr);
+}
+
+void
+ksba_der_add_bts (ksba_der_t d, const void *value, size_t valuelen,
+ unsigned int unusedbits)
+{
+ _ksba_der_add_bts (d, value, valuelen, unusedbits);
+}
+
+void
+ksba_der_add_der (ksba_der_t d, const void *der, size_t derlen)
+{
+ _ksba_der_add_der (d, der, derlen);
+}
+
+void
+ksba_der_add_tag (ksba_der_t d, int cls, int tag)
+{
+ _ksba_der_add_tag (d, cls, tag);
+}
+
+void
+ksba_der_add_end (ksba_der_t d)
+{
+ _ksba_der_add_end (d);
+}
+
+gpg_error_t
+ksba_der_builder_get (ksba_der_t d, unsigned char **r_obj, size_t *r_objlen)
+{
+ return _ksba_der_builder_get (d, r_obj, r_objlen);
+}
diff --git a/src/visibility.h b/src/visibility.h
index 04f67f9..0a2d96d 100644
--- a/src/visibility.h
+++ b/src/visibility.h
@@ -192,6 +192,19 @@
#define ksba_writer_write _ksba_writer_write
#define ksba_writer_write_octet_string _ksba_writer_write_octet_string
+#define ksba_der_release _ksba_der_release
+#define ksba_der_builder_new _ksba_der_builder_new
+#define ksba_der_builder_reset _ksba_der_builder_reset
+#define ksba_der_add_ptr _ksba_der_add_ptr
+#define ksba_der_add_val _ksba_der_add_val
+#define ksba_der_add_int _ksba_der_add_int
+#define ksba_der_add_oid _ksba_der_add_oid
+#define ksba_der_add_bts _ksba_der_add_bts
+#define ksba_der_add_der _ksba_der_add_der
+#define ksba_der_add_tag _ksba_der_add_tag
+#define ksba_der_add_end _ksba_der_add_end
+#define ksba_der_builder_get _ksba_der_builder_get
+
/* Include the main header file to map the public symbols to the
internal underscore prefixed symbols. */
@@ -386,6 +399,19 @@ int ksba_asn_delete_structure (void *dummy);
#undef ksba_writer_write
#undef ksba_writer_write_octet_string
+#undef ksba_der_release
+#undef ksba_der_builder_new
+#undef ksba_der_builder_reset
+#undef ksba_der_add_ptr
+#undef ksba_der_add_val
+#undef ksba_der_add_int
+#undef ksba_der_add_oid
+#undef ksba_der_add_bts
+#undef ksba_der_add_der
+#undef ksba_der_add_tag
+#undef ksba_der_add_end
+#undef ksba_der_builder_get
+
/* Mark all symbols. */
@@ -549,6 +575,19 @@ MARK_VISIBLE (ksba_writer_tell)
MARK_VISIBLE (ksba_writer_write)
MARK_VISIBLE (ksba_writer_write_octet_string)
+MARK_VISIBLE (ksba_der_release)
+MARK_VISIBLE (ksba_der_builder_new)
+MARK_VISIBLE (ksba_der_builder_reset)
+MARK_VISIBLE (ksba_der_add_ptr)
+MARK_VISIBLE (ksba_der_add_val)
+MARK_VISIBLE (ksba_der_add_int)
+MARK_VISIBLE (ksba_der_add_oid)
+MARK_VISIBLE (ksba_der_add_bts)
+MARK_VISIBLE (ksba_der_add_der)
+MARK_VISIBLE (ksba_der_add_tag)
+MARK_VISIBLE (ksba_der_add_end)
+MARK_VISIBLE (ksba_der_builder_get)
+
# undef MARK_VISIBLE
#endif /*_KSBA_INCLUDED_BY_VISIBILITY_C*/
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 759b626..0e7186f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -20,33 +20,45 @@
TESTS_ENVIRONMENT =
-test_certs = cert_dfn_pca01.der cert_dfn_pca15.der \
- cert_g10code_test1.der crl_testpki_testpca.der \
+test_certs = samples/cert_dfn_pca01.der samples/cert_dfn_pca15.der \
+ samples/cert_g10code_test1.der samples/crl_testpki_testpca.der \
samples/authority.crt samples/betsy.crt samples/bull.crt \
samples/ov-ocsp-server.crt samples/ov-userrev.crt \
samples/ov-root-ca-cert.crt samples/ov-serverrev.crt \
samples/ov-user.crt samples/ov-server.crt \
samples/ov2-root-ca-cert.crt samples/ov2-ocsp-server.crt \
- samples/ov2-user.crt samples/ov2-userrev.crt
+ samples/ov2-user.crt samples/ov2-userrev.crt \
+ samples/secp256r1-sha384_cert.crt \
+ samples/secp256r1-sha512_cert.crt \
+ samples/secp384r1-sha512_cert.crt \
+ samples/openssl-secp256r1ca.cert.crt \
+ samples/ed25519-rfc8410.crt \
+ samples/ed25519-ossl-1.crt \
+ samples/ed448-ossl-1.crt
+
test_crls = samples/ov-test-crl.crl
test_keys = samples/ov-server.p12 samples/ov-userrev.p12 \
samples/ov-serverrev.p12 samples/ov-user.p12
-EXTRA_DIST = $(test_certs) samples/README mkoidtbl.awk
+EXTRA_DIST = $(test_certs) samples/README mkoidtbl.awk \
+ samples/detached-sig.cms \
+ samples/rsa-sample1.p7m samples/rsa-sample1.p7m.asn \
+ samples/ecdh-sample1.p7m samples/ecdh-sample1.p7m.asn
BUILT_SOURCES = oidtranstbl.h
CLEANFILES = oidtranstbl.h
-TESTS = cert-basic t-crl-parser t-dnparser t-oid
+TESTS = cert-basic t-crl-parser t-dnparser t-oid t-reader t-cms-parser \
+ t-der-builder
-AM_CFLAGS = $(GPG_ERROR_CFLAGS)
-AM_LDFLAGS = -no-install
+AM_CFLAGS = $(GPG_ERROR_CFLAGS) $(COVERAGE_CFLAGS)
+AM_LDFLAGS = -no-install $(COVERAGE_LDFLAGS)
noinst_HEADERS = t-common.h
-noinst_PROGRAMS = $(TESTS) t-cms-parser t-crl-parser t-dnparser t-ocsp
-LDADD = ../src/libksba.la $(GPG_ERROR_LIBS)
+noinst_PROGRAMS = $(TESTS) t-ocsp
+LDADD = ../src/libksba.la $(GPG_ERROR_LIBS) @LDADD_FOR_TESTS_KLUDGE@
t_ocsp_SOURCES = t-ocsp.c sha1.c
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 0112b3b..21bf5a7 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -34,7 +34,17 @@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -98,17 +108,16 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
TESTS = cert-basic$(EXEEXT) t-crl-parser$(EXEEXT) t-dnparser$(EXEEXT) \
- t-oid$(EXEEXT)
-noinst_PROGRAMS = $(am__EXEEXT_1) t-cms-parser$(EXEEXT) \
- t-crl-parser$(EXEEXT) t-dnparser$(EXEEXT) t-ocsp$(EXEEXT)
+ t-oid$(EXEEXT) t-reader$(EXEEXT) t-cms-parser$(EXEEXT) \
+ t-der-builder$(EXEEXT)
+noinst_PROGRAMS = $(am__EXEEXT_1) t-ocsp$(EXEEXT)
subdir = tests
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/build-aux/depcomp $(noinst_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/gl/m4/gnulib.m4 \
$(top_srcdir)/gl/m4/valgrind-tests.m4 \
$(top_srcdir)/m4/autobuild.m4 \
+ $(top_srcdir)/m4/ax_prog_bison.m4 $(top_srcdir)/m4/gcov.m4 \
$(top_srcdir)/m4/gnupg-typedef.m4 \
$(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -116,12 +125,15 @@ am__aclocal_m4_deps = $(top_srcdir)/gl/m4/alloca.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
+ $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = cert-basic$(EXEEXT) t-crl-parser$(EXEEXT) \
- t-dnparser$(EXEEXT) t-oid$(EXEEXT)
+ t-dnparser$(EXEEXT) t-oid$(EXEEXT) t-reader$(EXEEXT) \
+ t-cms-parser$(EXEEXT) t-der-builder$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
cert_basic_SOURCES = cert-basic.c
cert_basic_OBJECTS = cert-basic.$(OBJEXT)
@@ -140,6 +152,10 @@ t_crl_parser_SOURCES = t-crl-parser.c
t_crl_parser_OBJECTS = t-crl-parser.$(OBJEXT)
t_crl_parser_LDADD = $(LDADD)
t_crl_parser_DEPENDENCIES = ../src/libksba.la $(am__DEPENDENCIES_1)
+t_der_builder_SOURCES = t-der-builder.c
+t_der_builder_OBJECTS = t-der-builder.$(OBJEXT)
+t_der_builder_LDADD = $(LDADD)
+t_der_builder_DEPENDENCIES = ../src/libksba.la $(am__DEPENDENCIES_1)
t_dnparser_SOURCES = t-dnparser.c
t_dnparser_OBJECTS = t-dnparser.$(OBJEXT)
t_dnparser_LDADD = $(LDADD)
@@ -152,6 +168,10 @@ t_oid_SOURCES = t-oid.c
t_oid_OBJECTS = t-oid.$(OBJEXT)
t_oid_LDADD = $(LDADD)
t_oid_DEPENDENCIES = ../src/libksba.la $(am__DEPENDENCIES_1)
+t_reader_SOURCES = t-reader.c
+t_reader_OBJECTS = t-reader.$(OBJEXT)
+t_reader_LDADD = $(LDADD)
+t_reader_DEPENDENCIES = ../src/libksba.la $(am__DEPENDENCIES_1)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -166,7 +186,12 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/cert-basic.Po ./$(DEPDIR)/sha1.Po \
+ ./$(DEPDIR)/t-cms-parser.Po ./$(DEPDIR)/t-crl-parser.Po \
+ ./$(DEPDIR)/t-der-builder.Po ./$(DEPDIR)/t-dnparser.Po \
+ ./$(DEPDIR)/t-ocsp.Po ./$(DEPDIR)/t-oid.Po \
+ ./$(DEPDIR)/t-reader.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -186,10 +211,11 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = cert-basic.c t-cms-parser.c t-crl-parser.c t-dnparser.c \
- $(t_ocsp_SOURCES) t-oid.c
-DIST_SOURCES = cert-basic.c t-cms-parser.c t-crl-parser.c t-dnparser.c \
- $(t_ocsp_SOURCES) t-oid.c
+SOURCES = cert-basic.c t-cms-parser.c t-crl-parser.c t-der-builder.c \
+ t-dnparser.c $(t_ocsp_SOURCES) t-oid.c t-reader.c
+DIST_SOURCES = cert-basic.c t-cms-parser.c t-crl-parser.c \
+ t-der-builder.c t-dnparser.c $(t_ocsp_SOURCES) t-oid.c \
+ t-reader.c
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -237,6 +263,8 @@ am__tty_colors = { \
std=''; \
fi; \
}
+am__DIST_COMMON = $(srcdir)/Makefile.in \
+ $(top_srcdir)/build-aux/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
@@ -256,6 +284,8 @@ CC = @CC@
CCDEPMODE = @CCDEPMODE@
CC_FOR_BUILD = @CC_FOR_BUILD@
CFLAGS = @CFLAGS@
+COVERAGE_CFLAGS = @COVERAGE_CFLAGS@
+COVERAGE_LDFLAGS = @COVERAGE_LDFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
@@ -270,6 +300,9 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
+GCOV = @GCOV@
+GENHTML = @GENHTML@
+GPGRT_CONFIG = @GPGRT_CONFIG@
GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
@@ -285,7 +318,9 @@ KSBA_CONFIG_API_VERSION = @KSBA_CONFIG_API_VERSION@
KSBA_CONFIG_CFLAGS = @KSBA_CONFIG_CFLAGS@
KSBA_CONFIG_HOST = @KSBA_CONFIG_HOST@
KSBA_CONFIG_LIBS = @KSBA_CONFIG_LIBS@
+LCOV = @LCOV@
LD = @LD@
+LDADD_FOR_TESTS_KLUDGE = @LDADD_FOR_TESTS_KLUDGE@
LDFLAGS = @LDFLAGS@
LIBKSBA_LT_AGE = @LIBKSBA_LT_AGE@
LIBKSBA_LT_CURRENT = @LIBKSBA_LT_CURRENT@
@@ -320,9 +355,11 @@ RC = @RC@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
+SHTOOL = @SHTOOL@
STRIP = @STRIP@
VALGRIND = @VALGRIND@
VERSION = @VERSION@
+VERSION_NUMBER = @VERSION_NUMBER@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
@@ -378,26 +415,37 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
TESTS_ENVIRONMENT =
-test_certs = cert_dfn_pca01.der cert_dfn_pca15.der \
- cert_g10code_test1.der crl_testpki_testpca.der \
+test_certs = samples/cert_dfn_pca01.der samples/cert_dfn_pca15.der \
+ samples/cert_g10code_test1.der samples/crl_testpki_testpca.der \
samples/authority.crt samples/betsy.crt samples/bull.crt \
samples/ov-ocsp-server.crt samples/ov-userrev.crt \
samples/ov-root-ca-cert.crt samples/ov-serverrev.crt \
samples/ov-user.crt samples/ov-server.crt \
samples/ov2-root-ca-cert.crt samples/ov2-ocsp-server.crt \
- samples/ov2-user.crt samples/ov2-userrev.crt
+ samples/ov2-user.crt samples/ov2-userrev.crt \
+ samples/secp256r1-sha384_cert.crt \
+ samples/secp256r1-sha512_cert.crt \
+ samples/secp384r1-sha512_cert.crt \
+ samples/openssl-secp256r1ca.cert.crt \
+ samples/ed25519-rfc8410.crt \
+ samples/ed25519-ossl-1.crt \
+ samples/ed448-ossl-1.crt
test_crls = samples/ov-test-crl.crl
test_keys = samples/ov-server.p12 samples/ov-userrev.p12 \
samples/ov-serverrev.p12 samples/ov-user.p12
-EXTRA_DIST = $(test_certs) samples/README mkoidtbl.awk
+EXTRA_DIST = $(test_certs) samples/README mkoidtbl.awk \
+ samples/detached-sig.cms \
+ samples/rsa-sample1.p7m samples/rsa-sample1.p7m.asn \
+ samples/ecdh-sample1.p7m samples/ecdh-sample1.p7m.asn
+
BUILT_SOURCES = oidtranstbl.h
CLEANFILES = oidtranstbl.h
-AM_CFLAGS = $(GPG_ERROR_CFLAGS)
-AM_LDFLAGS = -no-install
+AM_CFLAGS = $(GPG_ERROR_CFLAGS) $(COVERAGE_CFLAGS)
+AM_LDFLAGS = -no-install $(COVERAGE_LDFLAGS)
noinst_HEADERS = t-common.h
-LDADD = ../src/libksba.la $(GPG_ERROR_LIBS)
+LDADD = ../src/libksba.la $(GPG_ERROR_LIBS) @LDADD_FOR_TESTS_KLUDGE@
t_ocsp_SOURCES = t-ocsp.c sha1.c
LOG_COMPILER = $(VALGRIND)
all: $(BUILT_SOURCES)
@@ -417,14 +465,13 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu tests/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -457,6 +504,10 @@ t-crl-parser$(EXEEXT): $(t_crl_parser_OBJECTS) $(t_crl_parser_DEPENDENCIES) $(EX
@rm -f t-crl-parser$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(t_crl_parser_OBJECTS) $(t_crl_parser_LDADD) $(LIBS)
+t-der-builder$(EXEEXT): $(t_der_builder_OBJECTS) $(t_der_builder_DEPENDENCIES) $(EXTRA_t_der_builder_DEPENDENCIES)
+ @rm -f t-der-builder$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(t_der_builder_OBJECTS) $(t_der_builder_LDADD) $(LIBS)
+
t-dnparser$(EXEEXT): $(t_dnparser_OBJECTS) $(t_dnparser_DEPENDENCIES) $(EXTRA_t_dnparser_DEPENDENCIES)
@rm -f t-dnparser$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(t_dnparser_OBJECTS) $(t_dnparser_LDADD) $(LIBS)
@@ -469,19 +520,31 @@ t-oid$(EXEEXT): $(t_oid_OBJECTS) $(t_oid_DEPENDENCIES) $(EXTRA_t_oid_DEPENDENCIE
@rm -f t-oid$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(t_oid_OBJECTS) $(t_oid_LDADD) $(LIBS)
+t-reader$(EXEEXT): $(t_reader_OBJECTS) $(t_reader_DEPENDENCIES) $(EXTRA_t_reader_DEPENDENCIES)
+ @rm -f t-reader$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(t_reader_OBJECTS) $(t_reader_LDADD) $(LIBS)
+
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cert-basic.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-cms-parser.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-crl-parser.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-dnparser.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-ocsp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-oid.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cert-basic.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-cms-parser.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-crl-parser.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-der-builder.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-dnparser.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-ocsp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-oid.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-reader.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -655,7 +718,10 @@ check-TESTS: $(TESTS)
test "$$failed" -eq 0; \
else :; fi
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -730,7 +796,15 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/cert-basic.Po
+ -rm -f ./$(DEPDIR)/sha1.Po
+ -rm -f ./$(DEPDIR)/t-cms-parser.Po
+ -rm -f ./$(DEPDIR)/t-crl-parser.Po
+ -rm -f ./$(DEPDIR)/t-der-builder.Po
+ -rm -f ./$(DEPDIR)/t-dnparser.Po
+ -rm -f ./$(DEPDIR)/t-ocsp.Po
+ -rm -f ./$(DEPDIR)/t-oid.Po
+ -rm -f ./$(DEPDIR)/t-reader.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -776,7 +850,15 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/cert-basic.Po
+ -rm -f ./$(DEPDIR)/sha1.Po
+ -rm -f ./$(DEPDIR)/t-cms-parser.Po
+ -rm -f ./$(DEPDIR)/t-crl-parser.Po
+ -rm -f ./$(DEPDIR)/t-der-builder.Po
+ -rm -f ./$(DEPDIR)/t-dnparser.Po
+ -rm -f ./$(DEPDIR)/t-ocsp.Po
+ -rm -f ./$(DEPDIR)/t-oid.Po
+ -rm -f ./$(DEPDIR)/t-reader.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -797,19 +879,21 @@ uninstall-am:
.MAKE: all check check-am install install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
- clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \
- ctags ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
+ check-am clean clean-generic clean-libtool \
+ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
# Build the OID table: Note that the binary includes data from an
diff --git a/tests/cert-basic.c b/tests/cert-basic.c
index 4d460bc..80377f2 100644
--- a/tests/cert-basic.c
+++ b/tests/cert-basic.c
@@ -51,8 +51,9 @@
#define xfree(a) ksba_free (a)
+static int quiet;
static int verbose;
-static int errorcount = 0;
+static int errorcount;
static void
@@ -67,14 +68,16 @@ print_names (int indent, ksba_name_t name)
if (!name)
{
- fputs ("none\n", stdout);
+ if (!quiet)
+ fputs ("none\n", stdout);
return;
}
for (idx=0; (s = ksba_name_enum (name, idx)); idx++)
{
char *p = ksba_name_get_uri (name, idx);
- printf ("%*s%s\n", idx||indent_all?indent:0, "", p?p:s);
+ if (!quiet)
+ printf ("%*s%s\n", idx||indent_all?indent:0, "", p?p:s);
xfree (p);
}
}
@@ -158,9 +161,10 @@ list_extensions (ksba_cert_t cert)
&oid, &crit, &off, &len));idx++)
{
const char *s = get_oid_desc (oid);
- printf ("Extn: %s%s%s%s at %d with length %d %s\n",
- oid, s?" (":"", s?s:"", s?")":"",
- (int)off, (int)len, crit? "(critical)":"");
+ if (!quiet)
+ printf ("Extn: %s%s%s%s at %d with length %d %s\n",
+ oid, s?" (":"", s?s:"", s?")":"",
+ (int)off, (int)len, crit? "(critical)":"");
}
if (err && gpg_err_code (err) != GPG_ERR_EOF )
{
@@ -174,15 +178,22 @@ list_extensions (ksba_cert_t cert)
err = ksba_cert_get_subj_key_id (cert, NULL, &keyid);
if (!err || gpg_err_code (err) == GPG_ERR_NO_DATA)
{
- fputs ("SubjectKeyIdentifier: ", stdout);
+ if (!quiet)
+ fputs ("SubjectKeyIdentifier: ", stdout);
if (gpg_err_code (err) == GPG_ERR_NO_DATA)
- fputs ("none", stdout);
+ {
+ if (!quiet)
+ fputs ("none\n", stdout);
+ }
else
{
- print_sexp (keyid);
- ksba_free (keyid);
+ if (!quiet)
+ {
+ print_sexp (keyid);
+ putchar ('\n');
+ }
}
- putchar ('\n');
+ ksba_free (keyid);
}
@@ -190,26 +201,37 @@ list_extensions (ksba_cert_t cert)
err = ksba_cert_get_auth_key_id (cert, &keyid, &name1, &serial);
if (!err || gpg_err_code (err) == GPG_ERR_NO_DATA)
{
- fputs ("AuthorityKeyIdentifier: ", stdout);
+ if (!quiet)
+ fputs ("AuthorityKeyIdentifier: ", stdout);
if (gpg_err_code (err) == GPG_ERR_NO_DATA)
- fputs ("none\n", stdout);
+ {
+ if (!quiet)
+ fputs ("none\n", stdout);
+ }
else
{
if (name1)
{
print_names (24, name1);
ksba_name_release (name1);
- fputs (" serial: ", stdout);
- print_sexp (serial);
+ if (!quiet)
+ {
+ fputs (" serial: ", stdout);
+ print_sexp (serial);
+ }
ksba_free (serial);
}
- putchar ('\n');
+ if (!quiet)
+ putchar ('\n');
if (keyid)
{
- fputs (" keyIdentifier: ", stdout);
- print_sexp (keyid);
+ if (!quiet)
+ {
+ fputs (" keyIdentifier: ", stdout);
+ print_sexp (keyid);
+ putchar ('\n');
+ }
ksba_free (keyid);
- putchar ('\n');
}
}
}
@@ -228,18 +250,24 @@ list_extensions (ksba_cert_t cert)
errorcount++;
}
else if (is_ca)
- printf ("This is a CA certificate with a path length of %d\n", pathlen);
+ {
+ if (!quiet)
+ printf ("This is a CA certificate with a path length of %d\n", pathlen);
+ }
err = ksba_cert_get_key_usage (cert, &usage);
if (gpg_err_code (err) == GPG_ERR_NO_DATA)
- printf ("KeyUsage: Not specified\n");
+ {
+ if (!quiet)
+ printf ("KeyUsage: Not specified\n");
+ }
else if (err)
{
fprintf (stderr, "%s:%d: ksba_cert_get_key_usage failed: %s\n",
__FILE__, __LINE__, gpg_strerror (err));
errorcount++;
}
- else
+ else if (!quiet)
{
fputs ("KeyUsage:", stdout);
if ( (usage & KSBA_KEYUSAGE_DIGITAL_SIGNATURE))
@@ -264,7 +292,10 @@ list_extensions (ksba_cert_t cert)
}
err = ksba_cert_get_ext_key_usages (cert, &string);
if (gpg_err_code (err) == GPG_ERR_NO_DATA)
- printf ("ExtKeyUsages: none\n");
+ {
+ if (!quiet)
+ printf ("ExtKeyUsages: none\n");
+ }
else if (err)
{
fprintf (stderr, "%s:%d: ksba_cert_ext_key_usages failed: %s\n",
@@ -273,15 +304,21 @@ list_extensions (ksba_cert_t cert)
}
else
{
- fputs ("ExtKeyUsages: ", stdout);
- print_oid_list (14, string);
+ if (!quiet)
+ {
+ fputs ("ExtKeyUsages: ", stdout);
+ print_oid_list (14, string);
+ }
xfree (string);
}
err = ksba_cert_get_cert_policies (cert, &string);
if (gpg_err_code (err) == GPG_ERR_NO_DATA)
- printf ("CertificatePolicies: none\n");
+ {
+ if (!quiet)
+ printf ("CertificatePolicies: none\n");
+ }
else if (err)
{
fprintf (stderr, "%s:%d: ksba_cert_get_cert_policies failed: %s\n",
@@ -290,14 +327,17 @@ list_extensions (ksba_cert_t cert)
}
else
{
- /* for display purposes we replace the linefeeds by commas */
- for (p=string; *p; p++)
+ if (!quiet)
{
- if (*p == '\n')
- *p = ',';
+ /* for display purposes we replace the linefeeds by commas */
+ for (p=string; *p; p++)
+ {
+ if (*p == '\n')
+ *p = ',';
+ }
+ fputs ("CertificatePolicies: ", stdout);
+ print_oid_list (21, string);
}
- fputs ("CertificatePolicies: ", stdout);
- print_oid_list (21, string);
xfree (string);
}
@@ -306,27 +346,31 @@ list_extensions (ksba_cert_t cert)
&name1, &name2,
&reason));idx++)
{
- fputs ("CRLDistPoint: ", stdout);
+ if (!quiet)
+ fputs ("CRLDistPoint: ", stdout);
print_names (14, name1);
- fputs (" reasons:", stdout);
- if ( !reason )
- fputs (" none", stdout);
- if ( (reason & KSBA_CRLREASON_UNSPECIFIED))
- fputs (" unused", stdout);
- if ( (reason & KSBA_CRLREASON_KEY_COMPROMISE))
- fputs (" keyCompromise", stdout);
- if ( (reason & KSBA_CRLREASON_CA_COMPROMISE))
- fputs (" caCompromise", stdout);
- if ( (reason & KSBA_CRLREASON_AFFILIATION_CHANGED))
- fputs (" affiliationChanged", stdout);
- if ( (reason & KSBA_CRLREASON_SUPERSEDED))
- fputs (" superseded", stdout);
- if ( (reason & KSBA_CRLREASON_CESSATION_OF_OPERATION))
- fputs (" cessationOfOperation", stdout);
- if ( (reason & KSBA_CRLREASON_CERTIFICATE_HOLD))
- fputs (" certificateHold", stdout);
- putchar ('\n');
- fputs (" issuer: ", stdout);
+ if (!quiet)
+ {
+ fputs (" reasons:", stdout);
+ if ( !reason )
+ fputs (" none", stdout);
+ if ( (reason & KSBA_CRLREASON_UNSPECIFIED))
+ fputs (" unused", stdout);
+ if ( (reason & KSBA_CRLREASON_KEY_COMPROMISE))
+ fputs (" keyCompromise", stdout);
+ if ( (reason & KSBA_CRLREASON_CA_COMPROMISE))
+ fputs (" caCompromise", stdout);
+ if ( (reason & KSBA_CRLREASON_AFFILIATION_CHANGED))
+ fputs (" affiliationChanged", stdout);
+ if ( (reason & KSBA_CRLREASON_SUPERSEDED))
+ fputs (" superseded", stdout);
+ if ( (reason & KSBA_CRLREASON_CESSATION_OF_OPERATION))
+ fputs (" cessationOfOperation", stdout);
+ if ( (reason & KSBA_CRLREASON_CERTIFICATE_HOLD))
+ fputs (" certificateHold", stdout);
+ putchar ('\n');
+ fputs (" issuer: ", stdout);
+ }
print_names (14, name2);
ksba_name_release (name1);
ksba_name_release (name2);
@@ -343,8 +387,11 @@ list_extensions (ksba_cert_t cert)
&string, &name1))
; idx++)
{
- fputs ("authorityInfoAccess: ", stdout);
- print_oid_and_desc (string, 1);
+ if (!quiet)
+ {
+ fputs ("authorityInfoAccess: ", stdout);
+ print_oid_and_desc (string, 1);
+ }
print_names (-21, name1);
ksba_name_release (name1);
ksba_free (string);
@@ -362,8 +409,11 @@ list_extensions (ksba_cert_t cert)
&string, &name1))
; idx++)
{
- fputs ("subjectInfoAccess: ", stdout);
- print_oid_and_desc (string, 1);
+ if (!quiet)
+ {
+ fputs ("subjectInfoAccess: ", stdout);
+ print_oid_and_desc (string, 1);
+ }
print_names (-19, name1);
ksba_name_release (name1);
ksba_free (string);
@@ -413,43 +463,59 @@ one_file (const char *fname)
err = ksba_cert_read_der (cert, r);
fail_if_err2 (fname, err);
- printf ("Certificate in `%s':\n", fname);
+ if (!quiet)
+ printf ("Certificate in `%s':\n", fname);
sexp = ksba_cert_get_serial (cert);
- fputs (" serial....: ", stdout);
- print_sexp (sexp);
+ if (!quiet)
+ {
+ fputs (" serial....: ", stdout);
+ print_sexp (sexp);
+ putchar ('\n');
+ }
ksba_free (sexp);
- putchar ('\n');
for (idx=0;(dn = ksba_cert_get_issuer (cert, idx));idx++)
{
- fputs (idx?" aka: ":" issuer....: ", stdout);
- print_dn (dn);
+ if (!quiet)
+ {
+ fputs (idx?" aka: ":" issuer....: ", stdout);
+ print_dn (dn);
+ putchar ('\n');
+ }
ksba_free (dn);
- putchar ('\n');
}
for (idx=0;(dn = ksba_cert_get_subject (cert, idx));idx++)
{
- fputs (idx?" aka: ":" subject...: ", stdout);
- print_dn (dn);
+ if (!quiet)
+ {
+ fputs (idx?" aka: ":" subject...: ", stdout);
+ print_dn (dn);
+ putchar ('\n');
+ }
ksba_free (dn);
- putchar ('\n');
}
ksba_cert_get_validity (cert, 0, t);
- fputs (" notBefore.: ", stdout);
- print_time (t);
- putchar ('\n');
+ if (!quiet)
+ {
+ fputs (" notBefore.: ", stdout);
+ print_time (t);
+ putchar ('\n');
+ }
ksba_cert_get_validity (cert, 1, t);
- fputs (" notAfter..: ", stdout);
- print_time (t);
- putchar ('\n');
-
+ if (!quiet)
+ {
+ fputs (" notAfter..: ", stdout);
+ print_time (t);
+ putchar ('\n');
+ }
oid = ksba_cert_get_digest_algo (cert);
s = get_oid_desc (oid);
- printf (" hash algo.: %s%s%s%s\n",
- oid?oid:"(null)", s?" (":"",s?s:"",s?")":"");
+ if (!quiet)
+ printf (" hash algo.: %s%s%s%s\n",
+ oid?oid:"(null)", s?" (":"",s?s:"",s?")":"");
/* Under Windows the _ksba_keyinfo_from_sexp are not exported. */
#ifndef __WIN32
@@ -476,7 +542,7 @@ one_file (const char *fname)
putchar ('\n');
}
- err = _ksba_keyinfo_from_sexp (public, &der, &derlen);
+ err = _ksba_keyinfo_from_sexp (public, 0, &der, &derlen);
if (err)
{
fprintf (stderr, "%s:%d: converting public key failed: %s\n",
@@ -506,7 +572,7 @@ one_file (const char *fname)
unsigned char *der2;
size_t derlen2;
- err = _ksba_keyinfo_from_sexp (tmp, &der2, &derlen2);
+ err = _ksba_keyinfo_from_sexp (tmp, 0, &der2, &derlen2);
if (err)
{
fprintf (stderr, "%s:%d: re-re-converting "
@@ -521,7 +587,9 @@ one_file (const char *fname)
__FILE__, __LINE__);
errorcount++;
xfree (der2);
- } else {
+ }
+ else
+ {
/* Don't leak memory if everything is ok. */
xfree (der2);
}
@@ -539,8 +607,8 @@ one_file (const char *fname)
sexp = ksba_cert_get_sig_val (cert);
fputs (" sigval....: ", stdout);
print_sexp (sexp);
- ksba_free (sexp);
putchar ('\n');
+ ksba_free (sexp);
}
list_extensions (cert);
@@ -558,7 +626,8 @@ one_file (const char *fname)
errorcount++;
}
- putchar ('\n');
+ if (!quiet)
+ putchar ('\n');
ksba_cert_release (cert);
ksba_reader_release (r);
fclose (fp);
@@ -598,17 +667,40 @@ main (int argc, char **argv)
"cert_dfn_pca01.der",
"cert_dfn_pca15.der",
"cert_g10code_test1.der",
+ "authority.crt",
+ "betsy.crt",
+ "bull.crt",
+ "ov-ocsp-server.crt",
+ "ov-userrev.crt",
+ "ov-root-ca-cert.crt",
+ "ov-serverrev.crt",
+ "ov-user.crt",
+ "ov-server.crt",
+ "ov2-root-ca-cert.crt",
+ "ov2-ocsp-server.crt",
+ "ov2-user.crt",
+ "ov2-userrev.crt",
+ "secp256r1-sha384_cert.crt",
+ "secp256r1-sha512_cert.crt",
+ "secp384r1-sha512_cert.crt",
+ "openssl-secp256r1ca.cert.crt",
+ "ed25519-rfc8410.crt",
+ "ed25519-ossl-1.crt",
+ "ed448-ossl-1.crt",
NULL
};
int idx;
+ if (!verbose)
+ quiet = 1;
+
for (idx=0; files[idx]; idx++)
{
char *fname;
- fname = xmalloc (strlen (srcdir) + 1 + strlen (files[idx]) + 1);
+ fname = xmalloc (strlen (srcdir) + 10 + strlen (files[idx]) + 1);
strcpy (fname, srcdir);
- strcat (fname, "/");
+ strcat (fname, "/samples/");
strcat (fname, files[idx]);
one_file (fname);
ksba_free (fname);
diff --git a/tests/samples/README b/tests/samples/README
index 1855ae3..db2a1d3 100644
--- a/tests/samples/README
+++ b/tests/samples/README
@@ -1,4 +1,10 @@
+Sample data used for the initial development:
+ cert_dfn_pca01.der
+ cert_dfn_pca15.der
+ cert_g10code_test1.der
+ crl_testpki_testpca.der
+ detached_sig.cms
Certificates downloaded from http://www.magmacom.com/~mbartel/iso/\
certificates/samples/sample_certificates.html on 2003-11-20:
@@ -10,7 +16,7 @@ certificates/samples/sample_certificates.html on 2003-11-20:
Note, that these certs use MD2.
-Certificates downloaded from
+Certificates downloaded from
http://www.openvalidation.org/download/downloadrootcertsCA1.htm and
on 2003-11-20 and prefixed with "ov-":
@@ -43,7 +49,7 @@ http://dev.experimentalstuff.com:8082/CIC_sample-certs_2006-06-22.zip
and converted to binary format. These are signed with
ECDSA-P256-SHA384, ECDSA-P256-SHA512, and ECDSA-P384-SHA512.
- secp256r1-sha384_cert.crt
+ secp256r1-sha384_cert.crt
secp256r1-sha512_cert.crt
secp384r1-sha512_cert.crt
@@ -51,3 +57,34 @@ From http://dev.experimentalstuff.com:8082/certs/secp256r1ca.cert.pem
openssl-secp256r1ca.cert.crt
+ECDH sample enveloped data from the Mozilla bug tracker:
+
+ ecdh-sample1.p7m
+ ecdh-sample1.p7m.asn Commented dump.
+
+RSA sample enveloped data created with gpgsm
+
+ rsa-sample1.p7m
+ rsa-sample1.p7m.asn Commented dump
+
+RSA sample signature created with gpgsm
+
+ rsa-sample1.p7s
+ rsa-sample1.p7s.asn Commented dump
+
+ECDSA sample signature created with Governikus Signer
+
+ ecdsa-sample1.p7s signed data is hitchhiker.txt
+ ecdsa-sample1.p7s.asn Commented dump
+
+ED25519 sample self-signed certificates
+
+ ed25519-rfc8410.crt from RFC8410
+ ed25519-rfc8410.key
+ ed25519-ossl-1.crt generated with OpenSSL
+ ed25519-ossl-1.key
+
+ED448 sample self-signed certificate
+
+ ed448-ossl-1.crt generated with OpenSSL
+ ed448-ossl-1.key generated with OpenSSL
diff --git a/tests/cert_dfn_pca01.der b/tests/samples/cert_dfn_pca01.der
index 4c8593c..4c8593c 100644
--- a/tests/cert_dfn_pca01.der
+++ b/tests/samples/cert_dfn_pca01.der
Binary files differ
diff --git a/tests/cert_dfn_pca15.der b/tests/samples/cert_dfn_pca15.der
index c28f137..c28f137 100644
--- a/tests/cert_dfn_pca15.der
+++ b/tests/samples/cert_dfn_pca15.der
Binary files differ
diff --git a/tests/cert_g10code_test1.der b/tests/samples/cert_g10code_test1.der
index 67c7db6..67c7db6 100644
--- a/tests/cert_g10code_test1.der
+++ b/tests/samples/cert_g10code_test1.der
Binary files differ
diff --git a/tests/crl_testpki_testpca.der b/tests/samples/crl_testpki_testpca.der
index 0cddb76..0cddb76 100644
--- a/tests/crl_testpki_testpca.der
+++ b/tests/samples/crl_testpki_testpca.der
Binary files differ
diff --git a/tests/samples/detached-sig.cms b/tests/samples/detached-sig.cms
new file mode 100644
index 0000000..9b31d88
--- /dev/null
+++ b/tests/samples/detached-sig.cms
Binary files differ
diff --git a/tests/samples/ecdh-sample1.p7m b/tests/samples/ecdh-sample1.p7m
new file mode 100644
index 0000000..4ec30c6
--- /dev/null
+++ b/tests/samples/ecdh-sample1.p7m
Binary files differ
diff --git a/tests/samples/ecdh-sample1.p7m.asn b/tests/samples/ecdh-sample1.p7m.asn
new file mode 100644
index 0000000..d6868fa
--- /dev/null
+++ b/tests/samples/ecdh-sample1.p7m.asn
@@ -0,0 +1,95 @@
+ 0 443: SEQUENCE {
+ 4 9: OBJECT IDENTIFIER envelopedData (1 2 840 113549 1 7 3)
+ 15 428: [0] { -- content
+ 19 424: SEQUENCE {
+ 23 1: INTEGER 2
+ 26 323: SET {
+ 30 319: [1] { -- kari
+ 34 1: INTEGER 3
+ 37 113: [0] { -- originator
+ 39 111: [1] { -- choice originatorKey
+ 41 9: SEQUENCE { -- algorithm
+ 43 7: OBJECT IDENTIFIER ecPublicKey (1 2 840 10045 2 1)
+ : }
+ 52 98: BIT STRING -- publicKey (ephemeral public key)
+ : 04 A8 21 3B BD A2 18 85 63 B2 FA D1 46 94 05 3F
+ : EF 1F B0 47 29 69 69 B5 F4 50 B2 34 E1 3C AB EE
+ : EA E2 30 EB 46 E3 DD 4A 2B 15 B7 9D EF 3C 39 E1
+ : 36 39 0D E9 66 AE 18 59 E3 05 CC F0 42 0F 3F EC
+ : 51 8F 0C BB 0B DE 51 19 CE 06 4D BF 97 61 CF BF
+ : 24 BF BF F7 B2 54 7C EC 0C 65 41 DD 10 FE 95 B5
+ : A4
+ : }
+ : } -- end originator
+152 21: SEQUENCE { -- keyEncryptionAlgorithm
+154 6: OBJECT IDENTIFIER '1 3 132 1 11 1' -- (certicom)
+-- 11.1 := dhSinglePass-stdDH-sha256kdf-scheme
+-- 11.2 := dhSinglePass-stdDH-sha384kdf-scheme
+-- 11.3 := dhSinglePass-stdDH-sha512kdf-scheme
+162 11: SEQUENCE { -- keyWrapAlgorithm
+164 9: OBJECT IDENTIFIER aes128-wrap (2 16 840 1 101 3 4 1 5)
+-- 1.5 := aes128-wrap
+-- 1.25 := aes192-wrap
+-- 1.45 := aes256-wrap
+ : }
+ : }
+175 175: SEQUENCE { -- recipientEncryptedKeys
+178 172: SEQUENCE { -- recipientEncryptedKey
+181 143: SEQUENCE { -- rid.issuerAndSerialNumber
+184 119: SEQUENCE {
+186 11: SET {
+188 9: SEQUENCE {
+190 3: OBJECT IDENTIFIER countryName (2 5 4 6)
+195 2: PrintableString 'US'
+ : }
+ : }
+199 19: SET {
+201 17: SEQUENCE {
+203 3: OBJECT IDENTIFIER stateOrProvinceName (2 5 4 8)
+208 10: PrintableString 'California'
+ : }
+ : }
+220 22: SET {
+222 20: SEQUENCE {
+224 3: OBJECT IDENTIFIER localityName (2 5 4 7)
+229 13: PrintableString 'Mountain View'
+ : }
+ : }
+244 18: SET {
+246 16: SEQUENCE {
+248 3: OBJECT IDENTIFIER organizationName (2 5 4 10)
+253 9: PrintableString 'BOGUS NSS'
+ : }
+ : }
+264 39: SET {
+266 37: SEQUENCE {
+268 3: OBJECT IDENTIFIER commonName (2 5 4 3)
+273 30: PrintableString 'NSS Pregenerated Test CA (ECC)'
+ : }
+ : }
+ : }
+305 20: INTEGER
+ : 74 5D C1 8C 19 D4 40 13 83 BE FC 5F 6E D2 BA D1
+ : BE AE F5 09
+ : } -- end rid.issuerAndSerialNumber
+327 24: OCTET STRING -- encryptedKey
+ : 80 0F 02 BC 0A 4A 52 EB 8A FF 51 B7 4E 88 DA 52
+ : F7 EF AA 29 B0 26 13 E0
+ : } -- end recipientEncryptedKey
+ : } -- end recipientEncryptedKeys
+ : } -- end kari
+ : } -- end set
+353 92: SEQUENCE { -- encryptedContentInfo
+355 9: OBJECT IDENTIFIER data (1 2 840 113549 1 7 1) --type
+366 29: SEQUENCE { -- contentEncryptionAlgorithm
+368 9: OBJECT IDENTIFIER aes128-CBC (2 16 840 1 101 3 4 1 2)
+379 16: OCTET STRING B1 55 96 AD B3 05 C8 64 69 4F 55 C8 9C 37 3A DF
+ : }
+397 48: [0] -- encryptedContent
+ : 39 C9 BE CA 2C 99 58 ED F6 66 8F 96 A2 69 C8 58
+ : 32 FC 84 67 7C 79 B6 F4 05 9E 35 C7 CC 4A 79 6E
+ : 89 97 94 CF 9E 30 EE E1 AC DF A1 D9 C2 EC 72 9C
+ : }
+ : }
+ : }
+ : }
diff --git a/tests/samples/ed25519-ossl-1.crt b/tests/samples/ed25519-ossl-1.crt
new file mode 100644
index 0000000..7e07c72
--- /dev/null
+++ b/tests/samples/ed25519-ossl-1.crt
Binary files differ
diff --git a/tests/samples/ed25519-rfc8410.crt b/tests/samples/ed25519-rfc8410.crt
new file mode 100644
index 0000000..d0c5ae6
--- /dev/null
+++ b/tests/samples/ed25519-rfc8410.crt
Binary files differ
diff --git a/tests/samples/ed448-ossl-1.crt b/tests/samples/ed448-ossl-1.crt
new file mode 100644
index 0000000..abafcef
--- /dev/null
+++ b/tests/samples/ed448-ossl-1.crt
Binary files differ
diff --git a/tests/samples/openssl-secp256r1ca.cert.crt b/tests/samples/openssl-secp256r1ca.cert.crt
new file mode 100644
index 0000000..76b4842
--- /dev/null
+++ b/tests/samples/openssl-secp256r1ca.cert.crt
Binary files differ
diff --git a/tests/samples/rsa-sample1.p7m b/tests/samples/rsa-sample1.p7m
new file mode 100644
index 0000000..7fd700d
--- /dev/null
+++ b/tests/samples/rsa-sample1.p7m
Binary files differ
diff --git a/tests/samples/rsa-sample1.p7m.asn b/tests/samples/rsa-sample1.p7m.asn
new file mode 100644
index 0000000..a311aae
--- /dev/null
+++ b/tests/samples/rsa-sample1.p7m.asn
@@ -0,0 +1,96 @@
+ 0 NDEF: SEQUENCE {
+ 2 9: OBJECT IDENTIFIER envelopedData (1 2 840 113549 1 7 3)
+ 13 NDEF: [0] { -- content
+ 15 NDEF: SEQUENCE {
+ 17 1: INTEGER 0 -- version CMSVersion
+ 20 538: SET { -- recipientInfos
+ 24 534: SEQUENCE { -- ktri
+ 28 1: INTEGER 0 -- version
+ 31 126: SEQUENCE { -- rid.issuerAndSerialNumber
+ 33 120: SEQUENCE {
+ 35 11: SET {
+ 37 9: SEQUENCE {
+ 39 3: OBJECT IDENTIFIER countryName (2 5 4 6)
+ 44 2: PrintableString 'DE'
+ : }
+ : }
+ 48 22: SET {
+ 50 20: SEQUENCE {
+ 52 3: OBJECT IDENTIFIER organizationName (2 5 4 10)
+ 57 13: PrintableString 'g10 Code GmbH'
+ : }
+ : }
+ 72 16: SET {
+ 74 14: SEQUENCE {
+ 76 3: OBJECT IDENTIFIER organizationalUnitName (2 5 4 11)
+ 81 7: PrintableString 'Testlab'
+ : }
+ : }
+ 90 30: SET {
+ 92 28: SEQUENCE {
+ 94 3: OBJECT IDENTIFIER commonName (2 5 4 3)
+ 99 21: PrintableString 'g10 Code TEST CA 2019'
+ : }
+ : }
+ 122 31: SET {
+ 124 29: SEQUENCE {
+ 126 9: OBJECT IDENTIFIER
+ : emailAddress (1 2 840 113549 1 9 1)
+ 137 16: IA5String 'info@g10code.com'
+ : }
+ : }
+ : }
+ 155 2: INTEGER 6660
+ : } -- end rid.issuerAndSerialNumber
+ 159 13: SEQUENCE { -- keyEncryptionAlgorithm
+ 161 9: OBJECT IDENTIFIER rsaEncryption (1 2 840 113549 1 1 1)
+ 172 0: NULL
+ : }
+ 174 384: OCTET STRING -- encryptedKey
+ : 4F E8 F7 AF BD 6D 0A C0 96 69 A6 51 27 9A E9 D8
+ : D4 95 FA E2 88 7B FF 72 09 89 56 E5 57 17 EA 31
+ : 65 8D 14 14 06 3A 30 05 C5 46 3F 47 F3 D0 14 8B
+ : D9 9B 4B EA 09 26 F8 3E 6B 8B A5 EC 97 FE 77 9A
+ : 43 BC 6D 16 0C 5F 6E AA 1D 12 A8 C9 5F 41 A0 D6
+ : 65 19 CF EA 4C BE 9C 15 D4 B6 90 93 96 31 99 03
+ : 85 EF 43 0E 6E 4E 07 C7 F9 46 B4 22 81 B2 52 73
+ : C8 0B 90 E7 F4 6D 15 61 79 0B D2 AA A2 F4 29 45
+ : 67 10 0E 39 E3 6B 5F BF 3A F3 E8 39 66 87 1A 49
+ : 12 1E 03 24 BF F6 26 7F 81 04 DC 52 DE 44 E5 5F
+ : 73 FA 7C 22 9E 55 D4 E3 EA 74 71 7F E0 07 EE 10
+ : CF 35 7F 7D DE 64 6B A6 43 33 2A 74 96 23 D0 46
+ : D3 F6 05 61 55 84 8C 98 EC FA 53 21 83 6E FE 6A
+ : 2A 2C 91 81 FD 4C 9A C5 C5 AB 55 89 98 64 54 33
+ : CF A2 9B 1D FB 5A DE D6 B5 2A 11 5D 47 9C B5 37
+ : AE 22 49 97 3B F4 9F E7 F7 5C 57 27 42 39 35 0B
+ : 3B 23 59 01 90 58 70 C0 06 FB DB 11 AE 57 9E AE
+ : 5F 1B 9B 2C 8C 9A EE 31 EB 69 F0 AE A4 68 54 18
+ : 68 4B 69 6A 7A 86 9E 60 86 80 20 51 A0 EC 8C 7D
+ : 18 7B FA 44 64 E9 4E D7 6A FA C0 AB 90 7A B3 E3
+ : 02 B9 FF 45 6F 6F B5 0C E3 D1 F2 F9 6E 05 BD E0
+ : D7 A9 BB 10 DF A9 A4 13 65 3D DB 42 F3 04 7F 9E
+ : 62 6B 75 BE 89 6E 85 04 EF 38 DB 64 44 09 5C 64
+ : 79 73 99 F3 DD EB 16 BA 06 C2 92 84 A8 6B 7B 86
+ : } -- end ktri
+ : } -- end recipientInfos
+ 562 NDEF: SEQUENCE { --encryptedContentInfo
+ 564 9: OBJECT IDENTIFIER data (1 2 840 113549 1 7 1)
+ 575 29: SEQUENCE { -- contentEncryptionAlgorithm
+ 577 9: OBJECT IDENTIFIER aes128-CBC (2 16 840 1 101 3 4 1 2)
+ 588 16: OCTET STRING A1 53 A3 8D A7 3A 23 5F 1D 46 10 8D 56 00 BC 3C
+ : }
+ 606 NDEF: [0] { -- encryptedContent
+ 608 112: OCTET STRING
+ : DA 9F 04 37 3F C5 7F 47 45 88 D6 04 AE 28 8E 98
+ : 99 14 DD C1 DC 0A A9 18 38 BC 96 6D 05 AA 6F 82
+ : BB 10 06 55 CF 43 0D 97 AB 6C 30 9A 70 1F BE D2
+ : 35 A5 2E 96 F2 BC 4F 57 12 2F 2A FD 72 7A 79 CA
+ : 9E 76 A5 05 62 47 0B 36 25 59 EE 1C 9F 7F 82 39
+ : F6 58 91 3C 3B 97 A1 3E 5B A4 FA 6D 54 75 AF D8
+ : 68 3F 24 52 56 C1 3D 88 39 53 0E 68 DD F8 5A 38
+ 722 16: OCTET STRING F4 3A D1 CC 9A 64 31 C8 B7 3E ED F7 B9 FF 8F DC
+ : }
+ : }
+ : }
+ : }
+ : }
diff --git a/tests/samples/secp256r1-sha384_cert.crt b/tests/samples/secp256r1-sha384_cert.crt
new file mode 100644
index 0000000..c02e7ea
--- /dev/null
+++ b/tests/samples/secp256r1-sha384_cert.crt
Binary files differ
diff --git a/tests/samples/secp256r1-sha512_cert.crt b/tests/samples/secp256r1-sha512_cert.crt
new file mode 100644
index 0000000..36b50a6
--- /dev/null
+++ b/tests/samples/secp256r1-sha512_cert.crt
Binary files differ
diff --git a/tests/samples/secp384r1-sha512_cert.crt b/tests/samples/secp384r1-sha512_cert.crt
new file mode 100644
index 0000000..d9853c7
--- /dev/null
+++ b/tests/samples/secp384r1-sha512_cert.crt
Binary files differ
diff --git a/tests/t-cms-parser.c b/tests/t-cms-parser.c
index e912aea..3fe64fe 100644
--- a/tests/t-cms-parser.c
+++ b/tests/t-cms-parser.c
@@ -28,6 +28,11 @@
#include "t-common.h"
+
+static int quiet;
+static int verbose;
+
+
void
dummy_hash_fnc (void *arg, const void *buffer, size_t length)
{
@@ -64,7 +69,8 @@ one_file (const char *fname)
char *dn;
int idx;
- printf ("*** checking `%s' ***\n", fname);
+ if (!quiet)
+ printf ("*** checking `%s' ***\n", fname);
fp = fopen (fname, "r");
if (!fp)
{
@@ -94,9 +100,11 @@ one_file (const char *fname)
case KSBA_CT_DIGESTED_DATA: s = "digested data"; break;
case KSBA_CT_ENCRYPTED_DATA: s = "encrypted data"; break;
case KSBA_CT_AUTH_DATA: s = "auth data"; break;
+ case KSBA_CT_SPC_IND_DATA_CTX:s = "spc indirect data context"; break;
default: s = "unknown"; break;
}
- printf ("identified as: %s\n", s);
+ if (!quiet)
+ printf ("identified as: %s\n", s);
err = ksba_cms_new (&cms);
if (err)
@@ -107,24 +115,33 @@ one_file (const char *fname)
err = ksba_cms_parse (cms, &stopreason);
fail_if_err2 (fname, err);
- printf ("stop reason: %d\n", stopreason);
+ if (!quiet)
+ printf ("stop reason: %d\n", stopreason);
s = ksba_cms_get_content_oid (cms, 0);
- printf ("ContentType: %s\n", s?s:"none");
+ if (!quiet)
+ printf ("ContentType: %s\n", s?s:"none");
err = ksba_cms_parse (cms, &stopreason);
fail_if_err2 (fname, err);
- printf ("stop reason: %d\n", stopreason);
+ if (!quiet)
+ printf ("stop reason: %d\n", stopreason);
s = ksba_cms_get_content_oid (cms, 1);
- printf ("EncapsulatedContentType: %s\n", s?s:"none");
- printf ("DigestAlgorithms:");
+ if (!quiet)
+ {
+ printf ("EncapsulatedContentType: %s\n", s?s:"none");
+ printf ("DigestAlgorithms:");
+ }
for (i=0; (algoid = ksba_cms_get_digest_algo_list (cms, i)); i++)
- printf (" %s", algoid);
- putchar('\n');
+ if (!quiet)
+ printf (" %s", algoid);
+ if (!quiet)
+ putchar('\n');
if (stopreason == KSBA_SR_NEED_HASH)
- printf("Detached signature\n");
+ if (!quiet)
+ printf("Detached signature\n");
ksba_cms_set_hash_function (cms, dummy_hash_fnc, NULL);
@@ -132,7 +149,8 @@ one_file (const char *fname)
{
err = ksba_cms_parse (cms, &stopreason);
fail_if_err2 (fname, err);
- printf ("stop reason: %d\n", stopreason);
+ if (!quiet)
+ printf ("stop reason: %d\n", stopreason);
}
while (stopreason != KSBA_SR_READY);
@@ -146,17 +164,28 @@ one_file (const char *fname)
break; /* ready */
fail_if_err2 (fname, err);
- printf ("recipient %d - issuer: ", idx);
- print_dn (dn);
+ if (!quiet)
+ {
+ printf ("recipient %d - issuer: ", idx);
+ print_dn (dn);
+ }
ksba_free (dn);
- putchar ('\n');
- printf ("recipient %d - serial: ", idx);
- print_sexp_hex (p);
+ if (!quiet)
+ {
+ putchar ('\n');
+ printf ("recipient %d - serial: ", idx);
+ print_sexp_hex (p);
+ putchar ('\n');
+ }
ksba_free (p);
- putchar ('\n');
dn = ksba_cms_get_enc_val (cms, idx);
- printf ("recipient %d - enc_val %s\n", idx, dn? "found": "missing");
+ if (!quiet)
+ {
+ printf ("recipient %d - enc_val: ", idx);
+ print_sexp (dn);
+ putchar ('\n');
+ }
ksba_free (dn);
}
}
@@ -167,26 +196,37 @@ one_file (const char *fname)
err = ksba_cms_get_issuer_serial (cms, idx, &dn, &p);
if (gpg_err_code (err) == GPG_ERR_NO_DATA && !idx)
{
- printf ("this is a certs-only message\n");
+ if (!quiet)
+ printf ("this is a certs-only message\n");
break;
}
fail_if_err2 (fname, err);
- printf ("signer %d - issuer: ", idx);
- print_dn (dn);
+ if (!quiet)
+ {
+ printf ("signer %d - issuer: ", idx);
+ print_dn (dn);
+ putchar ('\n');
+ }
ksba_free (dn);
- putchar ('\n');
- printf ("signer %d - serial: ", idx);
- print_sexp_hex (p);
+
+ if (!quiet)
+ {
+ printf ("signer %d - serial: ", idx);
+ print_sexp_hex (p);
+ putchar ('\n');
+ }
ksba_free (p);
- putchar ('\n');
err = ksba_cms_get_message_digest (cms, idx, &dn, &n);
fail_if_err2 (fname, err);
- printf ("signer %d - messageDigest: ", idx);
- print_hex (dn, n);
+ if (!quiet)
+ {
+ printf ("signer %d - messageDigest: ", idx);
+ print_hex (dn, n);
+ putchar ('\n');
+ }
ksba_free (dn);
- putchar ('\n');
err = ksba_cms_get_sigattr_oids (cms, idx,
"1.2.840.113549.1.9.3",&dn);
@@ -199,27 +239,36 @@ one_file (const char *fname)
for (tmp=dn; *tmp; tmp++)
if (*tmp == '\n')
*tmp = ' ';
- printf ("signer %d - content-type: %s\n", idx, dn);
+ if (!quiet)
+ printf ("signer %d - content-type: %s\n", idx, dn);
ksba_free (dn);
}
algoid = ksba_cms_get_digest_algo (cms, idx);
- printf ("signer %d - digest algo: %s\n", idx, algoid?algoid:"?");
+ if (!quiet)
+ printf ("signer %d - digest algo: %s\n", idx, algoid?algoid:"?");
dn = ksba_cms_get_sig_val (cms, idx);
if (dn)
{
- printf ("signer %d - signature: ", idx);
- print_sexp (dn);
- putchar ('\n');
+ if (!quiet)
+ {
+ printf ("signer %d - signature: ", idx);
+ print_sexp (dn);
+ putchar ('\n');
+ }
}
else
- printf ("signer %d - signature not found\n", idx);
+ {
+ if (!quiet)
+ printf ("signer %d - signature not found\n", idx);
+ }
ksba_free (dn);
}
}
ksba_cms_release (cms);
+ ksba_writer_release (w);
ksba_reader_release (r);
fclose (fp);
}
@@ -230,10 +279,27 @@ one_file (const char *fname)
int
main (int argc, char **argv)
{
- if (argc > 1)
- one_file (argv[1]);
+ if (argc)
+ {
+ argc--; argv++;
+ }
+ if (argc && !strcmp (*argv, "--verbose"))
+ {
+ verbose = 1;
+ argc--; argv++;
+ }
+
+ if (argc)
+ one_file (argv[0]);
else
- one_file ("x.ber");
+ {
+ char *fname = prepend_srcdir ("samples/detached-sig.cms");
+
+ if (!verbose)
+ quiet = 1;
+ one_file (fname);
+ free(fname);
+ }
/*one_file ("pkcs7-1.ber");*/
/*one_file ("root-cert-2.der"); should fail */
diff --git a/tests/t-crl-parser.c b/tests/t-crl-parser.c
index 9fee61f..5e23b55 100644
--- a/tests/t-crl-parser.c
+++ b/tests/t-crl-parser.c
@@ -34,6 +34,11 @@
#include "t-common.h"
#include "oidtranstbl.h"
+
+static int quiet;
+static int verbose;
+
+
static void
my_hasher (void *arg, const void *buffer, size_t length)
{
@@ -74,14 +79,16 @@ print_names (int indent, ksba_name_t name)
if (!name)
{
- fputs ("none\n", stdout);
+ if (!quiet)
+ fputs ("none\n", stdout);
return;
}
for (idx=0; (s = ksba_name_enum (name, idx)); idx++)
{
char *p = ksba_name_get_uri (name, idx);
- printf ("%*s%s\n", idx||indent_all?indent:0, "", p?p:s);
+ if (!quiet)
+ printf ("%*s%s\n", idx||indent_all?indent:0, "", p?p:s);
xfree (p);
}
}
@@ -100,6 +107,7 @@ one_file (const char *fname)
FILE *hashlog = NULL;
#ifdef ENABLE_HASH_LOGGING
+ if (1)
{
char *buf;
@@ -112,8 +120,9 @@ one_file (const char *fname)
}
#endif
- printf ("*** checking `%s' ***\n", fname);
- fp = fopen (fname, "r");
+ if (!quiet)
+ printf ("*** checking `%s' ***\n", fname);
+ fp = fopen (fname, "rb");
if (!fp)
{
fprintf (stderr, "%s:%d: can't open `%s': %s\n",
@@ -150,23 +159,45 @@ one_file (const char *fname)
ksba_isotime_t this, next;
algoid = ksba_crl_get_digest_algo (crl);
- printf ("digest algo: %s\n", algoid? algoid : "[none]");
+ if (!quiet)
+ printf ("digest algo: %s\n", algoid? algoid : "[none]");
+ if (algoid && !strcmp (algoid, "1.2.840.113549.1.1.10"))
+ {
+ ksba_sexp_t pssparam;
+
+ if (!quiet)
+ printf (" pss para: ");
+ pssparam = ksba_crl_get_sig_val (crl);
+ if (!quiet)
+ {
+ print_sexp (pssparam);
+ putchar ('\n');
+ }
+ xfree (pssparam);
+ }
err = ksba_crl_get_issuer (crl, &issuer);
fail_if_err2 (fname, err);
- printf ("issuer: ");
- print_dn (issuer);
+ if (!quiet)
+ {
+ printf ("issuer: ");
+ print_dn (issuer);
+ putchar ('\n');
+ }
xfree (issuer);
- putchar ('\n');
+
err = ksba_crl_get_update_times (crl, this, next);
if (gpg_err_code (err) != GPG_ERR_INV_TIME)
fail_if_err2 (fname, err);
- printf ("thisUpdate: ");
- print_time (this);
- putchar ('\n');
- printf ("nextUpdate: ");
- print_time (next);
- putchar ('\n');
+ if (!quiet)
+ {
+ printf ("thisUpdate: ");
+ print_time (this);
+ putchar ('\n');
+ printf ("nextUpdate: ");
+ print_time (next);
+ putchar ('\n');
+ }
}
break;
@@ -178,11 +209,14 @@ one_file (const char *fname)
err = ksba_crl_get_item (crl, &serial, rdate, &reason);
fail_if_err2 (fname, err);
- printf ("CRL entry %d: s=", ++count);
- print_sexp_hex (serial);
- printf (", t=");
- print_time (rdate);
- printf (", r=%x\n", reason);
+ if (!quiet)
+ {
+ printf ("CRL entry %d: s=", ++count);
+ print_sexp_hex (serial);
+ printf (", t=");
+ print_time (rdate);
+ printf (", r=%x\n", reason);
+ }
xfree (serial);
}
break;
@@ -211,26 +245,37 @@ one_file (const char *fname)
err = ksba_crl_get_auth_key_id (crl, &keyid, &name1, &serial);
if (!err || gpg_err_code (err) == GPG_ERR_NO_DATA)
{
- fputs ("AuthorityKeyIdentifier: ", stdout);
+ if (!quiet)
+ fputs ("AuthorityKeyIdentifier: ", stdout);
if (gpg_err_code (err) == GPG_ERR_NO_DATA)
- fputs ("none\n", stdout);
+ {
+ if (!quiet)
+ fputs ("none\n", stdout);
+ }
else
{
if (name1)
{
print_names (24, name1);
ksba_name_release (name1);
- fputs (" serial: ", stdout);
- print_sexp_hex (serial);
+ if (!quiet)
+ {
+ fputs (" serial: ", stdout);
+ print_sexp_hex (serial);
+ }
ksba_free (serial);
}
- putchar ('\n');
+ if (!quiet)
+ putchar ('\n');
if (keyid)
{
- fputs (" keyIdentifier: ", stdout);
- print_sexp (keyid);
+ if (!quiet)
+ {
+ fputs (" keyIdentifier: ", stdout);
+ print_sexp (keyid);
+ putchar ('\n');
+ }
ksba_free (keyid);
- putchar ('\n');
}
}
}
@@ -244,15 +289,21 @@ one_file (const char *fname)
err = ksba_crl_get_crl_number (crl, &serial);
if (!err || gpg_err_code (err) == GPG_ERR_NO_DATA)
{
- fputs ("crlNumber: ", stdout);
+ if (!quiet)
+ fputs ("crlNumber: ", stdout);
if (gpg_err_code (err) == GPG_ERR_NO_DATA)
- fputs ("none", stdout);
+ {
+ if (!quiet)
+ fputs ("none", stdout);
+ }
else
{
- print_sexp (serial);
+ if (!quiet)
+ print_sexp (serial);
ksba_free (serial);
}
- putchar ('\n');
+ if (!quiet)
+ putchar ('\n');
}
else
fail_if_err (err);
@@ -269,10 +320,11 @@ one_file (const char *fname)
NULL, &derlen)); idx++)
{
const char *s = get_oid_desc (oid);
- printf ("%sExtn: %s%s%s%s (%lu octets)\n",
- crit? "Crit":"",
- s?" (":"", s?s:"", s?")":"",
- oid, (unsigned long)derlen);
+ if (!quiet)
+ printf ("%sExtn: %s%s%s%s (%lu octets)\n",
+ crit? "Crit":"",
+ s?" (":"", s?s:"", s?")":"",
+ oid, (unsigned long)derlen);
}
if (err && gpg_err_code (err) != GPG_ERR_EOF
&& gpg_err_code (err) != GPG_ERR_NO_DATA )
@@ -286,8 +338,11 @@ one_file (const char *fname)
sigval = ksba_crl_get_sig_val (crl);
if (!sigval)
fail ("signature value missing");
- print_sexp (sigval);
- putchar ('\n');
+ if (!quiet)
+ {
+ print_sexp (sigval);
+ putchar ('\n');
+ }
xfree (sigval);
}
@@ -310,9 +365,19 @@ main (int argc, char **argv)
if (!srcdir)
srcdir = ".";
- if (argc > 1)
+ if (argc)
+ {
+ argc--; argv++;
+ }
+ if (argc && !strcmp (*argv, "--verbose"))
+ {
+ verbose = 1;
+ argc--; argv++;
+ }
+
+ if (argc)
{
- for (argc--, argv++; argc; argc--, argv++)
+ for (; argc; argc--, argv++)
one_file (*argv);
}
else
@@ -323,13 +388,16 @@ main (int argc, char **argv)
};
int idx;
+ if (!verbose)
+ quiet = 1;
+
for (idx=0; files[idx]; idx++)
{
char *fname;
- fname = xmalloc (strlen (srcdir) + 1 + strlen (files[idx]) + 1);
+ fname = xmalloc (strlen (srcdir) + 10 + strlen (files[idx]) + 1);
strcpy (fname, srcdir);
- strcat (fname, "/");
+ strcat (fname, "/samples/");
strcat (fname, files[idx]);
one_file (fname);
xfree (fname);
diff --git a/tests/t-der-builder.c b/tests/t-der-builder.c
new file mode 100644
index 0000000..05b4d60
--- /dev/null
+++ b/tests/t-der-builder.c
@@ -0,0 +1,202 @@
+/* t-der-builder.c - Tests for the DER builder functions
+ * Copyright (C) 2020 g10 Code GmbH
+ *
+ * This file is part of KSBA.
+ *
+ * KSBA 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.
+ *
+ * KSBA 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/>.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <time.h>
+#include <errno.h>
+
+#include "../src/ksba.h"
+
+#define PGM "t-der-builder"
+
+#include "t-common.h"
+
+
+static int verbose;
+
+
+
+static void
+test_der_encoding (void)
+{
+ gpg_error_t err;
+ ksba_der_t d;
+ unsigned char *der;
+ size_t derlen;
+
+ d = ksba_der_builder_new (0);
+ if (!d)
+ fail ("error creating new DER builder");
+
+ ksba_der_add_ptr (d, KSBA_CLASS_UNIVERSAL, KSBA_TYPE_NULL, NULL, 0);
+ err = ksba_der_builder_get (d, &der, &derlen);
+ fail_if_err (err);
+ if (derlen != 2 || memcmp (der, "\x05\x00", 2))
+ fail ("bad encoding");
+ xfree (der);
+
+ ksba_der_builder_reset (d);
+ ksba_der_add_ptr (d, KSBA_CLASS_UNIVERSAL, KSBA_TYPE_OCTET_STRING, "123", 3);
+ err = ksba_der_builder_get (d, &der, &derlen);
+ fail_if_err (err);
+ if (derlen != 5 || memcmp (der, "\x04\x03""123", 5))
+ fail ("bad encoding");
+ xfree (der);
+
+ ksba_der_builder_reset (d);
+ ksba_der_add_ptr (d, KSBA_CLASS_UNIVERSAL, 65537, "a", 1);
+ err = ksba_der_builder_get (d, &der, &derlen);
+ fail_if_err (err);
+ if (derlen != 6 || memcmp (der, "\x1f\x84\x80\x01\x01\x61", 6))
+ fail ("bad encoding");
+ xfree (der);
+
+ ksba_der_builder_reset (d);
+ ksba_der_add_tag (d, KSBA_CLASS_APPLICATION, 257);
+ err = ksba_der_builder_get (d, &der, &derlen);
+ fail_if_err (err);
+ if (derlen != 4 || memcmp (der, "\x7f\x82\x01\x80", 4))
+ fail ("bad encoding");
+ xfree (der);
+
+ ksba_der_release (d);
+}
+
+
+static void
+test_der_builder (void)
+{
+ gpg_error_t err;
+ ksba_der_t d;
+ unsigned char *der;
+ size_t derlen;
+
+ d = ksba_der_builder_new (0);
+ if (!d)
+ fail ("error creating new DER builder");
+
+ ksba_der_add_tag (d, KSBA_CLASS_UNIVERSAL, KSBA_TYPE_SEQUENCE);
+ ksba_der_add_oid (d, "1.2.3.4");
+ ksba_der_add_tag (d, KSBA_CLASS_UNIVERSAL, KSBA_TYPE_SET);
+ ksba_der_add_tag (d, KSBA_CLASS_CONTEXT, 0);
+ ksba_der_add_int (d, "\x01", 1, 0);
+ ksba_der_add_end (d);
+ ksba_der_add_tag (d, KSBA_CLASS_CONTEXT, 42);
+ ksba_der_add_int (d, "\x7f", 1, 0); /* 127 */
+ ksba_der_add_int (d, "\x7f", 1, 1); /* Also 127 */
+ ksba_der_add_int (d, "\x82", 1, 0); /* Note: this is a negative number. */
+ ksba_der_add_int (d, "\x83", 1, 1); /* Forces positive encoding. */
+ ksba_der_add_end (d);
+ ksba_der_add_end (d);
+
+ err = ksba_der_builder_get (d, &der, &derlen);
+ fail_if_err (err);
+ /* gpgrt_log_printhex (der, derlen, "DER:"); */
+ if (derlen != 30
+ || memcmp (der, ("\x30\x1c\x06\x03\x2a\x03\x04\x31\x15\xa0\x03\x02"
+ "\x01\x01\xbf\x2a\x0d\x02\x01\x7f\x02\x01\x7f\x02"
+ "\x01\x82\x02\x02\x00\x83"), 30))
+ fail ("bad encoding");
+ xfree (der);
+
+
+ /* Now test our encapsulate feature. */
+ ksba_der_builder_reset (d);
+
+ ksba_der_add_tag (d, KSBA_CLASS_UNIVERSAL, KSBA_TYPE_SEQUENCE);
+ ksba_der_add_oid (d, "1.2.3.4");
+ ksba_der_add_tag (d, KSBA_CLASS_ENCAPSULATE, KSBA_TYPE_OCTET_STRING);
+ ksba_der_add_tag (d, KSBA_CLASS_UNIVERSAL, KSBA_TYPE_SEQUENCE);
+ ksba_der_add_int (d, "\x01\xc3", 2, 0); /* Integer 451 */
+ ksba_der_add_tag (d, KSBA_CLASS_CONTEXT, 0); /* [0] */
+ ksba_der_add_int (d, "\x2a", 1, 0); /* Integer 42 */
+ ksba_der_add_end (d); /* End [0] */
+ ksba_der_add_end (d); /* End sequence */
+ ksba_der_add_end (d); /* End octet string */
+ ksba_der_add_end (d); /* End sequence */
+
+ err = ksba_der_builder_get (d, &der, &derlen);
+ fail_if_err (err);
+ if (derlen != 20
+ || memcmp (der, ("\x30\x12\x06\x03\x2a\x03\x04\x04\x0b\x30"
+ "\x09\x02\x02\x01\xc3\xa0\x03\x02\x01\x2a"), 20))
+ fail ("bad encoding");
+ xfree (der);
+
+ /* Encapsulate in a bit string. */
+ ksba_der_builder_reset (d);
+
+ ksba_der_add_tag (d, KSBA_CLASS_UNIVERSAL, KSBA_TYPE_SEQUENCE);
+ ksba_der_add_oid (d, "1.2.3.4");
+ ksba_der_add_tag (d, KSBA_CLASS_ENCAPSULATE, KSBA_TYPE_BIT_STRING);
+ ksba_der_add_tag (d, KSBA_CLASS_UNIVERSAL, KSBA_TYPE_SEQUENCE);
+ ksba_der_add_int (d, "\x01\xc3", 2, 0); /* Integer 451 */
+ ksba_der_add_tag (d, KSBA_CLASS_CONTEXT, 0); /* [0] */
+ ksba_der_add_int (d, "\x2a", 1, 0); /* Integer 42 */
+ ksba_der_add_end (d); /* End [0] */
+ ksba_der_add_end (d); /* End sequence */
+ ksba_der_add_end (d); /* End octet string */
+ ksba_der_add_end (d); /* End sequence */
+
+ err = ksba_der_builder_get (d, &der, &derlen);
+ fail_if_err (err);
+ /* gpgrt_log_printhex (der, derlen, "der:"); */
+ if (derlen != 21
+ || memcmp (der, ("\x30\x13\x06\x03\x2a\x03\x04\x03\x0c\x00\x30"
+ "\x09\x02\x02\x01\xc3\xa0\x03\x02\x01\x2a"), 21))
+ fail ("bad encoding");
+ xfree (der);
+
+
+ ksba_der_release (d);
+}
+
+
+int
+main (int argc, char **argv)
+{
+ if (argc)
+ {
+ argc--; argv++;
+ }
+
+ if (argc && !strcmp (*argv, "--verbose"))
+ {
+ verbose = 1;
+ argc--; argv++;
+ }
+
+
+ if (!argc)
+ {
+ test_der_encoding ();
+ test_der_builder ();
+ }
+ else
+ {
+ fputs ("usage: "PGM"\n", stderr);
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/tests/t-dnparser.c b/tests/t-dnparser.c
index ef4ab5d..ef97456 100644
--- a/tests/t-dnparser.c
+++ b/tests/t-dnparser.c
@@ -27,6 +27,9 @@
#include "../src/ksba.h"
#include "t-common.h"
+static int quiet;
+static int verbose;
+
static void
test_0 (void)
@@ -92,9 +95,10 @@ test_1 (void)
err = ksba_dn_teststr (empty_elements[i], 0, &off, &len);
if (!err)
fail ("ksba_dn_teststr returned no error");
- printf ("string ->%s<- error at %lu.%lu (%.*s)\n",
- empty_elements[i], (unsigned long)off, (unsigned long)len,
- (int)len, empty_elements[i]+off);
+ if (!quiet)
+ printf ("string ->%s<- error at %lu.%lu (%.*s)\n",
+ empty_elements[i], (unsigned long)off, (unsigned long)len,
+ (int)len, empty_elements[i]+off);
xfree (buf);
}
}
@@ -120,9 +124,10 @@ test_2 (void)
err = ksba_dn_teststr (invalid_labels[i], 0, &off, &len);
if (!err)
fail ("ksba_dn_test_str returned no error");
- printf ("string ->%s<- error at %lu.%lu (%.*s)\n",
- invalid_labels[i], (unsigned long)off, (unsigned long)len,
- (int)len, invalid_labels[i]+off);
+ if (!quiet)
+ printf ("string ->%s<- error at %lu.%lu (%.*s)\n",
+ invalid_labels[i], (unsigned long)off, (unsigned long)len,
+ (int)len, invalid_labels[i]+off);
xfree (buf);
}
}
@@ -136,19 +141,32 @@ main (int argc, char **argv)
unsigned char *buf;
size_t len;
gpg_error_t err;
+ char *string;
+
+ if (argc)
+ {
+ argc--; argv++;
+ }
+ if (argc && !strcmp (*argv, "--verbose"))
+ {
+ verbose = 1;
+ argc--; argv++;
+ }
- if (argc == 2 && !strcmp (argv[1], "--to-str") )
+ if (argc == 1 && !strcmp (argv[0], "--to-str") )
{ /* Read the DER encoded DN from stdin write the string to stdout */
- fread (inputbuf, 1, sizeof inputbuf, stdin);
+ len = fread (inputbuf, 1, sizeof inputbuf, stdin);
if (!feof (stdin))
fail ("read error or input too large");
- fail ("not yet implemented");
-
+ err = ksba_dn_der2str (inputbuf, len, &string);
+ fail_if_err (err);
+ fputs (string, stdout);
+ ksba_free (string);
}
- else if (argc == 2 && !strcmp (argv[1], "--to-der") )
+ else if (argc == 1 && !strcmp (argv[0], "--to-der") )
{ /* Read the String from stdin write the DER encoding to stdout */
- fread (inputbuf, 1, sizeof inputbuf, stdin);
+ len = fread (inputbuf, 1, sizeof inputbuf, stdin);
if (!feof (stdin))
fail ("read error or input too large");
@@ -156,8 +174,10 @@ main (int argc, char **argv)
fail_if_err (err);
fwrite (buf, len, 1, stdout);
}
- else if (argc == 1)
+ else if (!argc)
{
+ if (!verbose)
+ quiet = 1;
test_0 ();
test_1 ();
test_2 ();
diff --git a/tests/t-reader.c b/tests/t-reader.c
new file mode 100644
index 0000000..a64ae2e
--- /dev/null
+++ b/tests/t-reader.c
@@ -0,0 +1,211 @@
+/* t-reader.c - basic tests for the reader object
+ * Copyright (C) 2017 g10 Code GmbH
+ *
+ * This file is part of KSBA.
+ *
+ * KSBA 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.
+ *
+ * KSBA 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/>.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <time.h>
+#include <errno.h>
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <gpg-error.h>
+
+#include "../src/ksba.h"
+#include "t-common.h"
+
+void
+test_fd(const char* path)
+{
+ int fd = open (path, O_RDONLY);
+ gpg_error_t err = 0;
+ ksba_reader_t reader;
+ ksba_cert_t cert;
+
+ if (fd < 0)
+ {
+ perror ("open() failed");
+ exit (1);
+ }
+
+ if ((err = ksba_reader_new (&reader)))
+ {
+ fprintf (stderr, "ksba_reader_new() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ if ((err = ksba_reader_set_fd (reader, fd)))
+ {
+ fprintf (stderr, "ksba_reader_set_fd() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ if ((err = ksba_cert_new (&cert)))
+ {
+ fprintf (stderr, "ksba_cert_new() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ if ((err = ksba_cert_read_der (cert, reader)))
+ {
+ fprintf(stderr, "ksba_cert_read_der() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ ksba_cert_release (cert);
+ ksba_reader_release (reader);
+ close (fd);
+}
+
+void
+test_file(const char* path)
+{
+ FILE* fp = fopen (path, "r");
+ gpg_error_t err = 0;
+ ksba_reader_t reader;
+ ksba_cert_t cert;
+
+ if (!fp)
+ {
+ perror ("fopen() failed");
+ exit (1);
+ }
+
+ if ((err = ksba_reader_new (&reader)))
+ {
+ fprintf (stderr, "ksba_reader_new() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ if ((err = ksba_reader_set_file (reader, fp)))
+ {
+ fprintf (stderr, "ksba_reader_set_fd() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ if ((err = ksba_cert_new (&cert)))
+ {
+ fprintf (stderr, "ksba_cert_new() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ if ((err = ksba_cert_read_der (cert, reader)))
+ {
+ fprintf(stderr, "ksba_cert_read_der() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ ksba_cert_release (cert);
+ ksba_reader_release (reader);
+ fclose (fp);
+}
+
+void
+test_mem(const char* path)
+{
+ int fd = open (path, O_RDONLY);
+ gpg_error_t err = 0;
+ ksba_reader_t reader;
+ ksba_cert_t cert;
+ char *mem = NULL;
+ ssize_t ret = 0;
+ size_t p = 0;
+ struct stat st;
+
+ if (fd < 0)
+ {
+ perror ("fopen() failed");
+ exit (1);
+ }
+
+ if (fstat (fd, &st))
+ {
+ fprintf (stderr, "fstat() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ mem = xmalloc(st.st_size);
+
+ while (p < st.st_size && (ret = read(fd, mem + p, st.st_size - p)))
+ {
+ if (ret < 0)
+ {
+ fprintf (stderr, "read() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+ p += ret;
+ }
+
+ if ((err = ksba_reader_new (&reader)))
+ {
+ exit (1);
+ }
+
+ if ((err = ksba_reader_set_mem (reader, mem, st.st_size)))
+ {
+ fprintf (stderr, "ksba_reader_set_mem() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ if ((err = ksba_cert_new (&cert)))
+ {
+ fprintf (stderr, "ksba_cert_new() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ if ((err = ksba_cert_read_der (cert, reader)))
+ {
+ fprintf(stderr, "ksba_cert_read_der() failed: %s\n", gpg_strerror (err));
+ exit (1);
+ }
+
+ ksba_cert_release (cert);
+ ksba_reader_release (reader);
+ xfree (mem);
+ close (fd);
+}
+
+int
+main (int argc, char **argv)
+{
+ if (argc == 1)
+ {
+ char *fname = prepend_srcdir ("samples/cert_g10code_test1.der");
+
+ test_fd (fname);
+ test_file (fname);
+ test_mem (fname);
+ free(fname);
+ }
+ else
+ {
+ int i;
+ for (i = 1; i < argc; ++i)
+ {
+ test_fd (argv[i]);
+ test_file (argv[i]);
+ test_mem (argv[i]);
+ }
+ }
+
+ return 0;
+}