aboutsummaryrefslogtreecommitdiffstats
path: root/sm/minip12.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-07-04gpgsm: Init a diagnostic var.Werner Koch1-1/+1
* sm/minip12.c (p12_parse): Init where. --
2023-06-29sm: Adding missing stuff to the PKCS#12 parser rewrite.Werner Koch1-85/+153
* sm/minip12.c (struct bufferlist_s): New. (struct tlv_ctx_s): Add bufferlist. (tlv_register_buffer): New. (tlv_release): Release bufferlist. (tlv_expect_object): Handle octet string cramming. (tlv_expect_octet_string): Ditto. (cram_octet_string): Changed interface. We don't need the input_consumed value anymore. * sm/minip12.c (parse_shrouded_key_bag): Also parse the attribute set. * sm/t-minip12.c (main): Add option --no-extra. (cert_collect_cb, run_tests_from_file): Fix memory leak * tests/cms/samplekeys/t5793-openssl.pfx: New from T5793. * tests/cms/samplekeys/t5793-test.pfx: Ditto. * tests/cms/samplekeys/Description-p12: Add them. * tests/cms/Makefile.am (EXTRA_DIST): Add samplekeys. -- This should finish the rewrite of the pkcsc#12 parser for now. More fun is likely to come. GnuPG-bug-id: 6536, 5793
2023-06-28sm: Major rewrite of the PKCS#12 parserWerner Koch1-743/+1200
* sm/minip12.c: Reworked most of the parser. (p12_set_verbosity): Add arg debug and change all callers. * sm/t-minip12.c: Major rewrite to run regression tests unattended. * sm/Makefile.am (module_maint_tests): Move t-Minit to ... (module_tests): here. * tests/cms/samplekeys/Description-p12: New. -- Note that cram_octet_string stuff has not yet been reworked. I need to locate the sample files first. GnuPG-bug-id: 6536
2023-06-28sm: Remove duplicated code.Werner Koch1-81/+28
* sm/minip12.c (struct tag_info): Change type of length and nhdr. (dump_tag_info): Adjust. (parse_tag): Re-implement using the parse_ber_header.
2022-09-09sm: Fix reporting of bad passphrase errorIngo Klöcker1-1/+4
* sm/minip12.c (p12_parse): Set badpass flag to result in ctx. -- Fixes-commit: a4e04375e84ecb7ea0d02e153cb27988fca4c2d0 GnuPG-bug-id: 5713, 6037
2022-06-20sm: Improve pkcs#12 debug output.Werner Koch1-7/+9
* sm/minip12.c (parse_shrouded_key_bag): Fix offset diagnostic. (parse_cert_bag): Ditto. (parse_bag_data): Remove debug output. Pass startoffset. Fix offset diagnostic.
2022-06-20sm: Rework the PKCS#12 parser to support DFN issued keys.Werner Koch1-177/+341
* sm/minip12.c (struct p12_parse_ctx_s): New. Use this instead of passing several parameters to most functions. (parse_pag_data): Factor things out to ... parse_shrouded_key_bag): new. (parse_cert_bag): New. (parse_bag_data): New. (p12_parse): Setup the parse context. -- To support newer pkcs#12 files like those issued by the DFN we need to support another ordering of data elements. This rework reflects the P12 data structure a bit better than our old ad-hoc hacks. Tests could only be done with the certificate parts and not the encrypted private keys. GnuPG-bug-id: 6037
2022-04-08doc: Typo fix in commentWerner Koch1-1/+1
--
2022-03-09sm: Fix parsing encrypted data.NIIBE Yutaka1-1/+14
* sm/minip12.c (cram_octet_string): Finish when N==0. (parse_bag_encrypted_data): Support constructed data with multiple octet strings. -- GnuPG-bug-id: 5793 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-02-25sm: Do not print certain issuer not found diags in quiet mode.Werner Koch1-2/+3
* sm/certchain.c (find_up_dirmngr): Print one diagnostic only in verbose mode. Do not print issuer not found diags in quiet mode. * sm/minip12.c (parse_bag_data): Add missing verbose condition. -- GnuPG-bug-id: 4757
2021-02-24sm: Silence some output on --quietWerner Koch1-4/+17
* sm/encrypt.c (gpgsm_encrypt): Take care of --quiet. * sm/gpgsm.c: Include minip12.h. (set_debug): Call p12_set_verbosity. * sm/import.c (parse_p12): Dump keygrip only in debug mode. * sm/minip12.c (opt_verbose, p12_set_verbosity): New. (parse_bag_encrypted_data): Print info messages only in verbose mode. -- GnuPG-bug-id: 4757
2020-07-08gpgsm: Replace all assert calls by log_assert.Werner Koch1-4/+3
-- Signed-off-by: Werner Koch <[email protected]>
2020-05-04doc: Typo fixes in code commentsWerner Koch1-1/+1
-- Signed-off-by: Werner Koch <[email protected]>
2020-04-27sm: Add support to export ECC private keys.Werner Koch1-178/+322
* sm/minip12.c [TEST]: Remove test code. Include util.h, tlv.h. and openpgpdefs.h. Remove the class and tag constants and replace them by those from tlv.h. (builder_add_oid, builder_add_mpi): New. (build_key_sequence): Rename to ... (build_rsa_key_sequence): this. (build_ecc_key_sequence): New. (p12_build): Call RSA or ECC builder. (p12_raw_build): Ditto. * sm/export.c (gpgsm_p12_export): Use correct armor header for ECC. (sexp_to_kparms): Support ECC. * sm/t-minip12.c: New to replace the former TEST code in minip12.h. -- GnuPG-bug-id: 4921
2020-04-21sm: Support import of PKCS#12 encoded ECC private keys.Werner Koch1-31/+120
* sm/minip12.c: Include ksba.h. (oid_pcPublicKey): New const. (parse_bag_data): Add arg 'r-curve'. Support parsing of ECC private keys. (p12_parse): Add arg 'r_curve'. * sm/import.c (parse_p12): Support ECC import. -- GnuPG-bug-id: 4921 Signed-off-by: Werner Koch <[email protected]>
2018-10-24all: fix spelling and typosDaniel Kahn Gillmor1-3/+3
Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2015-11-17Fix typos found using codespell.Justus Winter1-3/+3
* agent/cache.c: Fix typos. * agent/call-pinentry.c: Likewise. * agent/call-scd.c: Likewise. * agent/command-ssh.c: Likewise. * agent/command.c: Likewise. * agent/divert-scd.c: Likewise. * agent/findkey.c: Likewise. * agent/gpg-agent.c: Likewise. * agent/w32main.c: Likewise. * common/argparse.c: Likewise. * common/audit.c: Likewise. * common/audit.h: Likewise. * common/convert.c: Likewise. * common/dotlock.c: Likewise. * common/exechelp-posix.c: Likewise. * common/exechelp-w32.c: Likewise. * common/exechelp-w32ce.c: Likewise. * common/exechelp.h: Likewise. * common/helpfile.c: Likewise. * common/i18n.h: Likewise. * common/iobuf.c: Likewise. * common/iobuf.h: Likewise. * common/localename.c: Likewise. * common/logging.c: Likewise. * common/openpgp-oid.c: Likewise. * common/session-env.c: Likewise. * common/sexputil.c: Likewise. * common/sysutils.c: Likewise. * common/t-sexputil.c: Likewise. * common/ttyio.c: Likewise. * common/util.h: Likewise. * dirmngr/cdblib.c: Likewise. * dirmngr/certcache.c: Likewise. * dirmngr/crlcache.c: Likewise. * dirmngr/dirmngr-client.c: Likewise. * dirmngr/dirmngr.c: Likewise. * dirmngr/dirmngr_ldap.c: Likewise. * dirmngr/dns-stuff.c: Likewise. * dirmngr/http.c: Likewise. * dirmngr/ks-engine-hkp.c: Likewise. * dirmngr/ks-engine-ldap.c: Likewise. * dirmngr/ldap-wrapper.c: Likewise. * dirmngr/ldap.c: Likewise. * dirmngr/misc.c: Likewise. * dirmngr/ocsp.c: Likewise. * dirmngr/validate.c: Likewise. * g10/encrypt.c: Likewise. * g10/getkey.c: Likewise. * g10/gpg.c: Likewise. * g10/gpgv.c: Likewise. * g10/import.c: Likewise. * g10/keydb.c: Likewise. * g10/keydb.h: Likewise. * g10/keygen.c: Likewise. * g10/keyid.c: Likewise. * g10/keylist.c: Likewise. * g10/keyring.c: Likewise. * g10/mainproc.c: Likewise. * g10/misc.c: Likewise. * g10/options.h: Likewise. * g10/packet.h: Likewise. * g10/parse-packet.c: Likewise. * g10/pkclist.c: Likewise. * g10/pkglue.c: Likewise. * g10/plaintext.c: Likewise. * g10/server.c: Likewise. * g10/sig-check.c: Likewise. * g10/sqlite.c: Likewise. * g10/tdbio.c: Likewise. * g10/test-stubs.c: Likewise. * g10/tofu.c: Likewise. * g10/trust.c: Likewise. * g10/trustdb.c: Likewise. * g13/create.c: Likewise. * g13/mountinfo.c: Likewise. * kbx/keybox-blob.c: Likewise. * kbx/keybox-file.c: Likewise. * kbx/keybox-init.c: Likewise. * kbx/keybox-search-desc.h: Likewise. * kbx/keybox-search.c: Likewise. * kbx/keybox-update.c: Likewise. * scd/apdu.c: Likewise. * scd/app-openpgp.c: Likewise. * scd/app-p15.c: Likewise. * scd/app.c: Likewise. * scd/ccid-driver.c: Likewise. * scd/command.c: Likewise. * scd/iso7816.c: Likewise. * sm/base64.c: Likewise. * sm/call-agent.c: Likewise. * sm/call-dirmngr.c: Likewise. * sm/certchain.c: Likewise. * sm/gpgsm.c: Likewise. * sm/import.c: Likewise. * sm/keydb.c: Likewise. * sm/minip12.c: Likewise. * sm/qualified.c: Likewise. * sm/server.c: Likewise. * tools/gpg-check-pattern.c: Likewise. * tools/gpgconf-comp.c: Likewise. * tools/gpgkey2ssh.c: Likewise. * tools/gpgparsemail.c: Likewise. * tools/gpgtar.c: Likewise. * tools/rfc822parse.c: Likewise. * tools/symcryptrun.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
2015-01-26sm: Simplify fix ed8383c6Werner Koch1-4/+2
* sm/minip12.c (p12_build): Release PWBUF only at the end. -- Suggested-by: Eygene Ryabinkin <[email protected]> Signed-off-by: Werner Koch <[email protected]>
2014-12-22sm: Avoid double-free on iconv failureDaniel Kahn Gillmor1-0/+2
* sm/minip12.c: (p12_build) if jnlib_iconv_open fails, avoid double-free of pwbuf. -- Observed by Joshua Rogers <[email protected]>, who proposed a slightly different fix. Debian-Bug-Id: 773472 Added fix at a second place - wk.
2014-06-03gpgsm: New commands --export-secret-key-{p8,raw}Werner Koch1-38/+74
* sm/gpgsm.c: Add new commands. * sm/minip12.c (build_key_sequence): Add arg mode. (p12_raw_build): New. * sm/export.c (export_p12): Add arg rawmode. Call p12_raw_build. (gpgsm_p12_export): Ditto. (print_short_info): Print the keygrip.
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-6/+6
The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
2011-03-10Support pkcs#12 import of PBES2 encoded data.Werner Koch1-68/+288
This is so that we read compatible with gnutls's certtool. Only AES-128 is supported. The latest Libgcrypt from git is required. Fixes bug#1321.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-88/+88
We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
2010-06-21Implement export of pkcs#12 objects using a direct agent connection.Werner Koch1-3/+4
2010-06-17Avoid using the protect-tool to import pkcs#12.Werner Koch1-3/+6
2010-03-10Merged jnlib into common.Werner Koch1-3/+3
2010-01-08Add dummu option --passwd for gpg.Werner Koch1-1/+1
Collected changes.
2008-12-05Add option --card-timeout.Werner Koch1-1/+1
Add a new attribyte to app-openpgp.c Fix two portability bugs. Have gpg-connect-agent autostart gpg-agent on W32.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2007-06-14A whole bunch of changes to allow building for Windows.Werner Koch1-18/+13
See the ChangeLogs for details.
2007-06-06First steps towards supporting W32.Werner Koch1-9/+9
This is mainly source code reorganization. Update gnulib. g10/ does currently not build.
2007-03-20Allow setting of the passphrase encoding of pkcs#12 files.Werner Koch1-6/+65
New option --p12-charset.
2007-03-19 * PKCS#12 import now tries several encodings in case the passphraseWerner Koch1-24/+155
was not utf-8 encoded.
2006-11-20Made some PIN pads work.Werner Koch1-3/+4
Some cleanups for 64 bit CPUs.
2006-10-23Allow importing of web.de generated p12 filesWerner Koch1-4/+4
2006-07-24Create bag attributes so that Mozilla will accept these files.Werner Koch1-8/+79
Tested with using a CAcert generated certificate.
2006-07-21Support import from TrustedMIME (i.e. from simple keyBags)Werner Koch1-44/+191
2006-06-20Updated FSF's address.Werner Koch1-1/+2
2006-06-20Add MAC t P12 files.Werner Koch1-6/+60
2005-12-16Fixed importing certs created by newer versions of Mozilla.Werner Koch1-48/+237
2005-11-28Preparing an interim releaseWerner Koch1-6/+15
2005-09-16Fixed padding in pkcs#12 Werner Koch1-2/+12
2005-09-09Fixed yesterdays change. Importing to Outlook seems to work now.Werner Koch1-2/+2
2005-09-09Bug fixes and ssh support for the BELPIC.Werner Koch1-2/+2
2005-07-27Removed directories which are only used by the 1.9 branchWerner Koch1-1140/+0
2005-06-29(data_sign): Removed empty statement.Werner Koch1-4/+8
2005-06-16gcc-4 defaults forced me to edit many many files to get rid of theWerner Koch1-0/+2
char * vs. unsigned char * warnings. The GNU coding standards used to say that these mismatches are okay and better than a bunch of casts. Obviously this has changed now.
2005-04-20.Werner Koch1-3/+6
2004-09-29* minip12.c (parse_bag_encrypted_data): Print error if a badWerner Koch1-6/+21
passphrase has been given. * gpg-agent.texi (Invoking GPG-AGENT): Add a few words about the expected pinentry filename. * import.c (parse_p12): Write an error status line for bad passphrases. Add new arg CTRL and changed caller. * export.c (export_p12): Likewise.