aboutsummaryrefslogtreecommitdiffstats
path: root/common (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-05-03w32: Fix spawn functions to support Windows Xp.NIIBE Yutaka1-36/+67
Signed-off-by: NIIBE Yutaka <[email protected]>
2023-05-02w32: Fix inheriting HANDLEs.NIIBE Yutaka2-42/+75
Signed-off-by: NIIBE Yutaka <[email protected]>
2023-05-02Rename the enum constant to GNUPG_PROCESS_GET_PROC_ID.NIIBE Yutaka3-4/+4
And use GetProcessId on Windows in the implementation. Signed-off-by: NIIBE Yutaka <[email protected]>
2023-05-01common: Fix parsing ECC key.NIIBE Yutaka1-1/+1
* common/sexputil.c (get_ecc_q_from_canon_sexp): Initialize ECC_Q_LEN. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2023-04-20spawn: Introduce *_KEEP, removing *_NULL.NIIBE Yutaka5-37/+34
Signed-off-by: NIIBE Yutaka <[email protected]>
2023-04-20exechelp: Clean up macros.NIIBE Yutaka1-10/+0
Signed-off-by: NIIBE Yutaka <[email protected]>
2023-04-19Use keyboxd on a fresh install also on Windows.Werner Koch1-32/+40
* common/homedir.c (gnupg_maybe_make_homedir): Factor some code out to ... (create_common_conf): new. (standard_homedir): Call it also from here. -- Fixes-commit: d9e7488b17fdc617eec735e2c0485b69285ba511
2023-04-18gpgtar: Read common.conf for the log-file option.Werner Koch2-0/+4
* common/util.h (GNUPG_MODULE_NAME_GPGTAR): New. * common/homedir.c (gnupg_module_name): Add it. * tools/gpgtar.c: Include comopt.h. (enum cmd_and_opt_values): Add oDebug. (opts): Add --debug. (any_debug): New. (main): Parse common.conf. -- Having a way to see the output of gpgtar is often useful for debugging. The only effect of the debug option is to show whether common.conf was read.
2023-04-17Remove old API implementation for spawn functions.NIIBE Yutaka3-1323/+0
Signed-off-by: NIIBE Yutaka <[email protected]>
2023-04-17Fix use of GNUPG_PROCESS_DETACHED.NIIBE Yutaka3-54/+42
Signed-off-by: NIIBE Yutaka <[email protected]>
2023-04-17w32: Fix asshelp.c for Windows use case.NIIBE Yutaka1-2/+6
Signed-off-by: NIIBE Yutaka <[email protected]>
2023-04-13Fix requirement for _WIN32_WINNT to use process related functions.NIIBE Yutaka1-1/+1
Signed-off-by: NIIBE Yutaka <[email protected]>
2023-04-12gpg: Curvenames may now compared case insensitive.Werner Koch1-9/+12
* common/openpgp-oid.c (openpgp_curve_to_oid): Repalce strmcp by ascii_strcasecmp. (openpgp_oid_or_name_to_curve): Ditto. (openpgp_is_curve_supported): Ditto. (get_keyalgo_string): Ditto. -- It was just to hard to remember the correct capitalization of names like brainpoolP512r1.
2023-04-05gpg: New option --assert-signer.Werner Koch1-0/+1
* g10/gpg.c (enum cmd_and_opt_values): Add oAssertSigner. (opts): Add "assert-signer". (main): Set option. (assert_signer_true): New var. (g10_exit): Evaluate new var. * g10/main.h (assert_signer_true): Declare new var. * common/status.h (STATUS_ASSERT_SIGNER): New. * g10/options.h (opt): Add field assert_signer_list. * g10/verify.c (is_fingerprint): New. (check_assert_signer_list): New. * g10/mainproc.c (check_sig_and_print): Call that function. Clear assert_signer_true on a warning. * g10/gpgv.c: Add dummy function and vars. * g10/t-keydb-get-keyblock.c: Ditto. * g10/t-keydb.c: Ditto. * g10/t-stutter.c: Ditto. --
2023-04-04common: Change allocation of the comopt symbol.Werner Koch2-2/+7
* common/comopt.h (struct gnupg_comopt_s): New. * common/comopt.c (struct gnupg_comopt_s): Define here in the data segment.
2023-04-04Use the keyboxd for a fresh installWerner Koch2-3/+36
* common/homedir.c (gnupg_maybe_make_homedir): Also create a common.conf. * g10/keydb.c: Include comopt.h. (maybe_create_keyring_or_box): Detect the creation of a common.conf. * g10/gpg.c (main): Avoid adding more resources in this case. * sm/keydb.c: Include comopt.h. (maybe_create_keybox): Detect the creation of a common.conf. * common/comopt.h (comopt): Remove the conditional "extern".
2023-03-15scd,openpgp: Switch key attributes between RSA and ECC in writekey.Werner Koch1-1/+4
* common/sexputil.c (get_rsa_pk_from_canon_sexp): Also allow private keys. (pubkey_algo_string): Ditto. * scd/app-openpgp.c (do_writekey): Switch key attributes -- The scd WRITEKEY command for OpenPGP cards missed proper support to aautomagically switch key attributes based on the new key. We had this only in GENKEY. GnuPG-bug-id: 6378
2023-03-09dirmngr: Distinguish between "no crl" and "crl not trusted".Werner Koch2-1/+3
* dirmngr/crlcache.h (CRL_CACHE_NOTTRUSTED): New. * dirmngr/crlcache.c (cache_isvalid): Set this status. (crl_cache_cert_isvalid): Map it to GPG_ERR_NOT_TRUSTED. (crl_cache_reload_crl): Move diagnostic to ... * dirmngr/crlfetch.c (crl_fetch): here. * dirmngr/server.c (cmd_isvalid): Map it to GPG_ERR_NOT_TRUSTED. * dirmngr/validate.c (check_revocations): Handle new status. Improve diagnostics. * common/status.c (get_inv_recpsgnr_code): Map INV_CRL_OBJ. * common/audit.c (proc_type_verify): Ditto. -- This avoids repeated loading of CRLs in case of untrusted root certificates.
2023-03-08gpgsm: Strip trailing zeroes from detached signatures.Werner Koch3-3/+108
* common/ksba-io-support.c: Include tlv.h (struct reader_cb_parm_s): Add new fields. (starts_with_sequence): New. (simple_reader_cb): Handle stripping. * common/ksba-io-support.h (GNUPG_KSBA_IO_STRIP): New. (gnupg_ksba_create_reader): Handle the new flag. * sm/verify.c (gpgsm_verify): Use the new flag for detached signatures. -- Note that this works only if --assume-binary is given. The use case for the feature is PDF signature checking where the PDF specs require that the detached signature is padded with zeroes.
2023-02-23doc: Minor comment fixes.Werner Koch1-1/+2
--
2023-02-21gpg: Prepare to accept shorter OIDs for ed25519 and cv25519.Werner Koch1-6/+20
* common/openpgp-oid.c (oidtable): Add them. (oid_ed25519_v5, oid_cv25519_v5): New. (openpgp_oidbuf_is_ed25519): Take new OID in account. (openpgp_oidbuf_is_cv25519): Ditto. -- ed25519 is used in GnuPG and other implementations since 2015 and thus we can't simply switch to the shorter OIDs. However, we have not widely used them with v5 keys (only ed448 forced the use of v5) and thus it might be possible to use the new OIDs with v5 keys. Note that Libgcrypt supports the new OIDs even in 1.8.
2023-01-27Put gnupg_spawn_helper function to W32, too.NIIBE Yutaka2-7/+11
-- Signed-off-by: NIIBE Yutaka <[email protected]>
2023-01-24common: Slight redefinition of nvc_get_boolean.Werner Koch2-6/+11
* common/name-value.c (nvc_get_boolean): Rewrite. -- The function may now return a positive or negative number instead of just 1 for true. All callers were already prepared for this. GnuPG-bug-id: 6212
2023-01-20gpg: Replace --override-compliance-check by a real fix.Werner Koch1-0/+4
* common/compliance.c (gnupg_pk_is_allowed): Handle EdDSA. * g10/gpg.c (oOverrideComplianceCheck): Remove. (opts): Turn --override-compliance-check into a dummy option. * g10/options.h (opt): Remove override_compliance_check. * g10/sig-check.c (check_key_verify_compliance): Remove use of that option. -- The introduction of --override-compliance-check actually hid the real cause for the signature verification problem in de-vs mode for the Ed25519 key. The real fix is to handle the EdDSA algorithm in gnupg_pk_is_allowed. Fixes-commit: fb26e144adfd93051501d58f5d0d4f8826ddf436 GnuPG-bug-id: 5655
2023-01-20doc: Update copyright notices.Werner Koch1-1/+1
-- Note that we now print Copyright g10 Code instead of FSF.
2023-01-19common: Detect PNG and JPEG file formats.Werner Koch1-6/+24
* common/miscellaneous.c (is_file_compressed): Add detect code. -- GnuPG-bug-id: 6332
2023-01-19gpg: Detect already compressed data also when using a pipe.Werner Koch4-51/+134
* common/iobuf.c (file_filter_ctx_t): Add fields for the peek feature. (file_filter): Implement peeking. (iobuf_ioctl): Add new IOBUF_IOCTL_PEEK. * common/iobuf.h (IOBUF_IOCTL_PEEK, IOBUFCTRL_PEEK): New. * common/miscellaneous.c (is_file_compressed): Rewrite. Detect PDF. * g10/encrypt.c (encrypt_simple): Peek before detecting compression. (encrypt_crypt): Ditto. * g10/sign.c (sign_file): Also detect already compressed data. * g10/options.h (opt): Add explicit_compress_option. * g10/gpg.c (main): Set opt.explicit_compress_option for -z. -- Note that this patch also introduces a compression check for signing which was never done in the past. GnuPG-bug-id: 6332
2023-01-18common: Replace all assert by log_assert.Werner Koch1-31/+31
--
2023-01-12sm: Fix compliance checking for ECC signature verification.Werner Koch2-3/+15
* common/compliance.c (gnupg_pk_is_compliant): Also consider the gcrypt vids for ECDSA et al. (gnupg_pk_is_allowed): Ditto. * sm/verify.c (gpgsm_verify): Consider the curve. Print a compliance notice for a non-compliant key. * sm/certchain.c (gpgsm_validate_chain): Silence the "switching to chain model".
2023-01-11w32: Make sure DEP is enabled.Werner Koch1-1/+18
* common/init.c (_init_common_subsystems): Test and set the DEP Policy. -- Note that this change will now definitely require Windows XP SP3.
2022-12-16common: Fix translations in --help for gpgrt < 1.47Werner Koch1-0/+8
* common/mapstrings.c (map_static_macro_string): Add hack. --
2022-12-08w32,debug: Don't emit debug output any more.NIIBE Yutaka1-11/+9
Signed-off-by: NIIBE Yutaka <[email protected]>
2022-12-06Fix exechelp-w32.c.NIIBE Yutaka1-29/+37
Signed-off-by: NIIBE Yutaka <[email protected]>
2022-12-01tests: More fix for semihosted environment.NIIBE Yutaka1-21/+24
* common/all-tests.scm: Conditionalize by *win32*. * tests/cms/Makefile.am (GPGSM): Add missing GPGSM. * tests/pkits/Makefile.am (TESTS_ENVIRONMENT): Add EXEEXT. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-12-01tests: Support semihosted environment.NIIBE Yutaka1-3/+4
* Makefile.am (check-all): Add EXEEXT. * agent/all-tests.scm: Append EXEEXT. * common/all-tests.scm: Likewise. * g10/all-tests.scm: Likewise. * g13/all-tests.scm: Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-30w32: Fix gnupg_unsetenv.NIIBE Yutaka1-2/+11
* common/sysutils.c (gnupg_unsetenv): Don't use nonstandard extension of "NAME", but "NAME=". -- Microsoft implementation of putenv works to remove an environment variable by "NAME=". POSIX doesn't say that putenv with "NAME=" has same effect. GNU implementation doesn't support this way for removal of environment variable. Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-30w32: Fix spawn functions for Windows for _fd use case.NIIBE Yutaka2-15/+41
-- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-30w32: Use call back when ASFW is needed.NIIBE Yutaka2-11/+11
-- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-30posix: factor out call_spawn_cb.NIIBE Yutaka1-21/+31
-- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-29common: Support new spawn functions for Windows.NIIBE Yutaka3-11/+25
-- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-28Tweak the spawn API, again for POSIX.NIIBE Yutaka3-14/+14
-- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-28posix: Fix for spawn_cb.NIIBE Yutaka3-8/+11
-- Fixes: 7571fd4cd02571ddd0ba84700c0a52704f0a9b5c Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-25Change spawn_cb semantics.NIIBE Yutaka2-12/+20
-- So that the callback can replace fds for stdin/out/err. Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-25Replace other use cases of gnupg_spawn_process_fd.NIIBE Yutaka1-7/+5
-- by gnupg_process_spawn Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-25Support gnupg_process_spawn with R_PROC=NULL.NIIBE Yutaka2-3/+18
-- The use case of system(3) call. Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-25Fix gnupg_process_release.NIIBE Yutaka2-2/+14
Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-18w32: Fix gnupg_tmpfile for possible failure.NIIBE Yutaka1-6/+3
* common/sysutils.c (gnupg_tmpfile): Use different value for next attempt. -- The resolution of system timer is typically in the range of 10 milliseconds to 16 milliseconds. Thus, before the change, it may fail. Actually, it failed with Wine emulation. Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-18try to control inherited HANDLE for new Windows.NIIBE Yutaka2-36/+100
Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-17change the semantics of spawn_cb routine.NIIBE Yutaka4-75/+19
-- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-11-17common,tools,dirmngr: Introduce gnupg_process_spawn.NIIBE Yutaka4-13/+1458
-- Signed-off-by: NIIBE Yutaka <[email protected]>