aboutsummaryrefslogtreecommitdiffstats
path: root/sm/fingerprint.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* common,gpg,scd,sm: Use openpgp_oid_or_name_to_curve to get curve.NIIBE Yutaka2024-10-081-2/+1
| | | | | | | | | | | | * common/sexputil.c (pubkey_algo_string): Use openpgp_oid_or_name_to_curve. * g10/card-util.c (current_card_status, ask_card_keyattr): Likewise. * scd/app-piv.c (writekey_ecc): Likewise. * sm/fingerprint.c (gpgsm_get_key_algo_info): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* sm: Flag Brainpool curves as compliant for all other operations.Werner Koch2023-10-241-9/+2
| | | | | | | | | | | | | | * sm/fingerprint.c (gpgsm_get_key_algo_info2): Rename to (gpgsm_get_key_algo_info): this. Remove the old wrapper. Adjust all callers. * sm/decrypt.c (gpgsm_decrypt): Pass the curve to the compliance checker. * sm/encrypt.c (gpgsm_encrypt): Ditto. * sm/sign.c (gpgsm_sign): Ditto. * sm/verify.c (gpgsm_verify): Ditto. -- GnuPG-bug-id: 6253
* gpgsm: Allow ECC encryption keys with just keyAgreement specified.Werner Koch2022-10-251-0/+8
| | | | | | | | * sm/certlist.c (cert_usage_p): Allow keyAgreement for ECC. * sm/fingerprint.c (gpgsm_is_ecc_key): New. -- For ECC encryption keys keyAgreement is the keyUsage we want.
* gpgsm: Replace all assert calls by log_assert.Werner Koch2020-07-081-7/+6
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* sm: Print the key types as standard key algorithm strings.Werner Koch2020-05-071-2/+68
| | | | | | | | | | | | | | | | * sm/fingerprint.c (gpgsm_get_key_algo_info): Factor code out to ... (gpgsm_get_key_algo_info2): new. (gpgsm_pubkey_algo_string): New. * sm/keylist.c (list_cert_colon): Put curve into field 17 (list_cert_raw): Print the unified key algotithm string instead of the algo and size. (list_cert_std): Ditto. -- It is important to known whether a 256 bit ECC uses a NIST or a Brainpool curve. Signed-off-by: Werner Koch <[email protected]>
* sm: Minor debug output format changes.Werner Koch2020-04-231-1/+1
| | | | --
* Spelling cleanup.Daniel Kahn Gillmor2020-02-181-1/+1
| | | | | | | | | | | | | | | | No functional changes, just fixing minor spelling issues. --- Most of these were identified from the command line by running: codespell \ --ignore-words-list fpr,stati,keyserver,keyservers,asign,cas,iff,ifset \ --skip '*.po,ChangeLog*,help.*.txt,*.jpg,*.eps,*.pdf,*.png,*.gpg,*.asc' \ doc g13 g10 kbx agent artwork scd tests tools am common dirmngr sm \ NEWS README README.maint TODO Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Use the gpgrt log functions if possible.Werner Koch2017-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/logging.c: Do not build any code if we can use the gpgrt_log functions. (log_logv_with_prefix): Rename to log_logv_prefix and change order of args so that this function matches its printf like counterpart gpgrt_logv_prefix. Change all callers. (log_debug_with_string): Rename to log_debug_string. Change all callers. (log_printhex): Move first arg to end so that this function matches its printf like counterpart gpgrt_log_printhex. Change all callers. * common/logging.h: Divert to gpgrt/libgpg-error if we can use the gpgrt_log functions. (bug_at): Add inline versions if we can use the gpgrt_log functions. * configure.ac (GPGRT_ENABLE_LOG_MACROS): Add to AH_BOTTOM. (mycflags): Add -Wno-format-zero-length. -- This patch enables the use of the log function from libgpgrt (aka libgpg-error). Instead of checking a version number, we enable them depending on macros set by recent gpg-error versions. Eventually the whole divert stuff can be removed. The -Wno-format-zero-length is required because log_printhex can be called with an empty format string. Note that this is fully specified standard C behaviour. Signed-off-by: Werner Koch <[email protected]>
* gpg,sm: New option --with-key-screening.Werner Koch2017-10-171-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/pkscreening.c: New. * common/pkscreening.h: New. * common/Makefile.am (common_sources): Add them. * g10/gpg.c (opts): New option --with-key-screening. * g10/options.h (struct opt): New field with_key_screening. * g10/keylist.c: Include pkscreening.h. (print_pk_screening): New. (list_keyblock_print): Call it. (print_compliance_flags): Call it. * sm/gpgsm.c (opts): New option --with-key-screening. * sm/gpgsm.h (scruct opt): New field with_key_screening. * sm/keylist.c: Include pkscreening.h. (print_pk_screening): New. (print_compliance_flags): Call it. Add new arg cert. (list_cert_colon): Pass arg cert (list_cert_std): Call print_pk_screening. * sm/fingerprint.c (gpgsm_get_rsa_modulus): New. -- This new option can be used to detect ROCA affected keys. To scan an entire keyring and print the affected fingerprints use this: gpg -k --with-key-screening --with-colons | gawk -F: \ '$1~/pub|sub|sec|ssb|crt/ && $18~/\<6001\>/ {found=1;next}; $1=="fpr" && found {print $10}; {found=0}' The same works for gpgsm. Note that we need gawk due to the "\<" in the r.e. Signed-off-by: Werner Koch <[email protected]>
* Remove -I option to common.NIIBE Yutaka2017-03-071-1/+1
| | | | | | | | | | | | | * 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]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* sm: Avoid warnings about useless assignments.Werner Koch2016-01-071-1/+0
| | | | | | | | | | | | | * sm/call-dirmngr.c (prepare_dirmngr): Remove setting of ERR. (unhexify_fpr): Remove useless computation on N. * sm/certchain.c (do_validate_chain): Remove clearing of RC. Remove useless setting of RC. * sm/fingerprint.c (gpgsm_get_keygrip): Remove setting of RC. * sm/gpgsm.c (build_list): Replace final stpcpy by strcpy. * sm/keydb.c (keydb_clear_some_cert_flags): Remove clearing of RC. * sm/server.c (cmd_getauditlog): Comment unused skip_options. Signed-off-by: Werner Koch <[email protected]>
* Use inline functions to convert buffer data to scalars.Werner Koch2015-02-111-8/+5
| | | | | | | | | | | | | | | * common/host2net.h (buf16_to_ulong, buf16_to_uint): New. (buf16_to_ushort, buf16_to_u16): New. (buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New. -- Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to avoid all sign extension on shift problems. Hanno Böck found a case with an invalid read due to this problem. To fix that once and for all almost all uses of "<< 24" and "<< 8" are changed by this patch to use an inline function from host2net.h. Signed-off-by: Werner Koch <[email protected]>
* Avoid sign extension when shifting the MSB.Werner Koch2014-11-051-2/+8
| | | | | | | | * sm/fingerprint.c (gpgsm_get_short_fingerprint): Cast MSB before shifting. * g10/build-packet.c (delete_sig_subpkt): Ditto. Signed-off-by: Werner Koch <[email protected]>
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-12/+8
| | | | | | | | 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.
* Print NO_SECKEY status line in gpgsm.Werner Koch2009-03-251-2/+5
| | | | | This fixes bug#1020.
* New gpg-agent command to list key information.Werner Koch2009-03-061-2/+2
| | | | | | Gpgsm does now print the S/N of cards. Consider ephemeral keys during listing an export.
* Fix error detectionWerner Koch2009-01-081-6/+8
|
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* kbx/Werner Koch2007-03-201-14/+26
| | | | | | | | | | | | | | | | | | | | * keybox.h (KEYBOX_FLAG_BLOB_SECRET, KEYBOX_FLAG_BLOB_EPHEMERAL): New. * keybox-update.c (keybox_compress): Use it here instead of a magic constant. sm/ * fingerprint.c (gpgsm_get_fingerprint): Add caching. (gpgsm_get_fingerprint_string): Use bin2hexcolon(). (gpgsm_get_fingerprint_hexstring): Use bin2hex and allocate only as much memory as required. (gpgsm_get_keygrip_hexstring): Use bin2hex. * certchain.c (gpgsm_validate_chain): Keep track of the certificate chain and reset the ephemeral flags. * keydb.c (keydb_set_cert_flags): New args EPHEMERAL and MASK. Changed caller to use a mask of ~0. Return a proper error code if the certificate is not available.
* 2006-12-18 Marcus Brinkmann <[email protected]>Marcus Brinkmann2006-12-181-0/+1
| | | | | * fingerprint.c (gpgsm_get_fingerprint): Close MD.
* Updated FSF's address.Werner Koch2006-06-201-1/+2
|
* (gpgsm_get_certid): Cast printf arg to unsigned.Werner Koch2005-07-191-3/+1
| | | | | | Bug accidently introduced while solving the #$%^& gcc signed/unsigned char* warnings.
* gcc-4 defaults forced me to edit many many files to get rid of theWerner Koch2005-06-161-8/+9
| | | | | | | 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.
* * sign.c (gpgsm_sign): Include the error source in the final errorWerner Koch2004-05-111-0/+60
| | | | | | | | | | | | | | | message. * decrypt.c (gpgsm_decrypt): Ditto. * fingerprint.c (gpgsm_get_key_algo_info): New. * sign.c (gpgsm_sign): Don't assume RSA in the status line. * keylist.c (list_cert_colon): Really print the algorithm and key length. (list_cert_raw, list_cert_std): Ditto. * gpgsm.h (opt): Add member CONFIG_FILENAME. * gpgsm.c (main): Use it here instead of the local var.
* * gpgsm.c: New option --force-crl-refresh.Werner Koch2004-04-071-1/+1
| | | | | * call-dirmngr.c (gpgsm_dirmngr_isvalid): Pass option to dirmngr.
* Replaced deprecated type names.Werner Koch2003-12-171-9/+9
| | | | | | | | * certdump.c (gpgsm_print_serial): Cleaned up cast use in strtoul. (gpgsm_dump_serial): Ditto. * decrypt.c (gpgsm_decrypt): Replaced ERR by RC.
* Mainly changes to adjust for the changed KSBA API.Werner Koch2003-11-121-2/+2
|
* This commit was manufactured by cvs2svn to create branchRepo Admin2003-08-051-0/+271
| | | | 'GNUPG-1-9-BRANCH'.
* This commit was manufactured by cvs2svn to create branchRepo Admin2002-10-191-271/+0
| | | | 'GNUPG-1-9-BRANCH'.
* * keylist.c (list_cert_colon): Print the short fingerprint in theWerner Koch2002-08-101-1/+12
| | | | | | | | key ID field. * fingerprint.c (gpgsm_get_short_fingerprint): New. * verify.c (gpgsm_verify): Print more verbose info for a good signature.
* * delete.c: New.Werner Koch2002-07-221-1/+1
| | | | | | | | | | * gpgsm.c: Made --delete-key work. * server.c (cmd_delkeys): New. (register_commands): New command DELKEYS. * decrypt.c (gpgsm_decrypt): Print a convenience note when RC2 is used and a STATUS_ERROR with the algorithm oid.
* * fingerprint.c (gpgsm_get_certid): Print the serialand not theWerner Koch2002-01-131-1/+1
| | | | | hash after the dot.
* * call-dirmngr.c: New.Werner Koch2002-01-111-0/+67
| | | | | | | * certpath.c (gpgsm_validate_path): Check the CRL here. * fingerprint.c (gpgsm_get_certid): New. * gpgsm.c: New options --dirmngr-program and --disable-crl-checks.
* * base64.c (gpgsm_create_writer): Allow to set the object nameWerner Koch2002-01-101-0/+4
| | | | | | | | * server.c (cmd_genkey): New. * certreqgen.c: New. The parameter handling code has been taken from gnupg/g10/keygen.c version 1.0.6. * call-agent.c (gpgsm_agent_genkey): New.
* Changes to be used with the new libksba interface.Werner Koch2001-12-181-16/+19
| | | | | libgcrypt-1.1.5 is required (cvs or tarball)
* * decrypt.c (gpgsm_decrypt): Write STATUS_DECRYPTION_*.Werner Koch2001-12-151-1/+1
| | | | | * sign.c (gpgsm_sign): Write a STATUS_SIG_CREATED.
* Started with decryption stuffWerner Koch2001-12-051-1/+3
|
* Introduced the keygripWerner Koch2001-11-241-0/+57
|
* Added basic code for keylisting.Werner Koch2001-11-191-1/+1
| | | | | New Assuan command LISTKEYS.
* Write status output, make verify work in server mode.Werner Koch2001-11-191-0/+23
|
* We have reached a state where we are able to import certs andWerner Koch2001-11-131-0/+104
check the certification path.