aboutsummaryrefslogtreecommitdiffstats
path: root/g10/seskey.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-04-28Spelling fixes in docs and comments.NIIBE Yutaka1-2/+2
-- In addition, fix trailing spaces in tests/inittests. GnuPG-bug-id: 3121 Reported-by: ka7 (klemens) Signed-off-by: NIIBE Yutaka <[email protected]>
2017-03-07Remove -I option to common.NIIBE Yutaka1-2/+2
* dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <[email protected]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-06-02gpg: Do not abort on certain invalid packets.Werner Koch1-3/+6
* g10/build-packet.c (write_fake_data): Check for non-opaque data. * g10/seskey.c (do_encode_md): Return NULL instead of abort. -- The first may happen if the usage flags of an algorithm do not match the allowed usage. When writing a backsig this would lead to a log_bug in libgcrypt due to the use of a regular MPI as opaque data. The second may happen with all kind of invalid data. It is easy to avoid an abort, though. Signed-off-by: Werner Koch <[email protected]>
2016-05-21gpg: Remove debug output accidently introduced with 027c4e5.Werner Koch1-3/+0
-- Fixes-commit: 027c4e55522b8e18711a3331932a9869ab89ca26 Signed-off-by: Werner Koch <[email protected]>
2016-05-21gpg: Pass CTRL object down to the trust functionsWerner Koch1-0/+3
Signed-off-by: Werner Koch <[email protected]>
2016-04-29gpg: Remove all assert.h and s/assert/log_assert/.Werner Koch1-9/+8
Signed-off-by: Werner Koch <[email protected]>
2016-02-14Put asterisks in front of two function descriptions.Werner Koch1-9/+9
-- This helps visual impaired hackers to easier read comments and also helps use when looking at a printout.
2016-02-14gpg: Improve API documentation.Neal H. Walfield1-11/+17
* g10/seskey.c (make_session_key): Improve documentation. (encode_session_key): Improve documentation. * g10/encrypt.c (encrypt_seskey): Remove gratuitous initialization. * g10/dek.h (DEK): Improve documenation. -- Signed-off-by: Neal H. Walfield <[email protected]>
2015-04-06gpg: Rename a debug macro.Werner Koch1-2/+2
* g10/options.h (DBG_CIPHER_VALUE): Rename to DBG_CRYPTO_VALUE. (DBG_CIPHER): Rename to DBG_CRYPTO.
2014-01-30gpg: Use only OpenPGP public key algo ids and add the EdDSA algo id.Werner Koch1-11/+11
* common/sexputil.c (get_pk_algo_from_canon_sexp): Change to return a string. * g10/keygen.c (check_keygrip): Adjust for change. * sm/certreqgen-ui.c (check_keygrip): Likewise. * agent/pksign.c (do_encode_dsa): Remove bogus map_pk_openpgp_to_gcry. * g10/misc.c (map_pk_openpgp_to_gcry): Remove. (openpgp_pk_test_algo): Change to a wrapper for openpgp_pk_test_algo2. (openpgp_pk_test_algo2): Rewrite. (openpgp_pk_algo_usage, pubkey_nbits): Add support for EdDSA. (openpgp_pk_algo_name): Rewrite to remove need for gcry calls. (pubkey_get_npkey, pubkey_get_nskey): Ditto. (pubkey_get_nsig, pubkey_get_nenc): Ditto. * g10/keygen.c(do_create_from_keygrip): Support EdDSA. (common_gen, gen_ecc, ask_keysize, generate_keypair): Ditto. * g10/build-packet.c (do_key): Ditto. * g10/export.c (transfer_format_to_openpgp): Ditto. * g10/getkey.c (cache_public_key): Ditto. * g10/import.c (transfer_secret_keys): Ditto. * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Ditto. * g10/mainproc.c (proc_pubkey_enc): Ditto. * g10/parse-packet.c (parse_key): Ditto, * g10/sign.c (hash_for, sign_file, make_keysig_packet): Ditto. * g10/keyserver.c (print_keyrec): Use openpgp_pk_algo_name. * g10/pkglue.c (pk_verify, pk_encrypt, pk_check_secret_key): Use only OpenPGP algo ids and support EdDSA. * g10/pubkey-enc.c (get_it): Use only OpenPGP algo ids. * g10/seskey.c (encode_md_value): Ditto. -- This patch separates Libgcrypt and OpenPGP public key algorithms ids and in most cases completely removes the Libgcrypt ones. This is useful because for Libgcrypt we specify the algorithm in the S-expressions and the public key ids are not anymore needed. This patch also adds some support for PUBKEY_ALGO_EDDSA which will eventually be used instead of merging EdDSA with ECDSA. As of now an experimental algorithm id is used but the plan is to write an I-D so that we can get a new id from the IETF. Note that EdDSA (Ed25519) does not yet work and that more changes are required. The ECC support is still broken right now. Needs to be fixed. Signed-off-by: Werner Koch <[email protected]>
2014-01-29gpg: Remove cipher.h and put algo ids into a common file.Werner Koch1-1/+0
* common/openpgpdefs.h (cipher_algo_t, pubkey_algo_t, digest_algo_t) (compress_algo_t): New. * agent/gpg-agent.c: Remove ../g10/cipher.h. Add openpgpdefs.h. * g10/cipher.h (DEK): Move to ... * g10/dek.h: new file. * g10/cipher.h (is_RSA, is_ELGAMAL, is_DSA) (PUBKEY_MAX_NPKEY, PUBKEY_MAX_NSKEY, PUBKEY_MAX_NSIG, PUBKEY_MAX_NENC) (PUBKEY_USAGE_SIG, PUBKEY_USAGE_ENC, PUBKEY_USAGE_CERT) (PUBKEY_USAGE_AUTH, PUBKEY_USAGE_NONE): Move to * g10/packet.h: here. * g10/cipher.h: Remove. Remove from all files. * g10/filter.h, g10/packet.h: Include dek.h. * g10/Makefile.am (common_source): Remove cipher.h. Add dek.h. Signed-off-by: Werner Koch <[email protected]>
2013-11-15gpg: Rework ECC support and add experimental support for Ed25519.Werner Koch1-1/+6
* agent/findkey.c (key_parms_from_sexp): Add algo name "ecc". (agent_is_dsa_key): Ditto. (agent_is_eddsa_key): New. Not finished, though. * agent/pksign.c (do_encode_eddsa): New. (agent_pksign_do): Use gcry_log_debug functions. * agent/protect.c (agent_protect): Parse a flags parameter. * g10/keygen.c (gpg_curve_to_oid): Move to ... * common/openpgp-oid.c (openpgp_curve_to_oid): here and rename. (oid_ed25519): New. (openpgp_oid_is_ed25519): New. (openpgp_oid_to_curve): New. * common/t-openpgp-oid.c (test_openpgp_oid_is_ed25519): New. * g10/build-packet.c (gpg_mpi_write): Write the length header also for opaque MPIs. (gpg_mpi_write_nohdr): New. (do_key): Use gpg_mpi_write_nohdr depending on algorithm. (do_pubkey_enc): Ditto. * g10/ecdh.c (pk_ecdh_encrypt_with_shared_point): Use gpg_mpi_write_nohdr. * g10/export.c (transfer_format_to_openpgp): * g10/keygen.c (ecckey_from_sexp): Return the error. (gen_ecc): Repalce arg NBITS by CURVE. (read_parameter_file): Add keywords "Key-Curve" and "Subkey-Curve". (ask_curve): New. (generate_keypair, generate_subkeypair): Use ask_curve. (do_generate_keypair): Also pass curve name. * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Print curve name. * g10/parse-packet.c (mpi_read): Remove workaround for Libcgrypt < 1.5. (parse_key): Fix ECC case. Print the curve name. * g10/pkglue.c (mpi_from_sexp): Rename to get_mpi_from_sexp. (pk_verify, pk_check_secret_key): Add special case for Ed25519. * g10/seskey.c (encode_md_value): Ditto. * g10/sign.c (do_sign, hash_for, sign_file): Ditto. -- Be warned that this code is subject to further changes and that the format will very likely change before a release. There are also known bugs and missing code. Signed-off-by: Werner Koch <[email protected]>
2012-08-24Fix typos spotted during translationsDavid Prévot1-1/+1
* agent/genkey.c: s/to to/to/ * sm/*.c: s/failed to allocated/failed to allocate/ * sm/certlist.c, ./dirmngr/validate.c: s/should have not/should not have/ * g10/seskey.c: missing closing parenthesis * dirmngr/crlcache.c: s/may has/may have/ Consistency fix: * g10/gpg.c, kbx/kbxutil.c, sm/gpgsm.c: uppercase after Syntax * dirmngr/dirmngr_ldap: no period in Syntax * dirmngr/dirmngr-client.c: infinitive for option description: s/certificates are expected/expect certificates/
2011-06-01Fix size_t vs int issues.Marcus Brinkmann1-1/+1
2011-02-10Add ECC import regression tests and fixed a regression.Werner Koch1-16/+12
The import test imports the keys as needed and because they are passphrase protected we now need a pinentry script to convey the passphrase to gpg-agent.
2011-02-07Fix ECDSA 521 bit signing.Werner Koch1-15/+14
This fix also allows the creation and use of an 521 bit ECDH key which used to fail while creating the binding signature.
2011-02-03Finished ECC integration.ECC-INTEGRATION-2-1Werner Koch1-14/+14
Wrote the ChangeLog 2011-01-13 entry for Andrey's orginal work modulo the cleanups I did in the last week. Adjusted my own ChangeLog entries to be consistent with that entry. Nuked quite some trailing spaces; again sorry for that, I will better take care of not saving them in the future. "git diff -b" is useful to read the actual changes ;-). The ECC-INTEGRATION-2-1 branch can be closed now.
2011-01-21Truncate the DSA hash; fixes regression.Werner Koch1-4/+6
Removed left over debug code.
2011-01-21Editorial changes and allow building with old libgcrypts.Werner Koch1-127/+152
Changed order of some conditional to make to put the special case into the true branch. Indentation changes. Minor other changes to make the ECC code more similar to the rest of our code. It builds but many sefltests still fail. Need to fix that before using it with an ECDH enabled libgcrypt. [/] 2011-01-21 Werner Koch <[email protected]> * configure.ac: Need Libgcrypt 1.4.6 due to AESWRAP. (HAVE_GCRY_PK_ECDH): Add new test. [agent/] 2011-01-21 Werner Koch <[email protected]> * cvt-openpgp.c (GCRY_PK_ECDH) [!HAVE_GCRY_PK_ECDH]: New. [include/] 2011-01-21 Werner Koch <[email protected]> * cipher.h (GCRY_PK_USAGE_CERT): Remove compatibility macros because we now require libgcrypt 1.4.6. (GCRY_PK_ECDH): Add replacement.
2011-01-13Fixed key generation with P-521. Confirmed that signature generation and ↵Andrey Jivsov1-2/+2
verification work.
2011-01-06Integrating http://code.google.com/p/gnupg-ecc/source/detail?r=15 .Andrey Jivsov1-12/+57
The following works: gpg2 --gen-key (ECC) gpg2 --list-keys gpg2 --list-packets ~/.gnupg/pubring.gpg gpg2 --list-packets <private key from http://sites.google.com/site/brainhub/pgpecckeys> ECDH doesn't work yet as the code must be re-written to adjust for gpg-agent refactoring.
2010-04-20Generating an OpenPGP key cia gpg-agent basically works.Werner Koch1-16/+14
2009-06-05Add full Camellia support.David Shaw1-6/+6
* configure.ac: Remove Camellia restriction. * gpg.c (main), misc.c (openpgp_cipher_test_algo): Remove Camellia restriction. * misc.c (map_cipher_openpgp_to_gcry), main.h: Add macros for openpgp_cipher_open, openpgp_cipher_get_algo_keylen, and openpgp_cipher_get_algo_blklen to wrap around the corresponding gcry_* functions, but pass the algorithm number through map_cipher_openpgp_to_gcry. This is needed in case the gcry algorithm number doesn't match the OpenPGP number (c.f. Camellia). * encr-data.c, pubkey-enc.c, mainproc.c, cipher.c, encode.c, seskey.c, passphrase.c, seckey-cert.c: Use new openpgp_cipher_* macros here.
2008-09-29Remove hacks which are not anymore needed since we now require Libgcrypt 1.4Werner Koch1-4/+2
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2006-11-21No more warnings for AMD64 (at least when cross-compiling). Thus tehre is aWerner Koch1-10/+10
good chance that gpg2 will now work. Other cleanups. Updated gettext.
2006-10-05bug fixesWerner Koch1-1/+3
2006-06-30A couple of fixes. gpg2's key generation does now work.Werner Koch1-3/+2
2006-04-19Merged with gpg 1.4.3 code. Werner Koch1-76/+117
The gpg part does not yet build.
2006-03-30Update copyrightDavid Shaw1-1/+2
2006-03-30* main.h, seskey.c (encode_md_value): Modify to allow a q size greaterDavid Shaw1-26/+66
than 160 bits as per DSA2. This will allow us to verify and issue DSA2 signatures for some backwards compatibility once we start generating DSA2 keys. * sign.c (do_sign), sig-check.c (do_check): Change all callers. * sign.c (do_sign): Enforce the 160-bit check for new signatures here since encode_md_value can handle non-160-bit digests now. This will need to come out once the standard for DSA2 is firmed up.
2005-07-27Converted all m_free to xfree etc.Werner Koch1-6/+6
2005-05-31Updated FSF street address and preparations for a release candidate.Werner Koch1-1/+2
2004-08-19(encode_session_key): Changed the zero random byteWerner Koch1-2/+5
substituting code to actually do clever things. Thanks to Matthias Urlichs for noting the implementation problem.
2003-12-04* options.h, g10.c (main), main.h, seskey.c (do_encode_md,David Shaw1-6/+6
encode_md_value), sig-check.c (do_check), sign.c (do_sign): Remove --emulate-md-encode-bug as it only applied to Elgamal signatures, which are going away.
2003-11-21* seskey.c (do_encode_md): Comment about earlier (pre-PGP 2.3) encodings.David Shaw1-1/+10
* misc.c (compress_algo_to_string): Translate "Uncompressed". Requested by Tommi Vainikainen. (string_to_compress_algo): Include multi-string for "uncompressed|none".
2003-07-28Adjusted for use with current libgcrypt (1.1.42).Werner Koch1-3/+3
2003-07-03* options.h (DBG_CIPHER): Reintroduced it.Werner Koch1-2/+6
* seskey.c (encode_session_key): Debug output of the session key. * pubkey-enc.c (get_it): Handle card case. * call-agent.c (agent_scd_pkdecrypt): New. * pkglue.c (pk_encrypt): Add RSA support. * g10.c (main): Default to --use-agent. * keygen.c (show_smartcard): Print info about the public key. (check_smartcard): Check for existing key here. (gen_card_key): And not anymore here. (fpr_is_zero): New. (generate_keypair): Generate both keys for a card. (smartcard_change_url): Nw.
2003-07-01* app-openpgp.c (store_fpr): Fixed fingerprint calculation.Werner Koch1-2/+4
* keygen.c (gen_card_key): Obviously we should use the creation date received from SCDAEMON, so that the fingerprints will match. * sign.c (do_sign): Pass the serialno to the sign code. * keyid.c (serialno_and_fpr_from_sk): New.
2003-06-27Key generation and signing using the OpenPGP card does rudimentary work.Werner Koch1-0/+5
2003-06-18Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch1-65/+81
to libgcrypt functions, using shared error codes from libgpg-error, replacing the old functions we used to have in ../util by those in ../jnlib and ../common, renaming the malloc functions and a couple of types. Note, that not all changes are listed below becuause they are too similar and done at far too many places. As of today the code builds using the current libgcrypt from CVS but it is very unlikely that it actually works.
2002-06-29Update head to match stable 1.0David Shaw1-57/+47
2000-07-14See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch1-6/+14
2000-01-31See ChangeLog: Mon Jan 31 16:37:34 CET 2000 Werner KochWerner Koch1-1/+0
2000-01-24See ChangeLog: Mon Jan 24 13:04:28 CET 2000 Werner KochWerner Koch1-19/+18
1999-12-08See ChangeLog: Wed Dec 8 21:58:32 CET 1999 Werner KochWerner Koch1-11/+7
1999-11-13See ChangeLog: Sat Nov 13 17:44:23 CET 1999 Werner KochWerner Koch1-5/+5
1999-10-26See ChangeLog: Tue Oct 26 14:10:21 CEST 1999 Werner KochWerner Koch1-20/+41
1998-12-23See ChangeLog: Wed Dec 23 13:34:22 CET 1998 Werner KochWerner Koch1-3/+3