1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-10 21:38:50 +01:00
gnupg/sm
Werner Koch 690fd61a0c
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.  Enablein debug mode and if a
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.
--

GnuPG-bug-id: 7213

Fixing this took way too long; I should have earlier explained the
code to a co-hacker to find the problem myself in my code by this.
2024-08-06 17:51:01 +02:00
..
call-agent.c indent: Fix spelling 2024-05-31 12:28:32 +02:00
call-dirmngr.c common: Prepare for more flags in start_new_service. 2023-08-29 13:18:13 +02:00
certchain.c indent: Fix spelling 2024-05-31 12:28:32 +02:00
certcheck.c gpgsm: Avoid double free when checking rsaPSS signatures. 2024-05-28 17:15:03 +02:00
certdump.c gpgsm: New option --no-pretty-dn 2023-03-16 09:46:05 +01:00
certlist.c gpgsm: Add --always-trust feature. 2023-08-31 12:30:26 +02:00
certreqgen-ui.c gpgsm: Allow to add extensions at the --gen-key prompt. 2024-03-27 12:12:52 +01:00
certreqgen.c indent: Fix spelling 2024-05-31 12:28:32 +02:00
ChangeLog-2011 Generate the ChangeLog from commit logs. 2011-12-01 11:09:02 +01:00
decrypt.c indent: Fix spelling 2024-05-31 12:28:32 +02:00
delete.c sm: Implement delete key in keyboxd mode 2020-09-21 09:20:40 +02:00
encrypt.c Merge branch 'STABLE-BRANCH-2-4' 2024-01-26 09:41:00 +01:00
export.c Use gpgrt_process_spawn API from libgpg-error. 2024-07-09 10:04:16 +09:00
fingerprint.c sm: Flag Brainpool curves as compliant for all other operations. 2023-10-24 14:54:26 +02:00
gpgsm-w32info.rc w32: Add missing manifests and set a requestedExecutionLevel. 2023-05-24 12:14:06 +02:00
gpgsm.c indent: Fix spelling 2024-05-31 12:28:32 +02:00
gpgsm.h indent: Fix spelling 2024-05-31 12:28:32 +02:00
gpgsm.w32-manifest.in w32: Add missing supportedOS Ids for Windows-10 2023-05-24 14:17:06 +02:00
import.c Use gpgrt_process_spawn API from libgpg-error. 2024-07-09 10:04:16 +09:00
keydb.c indent: Fix spelling 2024-05-31 12:28:32 +02:00
keydb.h sm: Implement initial support for keyboxd. 2020-09-10 13:05:17 +02:00
keylist.c sm: Emit user IDs in colon mode even if the Subject is empty. 2024-06-21 10:19:00 +02:00
Makefile.am sm: Major rewrite of the PKCS#12 parser 2023-06-28 17:34:19 +02:00
minip12.c sm: More improvements for PKCS#12 parsing for latest IVBB changes. 2024-08-06 17:51:01 +02:00
minip12.h gpgsm: Allow parsing of PKCS#12 files with two private keys. 2024-01-15 09:56:07 +01:00
misc.c indent: Fix spelling 2024-05-31 12:28:32 +02:00
passphrase.c gpg,common,scd,sm: Function prototype fixes for modern compiler. 2022-09-13 16:34:00 +09: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-20 12:15:56 +02:00
server.c Merge branch 'STABLE-BRANCH-2-4' 2023-11-07 20:38:27 +01:00
sign.c Merge branch 'STABLE-BRANCH-2-4' 2023-12-22 13:45:02 +01:00
t-minip12.c sm: Add a debug helper command to t-minip12.c 2024-08-06 15:59:26 +02:00
verify.c Merge branch 'STABLE-BRANCH-2-4' 2024-01-26 09:41:00 +01:00