aboutsummaryrefslogtreecommitdiffstats
path: root/common (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-05-27gpg: Allow deletion of subkeys with --delete-[secret-]key.Werner Koch1-3/+4
* common/userids.c (classify_user_id): Do not set the EXACT flag in the default case. * g10/export.c (exact_subkey_match_p): Make static, * g10/delkey.c (do_delete_key): Implement subkey only deleting. -- GnuPG-bug-id: 4457
2019-04-16common: Fix AWK portability.NIIBE Yutaka2-7/+7
* common/Makefile.am: Use pkg_namespace. * common/mkstrtable.awk: Use pkg_namespace. Regexp fix. -- Cherry-picked from master commit: b6f0b0efa19e0434024bc16e246032b613fd448a GnuPG-bug-Bug: 4459 Signed-off-by: NIIBE Yutaka <[email protected]>
2019-02-19common: Fix gnupg_wait_processes.NIIBE Yutaka1-24/+26
* common/exechelp-posix.c (gnupg_wait_processes): Loop for r_exitcodes even if we already see an error. -- Cherry-picked master commit of: eeb3da6eb717ed6a1a1069a7611eb37503e8672d The value stored by waitpid for exit code is encoded; It requires decoded by WEXITSTATUS macro, regardless of an error. For example, when one of processes is already exited and another is still running, it resulted wrong value of in r_exitcodes[n]. Signed-off-by: NIIBE Yutaka <[email protected]>
2019-02-12Release 2.2.13gnupg-2.2.13Werner Koch2-2/+2
2019-02-11common: Provide function to get public key algo names in our format.Werner Koch2-0/+59
* common/sexputil.c (pubkey_algo_string): New. -- The new gpg format for public key algorithms is useful at other places as well. Thus we make this new function available. Note that the code we use in gpg is not based on s-expressions and thus a new function was required. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 03bf8e967adb2dd13329ba1089deb419d49e55c0) Not yet used in 2.2 but will likely be needed by future backports.
2019-02-11common: New functions get_option_value and ascii_strupr.Werner Koch4-1/+71
* common/server-help.c (get_option_value): New. * common/stringhelp.c (ascii_strupr): New. -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit e2f18023b3b3b7e55b35218f65e37448d1011172) This might come handy when we eventually backport other changes.
2019-01-29common: Provide some convenient OpenPGP related constants.Werner Koch1-0/+6
* common/openpgpdefs.h (OPENPGP_MAX_NPKEY): New. (OPENPGP_MAX_NSKEY): New. (OPENPGP_MAX_NSIG): New. (OPENPGP_MAX_NENC): New. * g10/packet.h: Define PUBKEY_MAX using the new consts. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit f382984966a31a4cbe572bce5370590c5490ed1e)
2019-01-29common: New helper functions for OpenPGP curve OIDs.Werner Koch3-34/+66
* common/openpgp-oid.c (openpgp_oidbuf_to_str): Factor most code out to ... (openpgp_oidbuf_to_str): new. (openpgp_oidbuf_is_ed25519): New. (openpgp_oidbuf_is_cv25519): New. -- At some places it is more convenient (and faster) to directly work on buffers and avoid the way via opaque MPIs. These 3 new functions allow for that. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 4a1558d0c7190cf13d35385e47291a7aa121be3e)
2018-12-05common/iobuf: fix memory wiping in iobuf_copyJussi Kivilinna1-1/+6
* common/iobuf.c (iobuf_copy): Wipe used area of buffer instead of first sizeof(char*) bytes. -- Signed-off-by: Jussi Kivilinna <[email protected]> (cherry picked from commit 654e353d9b20f10fa275e7ae10cc50480654f079)
2018-12-05common: Use platform memory zeroing function for wipememoryJussi Kivilinna2-9/+19
* common/mischelp.h (wipememory): Replace macro with function prototype. (wipememory2): Remove. * common/mischelp.c (wipememory): New. * configure.ac (AC_CHECK_FUNCS): Check for 'explicit_bzero' and remove duplicated checks. -- In new wipememory function, memory is cleared through platform provided secure memory zeroing function, SecureZeroMemory or explicit_bzero. If none of these is available, memset is called through volatile function pointer to so that compiler won't optimize away the call. Signed-off-by: Jussi Kivilinna <[email protected]> (cherry picked from commit 2a650772b4e1c78a4fd20bc88433930e5551fe9c)
2018-10-24agent: Fix possible uninitalized use of CTX in simple_pwquery.Werner Koch1-0/+1
* common/simple-pwquery.c (agent_open): Clear CTX even on early error. -- GnuPG-bug-id: 4223 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit bafcf7095159493a656382997f8b0d0bb11a20e8)
2018-10-02common: Fix gnupg_reopen_std.NIIBE Yutaka1-6/+5
* common/sysutils.c (gnupg_reopen_std): Use fcntl instead of fstat. -- Cherry-pick from master commit of: 50b02dba2060a8969da47b18d9c0ecdccbd30db4 When gpg was invoked by a Perl web application on FreeBSD, fstat in gnupg_reopen_std failed with EBADF. Using fcntl, which is considered lighter than fstat, it works fine. Since uur purpose is to check if file descriptor is valid or not, lighter operation is better. Reported-by: Marcin Gryszkalis <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
2018-09-10common: Use iobuf_get_noeof to avoid undefined behaviors.NIIBE Yutaka1-3/+3
* common/iobuf.c (block_filter): Use iobuf_get_noeof. -- Cherry-pick from master commit of: f80346f42df4bdc7d0a9741c3922129aceae4f81 When singed integer has negative value, left shift computation is undefined in C. GnuPG-bug-id: 4093 Reported-by: Philippe Antoine Signed-off-by: NIIBE Yutaka <[email protected]>
2018-09-06Fix use of strncpy, which is actually good to use memcpy.NIIBE Yutaka1-1/+1
* common/ssh-utils.c (get_fingerprint): Use memcpy. * g10/build-packet.c (string_to_notation): Use memcpy. -- Cherry-pick of master commit of: 625ced6e672daa892d334323cce6b3d42a6f929f Signed-off-by: NIIBE Yutaka <[email protected]>
2018-08-28assuan: Fix exponential decay for first second.Werner Koch2-5/+7
* common/asshelp.c (wait_for_sock): Round SECSLEFT. * dirmngr/dirmngr.c (main): Take care of --debug-wait also in dameon mode. * common/sysutils.c (gnupg_usleep) [HAVE_NANOSLEEP]: Fix nanosleep use. -- Without the rounding we saw in verbose mose [...]to come up ... (5s) [...]to come up ... (4s) immediately without the expected one second delay. Waiting for the next seconds did not work if nanosleep was used due to improper passed parameters in gnupg_usleep. Adding --debug-wait for dirmngr in daemon mode is required to test this change. GnuPG-bug-id: 3490 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 0cfdd3b57d592fb6baa7dafe8fde124e8a6c7798) Fixes-commit: 1189df2cd7d4b6896ba22aa204c159ff2a425ead Signed-off-by: Werner Koch <[email protected]>
2018-08-28assuan: Use exponential decay for first 1s of spinlock.Daniel Kahn Gillmor1-5/+26
* common/asshelp.c (wait_for_sock): instead of checking the socket every second, we check 10 times in the first second (with exponential decay). -- This cuts the wall clock time for the standard test suite roughly by half. GnuPG-bug-id: 3490 Signed-off-by: Daniel Kahn Gillmor <[email protected]> (cherry picked from commit 149041b0b917f4298239fe18b5ebd5ead71584a6)
2018-08-28assuan: Reorganize waiting for socket.Daniel Kahn Gillmor1-42/+30
* common/asshelp.c (wait_for_sock): New function, collecting codepaths from... (start_new_gpg_agent) here and... (start_new_dirmngr) here. -- This has no functional change, but makes it easier to make this function more efficient. GnuPG-bug-id: 3490 Signed-off-by: Daniel Kahn Gillmor <[email protected]> (cherry picked from commit 0471ff9d3bf8d6b9a359f3c426d70d0935066907)
2018-07-29common: New function to validate domain names.Werner Koch3-2/+93
* common/mbox-util.c (is_valid_domain_name): New. * common/t-mbox-util.c (run_dns_test): New test. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit ddee9f9409fb5a089883eab0fadef7b9b7e61e72)
2018-05-02gpg: Fix "Too many open files" when using --multifile.Werner Koch1-0/+1
* common/miscellaneous.c (is_file_compressed): Don't cache the file. -- This seems to be a pretty old bug. The fix is easy and also reveals that -z0 can be used as a workaround. GnuPG-bug-id: 3951 Signed-off-by: Werner Koch <[email protected]>
2018-05-02common,w32: Hide spawned processes by defaultAndre Heinecke1-1/+1
* common/exechelp-w32.c (gnupg_spawn_process): Use SW_HIDE instead of SW_MINIMIZE. -- Spawning minimized shows icons in the task bar so users see that background processes are started, which is unusual. I'm pretty sure that the intention of the code was to hide the window if not in spawn debug mode. This is also what GPGME does. This fixes dirmngr_ldap process windows and other spurious reports about e.g. a gpgv console window from loadswdb. GnuPG-Bug-Id: T3937 Signed-off-by: Andre Heinecke <[email protected]>
2018-04-09gpg,w32: Fix empty homedir when only a drive letter is used.Werner Koch1-32/+63
* common/homedir.c (copy_dir_with_fixup): New. (default_homedir): Use here. (gnupg_set_homedir): And here . -- This actually fixes a couple of cases for Windows. Both --home-dir and GNUPGHOME. The interpretation of "c:" -> "c:/" might not be the correct one but because we need an absolute dir anyway it is the less surprising one. Note that this does not include a full syntax check and fixup and thus it is very well possible that the result is not an absolute directory. GnuPG-bug-id: 3720 Signed-off-by: Werner Koch <[email protected]>
2018-03-23agent: New OPTION pretend-request-originWerner Koch2-0/+48
* common/shareddefs.h (request_origin_t): New. * common/agent-opt.c (parse_request_origin): New. (str_request_origin): New. * agent/command.c (option_handler): Implement new option. -- This allows to pretend that a request originated from the extra or browser socket. Signed-off-by: Werner Koch <[email protected]>
2018-02-22Release 2.2.5gnupg-2.2.5Werner Koch2-2/+2
Signed-off-by: Werner Koch <[email protected]>
2018-02-14common: Use new function to print status strings.Werner Koch2-0/+70
* common/asshelp2.c (vprint_assuan_status_strings): New. (print_assuan_status_strings): New. * agent/command.c (agent_write_status): Replace by call to new function. * dirmngr/server.c (dirmngr_status): Ditto. * g13/server.c (g13_status): Ditto. * g13/sh-cmd.c (g13_status): Ditto. * sm/server.c (gpgsm_status2): Ditto. * scd/command.c (send_status_info): Bump up N. -- This fixes a potential overflow if LFs are passed to the status string functions. This is actually not the case and would be wrong because neither the truncating in libassuan or our escaping is not the Right Thing. In any case the functions need to be more robust and comply to the promised interface. Thus the code has been factored out to a helper function and N has been bumped up correctly and checked in all cases. For some uses this changes the behaviour in the error case (i.e. CR or LF passed): It will now always be C-escaped and not passed to libassuan which would truncate the line at the first LF. Reported-by: private_pers
2017-12-22kbx: Simplify by removing custom memory functions.Werner Koch1-0/+26
* kbx/keybox-util.c (keybox_set_malloc_hooks): Remove. (_keybox_malloc, _keybox_calloc, keybox_realloc) (_keybox_free): Remove. (keybox_file_rename): Remove. Was not used. * sm/gpgsm.c (main): Remove call to keybox_set_malloc_hooks. * kbx/kbxutil.c (main): Ditto. * kbx/keybox-defs.h: Remove all separate includes. Include util.h. remove convenience macros. * common/logging.h (return_if_fail): New. Originally from keybox-defs.h but now using log_debug. (return_null_if_fail): Ditto. (return_val_if_fail): Ditto. (never_reached): Ditto. -- Originally the KBX code was written to allow standalone use. However this required lot of ugliness like separate memory allocators and such. It also precludes the use of some standard functions from common due to their use of the common gnupg malloc functions. Dropping all that makes things easier. Minor disadvantages: the kbx call done for gpg will now use gcry malloc fucntions and not the standard malloc functions. This might be a bit slower but removing them even fixes a possible bug in keybox_tmp_names which is used in gpg and uses gpg's xfree which is actually gcry_free. Signed-off-by: Werner Koch <[email protected]>
2017-12-20common: Use larger buffer for homedir in case of 64 bit UIDs.Werner Koch1-1/+1
* common/homedir.c (_gnupg_socketdir_internal): Enlarge PREFIX by 6 bytes for "/gnupg". -- The temporary buffer was to short for the extra "/gnupg". However the 20 bytes for the UID is large enough for all 32 bit UIDs and would only fail (detected) if a 64 bit UID is used. Fixes-commit: 17efcd2a2acdc3b7f00711272aa51e5be2476921 Reported-by: Rainer Perske. Signed-off-by: Werner Koch <[email protected]>
2017-12-12build: New configure option --enable-run-gnupg-user-socket.Werner Koch1-2/+12
* configure.ac: (USE_RUN_GNUPG_USER_SOCKET): New ac_define. * common/homedir.c (_gnupg_socketdir_internal): Add extra directories. -- This allows to build GnuPG with an extra socketdir below /run. See https://lists.gnupg.org/pipermail/gnupg-devel/2017-November/033250.html for a longer explanation why this is sometimes useful. Suggested-by: Rainer Perske Signed-off-by: Werner Koch <[email protected]>
2017-12-08Revert: build: Do not define logging.h constants for ...Werner Koch1-17/+9
--- This reverts commit 2fedf8583bcc493f587c90bc9632d25dfd10bd10. We better solve this on the libgpg-error side. Signed-off-by: Werner Koch <[email protected]>
2017-12-07build: Do not define logging.h constants for libgpg-error dev versions.Werner Koch1-9/+17
* common/logging.h [GPGRT_LOG_WITH_PREFIX]: Do not define the log constants. -- logging.h uses constants we plan to use for future versions of libgpg-error. My dev version already has the logging functions and thus I run into a conflict. This patch protects against this and make the GnuPG work with later libgpg-error versions. It was not the best idea to use constants from a planned libgpg-error in the first place. The actual problem are the enums, the macros won't harm. Signed-off-by: Werner Koch <[email protected]>
2017-11-01common: Accept the Z-suffix for yymmddThhmmssZ format.NIIBE Yutaka1-3/+6
* common/gettime.c (isotime_p): Accept the Z suffix. -- The intention is use for human interface. GnuPG-bug-id: 3278 Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit ba8afc4966cca1f6aaf9b2a9bfc3220782306c2b)
2017-08-01indent: Wrap overlong lines in argparse.cWerner Koch1-5/+10
--
2017-07-27gpg: Tweak compliance checking for verificationWerner Koch1-44/+39
* common/compliance.c (gnupg_pk_is_allowed): Rework to always allow verification. * g10/mainproc.c (check_sig_and_print): Print a con-compliant warning. * g10/sig-check.c (check_signature2): Use log_error instead of log_info. -- We should be able to verify all signatures. So we only print a warning. That is the same beheavour as for untrusted keys etc. GnuPG-bug-id: 3311 Signed-off-by: Werner Koch <[email protected]>
2017-07-27gpg,sm: Fix compliance checking for decryption.Werner Koch1-14/+32
* common/compliance.c (gnupg_pk_is_compliant): Remove the Elgamal signing check. We don't support Elgamal signing at all. (gnupg_pk_is_allowed) <de-vs>: Revert encryption/decryption for RSA. Check the curvenames for ECDH. * g10/pubkey-enc.c (get_session_key): Print only a warning if the key is not compliant. * sm/decrypt.c (gpgsm_decrypt): Ditto. Use the same string as in gpg so that we have only one translation. -- We always allow decryption and print only a note if the key was not complaint at the encryption site. GnuPG-bug-id: 3308 Signed-off-by: Werner Koch <[email protected]>
2017-07-25common: Strip trailing slashes from the homedir.Werner Koch1-6/+57
* common/homedir.c (default_homedir): Strip trailing slashes. (gnupg_set_homedir): Ditto. -- is_gnupg_default_homedir() does not ignore trailing slashes when comparing directory names. This can lead to multiple agents started on the same directory if the homedir was specified with --homedir or GNUPGHOME without or with a number of slashes. We now make sure that the home directory name never ends in a slash (except for the roo of course). GnuPG-bug-id: 3295 Signed-off-by: Werner Koch <[email protected]>
2017-07-25common: New functions gnupg_daemon_rootdir and gnupg_chdir.Werner Koch4-1/+40
* common/sysutils.c (gnupg_chdir): New. * common/homedir.c (gnupg_daemon_rootdir): New. * agent/gpg-agent.c (main): Use these functions instead chdir("/"). * dirmngr/dirmngr.c (main): Ditto. * scd/scdaemon.c (main): Ditto. -- Signed-off-by: Werner Koch <[email protected]>
2017-07-20common: New function print_utf9_string.Werner Koch2-0/+11
* common/miscellaneous.c (print_utf8_string): New. -- This is a simple convenience function. Signed-off-by: Werner Koch <[email protected]>
2017-07-20common: logstream fix.NIIBE Yutaka1-1/+2
* common/logging.c (set_file_fd): Don't close es_stderr. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-07-18common: Allow abbreviations of standard options.Marcus Brinkmann2-7/+52
* argparse.h (ARGPARSE_SHORTOPT_HELP, ARGPARSE_SHORTOPT_VERSION, ARGPARSE_SHORTOPT_WARRANTY, ARGPARSE_SHORTOPT_DUMP_OPTIONS): New macros. (ARGPARSE_end): Add some placeholders for standard options. * argparse.c (arg_parse): Fill in missing standard options so default machinery works. Check for standard options in new way. Do not write out standard options for --dump-options. Signed-off-by: Marcus Brinkmann <[email protected]> GnuPG-bug-id: 1747
2017-07-17gpg,sm: Check compliance of the RNG.Werner Koch2-0/+42
* common/compliance.c (gnupg_rng_is_compliant): New. * g10/call-agent.c (start_agent) [W32]: Check rng compliance. * sm/call-agent.c (start_agent) [W32]: Ditto. * g10/encrypt.c (encrypt_simple, encrypt_crypt): Check that the RNG is compliant. * sm/encrypt.c (gpgsm_encrypt): Ditto. * g10/sign.c (do_sign): Ditto. * sm/sign.c (gpgsm_sign): Ditto. -- Under Windows we need to check that the Jitter RNG is active in de-vs mode. Under Linux this is not necessary because /dev/random can be scrutinized and is believed to provide enough entropy. Signed-off-by: Werner Koch <[email protected]>
2017-07-17common: New function split_fields_colon.Werner Koch3-0/+116
* common/stringhelp.c (split_fields_colon): New. * common/t-stringhelp.c (test_split_fields_colon): New test. (main): Call that test. Signed-off-by: Werner Koch <[email protected]>
2017-06-23agent: Shutdown on removal of the home directory.Werner Koch2-0/+38
* common/sysutils.c (gnupg_inotify_watch_delete_self): New. * agent/gpg-agent.c (handle_connections): Rename my_inotify_fd to sock_inotify_fd. (handle_connections): Add home_inotify_fd to watch the home directory. -- GnuPG-bug-id: 3218 Note that we should add this also to dirmngr. And for non-Linux systems a stat in ticker should be implemented. Signed-off-by: Werner Koch <[email protected]>
2017-06-23gpg,gpgsm: Emit status code ENCRYPTION_COMPLIANCE_MODE.Werner Koch1-0/+1
* common/status.h (STATUS_ENCRYPTION_COMPLIANCE_MODE): New. * g10/encrypt.c (encrypt_crypt): Emit new status code. * sm/encrypt.c (gpgsm_encrypt): Ditto. -- This status code allows to report whether an encryption operation was compliant to de-vs. Signed-off-by: Werner Koch <[email protected]>
2017-06-19gpg,gpgsm: Fix compliance check for DSA and avoid an assert.Werner Koch2-14/+19
* common/compliance.c (gnupg_pk_is_compliant): Swap P and Q for DSA check. Explicitly check for allowed ECC algos. (gnupg_pk_is_allowed): Swap P and Q for DSA check. * g10/mainproc.c (proc_encrypted): Simplify SYMKEYS check. Replace assert by debug message. -- Note that in mainproc.c SYMKEYS is unsigned and thus a greater than 0 condition is surprising because it leads to the assumption SYMKEYS could be negative. Better use a boolean test. The assert could have lead to a regression for no good reason. Not being compliant is better than breaking existing users. Signed-off-by: Werner Koch <[email protected]>
2017-06-19indent: Always use "_(" and not "_ (" to mark translatable strings.Werner Koch1-4/+5
-- This makes greping much easier and we have done that since ever. Signed-off-by: Werner Koch <[email protected]>
2017-06-19Change license of some files to LGPLv2.1.Werner Koch2-4/+10
* COPYING.LIB: Rename to COPYING.LGPL3. * COPYING.LGPL21: New. * COPYING.GPL2: New. * Makefile.am: Distribute them. * AUTHORS: Update license pointers. Add BSI as copyright holder. * common/compliance.c, common/compliance.h: Add BSI copyright notice. Break overlong lines. * dirmngr/loadswdb.c: Add BSI copyright notices. * dirmngr/server.c: Ditto. * tools/call-dirmngr.c: Change license to LGPLv2.1. Add BSI copyright notice. * tools/call-dirmngr.h: Ditto. * tools/gpg-wks-client.c: Ditto. * tools/gpg-wks-server.c: Ditto. * tools/gpg-wks.h: Ditto. * tools/mime-maker.c: Ditto. * tools/mime-maker.h: Ditto. * tools/mime-parser.c: Ditto. * tools/mime-parser.h: Ditto. * tools/send-mail.c: Ditto. * tools/send-mail.h: Ditto. * tools/wks-receive.c: Ditto. * tools/wks-util.c: Ditto. * tools/rfc822parse.c, tools/rfc822parse.h: Change license to LGPLv2.1. -- For better deployment it seems to be better to make the Web Key Directory code more easily available. Some code was been developed under contract of the BSI. Signed-off-by: Werner Koch <[email protected]>
2017-06-19gpg: Disable compliance module for other GnuPG components.Justus Winter1-9/+15
* common/compliance.c (gnupg_{pk,cipher,digest}_is_compliant): Return false if the module is not initialized. (gnupg_{pk,cipher,digest}_is_allowed): Return true if the module is not initialized. (gnupg_status_compliance_flag): Do not assert that the module is initialized. (gnupg_parse_compliance_option): Likewise. (gnupg_compliance_option_string): Likewise. -- This implements a default policy for modules not explicitly using the compliance module. The default policy is to allow all algorithms, but mark none of them as compliant. Fixes gpgv. GnuPG-bug-id: 3210 Signed-off-by: Justus Winter <[email protected]>
2017-06-13common: Fix -Wswitch warning.Werner Koch1-1/+0
* common/compliance.c (gnupg_digest_is_allowed): Don't include GCRY_MD_WHIRLPOOL because it is not a digest_algo_t. -- Note that Whirlpool is not used anywhere in gpg or gpgsm. Signed-off-by: Werner Koch <[email protected]>
2017-06-08common,gpg,sm: Restrict the use of algorithms according to CO_DE_VS.Justus Winter2-0/+202
* common/compliance.c (gnupg_pk_is_allowed): New function. (gnupg_cipher_is_allowed): Likewise. (gnupg_digest_is_allowed): Likewise. * common/compliance.h (enum pk_use_case): New definition. (gnupg_pk_is_allowed): New prototype. (gnupg_cipher_is_allowed): Likewise. (gnupg_digest_is_allowed): Likewise. * g10/decrypt-data.c (decrypt_data): Restrict use of algorithms using the new predicates. * g10/encrypt.c (encrypt_crypt): Likewise. * g10/gpg.c (main): Likewise. * g10/pubkey-enc.c (get_session_key): Likewise. * g10/sig-check.c (check_signature2): Likewise. * g10/sign.c (do_sign): Likewise. * sm/decrypt.c (gpgsm_decrypt): Likewise. * sm/encrypt.c (gpgsm_encrypt): Likewise. * sm/gpgsm.c (main): Likewise. * sm/sign.c (gpgsm_sign): Likewise. * sm/verify.c (gpgsm_verify): Likewise. -- With this change, policies can effectively restrict what algorithms are used for different purposes. The algorithm policy for CO_DE_VS is implemented. GnuPG-bug-id: 3191 Signed-off-by: Justus Winter <[email protected]>
2017-06-07common: Add cipher mode to compliance predicate.Justus Winter2-4/+15
* common/compliance.c (gnupg_cipher_is_compliant): Add mode parameter. * common/compliance.h (gnupg_cipher_is_compliant): Likewise. * g10/mainproc.c (proc_encrypted): Adapt callsite. * sm/decrypt.c (gpgsm_decrypt): Likewise. GnuPG-bug-id: 3059 Signed-off-by: Justus Winter <[email protected]>
2017-06-07common,gpg,sm: Initialize compliance module.Justus Winter2-0/+65
* common/compliance.c (gnupg_initialize_compliance): New function. * common/compliance.h (gnupg_initialize_compliance): New prototype. * g10/gpg.c (main): Use the new function. * sm/gpgsm.c (main): Likewise. GnuPG-bug-id: 3191 Signed-off-by: Justus Winter <[email protected]>