1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-10-30 19:58:44 +01:00
gnupg/sm
Werner Koch 0dcd1504ba
sm: More improvements for PKCS#12 parsing for latest IVBB changes.
* common/tlv.h (TLV_PARSER_FLAG_T5793): New.
(tlv_parser_new): New macro.  Rename function with an underscore.
(tlv_next_with_flag): New.
* common/tlv-parser.c (struct tlv_parser_s): Remove const from buffer.
Add fields crammed, lasttlv, and origoff.  Remove bufferlist ands ist
definition.
(dump_to_file): New but disabled debug helper.
(parse_tag): Print more info on error.
(_tlv_parser_new): Add args lasttlv and LNO.  Take a copy of the data.
(_tlv_parser_release): Free the copy of the buffer and return the
recorded TLV object from tlv_parser_new.
(_tlv_peek, tlv_parser_peek, _tlv_parser_peek_null): Remove.
(_tlv_push): Record crammed length.
(_tlv_pop): Restore crammed length.
(_tlv_parser_next): Add arg flags.  More debug output.  Handle cramming
here.  Take care of cramming here.
(tlv_expect_object): Simplify to adjust for changes in _tlv_parser_next.
(tlv_expect_octet_string): Remove arg encapsulates.  Adjust for
changes in _tlv_parser_next.  Change all allers.
(tlv_expect_null): New.
(cram_octet_string): Rewrite.
(need_octet_string_cramming): Remove.

* sm/minip12.c (dump_to_file): New.  Enable in debug mode and if an
envvar ist set.  Replace all explict but disabled dumping to call this
function.
(parse_bag_encrypted_data): Replace tlv_peek_null and a peeking for an
optional SET by non-peeking code.
(parse_cert_bag): Ditto.
(parse_shrouded_key_bag): Replace tlv_peek_null by non-peeking code.
(parse_bag_encrypted_data): Use the new TLV_PARSER_FLAG_T5793 to
enable the Mozilla workaround.
(parse_bag_encrypted_data): Replace the 'renewed_tlv' code by the new
tlv_parser_release semantics.
(parse_shrouded_key_bag): Ditto.
(parse_shrouded_key_bag): Create a new context instead of using the
former encapsulated mechanism for tlv_expect_octet_string.
(parse_bag_data): Ditto.
(p12_parse): Ditto.

* common/tlv-parser.c: New
* common/Makefile.am: Add new file.
--

GnuPG-bug-id: 7213
Backported-from-master: 690fd61a0c

This backport required to introduce the new tlv-parser.c file and
remove most source copied stuff from minip12.c.  Thus the above
ChangeList is not fully correct.
2024-08-07 11:21:35 +02:00
..
call-agent.c gpg,gpgsm: Hide password in debug output also for asked passwords. 2023-11-14 15:08:20 +01:00
call-dirmngr.c sm: Fix use of value NONE in gnupg_isotime_t type. 2023-08-28 08:39:16 +02:00
certchain.c agent: New flag "qual" for the trustlist.txt. 2023-09-07 17:12:33 +02:00
certcheck.c gpgsm: Avoid double free when checking rsaPSS signatures. 2024-05-29 11:58:27 +02:00
certdump.c sm: Fix a bug in the rfc2253 parser 2020-08-28 09:09:34 +02:00
certlist.c gpgsm: Add --always-trust feature. 2023-08-31 11:13:38 +02:00
certreqgen-ui.c gpgsm: Cleanup the use of GCRY_PK_ECC and GCRY_PK_ECDSA. 2022-11-14 18:16:49 +01:00
certreqgen.c gpg,gpgsm: Remove compatibility_flags allow-ecc-encr and vsd-allow-encr. 2024-05-06 14:34:48 +02:00
ChangeLog-2011 Generate the ChangeLog from commit logs. 2011-12-01 11:09:02 +01:00
decrypt.c gpgsm: Support ECDSA in de-vs mode. 2023-11-08 17:16:31 +01:00
delete.c sm: Fix issuer certificate look error due to legacy error code. 2023-02-24 17:46:39 +01:00
encrypt.c gpg,gpgsm: Remove compatibility_flags allow-ecc-encr and vsd-allow-encr. 2024-05-06 14:34:48 +02:00
export.c sm: Fix issuer certificate look error due to legacy error code. 2023-02-24 17:46:39 +01:00
fingerprint.c sm: Flag Brainpool curves as compliant for all other operations. 2023-10-24 14:51:16 +02:00
gpgsm-w32info.rc w32: Add manifest files to most binaries 2020-10-02 17:04:12 +02:00
gpgsm.c gpg,gpgsm: Remove compatibility_flags allow-ecc-encr and vsd-allow-encr. 2024-05-06 14:34:48 +02:00
gpgsm.h gpg,gpgsm: Remove compatibility_flags allow-ecc-encr and vsd-allow-encr. 2024-05-06 14:34:48 +02:00
gpgsm.w32-manifest.in w32: Add missing manifests and set a requestedExecutionLevel. 2023-05-25 11:10:21 +02:00
import.c sm: Support import of PKCS#12 encoded ECC private keys. 2023-10-17 16:40:49 +02:00
keydb.c sm: Fix issuer certificate look error due to legacy error code. 2023-02-24 17:46:39 +01:00
keydb.h sm: On Windows close the kbx files at several places. 2021-03-02 19:01:07 +01:00
keylist.c gpgsm: Set validity flag in keylisting to n for untrusted root cert. 2023-11-27 12:34:38 +01:00
Makefile.am sm: Complete rewrite of the PKCS#12 parser 2023-07-05 14:21:16 +02:00
minip12.c sm: More improvements for PKCS#12 parsing for latest IVBB changes. 2024-08-07 11:21:35 +02:00
minip12.h sm: Complete rewrite of the PKCS#12 parser 2023-07-05 14:21:16 +02:00
misc.c gpgsm: Some more ECC support backported. 2022-11-14 17:23:06 +01:00
passphrase.c Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
passphrase.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
qualified.c Replace most of the remaining stdio calls by estream calls. 2020-10-21 21:09:38 +02:00
server.c gpgsm: Add --always-trust feature. 2023-08-31 11:13:38 +02:00
sign.c gpgsm: Support ECDSA in de-vs mode. 2023-11-08 17:16:31 +01:00
t-minip12.c sm: Minor robustness fix for a regression test. 2023-10-17 16:42:33 +02:00
verify.c gpgsm: Support ECDSA in de-vs mode. 2023-11-08 17:16:31 +01:00