From cvs at cvs.gnupg.org Tue Sep 1 07:35:36 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 01 Sep 2015 07:35:36 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-259-gc17f84b Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via c17f84bd02d7ee93845e92e20f6ddba814961588 (commit) via dd87639abd38afc91a6f27af33f0ba17402ad02d (commit) from a785cc3db0c4e8eb8ebbf784b833a40d2c42ec3e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c17f84bd02d7ee93845e92e20f6ddba814961588 Author: Werner Koch Date: Mon Aug 31 23:13:27 2015 +0200 rsa: Add verify after sign to avoid Lenstra's CRT attack. * cipher/rsa.c (rsa_sign): Check the CRT. -- Failures in the computation of the CRT (e.g. due faulty hardware) can lead to a leak of the private key. The standard precaution against this is to verify the signature after signing. GnuPG does this itself and even has an option to disable this. However, the low performance impact of this extra precaution suggest that it should always be done and Libgcrypt is the right place here. For decryption is not done because the application will detect the failure due to garbled plaintext and in any case no key derived material will be send to the user. Signed-off-by: Werner Koch diff --git a/cipher/rsa.c b/cipher/rsa.c index e4f73d5..45a481b 100644 --- a/cipher/rsa.c +++ b/cipher/rsa.c @@ -1112,7 +1112,9 @@ rsa_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_data, gcry_sexp_t keyparms) struct pk_encoding_ctx ctx; gcry_mpi_t data = NULL; RSA_secret_key sk = {NULL, NULL, NULL, NULL, NULL, NULL}; + RSA_public_key pk; gcry_mpi_t sig = NULL; + gcry_mpi_t result = NULL; _gcry_pk_util_init_encoding_ctx (&ctx, PUBKEY_OP_SIGN, rsa_get_nbits (keyparms)); @@ -1148,11 +1150,25 @@ rsa_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_data, gcry_sexp_t keyparms) } } - /* Do RSA computation and build the result. */ + /* Do RSA computation. */ sig = mpi_new (0); secret (sig, data, &sk); if (DBG_CIPHER) log_printmpi ("rsa_sign res", sig); + + /* Check that the created signature is good. This detects a failure + of the CRT algorithm (Lenstra's attack on RSA's use of the CRT). */ + result = mpi_new (0); + pk.n = sk.n; + pk.e = sk.e; + public (result, sig, &pk); + if (mpi_cmp (result, data)) + { + rc = GPG_ERR_BAD_SIGNATURE; + goto leave; + } + + /* Convert the result. */ if ((ctx.flags & PUBKEY_FLAG_FIXEDLEN)) { /* We need to make sure to return the correct length to avoid @@ -1172,6 +1188,7 @@ rsa_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_data, gcry_sexp_t keyparms) leave: + _gcry_mpi_release (result); _gcry_mpi_release (sig); _gcry_mpi_release (sk.n); _gcry_mpi_release (sk.e); commit dd87639abd38afc91a6f27af33f0ba17402ad02d Author: Werner Koch Date: Mon Aug 31 22:41:12 2015 +0200 Add pubkey algo id for EdDSA. * src/gcrypt.h.in (GCRY_PK_EDDSA): New. -- These ids are not actually used by Libgcrypt but other software makes use of such algorithm ids. Thus we provide them here. Signed-off-by: Werner Koch diff --git a/NEWS b/NEWS index d90ee6d..22565ed 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,7 @@ Noteworthy changes in version 1.7.0 (unreleased) GCRY_CIPHER_MODE_OCB NEW. GCRYCTL_SET_TAGLEN NEW. gcry_cipher_final NEW macro. + GCRY_PK_EDDSA NEW constant. Noteworthy changes in version 1.6.0 (2013-12-16) diff --git a/src/gcrypt.h.in b/src/gcrypt.h.in index 884034c..585da6a 100644 --- a/src/gcrypt.h.in +++ b/src/gcrypt.h.in @@ -1053,8 +1053,9 @@ enum gcry_pk_algos GCRY_PK_DSA = 17, /* Digital Signature Algorithm. */ GCRY_PK_ECC = 18, /* Generic ECC. */ GCRY_PK_ELG = 20, /* Elgamal */ - GCRY_PK_ECDSA = 301, /* (deprecated: use 18). */ - GCRY_PK_ECDH = 302 /* (deprecated: use 18). */ + GCRY_PK_ECDSA = 301, /* (only for external use). */ + GCRY_PK_ECDH = 302, /* (only for external use). */ + GCRY_PK_EDDSA = 303 /* (only for external use). */ }; /* Flags describing usage capabilities of a PK algorithm. */ ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + cipher/rsa.c | 19 ++++++++++++++++++- src/gcrypt.h.in | 5 +++-- 3 files changed, 22 insertions(+), 3 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 1 07:43:45 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 01 Sep 2015 07:43:45 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.7-63-g9ba4ccd Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, master has been updated via 9ba4ccdaf5e128fbea51ff142c63d4b359c7264d (commit) via f9c83d84e7d33df76898975f5ac852efa9c4882a (commit) via 99c9bf7defd6c1ac9cc49c84e6c78eeb886a6952 (commit) via bc23e69b70191f887dcb937007833d0187af181f (commit) via 836a3e4315478236bcac126a79b9cdf3c3f1d3b6 (commit) from 04a6b903d0354be2c69c7f2c98987de17d68416e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9ba4ccdaf5e128fbea51ff142c63d4b359c7264d Author: Werner Koch Date: Tue Sep 1 07:39:28 2015 +0200 agent: Protect commit 135b1e3 against misbehaving Libgcrypt. * agent/command-ssh.c (ssh_key_to_blob): Check DATALEN. Signed-off-by: Werner Koch diff --git a/agent/command-ssh.c b/agent/command-ssh.c index 689241f..8868620 100644 --- a/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -1964,7 +1964,7 @@ ssh_key_to_blob (gcry_sexp_t sexp, int with_secret, err = gpg_error (GPG_ERR_INV_SEXP); goto out; } - if (*p_elems == 'q') + if (*p_elems == 'q' && datalen) { /* Remove the prefix 0x40. */ data++; datalen--; commit f9c83d84e7d33df76898975f5ac852efa9c4882a Author: Werner Koch Date: Tue Sep 1 00:07:24 2015 +0200 gpg: Remove option --no-sig-create-check. * g10/gpg.c (opts): Remove --no-sig-create-check. * g10/options.h (struct opt): Remove field no_sig_create_check. * g10/sign.c (do_sign): Always check unless it is RSA and we are using Libgcrypt 1.7. Signed-off-by: Werner Koch diff --git a/doc/gpg.texi b/doc/gpg.texi index a5cbafd..9d62afb 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -1629,15 +1629,6 @@ modifications, you can use this option to disable the caching. It probably does not make sense to disable it because all kind of damage can be done if someone else has write access to your public keyring. - at item --no-sig-create-check - at opindex no-sig-create-check -GnuPG normally verifies each signature right after creation to protect -against bugs and hardware malfunctions which could leak out bits from -the secret key. This extra verification needs some time (about 115% -for DSA keys), and so this option can be used to disable it. -However, due to the fact that the signature creation needs manual -interaction, this performance penalty does not matter in most settings. - @item --auto-check-trustdb @itemx --no-auto-check-trustdb @opindex auto-check-trustdb diff --git a/g10/gpg.c b/g10/gpg.c index e6fb42e..9454b53 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -337,7 +337,6 @@ enum cmd_and_opt_values oFixedListMode, oLegacyListMode, oNoSigCache, - oNoSigCreateCheck, oAutoCheckTrustDB, oNoAutoCheckTrustDB, oPreservePermissions, @@ -727,7 +726,6 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_n (oAutoKeyRetrieve, "auto-key-retrieve", "@"), ARGPARSE_s_n (oNoAutoKeyRetrieve, "no-auto-key-retrieve", "@"), ARGPARSE_s_n (oNoSigCache, "no-sig-cache", "@"), - ARGPARSE_s_n (oNoSigCreateCheck, "no-sig-create-check", "@"), ARGPARSE_s_n (oMergeOnly, "merge-only", "@" ), ARGPARSE_s_n (oAllowSecretKeyImport, "allow-secret-key-import", "@"), ARGPARSE_s_n (oTryAllSecrets, "try-all-secrets", "@"), @@ -2990,7 +2988,6 @@ main (int argc, char **argv) } break; case oNoSigCache: opt.no_sig_cache = 1; break; - case oNoSigCreateCheck: opt.no_sig_create_check = 1; break; case oAllowNonSelfsignedUID: opt.allow_non_selfsigned_uid = 1; break; case oNoAllowNonSelfsignedUID: opt.allow_non_selfsigned_uid=0; break; case oAllowFreeformUID: opt.allow_freeform_uid = 1; break; diff --git a/g10/options.h b/g10/options.h index 465c5b2..fd2f4a2 100644 --- a/g10/options.h +++ b/g10/options.h @@ -191,7 +191,6 @@ struct int try_all_secrets; int no_expensive_trust_checks; int no_sig_cache; - int no_sig_create_check; int no_auto_check_trustdb; int preserve_permissions; int no_homedir_creation; diff --git a/g10/sign.c b/g10/sign.c index afc117e..7a8d697 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -294,8 +294,13 @@ do_sign (PKT_public_key *pksk, PKT_signature *sig, /* Check that the signature verification worked and nothing is * fooling us e.g. by a bug in the signature create code or by - * deliberately introduced faults. */ - if (!err && !opt.no_sig_create_check) + * deliberately introduced faults. Because Libgcrypt 1.7 does this + * for RSA internally there is no need to do it here again. */ + if (!err +#if GCRYPT_VERSION_NUMBER >= 0x010700 /* Libgcrypt >= 1.7 */ + && !is_RSA (pksk->pubkey_algo) +#endif /* Libgcrypt >= 1.7 */ + ) { PKT_public_key *pk = xmalloc_clear (sizeof *pk); commit 99c9bf7defd6c1ac9cc49c84e6c78eeb886a6952 Author: Werner Koch Date: Mon Aug 31 20:29:28 2015 +0200 common: Assume an utf-8 locale on iconv errors. * common/utf8conv.c (handle_iconv_error): Use utf-8 as fallback. Signed-off-by: Werner Koch diff --git a/common/utf8conv.c b/common/utf8conv.c index 99cfc2d..a912b82 100644 --- a/common/utf8conv.c +++ b/common/utf8conv.c @@ -127,12 +127,10 @@ handle_iconv_error (const char *to, const char *from, int use_fallback) if (use_fallback) { - /* To avoid further error messages we fallback to Latin-1 for the - native encoding. This is justified as one can expect that on a - utf-8 enabled system nl_langinfo() will work and thus we won't - never get to here. Thus Latin-1 seems to be a reasonable - default. */ - active_charset_name = "iso-8859-1"; + /* To avoid further error messages we fallback to UTF-8 for the + native encoding. Nowadays this seems to be the best bet in + case of errors from iconv or nl_langinfo. */ + active_charset_name = "utf-8"; no_translation = 0; use_iconv = 0; } commit bc23e69b70191f887dcb937007833d0187af181f Author: Werner Koch Date: Mon Aug 31 20:21:43 2015 +0200 common: Fix regression in building argpase.c standalone. * common/argparse.c (is_native_utf8) [GNUPG_MAJOR_VERSION]: New. diff --git a/common/argparse.c b/common/argparse.c index e9d98f0..53c20fc 100644 --- a/common/argparse.c +++ b/common/argparse.c @@ -123,6 +123,13 @@ my_log_bug (const char *fmt, ...) abort (); } +/* Return true if the native charset is utf-8. */ +static int +is_native_utf8 (void) +{ + return 1; +} + static char * my_trim_spaces (char *str) { commit 836a3e4315478236bcac126a79b9cdf3c3f1d3b6 Author: Werner Koch Date: Fri Aug 28 05:05:37 2015 +0200 Typo fixes -- diff --git a/doc/gpg.texi b/doc/gpg.texi index 86726b3..a5cbafd 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -567,7 +567,7 @@ may be used. @item --gen-key @opindex gen-key -Generate a new key pair using teh current default parameters. This is +Generate a new key pair using the current default parameters. This is the standard command to create a new key. @item --full-gen-key diff --git a/scd/command.c b/scd/command.c index 1cc580a..41a150b 100644 --- a/scd/command.c +++ b/scd/command.c @@ -59,7 +59,7 @@ #define set_error(e,t) assuan_set_error (ctx, gpg_error (e), (t)) -/* Macro to flag a removed card. ENODEV is also tested to catch teh +/* Macro to flag a removed card. ENODEV is also tested to catch the case of a removed reader. */ #define TEST_CARD_REMOVAL(c,r) \ do { \ ----------------------------------------------------------------------- Summary of changes: agent/command-ssh.c | 2 +- common/argparse.c | 7 +++++++ common/utf8conv.c | 10 ++++------ doc/gpg.texi | 11 +---------- g10/gpg.c | 3 --- g10/options.h | 1 - g10/sign.c | 9 +++++++-- scd/command.c | 2 +- 8 files changed, 21 insertions(+), 24 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 1 07:47:04 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 01 Sep 2015 07:47:04 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.28-15-g60b0403 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, STABLE-BRANCH-2-0 has been updated via 60b0403f3ce50ee6f67fa94bf0342fb5b3988e2b (commit) from 80521c3ff900a09a1b382869783187c463144c77 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 60b0403f3ce50ee6f67fa94bf0342fb5b3988e2b Author: Werner Koch Date: Mon Aug 31 23:35:32 2015 +0200 gpg: Obsolete --no-sig-create-check. * g10/gpg.c (opts): Make --no-sig-create-check a NOP. * g10/options.h (struct opt): Remove field "no_sig_create_check". * g10/sign.c (do_sign): Do not run the create check for Libgcrypt 1.7. Signed-off-by: Werner Koch diff --git a/doc/gpg.texi b/doc/gpg.texi index 2808562..ee31d75 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -1719,12 +1719,7 @@ can be done if someone else has write access to your public keyring. @item --no-sig-create-check @opindex no-sig-create-check -GnuPG normally verifies each signature right after creation to protect -against bugs and hardware malfunctions which could leak out bits from -the secret key. This extra verification needs some time (about 115% -for DSA keys), and so this option can be used to disable it. -However, due to the fact that the signature creation needs manual -interaction, this performance penalty does not matter in most settings. +This option is obsolete. It has no function. @item --auto-check-trustdb @itemx --no-auto-check-trustdb diff --git a/g10/gpg.c b/g10/gpg.c index 060495e..3fb598c 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -331,7 +331,6 @@ enum cmd_and_opt_values oNoExpensiveTrustChecks, oFixedListMode, oNoSigCache, - oNoSigCreateCheck, oAutoCheckTrustDB, oNoAutoCheckTrustDB, oPreservePermissions, @@ -697,7 +696,6 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_n (oAutoKeyRetrieve, "auto-key-retrieve", "@"), ARGPARSE_s_n (oNoAutoKeyRetrieve, "no-auto-key-retrieve", "@"), ARGPARSE_s_n (oNoSigCache, "no-sig-cache", "@"), - ARGPARSE_s_n (oNoSigCreateCheck, "no-sig-create-check", "@"), ARGPARSE_s_n (oAutoCheckTrustDB, "auto-check-trustdb", "@"), ARGPARSE_s_n (oNoAutoCheckTrustDB, "no-auto-check-trustdb", "@"), ARGPARSE_s_n (oMergeOnly, "merge-only", "@" ), @@ -776,6 +774,7 @@ static ARGPARSE_OPTS opts[] = { /* Dummy options. */ ARGPARSE_s_n (oNoop, "sk-comments", "@"), ARGPARSE_s_n (oNoop, "no-sk-comments", "@"), + ARGPARSE_s_n (oNoop, "no-sig-create-check", "@"), ARGPARSE_end () }; @@ -2816,7 +2815,6 @@ main (int argc, char **argv) } break; case oNoSigCache: opt.no_sig_cache = 1; break; - case oNoSigCreateCheck: opt.no_sig_create_check = 1; break; case oAllowNonSelfsignedUID: opt.allow_non_selfsigned_uid = 1; break; case oNoAllowNonSelfsignedUID: opt.allow_non_selfsigned_uid=0; break; case oAllowFreeformUID: opt.allow_freeform_uid = 1; break; diff --git a/g10/options.h b/g10/options.h index 9b12b77..cc8718e 100644 --- a/g10/options.h +++ b/g10/options.h @@ -194,7 +194,6 @@ struct int try_all_secrets; int no_expensive_trust_checks; int no_sig_cache; - int no_sig_create_check; int no_auto_check_trustdb; int preserve_permissions; int no_homedir_creation; diff --git a/g10/sign.c b/g10/sign.c index e7e79cc..58bc981 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -291,10 +291,16 @@ do_sign( PKT_secret_key *sk, PKT_signature *sig, gcry_mpi_release (frame); } - if (!rc && !opt.no_sig_create_check) { + if (!rc +#if GCRYPT_VERSION_NUMBER >= 0x010700 /* Libgcrypt >= 1.7 */ + && is_DSA (sk->pubkey_algo) +#endif /* Libgcrypt >= 1.7 */ + ) + { /* Check that the signature verification worked and nothing is - * fooling us e.g. by a bug in the signature create - * code or by deliberately introduced faults. */ + * fooling us e.g. by a bug in the signature creation code or by + * deliberately introduced faults. Libgcrypt 1.7 includes + * this check for RSA and thus we don't need it in that case. */ PKT_public_key *pk = xmalloc_clear (sizeof *pk); if( get_pubkey( pk, sig->keyid ) ) @@ -312,6 +318,7 @@ do_sign( PKT_secret_key *sk, PKT_signature *sig, g10_errstr (rc)); free_public_key (pk); } + if( rc ) log_error(_("signing failed: %s\n"), g10_errstr(rc) ); else { ----------------------------------------------------------------------- Summary of changes: doc/gpg.texi | 7 +------ g10/gpg.c | 4 +--- g10/options.h | 1 - g10/sign.c | 13 ++++++++++--- 4 files changed, 12 insertions(+), 13 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 1 07:50:02 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 01 Sep 2015 07:50:02 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-1-4, updated. gnupg-1.4.19-9-gae61f01 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, STABLE-BRANCH-1-4 has been updated via ae61f01523fc68fbd3dbac5f2ba761a7b8b117dd (commit) from ae38cbbca493725305c4131fbcafa716ae0c6109 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ae61f01523fc68fbd3dbac5f2ba761a7b8b117dd Author: Werner Koch Date: Mon Aug 31 23:55:16 2015 +0200 Obsolete option --no-sig-create-check. * cipher/rsa.c (rsa_sign): Verify after sign. * g10/gpg.c (opts): Make --no-sig-create-check a NOP. * g10/options.h (opt): Remove field "no_sig_create_check". * g10/sign.c (do_sign): Do check only for DSA. Signed-off-by: Werner Koch diff --git a/cipher/rsa.c b/cipher/rsa.c index c4d5161..5efab1d 100644 --- a/cipher/rsa.c +++ b/cipher/rsa.c @@ -452,6 +452,9 @@ int rsa_sign( int algo, MPI *resarr, MPI data, MPI *skey ) { RSA_secret_key sk; + RSA_public_key pk; + MPI cres; + int rc; if( algo != 1 && algo != 3 ) return G10ERR_PUBKEY_ALGO; @@ -465,7 +468,15 @@ rsa_sign( int algo, MPI *resarr, MPI data, MPI *skey ) resarr[0] = mpi_alloc( mpi_get_nlimbs( sk.n ) ); secret( resarr[0], data, &sk ); - return 0; + /* Check for a failure in secret(). */ + cres = mpi_alloc ( mpi_nlimb_hint_from_nbits (160) ); + pk.n = sk.n; + pk.e = sk.e; + public (cres, resarr[0], &pk); + rc = mpi_cmp (cres, data)? G10ERR_BAD_SIGN : 0; + mpi_free (cres); + + return rc; } int diff --git a/doc/gpg.texi b/doc/gpg.texi index 2797fff..27ae18c 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -1625,12 +1625,7 @@ can be done if someone else has write access to your public keyring. @item --no-sig-create-check @opindex no-sig-create-check -GnuPG normally verifies each signature right after creation to protect -against bugs and hardware malfunctions which could leak out bits from -the secret key. This extra verification needs some time (about 115% -for DSA keys), and so this option can be used to disable it. -However, due to the fact that the signature creation needs manual -interaction, this performance penalty does not matter in most settings. +This options is obsolete. It has no function. @item --auto-check-trustdb @itemx --no-auto-check-trustdb diff --git a/g10/gpg.c b/g10/gpg.c index 544c576..3f0d305 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -336,7 +336,6 @@ enum cmd_and_opt_values oNoExpensiveTrustChecks, oFixedListMode, oNoSigCache, - oNoSigCreateCheck, oAutoCheckTrustDB, oNoAutoCheckTrustDB, oPreservePermissions, @@ -673,7 +672,7 @@ static ARGPARSE_OPTS opts[] = { { oAutoKeyRetrieve, "auto-key-retrieve", 0, "@" }, { oNoAutoKeyRetrieve, "no-auto-key-retrieve", 0, "@" }, { oNoSigCache, "no-sig-cache", 0, "@" }, - { oNoSigCreateCheck, "no-sig-create-check", 0, "@" }, + { oNoop, "no-sig-create-check", 0, "@" }, { oAutoCheckTrustDB, "auto-check-trustdb", 0, "@"}, { oNoAutoCheckTrustDB, "no-auto-check-trustdb", 0, "@"}, { oMergeOnly, "merge-only", 0, "@" }, @@ -2716,7 +2715,6 @@ main (int argc, char **argv ) disable_pubkey_algo( string_to_pubkey_algo(pargs.r.ret_str) ); break; case oNoSigCache: opt.no_sig_cache = 1; break; - case oNoSigCreateCheck: opt.no_sig_create_check = 1; break; case oAllowNonSelfsignedUID: opt.allow_non_selfsigned_uid = 1; break; case oNoAllowNonSelfsignedUID: opt.allow_non_selfsigned_uid=0; break; case oAllowFreeformUID: opt.allow_freeform_uid = 1; break; diff --git a/g10/options.h b/g10/options.h index dad5980..f3543b1 100644 --- a/g10/options.h +++ b/g10/options.h @@ -194,7 +194,6 @@ struct int try_all_secrets; int no_expensive_trust_checks; int no_sig_cache; - int no_sig_create_check; int no_auto_check_trustdb; int preserve_permissions; int no_homedir_creation; diff --git a/g10/sign.c b/g10/sign.c index 6587a60..ed8ac73 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -291,10 +291,11 @@ do_sign( PKT_secret_key *sk, PKT_signature *sig, mpi_free(frame); } - if (!rc && !opt.no_sig_create_check) { - /* check that the signature verification worked and nothing is - * fooling us e.g. by a bug in the signature create - * code or by deliberately introduced faults. */ + if (!rc && is_DSA (sk->pubkey_algo)) { + /* Check that the signature verification worked and nothing is + * fooling us e.g. by a bug in the signature create code or by + * deliberately introduced faults. We don't do this for RSA + * because that is done at a lower layer. */ PKT_public_key *pk = xmalloc_clear (sizeof *pk); if( get_pubkey( pk, sig->keyid ) ) ----------------------------------------------------------------------- Summary of changes: cipher/rsa.c | 13 ++++++++++++- doc/gpg.texi | 7 +------ g10/gpg.c | 4 +--- g10/options.h | 1 - g10/sign.c | 9 +++++---- 5 files changed, 19 insertions(+), 15 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 1 07:50:35 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 01 Sep 2015 07:50:35 +0200 Subject: [git] GPA - branch, master, updated. gpa-0.9.7-7-g347e2a4 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Assistant". The branch, master has been updated via 347e2a436a7d5e936df295875edea8e1d4a22120 (commit) from 9599359bb8cdb24af704be03f0532b69523152df (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 347e2a436a7d5e936df295875edea8e1d4a22120 Author: Werner Koch Date: Mon Aug 31 10:33:21 2015 +0200 Use GnuPG 2.1 style pubkey algo format also for subkey lists. * src/gpasubkeylist.c (SUBKEY_SIZE): Define only for old gpgme versions. (gpa_subkey_list_new): Ditto for "Size". (gpa_subkey_list_set_key): Use new algostr if possble. Signed-off-by: Werner Koch diff --git a/src/gpasubkeylist.c b/src/gpasubkeylist.c index 78e933b..b37cf7b 100644 --- a/src/gpasubkeylist.c +++ b/src/gpasubkeylist.c @@ -40,7 +40,9 @@ static gboolean query_tooltip_cb (GtkWidget *wdiget, int x, int y, typedef enum { SUBKEY_ID, +#if GPGME_VERSION_NUMBER >= 0x010601 /* GPGME < 1.6.1 */ SUBKEY_SIZE, +#endif SUBKEY_ALGO, SUBKEY_CREATED, SUBKEY_EXPIRE, @@ -103,11 +105,13 @@ gpa_subkey_list_new (void) NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (list), column); +#if GPGME_VERSION_NUMBER < 0x010601 /* GPGME < 1.6.1 */ renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes (_("Size"), renderer, "text", SUBKEY_SIZE, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (list), column); +#endif renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes (_("Created"), @@ -204,6 +208,10 @@ gpa_subkey_list_set_key (GtkWidget *list, gpgme_key_t key) gpgme_subkey_t subkey, secsubkey; gpgme_key_t seckey; gchar *p, *size, *expires; +#if GPGME_VERSION_NUMBER >= 0x010601 /* GPGME >= 1.6.1 */ + char *algostr_buf; +#endif + const char *algostr; /* Empty the list */ gtk_list_store_clear (store); @@ -242,12 +250,21 @@ gpa_subkey_list_set_key (GtkWidget *list, gpgme_key_t key) if (*expires != '>' && (p = strchr (expires, ' '))) *p = 0; +#if GPGME_VERSION_NUMBER >= 0x010601 /* GPGME >= 1.6.1 */ + algostr_buf = gpgme_pubkey_algo_string (key->subkeys); + algostr = algostr_buf? algostr_buf : "?"; +#else /* GPGME < 1.6.1 */ + algostr = gpgme_pubkey_algo_name (subkey->pubkey_algo), +#endif /* GPGME < 1.6.1 */ + gtk_list_store_set (store, &iter, SUBKEY_ID, subkey->keyid+8, +#if GPGME_VERSION_NUMBER < 0x010601 /* GPGME < 1.6.1 */ SUBKEY_SIZE, size, +#endif SUBKEY_ALGO, - gpgme_pubkey_algo_name (subkey->pubkey_algo), + algostr, SUBKEY_CREATED, gpa_creation_date_string (subkey->timestamp), SUBKEY_EXPIRE, @@ -262,6 +279,9 @@ gpa_subkey_list_set_key (GtkWidget *list, gpgme_key_t key) -1); g_free (size); g_free (expires); +#if GPGME_VERSION_NUMBER >= 0x010601 /* GPGME >= 1.6.1 */ + gpgme_free (algostr_buf); +#endif } } } ----------------------------------------------------------------------- Summary of changes: src/gpasubkeylist.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) hooks/post-receive -- The GNU Privacy Assistant http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 1 07:51:14 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 01 Sep 2015 07:51:14 +0200 Subject: [git] GPGME - branch, master, updated. gpgme-1.6.0-3-gf0ccce8 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GnuPG Made Easy". The branch, master has been updated via f0ccce855bd99fca7cfbbcafe3544e3113fedc67 (commit) from c4b6b35bfa98e478f1d13f4ce3e664771f2604c2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f0ccce855bd99fca7cfbbcafe3544e3113fedc67 Author: Werner Koch Date: Mon Aug 31 20:33:44 2015 +0200 gpgme-tool: Switch to argparse.c for option parsing. * src/argparse.c, src/argparse.h: New. Taken from current gnupg. * src/Makefile.am (gpgme_tool_SOURCES): New. * src/gpgme-tool.c: Remove all argp.h stuff. (my_strusage): New. (main): Change to use argparse. -- As a GnuPG related tool the user should get the same experience in option parsing as with gpg et al. Thus we use the same parser. Signed-off-by: Werner Koch diff --git a/src/Makefile.am b/src/Makefile.am index 58922f9..698c632 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -128,6 +128,7 @@ endif AM_CPPFLAGS = @GPG_ERROR_CFLAGS@ @QT4_CORE_CFLAGS@ AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GLIB_CFLAGS@ @QT4_CORE_CFLAGS@ +gpgme_tool_SOURCES = gpgme-tool.c argparse.c argparse.h gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@ diff --git a/src/argparse.c b/src/argparse.c new file mode 100644 index 0000000..53c20fc --- /dev/null +++ b/src/argparse.c @@ -0,0 +1,1609 @@ +/* [argparse.c wk 17.06.97] Argument Parser for option handling + * Copyright (C) 1998-2001, 2006-2008, 2012 Free Software Foundation, Inc. + * Copyright (C) 1997-2001, 2006-2008, 2013-2015 Werner Koch + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify it + * under the terms of either + * + * - the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at + * your option) any later version. + * + * or + * + * - the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * or both in parallel, as here. + * + * GnuPG is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copies of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, see . + */ + +/* This file may be used as part of GnuPG or standalone. A GnuPG + build is detected by the presence of the macro GNUPG_MAJOR_VERSION. + Some feature are only availalbe in the GnuPG build mode. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#ifdef GNUPG_MAJOR_VERSION +# include "util.h" +# include "common-defs.h" +# include "i18n.h" +# include "mischelp.h" +# include "stringhelp.h" +# include "logging.h" +# include "utf8conv.h" +#endif /*GNUPG_MAJOR_VERSION*/ + +#include "argparse.h" + +/* GnuPG uses GPLv3+ but a standalone version of this defaults to + GPLv2+ because that is the license of this file. Change this if + you include it in a program which uses GPLv3. If you don't want to + set a a copyright string for your usage() you may also hardcode it + here. */ +#ifndef GNUPG_MAJOR_VERSION + +# define ARGPARSE_GPL_VERSION 2 +# define ARGPARSE_CRIGHT_STR "Copyright (C) YEAR NAME" + +#else /* Used by GnuPG */ + +# define ARGPARSE_GPL_VERSION 3 +# define ARGPARSE_CRIGHT_STR "Copyright (C) 2015 Free Software Foundation, Inc." + +#endif /*GNUPG_MAJOR_VERSION*/ + +/* Replacements for standalone builds. */ +#ifndef GNUPG_MAJOR_VERSION +# ifndef _ +# define _(a) (a) +# endif +# ifndef DIM +# define DIM(v) (sizeof(v)/sizeof((v)[0])) +# endif +# define xtrymalloc(a) malloc ((a)) +# define xtryrealloc(a,b) realloc ((a), (b)) +# define xtrystrdup(a) strdup ((a)) +# define xfree(a) free ((a)) +# define log_error my_log_error +# define log_bug my_log_bug +# define trim_spaces(a) my_trim_spaces ((a)) +# define map_static_macro_string(a) (a) +#endif /*!GNUPG_MAJOR_VERSION*/ + + +#define ARGPARSE_STR(v) #v +#define ARGPARSE_STR2(v) ARGPARSE_STR(v) + + +/* Replacements for standalone builds. */ +#ifndef GNUPG_MAJOR_VERSION +static void +my_log_error (const char *fmt, ...) +{ + va_list arg_ptr ; + + va_start (arg_ptr, fmt); + fprintf (stderr, "%s: ", strusage (11)); + vfprintf (stderr, fmt, arg_ptr); + va_end (arg_ptr); +} + +static void +my_log_bug (const char *fmt, ...) +{ + va_list arg_ptr ; + + va_start (arg_ptr, fmt); + fprintf (stderr, "%s: Ohhhh jeeee: ", strusage (11)); + vfprintf (stderr, fmt, arg_ptr); + va_end (arg_ptr); + abort (); +} + +/* Return true if the native charset is utf-8. */ +static int +is_native_utf8 (void) +{ + return 1; +} + +static char * +my_trim_spaces (char *str) +{ + char *string, *p, *mark; + + string = str; + /* Find first non space character. */ + for (p=string; *p && isspace (*(unsigned char*)p) ; p++) + ; + /* Move characters. */ + for ((mark = NULL); (*string = *p); string++, p++) + if (isspace (*(unsigned char*)p)) + { + if (!mark) + mark = string; + } + else + mark = NULL; + if (mark) + *mark = '\0' ; /* Remove trailing spaces. */ + + return str ; +} + +#endif /*!GNUPG_MAJOR_VERSION*/ + + + +/********************************* + * @Summary arg_parse + * #include "argparse.h" + * + * typedef struct { + * char *argc; pointer to argc (value subject to change) + * char ***argv; pointer to argv (value subject to change) + * unsigned flags; Global flags (DO NOT CHANGE) + * int err; print error about last option + * 1 = warning, 2 = abort + * int r_opt; return option + * int r_type; type of return value (0 = no argument found) + * union { + * int ret_int; + * long ret_long + * ulong ret_ulong; + * char *ret_str; + * } r; Return values + * struct { + * int idx; + * const char *last; + * void *aliases; + * } internal; DO NOT CHANGE + * } ARGPARSE_ARGS; + * + * typedef struct { + * int short_opt; + * const char *long_opt; + * unsigned flags; + * } ARGPARSE_OPTS; + * + * int arg_parse( ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts ); + * + * @Description + * This is my replacement for getopt(). See the example for a typical usage. + * Global flags are: + * Bit 0 : Do not remove options form argv + * Bit 1 : Do not stop at last option but return other args + * with r_opt set to -1. + * Bit 2 : Assume options and real args are mixed. + * Bit 3 : Do not use -- to stop option processing. + * Bit 4 : Do not skip the first arg. + * Bit 5 : allow usage of long option with only one dash + * Bit 6 : ignore --version + * all other bits must be set to zero, this value is modified by the + * function, so assume this is write only. + * Local flags (for each option): + * Bit 2-0 : 0 = does not take an argument + * 1 = takes int argument + * 2 = takes string argument + * 3 = takes long argument + * 4 = takes ulong argument + * Bit 3 : argument is optional (r_type will the be set to 0) + * Bit 4 : allow 0x etc. prefixed values. + * Bit 6 : Ignore this option + * Bit 7 : This is a command and not an option + * You stop the option processing by setting opts to NULL, the function will + * then return 0. + * @Return Value + * Returns the args.r_opt or 0 if ready + * r_opt may be -2/-7 to indicate an unknown option/command. + * @See Also + * ArgExpand + * @Notes + * You do not need to process the options 'h', '--help' or '--version' + * because this function includes standard help processing; but if you + * specify '-h', '--help' or '--version' you have to do it yourself. + * The option '--' stops argument processing; if bit 1 is set the function + * continues to return normal arguments. + * To process float args or unsigned args you must use a string args and do + * the conversion yourself. + * @Example + * + * ARGPARSE_OPTS opts[] = { + * { 'v', "verbose", 0 }, + * { 'd', "debug", 0 }, + * { 'o', "output", 2 }, + * { 'c', "cross-ref", 2|8 }, + * { 'm', "my-option", 1|8 }, + * { 300, "ignored-long-option, ARGPARSE_OP_IGNORE}, + * { 500, "have-no-short-option-for-this-long-option", 0 }, + * {0} }; + * ARGPARSE_ARGS pargs = { &argc, &argv, 0 } + * + * while( ArgParse( &pargs, &opts) ) { + * switch( pargs.r_opt ) { + * case 'v': opt.verbose++; break; + * case 'd': opt.debug++; break; + * case 'o': opt.outfile = pargs.r.ret_str; break; + * case 'c': opt.crf = pargs.r_type? pargs.r.ret_str:"a.crf"; break; + * case 'm': opt.myopt = pargs.r_type? pargs.r.ret_int : 1; break; + * case 500: opt.a_long_one++; break + * default : pargs.err = 1; break; -- force warning output -- + * } + * } + * if( argc > 1 ) + * log_fatal( "Too many args"); + * + */ + +typedef struct alias_def_s *ALIAS_DEF; +struct alias_def_s { + ALIAS_DEF next; + char *name; /* malloced buffer with name, \0, value */ + const char *value; /* ptr into name */ +}; + + +/* Object to store the names for the --ignore-invalid-option option. + This is a simple linked list. */ +typedef struct iio_item_def_s *IIO_ITEM_DEF; +struct iio_item_def_s +{ + IIO_ITEM_DEF next; + char name[1]; /* String with the long option name. */ +}; + +static const char *(*strusage_handler)( int ) = NULL; +static int (*custom_outfnc) (int, const char *); + +static int set_opt_arg(ARGPARSE_ARGS *arg, unsigned flags, char *s); +static void show_help(ARGPARSE_OPTS *opts, unsigned flags); +static void show_version(void); +static int writestrings (int is_error, const char *string, ...) +#if __GNUC__ >= 4 + __attribute__ ((sentinel(0))) +#endif + ; + + +void +argparse_register_outfnc (int (*fnc)(int, const char *)) +{ + custom_outfnc = fnc; +} + + +/* Write STRING and all following const char * arguments either to + stdout or, if IS_ERROR is set, to stderr. The list of strings must + be terminated by a NULL. */ +static int +writestrings (int is_error, const char *string, ...) +{ + va_list arg_ptr; + const char *s; + int count = 0; + + if (string) + { + s = string; + va_start (arg_ptr, string); + do + { + if (custom_outfnc) + custom_outfnc (is_error? 2:1, s); + else + fputs (s, is_error? stderr : stdout); + count += strlen (s); + } + while ((s = va_arg (arg_ptr, const char *))); + va_end (arg_ptr); + } + return count; +} + + +static void +flushstrings (int is_error) +{ + if (custom_outfnc) + custom_outfnc (is_error? 2:1, NULL); + else + fflush (is_error? stderr : stdout); +} + + +static void +initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno ) +{ + if( !(arg->flags & (1<<15)) ) + { + /* Initialize this instance. */ + arg->internal.idx = 0; + arg->internal.last = NULL; + arg->internal.inarg = 0; + arg->internal.stopped = 0; + arg->internal.aliases = NULL; + arg->internal.cur_alias = NULL; + arg->internal.iio_list = NULL; + arg->err = 0; + arg->flags |= 1<<15; /* Mark as initialized. */ + if ( *arg->argc < 0 ) + log_bug ("invalid argument for arg_parse\n"); + } + + + if (arg->err) + { + /* Last option was erroneous. */ + const char *s; + + if (filename) + { + if ( arg->r_opt == ARGPARSE_UNEXPECTED_ARG ) + s = _("argument not expected"); + else if ( arg->r_opt == ARGPARSE_READ_ERROR ) + s = _("read error"); + else if ( arg->r_opt == ARGPARSE_KEYWORD_TOO_LONG ) + s = _("keyword too long"); + else if ( arg->r_opt == ARGPARSE_MISSING_ARG ) + s = _("missing argument"); + else if ( arg->r_opt == ARGPARSE_INVALID_ARG ) + s = _("invalid argument"); + else if ( arg->r_opt == ARGPARSE_INVALID_COMMAND ) + s = _("invalid command"); + else if ( arg->r_opt == ARGPARSE_INVALID_ALIAS ) + s = _("invalid alias definition"); + else if ( arg->r_opt == ARGPARSE_OUT_OF_CORE ) + s = _("out of core"); + else + s = _("invalid option"); + log_error ("%s:%u: %s\n", filename, *lineno, s); + } + else + { + s = arg->internal.last? arg->internal.last:"[??]"; + + if ( arg->r_opt == ARGPARSE_MISSING_ARG ) + log_error (_("missing argument for option \"%.50s\"\n"), s); + else if ( arg->r_opt == ARGPARSE_INVALID_ARG ) + log_error (_("invalid argument for option \"%.50s\"\n"), s); + else if ( arg->r_opt == ARGPARSE_UNEXPECTED_ARG ) + log_error (_("option \"%.50s\" does not expect an argument\n"), s); + else if ( arg->r_opt == ARGPARSE_INVALID_COMMAND ) + log_error (_("invalid command \"%.50s\"\n"), s); + else if ( arg->r_opt == ARGPARSE_AMBIGUOUS_OPTION ) + log_error (_("option \"%.50s\" is ambiguous\n"), s); + else if ( arg->r_opt == ARGPARSE_AMBIGUOUS_COMMAND ) + log_error (_("command \"%.50s\" is ambiguous\n"),s ); + else if ( arg->r_opt == ARGPARSE_OUT_OF_CORE ) + log_error ("%s\n", _("out of core\n")); + else + log_error (_("invalid option \"%.50s\"\n"), s); + } + if (arg->err != ARGPARSE_PRINT_WARNING) + exit (2); + arg->err = 0; + } + + /* Zero out the return value union. */ + arg->r.ret_str = NULL; + arg->r.ret_long = 0; +} + + +static void +store_alias( ARGPARSE_ARGS *arg, char *name, char *value ) +{ + /* TODO: replace this dummy function with a rea one + * and fix the probelms IRIX has with (ALIAS_DEV)arg.. + * used as lvalue + */ + (void)arg; + (void)name; + (void)value; +#if 0 + ALIAS_DEF a = xmalloc( sizeof *a ); + a->name = name; + a->value = value; + a->next = (ALIAS_DEF)arg->internal.aliases; + (ALIAS_DEF)arg->internal.aliases = a; +#endif +} + + +/* Return true if KEYWORD is in the ignore-invalid-option list. */ +static int +ignore_invalid_option_p (ARGPARSE_ARGS *arg, const char *keyword) +{ + IIO_ITEM_DEF item = arg->internal.iio_list; + + for (; item; item = item->next) + if (!strcmp (item->name, keyword)) + return 1; + return 0; +} + + +/* Add the keywords up to the next LF to the list of to be ignored + options. After returning FP will either be at EOF or the next + character read wll be the first of a new line. The function + returns 0 on success or true on malloc failure. */ +static int +ignore_invalid_option_add (ARGPARSE_ARGS *arg, FILE *fp) +{ + IIO_ITEM_DEF item; + int c; + char name[100]; + int namelen = 0; + int ready = 0; + enum { skipWS, collectNAME, skipNAME, addNAME} state = skipWS; + + while (!ready) + { + c = getc (fp); + if (c == '\n') + ready = 1; + else if (c == EOF) + { + c = '\n'; + ready = 1; + } + again: + switch (state) + { + case skipWS: + if (!isascii (c) || !isspace(c)) + { + namelen = 0; + state = collectNAME; + goto again; + } + break; + + case collectNAME: + if (isspace (c)) + { + state = addNAME; + goto again; + } + else if (namelen < DIM(name)-1) + name[namelen++] = c; + else /* Too long. */ + state = skipNAME; + break; + + case skipNAME: + if (isspace (c)) + { + state = skipWS; + goto again; + } + break; + + case addNAME: + name[namelen] = 0; + if (!ignore_invalid_option_p (arg, name)) + { + item = xtrymalloc (sizeof *item + namelen); + if (!item) + return 1; + strcpy (item->name, name); + item->next = (IIO_ITEM_DEF)arg->internal.iio_list; + arg->internal.iio_list = item; + } + state = skipWS; + goto again; + } + } + return 0; +} + + +/* Clear the entire ignore-invalid-option list. */ +static void +ignore_invalid_option_clear (ARGPARSE_ARGS *arg) +{ + IIO_ITEM_DEF item, tmpitem; + + for (item = arg->internal.iio_list; item; item = tmpitem) + { + tmpitem = item->next; + xfree (item); + } + arg->internal.iio_list = NULL; +} + + + +/**************** + * Get options from a file. + * Lines starting with '#' are comment lines. + * Syntax is simply a keyword and the argument. + * Valid keywords are all keywords from the long_opt list without + * the leading dashes. The special keywords "help", "warranty" and "version" + * are not valid here. + * The special keyword "alias" may be used to store alias definitions, + * which are later expanded like long options. + * The option + * ignore-invalid-option OPTIONNAMEs + * is recognized and updates a list of option which should be ignored if they + * are not defined. + * Caller must free returned strings. + * If called with FP set to NULL command line args are parse instead. + * + * Q: Should we allow the syntax + * keyword = value + * and accept for boolean options a value of 1/0, yes/no or true/false? + * Note: Abbreviation of options is here not allowed. + */ +int +optfile_parse (FILE *fp, const char *filename, unsigned *lineno, + ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts) +{ + int state, i, c; + int idx=0; + char keyword[100]; + char *buffer = NULL; + size_t buflen = 0; + int in_alias=0; + + if (!fp) /* Divert to to arg_parse() in this case. */ + return arg_parse (arg, opts); + + initialize (arg, filename, lineno); + + /* Find the next keyword. */ + state = i = 0; + for (;;) + { + c = getc (fp); + if (c == '\n' || c== EOF ) + { + if ( c != EOF ) + ++*lineno; + if (state == -1) + break; + else if (state == 2) + { + keyword[i] = 0; + for (i=0; opts[i].short_opt; i++ ) + { + if (opts[i].long_opt && !strcmp (opts[i].long_opt, keyword)) + break; + } + idx = i; + arg->r_opt = opts[idx].short_opt; + if ((opts[idx].flags & ARGPARSE_OPT_IGNORE)) + { + state = i = 0; + continue; + } + else if (!opts[idx].short_opt ) + { + if (!strcmp (keyword, "ignore-invalid-option")) + { + /* No argument - ignore this meta option. */ + state = i = 0; + continue; + } + else if (ignore_invalid_option_p (arg, keyword)) + { + /* This invalid option is in the iio list. */ + state = i = 0; + continue; + } + arg->r_opt = ((opts[idx].flags & ARGPARSE_OPT_COMMAND) + ? ARGPARSE_INVALID_COMMAND + : ARGPARSE_INVALID_OPTION); + } + else if (!(opts[idx].flags & ARGPARSE_TYPE_MASK)) + arg->r_type = 0; /* Does not take an arg. */ + else if ((opts[idx].flags & ARGPARSE_OPT_OPTIONAL) ) + arg->r_type = 0; /* Arg is optional. */ + else + arg->r_opt = ARGPARSE_MISSING_ARG; + + break; + } + else if (state == 3) + { + /* No argument found. */ + if (in_alias) + arg->r_opt = ARGPARSE_MISSING_ARG; + else if (!(opts[idx].flags & ARGPARSE_TYPE_MASK)) + arg->r_type = 0; /* Does not take an arg. */ + else if ((opts[idx].flags & ARGPARSE_OPT_OPTIONAL)) + arg->r_type = 0; /* No optional argument. */ + else + arg->r_opt = ARGPARSE_MISSING_ARG; + + break; + } + else if (state == 4) + { + /* Has an argument. */ + if (in_alias) + { + if (!buffer) + arg->r_opt = ARGPARSE_UNEXPECTED_ARG; + else + { + char *p; + + buffer[i] = 0; + p = strpbrk (buffer, " \t"); + if (p) + { + *p++ = 0; + trim_spaces (p); + } + if (!p || !*p) + { + xfree (buffer); + arg->r_opt = ARGPARSE_INVALID_ALIAS; + } + else + { + store_alias (arg, buffer, p); + } + } + } + else if (!(opts[idx].flags & ARGPARSE_TYPE_MASK)) + arg->r_opt = ARGPARSE_UNEXPECTED_ARG; + else + { + char *p; + + if (!buffer) + { + keyword[i] = 0; + buffer = xtrystrdup (keyword); + if (!buffer) + arg->r_opt = ARGPARSE_OUT_OF_CORE; + } + else + buffer[i] = 0; + + if (buffer) + { + trim_spaces (buffer); + p = buffer; + if (*p == '"') + { + /* Remove quotes. */ + p++; + if (*p && p[strlen(p)-1] == '\"' ) + p[strlen(p)-1] = 0; + } + if (!set_opt_arg (arg, opts[idx].flags, p)) + xfree (buffer); + } + } + break; + } + else if (c == EOF) + { + ignore_invalid_option_clear (arg); + if (ferror (fp)) + arg->r_opt = ARGPARSE_READ_ERROR; + else + arg->r_opt = 0; /* EOF. */ + break; + } + state = 0; + i = 0; + } + else if (state == -1) + ; /* Skip. */ + else if (state == 0 && isascii (c) && isspace(c)) + ; /* Skip leading white space. */ + else if (state == 0 && c == '#' ) + state = 1; /* Start of a comment. */ + else if (state == 1) + ; /* Skip comments. */ + else if (state == 2 && isascii (c) && isspace(c)) + { + /* Check keyword. */ + keyword[i] = 0; + for (i=0; opts[i].short_opt; i++ ) + if (opts[i].long_opt && !strcmp (opts[i].long_opt, keyword)) + break; + idx = i; + arg->r_opt = opts[idx].short_opt; + if ((opts[idx].flags & ARGPARSE_OPT_IGNORE)) + { + state = 1; /* Process like a comment. */ + } + else if (!opts[idx].short_opt) + { + if (!strcmp (keyword, "alias")) + { + in_alias = 1; + state = 3; + } + else if (!strcmp (keyword, "ignore-invalid-option")) + { + if (ignore_invalid_option_add (arg, fp)) + { + arg->r_opt = ARGPARSE_OUT_OF_CORE; + break; + } + state = i = 0; + ++*lineno; + } + else if (ignore_invalid_option_p (arg, keyword)) + state = 1; /* Process like a comment. */ + else + { + arg->r_opt = ((opts[idx].flags & ARGPARSE_OPT_COMMAND) + ? ARGPARSE_INVALID_COMMAND + : ARGPARSE_INVALID_OPTION); + state = -1; /* Skip rest of line and leave. */ + } + } + else + state = 3; + } + else if (state == 3) + { + /* Skip leading spaces of the argument. */ + if (!isascii (c) || !isspace(c)) + { + i = 0; + keyword[i++] = c; + state = 4; + } + } + else if (state == 4) + { + /* Collect the argument. */ + if (buffer) + { + if (i < buflen-1) + buffer[i++] = c; + else + { + char *tmp; + size_t tmplen = buflen + 50; + + tmp = xtryrealloc (buffer, tmplen); + if (tmp) + { + buflen = tmplen; + buffer = tmp; + buffer[i++] = c; + } + else + { + xfree (buffer); + arg->r_opt = ARGPARSE_OUT_OF_CORE; + break; + } + } + } + else if (i < DIM(keyword)-1) + keyword[i++] = c; + else + { + size_t tmplen = DIM(keyword) + 50; + buffer = xtrymalloc (tmplen); + if (buffer) + { + buflen = tmplen; + memcpy(buffer, keyword, i); + buffer[i++] = c; + } + else + { + arg->r_opt = ARGPARSE_OUT_OF_CORE; + break; + } + } + } + else if (i >= DIM(keyword)-1) + { + arg->r_opt = ARGPARSE_KEYWORD_TOO_LONG; + state = -1; /* Skip rest of line and leave. */ + } + else + { + keyword[i++] = c; + state = 2; + } + } + + return arg->r_opt; +} + + + +static int +find_long_option( ARGPARSE_ARGS *arg, + ARGPARSE_OPTS *opts, const char *keyword ) +{ + int i; + size_t n; + + (void)arg; + + /* Would be better if we can do a binary search, but it is not + possible to reorder our option table because we would mess + up our help strings - What we can do is: Build a nice option + lookup table wehn this function is first invoked */ + if( !*keyword ) + return -1; + for(i=0; opts[i].short_opt; i++ ) + if( opts[i].long_opt && !strcmp( opts[i].long_opt, keyword) ) + return i; +#if 0 + { + ALIAS_DEF a; + /* see whether it is an alias */ + for( a = args->internal.aliases; a; a = a->next ) { + if( !strcmp( a->name, keyword) ) { + /* todo: must parse the alias here */ + args->internal.cur_alias = a; + return -3; /* alias available */ + } + } + } +#endif + /* not found, see whether it is an abbreviation */ + /* aliases may not be abbreviated */ + n = strlen( keyword ); + for(i=0; opts[i].short_opt; i++ ) { + if( opts[i].long_opt && !strncmp( opts[i].long_opt, keyword, n ) ) { + int j; + for(j=i+1; opts[j].short_opt; j++ ) { + if( opts[j].long_opt + && !strncmp( opts[j].long_opt, keyword, n ) ) + return -2; /* abbreviation is ambiguous */ + } + return i; + } + } + return -1; /* Not found. */ +} + +int +arg_parse( ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts) +{ + int idx; + int argc; + char **argv; + char *s, *s2; + int i; + + initialize( arg, NULL, NULL ); + argc = *arg->argc; + argv = *arg->argv; + idx = arg->internal.idx; + + if (!idx && argc && !(arg->flags & ARGPARSE_FLAG_ARG0)) + { + /* Skip the first argument. */ + argc--; argv++; idx++; + } + + next_one: + if (!argc) + { + /* No more args. */ + arg->r_opt = 0; + goto leave; /* Ready. */ + } + + s = *argv; + arg->internal.last = s; + + if (arg->internal.stopped && (arg->flags & ARGPARSE_FLAG_ALL)) + { + arg->r_opt = ARGPARSE_IS_ARG; /* Not an option but an argument. */ + arg->r_type = 2; + arg->r.ret_str = s; + argc--; argv++; idx++; /* set to next one */ + } + else if( arg->internal.stopped ) + { + arg->r_opt = 0; + goto leave; /* Ready. */ + } + else if ( *s == '-' && s[1] == '-' ) + { + /* Long option. */ + char *argpos; + + arg->internal.inarg = 0; + if (!s[2] && !(arg->flags & ARGPARSE_FLAG_NOSTOP)) + { + /* Stop option processing. */ + arg->internal.stopped = 1; + arg->flags |= ARGPARSE_FLAG_STOP_SEEN; + argc--; argv++; idx++; + goto next_one; + } + + argpos = strchr( s+2, '=' ); + if ( argpos ) + *argpos = 0; + i = find_long_option ( arg, opts, s+2 ); + if ( argpos ) + *argpos = '='; + + if ( i < 0 && !strcmp ( "help", s+2) ) + show_help (opts, arg->flags); + else if ( i < 0 && !strcmp ( "version", s+2) ) + { + if (!(arg->flags & ARGPARSE_FLAG_NOVERSION)) + { + show_version (); + exit(0); + } + } + else if ( i < 0 && !strcmp( "warranty", s+2)) + { + writestrings (0, strusage (16), "\n", NULL); + exit (0); + } + else if ( i < 0 && !strcmp( "dump-options", s+2) ) + { + for (i=0; opts[i].short_opt; i++ ) + { + if (opts[i].long_opt && !(opts[i].flags & ARGPARSE_OPT_IGNORE)) + writestrings (0, "--", opts[i].long_opt, "\n", NULL); + } + writestrings (0, "--dump-options\n--help\n--version\n--warranty\n", + NULL); + exit (0); + } + + if ( i == -2 ) + arg->r_opt = ARGPARSE_AMBIGUOUS_OPTION; + else if ( i == -1 ) + { + arg->r_opt = ARGPARSE_INVALID_OPTION; + arg->r.ret_str = s+2; + } + else + arg->r_opt = opts[i].short_opt; + if ( i < 0 ) + ; + else if ( (opts[i].flags & ARGPARSE_TYPE_MASK) ) + { + if ( argpos ) + { + s2 = argpos+1; + if ( !*s2 ) + s2 = NULL; + } + else + s2 = argv[1]; + if ( !s2 && (opts[i].flags & ARGPARSE_OPT_OPTIONAL) ) + { + arg->r_type = ARGPARSE_TYPE_NONE; /* Argument is optional. */ + } + else if ( !s2 ) + { + arg->r_opt = ARGPARSE_MISSING_ARG; + } + else if ( !argpos && *s2 == '-' + && (opts[i].flags & ARGPARSE_OPT_OPTIONAL) ) + { + /* The argument is optional and the next seems to be an + option. We do not check this possible option but + assume no argument */ + arg->r_type = ARGPARSE_TYPE_NONE; + } + else + { + set_opt_arg (arg, opts[i].flags, s2); + if ( !argpos ) + { + argc--; argv++; idx++; /* Skip one. */ + } + } + } + else + { + /* Does not take an argument. */ + if ( argpos ) + arg->r_type = ARGPARSE_UNEXPECTED_ARG; + else + arg->r_type = 0; + } + argc--; argv++; idx++; /* Set to next one. */ + } + else if ( (*s == '-' && s[1]) || arg->internal.inarg ) + { + /* Short option. */ + int dash_kludge = 0; + + i = 0; + if ( !arg->internal.inarg ) + { + arg->internal.inarg++; + if ( (arg->flags & ARGPARSE_FLAG_ONEDASH) ) + { + for (i=0; opts[i].short_opt; i++ ) + if ( opts[i].long_opt && !strcmp (opts[i].long_opt, s+1)) + { + dash_kludge = 1; + break; + } + } + } + s += arg->internal.inarg; + + if (!dash_kludge ) + { + for (i=0; opts[i].short_opt; i++ ) + if ( opts[i].short_opt == *s ) + break; + } + + if ( !opts[i].short_opt && ( *s == 'h' || *s == '?' ) ) + show_help (opts, arg->flags); + + arg->r_opt = opts[i].short_opt; + if (!opts[i].short_opt ) + { + arg->r_opt = (opts[i].flags & ARGPARSE_OPT_COMMAND)? + ARGPARSE_INVALID_COMMAND:ARGPARSE_INVALID_OPTION; + arg->internal.inarg++; /* Point to the next arg. */ + arg->r.ret_str = s; + } + else if ( (opts[i].flags & ARGPARSE_TYPE_MASK) ) + { + if ( s[1] && !dash_kludge ) + { + s2 = s+1; + set_opt_arg (arg, opts[i].flags, s2); + } + else + { + s2 = argv[1]; + if ( !s2 && (opts[i].flags & ARGPARSE_OPT_OPTIONAL) ) + { + arg->r_type = ARGPARSE_TYPE_NONE; + } + else if ( !s2 ) + { + arg->r_opt = ARGPARSE_MISSING_ARG; + } + else if ( *s2 == '-' && s2[1] + && (opts[i].flags & ARGPARSE_OPT_OPTIONAL) ) + { + /* The argument is optional and the next seems to + be an option. We do not check this possible + option but assume no argument. */ + arg->r_type = ARGPARSE_TYPE_NONE; + } + else + { + set_opt_arg (arg, opts[i].flags, s2); + argc--; argv++; idx++; /* Skip one. */ + } + } + s = "x"; /* This is so that !s[1] yields false. */ + } + else + { + /* Does not take an argument. */ + arg->r_type = ARGPARSE_TYPE_NONE; + arg->internal.inarg++; /* Point to the next arg. */ + } + if ( !s[1] || dash_kludge ) + { + /* No more concatenated short options. */ + arg->internal.inarg = 0; + argc--; argv++; idx++; + } + } + else if ( arg->flags & ARGPARSE_FLAG_MIXED ) + { + arg->r_opt = ARGPARSE_IS_ARG; + arg->r_type = 2; + arg->r.ret_str = s; + argc--; argv++; idx++; /* Set to next one. */ + } + else + { + arg->internal.stopped = 1; /* Stop option processing. */ + goto next_one; + } + + leave: + *arg->argc = argc; + *arg->argv = argv; + arg->internal.idx = idx; + return arg->r_opt; +} + + +/* Returns: -1 on error, 0 for an integer type and 1 for a non integer + type argument. */ +static int +set_opt_arg (ARGPARSE_ARGS *arg, unsigned flags, char *s) +{ + int base = (flags & ARGPARSE_OPT_PREFIX)? 0 : 10; + long l; + + switch ( (arg->r_type = (flags & ARGPARSE_TYPE_MASK)) ) + { + case ARGPARSE_TYPE_LONG: + case ARGPARSE_TYPE_INT: + errno = 0; + l = strtol (s, NULL, base); + if ((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) + { + arg->r_opt = ARGPARSE_INVALID_ARG; + return -1; + } + if (arg->r_type == ARGPARSE_TYPE_LONG) + arg->r.ret_long = l; + else if ( (l < 0 && l < INT_MIN) || l > INT_MAX ) + { + arg->r_opt = ARGPARSE_INVALID_ARG; + return -1; + } + else + arg->r.ret_int = (int)l; + return 0; + + case ARGPARSE_TYPE_ULONG: + while (isascii (*s) && isspace(*s)) + s++; + if (*s == '-') + { + arg->r.ret_ulong = 0; + arg->r_opt = ARGPARSE_INVALID_ARG; + return -1; + } + errno = 0; + arg->r.ret_ulong = strtoul (s, NULL, base); + if (arg->r.ret_ulong == ULONG_MAX && errno == ERANGE) + { + arg->r_opt = ARGPARSE_INVALID_ARG; + return -1; + } + return 0; + + case ARGPARSE_TYPE_STRING: + default: + arg->r.ret_str = s; + return 1; + } +} + + +static size_t +long_opt_strlen( ARGPARSE_OPTS *o ) +{ + size_t n = strlen (o->long_opt); + + if ( o->description && *o->description == '|' ) + { + const char *s; + int is_utf8 = is_native_utf8 (); + + s=o->description+1; + if ( *s != '=' ) + n++; + /* For a (mostly) correct length calculation we exclude + continuation bytes (10xxxxxx) if we are on a native utf8 + terminal. */ + for (; *s && *s != '|'; s++ ) + if ( is_utf8 && (*s&0xc0) != 0x80 ) + n++; + } + return n; +} + + +/**************** + * Print formatted help. The description string has some special + * meanings: + * - A description string which is "@" suppresses help output for + * this option + * - a description,ine which starts with a '@' and is followed by + * any other characters is printed as is; this may be used for examples + * ans such. + * - A description which starts with a '|' outputs the string between this + * bar and the next one as arguments of the long option. + */ +static void +show_help (ARGPARSE_OPTS *opts, unsigned int flags) +{ + const char *s; + char tmp[2]; + + show_version (); + writestrings (0, "\n", NULL); + s = strusage (42); + if (s && *s == '1') + { + s = strusage (40); + writestrings (1, s, NULL); + if (*s && s[strlen(s)] != '\n') + writestrings (1, "\n", NULL); + } + s = strusage(41); + writestrings (0, s, "\n", NULL); + if ( opts[0].description ) + { + /* Auto format the option description. */ + int i,j, indent; + + /* Get max. length of long options. */ + for (i=indent=0; opts[i].short_opt; i++ ) + { + if ( opts[i].long_opt ) + if ( !opts[i].description || *opts[i].description != '@' ) + if ( (j=long_opt_strlen(opts+i)) > indent && j < 35 ) + indent = j; + } + + /* Example: " -v, --verbose Viele Sachen ausgeben" */ + indent += 10; + if ( *opts[0].description != '@' ) + writestrings (0, "Options:", "\n", NULL); + for (i=0; opts[i].short_opt; i++ ) + { + s = map_static_macro_string (_( opts[i].description )); + if ( s && *s== '@' && !s[1] ) /* Hide this line. */ + continue; + if ( s && *s == '@' ) /* Unindented comment only line. */ + { + for (s++; *s; s++ ) + { + if ( *s == '\n' ) + { + if( s[1] ) + writestrings (0, "\n", NULL); + } + else + { + tmp[0] = *s; + tmp[1] = 0; + writestrings (0, tmp, NULL); + } + } + writestrings (0, "\n", NULL); + continue; + } + + j = 3; + if ( opts[i].short_opt < 256 ) + { + tmp[0] = opts[i].short_opt; + tmp[1] = 0; + writestrings (0, " -", tmp, NULL ); + if ( !opts[i].long_opt ) + { + if (s && *s == '|' ) + { + writestrings (0, " ", NULL); j++; + for (s++ ; *s && *s != '|'; s++, j++ ) + { + tmp[0] = *s; + tmp[1] = 0; + writestrings (0, tmp, NULL); + } + if ( *s ) + s++; + } + } + } + else + writestrings (0, " ", NULL); + if ( opts[i].long_opt ) + { + tmp[0] = opts[i].short_opt < 256?',':' '; + tmp[1] = 0; + j += writestrings (0, tmp, " --", opts[i].long_opt, NULL); + if (s && *s == '|' ) + { + if ( *++s != '=' ) + { + writestrings (0, " ", NULL); + j++; + } + for ( ; *s && *s != '|'; s++, j++ ) + { + tmp[0] = *s; + tmp[1] = 0; + writestrings (0, tmp, NULL); + } + if ( *s ) + s++; + } + writestrings (0, " ", NULL); + j += 3; + } + for (;j < indent; j++ ) + writestrings (0, " ", NULL); + if ( s ) + { + if ( *s && j > indent ) + { + writestrings (0, "\n", NULL); + for (j=0;j < indent; j++ ) + writestrings (0, " ", NULL); + } + for (; *s; s++ ) + { + if ( *s == '\n' ) + { + if ( s[1] ) + { + writestrings (0, "\n", NULL); + for (j=0; j < indent; j++ ) + writestrings (0, " ", NULL); + } + } + else + { + tmp[0] = *s; + tmp[1] = 0; + writestrings (0, tmp, NULL); + } + } + } + writestrings (0, "\n", NULL); + } + if ( (flags & ARGPARSE_FLAG_ONEDASH) ) + writestrings (0, "\n(A single dash may be used " + "instead of the double ones)\n", NULL); + } + if ( (s=strusage(19)) ) + { + writestrings (0, "\n", NULL); + writestrings (0, s, NULL); + } + flushstrings (0); + exit(0); +} + +static void +show_version () +{ + const char *s; + int i; + + /* Version line. */ + writestrings (0, strusage (11), NULL); + if ((s=strusage (12))) + writestrings (0, " (", s, ")", NULL); + writestrings (0, " ", strusage (13), "\n", NULL); + /* Additional version lines. */ + for (i=20; i < 30; i++) + if ((s=strusage (i))) + writestrings (0, s, "\n", NULL); + /* Copyright string. */ + if ((s=strusage (14))) + writestrings (0, s, "\n", NULL); + /* Licence string. */ + if( (s=strusage (10)) ) + writestrings (0, s, "\n", NULL); + /* Copying conditions. */ + if ( (s=strusage(15)) ) + writestrings (0, s, NULL); + /* Thanks. */ + if ((s=strusage(18))) + writestrings (0, s, NULL); + /* Additional program info. */ + for (i=30; i < 40; i++ ) + if ( (s=strusage (i)) ) + writestrings (0, s, NULL); + flushstrings (0); +} + + +void +usage (int level) +{ + const char *p; + + if (!level) + { + writestrings (1, strusage(11), " ", strusage(13), "; ", + strusage (14), "\n", NULL); + flushstrings (1); + } + else if (level == 1) + { + p = strusage (40); + writestrings (1, p, NULL); + if (*p && p[strlen(p)] != '\n') + writestrings (1, "\n", NULL); + exit (2); + } + else if (level == 2) + { + p = strusage (42); + if (p && *p == '1') + { + p = strusage (40); + writestrings (1, p, NULL); + if (*p && p[strlen(p)] != '\n') + writestrings (1, "\n", NULL); + } + writestrings (0, strusage(41), "\n", NULL); + exit (0); + } +} + +/* Level + * 0: Print copyright string to stderr + * 1: Print a short usage hint to stderr and terminate + * 2: Print a long usage hint to stdout and terminate + * 10: Return license info string + * 11: Return the name of the program + * 12: Return optional name of package which includes this program. + * 13: version string + * 14: copyright string + * 15: Short copying conditions (with LFs) + * 16: Long copying conditions (with LFs) + * 17: Optional printable OS name + * 18: Optional thanks list (with LFs) + * 19: Bug report info + *20..29: Additional lib version strings. + *30..39: Additional program info (with LFs) + * 40: short usage note (with LF) + * 41: long usage note (with LF) + * 42: Flag string: + * First char is '1': + * The short usage notes needs to be printed + * before the long usage note. + */ +const char * +strusage( int level ) +{ + const char *p = strusage_handler? strusage_handler(level) : NULL; + + if ( p ) + return map_static_macro_string (p); + + switch ( level ) + { + + case 10: +#if ARGPARSE_GPL_VERSION == 3 + p = ("License GPLv3+: GNU GPL version 3 or later " + ""); +#else + p = ("License GPLv2+: GNU GPL version 2 or later " + ""); +#endif + break; + case 11: p = "foo"; break; + case 13: p = "0.0"; break; + case 14: p = ARGPARSE_CRIGHT_STR; break; + case 15: p = +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n"; + break; + case 16: p = +"This is free software; you can redistribute it and/or modify\n" +"it under the terms of the GNU General Public License as published by\n" +"the Free Software Foundation; either version " +ARGPARSE_STR2(ARGPARSE_GPL_VERSION) +" of the License, or\n" +"(at your option) any later version.\n\n" +"It is distributed in the hope that it will be useful,\n" +"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +"GNU General Public License for more details.\n\n" +"You should have received a copy of the GNU General Public License\n" +"along with this software. If not, see .\n"; + break; + case 40: /* short and long usage */ + case 41: p = ""; break; + } + + return p; +} + + +/* Set the usage handler. This function is basically a constructor. */ +void +set_strusage ( const char *(*f)( int ) ) +{ + strusage_handler = f; +} + + +#ifdef TEST +static struct { + int verbose; + int debug; + char *outfile; + char *crf; + int myopt; + int echo; + int a_long_one; +} opt; + +int +main(int argc, char **argv) +{ + ARGPARSE_OPTS opts[] = { + ARGPARSE_x('v', "verbose", NONE, 0, "Laut sein"), + ARGPARSE_s_n('e', "echo" , ("Zeile ausgeben, damit wir sehen, " + "was wir eingegeben haben")), + ARGPARSE_s_n('d', "debug", "Debug\nfalls mal etwas\nschief geht"), + ARGPARSE_s_s('o', "output", 0 ), + ARGPARSE_o_s('c', "cross-ref", "cross-reference erzeugen\n" ), + /* Note that on a non-utf8 terminal the ? might garble the output. */ + ARGPARSE_s_n('s', "street","|Stra?e|set the name of the street to Stra?e"), + ARGPARSE_o_i('m', "my-option", 0), + ARGPARSE_s_n(500, "a-long-option", 0 ), + ARGPARSE_end() + }; + ARGPARSE_ARGS pargs = { &argc, &argv, (ARGPARSE_FLAG_ALL + | ARGPARSE_FLAG_MIXED + | ARGPARSE_FLAG_ONEDASH) }; + int i; + + while (arg_parse (&pargs, opts)) + { + switch (pargs.r_opt) + { + case ARGPARSE_IS_ARG : + printf ("arg='%s'\n", pargs.r.ret_str); + break; + case 'v': opt.verbose++; break; + case 'e': opt.echo++; break; + case 'd': opt.debug++; break; + case 'o': opt.outfile = pargs.r.ret_str; break; + case 'c': opt.crf = pargs.r_type? pargs.r.ret_str:"a.crf"; break; + case 'm': opt.myopt = pargs.r_type? pargs.r.ret_int : 1; break; + case 500: opt.a_long_one++; break; + default : pargs.err = ARGPARSE_PRINT_WARNING; break; + } + } + for (i=0; i < argc; i++ ) + printf ("%3d -> (%s)\n", i, argv[i] ); + puts ("Options:"); + if (opt.verbose) + printf (" verbose=%d\n", opt.verbose ); + if (opt.debug) + printf (" debug=%d\n", opt.debug ); + if (opt.outfile) + printf (" outfile='%s'\n", opt.outfile ); + if (opt.crf) + printf (" crffile='%s'\n", opt.crf ); + if (opt.myopt) + printf (" myopt=%d\n", opt.myopt ); + if (opt.a_long_one) + printf (" a-long-one=%d\n", opt.a_long_one ); + if (opt.echo) + printf (" echo=%d\n", opt.echo ); + + return 0; +} +#endif /*TEST*/ + +/**** bottom of file ****/ diff --git a/src/argparse.h b/src/argparse.h new file mode 100644 index 0000000..10b838f --- /dev/null +++ b/src/argparse.h @@ -0,0 +1,203 @@ +/* argparse.h - Argument parser for option handling. + * Copyright (C) 1998,1999,2000,2001,2006 Free Software Foundation, Inc. + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify it + * under the terms of either + * + * - the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 3 of the License, or (at + * your option) any later version. + * + * or + * + * - the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * or both in parallel, as here. + * + * GnuPG is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copies of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, see . + */ + +#ifndef GNUPG_COMMON_ARGPARSE_H +#define GNUPG_COMMON_ARGPARSE_H + +#include + +typedef struct +{ + int *argc; /* Pointer to ARGC (value subject to change). */ + char ***argv; /* Pointer to ARGV (value subject to change). */ + unsigned int flags; /* Global flags. May be set prior to calling the + parser. The parser may change the value. */ + int err; /* Print error description for last option. + Either 0, ARGPARSE_PRINT_WARNING or + ARGPARSE_PRINT_ERROR. */ + + int r_opt; /* Returns option code. */ + int r_type; /* Returns type of option value. */ + union { + int ret_int; + long ret_long; + unsigned long ret_ulong; + char *ret_str; + } r; /* Return values */ + + struct { + int idx; + int inarg; + int stopped; + const char *last; + void *aliases; + const void *cur_alias; + void *iio_list; + } internal; /* Private - do not change. */ +} ARGPARSE_ARGS; + +typedef struct +{ + int short_opt; + const char *long_opt; + unsigned int flags; + const char *description; /* Optional option description. */ +} ARGPARSE_OPTS; + + +/* Global flags (ARGPARSE_ARGS). */ +#define ARGPARSE_FLAG_KEEP 1 /* Do not remove options form argv. */ +#define ARGPARSE_FLAG_ALL 2 /* Do not stop at last option but return + remaining args with R_OPT set to -1. */ +#define ARGPARSE_FLAG_MIXED 4 /* Assume options and args are mixed. */ +#define ARGPARSE_FLAG_NOSTOP 8 /* Do not stop processing at "--". */ +#define ARGPARSE_FLAG_ARG0 16 /* Do not skip the first arg. */ +#define ARGPARSE_FLAG_ONEDASH 32 /* Allow long options with one dash. */ +#define ARGPARSE_FLAG_NOVERSION 64 /* No output for "--version". */ + +#define ARGPARSE_FLAG_STOP_SEEN 256 /* Set to true if a "--" has been seen. */ + +/* Flags for each option (ARGPARSE_OPTS). The type code may be + ORed with the OPT flags. */ +#define ARGPARSE_TYPE_NONE 0 /* Does not take an argument. */ +#define ARGPARSE_TYPE_INT 1 /* Takes an int argument. */ +#define ARGPARSE_TYPE_STRING 2 /* Takes a string argument. */ +#define ARGPARSE_TYPE_LONG 3 /* Takes a long argument. */ +#define ARGPARSE_TYPE_ULONG 4 /* Takes an unsigned long argument. */ +#define ARGPARSE_OPT_OPTIONAL (1<<3) /* Argument is optional. */ +#define ARGPARSE_OPT_PREFIX (1<<4) /* Allow 0x etc. prefixed values. */ +#define ARGPARSE_OPT_IGNORE (1<<6) /* Ignore command or option. */ +#define ARGPARSE_OPT_COMMAND (1<<7) /* The argument is a command. */ + +#define ARGPARSE_TYPE_MASK 7 /* Mask for the type values (internal). */ + +/* A set of macros to make option definitions easier to read. */ +#define ARGPARSE_x(s,l,t,f,d) \ + { (s), (l), ARGPARSE_TYPE_ ## t | (f), (d) } + +#define ARGPARSE_s(s,l,t,d) \ + { (s), (l), ARGPARSE_TYPE_ ## t, (d) } +#define ARGPARSE_s_n(s,l,d) \ + { (s), (l), ARGPARSE_TYPE_NONE, (d) } +#define ARGPARSE_s_i(s,l,d) \ + { (s), (l), ARGPARSE_TYPE_INT, (d) } +#define ARGPARSE_s_s(s,l,d) \ + { (s), (l), ARGPARSE_TYPE_STRING, (d) } +#define ARGPARSE_s_l(s,l,d) \ + { (s), (l), ARGPARSE_TYPE_LONG, (d) } +#define ARGPARSE_s_u(s,l,d) \ + { (s), (l), ARGPARSE_TYPE_ULONG, (d) } + +#define ARGPARSE_o(s,l,t,d) \ + { (s), (l), (ARGPARSE_TYPE_ ## t | ARGPARSE_OPT_OPTIONAL), (d) } +#define ARGPARSE_o_n(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_NONE | ARGPARSE_OPT_OPTIONAL), (d) } +#define ARGPARSE_o_i(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_INT | ARGPARSE_OPT_OPTIONAL), (d) } +#define ARGPARSE_o_s(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_STRING | ARGPARSE_OPT_OPTIONAL), (d) } +#define ARGPARSE_o_l(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_LONG | ARGPARSE_OPT_OPTIONAL), (d) } +#define ARGPARSE_o_u(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_ULONG | ARGPARSE_OPT_OPTIONAL), (d) } + +#define ARGPARSE_p(s,l,t,d) \ + { (s), (l), (ARGPARSE_TYPE_ ## t | ARGPARSE_OPT_PREFIX), (d) } +#define ARGPARSE_p_n(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_NONE | ARGPARSE_OPT_PREFIX), (d) } +#define ARGPARSE_p_i(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_INT | ARGPARSE_OPT_PREFIX), (d) } +#define ARGPARSE_p_s(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_STRING | ARGPARSE_OPT_PREFIX), (d) } +#define ARGPARSE_p_l(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_LONG | ARGPARSE_OPT_PREFIX), (d) } +#define ARGPARSE_p_u(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_ULONG | ARGPARSE_OPT_PREFIX), (d) } + +#define ARGPARSE_op(s,l,t,d) \ + { (s), (l), (ARGPARSE_TYPE_ ## t \ + | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } +#define ARGPARSE_op_n(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_NONE \ + | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } +#define ARGPARSE_op_i(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_INT \ + | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } +#define ARGPARSE_op_s(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_STRING \ + | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } +#define ARGPARSE_op_l(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_LONG \ + | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } +#define ARGPARSE_op_u(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_ULONG \ + | ARGPARSE_OPT_OPTIONAL | ARGPARSE_OPT_PREFIX), (d) } + +#define ARGPARSE_c(s,l,d) \ + { (s), (l), (ARGPARSE_TYPE_NONE | ARGPARSE_OPT_COMMAND), (d) } + +#define ARGPARSE_ignore(s,l) \ + { (s), (l), (ARGPARSE_OPT_IGNORE), "@" } + +#define ARGPARSE_group(s,d) \ + { (s), NULL, 0, (d) } + +#define ARGPARSE_end() { 0, NULL, 0, NULL } + + +/* Other constants. */ +#define ARGPARSE_PRINT_WARNING 1 +#define ARGPARSE_PRINT_ERROR 2 + + +/* Error values. */ +#define ARGPARSE_IS_ARG (-1) +#define ARGPARSE_INVALID_OPTION (-2) +#define ARGPARSE_MISSING_ARG (-3) +#define ARGPARSE_KEYWORD_TOO_LONG (-4) +#define ARGPARSE_READ_ERROR (-5) +#define ARGPARSE_UNEXPECTED_ARG (-6) +#define ARGPARSE_INVALID_COMMAND (-7) +#define ARGPARSE_AMBIGUOUS_OPTION (-8) +#define ARGPARSE_AMBIGUOUS_COMMAND (-9) +#define ARGPARSE_INVALID_ALIAS (-10) +#define ARGPARSE_OUT_OF_CORE (-11) +#define ARGPARSE_INVALID_ARG (-12) + + +int arg_parse (ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts); +int optfile_parse (FILE *fp, const char *filename, unsigned *lineno, + ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts); +void usage (int level); +const char *strusage (int level); +void set_strusage (const char *(*f)( int )); +void argparse_register_outfnc (int (*fnc)(int, const char *)); + +#endif /*GNUPG_COMMON_ARGPARSE_H*/ diff --git a/src/gpgme-tool.c b/src/gpgme-tool.c index e5e5707..557ed64 100644 --- a/src/gpgme-tool.c +++ b/src/gpgme-tool.c @@ -32,12 +32,10 @@ #ifdef HAVE_LOCALE_H #include #endif -#ifdef HAVE_ARGP_H -#include -#endif #include +#include "argparse.h" #include "gpgme.h" /* GCC attributes. */ @@ -60,421 +58,6 @@ -#ifndef HAVE_ARGP_H -/* Minimal argp implementation. */ - -/* Differences to ARGP: - argp_program_version: Required. - argp_program_bug_address: Required. - argp_program_version_hook: Not supported. - argp_err_exit_status: Required. - struct argp: Children and help_filter not supported. - argp_domain: Not supported. - struct argp_option: Group not supported. Options are printed in - order given. Flags OPTION_ALIAS, OPTION_DOC and OPTION_NO_USAGE - are not supported. - argp_parse: No flags are supported (ARGP_PARSE_ARGV0, ARGP_NO_ERRS, - ARGP_NO_ARGS, ARGP_IN_ORDER, ARGP_NO_HELP, ARGP_NO_EXIT, - ARGP_LONG_ONLY, ARGP_SILENT). ARGP must not be NULL. - argp_help: Flag ARGP_HELP_LONG_ONLY not supported. - argp_state: argc, argv, next may not be modified and should not be used. */ - -extern const char *argp_program_version; -extern const char *argp_program_bug_address; -extern error_t argp_err_exit_status; - -struct argp_option -{ - const char *name; - int key; - const char *arg; -#define OPTION_ARG_OPTIONAL 0x1 -#define OPTION_HIDDEN 0x2 - int flags; - const char *doc; - int group; -}; - -struct argp; -struct argp_state -{ - const struct argp *const root_argp; - int argc; - char **argv; - int next; - unsigned flags; - unsigned arg_num; - int quoted; - void *input; - void **child_inputs; - void *hook; - char *name; - FILE *err_stream; - FILE *out_stream; - void *pstate; -}; - -#ifdef EDEADLK -# define ARGP_ERR_UNKNOWN EDEADLK /* POSIX */ -#else -# define ARGP_ERR_UNKNOWN EDEADLOCK /* *GNU/kFreebsd does not define this) */ -#endif -#define ARGP_KEY_ARG 0 -#define ARGP_KEY_ARGS 0x1000006 -#define ARGP_KEY_END 0x1000001 -#define ARGP_KEY_NO_ARGS 0x1000002 -#define ARGP_KEY_INIT 0x1000003 -#define ARGP_KEY_FINI 0x1000007 -#define ARGP_KEY_SUCCESS 0x1000004 -#define ARGP_KEY_ERROR 0x1000005 -typedef error_t (*argp_parser_t) (int key, char *arg, struct argp_state *state); - -struct argp -{ - const struct argp_option *options; - argp_parser_t parser; - const char *args_doc; - const char *doc; - - const struct argp_child *children; - char *(*help_filter) (int key, const char *text, void *input); - const char *argp_domain; -}; - -#define ARGP_HELP_USAGE ARGP_HELP_SHORT_USAGE -#define ARGP_HELP_SHORT_USAGE 0x02 -#define ARGP_HELP_SEE 0x04 -#define ARGP_HELP_LONG 0x08 -#define ARGP_HELP_PRE_DOC 0x10 -#define ARGP_HELP_POST_DOC 0x20 -#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC) -#define ARGP_HELP_BUG_ADDR 0x40 -#define ARGP_HELP_EXIT_ERR 0x100 -#define ARGP_HELP_EXIT_OK 0x200 -#define ARGP_HELP_STD_ERR (ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR) -#define ARGP_HELP_STD_USAGE \ - (ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR) -#define ARGP_HELP_STD_HELP \ - (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \ - | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR) - - -void argp_error (const struct argp_state *state, - const char *fmt, ...) GT_GCC_A_PRINTF(2, 3); - - - -char * -_argp_pname (char *name) -{ - char *pname = name; - char *bname = strrchr (pname, '/'); - if (! bname) - bname = strrchr (pname, '\\'); - if (bname) - pname = bname + 1; - return pname; -} - - -void -_argp_state_help (const struct argp *argp, const struct argp_state *state, - FILE *stream, unsigned flags, char *name) -{ - if (state) - name = state->name; - - if (flags & ARGP_HELP_SHORT_USAGE) - fprintf (stream, "Usage: %s [OPTIONS...] %s\n", name, argp->args_doc); - if (flags & ARGP_HELP_SEE) - fprintf (stream, "Try `%s --help' or `%s --usage' for more information.\n", - name, name); - if (flags & ARGP_HELP_PRE_DOC) - { - char buf[1024]; - char *end; - strncpy (buf, argp->doc, sizeof (buf)); - buf[sizeof (buf) - 1] = '\0'; - end = strchr (buf, '\v'); - if (end) - *end = '\0'; - fprintf (stream, "%s\n%s", buf, buf[0] ? "\n" : ""); - } - if (flags & ARGP_HELP_LONG) - { - const struct argp_option *opt = argp->options; - while (opt->key) - { - #define NSPACES 29 - char spaces[NSPACES + 1] = " "; - int len = 0; - fprintf (stream, " "); - len += 2; - if (isascii (opt->key)) - { - fprintf (stream, "-%c", opt->key); - len += 2; - if (opt->name) - { - fprintf (stream, ", "); - len += 2; - } - } - if (opt->name) - { - fprintf (stream, "--%s", opt->name); - len += 2 + strlen (opt->name); - } - if (opt->arg && (opt->flags & OPTION_ARG_OPTIONAL)) - { - fprintf (stream, "[=%s]", opt->arg); - len += 3 + strlen (opt->arg); - } - else if (opt->arg) - { - fprintf (stream, "=%s", opt->arg); - len += 1 + strlen (opt->arg); - } - if (len >= NSPACES) - len = NSPACES - 1; - spaces[NSPACES - len] = '\0'; - fprintf (stream, "%s%s\n", spaces, opt->doc); - opt++; - } - fprintf (stream, " -?, --help Give this help list\n"); - fprintf (stream, " --usage Give a short usage " - "message\n"); - } - if (flags & ARGP_HELP_POST_DOC) - { - char buf[1024]; - char *end; - strncpy (buf, argp->doc, sizeof (buf)); - buf[sizeof (buf) - 1] = '\0'; - end = strchr (buf, '\v'); - if (end) - { - end++; - if (*end) - fprintf (stream, "\n%s\n", end); - } - fprintf (stream, "\nMandatory or optional arguments to long options are also mandatory or optional\n"); - fprintf (stream, "for any corresponding short options.\n"); - } - if (flags & ARGP_HELP_BUG_ADDR) - fprintf (stream, "\nReport bugs to %s.\n", argp_program_bug_address); - - if (flags & ARGP_HELP_EXIT_ERR) - exit (argp_err_exit_status); - if (flags & ARGP_HELP_EXIT_OK) - exit (0); -} - - -void -argp_usage (const struct argp_state *state) -{ - _argp_state_help (state->root_argp, state, state->err_stream, - ARGP_HELP_STD_USAGE, state->name); -} - - -void -argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags) -{ - _argp_state_help (state->root_argp, state, stream, flags, state->name); -} - - -void -argp_error (const struct argp_state *state, const char *fmt, ...) -{ - va_list ap; - - fprintf (state->err_stream, "%s: ", state->name); - va_start (ap, fmt); - vfprintf (state->err_stream, fmt, ap); - va_end (ap); - fprintf (state->err_stream, "\n"); - argp_state_help (state, state->err_stream, ARGP_HELP_STD_ERR); - exit (argp_err_exit_status); -} - - -void -argp_help (const struct argp *argp, FILE *stream, unsigned flags, char *name) -{ - _argp_state_help (argp, NULL, stream, flags, name); -} - - -error_t -argp_parse (const struct argp *argp, int argc, - char **argv, unsigned flags, int *arg_index, void *input) -{ - int rc = 0; - struct argp_state state = { argp, argc, argv, 1, flags, 0, 0, input, - NULL, NULL, _argp_pname (argv[0]), - stderr, stdout, NULL }; - /* All non-option arguments are collected at the beginning of - &argv[1] during processing. This is a counter for their number. */ - int non_opt_args = 0; - - rc = argp->parser (ARGP_KEY_INIT, NULL, &state); - if (rc && rc != ARGP_ERR_UNKNOWN) - goto argperror; - - while (state.next < state.argc - non_opt_args) - { - int idx = state.next; - state.next++; - - if (! strcasecmp (state.argv[idx], "--")) - { - state.quoted = idx; - continue; - } - - if (state.quoted || state.argv[idx][0] != '-') - { - char *arg_saved = state.argv[idx]; - non_opt_args++; - memmove (&state.argv[idx], &state.argv[idx + 1], - (state.argc - 1 - idx) * sizeof (char *)); - state.argv[argc - 1] = arg_saved; - state.next--; - } - else if (! strcasecmp (state.argv[idx], "--help") - || !strcmp (state.argv[idx], "-?")) - { - argp_state_help (&state, state.out_stream, ARGP_HELP_STD_HELP); - } - else if (! strcasecmp (state.argv[idx], "--usage")) - { - argp_state_help (&state, state.out_stream, - ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK); - } - else if (! strcasecmp (state.argv[idx], "--version") - || !strcmp (state.argv[idx], "-V")) - { - fprintf (state.out_stream, "%s\n", argp_program_version); - exit (0); - } - else - { - /* Search for option and call parser with its KEY. */ - int key = ARGP_KEY_ARG; /* Just some dummy value. */ - const struct argp_option *opt = argp->options; - char *arg = NULL; - int found = 0; - - /* Check for --opt=value syntax. */ - arg = strchr (state.argv[idx], '='); - if (arg) - { - *arg = '\0'; - arg++; - } - - if (state.argv[idx][1] != '-') - key = state.argv[idx][1]; - - while (! found && opt->key) - { - if (key == opt->key - || (key == ARGP_KEY_ARG - && ! strcasecmp (&state.argv[idx][2], opt->name))) - { - if (arg && !opt->arg) - argp_error (&state, "Option %s does not take an argument", - state.argv[idx]); - if (opt->arg && state.next < state.argc - && state.argv[idx + 1][0] != '-') - { - arg = state.argv[idx + 1]; - state.next++; - } - if (opt->arg && !(opt->flags & OPTION_ARG_OPTIONAL)) - argp_error (&state, "Option %s requires an argument", - state.argv[idx]); - - rc = argp->parser (opt->key, arg, &state); - if (rc == ARGP_ERR_UNKNOWN) - break; - else if (rc) - goto argperror; - found = 1; - } - opt++; - } - if (! found) - argp_error (&state, "Unknown option %s", state.argv[idx]); - } - } - - while (state.next < state.argc) - { - /* Call parser for all non-option args. */ - int idx = state.next; - state.next++; - rc = argp->parser (ARGP_KEY_ARG, state.argv[idx], &state); - if (rc && rc != ARGP_ERR_UNKNOWN) - goto argperror; - if (rc == ARGP_ERR_UNKNOWN) - { - int old_next = state.next; - rc = argp->parser (ARGP_KEY_ARGS, NULL, &state); - if (rc == ARGP_ERR_UNKNOWN) - { - argp_error (&state, "Too many arguments"); - goto argperror; - } - if (! rc && state.next == old_next) - { - state.arg_num += state.argc - state.next; - state.next = state.argc; - } - } - else - state.arg_num++; - } - - if (state.arg_num == 0) - { - rc = argp->parser (ARGP_KEY_NO_ARGS, NULL, &state); - if (rc && rc != ARGP_ERR_UNKNOWN) - goto argperror; - } - if (state.next == state.argc) - { - rc = argp->parser (ARGP_KEY_END, NULL, &state); - if (rc && rc != ARGP_ERR_UNKNOWN) - goto argperror; - } - rc = argp->parser (ARGP_KEY_FINI, NULL, &state); - if (rc && rc != ARGP_ERR_UNKNOWN) - goto argperror; - - rc = 0; - argp->parser (ARGP_KEY_SUCCESS, NULL, &state); - - argperror: - if (rc) - { - argp_error (&state, "unexpected error: %s", strerror (rc)); - argp->parser (ARGP_KEY_ERROR, NULL, &state); - } - - argp->parser (ARGP_KEY_FINI, NULL, &state); - - if (arg_index) - *arg_index = state.next - 1; - - return 0; -} -#endif - - /* MEMBUF */ /* A simple implementation of a dynamic buffer. Use init_membuf() to @@ -3722,85 +3305,51 @@ gpgme_server (gpgme_tool_t gt) -/* MAIN PROGRAM STARTS HERE. */ - -const char *argp_program_version = VERSION; -const char *argp_program_bug_address = "bug-gpgme at gnupg.org"; -error_t argp_err_exit_status = 1; - -static char doc[] = "GPGME Tool -- Assuan server exposing GPGME operations"; -static char args_doc[] = "COMMAND [OPTIONS...]"; - -static struct argp_option options[] = { - { "server", 's', 0, 0, "Server mode" }, - { "gpg-binary", 501, "FILE", 0, "Use FILE for the GPG backend" }, - { "lib-version", 502, 0, 0, "Show library version" }, - { 0 } -}; - -static error_t parse_options (int key, char *arg, struct argp_state *state); -static struct argp argp = { options, parse_options, args_doc, doc }; - -struct args -{ - enum { CMD_DEFAULT, CMD_SERVER, CMD_LIBVERSION } cmd; - const char *gpg_binary; -}; - -void -args_init (struct args *args) -{ - memset (args, '\0', sizeof (*args)); - args->cmd = CMD_DEFAULT; -} - - -static error_t -parse_options (int key, char *arg, struct argp_state *state) +static const char * +my_strusage( int level ) { - struct args *args = state->input; + const char *p; - switch (key) + switch (level) { - case 's': - args->cmd = CMD_SERVER; - break; - - case 501: - args->gpg_binary = arg; - break; - - case 502: - args->cmd = CMD_LIBVERSION; + case 11: p = "gpgme-tool"; break; + case 13: p = PACKAGE_VERSION; break; + case 14: p = "Copyright (C) 2015 g10 Code GmbH"; break; + case 19: p = "Please report bugs to <" PACKAGE_BUGREPORT ">.\n"; break; + case 1: + case 40: + p = "Usage: gpgme-tool [OPTIONS] [COMMANDS]"; break; - -#if 0 - case ARGP_KEY_ARG: - if (state->arg_num >= 2) - argp_usage (state); - printf ("Arg[%i] = %s\n", state->arg_num, arg); + case 41: + p = "GPGME Tool -- Assuan server exposing GPGME operations\n"; break; - case ARGP_KEY_END: - if (state->arg_num < 2) - argp_usage (state); + case 42: + p = "1"; /* Flag print 40 as part of 41. */ break; -#endif - - default: - return ARGP_ERR_UNKNOWN; + default: p = NULL; break; } - return 0; + return p; } - + int main (int argc, char *argv[]) { - struct args args; + static ARGPARSE_OPTS opts[] = { + ARGPARSE_c ('s', "server", "Server mode"), + ARGPARSE_s_s(501, "gpg-binary", "|FILE|Use FILE for the GPG backend"), + ARGPARSE_c (502, "lib-version", "Show library version"), + ARGPARSE_end() + }; + ARGPARSE_ARGS pargs = { &argc, &argv, 0 }; + enum { CMD_DEFAULT, CMD_SERVER, CMD_LIBVERSION } cmd = CMD_DEFAULT; + const char *gpg_binary = NULL; struct gpgme_tool gt; gpg_error_t err; int needgt = 1; + set_strusage (my_strusage); + #ifdef HAVE_SETLOCALE setlocale (LC_ALL, ""); #endif @@ -3812,30 +3361,40 @@ main (int argc, char *argv[]) gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL)); #endif - args_init (&args); - - argp_parse (&argp, argc, argv, 0, 0, &args); log_init (); - if (args.cmd == CMD_LIBVERSION) + while (arg_parse (&pargs, opts)) + { + switch (pargs.r_opt) + { + case 's': cmd = CMD_SERVER; break; + case 501: gpg_binary = pargs.r.ret_str; break; + case 502: cmd = CMD_LIBVERSION; break; + default: + pargs.err = ARGPARSE_PRINT_WARNING; + break; + } + } + + if (cmd == CMD_LIBVERSION) needgt = 0; - if (needgt && args.gpg_binary) + if (needgt && gpg_binary) { - if (access (args.gpg_binary, X_OK)) + if (access (gpg_binary, X_OK)) err = gpg_error_from_syserror (); else err = gpgme_set_engine_info (GPGME_PROTOCOL_OpenPGP, - args.gpg_binary, NULL); + gpg_binary, NULL); if (err) log_error (1, err, "error witching OpenPGP engine to '%s'", - args.gpg_binary); + gpg_binary); } if (needgt) gt_init (>); - switch (args.cmd) + switch (cmd) { case CMD_DEFAULT: case CMD_SERVER: @@ -3860,4 +3419,3 @@ main (int argc, char *argv[]) return 0; } - ----------------------------------------------------------------------- Summary of changes: src/Makefile.am | 1 + src/argparse.c | 1609 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/argparse.h | 203 +++++++ src/gpgme-tool.c | 540 ++---------------- 4 files changed, 1862 insertions(+), 491 deletions(-) create mode 100644 src/argparse.c create mode 100644 src/argparse.h hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Wed Sep 2 10:47:30 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Wed, 02 Sep 2015 10:47:30 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.7-69-gf076fa1 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, master has been updated via f076fa190e09eab5c586650d81e241e0bb85ce25 (commit) via 219de84df9a8408fffedbb2600f5eb4c441950b6 (commit) via f2d75ac7dc58f5ea59b231be6b83fea939b43ab8 (commit) via 5ff5e72b9c275fbd978136b1028bbf251af26e57 (commit) via 24259d856b6cbdd679035512a8fb7c042de8f02e (commit) via 8522cdc2264804d0677b7c0a447a0b45cf4195e3 (commit) from 9ba4ccdaf5e128fbea51ff142c63d4b359c7264d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f076fa190e09eab5c586650d81e241e0bb85ce25 Author: Neal H. Walfield Date: Wed Sep 2 10:33:26 2015 +0200 g10: If iobuf_seek fails when reading from the cache, do a hard read. * g10/keydb.c (keydb_get_keyblock): If the iobuf_seek fails when reading from the cache, then simply clear the cache and try reading from the database. -- Signed-off-by: Neal H. Walfield . diff --git a/g10/keydb.c b/g10/keydb.c index b4877d4..124e940 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -1126,18 +1126,26 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb) if (keyblock_cache.state == KEYBLOCK_CACHE_FILLED) { - iobuf_seek (keyblock_cache.iobuf, 0); - err = parse_keyblock_image (keyblock_cache.iobuf, - keyblock_cache.pk_no, - keyblock_cache.uid_no, - keyblock_cache.sigstatus, - ret_kb); + err = iobuf_seek (keyblock_cache.iobuf, 0); if (err) - keyblock_cache_clear (); - if (DBG_CLOCK) - log_clock (err? "keydb_get_keyblock leave (cached, failed)" - : "keydb_get_keyblock leave (cached)"); - return err; + { + log_error ("keydb_get_keyblock: failed to rewind iobuf for cache\n"); + keyblock_cache_clear (); + } + else + { + err = parse_keyblock_image (keyblock_cache.iobuf, + keyblock_cache.pk_no, + keyblock_cache.uid_no, + keyblock_cache.sigstatus, + ret_kb); + if (err) + keyblock_cache_clear (); + if (DBG_CLOCK) + log_clock (err? "keydb_get_keyblock leave (cached, failed)" + : "keydb_get_keyblock leave (cached)"); + return err; + } } if (hd->found < 0 || hd->found >= hd->used) commit 219de84df9a8408fffedbb2600f5eb4c441950b6 Author: Neal H. Walfield Date: Wed Sep 2 10:30:59 2015 +0200 iobuf: Reduce verbosity of test. * common/t-iobuf.c (main): Reduce verbosity. -- Signed-off-by: Neal H. Walfield . diff --git a/common/t-iobuf.c b/common/t-iobuf.c index 839798f..99581b9 100644 --- a/common/t-iobuf.c +++ b/common/t-iobuf.c @@ -335,11 +335,13 @@ main (int argc, char *argv[]) assert (rc == 0); n = iobuf_temp_to_buffer (iobuf, buffer, sizeof (buffer)); +#if 0 printf ("Got %d bytes\n", n); printf ("buffer: `"); fwrite (buffer, n, 1, stdout); fputc ('\'', stdout); fputc ('\n', stdout); +#endif assert (n == strlen (content) + 2 * (strlen (content2) + 1)); assert (strcmp (buffer, "0123456789aabbcc") == 0); commit f2d75ac7dc58f5ea59b231be6b83fea939b43ab8 Author: Neal H. Walfield Date: Wed Sep 2 10:24:33 2015 +0200 iobuf: Add the IOBUF_INPUT_TEMP type to improve input temp handling. * common/iobuf.h (enum iobuf_use): Add new member, IOBUF_INPUT_TEMP. * common/iobuf.c (iobuf_temp_with_content): Create the iobuf as an IOBUF_INPUT_TEMP, not an IOBUF_INPUT buffer. Assert that LENGTH == A->D.SIZE. (iobuf_push_filter2): If A is an IOBUF_INPUT_TEMP, then make the new filter an IOBUF_INPUT filter and set its buffer size to IOBUF_BUFFER_SIZE. (underflow): If A is an IOBUF_INPUT_TEMP, then just return EOF; don't remove already read data. (iobuf_seek): If A is an IOBUF_INPUT_TEMP, don't discard the buffered data. (iobuf_alloc): Allow USE == IOBUF_INPUT_TEMP. (pop_filter): Allow USE == IOBUF_INPUT_TEMP. (iobuf_peek): Allow USE == IOBUF_INPUT_TEMP. (iobuf_writebyte): Fail if USE == IOBUF_INPUT_TEMP. (iobuf_write): Fail if USE == IOBUF_INPUT_TEMP. (iobuf_writestr): Fail if USE == IOBUF_INPUT_TEMP. (iobuf_flush_temp): Fail if USE == IOBUF_INPUT_TEMP. -- Signed-off-by: Neal H. Walfield . Introduce a new iobuf type, IOBUF_INPUT_TEMP. Use this for the iobuf created by iobuf_temp_with_content instead of IOBUF_INPUT. This was necessary so that seeking and peeking correctly work on this type of iobuf. In particular, seeking didn't work because we discarded the buffered data and peeking didn't work because we discarded data which was already read, which made seeking later impossible. diff --git a/common/iobuf.c b/common/iobuf.c index a6786b1..795ff11 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -1099,7 +1099,7 @@ iobuf_alloc (int use, size_t bufsize) iobuf_t a; static int number = 0; - assert (use == IOBUF_INPUT + assert (use == IOBUF_INPUT || use == IOBUF_INPUT_TEMP || use == IOBUF_OUTPUT || use == IOBUF_OUTPUT_TEMP); if (bufsize == 0) { @@ -1220,7 +1220,8 @@ iobuf_temp_with_content (const char *buffer, size_t length) iobuf_t a; int i; - a = iobuf_alloc (IOBUF_INPUT, length); + a = iobuf_alloc (IOBUF_INPUT_TEMP, length); + assert (length == a->d.size); /* memcpy (a->d.buf, buffer, length); */ for (i=0; i < length; i++) a->d.buf[i] = buffer[i]; @@ -1619,6 +1620,12 @@ iobuf_push_filter2 (iobuf_t a, size. */ a->d.size = IOBUF_BUFFER_SIZE; } + else if (a->use == IOBUF_INPUT_TEMP) + /* Same idea as above. */ + { + a->use = IOBUF_INPUT; + a->d.size = IOBUF_BUFFER_SIZE; + } /* The new filter (A) gets a new buffer. @@ -1678,7 +1685,7 @@ pop_filter (iobuf_t a, int (*f) (void *opaque, int control, if (DBG_IOBUF) log_debug ("iobuf-%d.%d: pop '%s'\n", a->no, a->subno, iobuf_desc (a)); - if (a->use == IOBUF_OUTPUT_TEMP) + if (a->use == IOBUF_INPUT_TEMP || a->use == IOBUF_OUTPUT_TEMP) { /* This should be the last filter in the pipeline. */ assert (! a->chain); @@ -1765,6 +1772,11 @@ underflow (iobuf_t a, int clear_pending_eof) (int) a->d.size, (int) (a->d.len - a->d.start), (int) (a->d.size - (a->d.len - a->d.start))); + if (a->use == IOBUF_INPUT_TEMP) + /* By definition, there isn't more data to read into the + buffer. */ + return -1; + assert (a->use == IOBUF_INPUT); /* If there is still some buffered data, then move it to the start @@ -2056,7 +2068,7 @@ iobuf_peek (iobuf_t a, byte * buf, unsigned buflen) int n = 0; assert (buflen > 0); - assert (a->use == IOBUF_INPUT); + assert (a->use == IOBUF_INPUT || a->use == IOBUF_INPUT_TEMP); if (buflen > a->d.size) /* We can't peek more than we can buffer. */ @@ -2097,7 +2109,7 @@ iobuf_writebyte (iobuf_t a, unsigned int c) { int rc; - if (a->use == IOBUF_INPUT) + if (a->use == IOBUF_INPUT || a->use == IOBUF_INPUT_TEMP) { log_bug ("iobuf_writebyte called on an input pipeline!\n"); return -1; @@ -2119,7 +2131,7 @@ iobuf_write (iobuf_t a, const void *buffer, unsigned int buflen) const unsigned char *buf = (const unsigned char *)buffer; int rc; - if (a->use == IOBUF_INPUT) + if (a->use == IOBUF_INPUT || a->use == IOBUF_INPUT_TEMP) { log_bug ("iobuf_write called on an input pipeline!\n"); return -1; @@ -2152,7 +2164,7 @@ iobuf_write (iobuf_t a, const void *buffer, unsigned int buflen) int iobuf_writestr (iobuf_t a, const char *buf) { - if (a->use == IOBUF_INPUT) + if (a->use == IOBUF_INPUT || a->use == IOBUF_INPUT_TEMP) { log_bug ("iobuf_writestr called on an input pipeline!\n"); return -1; @@ -2200,7 +2212,7 @@ iobuf_temp_to_buffer (iobuf_t a, byte * buffer, size_t buflen) void iobuf_flush_temp (iobuf_t temp) { - if (temp->use == IOBUF_INPUT) + if (temp->use == IOBUF_INPUT || temp->use == IOBUF_INPUT_TEMP) log_bug ("iobuf_writestr called on an input pipeline!\n"); while (temp->chain) pop_filter (temp, temp->filter, NULL); @@ -2379,10 +2391,9 @@ iobuf_seek (iobuf_t a, off_t newpos) return -1; } #endif + /* Discard the buffer it is not a temp stream. */ + a->d.len = 0; } - /* Discard the buffer it is not a temp stream. */ - if (a->use != IOBUF_OUTPUT_TEMP) - a->d.len = 0; a->d.start = 0; a->nbytes = 0; a->nlimit = 0; @@ -2409,10 +2420,6 @@ iobuf_seek (iobuf_t a, off_t newpos) } - - - - const char * iobuf_get_real_fname (iobuf_t a) { @@ -2430,7 +2437,6 @@ iobuf_get_real_fname (iobuf_t a) return NULL; } - const char * iobuf_get_fname (iobuf_t a) { @@ -2462,7 +2468,6 @@ iobuf_set_partial_block_mode (iobuf_t a, size_t len) { block_filter_ctx_t *ctx = xcalloc (1, sizeof *ctx); - assert (a->use == IOBUF_INPUT || a->use == IOBUF_OUTPUT); ctx->use = a->use; if (!len) { diff --git a/common/iobuf.h b/common/iobuf.h index b65ea60..bce6c31 100644 --- a/common/iobuf.h +++ b/common/iobuf.h @@ -124,12 +124,15 @@ enum iobuf_use /* Pipeline is in input mode. The data flows from the end to the beginning. That is, when reading from the pipeline, the first filter gets its input from the second filter, etc. */ - IOBUF_INPUT=1, + IOBUF_INPUT, + /* Pipeline is in input mode. The last filter in the pipeline is + a temporary buffer from which the data is "read". */ + IOBUF_INPUT_TEMP, /* Pipeline is in output mode. The data flows from the beginning to the end. That is, when writing to the pipeline, the user writes to the first filter, which transforms the data and sends it to the second filter, etc. */ - IOBUF_OUTPUT=2, + IOBUF_OUTPUT, /* Pipeline is in output mode. The last filter in the pipeline is a temporary buffer that grows as necessary. */ IOBUF_OUTPUT_TEMP @@ -274,7 +277,8 @@ int iobuf_is_pipe_filename (const char *fname); create a new primary source or primary sink, i.e., the last filter in the pipeline. - USE is IOBUF_INPUT, IOBUF_OUTPUT or IOBUF_OUTPUT_TEMP. + USE is IOBUF_INPUT, IOBUF_INPUT_TEMP, IOBUF_OUTPUT or + IOBUF_OUTPUT_TEMP. BUFSIZE is the desired internal buffer size (that is, the size of the typical read / write request). */ commit 5ff5e72b9c275fbd978136b1028bbf251af26e57 Author: Neal H. Walfield Date: Wed Sep 2 09:56:09 2015 +0200 iobuf: Rename IOBUF_TEMP to IOBUF_OUTPUT_TEMP. * common/iobuf.h (enum iobuf_use): Rename IOBUF_TEMP to IOBUF_OUTPUT_TEMP. Update users. -- Signed-off-by: Neal H. Walfield . diff --git a/common/iobuf.c b/common/iobuf.c index 35b58ff..a6786b1 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -170,10 +170,10 @@ static int translate_file_handle (int fd, int for_write); underlying file; it just causes any data buffered at the filter A to be sent to A's filter function. - If A is a IOBUF_TEMP filter, then this also enlarges the buffer by - IOBUF_BUFFER_SIZE. + If A is a IOBUF_OUTPUT_TEMP filter, then this also enlarges the + buffer by IOBUF_BUFFER_SIZE. - May only be called on an IOBUF_OUTPUT or IOBUF_TEMP filters. */ + May only be called on an IOBUF_OUTPUT or IOBUF_OUTPUT_TEMP filters. */ static int filter_flush (iobuf_t a); @@ -1099,7 +1099,8 @@ iobuf_alloc (int use, size_t bufsize) iobuf_t a; static int number = 0; - assert (use == IOBUF_INPUT || use == IOBUF_OUTPUT || use == IOBUF_TEMP); + assert (use == IOBUF_INPUT + || use == IOBUF_OUTPUT || use == IOBUF_OUTPUT_TEMP); if (bufsize == 0) { log_bug ("iobuf_alloc() passed a bufsize of 0!\n"); @@ -1210,7 +1211,7 @@ iobuf_cancel (iobuf_t a) iobuf_t iobuf_temp (void) { - return iobuf_alloc (IOBUF_TEMP, IOBUF_BUFFER_SIZE); + return iobuf_alloc (IOBUF_OUTPUT_TEMP, IOBUF_BUFFER_SIZE); } iobuf_t @@ -1274,6 +1275,8 @@ do_open (const char *fname, int special_filenames, int print_only = 0; int fd; + assert (use == IOBUF_INPUT || use == IOBUF_OUTPUT); + if (special_filenames /* NULL or '-'. */ && (!fname || (*fname == '-' && !fname[1]))) @@ -1600,13 +1603,13 @@ iobuf_push_filter2 (iobuf_t a, a->filter_ov = NULL; a->filter_ov_owner = 0; a->filter_eof = 0; - if (a->use == IOBUF_TEMP) + if (a->use == IOBUF_OUTPUT_TEMP) /* A TEMP filter buffers any data sent to it; it does not forward any data down the pipeline. If we add a new filter to the pipeline, it shouldn't also buffer data. It should send it downstream to be buffered. Thus, the correct type for a filter - added in front of an IOBUF_TEMP filter is IOBUF_OUPUT, not - IOBUF_TEMP. */ + added in front of an IOBUF_OUTPUT_TEMP filter is IOBUF_OUPUT, not + IOBUF_OUTPUT_TEMP. */ { a->use = IOBUF_OUTPUT; @@ -1675,6 +1678,12 @@ pop_filter (iobuf_t a, int (*f) (void *opaque, int control, if (DBG_IOBUF) log_debug ("iobuf-%d.%d: pop '%s'\n", a->no, a->subno, iobuf_desc (a)); + if (a->use == IOBUF_OUTPUT_TEMP) + { + /* This should be the last filter in the pipeline. */ + assert (! a->chain); + return 0; + } if (!a->filter) { /* this is simple */ b = a->chain; @@ -1904,7 +1913,7 @@ filter_flush (iobuf_t a) size_t len; int rc; - if (a->use == IOBUF_TEMP) + if (a->use == IOBUF_OUTPUT_TEMP) { /* increase the temp buffer */ size_t newsize = a->d.size + IOBUF_BUFFER_SIZE; @@ -1940,7 +1949,7 @@ iobuf_readbyte (iobuf_t a) { int c; - if (a->use != IOBUF_INPUT) + if (a->use == IOBUF_OUTPUT || a->use == IOBUF_OUTPUT_TEMP) { log_bug ("iobuf_readbyte called on a non-INPUT pipeline!\n"); return -1; @@ -1974,12 +1983,11 @@ iobuf_read (iobuf_t a, void *buffer, unsigned int buflen) unsigned char *buf = (unsigned char *)buffer; int c, n; - if (a->use != IOBUF_INPUT) + if (a->use == IOBUF_OUTPUT || a->use == IOBUF_OUTPUT_TEMP) { log_bug ("iobuf_read called on a non-INPUT pipeline!\n"); return -1; } - assert (a->use == IOBUF_INPUT); if (a->nlimit) { @@ -2158,8 +2166,8 @@ iobuf_writestr (iobuf_t a, const char *buf) int iobuf_write_temp (iobuf_t dest, iobuf_t source) { - assert (source->use == IOBUF_OUTPUT || source->use == IOBUF_TEMP); - assert (dest->use == IOBUF_OUTPUT || dest->use == IOBUF_TEMP); + assert (source->use == IOBUF_OUTPUT || source->use == IOBUF_OUTPUT_TEMP); + assert (dest->use == IOBUF_OUTPUT || dest->use == IOBUF_OUTPUT_TEMP); iobuf_flush_temp (source); return iobuf_write (dest, source->d.buf, source->d.len); @@ -2346,7 +2354,7 @@ iobuf_seek (iobuf_t a, off_t newpos) { file_filter_ctx_t *b = NULL; - if (a->use != IOBUF_TEMP) + if (a->use == IOBUF_OUTPUT || a->use == IOBUF_INPUT) { /* Find the last filter in the pipeline. */ for (; a->chain; a = a->chain) @@ -2372,8 +2380,8 @@ iobuf_seek (iobuf_t a, off_t newpos) } #endif } - /* Discard the buffer unless it is a temp stream. */ - if (a->use != IOBUF_TEMP) + /* Discard the buffer it is not a temp stream. */ + if (a->use != IOBUF_OUTPUT_TEMP) a->d.len = 0; a->d.start = 0; a->nbytes = 0; diff --git a/common/iobuf.h b/common/iobuf.h index 36b14b7..b65ea60 100644 --- a/common/iobuf.h +++ b/common/iobuf.h @@ -58,13 +58,14 @@ in the iobuf_t. A pipeline can only be used for reading (IOBUF_INPUT) or for - writing (IOBUF_OUTPUT / IOBUF_TEMP). When reading, data flows from - the last filter towards the first. That is, the user calls - iobuf_read(), the module reads from the first filter, which gets - its input from the second filter, etc. When writing, data flows - from the first filter towards the last. In this case, when the - user calls iobuf_write(), the data is written to the first filter, - which writes the transformed data to the second filter, etc. + writing (IOBUF_OUTPUT / IOBUF_OUTPUT_TEMP). When reading, data + flows from the last filter towards the first. That is, the user + calls iobuf_read(), the module reads from the first filter, which + gets its input from the second filter, etc. When writing, data + flows from the first filter towards the last. In this case, when + the user calls iobuf_write(), the data is written to the first + filter, which writes the transformed data to the second filter, + etc. An iobuf_t contains some state about the filter. For instance, it indicates if the filter has already returned EOF (filter_eof) and @@ -131,7 +132,7 @@ enum iobuf_use IOBUF_OUTPUT=2, /* Pipeline is in output mode. The last filter in the pipeline is a temporary buffer that grows as necessary. */ - IOBUF_TEMP=3 + IOBUF_OUTPUT_TEMP }; @@ -142,7 +143,7 @@ typedef struct iobuf_struct *IOBUF; /* Compatibility with gpg 1.4. */ struct iobuf_struct { /* The type of filter. Either IOBUF_INPUT, IOBUF_OUTPUT or - IOBUF_TEMP. */ + IOBUF_OUTPUT_TEMP. */ enum iobuf_use use; /* nlimit can be changed using iobuf_set_limit. If non-zero, it is @@ -273,7 +274,7 @@ int iobuf_is_pipe_filename (const char *fname); create a new primary source or primary sink, i.e., the last filter in the pipeline. - USE is IOBUF_INPUT, IOBUF_OUTPUT or IOBUF_TEMP. + USE is IOBUF_INPUT, IOBUF_OUTPUT or IOBUF_OUTPUT_TEMP. BUFSIZE is the desired internal buffer size (that is, the size of the typical read / write request). */ @@ -437,7 +438,7 @@ int iobuf_print_chain (iobuf_t a); void iobuf_set_limit (iobuf_t a, off_t nlimit); /* Returns the number of bytes that have been read from the pipeline. - Note: the result is undefined for IOBUF_OUTPUT and IOBUF_TEMP + Note: the result is undefined for IOBUF_OUTPUT and IOBUF_OUTPUT_TEMP pipelines! */ off_t iobuf_tell (iobuf_t a); @@ -604,6 +605,6 @@ void iobuf_skip_rest (iobuf_t a, unsigned long n, int partial); #define iobuf_get_temp_length(a) ( (a)->d.len ) /* Whether the filter uses an in-memory buffer. */ -#define iobuf_is_temp(a) ( (a)->use == IOBUF_TEMP ) +#define iobuf_is_temp(a) ( (a)->use == IOBUF_OUTPUT_TEMP ) #endif /*GNUPG_COMMON_IOBUF_H*/ commit 24259d856b6cbdd679035512a8fb7c042de8f02e Author: Neal H. Walfield Date: Tue Sep 1 22:17:23 2015 +0200 iobuf: Use a first-class enum. * common/iobuf.h (enum iobuf_use): Name the IOBUF_OUTPUT, etc. enum. (struct iobuf_struct): Change the field use's type to it. -- Signed-off-by: Neal H. Walfield . diff --git a/common/iobuf.h b/common/iobuf.h index 7157e0f..36b14b7 100644 --- a/common/iobuf.h +++ b/common/iobuf.h @@ -118,7 +118,7 @@ typedef enum IOBUF_IOCTL_FSYNC = 4 /* Uses ptrval. */ } iobuf_ioctl_t; -enum +enum iobuf_use { /* Pipeline is in input mode. The data flows from the end to the beginning. That is, when reading from the pipeline, the first @@ -143,7 +143,7 @@ struct iobuf_struct { /* The type of filter. Either IOBUF_INPUT, IOBUF_OUTPUT or IOBUF_TEMP. */ - int use; + enum iobuf_use use; /* nlimit can be changed using iobuf_set_limit. If non-zero, it is the number of additional bytes that can be read from the filter commit 8522cdc2264804d0677b7c0a447a0b45cf4195e3 Author: Neal H. Walfield Date: Tue Sep 1 22:13:45 2015 +0200 iobuf: Fix test. * common/t-iobuf.c (content_filter): If there is nothing to read, don't forget to set *LEN to 0. (main): Fix checks. -- Signed-off-by: Neal H. Walfield . diff --git a/common/t-iobuf.c b/common/t-iobuf.c index ae72fde..839798f 100644 --- a/common/t-iobuf.c +++ b/common/t-iobuf.c @@ -111,15 +111,14 @@ content_filter (void *opaque, int control, if (toread > remaining) toread = remaining; - if (toread == 0) - return -1; - memcpy (buf, &state->buffer[state->pos], toread); state->pos += toread; *len = toread; + if (toread == 0) + return -1; return 0; } @@ -269,10 +268,8 @@ main (int argc, char *argv[]) } { - /* - 3 characters plus new line - - 4 characters plus new line - - 5 characters plus new line - - 5 characters, no new line + /* - 10 characters, EOF + - 17 characters, EOF */ char *content = "abcdefghijklmnopq"; char *content2 = "0123456789"; @@ -294,7 +291,7 @@ main (int argc, char *argv[]) if (c == -1 && lastc == -1) { /* printf("Two EOFs in a row. Done.\n"); */ - assert (n == 44); + assert (n == 27); break; } @@ -303,7 +300,7 @@ main (int argc, char *argv[]) if (c == -1) { /* printf("After %d bytes, got EOF.\n", n); */ - assert (n == 27 || n == 44); + assert (n == 10 || n == 27); } else { ----------------------------------------------------------------------- Summary of changes: common/iobuf.c | 73 +++++++++++++++++++++++++++++++++----------------------- common/iobuf.h | 37 +++++++++++++++------------- common/t-iobuf.c | 17 +++++++------ g10/keydb.c | 30 ++++++++++++++--------- 4 files changed, 91 insertions(+), 66 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Wed Sep 2 15:09:32 2015 From: cvs at cvs.gnupg.org (by Neal H. Walfield) Date: Wed, 02 Sep 2015 15:09:32 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.7-73-gbd0c902 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, master has been updated via bd0c902f1de46eda03a065da41487e7e01ab4c50 (commit) via 1f03d4cd940fed26fc3ffa1742728d68c55ee5d1 (commit) via ee7ec1256b24dc340656c331ef92fc59cad817b6 (commit) via 60bc518645d3acfd4dcb79e61a2be6ce001e93aa (commit) from f076fa190e09eab5c586650d81e241e0bb85ce25 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit bd0c902f1de46eda03a065da41487e7e01ab4c50 Author: Neal H. Walfield Date: Tue Sep 1 14:53:47 2015 +0200 g10: Remove unused field req_algo. * g10/packet.h (PKT_public_key): Remove unused field req_algo. Remove users. * g10/getkey.c (struct getkey_ctx_s): Remove unused field req_algo. Remove users. -- Signed-off-by: Neal H. Walfield . diff --git a/g10/getkey.c b/g10/getkey.c index 6e85834..7aeaebc 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -55,7 +55,6 @@ struct getkey_ctx_s KBNODE found_key; /* Pointer into some keyblock. */ strlist_t extra_list; /* Will be freed when releasing the context. */ int req_usage; - int req_algo; KEYDB_HANDLE kr_handle; int not_allocated; int nitems; @@ -392,7 +391,6 @@ get_pubkey (PKT_public_key * pk, u32 * keyid) ctx.items[0].mode = KEYDB_SEARCH_MODE_LONG_KID; ctx.items[0].u.kid[0] = keyid[0]; ctx.items[0].u.kid[1] = keyid[1]; - ctx.req_algo = pk->req_algo; ctx.req_usage = pk->req_usage; rc = lookup (&ctx, &kb, 0); if (!rc) @@ -524,7 +522,6 @@ get_seckey (PKT_public_key *pk, u32 *keyid) ctx.items[0].mode = KEYDB_SEARCH_MODE_LONG_KID; ctx.items[0].u.kid[0] = keyid[0]; ctx.items[0].u.kid[1] = keyid[1]; - ctx.req_algo = pk->req_algo; ctx.req_usage = pk->req_usage; err = lookup (&ctx, &keyblock, 1); if (!err) @@ -661,7 +658,6 @@ key_byname (GETKEY_CTX *retctx, strlist_t namelist, if (pk) { - ctx->req_algo = pk->req_algo; ctx->req_usage = pk->req_usage; } diff --git a/g10/packet.h b/g10/packet.h index 826963e..1906ec5 100644 --- a/g10/packet.h +++ b/g10/packet.h @@ -273,7 +273,6 @@ typedef struct byte pubkey_algo; /* algorithm used for public key scheme */ byte pubkey_usage; /* for now only used to pass it to getkey() */ byte req_usage; /* hack to pass a request to getkey() */ - byte req_algo; /* Ditto */ u32 has_expired; /* set to the expiration date if expired */ u32 main_keyid[2]; /* keyid of the primary key */ u32 keyid[2]; /* calculated by keyid_from_pk() */ commit 1f03d4cd940fed26fc3ffa1742728d68c55ee5d1 Author: Neal H. Walfield Date: Tue Sep 1 10:40:04 2015 +0200 g10: Use a symbolic constant instead of a literal. * g10/trustdb.c (KEY_HASH_TABLE_SIZE): Define. (new_key_hash_table): Use KEY_HASH_TABLE_SIZE instead of a literal. (release_key_hash_table): Likewise. (test_key_hash_table): Likewise. (add_key_hash_table): Likewise. -- Signed-off-by: Neal H. Walfield . diff --git a/g10/trustdb.c b/g10/trustdb.c index 1826e98..ba4ba5f 100644 --- a/g10/trustdb.c +++ b/g10/trustdb.c @@ -99,20 +99,22 @@ release_key_items (struct key_item *k) } } +#define KEY_HASH_TABLE_SIZE 1024 + /* - * For fast keylook up we need a hash table. Each byte of a KeyIDs + * For fast keylook up we need a hash table. Each byte of a KeyID * should be distributed equally over the 256 possible values (except * for v3 keyIDs but we consider them as not important here). So we - * can just use 10 bits to index a table of 1024 key items. - * Possible optimization: Don not use key_items but other hash_table when the - * duplicates lists gets too large. + * can just use 10 bits to index a table of KEY_HASH_TABLE_SIZE key items. + * Possible optimization: Do not use key_items but other hash_table when the + * duplicates lists get too large. */ static KeyHashTable new_key_hash_table (void) { struct key_item **tbl; - tbl = xmalloc_clear (1024 * sizeof *tbl); + tbl = xmalloc_clear (KEY_HASH_TABLE_SIZE * sizeof *tbl); return tbl; } @@ -123,7 +125,7 @@ release_key_hash_table (KeyHashTable tbl) if (!tbl) return; - for (i=0; i < 1024; i++) + for (i=0; i < KEY_HASH_TABLE_SIZE; i++) release_key_items (tbl[i]); xfree (tbl); } @@ -136,7 +138,7 @@ test_key_hash_table (KeyHashTable tbl, u32 *kid) { struct key_item *k; - for (k = tbl[(kid[1] & 0x03ff)]; k; k = k->next) + for (k = tbl[(kid[1] % KEY_HASH_TABLE_SIZE)]; k; k = k->next) if (k->kid[0] == kid[0] && k->kid[1] == kid[1]) return 1; return 0; @@ -148,17 +150,18 @@ test_key_hash_table (KeyHashTable tbl, u32 *kid) static void add_key_hash_table (KeyHashTable tbl, u32 *kid) { + int i = kid[1] % KEY_HASH_TABLE_SIZE; struct key_item *k, *kk; - for (k = tbl[(kid[1] & 0x03ff)]; k; k = k->next) + for (k = tbl[i]; k; k = k->next) if (k->kid[0] == kid[0] && k->kid[1] == kid[1]) return; /* already in table */ kk = new_key_item (); kk->kid[0] = kid[0]; kk->kid[1] = kid[1]; - kk->next = tbl[(kid[1] & 0x03ff)]; - tbl[(kid[1] & 0x03ff)] = kk; + kk->next = tbl[i]; + tbl[i] = kk; } /* commit ee7ec1256b24dc340656c331ef92fc59cad817b6 Author: Neal H. Walfield Date: Wed Sep 2 15:07:06 2015 +0200 g10: Add test for keydb as well as new testing infrastructure. * g10/Makefile.am (EXTRA_DIST): Add test.c. (AM_CPPFLAGS): Add -DSOURCE_DIR="\"$(srcdir)\"". (module_tests): Add t-keydb. (t_keydb_SOURCES): New variable. (t_keydb_LDADD): Likewise. * g10/t-keydb.c: New file. * g10/t-keydb-keyring.kbx: New file. * g10/test-stubs.c: New file. * g10/test.c: New file. -- Signed-off-by: Neal H. Walfield . diff --git a/g10/Makefile.am b/g10/Makefile.am index 0c53eab..421870c 100644 --- a/g10/Makefile.am +++ b/g10/Makefile.am @@ -19,9 +19,9 @@ ## Process this file with automake to produce Makefile.in EXTRA_DIST = options.skel distsigkey.gpg ChangeLog-2011 gpg-w32info.rc \ - gpg.w32-manifest.in + gpg.w32-manifest.in test.c -AM_CPPFLAGS = -I$(top_srcdir)/common +AM_CPPFLAGS = -I$(top_srcdir)/common -DSOURCE_DIR="\"$(srcdir)\"" include $(top_srcdir)/am/cmacros.am @@ -150,9 +150,12 @@ gpgv2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) \ gpgv2_LDFLAGS = $(extra_bin_ldflags) t_common_ldadd = -module_tests = t-rmd160 +module_tests = t-rmd160 t-keydb t_rmd160_SOURCES = t-rmd160.c rmd160.c t_rmd160_LDADD = $(t_common_ldadd) +t_keydb_SOURCES = t-keydb.c test-stubs.c $(common_source) +t_keydb_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \ + $(LIBICONV) $(t_common_ldadd) $(PROGRAMS): $(needed_libs) ../common/libgpgrl.a diff --git a/g10/t-keydb-keyring.kbx b/g10/t-keydb-keyring.kbx new file mode 100644 index 0000000..a1d3af0 Binary files /dev/null and b/g10/t-keydb-keyring.kbx differ diff --git a/g10/t-keydb.c b/g10/t-keydb.c new file mode 100644 index 0000000..0f17643 --- /dev/null +++ b/g10/t-keydb.c @@ -0,0 +1,87 @@ +/* t-keydb.c - Tests for keydb.c. + * Copyright (C) 2015 g10 Code GmbH + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * GnuPG is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include "test.c" + +#include "keydb.h" + +static void +do_test (int argc, char *argv[]) +{ + int rc; + KEYDB_HANDLE hd1, hd2; + KEYDB_SEARCH_DESC desc1, desc2; + KBNODE kb1, kb2; + char *uid1; + char *uid2; + + (void) argc; + (void) argv; + + rc = keydb_add_resource (SOURCE_DIR "/t-keydb-keyring.kbx", 0); + if (rc) + ABORT ("Failed to open keyring."); + + hd1 = keydb_new (); + hd2 = keydb_new (); + + rc = classify_user_id ("2689 5E25 E844 6D44 A26D 8FAF 2F79 98F3 DBFC 6AD9", + &desc1, 0); + if (rc) + ABORT ("Failed to convert fingerprint for DBFC6AD9"); + + rc = keydb_search (hd1, &desc1, 1, NULL); + if (rc) + ABORT ("Failed to lookup key associated with DBFC6AD9"); + + + classify_user_id ("8061 5870 F5BA D690 3336 86D0 F2AD 85AC 1E42 B367", + &desc2, 0); + if (rc) + ABORT ("Failed to convert fingerprint for 1E42B367"); + + rc = keydb_search (hd2, &desc2, 1, NULL); + if (rc) + ABORT ("Failed to lookup key associated with 1E42B367"); + + rc = keydb_get_keyblock (hd2, &kb2); + if (rc) + ABORT ("Failed to get keyblock for 1E42B367"); + + rc = keydb_get_keyblock (hd1, &kb1); + if (rc) + ABORT ("Failed to get keyblock for DBFC6AD9"); + + while (kb1 && kb1->pkt->pkttype != PKT_USER_ID) + kb1 = kb1->next; + if (! kb1) + ABORT ("DBFC6AD9 has no user id packet"); + uid1 = kb1->pkt->pkt.user_id->name; + + while (kb2 && kb2->pkt->pkttype != PKT_USER_ID) + kb2 = kb2->next; + if (! kb2) + ABORT ("1E42B367 has no user id packet"); + uid2 = kb2->pkt->pkt.user_id->name; + + printf ("user id for DBFC6AD9: %s\n", uid1); + printf ("user id for 1E42B367: %s\n", uid2); + + TEST_P ("cache consistency", strcmp (uid1, uid2) != 0); +} diff --git a/g10/test-stubs.c b/g10/test-stubs.c new file mode 100644 index 0000000..c6f6d68 --- /dev/null +++ b/g10/test-stubs.c @@ -0,0 +1,413 @@ +/* test-stubs.c - The GnuPG signature verify utility + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2006, + * 2008, 2009, 2012 Free Software Foundation, Inc. + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * GnuPG is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +#define INCLUDED_BY_MAIN_MODULE 1 +#include "gpg.h" +#include "util.h" +#include "packet.h" +#include "iobuf.h" +#include "main.h" +#include "options.h" +#include "keydb.h" +#include "trustdb.h" +#include "filter.h" +#include "ttyio.h" +#include "i18n.h" +#include "sysutils.h" +#include "status.h" +#include "call-agent.h" + +int g10_errors_seen; + + +void +g10_exit( int rc ) +{ + rc = rc? rc : log_get_errorcount(0)? 2 : g10_errors_seen? 1 : 0; + exit(rc ); +} + + +/* Stub: + * We have to override the trustcheck from pkclist.c becuase + * this utility assumes that all keys in the keyring are trustworthy + */ +int +check_signatures_trust( PKT_signature *sig ) +{ + (void)sig; + return 0; +} + +void +read_trust_options(byte *trust_model, ulong *created, ulong *nextcheck, + byte *marginals, byte *completes, byte *cert_depth, + byte *min_cert_level) +{ + (void)trust_model; + (void)created; + (void)nextcheck; + (void)marginals; + (void)completes; + (void)cert_depth; + (void)min_cert_level; +} + +/* Stub: + * We don't have the trustdb , so we have to provide some stub functions + * instead + */ + +int +cache_disabled_value(PKT_public_key *pk) +{ + (void)pk; + return 0; +} + +void +check_trustdb_stale(void) +{ +} + +int +get_validity_info (PKT_public_key *pk, PKT_user_id *uid) +{ + (void)pk; + (void)uid; + return '?'; +} + +unsigned int +get_validity (PKT_public_key *pk, PKT_user_id *uid) +{ + (void)pk; + (void)uid; + return 0; +} + +const char * +trust_value_to_string (unsigned int value) +{ + (void)value; + return "err"; +} + +const char * +uid_trust_string_fixed (PKT_public_key *key, PKT_user_id *uid) +{ + (void)key; + (void)uid; + return "err"; +} + +int +get_ownertrust_info (PKT_public_key *pk) +{ + (void)pk; + return '?'; +} + +unsigned int +get_ownertrust (PKT_public_key *pk) +{ + (void)pk; + return TRUST_UNKNOWN; +} + + +/* Stubs: + * Because we only work with trusted keys, it does not make sense to + * get them from a keyserver + */ + +struct keyserver_spec * +keyserver_match (struct keyserver_spec *spec) +{ + (void)spec; + return NULL; +} + +int +keyserver_import_keyid (u32 *keyid, void *dummy) +{ + (void)keyid; + (void)dummy; + return -1; +} + +int +keyserver_import_cert (const char *name) +{ + (void)name; + return -1; +} + +int +keyserver_import_pka (const char *name,unsigned char *fpr) +{ + (void)name; + (void)fpr; + return -1; +} + +int +keyserver_import_name (const char *name,struct keyserver_spec *spec) +{ + (void)name; + (void)spec; + return -1; +} + +int +keyserver_import_ldap (const char *name) +{ + (void)name; + return -1; +} + +/* Stub: + * No encryption here but mainproc links to these functions. + */ +gpg_error_t +get_session_key (PKT_pubkey_enc *k, DEK *dek) +{ + (void)k; + (void)dek; + return GPG_ERR_GENERAL; +} + +/* Stub: */ +gpg_error_t +get_override_session_key (DEK *dek, const char *string) +{ + (void)dek; + (void)string; + return GPG_ERR_GENERAL; +} + +/* Stub: */ +int +decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek) +{ + (void)ctrl; + (void)procctx; + (void)ed; + (void)dek; + return GPG_ERR_GENERAL; +} + + +/* Stub: + * No interactive commands, so we don't need the helptexts + */ +void +display_online_help (const char *keyword) +{ + (void)keyword; +} + +/* Stub: + * We don't use secret keys, but getkey.c links to this + */ +int +check_secret_key (PKT_public_key *pk, int n) +{ + (void)pk; + (void)n; + return GPG_ERR_GENERAL; +} + +/* Stub: + * No secret key, so no passphrase needed + */ +DEK * +passphrase_to_dek (u32 *keyid, int pubkey_algo, + int cipher_algo, STRING2KEY *s2k, int mode, + const char *tmp, int *canceled) +{ + (void)keyid; + (void)pubkey_algo; + (void)cipher_algo; + (void)s2k; + (void)mode; + (void)tmp; + + if (canceled) + *canceled = 0; + return NULL; +} + +void +passphrase_clear_cache (u32 *keyid, const char *cacheid, int algo) +{ + (void)keyid; + (void)cacheid; + (void)algo; +} + +struct keyserver_spec * +parse_preferred_keyserver(PKT_signature *sig) +{ + (void)sig; + return NULL; +} + +struct keyserver_spec * +parse_keyserver_uri (const char *uri, int require_scheme, + const char *configname, unsigned int configlineno) +{ + (void)uri; + (void)require_scheme; + (void)configname; + (void)configlineno; + return NULL; +} + +void +free_keyserver_spec (struct keyserver_spec *keyserver) +{ + (void)keyserver; +} + +/* Stubs to avoid linking to photoid.c */ +void +show_photos (const struct user_attribute *attrs, int count, PKT_public_key *pk) +{ + (void)attrs; + (void)count; + (void)pk; +} + +int +parse_image_header (const struct user_attribute *attr, byte *type, u32 *len) +{ + (void)attr; + (void)type; + (void)len; + return 0; +} + +char * +image_type_to_string (byte type, int string) +{ + (void)type; + (void)string; + return NULL; +} + +#ifdef ENABLE_CARD_SUPPORT +int +agent_scd_getattr (const char *name, struct agent_card_info_s *info) +{ + (void)name; + (void)info; + return 0; +} +#endif /* ENABLE_CARD_SUPPORT */ + +/* We do not do any locking, so use these stubs here */ +void +dotlock_disable (void) +{ +} + +dotlock_t +dotlock_create (const char *file_to_lock, unsigned int flags) +{ + (void)file_to_lock; + (void)flags; + return NULL; +} + +void +dotlock_destroy (dotlock_t h) +{ + (void)h; +} + +int +dotlock_take (dotlock_t h, long timeout) +{ + (void)h; + (void)timeout; + return 0; +} + +int +dotlock_release (dotlock_t h) +{ + (void)h; + return 0; +} + +void +dotlock_remove_lockfiles (void) +{ +} + +gpg_error_t +agent_probe_secret_key (ctrl_t ctrl, PKT_public_key *pk) +{ + (void)ctrl; + (void)pk; + return gpg_error (GPG_ERR_NO_SECKEY); +} + +gpg_error_t +agent_probe_any_secret_key (ctrl_t ctrl, kbnode_t keyblock) +{ + (void)ctrl; + (void)keyblock; + return gpg_error (GPG_ERR_NO_SECKEY); +} + +gpg_error_t +agent_get_keyinfo (ctrl_t ctrl, const char *hexkeygrip, char **r_serialno) +{ + (void)ctrl; + (void)hexkeygrip; + *r_serialno = NULL; + return gpg_error (GPG_ERR_NO_SECKEY); +} + +gpg_error_t +gpg_dirmngr_get_pka (ctrl_t ctrl, const char *userid, + unsigned char **r_fpr, size_t *r_fprlen, + char **r_url) +{ + (void)ctrl; + (void)userid; + if (r_fpr) + *r_fpr = NULL; + if (r_fprlen) + *r_fprlen = 0; + if (r_url) + *r_url = NULL; + return gpg_error (GPG_ERR_NOT_FOUND); +} diff --git a/g10/test.c b/g10/test.c new file mode 100644 index 0000000..6910f95 --- /dev/null +++ b/g10/test.c @@ -0,0 +1,141 @@ +/* test.c - Infrastructure for unit tests. + * Copyright (C) 2015 g10 Code GmbH + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * GnuPG is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include +#include "gpg.h" + +/* A unit test consists of one or more tests. Tests can be broken + into groups and each group can consist of one or more tests. */ + +/* The number of test groups. */ +static int test_groups; +/* The current test group. */ +static char *test_group; + +/* Whether there was already a failure in the current test group. */ +static int current_test_group_failed; +/* The number of test groups with a failure. */ +static int test_groups_failed; + +/* The total number of tests. */ +static int tests; +/* The total number of tests that failed. */ +static int tests_failed; + +#define TEST_GROUP(description) \ + do { \ + test_group = (description); \ + test_groups ++; \ + current_test_group_failed = 0; \ + } while (0) + +#define STRINGIFY2(x) #x +#define STRINGIFY(x) STRINGIFY2(x) + +/* Execute a test. */ +#define TEST(description, test, expected) \ + do { \ + int test_result; \ + int expected_result; \ + \ + tests ++; \ + \ + printf ("%d. Checking %s...", \ + tests, (description) ?: ""); \ + fflush (stdout); \ + \ + test_result = (test); \ + expected_result = (expected); \ + \ + if (test_result == expected_result) \ + { \ + printf (" ok.\n"); \ + } \ + else \ + { \ + printf (" failed.\n"); \ + printf (" %s == %s failed.\n", \ + STRINGIFY(test), \ + STRINGIFY(expected)); \ + tests_failed ++; \ + if (! current_test_group_failed) \ + { \ + current_test_group_failed = 1; \ + test_groups_failed ++; \ + } \ + } \ + } while (0) + +/* Test that a condition evaluates to true. */ +#define TEST_P(description, test) \ + TEST(description, !!(test), 1) + +/* Like CHECK, but if the test fails, abort the program. */ +#define ASSERT(description, test, expected) \ + do { \ + int tests_failed_pre = tests_failed; \ + CHECK(description, test, expected); \ + if (tests_failed_pre != tests_failed) \ + exit (1); \ + } while (0) + +/* Call this if something went wrong. */ +#define ABORT(message) \ + do { \ + printf ("aborting..."); \ + if (message) \ + printf (" %s\n", (message)); \ + \ + exit(1); \ + } while (0) + +/* You need to fill this function in. */ +static void do_test (int argc, char *argv[]); + +static void +print_results (void) +{ + if (tests_failed == 0) + { + printf ("All %d tests passed.\n", tests); + exit (0); + } + else + { + printf ("%d of %d tests failed", + tests_failed, tests); + if (test_groups > 1) + printf (" (%d of %d groups)", + test_groups_failed, test_groups); + printf ("\n"); + + exit (1); + } +} + +int +main (int argc, char *argv[]) +{ + (void) test_group; + + do_test (argc, argv); + atexit (print_results); + + return tests_failed == 0; +} commit 60bc518645d3acfd4dcb79e61a2be6ce001e93aa Author: Neal H. Walfield Date: Mon Aug 31 13:57:07 2015 +0200 g10: Make the keyblock cache per-handle rather than global. * g10/keydb.c (keyblock_cache): Don't declare this variable. Instead... (struct keyblock_cache): ... turn its type into this first class object... (struct keydb_handle): ... and instantiate it once per database handle. Update all users. (keydb_rebuild_caches): Don't invalidate the keyblock cache. -- Signed-off-by: Neal H. Walfield . diff --git a/g10/keydb.c b/g10/keydb.c index 124e940..da18bc0 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -62,6 +62,28 @@ static struct resource_item all_resources[MAX_KEYDB_RESOURCES]; static int used_resources; static void *primary_keyring=NULL; + +/* This is a simple cache used to return the last result of a + successful fingerprint search. This works only for keybox resources + because (due to lack of a copy_keyblock function) we need to store + an image of the keyblock which is fortunately instantly available + for keyboxes. */ +enum keyblock_cache_states { + KEYBLOCK_CACHE_EMPTY, + KEYBLOCK_CACHE_PREPARED, + KEYBLOCK_CACHE_FILLED +}; + +struct keyblock_cache { + enum keyblock_cache_states state; + byte fpr[MAX_FINGERPRINT_LEN]; + iobuf_t iobuf; /* Image of the keyblock. */ + u32 *sigstatus; + int pk_no; + int uid_no; +}; + + struct keydb_handle { /* When we locked all of the resources in ACTIVE (using keyring_lock @@ -94,6 +116,10 @@ struct keydb_handle /* The number of resources in ACTIVE. */ int used; + /* Cache of the last found and parsed key block (only used for + keyboxes, not keyrings). */ + struct keyblock_cache keyblock_cache; + /* Copy of ALL_RESOURCES when keydb_new is called. */ struct resource_item active[MAX_KEYDB_RESOURCES]; }; @@ -126,27 +152,6 @@ struct kid_not_found_cache_bucket }; -/* This is a simple cache used to return the last result of a - successful fingerprint search. This works only for keybox resources - because (due to lack of a copy_keyblock function) we need to store - an image of the keyblock which is fortunately instantly available - for keyboxes. */ -enum keyblock_cache_states { - KEYBLOCK_CACHE_EMPTY, - KEYBLOCK_CACHE_PREPARED, - KEYBLOCK_CACHE_FILLED -}; - -struct { - enum keyblock_cache_states state; - byte fpr[MAX_FINGERPRINT_LEN]; - iobuf_t iobuf; /* Image of the keyblock. */ - u32 *sigstatus; - int pk_no; - int uid_no; -} keyblock_cache; - - static int lock_all (KEYDB_HANDLE hd); static void unlock_all (KEYDB_HANDLE hd); @@ -233,13 +238,13 @@ kid_not_found_flush (void) static void -keyblock_cache_clear (void) +keyblock_cache_clear (struct keydb_handle *hd) { - keyblock_cache.state = KEYBLOCK_CACHE_EMPTY; - xfree (keyblock_cache.sigstatus); - keyblock_cache.sigstatus = NULL; - iobuf_close (keyblock_cache.iobuf); - keyblock_cache.iobuf = NULL; + hd->keyblock_cache.state = KEYBLOCK_CACHE_EMPTY; + xfree (hd->keyblock_cache.sigstatus); + hd->keyblock_cache.sigstatus = NULL; + iobuf_close (hd->keyblock_cache.iobuf); + hd->keyblock_cache.iobuf = NULL; } @@ -1124,23 +1129,23 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb) if (DBG_CLOCK) log_clock ("keydb_get_keybock enter"); - if (keyblock_cache.state == KEYBLOCK_CACHE_FILLED) + if (hd->keyblock_cache.state == KEYBLOCK_CACHE_FILLED) { - err = iobuf_seek (keyblock_cache.iobuf, 0); + err = iobuf_seek (hd->keyblock_cache.iobuf, 0); if (err) { log_error ("keydb_get_keyblock: failed to rewind iobuf for cache\n"); - keyblock_cache_clear (); + keyblock_cache_clear (hd); } else { - err = parse_keyblock_image (keyblock_cache.iobuf, - keyblock_cache.pk_no, - keyblock_cache.uid_no, - keyblock_cache.sigstatus, + err = parse_keyblock_image (hd->keyblock_cache.iobuf, + hd->keyblock_cache.pk_no, + hd->keyblock_cache.uid_no, + hd->keyblock_cache.sigstatus, ret_kb); if (err) - keyblock_cache_clear (); + keyblock_cache_clear (hd); if (DBG_CLOCK) log_clock (err? "keydb_get_keyblock leave (cached, failed)" : "keydb_get_keyblock leave (cached)"); @@ -1171,13 +1176,13 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb) { err = parse_keyblock_image (iobuf, pk_no, uid_no, sigstatus, ret_kb); - if (!err && keyblock_cache.state == KEYBLOCK_CACHE_PREPARED) + if (!err && hd->keyblock_cache.state == KEYBLOCK_CACHE_PREPARED) { - keyblock_cache.state = KEYBLOCK_CACHE_FILLED; - keyblock_cache.sigstatus = sigstatus; - keyblock_cache.iobuf = iobuf; - keyblock_cache.pk_no = pk_no; - keyblock_cache.uid_no = uid_no; + hd->keyblock_cache.state = KEYBLOCK_CACHE_FILLED; + hd->keyblock_cache.sigstatus = sigstatus; + hd->keyblock_cache.iobuf = iobuf; + hd->keyblock_cache.pk_no = pk_no; + hd->keyblock_cache.uid_no = uid_no; } else { @@ -1189,8 +1194,8 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb) break; } - if (keyblock_cache.state != KEYBLOCK_CACHE_FILLED) - keyblock_cache_clear (); + if (hd->keyblock_cache.state != KEYBLOCK_CACHE_FILLED) + keyblock_cache_clear (hd); if (DBG_CLOCK) log_clock (err? "keydb_get_keyblock leave (failed)" @@ -1298,7 +1303,7 @@ keydb_update_keyblock (KEYDB_HANDLE hd, kbnode_t kb) return gpg_error (GPG_ERR_INV_ARG); kid_not_found_flush (); - keyblock_cache_clear (); + keyblock_cache_clear (hd); if (hd->found < 0 || hd->found >= hd->used) return gpg_error (GPG_ERR_VALUE_NOT_FOUND); @@ -1349,7 +1354,7 @@ keydb_insert_keyblock (KEYDB_HANDLE hd, kbnode_t kb) return gpg_error (GPG_ERR_INV_ARG); kid_not_found_flush (); - keyblock_cache_clear (); + keyblock_cache_clear (hd); if (opt.dry_run) return 0; @@ -1409,7 +1414,7 @@ keydb_delete_keyblock (KEYDB_HANDLE hd) return gpg_error (GPG_ERR_INV_ARG); kid_not_found_flush (); - keyblock_cache_clear (); + keyblock_cache_clear (hd); if (hd->found < 0 || hd->found >= hd->used) return gpg_error (GPG_ERR_VALUE_NOT_FOUND); @@ -1497,8 +1502,6 @@ keydb_rebuild_caches (int noisy) { int i, rc; - keyblock_cache_clear (); - for (i=0; i < used_resources; i++) { if (!keyring_is_writable (all_resources[i].token)) @@ -1537,7 +1540,7 @@ keydb_search_reset (KEYDB_HANDLE hd) if (!hd) return gpg_error (GPG_ERR_INV_ARG); - keyblock_cache_clear (); + keyblock_cache_clear (hd); if (DBG_CLOCK) log_clock ("keydb_search_reset"); @@ -1652,8 +1655,8 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, && ndesc == 1 && (desc[0].mode == KEYDB_SEARCH_MODE_FPR20 || desc[0].mode == KEYDB_SEARCH_MODE_FPR) - && keyblock_cache.state == KEYBLOCK_CACHE_FILLED - && !memcmp (keyblock_cache.fpr, desc[0].u.fpr, 20)) + && hd->keyblock_cache.state == KEYBLOCK_CACHE_FILLED + && !memcmp (hd->keyblock_cache.fpr, desc[0].u.fpr, 20)) { /* (DESCINDEX is already set). */ if (DBG_CLOCK) @@ -1694,14 +1697,14 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, ? gpg_error (GPG_ERR_NOT_FOUND) : rc); - keyblock_cache_clear (); + keyblock_cache_clear (hd); if (!hd->no_caching && !rc && ndesc == 1 && (desc[0].mode == KEYDB_SEARCH_MODE_FPR20 || desc[0].mode == KEYDB_SEARCH_MODE_FPR)) { - keyblock_cache.state = KEYBLOCK_CACHE_PREPARED; - memcpy (keyblock_cache.fpr, desc[0].u.fpr, 20); + hd->keyblock_cache.state = KEYBLOCK_CACHE_PREPARED; + memcpy (hd->keyblock_cache.fpr, desc[0].u.fpr, 20); } if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND ----------------------------------------------------------------------- Summary of changes: g10/Makefile.am | 9 ++- g10/getkey.c | 4 - g10/keydb.c | 111 +++++++++++++------------- g10/packet.h | 1 - g10/t-keydb-keyring.kbx | Bin 0 -> 5104 bytes g10/t-keydb.c | 87 ++++++++++++++++++++ g10/{gpgv.c => test-stubs.c} | 185 +------------------------------------------ g10/test.c | 141 +++++++++++++++++++++++++++++++++ g10/trustdb.c | 23 +++--- 9 files changed, 306 insertions(+), 255 deletions(-) create mode 100644 g10/t-keydb-keyring.kbx create mode 100644 g10/t-keydb.c copy g10/{gpgv.c => test-stubs.c} (60%) create mode 100644 g10/test.c hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Fri Sep 4 12:47:32 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Fri, 04 Sep 2015 12:47:32 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-261-ge97c62a Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via e97c62a4a687b56d00a2d0a63e072a977f8eb81c (commit) via e2785a2268702312529521df3bd2f4e6b43cea3a (commit) from c17f84bd02d7ee93845e92e20f6ddba814961588 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e97c62a4a687b56d00a2d0a63e072a977f8eb81c Author: Werner Koch Date: Fri Sep 4 12:39:56 2015 +0200 w32: Avoid a few compiler warnings. * cipher/cipher-selftest.c (_gcry_selftest_helper_cbc) (_gcry_selftest_helper_cfb, _gcry_selftest_helper_ctr): Mark variable as unused. * random/rndw32.c (slow_gatherer): Avoid signed pointer mismatch warning. * src/secmem.c (init_pool): Avoid unused variable warning. * tests/random.c (writen, readn): Include on if needed. Signed-off-by: Werner Koch diff --git a/cipher/cipher-selftest.c b/cipher/cipher-selftest.c index 470499f..cecbab7 100644 --- a/cipher/cipher-selftest.c +++ b/cipher/cipher-selftest.c @@ -131,6 +131,8 @@ _gcry_selftest_helper_cbc (const char *cipher, gcry_cipher_setkey_t setkey_func, syslog (LOG_USER|LOG_WARNING, "Libgcrypt warning: " "%s-CBC-%d test failed (plaintext mismatch)", cipher, blocksize * 8); +#else + (void)cipher; /* Not used. */ #endif return "selftest for CBC failed - see syslog for details"; } @@ -251,6 +253,8 @@ _gcry_selftest_helper_cfb (const char *cipher, gcry_cipher_setkey_t setkey_func, syslog (LOG_USER|LOG_WARNING, "Libgcrypt warning: " "%s-CFB-%d test failed (plaintext mismatch)", cipher, blocksize * 8); +#else + (void)cipher; /* Not used. */ #endif return "selftest for CFB failed - see syslog for details"; } @@ -379,6 +383,8 @@ _gcry_selftest_helper_ctr (const char *cipher, gcry_cipher_setkey_t setkey_func, syslog (LOG_USER|LOG_WARNING, "Libgcrypt warning: " "%s-CTR-%d test failed (plaintext mismatch)", cipher, blocksize * 8); +#else + (void)cipher; /* Not used. */ #endif return "selftest for CTR failed - see syslog for details"; } diff --git a/random/rndw32.c b/random/rndw32.c index 4ab1bca..1325b18 100644 --- a/random/rndw32.c +++ b/random/rndw32.c @@ -513,7 +513,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins), status = RegQueryValueEx (hKey, "ProductType", 0, NULL, szValue, &dwSize); - if (status == ERROR_SUCCESS && stricmp (szValue, "WinNT")) + if (status == ERROR_SUCCESS && stricmp ((char*)szValue, "WinNT")) { /* Note: There are (at least) three cases for ProductType: WinNT = NT Workstation, ServerNT = NT Server, LanmanNT = diff --git a/src/secmem.c b/src/secmem.c index d75c14c..2109bc2 100644 --- a/src/secmem.c +++ b/src/secmem.c @@ -363,8 +363,6 @@ lock_pool (void *p, size_t n) static void init_pool (size_t n) { - size_t pgsize; - long int pgsize_val; memblock_t *mb; pool_size = n; @@ -372,48 +370,54 @@ init_pool (size_t n) if (disable_secmem) log_bug ("secure memory is disabled"); -#if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) - pgsize_val = sysconf (_SC_PAGESIZE); -#elif defined(HAVE_GETPAGESIZE) - pgsize_val = getpagesize (); -#else - pgsize_val = -1; -#endif - pgsize = (pgsize_val != -1 && pgsize_val > 0)? pgsize_val:DEFAULT_PAGE_SIZE; - #if HAVE_MMAP - pool_size = (pool_size + pgsize - 1) & ~(pgsize - 1); -#ifdef MAP_ANONYMOUS - pool = mmap (0, pool_size, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); -#else /* map /dev/zero instead */ { - int fd; + size_t pgsize; + long int pgsize_val; + +# if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) + pgsize_val = sysconf (_SC_PAGESIZE); +# elif defined(HAVE_GETPAGESIZE) + pgsize_val = getpagesize (); +# else + pgsize_val = -1; +# endif + pgsize = (pgsize_val != -1 && pgsize_val > 0)? pgsize_val:DEFAULT_PAGE_SIZE; + + pool_size = (pool_size + pgsize - 1) & ~(pgsize - 1); +# ifdef MAP_ANONYMOUS + pool = mmap (0, pool_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +# else /* map /dev/zero instead */ + { + int fd; - fd = open ("/dev/zero", O_RDWR); - if (fd == -1) - { - log_error ("can't open /dev/zero: %s\n", strerror (errno)); - pool = (void *) -1; - } + fd = open ("/dev/zero", O_RDWR); + if (fd == -1) + { + log_error ("can't open /dev/zero: %s\n", strerror (errno)); + pool = (void *) -1; + } + else + { + pool = mmap (0, pool_size, + (PROT_READ | PROT_WRITE), MAP_PRIVATE, fd, 0); + close (fd); + } + } +# endif + if (pool == (void *) -1) + log_info ("can't mmap pool of %u bytes: %s - using malloc\n", + (unsigned) pool_size, strerror (errno)); else { - pool = mmap (0, pool_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); - close (fd); + pool_is_mmapped = 1; + pool_okay = 1; } } -#endif - if (pool == (void *) -1) - log_info ("can't mmap pool of %u bytes: %s - using malloc\n", - (unsigned) pool_size, strerror (errno)); - else - { - pool_is_mmapped = 1; - pool_okay = 1; - } +#endif /*HAVE_MMAP*/ -#endif if (!pool_okay) { pool = malloc (pool_size); diff --git a/tests/fipsdrv.c b/tests/fipsdrv.c index eef2ddd..b3da2a3 100644 --- a/tests/fipsdrv.c +++ b/tests/fipsdrv.c @@ -2358,14 +2358,14 @@ main (int argc, char **argv) { if (!(++count % 1000)) fprintf (stderr, PGM ": %lu random bytes so far\n", - (unsigned long int)count * sizeof buffer); + (unsigned long int)(count * sizeof buffer)); } } while (loop_mode); if (progress) fprintf (stderr, PGM ": %lu random bytes\n", - (unsigned long int)count * sizeof buffer); + (unsigned long int)(count * sizeof buffer)); deinit_external_rng_test (context); } diff --git a/tests/gchash.c b/tests/gchash.c index 7a2aad6..7ff99e0 100644 --- a/tests/gchash.c +++ b/tests/gchash.c @@ -109,7 +109,7 @@ main (int argc, char **argv) h = gcry_md_read(hd, 0); for (i = 0; i < gcry_md_get_algo_dlen (algo); i++) - printf("%02hhx", h[i]); + printf("%02x", h[i]); printf(" %s\n", *argv); gcry_md_reset(hd); diff --git a/tests/random.c b/tests/random.c index 10bf646..d7a624a 100644 --- a/tests/random.c +++ b/tests/random.c @@ -87,7 +87,7 @@ progress_cb (void *cb_data, const char *what, int printchar, } - +#ifndef HAVE_W32_SYSTEM static int writen (int fd, const void *buf, size_t nbytes) { @@ -110,7 +110,10 @@ writen (int fd, const void *buf, size_t nbytes) return 0; } +#endif /*!HAVE_W32_SYSTEM*/ + +#ifndef HAVE_W32_SYSTEM static int readn (int fd, void *buf, size_t buflen, size_t *ret_nread) { @@ -136,7 +139,7 @@ readn (int fd, void *buf, size_t buflen, size_t *ret_nread) *ret_nread = buflen - nleft; return 0; } - +#endif /*!HAVE_W32_SYSTEM*/ /* Check that forking won't return the same random. */ commit e2785a2268702312529521df3bd2f4e6b43cea3a Author: Werner Koch Date: Fri Sep 4 12:32:16 2015 +0200 w32: Fix alignment problem with AESNI on Windows >= 8 * cipher/cipher-selftest.c (_gcry_cipher_selftest_alloc_ctx): New. * cipher/rijndael.c (selftest_basic_128, selftest_basic_192) (selftest_basic_256): Allocate context on the heap. -- The stack alignment on Windows changed and because ld seems to limit stack variables to a 8 byte alignment (we request 16), we get bus errors from the selftests if AESNI is in use. GnuPG-bug-id: 2085 Signed-off-by: Werner Koch diff --git a/cipher/cipher-selftest.c b/cipher/cipher-selftest.c index 852368a..470499f 100644 --- a/cipher/cipher-selftest.c +++ b/cipher/cipher-selftest.c @@ -44,6 +44,29 @@ #endif +/* Return an allocated buffers of size CONTEXT_SIZE with an alignment + of 16. The caller must free that buffer using the address returned + at R_MEM. Returns NULL and sets ERRNO on failure. */ +void * +_gcry_cipher_selftest_alloc_ctx (const int context_size, unsigned char **r_mem) +{ + int offs; + unsigned int ctx_aligned_size, memsize; + + ctx_aligned_size = context_size + 15; + ctx_aligned_size -= ctx_aligned_size & 0xf; + + memsize = ctx_aligned_size + 16; + + *r_mem = xtrycalloc (1, memsize); + if (!*r_mem) + return NULL; + + offs = (16 - ((uintptr_t)*r_mem & 15)) & 15; + return (void*)(*r_mem + offs); +} + + /* Run the self-tests for -CBC-, tests bulk CBC decryption. Returns NULL on success. */ const char * diff --git a/cipher/cipher-selftest.h b/cipher/cipher-selftest.h index a70667a..a435080 100644 --- a/cipher/cipher-selftest.h +++ b/cipher/cipher-selftest.h @@ -40,6 +40,11 @@ typedef void (*gcry_cipher_bulk_ctr_enc_t)(void *context, unsigned char *iv, const void *inbuf_arg, size_t nblocks); +/* Helper function to allocate an aligned context for selftests. */ +void *_gcry_cipher_selftest_alloc_ctx (const int context_size, + unsigned char **r_mem); + + /* Helper function for bulk CBC decryption selftest */ const char * _gcry_selftest_helper_cbc (const char *cipher, gcry_cipher_setkey_t setkey, diff --git a/cipher/rijndael.c b/cipher/rijndael.c index eff59c2..0130924 100644 --- a/cipher/rijndael.c +++ b/cipher/rijndael.c @@ -1358,7 +1358,8 @@ _gcry_aes_ocb_auth (gcry_cipher_hd_t c, const void *abuf_arg, size_t nblocks) static const char* selftest_basic_128 (void) { - RIJNDAEL_context ctx; + RIJNDAEL_context *ctx; + unsigned char *ctxmem; unsigned char scratch[16]; /* The test vectors are from the AES supplied ones; more or less @@ -1401,11 +1402,21 @@ selftest_basic_128 (void) }; #endif - rijndael_setkey (&ctx, key_128, sizeof (key_128)); - rijndael_encrypt (&ctx, scratch, plaintext_128); + /* Because gcc/ld can only align the CTX struct on 8 bytes on the + stack, we need to allocate that context on the heap. */ + ctx = _gcry_cipher_selftest_alloc_ctx (sizeof *ctx, &ctxmem); + if (!ctx) + return "failed to allocate memory"; + + rijndael_setkey (ctx, key_128, sizeof (key_128)); + rijndael_encrypt (ctx, scratch, plaintext_128); if (memcmp (scratch, ciphertext_128, sizeof (ciphertext_128))) - return "AES-128 test encryption failed."; - rijndael_decrypt (&ctx, scratch, scratch); + { + xfree (ctxmem); + return "AES-128 test encryption failed."; + } + rijndael_decrypt (ctx, scratch, scratch); + xfree (ctxmem); if (memcmp (scratch, plaintext_128, sizeof (plaintext_128))) return "AES-128 test decryption failed."; @@ -1416,7 +1427,8 @@ selftest_basic_128 (void) static const char* selftest_basic_192 (void) { - RIJNDAEL_context ctx; + RIJNDAEL_context *ctx; + unsigned char *ctxmem; unsigned char scratch[16]; static unsigned char plaintext_192[16] = @@ -1436,11 +1448,18 @@ selftest_basic_192 (void) 0x12,0x13,0x1A,0xC7,0xC5,0x47,0x88,0xAA }; - rijndael_setkey (&ctx, key_192, sizeof(key_192)); - rijndael_encrypt (&ctx, scratch, plaintext_192); + ctx = _gcry_cipher_selftest_alloc_ctx (sizeof *ctx, &ctxmem); + if (!ctx) + return "failed to allocate memory"; + rijndael_setkey (ctx, key_192, sizeof(key_192)); + rijndael_encrypt (ctx, scratch, plaintext_192); if (memcmp (scratch, ciphertext_192, sizeof (ciphertext_192))) - return "AES-192 test encryption failed."; - rijndael_decrypt (&ctx, scratch, scratch); + { + xfree (ctxmem); + return "AES-192 test encryption failed."; + } + rijndael_decrypt (ctx, scratch, scratch); + xfree (ctxmem); if (memcmp (scratch, plaintext_192, sizeof (plaintext_192))) return "AES-192 test decryption failed."; @@ -1452,7 +1471,8 @@ selftest_basic_192 (void) static const char* selftest_basic_256 (void) { - RIJNDAEL_context ctx; + RIJNDAEL_context *ctx; + unsigned char *ctxmem; unsigned char scratch[16]; static unsigned char plaintext_256[16] = @@ -1473,11 +1493,18 @@ selftest_basic_256 (void) 0x9A,0xCF,0x72,0x80,0x86,0x04,0x0A,0xE3 }; - rijndael_setkey (&ctx, key_256, sizeof(key_256)); - rijndael_encrypt (&ctx, scratch, plaintext_256); + ctx = _gcry_cipher_selftest_alloc_ctx (sizeof *ctx, &ctxmem); + if (!ctx) + return "failed to allocate memory"; + rijndael_setkey (ctx, key_256, sizeof(key_256)); + rijndael_encrypt (ctx, scratch, plaintext_256); if (memcmp (scratch, ciphertext_256, sizeof (ciphertext_256))) - return "AES-256 test encryption failed."; - rijndael_decrypt (&ctx, scratch, scratch); + { + xfree (ctxmem); + return "AES-256 test encryption failed."; + } + rijndael_decrypt (ctx, scratch, scratch); + xfree (ctxmem); if (memcmp (scratch, plaintext_256, sizeof (plaintext_256))) return "AES-256 test decryption failed."; ----------------------------------------------------------------------- Summary of changes: cipher/cipher-selftest.c | 29 +++++++++++++++++++ cipher/cipher-selftest.h | 5 ++++ cipher/rijndael.c | 57 +++++++++++++++++++++++++++---------- random/rndw32.c | 2 +- src/secmem.c | 74 +++++++++++++++++++++++++----------------------- tests/fipsdrv.c | 4 +-- tests/gchash.c | 2 +- tests/random.c | 7 +++-- 8 files changed, 124 insertions(+), 56 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org From cvs at cvs.gnupg.org Fri Sep 4 13:04:20 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Fri, 04 Sep 2015 13:04:20 +0200 Subject: [git] GCRYPT - branch, LIBGCRYPT-1-6-BRANCH, updated. libgcrypt-1.6.3-8-gb85c8d6 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, LIBGCRYPT-1-6-BRANCH has been updated via b85c8d6645039fc9d403791750510e439731d479 (commit) via 9f32789ee81c2db90a977ff3b401411507ffba82 (commit) from 842535b7ea0a9811405e0feae0e9ffb349ee5360 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b85c8d6645039fc9d403791750510e439731d479 Author: Werner Koch Date: Mon Aug 31 23:13:27 2015 +0200 rsa: Add verify after sign to avoid Lenstra's CRT attack. * cipher/rsa.c (rsa_sign): Check the CRT. -- Failures in the computation of the CRT (e.g. due faulty hardware) can lead to a leak of the private key. The standard precaution against this is to verify the signature after signing. GnuPG does this itself and even has an option to disable this. However, the low performance impact of this extra precaution suggest that it should always be done and Libgcrypt is the right place here. For decryption is not done because the application will detect the failure due to garbled plaintext and in any case no key derived material will be send to the user. Signed-off-by: Werner Koch diff --git a/cipher/rsa.c b/cipher/rsa.c index 9a8d235..0b98b6a 100644 --- a/cipher/rsa.c +++ b/cipher/rsa.c @@ -1112,7 +1112,9 @@ rsa_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_data, gcry_sexp_t keyparms) struct pk_encoding_ctx ctx; gcry_mpi_t data = NULL; RSA_secret_key sk = {NULL, NULL, NULL, NULL, NULL, NULL}; + RSA_public_key pk; gcry_mpi_t sig = NULL; + gcry_mpi_t result = NULL; _gcry_pk_util_init_encoding_ctx (&ctx, PUBKEY_OP_SIGN, rsa_get_nbits (keyparms)); @@ -1148,11 +1150,25 @@ rsa_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_data, gcry_sexp_t keyparms) } } - /* Do RSA computation and build the result. */ + /* Do RSA computation. */ sig = mpi_new (0); secret (sig, data, &sk); if (DBG_CIPHER) log_printmpi ("rsa_sign res", sig); + + /* Check that the created signature is good. This detects a failure + of the CRT algorithm (Lenstra's attack on RSA's use of the CRT). */ + result = mpi_new (0); + pk.n = sk.n; + pk.e = sk.e; + public (result, sig, &pk); + if (mpi_cmp (result, data)) + { + rc = GPG_ERR_BAD_SIGNATURE; + goto leave; + } + + /* Convert the result. */ if ((ctx.flags & PUBKEY_FLAG_FIXEDLEN)) { /* We need to make sure to return the correct length to avoid @@ -1172,6 +1188,7 @@ rsa_sign (gcry_sexp_t *r_sig, gcry_sexp_t s_data, gcry_sexp_t keyparms) leave: + _gcry_mpi_release (result); _gcry_mpi_release (sig); _gcry_mpi_release (sk.n); _gcry_mpi_release (sk.e); commit 9f32789ee81c2db90a977ff3b401411507ffba82 Author: Werner Koch Date: Fri Sep 4 12:32:16 2015 +0200 w32: Fix alignment problem with AESNI on Windows >= 8 * cipher/cipher-selftest.c (_gcry_cipher_selftest_alloc_ctx): New. * cipher/rijndael.c (selftest_basic_128, selftest_basic_192) (selftest_basic_256): Allocate context on the heap. -- The stack alignment on Windows changed and because ld seems to limit stack variables to a 8 byte alignment (we request 16), we get bus errors from the selftests if AESNI is in use. GnuPG-bug-id: 2085 Signed-off-by: Werner Koch diff --git a/cipher/cipher-selftest.c b/cipher/cipher-selftest.c index bb33d94..0852332 100644 --- a/cipher/cipher-selftest.c +++ b/cipher/cipher-selftest.c @@ -44,6 +44,29 @@ #endif +/* Return an allocated buffers of size CONTEXT_SIZE with an alignment + of 16. The caller must free that buffer using the address returned + at R_MEM. Returns NULL and sets ERRNO on failure. */ +void * +_gcry_cipher_selftest_alloc_ctx (const int context_size, unsigned char **r_mem) +{ + int offs; + unsigned int ctx_aligned_size, memsize; + + ctx_aligned_size = context_size + 15; + ctx_aligned_size -= ctx_aligned_size & 0xf; + + memsize = ctx_aligned_size + 16; + + *r_mem = xtrycalloc (1, memsize); + if (!*r_mem) + return NULL; + + offs = (16 - ((uintptr_t)*r_mem & 15)) & 15; + return (void*)(*r_mem + offs); +} + + /* Run the self-tests for -CBC-, tests bulk CBC decryption. Returns NULL on success. */ const char * diff --git a/cipher/cipher-selftest.h b/cipher/cipher-selftest.h index 3a0fe98..885c317 100644 --- a/cipher/cipher-selftest.h +++ b/cipher/cipher-selftest.h @@ -40,6 +40,11 @@ typedef void (*gcry_cipher_bulk_ctr_enc_t)(void *context, unsigned char *iv, const void *inbuf_arg, size_t nblocks); +/* Helper function to allocate an aligned context for selftests. */ +void *_gcry_cipher_selftest_alloc_ctx (const int context_size, + unsigned char **r_mem); + + /* Helper function for bulk CBC decryption selftest */ const char * _gcry_selftest_helper_cbc (const char *cipher, gcry_cipher_setkey_t setkey, diff --git a/cipher/rijndael.c b/cipher/rijndael.c index 8019f0a..ac96e7b 100644 --- a/cipher/rijndael.c +++ b/cipher/rijndael.c @@ -2338,7 +2338,8 @@ _gcry_aes_cbc_dec (void *context, unsigned char *iv, static const char* selftest_basic_128 (void) { - RIJNDAEL_context ctx; + RIJNDAEL_context *ctx; + unsigned char *ctxmem; unsigned char scratch[16]; /* The test vectors are from the AES supplied ones; more or less @@ -2381,11 +2382,21 @@ selftest_basic_128 (void) }; #endif - rijndael_setkey (&ctx, key_128, sizeof (key_128)); - rijndael_encrypt (&ctx, scratch, plaintext_128); + /* Because gcc/ld can only align the CTX struct on 8 bytes on the + stack, we need to allocate that context on the heap. */ + ctx = _gcry_cipher_selftest_alloc_ctx (sizeof *ctx, &ctxmem); + if (!ctx) + return "failed to allocate memory"; + + rijndael_setkey (ctx, key_128, sizeof (key_128)); + rijndael_encrypt (ctx, scratch, plaintext_128); if (memcmp (scratch, ciphertext_128, sizeof (ciphertext_128))) - return "AES-128 test encryption failed."; - rijndael_decrypt (&ctx, scratch, scratch); + { + xfree (ctxmem); + return "AES-128 test encryption failed."; + } + rijndael_decrypt (ctx, scratch, scratch); + xfree (ctxmem); if (memcmp (scratch, plaintext_128, sizeof (plaintext_128))) return "AES-128 test decryption failed."; @@ -2396,7 +2407,8 @@ selftest_basic_128 (void) static const char* selftest_basic_192 (void) { - RIJNDAEL_context ctx; + RIJNDAEL_context *ctx; + unsigned char *ctxmem; unsigned char scratch[16]; static unsigned char plaintext_192[16] = @@ -2416,11 +2428,18 @@ selftest_basic_192 (void) 0x12,0x13,0x1A,0xC7,0xC5,0x47,0x88,0xAA }; - rijndael_setkey (&ctx, key_192, sizeof(key_192)); - rijndael_encrypt (&ctx, scratch, plaintext_192); + ctx = _gcry_cipher_selftest_alloc_ctx (sizeof *ctx, &ctxmem); + if (!ctx) + return "failed to allocate memory"; + rijndael_setkey (ctx, key_192, sizeof(key_192)); + rijndael_encrypt (ctx, scratch, plaintext_192); if (memcmp (scratch, ciphertext_192, sizeof (ciphertext_192))) - return "AES-192 test encryption failed."; - rijndael_decrypt (&ctx, scratch, scratch); + { + xfree (ctxmem); + return "AES-192 test encryption failed."; + } + rijndael_decrypt (ctx, scratch, scratch); + xfree (ctxmem); if (memcmp (scratch, plaintext_192, sizeof (plaintext_192))) return "AES-192 test decryption failed."; @@ -2432,7 +2451,8 @@ selftest_basic_192 (void) static const char* selftest_basic_256 (void) { - RIJNDAEL_context ctx; + RIJNDAEL_context *ctx; + unsigned char *ctxmem; unsigned char scratch[16]; static unsigned char plaintext_256[16] = @@ -2453,11 +2473,18 @@ selftest_basic_256 (void) 0x9A,0xCF,0x72,0x80,0x86,0x04,0x0A,0xE3 }; - rijndael_setkey (&ctx, key_256, sizeof(key_256)); - rijndael_encrypt (&ctx, scratch, plaintext_256); + ctx = _gcry_cipher_selftest_alloc_ctx (sizeof *ctx, &ctxmem); + if (!ctx) + return "failed to allocate memory"; + rijndael_setkey (ctx, key_256, sizeof(key_256)); + rijndael_encrypt (ctx, scratch, plaintext_256); if (memcmp (scratch, ciphertext_256, sizeof (ciphertext_256))) - return "AES-256 test encryption failed."; - rijndael_decrypt (&ctx, scratch, scratch); + { + xfree (ctxmem); + return "AES-256 test encryption failed."; + } + rijndael_decrypt (ctx, scratch, scratch); + xfree (ctxmem); if (memcmp (scratch, plaintext_256, sizeof (plaintext_256))) return "AES-256 test decryption failed."; ----------------------------------------------------------------------- Summary of changes: cipher/cipher-selftest.c | 23 +++++++++++++++++++ cipher/cipher-selftest.h | 5 +++++ cipher/rijndael.c | 57 +++++++++++++++++++++++++++++++++++------------- cipher/rsa.c | 19 +++++++++++++++- 4 files changed, 88 insertions(+), 16 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org From cvs at cvs.gnupg.org Mon Sep 7 07:05:49 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Mon, 07 Sep 2015 07:05:49 +0200 Subject: [git] GnuPG - branch, master, updated. gnupg-2.1.7-75-gf10b427 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, master has been updated via f10b427d0e2be333776fee2df8150145da36e587 (commit) via fd689e85423d0d80d725f0315c52d94f0e9766f8 (commit) from bd0c902f1de46eda03a065da41487e7e01ab4c50 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f10b427d0e2be333776fee2df8150145da36e587 Author: NIIBE Yutaka Date: Mon Sep 7 13:49:47 2015 +0900 scd: Force key attribute change for writekey. * scd/app-openpgp.c (change_rsa_keyattr): New. (change_keyattr_from_string): Use change_rsa_keyattr. (rsa_writekey): Call change_rsa_keyattr when different size. (ecc_writekey): Try to change key attribute. diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index f7ad274..8f7c8b0 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -2729,6 +2729,43 @@ change_keyattr (app_t app, int keyno, const unsigned char *buf, size_t buflen, } +static gpg_error_t +change_rsa_keyattr (app_t app, int keyno, unsigned int nbits, + gpg_error_t (*pincb)(void*, const char *, char **), + void *pincb_arg) +{ + gpg_error_t err = 0; + unsigned char *buf; + size_t buflen; + void *relptr; + + /* Read the current attributes into a buffer. */ + relptr = get_one_do (app, 0xC1+keyno, &buf, &buflen, NULL); + if (!relptr) + err = gpg_error (GPG_ERR_CARD); + else if (buflen < 6 || buf[0] != PUBKEY_ALGO_RSA) + { + /* Attriutes too short or not an RSA key. */ + xfree (relptr); + err = gpg_error (GPG_ERR_CARD); + } + else + { + /* We only change n_bits and don't touch anything else. Before we + do so, we round up NBITS to a sensible way in the same way as + gpg's key generation does it. This may help to sort out problems + with a few bits too short keys. */ + nbits = ((nbits + 31) / 32) * 32; + buf[1] = (nbits >> 8); + buf[2] = nbits; + err = change_keyattr (app, keyno, buf, buflen, pincb, pincb_arg); + xfree (relptr); + } + + return err; +} + + /* Helper to process an setattr command for name KEY-ATTR. In (VALUE,VALUELEN), it expects following string: RSA: "--force rsa" @@ -2779,36 +2816,7 @@ change_keyattr_from_string (app_t app, else if (nbits > 4096) err = gpg_error (GPG_ERR_TOO_LARGE); else - { - unsigned char *buf; - size_t buflen; - void *relptr; - - /* Read the current attributes into a buffer. */ - relptr = get_one_do (app, 0xC1+keyno, &buf, &buflen, NULL); - if (!relptr) - { - err = gpg_error (GPG_ERR_CARD); - goto leave; - } - if (buflen < 6 || buf[0] != PUBKEY_ALGO_RSA) - { - /* Attriutes too short or not an RSA key. */ - xfree (relptr); - err = gpg_error (GPG_ERR_CARD); - goto leave; - } - - /* We only change n_bits and don't touch anything else. Before we - do so, we round up NBITS to a sensible way in the same way as - gpg's key generation does it. This may help to sort out problems - with a few bits too short keys. */ - nbits = ((nbits + 31) / 32) * 32; - buf[1] = (nbits >> 8); - buf[2] = nbits; - err = change_keyattr (app, keyno, buf, buflen, pincb, pincb_arg); - xfree (relptr); - } + err = change_rsa_keyattr (app, keyno, nbits, pincb, pincb_arg); } else if (algo == PUBKEY_ALGO_ECDH || algo == PUBKEY_ALGO_ECDSA || algo == PUBKEY_ALGO_EDDSA) @@ -2971,6 +2979,14 @@ rsa_writekey (app_t app, gpg_error_t (*pincb)(void*, const char *, char **), if (opt.verbose) log_info ("RSA modulus size is %u bits (%u bytes)\n", nbits, (unsigned int)rsa_n_len); + if (nbits && nbits != maxbits + && app->app_local->extcap.algo_attr_change) + { + /* Try to switch the key to a new length. */ + err = change_rsa_keyattr (app, keyno, nbits, pincb, pincb_arg); + if (!err) + maxbits = app->app_local->keyattr[keyno].rsa.n_bits; + } if (nbits != maxbits) { log_error (_("RSA modulus missing or not of size %d bits\n"), @@ -3327,9 +3343,22 @@ ecc_writekey (app_t app, gpg_error_t (*pincb)(void*, const char *, char **), || app->app_local->keyattr[keyno].ecc.oid != oidstr || app->app_local->keyattr[keyno].ecc.flags != flag_djb_tweak) { - log_error ("key attribute on card doesn't match\n"); - err = gpg_error (GPG_ERR_INV_VALUE); - goto leave; + if (app->app_local->extcap.algo_attr_change) + { + unsigned char keyattr[oid_len]; + + keyattr[0] = algo; + memcpy (keyattr+1, oidbuf+1, oid_len-1); + err = change_keyattr (app, keyno, keyattr, oid_len, pincb, pincb_arg); + if (err) + goto leave; + } + else + { + log_error ("key attribute on card doesn't match\n"); + err = gpg_error (GPG_ERR_INV_VALUE); + goto leave; + } } if (opt.verbose) commit fd689e85423d0d80d725f0315c52d94f0e9766f8 Author: NIIBE Yutaka Date: Mon Sep 7 13:09:01 2015 +0900 scd: KEYNO cleanup. * scd/app-openpgp.c (get_public_key, send_keypair_info, do_readkey) (change_keyattr, change_keyattr_from_string, ecc_writekey, do_genkey) (compare_fingerprint, check_against_given_fingerprint): KEYNO starts from 0. diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 461c710..f7ad274 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -1224,7 +1224,7 @@ retrieve_key_material (FILE *fp, const char *hexkeyid, the APP handle. On error that field gets cleared. If we already know about the public key we will just return. Note that this does not mean a key is available; this is soley indicated by the - presence of the app->app_local->pk[KEYNO-1].key field. + presence of the app->app_local->pk[KEYNO].key field. Note that GnuPG 1.x does not need this and it would be too time consuming to send it just for the fun of it. However, given that we @@ -1246,9 +1246,8 @@ get_public_key (app_t app, int keyno) gcry_sexp_t s_pkey; size_t len; - if (keyno < 1 || keyno > 3) + if (keyno < 0 || keyno > 2) return gpg_error (GPG_ERR_INV_ID); - keyno--; /* Already cached? */ if (app->app_local->pk[keyno].read_done) @@ -1475,11 +1474,12 @@ get_public_key (app_t app, int keyno) -/* Send the KEYPAIRINFO back. KEYNO needs to be in the range [1,3]. +/* Send the KEYPAIRINFO back. KEY needs to be in the range [1,3]. This is used by the LEARN command. */ static gpg_error_t -send_keypair_info (app_t app, ctrl_t ctrl, int keyno) +send_keypair_info (app_t app, ctrl_t ctrl, int key) { + int keyno = key - 1; gpg_error_t err = 0; /* Note that GnuPG 1.x does not need this and it would be too time consuming to send it just for the fun of it. */ @@ -1492,19 +1492,19 @@ send_keypair_info (app_t app, ctrl_t ctrl, int keyno) if (err) goto leave; - assert (keyno >= 1 && keyno <= 3); - if (!app->app_local->pk[keyno-1].key) + assert (keyno >= 0 && keyno <= 2); + if (!app->app_local->pk[keyno].key) goto leave; /* No such key - ignore. */ - err = keygrip_from_canon_sexp (app->app_local->pk[keyno-1].key, - app->app_local->pk[keyno-1].keylen, + err = keygrip_from_canon_sexp (app->app_local->pk[keyno].key, + app->app_local->pk[keyno].keylen, grip); if (err) goto leave; bin2hex (grip, 20, gripstr); - sprintf (idbuf, "OPENPGP.%d", keyno); + sprintf (idbuf, "OPENPGP.%d", keyno+1); send_status_info (ctrl, "KEYPAIRINFO", gripstr, 40, idbuf, strlen (idbuf), @@ -1567,11 +1567,11 @@ do_readkey (app_t app, const char *keyid, unsigned char **pk, size_t *pklen) unsigned char *buf; if (!strcmp (keyid, "OPENPGP.1")) - keyno = 1; + keyno = 0; else if (!strcmp (keyid, "OPENPGP.2")) - keyno = 2; + keyno = 1; else if (!strcmp (keyid, "OPENPGP.3")) - keyno = 3; + keyno = 2; else return gpg_error (GPG_ERR_INV_ID); @@ -1579,10 +1579,10 @@ do_readkey (app_t app, const char *keyid, unsigned char **pk, size_t *pklen) if (err) return err; - buf = app->app_local->pk[keyno-1].key; + buf = app->app_local->pk[keyno].key; if (!buf) return gpg_error (GPG_ERR_NO_PUBKEY); - *pklen = app->app_local->pk[keyno-1].keylen;; + *pklen = app->app_local->pk[keyno].keylen;; *pk = xtrymalloc (*pklen); if (!*pk) { @@ -2731,8 +2731,8 @@ change_keyattr (app_t app, int keyno, const unsigned char *buf, size_t buflen, /* Helper to process an setattr command for name KEY-ATTR. In (VALUE,VALUELEN), it expects following string: - RSA: "--force rsa" - ECC: "--force " + RSA: "--force rsa" + ECC: "--force " */ static gpg_error_t change_keyattr_from_string (app_t app, @@ -2742,7 +2742,7 @@ change_keyattr_from_string (app_t app, { gpg_error_t err = 0; char *string; - int keyno, algo; + int key, keyno, algo; int n = 0; /* VALUE is expected to be a string but not guaranteed to be @@ -2756,14 +2756,15 @@ change_keyattr_from_string (app_t app, /* Because this function deletes the key we require the string "--force" in the data to make clear that something serious might happen. */ - sscanf (string, " --force %d %d %n", &keyno, &algo, &n); + sscanf (string, " --force %d %d %n", &key, &algo, &n); if (n < 13) { err = gpg_error (GPG_ERR_INV_DATA); goto leave; } - if (keyno < 1 || keyno > 3) + keyno = key - 1; + if (keyno < 0 || keyno > 2) err = gpg_error (GPG_ERR_INV_ID); else if (algo == PUBKEY_ALGO_RSA) { @@ -2805,7 +2806,7 @@ change_keyattr_from_string (app_t app, nbits = ((nbits + 31) / 32) * 32; buf[1] = (nbits >> 8); buf[2] = nbits; - err = change_keyattr (app, keyno-1, buf, buflen, pincb, pincb_arg); + err = change_keyattr (app, keyno, buf, buflen, pincb, pincb_arg); xfree (relptr); } } @@ -2813,29 +2814,29 @@ change_keyattr_from_string (app_t app, || algo == PUBKEY_ALGO_EDDSA) { const char *oidstr; + gcry_mpi_t oid; + const unsigned char *oidbuf; + size_t oid_len; oidstr = openpgp_curve_to_oid (string+n, NULL); if (!oidstr) - err = gpg_error (GPG_ERR_INV_DATA); - else { - gcry_mpi_t m; - - err = openpgp_oid_from_str (oidstr, &m); - if (!err) - { - unsigned int len; - const unsigned char *buf = gcry_mpi_get_opaque (m, &len); - - /* We have enough room at STRING. */ - len = buf[0]; - string[0] = algo; - memcpy (string+1, buf+1, len++); - err = change_keyattr (app, keyno-1, string, len, - pincb, pincb_arg); - gcry_mpi_release (m); - } + err = gpg_error (GPG_ERR_INV_DATA); + goto leave; } + + err = openpgp_oid_from_str (oidstr, &oid); + if (err) + goto leave; + + oidbuf = gcry_mpi_get_opaque (oid, &n); + oid_len = (n+7)/8; + + /* We have enough room at STRING. */ + string[0] = algo; + memcpy (string+1, oidbuf+1, oid_len-1); + err = change_keyattr (app, keyno, string, oid_len, pincb, pincb_arg); + gcry_mpi_release (oid); } else err = gpg_error (GPG_ERR_PUBKEY_ALGO); @@ -3167,6 +3168,11 @@ ecc_writekey (app_t app, gpg_error_t (*pincb)(void*, const char *, char **), const char *oidstr = NULL; int flag_djb_tweak = 0; int algo; + gcry_mpi_t oid; + const unsigned char *oidbuf = NULL; + unsigned int n; + size_t oid_len; + unsigned char fprbuf[20]; /* (private-key(ecc(curve%s)(q%m)(d%m))(created-at%d)): curve = "NIST P-256" */ @@ -3305,6 +3311,18 @@ ecc_writekey (app_t app, gpg_error_t (*pincb)(void*, const char *, char **), else algo = PUBKEY_ALGO_ECDSA; + err = openpgp_oid_from_str (oidstr, &oid); + if (err) + goto leave; + oidbuf = gcry_mpi_get_opaque (oid, &n); + oid_len = (n+7)/8; + if (!oidbuf) + { + err = gpg_error_from_syserror (); + gcry_mpi_release (oid); + goto leave; + } + if (app->app_local->keyattr[keyno].key_type != KEY_TYPE_ECC || app->app_local->keyattr[keyno].ecc.oid != oidstr || app->app_local->keyattr[keyno].ecc.flags != flag_djb_tweak) @@ -3364,33 +3382,13 @@ ecc_writekey (app_t app, gpg_error_t (*pincb)(void*, const char *, char **), log_error (_("failed to store the key: %s\n"), gpg_strerror (err)); goto leave; } - else - { - gcry_mpi_t oid; - const unsigned char *oidbuf; - unsigned int n; - size_t oid_len; - unsigned char fprbuf[20]; - err = openpgp_oid_from_str (oidstr, &oid); - if (err) - goto leave; - - oidbuf = gcry_mpi_get_opaque (oid, &n); - oid_len = (n+7)/8; - if (!oidbuf) - { - err = gpg_error_from_syserror (); - gcry_mpi_release (oid); - goto leave; - } - err = store_fpr (app, keyno, created_at, fprbuf, algo, - oidbuf, oid_len, ecc_q, ecc_q_len, - "\x03\x01\x08\x07", (size_t)4); - gcry_mpi_release (oid); - } + err = store_fpr (app, keyno, created_at, fprbuf, algo, oidbuf, oid_len, + ecc_q, ecc_q_len, "\x03\x01\x08\x07", (size_t)4); leave: + if (oidbuf) + gcry_mpi_release (oid); return err; } @@ -3486,16 +3484,15 @@ do_genkey (app_t app, ctrl_t ctrl, const char *keynostr, unsigned int flags, unsigned char *buffer = NULL; size_t buflen, keydatalen, mlen, elen; time_t created_at; - int keyno = atoi (keynostr); + int keyno = atoi (keynostr) - 1; int force = (flags & 1); time_t start_at; int exmode; int le_value; unsigned int keybits; - if (keyno < 1 || keyno > 3) + if (keyno < 0 || keyno > 2) return gpg_error (GPG_ERR_INV_ID); - keyno--; /* We flush the cache to increase the traffic before a key generation. This _might_ help a card to gather more entropy. */ @@ -3645,7 +3642,7 @@ compare_fingerprint (app_t app, int keyno, unsigned char *sha1fpr) size_t buflen, n; int rc, i; - assert (keyno >= 1 && keyno <= 3); + assert (keyno >= 0 && keyno <= 2); rc = get_cached_data (app, 0x006E, &buffer, &buflen, 0, 0); if (rc) @@ -3660,7 +3657,7 @@ compare_fingerprint (app_t app, int keyno, unsigned char *sha1fpr) log_error (_("error reading fingerprint DO\n")); return gpg_error (GPG_ERR_GENERAL); } - fpr += (keyno-1)*20; + fpr += keyno*20; for (i=0; i < 20; i++) if (sha1fpr[i] != fpr[i]) { @@ -3679,7 +3676,7 @@ compare_fingerprint (app_t app, int keyno, unsigned char *sha1fpr) gpg has not been updated. If there is no fingerprint we assume that this is okay. */ static gpg_error_t -check_against_given_fingerprint (app_t app, const char *fpr, int keyno) +check_against_given_fingerprint (app_t app, const char *fpr, int key) { unsigned char tmp[20]; const char *s; @@ -3696,7 +3693,7 @@ check_against_given_fingerprint (app_t app, const char *fpr, int keyno) for (s=fpr, n=0; n < 20; s += 2, n++) tmp[n] = xtoi_2 (s); - return compare_fingerprint (app, keyno, tmp); + return compare_fingerprint (app, key-1, tmp); } ----------------------------------------------------------------------- Summary of changes: scd/app-openpgp.c | 230 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 128 insertions(+), 102 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Mon Sep 7 14:08:12 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 07 Sep 2015 14:08:12 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-262-g3a3d541 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 3a3d5410cc83f7069c7cb1ab384905f382292d32 (commit) from e97c62a4a687b56d00a2d0a63e072a977f8eb81c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3a3d5410cc83f7069c7cb1ab384905f382292d32 Author: Werner Koch Date: Mon Sep 7 14:02:09 2015 +0200 Improve GCRYCTL_DISABLE_PRIV_DROP by also disabling cap_ calls. * src/secmem.c (lock_pool, secmem_init): Do not call any cap_ functions if NO_PRIV_DROP is set. Signed-off-by: Werner Koch diff --git a/src/secmem.c b/src/secmem.c index 2109bc2..c4e8414 100644 --- a/src/secmem.c +++ b/src/secmem.c @@ -245,15 +245,21 @@ lock_pool (void *p, size_t n) { cap_t cap; - cap = cap_from_text ("cap_ipc_lock+ep"); - cap_set_proc (cap); - cap_free (cap); + if (!no_priv_drop) + { + cap = cap_from_text ("cap_ipc_lock+ep"); + cap_set_proc (cap); + cap_free (cap); + } err = no_mlock? 0 : mlock (p, n); if (err && errno) err = errno; - cap = cap_from_text ("cap_ipc_lock+p"); - cap_set_proc (cap); - cap_free(cap); + if (!no_priv_drop) + { + cap = cap_from_text ("cap_ipc_lock+p"); + cap_set_proc (cap); + cap_free(cap); + } } if (err) @@ -485,13 +491,14 @@ secmem_init (size_t n) { #ifdef USE_CAPABILITIES /* drop all capabilities */ - { - cap_t cap; + if (!no_priv_drop) + { + cap_t cap; - cap = cap_from_text ("all-eip"); - cap_set_proc (cap); - cap_free (cap); - } + cap = cap_from_text ("all-eip"); + cap_set_proc (cap); + cap_free (cap); + } #elif !defined(HAVE_DOSISH_SYSTEM) uid_t uid; @@ -539,7 +546,7 @@ _gcry_secmem_init (size_t n) gcry_err_code_t _gcry_secmem_module_init () { - /* No anymore needed. */ + /* Not anymore needed. */ return 0; } ----------------------------------------------------------------------- Summary of changes: src/secmem.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org From cvs at cvs.gnupg.org Mon Sep 7 15:46:50 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 07 Sep 2015 15:46:50 +0200 Subject: [git] GCRYPT - branch, LIBGCRYPT-1-6-BRANCH, updated. libgcrypt-1.6.3-10-gd281624 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, LIBGCRYPT-1-6-BRANCH has been updated via d2816248461c24a7ea81a1de2f562f481ccc9edd (commit) via 236c040c066d385582376b67a2f356a07fbbfafc (commit) from b85c8d6645039fc9d403791750510e439731d479 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d2816248461c24a7ea81a1de2f562f481ccc9edd Author: Werner Koch Date: Mon Sep 7 15:38:04 2015 +0200 Fix gcc portability on Solaris 9 SPARC boxes. * mpi/longlong.h: Use __sparcv8 as alias for __sparc_v8__. -- This patch has been in use by pkgsrc for SunOS mentok 5.9 Generic_117171-02 sun4u sparc SUNW,Sun-Fire-V240 since 2004. GnuPG-bug-id: 1703 Signed-off-by: Werner Koch diff --git a/mpi/longlong.h b/mpi/longlong.h index 4f33937..1ebfdd4 100644 --- a/mpi/longlong.h +++ b/mpi/longlong.h @@ -1287,7 +1287,7 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); "rJ" ((USItype)(al)), \ "rI" ((USItype)(bl)) \ __CLOBBER_CC) -#if defined (__sparc_v8__) +#if defined (__sparc_v8__) || defined(__sparcv8) /* Don't match immediate range because, 1) it is not often useful, 2) the 'I' flag thinks of the range as a 13 bit signed interval, while we want to match a 13 bit interval, sign extended to 32 bits, commit 236c040c066d385582376b67a2f356a07fbbfafc Author: Werner Koch Date: Mon Sep 7 14:02:09 2015 +0200 Improve GCRYCTL_DISABLE_PRIV_DROP by also disabling cap_ calls. * src/secmem.c (lock_pool, secmem_init): Do not call any cap_ functions if NO_PRIV_DROP is set. -- Signed-off-by: Werner Koch (cherry picked from commit 3a3d5410cc83f7069c7cb1ab384905f382292d32) Resolved conflicts: src/secmem.c - No need for the typo fix. diff --git a/src/secmem.c b/src/secmem.c index 2bf7d8c..cce1a03 100644 --- a/src/secmem.c +++ b/src/secmem.c @@ -246,15 +246,21 @@ lock_pool (void *p, size_t n) { cap_t cap; - cap = cap_from_text ("cap_ipc_lock+ep"); - cap_set_proc (cap); - cap_free (cap); + if (!no_priv_drop) + { + cap = cap_from_text ("cap_ipc_lock+ep"); + cap_set_proc (cap); + cap_free (cap); + } err = no_mlock? 0 : mlock (p, n); if (err && errno) err = errno; - cap = cap_from_text ("cap_ipc_lock+p"); - cap_set_proc (cap); - cap_free(cap); + if (!no_priv_drop) + { + cap = cap_from_text ("cap_ipc_lock+p"); + cap_set_proc (cap); + cap_free(cap); + } } if (err) @@ -482,13 +488,14 @@ secmem_init (size_t n) { #ifdef USE_CAPABILITIES /* drop all capabilities */ - { - cap_t cap; + if (!no_priv_drop) + { + cap_t cap; - cap = cap_from_text ("all-eip"); - cap_set_proc (cap); - cap_free (cap); - } + cap = cap_from_text ("all-eip"); + cap_set_proc (cap); + cap_free (cap); + } #elif !defined(HAVE_DOSISH_SYSTEM) uid_t uid; ----------------------------------------------------------------------- Summary of changes: mpi/longlong.h | 2 +- src/secmem.c | 31 +++++++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org From cvs at cvs.gnupg.org Mon Sep 7 18:02:38 2015 From: cvs at cvs.gnupg.org (by Peter Wu) Date: Mon, 07 Sep 2015 18:02:38 +0200 Subject: [git] GCRYPT - branch, LIBGCRYPT-1-6-BRANCH, updated. libgcrypt-1.6.3-11-g67d93a2 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, LIBGCRYPT-1-6-BRANCH has been updated via 67d93a230a4bf19feffae29de211d9bb0cfdd7e1 (commit) from d2816248461c24a7ea81a1de2f562f481ccc9edd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 67d93a230a4bf19feffae29de211d9bb0cfdd7e1 Author: Peter Wu Date: Tue Jul 14 09:53:38 2015 +0900 sexp: Fix invalid deallocation in error path. * src/sexp.c: Fix wrong condition. -- Signed-off-by: Peter Wu (cherry picked from commit 0f9532b186c1e0b54d7e7a6d76bce82b6226122b) diff --git a/src/sexp.c b/src/sexp.c index 9bc13ca..1c014e0 100644 --- a/src/sexp.c +++ b/src/sexp.c @@ -2405,7 +2405,7 @@ _gcry_sexp_vextract_param (gcry_sexp_t sexp, const char *path, _gcry_mpi_release (*array[idx]); *array[idx] = NULL; } - else if (!arrayisdesc[idx] == 1) + else if (arrayisdesc[idx] == 1) { /* Caller provided buffer. */ gcry_buffer_t *spec = (gcry_buffer_t*)array[idx]; ----------------------------------------------------------------------- Summary of changes: src/sexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org From cvs at cvs.gnupg.org Mon Sep 7 18:06:18 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Mon, 07 Sep 2015 18:06:18 +0200 Subject: [git] GCRYPT - branch, LIBGCRYPT-1-6-BRANCH, updated. libgcrypt-1.6.3-12-g59058aa Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, LIBGCRYPT-1-6-BRANCH has been updated via 59058aaca0892f5259f233a3a2af1e5084716198 (commit) from 67d93a230a4bf19feffae29de211d9bb0cfdd7e1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 59058aaca0892f5259f233a3a2af1e5084716198 Author: Werner Koch Date: Mon Jan 5 19:38:29 2015 +0100 random: Silent warning under NetBSD using rndunix * random/rndunix.c (STDERR_FILENO): Define if needed. (start_gatherer): Re-open standard descriptors. Fix an unsigned/signed pointer warning. -- GnuPG-bug-id: 1702 (cherry picked from commit 817472358a093438e802380caecf7139406400cf) diff --git a/configure.ac b/configure.ac index c4d7e5f..efcbc52 100644 --- a/configure.ac +++ b/configure.ac @@ -2053,11 +2053,10 @@ cat < sizeof(msg.data)? sizeof(msg.data) : nbytes; memcpy( msg.data, p, msg.ndata ); ----------------------------------------------------------------------- Summary of changes: configure.ac | 7 +++---- random/rndunix.c | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 8 02:14:46 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Tue, 08 Sep 2015 02:14:46 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-1-4, updated. gnupg-1.4.19-10-gbd6f800 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, STABLE-BRANCH-1-4 has been updated via bd6f80061a7f7dd8831a2ce989bbd47f46a195bc (commit) from ae61f01523fc68fbd3dbac5f2ba761a7b8b117dd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit bd6f80061a7f7dd8831a2ce989bbd47f46a195bc Author: NIIBE Yutaka Date: Tue Sep 8 09:14:20 2015 +0900 po: Fix Spanish translation diff --git a/po/es.po b/po/es.po index 6044b04..bb403e5 100644 --- a/po/es.po +++ b/po/es.po @@ -3180,7 +3180,7 @@ msgstr "Seleccione el tipo de clave deseado:\n" #, c-format msgid " (%d) RSA and RSA (default)\n" -msgstr " (%d) DSA y ElGamal (por defecto)\n" +msgstr " (%d) RSA y RSA (por defecto)\n" #, c-format msgid " (%d) DSA and Elgamal\n" ----------------------------------------------------------------------- Summary of changes: po/es.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 8 08:53:16 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 08 Sep 2015 08:53:16 +0200 Subject: [git] GCRYPT - branch, LIBGCRYPT-1-6-BRANCH, updated. libgcrypt-1.6.3-16-g936098e Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, LIBGCRYPT-1-6-BRANCH has been updated via 936098e99bd29cb3627c6aa296e3895feb53fa27 (commit) via 72e8c2715dff99b63ef3c1541ae0dbfee4e99410 (commit) via 6098f88d17754683e1003c5ead77b707117c3cd0 (commit) via 84be4b23fca5faa910f04965e3e6b92ba2dc594f (commit) from 59058aaca0892f5259f233a3a2af1e5084716198 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 936098e99bd29cb3627c6aa296e3895feb53fa27 Author: Werner Koch Date: Tue Sep 8 08:50:28 2015 +0200 Post release updates. -- diff --git a/NEWS b/NEWS index 07b4b6e..25689ba 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Noteworthy changes in version 1.6.5 (unreleased) [C20/A0/R_] +------------------------------------------------ + + Noteworthy changes in version 1.6.4 (2015-09-08) [C20/A0/R4] ------------------------------------------------ diff --git a/configure.ac b/configure.ac index 985e045..eb1ba34 100644 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,7 @@ min_automake_version="1.14" # for the LT versions. m4_define(mym4_version_major, [1]) m4_define(mym4_version_minor, [6]) -m4_define(mym4_version_micro, [4]) +m4_define(mym4_version_micro, [5]) # Below is m4 magic to extract and compute the revision number, the # decimalized short revision number, a beta version string, and a flag commit 72e8c2715dff99b63ef3c1541ae0dbfee4e99410 Author: Werner Koch Date: Tue Sep 8 08:29:55 2015 +0200 Release 1.6.4. * configure.ac: Change LT version to C20/A0/R4. Signed-off-by: Werner Koch diff --git a/NEWS b/NEWS index 85838ed..07b4b6e 100644 --- a/NEWS +++ b/NEWS @@ -1,10 +1,22 @@ -Noteworthy changes in version 1.6.4 (unreleased) [C20/A0/R3] +Noteworthy changes in version 1.6.4 (2015-09-08) [C20/A0/R4] ------------------------------------------------ + * Speed up the random number generator by requiring less extra + seeding. + * New flag "no-keytest" for ECC key generation. Due to a bug in the parser that flag will also be accepted but ignored by older version of Libgcrypt. + * Always verify a created RSA signature to avoid private key leaks + due to hardware failures. + + * Fix alignment bug in the AESNI code on Windows > 7. + + * Support FreeBSD 10 and later. + + * Other minor bug fixes. + Noteworthy changes in version 1.6.3 (2015-02-27) [C20/A0/R3] ------------------------------------------------ diff --git a/configure.ac b/configure.ac index efcbc52..985e045 100644 --- a/configure.ac +++ b/configure.ac @@ -56,7 +56,7 @@ AC_INIT([libgcrypt],[mym4_full_version],[http://bugs.gnupg.org]) # (No interfaces changed: REVISION++) LIBGCRYPT_LT_CURRENT=20 LIBGCRYPT_LT_AGE=0 -LIBGCRYPT_LT_REVISION=3 +LIBGCRYPT_LT_REVISION=4 # If the API is changed in an incompatible way: increment the next counter. commit 6098f88d17754683e1003c5ead77b707117c3cd0 Author: Werner Koch Date: Fri Sep 4 12:39:56 2015 +0200 w32: Avoid a few compiler warnings. * cipher/cipher-selftest.c (_gcry_selftest_helper_cbc) (_gcry_selftest_helper_cfb, _gcry_selftest_helper_ctr): Mark variable as unused. * random/rndw32.c (slow_gatherer): Avoid signed pointer mismatch warning. * src/secmem.c (init_pool): Avoid unused variable warning. * tests/random.c (writen, readn): Include on if needed. -- Signed-off-by: Werner Koch (cherry picked from commit e97c62a4a687b56d00a2d0a63e072a977f8eb81c) Resolved conflicts: tests/gchash.c - Remove. diff --git a/cipher/cipher-selftest.c b/cipher/cipher-selftest.c index 0852332..e77fdf5 100644 --- a/cipher/cipher-selftest.c +++ b/cipher/cipher-selftest.c @@ -127,6 +127,8 @@ _gcry_selftest_helper_cbc (const char *cipher, gcry_cipher_setkey_t setkey_func, syslog (LOG_USER|LOG_WARNING, "Libgcrypt warning: " "%s-CBC-%d test failed (plaintext mismatch)", cipher, blocksize * 8); +#else + (void)cipher; /* Not used. */ #endif return "selftest for CBC failed - see syslog for details"; } @@ -243,6 +245,8 @@ _gcry_selftest_helper_cfb (const char *cipher, gcry_cipher_setkey_t setkey_func, syslog (LOG_USER|LOG_WARNING, "Libgcrypt warning: " "%s-CFB-%d test failed (plaintext mismatch)", cipher, blocksize * 8); +#else + (void)cipher; /* Not used. */ #endif return "selftest for CFB failed - see syslog for details"; } @@ -367,6 +371,8 @@ _gcry_selftest_helper_ctr (const char *cipher, gcry_cipher_setkey_t setkey_func, syslog (LOG_USER|LOG_WARNING, "Libgcrypt warning: " "%s-CTR-%d test failed (plaintext mismatch)", cipher, blocksize * 8); +#else + (void)cipher; /* Not used. */ #endif return "selftest for CTR failed - see syslog for details"; } diff --git a/random/rndw32.c b/random/rndw32.c index 4ab1bca..1325b18 100644 --- a/random/rndw32.c +++ b/random/rndw32.c @@ -513,7 +513,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins), status = RegQueryValueEx (hKey, "ProductType", 0, NULL, szValue, &dwSize); - if (status == ERROR_SUCCESS && stricmp (szValue, "WinNT")) + if (status == ERROR_SUCCESS && stricmp ((char*)szValue, "WinNT")) { /* Note: There are (at least) three cases for ProductType: WinNT = NT Workstation, ServerNT = NT Server, LanmanNT = diff --git a/src/secmem.c b/src/secmem.c index cce1a03..69fdca9 100644 --- a/src/secmem.c +++ b/src/secmem.c @@ -370,8 +370,6 @@ lock_pool (void *p, size_t n) static void init_pool (size_t n) { - size_t pgsize; - long int pgsize_val; memblock_t *mb; pool_size = n; @@ -379,48 +377,54 @@ init_pool (size_t n) if (disable_secmem) log_bug ("secure memory is disabled"); -#if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) - pgsize_val = sysconf (_SC_PAGESIZE); -#elif defined(HAVE_GETPAGESIZE) - pgsize_val = getpagesize (); -#else - pgsize_val = -1; -#endif - pgsize = (pgsize_val != -1 && pgsize_val > 0)? pgsize_val:DEFAULT_PAGE_SIZE; - #if HAVE_MMAP - pool_size = (pool_size + pgsize - 1) & ~(pgsize - 1); -#ifdef MAP_ANONYMOUS - pool = mmap (0, pool_size, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); -#else /* map /dev/zero instead */ { - int fd; + size_t pgsize; + long int pgsize_val; + +# if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) + pgsize_val = sysconf (_SC_PAGESIZE); +# elif defined(HAVE_GETPAGESIZE) + pgsize_val = getpagesize (); +# else + pgsize_val = -1; +# endif + pgsize = (pgsize_val != -1 && pgsize_val > 0)? pgsize_val:DEFAULT_PAGE_SIZE; + + pool_size = (pool_size + pgsize - 1) & ~(pgsize - 1); +# ifdef MAP_ANONYMOUS + pool = mmap (0, pool_size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +# else /* map /dev/zero instead */ + { + int fd; - fd = open ("/dev/zero", O_RDWR); - if (fd == -1) - { - log_error ("can't open /dev/zero: %s\n", strerror (errno)); - pool = (void *) -1; - } + fd = open ("/dev/zero", O_RDWR); + if (fd == -1) + { + log_error ("can't open /dev/zero: %s\n", strerror (errno)); + pool = (void *) -1; + } + else + { + pool = mmap (0, pool_size, + (PROT_READ | PROT_WRITE), MAP_PRIVATE, fd, 0); + close (fd); + } + } +# endif + if (pool == (void *) -1) + log_info ("can't mmap pool of %u bytes: %s - using malloc\n", + (unsigned) pool_size, strerror (errno)); else { - pool = mmap (0, pool_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); - close (fd); + pool_is_mmapped = 1; + pool_okay = 1; } } -#endif - if (pool == (void *) -1) - log_info ("can't mmap pool of %u bytes: %s - using malloc\n", - (unsigned) pool_size, strerror (errno)); - else - { - pool_is_mmapped = 1; - pool_okay = 1; - } +#endif /*HAVE_MMAP*/ -#endif if (!pool_okay) { pool = malloc (pool_size); diff --git a/tests/fipsdrv.c b/tests/fipsdrv.c index eef2ddd..b3da2a3 100644 --- a/tests/fipsdrv.c +++ b/tests/fipsdrv.c @@ -2358,14 +2358,14 @@ main (int argc, char **argv) { if (!(++count % 1000)) fprintf (stderr, PGM ": %lu random bytes so far\n", - (unsigned long int)count * sizeof buffer); + (unsigned long int)(count * sizeof buffer)); } } while (loop_mode); if (progress) fprintf (stderr, PGM ": %lu random bytes\n", - (unsigned long int)count * sizeof buffer); + (unsigned long int)(count * sizeof buffer)); deinit_external_rng_test (context); } diff --git a/tests/random.c b/tests/random.c index 10bf646..d7a624a 100644 --- a/tests/random.c +++ b/tests/random.c @@ -87,7 +87,7 @@ progress_cb (void *cb_data, const char *what, int printchar, } - +#ifndef HAVE_W32_SYSTEM static int writen (int fd, const void *buf, size_t nbytes) { @@ -110,7 +110,10 @@ writen (int fd, const void *buf, size_t nbytes) return 0; } +#endif /*!HAVE_W32_SYSTEM*/ + +#ifndef HAVE_W32_SYSTEM static int readn (int fd, void *buf, size_t buflen, size_t *ret_nread) { @@ -136,7 +139,7 @@ readn (int fd, void *buf, size_t buflen, size_t *ret_nread) *ret_nread = buflen - nleft; return 0; } - +#endif /*!HAVE_W32_SYSTEM*/ /* Check that forking won't return the same random. */ commit 84be4b23fca5faa910f04965e3e6b92ba2dc594f Author: Jussi Kivilinna Date: Wed Apr 29 18:18:07 2015 +0300 Prepare random/win32.c fast poll for 64-bit Windows * random/win32.c (_gcry_rndw32_gather_random_fast) [ADD]: Rename to ADDINT. (_gcry_rndw32_gather_random_fast): Add ADDPTR. (_gcry_rndw32_gather_random_fast): Disable entropy gathering from GetQueueStatus(QS_ALLEVENTS). (_gcry_rndw32_gather_random_fast): Change minimumWorkingSetSize and maximumWorkingSetSize to SIZE_T from DWORD. (_gcry_rndw32_gather_random_fast): Only add lower 32-bits of minimumWorkingSetSize and maximumWorkingSetSize to random poll. (_gcry_rndw32_gather_random_fast) [__WIN64__]: Read TSC directly using intrinsic. -- Introduce entropy gatherer changes related to 64-bit Windows platform as done in cryptlib fast poll: - Change ADD macro to ADDPTR/ADDINT to handle pointer values. ADDPTR discards high 32-bits of 64-bit pointer values. - minimum/maximumWorkingSetSize changed to SIZE_T type to avoid stack corruption on 64-bit; only low 32-bits are used for entropy. - Use __rdtsc() intrinsic on 64-bit (as TSC is always available). Signed-off-by: Jussi Kivilinna (cherry picked from commit 0cdd24456b33defc7f8176fa82ab694fbc284385) diff --git a/random/rndw32.c b/random/rndw32.c index c495131..4ab1bca 100644 --- a/random/rndw32.c +++ b/random/rndw32.c @@ -826,39 +826,47 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, cursor position for last message, 1 ms time for last message, handle of window with clipboard open, handle of process heap, handle of procs window station, types of events in input queue, - and milliseconds since Windows was started. */ + and milliseconds since Windows was started. On 64-bit platform + some of these return values are pointers and thus 64-bit wide. + We discard the upper 32-bit of those values. */ { byte buffer[20*sizeof(ulong)], *bufptr; bufptr = buffer; -#define ADD(f) do { ulong along = (ulong)(f); \ - memcpy (bufptr, &along, sizeof (along) ); \ - bufptr += sizeof (along); \ - } while (0) - - ADD ( GetActiveWindow ()); - ADD ( GetCapture ()); - ADD ( GetClipboardOwner ()); - ADD ( GetClipboardViewer ()); - ADD ( GetCurrentProcess ()); - ADD ( GetCurrentProcessId ()); - ADD ( GetCurrentThread ()); - ADD ( GetCurrentThreadId ()); - ADD ( GetDesktopWindow ()); - ADD ( GetFocus ()); - ADD ( GetInputState ()); - ADD ( GetMessagePos ()); - ADD ( GetMessageTime ()); - ADD ( GetOpenClipboardWindow ()); - ADD ( GetProcessHeap ()); - ADD ( GetProcessWindowStation ()); - ADD ( GetQueueStatus (QS_ALLEVENTS)); - ADD ( GetTickCount ()); +#define ADDINT(f) do { ulong along = (ulong)(f); \ + memcpy (bufptr, &along, sizeof (along) ); \ + bufptr += sizeof (along); \ + } while (0) +#define ADDPTR(f) do { void *aptr = (f); \ + ADDINT((SIZE_T)aptr); \ + } while (0) + + ADDPTR ( GetActiveWindow ()); + ADDPTR ( GetCapture ()); + ADDPTR ( GetClipboardOwner ()); + ADDPTR ( GetClipboardViewer ()); + ADDPTR ( GetCurrentProcess ()); + ADDINT ( GetCurrentProcessId ()); + ADDPTR ( GetCurrentThread ()); + ADDINT ( GetCurrentThreadId ()); + ADDPTR ( GetDesktopWindow ()); + ADDPTR ( GetFocus ()); + ADDINT ( GetInputState ()); + ADDINT ( GetMessagePos ()); + ADDINT ( GetMessageTime ()); + ADDPTR ( GetOpenClipboardWindow ()); + ADDPTR ( GetProcessHeap ()); + ADDPTR ( GetProcessWindowStation ()); + /* Following function in some cases stops returning events, and cannot + be used as an entropy source. */ + /*ADDINT ( GetQueueStatus (QS_ALLEVENTS));*/ + ADDINT ( GetTickCount ()); gcry_assert ( bufptr-buffer < sizeof (buffer) ); (*add) ( buffer, bufptr-buffer, origin ); -#undef ADD +#undef ADDINT +#undef ADDPTR } /* Get multiword system information: Current caret position, current @@ -888,7 +896,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, { HANDLE handle; FILETIME creationTime, exitTime, kernelTime, userTime; - DWORD minimumWorkingSetSize, maximumWorkingSetSize; + SIZE_T minimumWorkingSetSize, maximumWorkingSetSize; handle = GetCurrentThread (); GetThreadTimes (handle, &creationTime, &exitTime, @@ -910,10 +918,9 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, process. */ GetProcessWorkingSetSize (handle, &minimumWorkingSetSize, &maximumWorkingSetSize); - (*add) ( &minimumWorkingSetSize, - sizeof (minimumWorkingSetSize), origin ); - (*add) ( &maximumWorkingSetSize, - sizeof (maximumWorkingSetSize), origin ); + /* On 64-bit system, discard the high 32-bits. */ + (*add) ( &minimumWorkingSetSize, sizeof (int), origin ); + (*add) ( &maximumWorkingSetSize, sizeof (int), origin ); } @@ -961,7 +968,20 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, To make things unambiguous, we detect a CPU new enough to call RDTSC directly by checking for CPUID capabilities, and fall back to QPC if - this isn't present. */ + this isn't present. + + On AMD64, TSC is always available and intrinsic is provided for accessing + it. */ +#ifdef __WIN64__ + { + unsigned __int64 aint64; + + /* Note: cryptlib does not discard upper 32 bits of TSC on WIN64, but does + * on WIN32. Is this correct? */ + aint64 = __rdtsc(); + (*add) (&aint64, sizeof(aint64), origin); + } +#else #ifdef __GNUC__ /* FIXME: We would need to implement the CPU feature tests first. */ /* if (cpu_has_feature_rdtsc) */ @@ -990,6 +1010,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, (*add) (&aword, sizeof (aword), origin ); } } +#endif /*__WIN64__*/ } ----------------------------------------------------------------------- Summary of changes: NEWS | 18 +++++++++- cipher/cipher-selftest.c | 6 ++++ configure.ac | 4 +-- random/rndw32.c | 85 ++++++++++++++++++++++++++++++------------------ src/secmem.c | 74 +++++++++++++++++++++-------------------- tests/fipsdrv.c | 4 +-- tests/random.c | 7 ++-- 7 files changed, 124 insertions(+), 74 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 8 16:44:58 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 08 Sep 2015 16:44:58 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.29-1-g0a88cd1 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, STABLE-BRANCH-2-0 has been updated via 0a88cd186f2943eb5ff6839ce0299d313c1d958d (commit) via 120fc695209fed9b447a72d36a9f7563e7b77a68 (commit) via 88deb88741f062098e726527450bfcf16f11848d (commit) via 12835e034b35781eac53a73a62d4e71960a14e64 (commit) via 89cce4cbbbbb8c08d3db0021c5f90ef480f54e47 (commit) via 77f2964b9602fb463738d14bd957d967a0c1b5ac (commit) via 0b01bb7f253fc1f9422e59dc475fa86854b46f69 (commit) from 60b0403f3ce50ee6f67fa94bf0342fb5b3988e2b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0a88cd186f2943eb5ff6839ce0299d313c1d958d Author: Werner Koch Date: Tue Sep 8 16:41:38 2015 +0200 Post release updates. -- diff --git a/NEWS b/NEWS index 14ab547..ef93593 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +Noteworthy changes in version 2.0.30 (unreleased) +------------------------------------------------- + Noteworthy changes in version 2.0.29 (2015-09-08) ------------------------------------------------- diff --git a/configure.ac b/configure.ac index 665c2b7..e5b8baf 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ min_automake_version="1.14" # (git tag -s gnupg-2.n.m) and run "./autogen.sh --force". Please # bump the version number immediately *after* the release and do # another commit and push so that the git magic is able to work. -m4_define([mym4_version], [2.0.29]) +m4_define([mym4_version], [2.0.30]) # Below is m4 magic to extract and compute the git revision number, # the decimalized short revision number, a beta version string and a commit 120fc695209fed9b447a72d36a9f7563e7b77a68 Author: Werner Koch Date: Tue Sep 8 15:59:00 2015 +0200 Release 2.0.29. Signed-off-by: Werner Koch diff --git a/AUTHORS b/AUTHORS index 323954b..9b57c16 100644 --- a/AUTHORS +++ b/AUTHORS @@ -183,10 +183,8 @@ name gpg2keys_*. ========= - Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010, 2011, - 2012, 2013 Free Software Foundation, Inc. - Copyright 1997, 1998, 2013, 2014 Werner Koch + Copyright 1997-2015 Werner Koch + Copyright 1998-2013 Free Software Foundation, Inc. This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff --git a/NEWS b/NEWS index 6347c5c..14ab547 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,18 @@ -Noteworthy changes in version 2.0.29 (unreleased) +Noteworthy changes in version 2.0.29 (2015-09-08) ------------------------------------------------- + * gpg: Print a PGP-2 fingerprint again instead of a row of "0". + + * gpg: Fixed a race condition from multiple several "gpg --verify". + + * gpg: Print FAILURE status lines to help GPGME. + + * gpgsm: Fixed a regression in CSR generation. + + * scdaemon: Fixed problems with some pinpads. + + * Fixed a few other bugs. + Noteworthy changes in version 2.0.28 (2015-06-02) ------------------------------------------------- diff --git a/README b/README index a33598e..a031c5e 100644 --- a/README +++ b/README @@ -2,8 +2,8 @@ ======================= Version 2.0 + Copyright 1997-2015 Werner Koch Copyright 1998-2015 Free Software Foundation, Inc. - Copyright 1997-1998, 2013-2015 Werner Koch INTRODUCTION diff --git a/g10/gpg.c b/g10/gpg.c index 4f71bf4..97975fb 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -1,6 +1,7 @@ /* gpg.c - The GnuPG utility (main for gpg) - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - * 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + * Copyright (C) 1998-2011 Free Software Foundation, Inc. + * Copyright (C) 1997-2015 Werner Koch + * Copyright (C) 2015 g10 Code GmbH * * This file is part of GnuPG. * commit 88deb88741f062098e726527450bfcf16f11848d Author: Werner Koch Date: Tue Sep 8 15:58:28 2015 +0200 po: Auto-update. -- diff --git a/po/be.po b/po/be.po index 2478aef..606b297 100644 --- a/po/be.po +++ b/po/be.po @@ -3782,6 +3782,10 @@ msgstr "" msgid " Key fingerprint =" msgstr "???????????????? ?????????? ?? ?????????????? ??????????????" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "???????????????????? ??????-?????????????????? \"%s\"\n" + msgid " Card serial no. =" msgstr "" @@ -4876,6 +4880,14 @@ msgstr "?????????????? ???????????????? ??????????" msgid "trustdb: sync failed: %s\n" msgstr "" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "%s: ?????????????????? ???????????????? ??????????: %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "?????????????????? ?????????????? \"%s\"\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "" @@ -4895,14 +4907,6 @@ msgstr "?????????????????? ?????????????? %s: %s\n" msgid "%s: directory does not exist!\n" msgstr "" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "%s: ?????????????????? ???????????????? ??????????: %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "?????????????????? ?????????????? \"%s\"\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "" diff --git a/po/ca.po b/po/ca.po index bf9b79d..86eb364 100644 --- a/po/ca.po +++ b/po/ca.po @@ -4141,6 +4141,10 @@ msgstr " Empremta digital de la subclau:" msgid " Key fingerprint =" msgstr " Empremta digital =" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "signatura %s, algorisme de resum %s\n" + msgid " Card serial no. =" msgstr "" @@ -5353,6 +5357,14 @@ msgstr "error de lectura: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "base de dades de confian??a: no s'ha pogut sincronitzar: %s\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "no es pot crear el directori ??%s??: %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "no s'ha pogut obrir ??%s??\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "reg de la base de dades de confian??a %lu: ha fallat lseek: %s\n" @@ -5375,14 +5387,6 @@ msgstr "no s'ha pogut tancar ??%s??: %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: el directori no existeix!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "no es pot crear el directori ??%s??: %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "no s'ha pogut obrir ??%s??\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: no s'ha pogut crear un registre de versi??: %s" diff --git a/po/cs.po b/po/cs.po index 15a90d9..0aaabcb 100644 --- a/po/cs.po +++ b/po/cs.po @@ -3873,6 +3873,11 @@ msgstr " Otisk podkl????e:" msgid " Key fingerprint =" msgstr " Otisk kl????e =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "VAROV??N??: pou????v??m experiment??ln?? hashovac?? algoritmus %s\n" + msgid " Card serial no. =" msgstr " S??riov?? ????slo karty =" @@ -5016,6 +5021,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "datab??ze d??v??ry: synchronizace selhala %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "nemohu vytvo??it z??mek pro ???%s???\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "nelze zamknout ???%s???\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "z??znam v datab??zi d??v??ry %lu: lseek() se nepoda??il: %s\n" @@ -5035,14 +5048,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: adres???? neexistuje!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "nemohu vytvo??it z??mek pro ???%s???\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "nelze zamknout ???%s???\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: nepoda??ilo se vytvo??it z??znam verze: %s" diff --git a/po/da.po b/po/da.po index 0d5c736..06d9ab0 100644 --- a/po/da.po +++ b/po/da.po @@ -3856,6 +3856,11 @@ msgstr " Undern??glefingeraftryk:" msgid " Key fingerprint =" msgstr " N??glefingeraftryk =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "ADVARSEL: bruger eksperimentel sammendragsalgoritme %s\n" + msgid " Card serial no. =" msgstr " Serielnr. for kort =" @@ -5000,6 +5005,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "trustdb: synkronisering mislykkedes: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "kan ikke oprette l??s for ??%s??\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "kan ikke l??se ??%s??\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: lseek mislykkedes: %s\n" @@ -5019,14 +5032,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: mappe findes ikke!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "kan ikke oprette l??s for ??%s??\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "kan ikke l??se ??%s??\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: kunne ikke oprette versionspost: %s" diff --git a/po/el.po b/po/el.po index e094b07..b55f03a 100644 --- a/po/el.po +++ b/po/el.po @@ -4047,6 +4047,10 @@ msgstr " msgid " Key fingerprint =" msgstr " ????????? ???????? =" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "%s ????????, ?????????? ????????? %s\n" + msgid " Card serial no. =" msgstr "" @@ -5231,6 +5235,14 @@ msgstr " msgid "trustdb: sync failed: %s\n" msgstr "trustdb: sync ???????: %s\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "???????? ??????????? ??? `%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "???????? ????????? ??? `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: ???????? lseek: %s\n" @@ -5250,14 +5262,6 @@ msgstr " msgid "%s: directory does not exist!\n" msgstr "%s: ? ??????? ??? ???????!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "???????? ??????????? ??? `%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "???????? ????????? ??? `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: ???????? ??????????? ???? ???????? ???????: %s" diff --git a/po/eo.po b/po/eo.po index a6e7818..8fc95a9 100644 --- a/po/eo.po +++ b/po/eo.po @@ -4026,6 +4026,10 @@ msgstr " msgid " Key fingerprint =" msgstr " ?losilo-fingrospuro =" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "%s-subskribo de: %s\n" + msgid " Card serial no. =" msgstr "" @@ -5186,6 +5190,14 @@ msgstr "kiraso: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "fido-datenaro: sync malsukcesis: %s\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "ne povas krei '%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "ne povas malfermi '%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "fido-datenaro loko %lu: lseek malsukcesis: %s\n" @@ -5205,14 +5217,6 @@ msgstr "ne povas fermi '%s': %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: dosierujo ne ekzistas!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "ne povas krei '%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "ne povas malfermi '%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: malsukcesis krei versiregistron: %s" diff --git a/po/es.po b/po/es.po index 7fe8148..33330d2 100644 --- a/po/es.po +++ b/po/es.po @@ -3873,6 +3873,11 @@ msgstr " Huella de subclave:" msgid " Key fingerprint =" msgstr " Huella de clave =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "ATENCI??N: usando algoritmo de resumen experimental %s\n" + msgid " Card serial no. =" msgstr " N??mero de serie de la tarjeta =" @@ -5020,6 +5025,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "base de datos de confianza: fallo sincronizaci??n: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "no se puede crear el bloqueo para `%s'\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "no se puede bloquear `%s'\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "registro base de datos de confianza %lu: lseek fallido: %s\n" @@ -5040,14 +5053,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: ??el directorio no existe!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "no se puede crear el bloqueo para `%s'\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "no se puede bloquear `%s'\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: fallo en la creaci??n del registro de versi??n: %s" diff --git a/po/et.po b/po/et.po index ba781a7..d18984e 100644 --- a/po/et.po +++ b/po/et.po @@ -3994,6 +3994,10 @@ msgstr " Alamv msgid " Key fingerprint =" msgstr " V?tme s?rmej?lg =" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "%s allkiri, s?numil?hendi algoritm %s\n" + msgid " Card serial no. =" msgstr "" @@ -5153,6 +5157,14 @@ msgstr "viga lugemisel: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "trustdb: sync eba?nnestus: %s\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "`%s' ei ?nnestu luua: %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "`%s' ei ?nnestu avada\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb kirje %lu: lseek eba?nnestus: %s\n" @@ -5172,14 +5184,6 @@ msgstr "`%s' ei msgid "%s: directory does not exist!\n" msgstr "%s: kataloogi ei ole!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "`%s' ei ?nnestu luua: %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "`%s' ei ?nnestu avada\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: versioonikirje loomine ei ?nnestu: %s" diff --git a/po/fi.po b/po/fi.po index 6b3d566..85e042e 100644 --- a/po/fi.po +++ b/po/fi.po @@ -4030,6 +4030,11 @@ msgstr " Aliavaimen sormenj??lki:" msgid " Key fingerprint =" msgstr " Avaimen sormenj??lki =" +# Ensimm??inen %s on binary, textmode tai unknown, ks. alla +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "%sallekirjoitus, tiivistealgoritmi %s\n" + msgid " Card serial no. =" msgstr "" @@ -5216,6 +5221,14 @@ msgstr "lukuvirhe: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "trustdb: synkronointi ep??onnistui: %s\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "tiedostoa \"%s\" ei voi luoda: %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "tiedostoa \"%s\" ei voi avata\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: lseek ep??onnistui: %s\n" @@ -5235,14 +5248,6 @@ msgstr "tiedostoa \"%s\" ei voi sulkea: %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: hakemistoa ei ole olemassa!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "tiedostoa \"%s\" ei voi luoda: %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "tiedostoa \"%s\" ei voi avata\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: versiotietueen luonti ep??onnistui: %s" diff --git a/po/fr.po b/po/fr.po index a640f2e..b0775c9 100644 --- a/po/fr.po +++ b/po/fr.po @@ -3942,6 +3942,11 @@ msgstr " Empreinte de sous-clef??:" msgid " Key fingerprint =" msgstr " Empreinte de la clef =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "Attention??: utilisation de l'algorithme exp??rimental de hachage %s\n" + msgid " Card serial no. =" msgstr " N?? de s??rie de carte =" @@ -5137,6 +5142,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "base de confiance??: ??chec de synchronisation??: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "impossible de cr??er un verrou pour ????%s????\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "impossible de verrouiller ????%s????\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "enregistrement de base de confiance %lu??: ??chec de lseek??: %s\n" @@ -5157,14 +5170,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s??: le r??pertoire n'existe pas.\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "impossible de cr??er un verrou pour ????%s????\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "impossible de verrouiller ????%s????\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s??: impossible de cr??er un enregistrement de version??: %s" diff --git a/po/gl.po b/po/gl.po index 3c62fc8..f675ea7 100644 --- a/po/gl.po +++ b/po/gl.po @@ -4044,6 +4044,10 @@ msgstr " Pegada dactilar da sub-chave:" msgid " Key fingerprint =" msgstr " Pegada dactilar =" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "Sinatura %s, algoritmo de resumo %s\n" + msgid " Card serial no. =" msgstr "" @@ -5219,6 +5223,14 @@ msgstr "erro de lectura: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "base de datos de confianza: fallou a sincronizaci?n: %s\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "non se pode crear `%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "non se puido abrir `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "rexistro da base de datos de confianza %lu: lseek fallou: %s\n" @@ -5239,14 +5251,6 @@ msgstr "non se pode pechar `%s': %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: ?o directorio non existe!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "non se pode crear `%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "non se puido abrir `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: non se puido crea-lo rexistro de versi?n: %s" diff --git a/po/hu.po b/po/hu.po index f763ca5..a43f640 100644 --- a/po/hu.po +++ b/po/hu.po @@ -4003,6 +4003,10 @@ msgstr " Alkulcsujjlenyomat:" msgid " Key fingerprint =" msgstr " Kulcs ujjlenyomata =" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "%s al??r?s, %s kivonatol? algoritmus.\n" + msgid " Card serial no. =" msgstr "" @@ -5184,6 +5188,14 @@ msgstr "Olvas msgid "trustdb: sync failed: %s\n" msgstr "Bizalmi adatb?zis: szinkroniz?ci? sikertelen: %s.\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "Nem tudom l?trehozni a(z) \"%s\" ?llom?nyt: %s.\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "Nem tudom megnyitni %s-t!\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "Bizalmi adatb?zis %lu. rekord: lseek sikertelen: %s.\n" @@ -5203,14 +5215,6 @@ msgstr "Nem tudom bez msgid "%s: directory does not exist!\n" msgstr "%s: K?nyvt?r nem l?tezik!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "Nem tudom l?trehozni a(z) \"%s\" ?llom?nyt: %s.\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "Nem tudom megnyitni %s-t!\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: Nem siker?lt verzi?rekordot l?trehoznom: %s" diff --git a/po/id.po b/po/id.po index 53d8174..5238a4b 100644 --- a/po/id.po +++ b/po/id.po @@ -4017,6 +4017,10 @@ msgstr " Fingerprint subkunci =" msgid " Key fingerprint =" msgstr " Fingerprint kunci =" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "%s signature, algoritma digest %s\n" + msgid " Card serial no. =" msgstr "" @@ -5182,6 +5186,14 @@ msgstr "kesalahan pembacaan: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "trustdb: gagal sync: %s\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "tidak dapat membuat %s: %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "tidak dapat membuka `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: lseek gagal: %s\n" @@ -5201,14 +5213,6 @@ msgstr "tidak dapat menutup `%s': %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: direktori tidak ada!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "tidak dapat membuat %s: %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "tidak dapat membuka `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: gagal membuat catatan versi: %s" diff --git a/po/it.po b/po/it.po index dc61449..0612633 100644 --- a/po/it.po +++ b/po/it.po @@ -4030,6 +4030,10 @@ msgstr " Impronta digitale della subchiave:" msgid " Key fingerprint =" msgstr " Impronta digitale =" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "Firma %s, algoritmo di digest %s\n" + msgid " Card serial no. =" msgstr "" @@ -5222,6 +5226,14 @@ msgstr "errore di lettura: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "trustdb: sync fallita: %s\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "impossibile creare `%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "impossibile aprire `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: lseek fallita: %s\n" @@ -5241,14 +5253,6 @@ msgstr "impossibile chiudere `%s': %s\n" msgid "%s: directory does not exist!\n" msgstr "%s: la directory non esiste!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "impossibile creare `%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "impossibile aprire `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: creazione del record della versione fallita: %s" diff --git a/po/ja.po b/po/ja.po index 31ffef0..d5415cd 100644 --- a/po/ja.po +++ b/po/ja.po @@ -3775,6 +3775,11 @@ msgstr "????????????????????????????????????:" msgid " Key fingerprint =" msgstr " ?????????????????????????????? =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "*??????*: ???????????????????????????????????????????????? %s?????????\n" + msgid " Card serial no. =" msgstr " ?????????????????????????????? =" @@ -4891,6 +4896,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "????????????????????????: ???????????????????????????: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "???%s???????????????????????????????????????\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "???%s??????????????????????????????\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "???????????????????????? ????????????%lu: ??????????????????????????????: %s\n" @@ -4910,14 +4923,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: ????????????????????????????????????!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "???%s???????????????????????????????????????\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "???%s??????????????????????????????\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: ????????????????????????????????????????????????????????????: %s" diff --git a/po/nb.po b/po/nb.po index 98fbbc2..f7a3a1b 100644 --- a/po/nb.po +++ b/po/nb.po @@ -3844,6 +3844,11 @@ msgstr " Fingeravstrykk for undern msgid " Key fingerprint =" msgstr " N?kkelfingeravtrykk =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "ADVARSEL: bruker eksperimentell digest-algoritme %s\n" + msgid " Card serial no. =" msgstr " Serienummer for kort =" @@ -4955,6 +4960,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "kan ikke opprette l?s for ?%s?\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "kan ikke l?se ?%s?\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "" @@ -4974,14 +4987,6 @@ msgid "%s: directory does not exist!\n" msgstr "" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "kan ikke opprette l?s for ?%s?\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "kan ikke l?se ?%s?\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "" diff --git a/po/nl.po b/po/nl.po index f2a839c..bf40d9f 100644 --- a/po/nl.po +++ b/po/nl.po @@ -3987,6 +3987,11 @@ msgstr " Vingerafdruk van de subsleutel:" msgid " Key fingerprint =" msgstr " Vingerafdruk van de sleutel =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "WAARSCHUWING: er wordt een experimenteel hashalgoritme %s gebruikt\n" + msgid " Card serial no. =" msgstr " Serienummer van de kaart =" @@ -5187,6 +5192,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "betrouwbaarheidsdatabank (trustdb): synchronisatie mislukt: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "kan geen grendel maken voor `%s'\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "kan `%s' niet vergrendelen\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "" "betrouwbaarheidsdatabank (trustdb): element %lu: lseek is mislukt: %s\n" @@ -5209,14 +5222,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: map bestaat niet!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "kan geen grendel maken voor `%s'\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "kan `%s' niet vergrendelen\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: het registreren van de versie is mislukt: %s" diff --git a/po/pl.po b/po/pl.po index f1efab6..331510c 100644 --- a/po/pl.po +++ b/po/pl.po @@ -3882,6 +3882,11 @@ msgstr " Odcisk podklucza:" msgid " Key fingerprint =" msgstr " Odcisk klucza =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "OSTRZE??ENIE: u??ycie eksperymentalnego algorytmu skr??tu %s\n" + msgid " Card serial no. =" msgstr " Nr seryjny karty =" @@ -5038,6 +5043,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "baza zaufania: synchronizacja nie powiod??a si?? %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "nie mo??na utworzy?? blokady dla ,,%s''\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "nie mo??na zablokowa?? ,,%s''\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "baza zaufania, wpis %lu: funkcja lseek() nie powiod??a si??: %s\n" @@ -5057,14 +5070,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: katalog nie istnieje!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "nie mo??na utworzy?? blokady dla ,,%s''\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "nie mo??na zablokowa?? ,,%s''\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: stworzenie zapisu o wersji nie powiod??o si??: %s" diff --git a/po/pt.po b/po/pt.po index 1ebd6ab..d51a531 100644 --- a/po/pt.po +++ b/po/pt.po @@ -4016,6 +4016,10 @@ msgstr " Impress msgid " Key fingerprint =" msgstr " Impress?o da chave =" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "assinatura %s de: \"%s\"\n" + msgid " Card serial no. =" msgstr "" @@ -5184,6 +5188,14 @@ msgstr "armadura: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "base de dados de confian?a: sincroniza??o falhou: %s\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "imposs?vel criar `%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "imposs?vel abrir `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "base de dados de confian?a rec %lu: lseek falhou: %s\n" @@ -5203,14 +5215,6 @@ msgstr "imposs msgid "%s: directory does not exist!\n" msgstr "%s: diretoria inexistente!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "imposs?vel criar `%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "imposs?vel abrir `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: falha ao criar registo de vers?o: %s" diff --git a/po/pt_BR.po b/po/pt_BR.po index 579ea19..f74ef0f 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -4032,6 +4032,10 @@ msgstr " Impress msgid " Key fingerprint =" msgstr " Impress?o digital:" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "assinatura %s de: %s\n" + msgid " Card serial no. =" msgstr "" @@ -5194,6 +5198,14 @@ msgstr "erro de leitura: %s\n" msgid "trustdb: sync failed: %s\n" msgstr "banco de dados de confiabilidade: sincroniza??o falhou: %s\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "imposs?vel criar %s: %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "imposs?vel abrir `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "banco de dados de confiabilidade rec %lu: lseek falhou: %s\n" @@ -5213,14 +5225,6 @@ msgstr "imposs msgid "%s: directory does not exist!\n" msgstr "%s: diret?rio inexistente!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "imposs?vel criar %s: %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "imposs?vel abrir `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: falha ao criar registro de vers?o: %s" diff --git a/po/ro.po b/po/ro.po index 5ddab61..be90de5 100644 --- a/po/ro.po +++ b/po/ro.po @@ -3940,6 +3940,11 @@ msgstr " Amprent msgid " Key fingerprint =" msgstr " Amprent? cheie =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "AVERTISMENT: folosesc algoritmul rezumat experimental %s\n" + msgid " Card serial no. =" msgstr " Card nr. serie =" @@ -5095,6 +5100,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "trustdb: sincronizarea a e?uat: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "nu pot crea ?ncuietoare (lock) pentru `%s'\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "nu pot ?ncuia (lock) `%s'\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb rec %lu: lseek a e?uat: %s\n" @@ -5114,14 +5127,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: directorul nu exist?!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "nu pot crea ?ncuietoare (lock) pentru `%s'\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "nu pot ?ncuia (lock) `%s'\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: am e?uat s? creez ?nregistrare versiune: %s" diff --git a/po/ru.po b/po/ru.po index 3cf9dc0..a5156be 100644 --- a/po/ru.po +++ b/po/ru.po @@ -4979,6 +4979,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "?????????????? ??????????????: ???????? ??????????????????????????: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "???????????????????? ?????????????? ???????????????????? ?????? `%s'\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "???????????????????? ?????????????????????????? `%s'\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "?????????????? ??????????????, ???????????? %lu: ???????? lseek: %s\n" @@ -4998,14 +5006,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: ?????????????? ???? ????????????????????!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "???????????????????? ?????????????? ???????????????????? ?????? `%s'\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "???????????????????? ?????????????????????????? `%s'\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: ???????? ???????????????? ???????????? ?? ????????????: %s" diff --git a/po/sk.po b/po/sk.po index 23bac58..9d5feb9 100644 --- a/po/sk.po +++ b/po/sk.po @@ -4024,6 +4024,10 @@ msgstr " Fingerprint podk msgid " Key fingerprint =" msgstr " Fingerprint k???a =" +#, fuzzy, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "%s podpis, hashovac? algoritmus %s\n" + msgid " Card serial no. =" msgstr "" @@ -5200,6 +5204,14 @@ msgstr "chyba pri msgid "trustdb: sync failed: %s\n" msgstr "datab?za d?very: synchroniz?cia zlyhala %s\n" +#, fuzzy, c-format +msgid "can't create lock for `%s'\n" +msgstr "nem??em vytvori? `%s': %s\n" + +#, fuzzy, c-format +msgid "can't lock `%s'\n" +msgstr "nemo?no otvori? `%s'\n" + #, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "z?znam v datab?ze d?very %lu: lseek() sa nepodaril: %s\n" @@ -5219,14 +5231,6 @@ msgstr "nem msgid "%s: directory does not exist!\n" msgstr "%s: adres?r neexistuje!\n" -#, fuzzy, c-format -msgid "can't create lock for `%s'\n" -msgstr "nem??em vytvori? `%s': %s\n" - -#, fuzzy, c-format -msgid "can't lock `%s'\n" -msgstr "nemo?no otvori? `%s'\n" - #, c-format msgid "%s: failed to create version record: %s" msgstr "%s: nepodarilo sa vytvori? z?znam verzie: %s" diff --git a/po/sv.po b/po/sv.po index 3e8b6cd..0817012 100644 --- a/po/sv.po +++ b/po/sv.po @@ -3950,6 +3950,11 @@ msgstr " Undernyckelns fingeravtryck:" msgid " Key fingerprint =" msgstr "Nyckelns fingeravtryck =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "VARNING: anv??nder experimentella sammandragsalgoritmen %s\n" + msgid " Card serial no. =" msgstr " Kortets serienr =" @@ -5129,6 +5134,15 @@ msgid "trustdb: sync failed: %s\n" msgstr "tillitsdatabas: synkronisering misslyckades: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "kan inte skapa l??s f??r \"%s\"\n" + +# se f??rra kommentaren +#, c-format +msgid "can't lock `%s'\n" +msgstr "kan inte l??sa \"%s\"\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "tillitsdatabasposten %lu: lseek misslyckades: %s\n" @@ -5148,15 +5162,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: katalogen finns inte!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "kan inte skapa l??s f??r \"%s\"\n" - -# se f??rra kommentaren -#, c-format -msgid "can't lock `%s'\n" -msgstr "kan inte l??sa \"%s\"\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: misslyckades med att skapa versionspost: %s" diff --git a/po/tr.po b/po/tr.po index 889f532..eb8af01 100644 --- a/po/tr.po +++ b/po/tr.po @@ -3912,6 +3912,11 @@ msgstr "Yard??mc?? anahtar parmak izi:" msgid " Key fingerprint =" msgstr " Anahtar parmakizi =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "UYARI: deneysel %s ??zet algoritmas?? kullan??l??yor\n" + msgid " Card serial no. =" msgstr " Kart seri no. =" @@ -5065,6 +5070,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "g??vence veritaban??: e??zamanlama ba??ar??s??z: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "`%s' i??in kilit olu??turulam??yor\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "`%s' kiltlenemedi\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "g??vence veritaban?? %lu kayd??: eri??im ba??ar??s??z: %s\n" @@ -5084,14 +5097,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: dizin yok!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "`%s' i??in kilit olu??turulam??yor\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "`%s' kiltlenemedi\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: s??r??m kayd?? olu??turmada ba??ar??s??z: %s" diff --git a/po/uk.po b/po/uk.po index 77998ae..1ad8d81 100644 --- a/po/uk.po +++ b/po/uk.po @@ -3915,6 +3915,13 @@ msgstr " ???????????????? ????????????????:" msgid " Key fingerprint =" msgstr " ???????????????? ?????????? =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "" +"??????????: ???????????????????????????? ?????????????????????????????????? ???????????????? ???????????????????? ?????????????????????? ?????? " +"%s\n" + msgid " Card serial no. =" msgstr "???????????????? ?????????? ???????????? =" @@ -5074,6 +5081,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "trustdb: ?????????????? ??????????????????????????: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "???? ?????????????? ???????????????? ???????????????????? ?????? ??%s??\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "???? ?????????????? ?????????????????????? ??%s??\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "?????????? trustdb %lu: ?????????????? lseek: %s\n" @@ -5093,14 +5108,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: ???????????????? ???? ??????????!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "???? ?????????????? ???????????????? ???????????????????? ?????? ??%s??\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "???? ?????????????? ?????????????????????? ??%s??\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: ???? ?????????????? ???????????????? ?????????? ???????? ????????????: %s" diff --git a/po/zh_CN.po b/po/zh_CN.po index 8ab5db7..20f44b9 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -3835,6 +3835,11 @@ msgstr " ???????????????" msgid " Key fingerprint =" msgstr "???????????? =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "?????????????????????????????????????????? %s\n" + msgid " Card serial no. =" msgstr "???????????? =" @@ -4934,6 +4939,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "????????????????????????????????????%s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "????????????%s???????????????\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "???????????????%s???\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "???????????????????????? %lu???lseek ?????????%s\n" @@ -4953,14 +4966,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s?????????????????????\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "????????????%s???????????????\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "???????????????%s???\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s??????????????????????????????%s" diff --git a/po/zh_TW.po b/po/zh_TW.po index f8192f6..c1319a0 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -3759,6 +3759,11 @@ msgstr " ????????????:" msgid " Key fingerprint =" msgstr " ???????????? =" +#, fuzzy, c-format +#| msgid "WARNING: using experimental digest algorithm %s\n" +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "??????: ???????????????????????? %s ???????????????\n" + msgid " Card serial no. =" msgstr " ???????????? =" @@ -4861,6 +4866,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "???????????????: ???????????????: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "????????? `%s' ????????????\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "???????????? `%s'\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "????????????????????? %lu: ??????????????????: %s\n" @@ -4880,14 +4893,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: ???????????????!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "????????? `%s' ????????????\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "???????????? `%s'\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: ????????????????????????: %s" commit 12835e034b35781eac53a73a62d4e71960a14e64 Author: Werner Koch Date: Tue Sep 8 15:57:44 2015 +0200 po: Update German translation -- diff --git a/po/de.po b/po/de.po index 681c6de..839868b 100644 --- a/po/de.po +++ b/po/de.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: gnupg-2.0.18\n" "Report-Msgid-Bugs-To: translations at gnupg.org\n" -"PO-Revision-Date: 2015-06-02 13:13+0200\n" +"PO-Revision-Date: 2015-09-08 15:57+0200\n" "Last-Translator: Werner Koch \n" "Language-Team: German \n" "Language: de\n" @@ -3915,6 +3915,10 @@ msgstr " Unter-Fingerabdruck =" msgid " Key fingerprint =" msgstr " Schl.-Fingerabdruck =" +#, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "WARNUNG: Ein PGP-2 Fingerabdruck ist unsicher\n" + msgid " Card serial no. =" msgstr " Kartenseriennr. =" @@ -5102,6 +5106,14 @@ msgid "trustdb: sync failed: %s\n" msgstr "\"Trust-DB\": sync fehlgeschlagen: %s\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "Datei `%s' konnte nicht gesperrt werden\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "'%s' kann nicht gesperrt werden\n" + +#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "trustdb Satz %lu: lseek fehlgeschlagen: %s\n" @@ -5121,14 +5133,6 @@ msgid "%s: directory does not exist!\n" msgstr "%s: Verzeichnis existiert nicht!\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "Datei `%s' konnte nicht gesperrt werden\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "'%s' kann nicht gesperrt werden\n" - -#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: Fehler beim Erzeugen des Versionsatzes: %s" commit 89cce4cbbbbb8c08d3db0021c5f90ef480f54e47 Author: Ineiev Date: Tue Sep 8 15:54:38 2015 +0200 po: Update Russian translation. -- diff --git a/po/ru.po b/po/ru.po index 7341334..3cf9dc0 100644 --- a/po/ru.po +++ b/po/ru.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: GnuPG 2.0.10\n" "Report-Msgid-Bugs-To: translations at gnupg.org\n" -"PO-Revision-Date: 2015-02-14 17:16+0000\n" +"PO-Revision-Date: 2015-06-25 17:16+0000\n" "Last-Translator: Ineiev \n" "Language-Team: Russian \n" "Language: ru\n" @@ -36,36 +36,26 @@ msgstr "|pinentry-label|_OK" msgid "|pinentry-label|_Cancel" msgstr "|pinentry-label|???????????? (_C)" -#, fuzzy -#| msgid "|pinentry-label|_OK" msgid "|pinentry-label|_Yes" -msgstr "|pinentry-label|_OK" +msgstr "|pinentry-label|???? (_Y)" -#, fuzzy -#| msgid "|pinentry-label|_OK" msgid "|pinentry-label|_No" -msgstr "|pinentry-label|_OK" +msgstr "|pinentry-label|?????? (_N)" msgid "|pinentry-label|PIN:" msgstr "|pinentry-label|PIN:" -#, fuzzy -#| msgid "|pinentry-label|_Cancel" msgid "|pinentry-label|_Save in password manager" -msgstr "|pinentry-label|???????????? (_C)" +msgstr "|pinentry-label|?????????????????? ?? ???????????????????? ?????????????? (_S)" -#, fuzzy -#| msgid "Do you really want to revoke the selected subkeys? (y/N) " msgid "Do you really want to make your passphrase visible on the screen?" -msgstr "???? ?????????????????????????? ???????????? ???????????????? ?????????????????? ????????????????? (y/N) " +msgstr "???? ?????????????????????????? ????????????, ?????????? ??????????-???????????? ???????? ?????????? ???? ?????????????" msgid "|pinentry-tt|Make passphrase visible" -msgstr "" +msgstr "|pinentry-tt|???????????????????? ??????????-????????????" -#, fuzzy -#| msgid "Enter new passphrase" msgid "|pinentry-tt|Hide passphrase" -msgstr "?????????????? ?????????? ??????????-????????????" +msgstr "|pinentry-tt|???????????????? ??????????-????????????" #. TRANSLATORS: This string is displayed by Pinentry as the label #. for the quality bar. @@ -391,10 +381,8 @@ msgstr "???????????????? ?????????????????? ssh" msgid "enable putty support" msgstr "???????????????? ?????????????????? putty" -#, fuzzy -#| msgid "do not allow the reuse of old passphrases" msgid "disallow the use of an external password cache" -msgstr "???? ?????????????????? ?????????????????? ?????????????????????????? ???????????? ????????-??????????????" +msgstr "???? ?????????????????? ???????????????????????? ?????????????? ?????????????? ??????????????" msgid "|FILE|write environment settings also to FILE" msgstr "|FILE|?????????????????? ?????????????????? ?????????? ?????????? ?? ???????? FILE" @@ -3844,6 +3832,10 @@ msgstr " ?????????????????? ????????????????:" msgid " Key fingerprint =" msgstr " ?????????????????? ?????????? =" +#, c-format +msgid "WARNING: a PGP-2 fingerprint is not safe\n" +msgstr "????????????????: ?????????????????? PGP-2 ???? ??????????????????\n" + msgid " Card serial no. =" msgstr " ???????????????? ?????????? ?????????? =" @@ -5269,10 +5261,8 @@ msgstr "???????????????? ?????????? ?????????????? ??????????????" msgid "missing argument" msgstr "???????????????? ????????????????" -#, fuzzy -#| msgid "invalid value\n" msgid "invalid argument" -msgstr "???????????????????????? ????????????????\n" +msgstr "???????????????????????? ????????????????" msgid "invalid command" msgstr "???????????????????????? ??????????????" @@ -5290,10 +5280,9 @@ msgstr "???????????????????????? ????????????????" msgid "missing argument for option \"%.50s\"\n" msgstr "???? ?????????????? ?????????????????? ?????? ?????????????????? \"%.50s\"\n" -#, fuzzy, c-format -#| msgid "missing argument for option \"%.50s\"\n" +#, c-format msgid "invalid argument for option \"%.50s\"\n" -msgstr "???? ?????????????? ?????????????????? ?????? ?????????????????? \"%.50s\"\n" +msgstr "???????????????????????? ???????????????? ?????? ?????????????????? \"%.50s\"\n" #, c-format msgid "option \"%.50s\" does not expect an argument\n" commit 77f2964b9602fb463738d14bd957d967a0c1b5ac Author: Werner Koch Date: Tue Sep 8 15:29:59 2015 +0200 gpg: Print a new FAILURE status after most commands. * common/status.h (STATUS_FAILURE): New. * g10/cpr.c (write_status_failure): New. * g10/gpg.c (main): Call write_status_failure for all commands which print an error message here. -- This status line can be used similar to the error code returned by commands send over the Assuan interface in gpgsm. We don't emit them in gpgsm because there we already have that Assuan interface to return proper error code. This change helps GPGME to return better error codes. (backported from master 9cdff09743c473a12359bfdb914578ede0e4e3e2) Signed-off-by: Werner Koch diff --git a/common/status.h b/common/status.h index cfb64ca..f101bf0 100644 --- a/common/status.h +++ b/common/status.h @@ -20,7 +20,7 @@ #ifndef GNUPG_COMMON_STATUS_H #define GNUPG_COMMON_STATUS_H -enum +enum { STATUS_ENTER, STATUS_LEAVE, @@ -39,7 +39,7 @@ enum STATUS_TRUST_MARGINAL, STATUS_TRUST_FULLY, STATUS_TRUST_ULTIMATE, - + STATUS_NEED_PASSPHRASE, STATUS_VALIDSIG, STATUS_SIG_ID, @@ -59,20 +59,20 @@ enum STATUS_ERRMDC, STATUS_IMPORTED, STATUS_IMPORT_OK, - STATUS_IMPORT_PROBLEM, + STATUS_IMPORT_PROBLEM, STATUS_IMPORT_RES, STATUS_IMPORT_CHECK, STATUS_FILE_START, STATUS_FILE_DONE, STATUS_FILE_ERROR, - + STATUS_BEGIN_DECRYPTION, STATUS_END_DECRYPTION, STATUS_BEGIN_ENCRYPTION, STATUS_END_ENCRYPTION, STATUS_BEGIN_SIGNING, - + STATUS_DELETE_PROBLEM, STATUS_GET_BOOL, @@ -126,6 +126,7 @@ enum STATUS_TRUNCATED, STATUS_ERROR, + STATUS_FAILURE, STATUS_SUCCESS }; diff --git a/g10/cpr.c b/g10/cpr.c index 0fc45b1..3142ac4 100644 --- a/g10/cpr.c +++ b/g10/cpr.c @@ -303,6 +303,20 @@ write_status_begin_signing (gcry_md_hd_t md) } +/* Write a FAILURE status line. */ +void +write_status_failure (const char *where, gpg_error_t err) +{ + if (!statusfp || !status_currently_allowed (STATUS_FAILURE)) + return; /* Not enabled or allowed. */ + + fprintf (statusfp, "[GNUPG:] %s %s %u\n", + get_status_string (STATUS_FAILURE), where, err); + if (fflush (statusfp) && opt.exit_on_status_write_error) + g10_exit (0); +} + + static int myread(int fd, void *buf, size_t count) { diff --git a/g10/gpg.c b/g10/gpg.c index 3fb598c..4f71bf4 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -3504,15 +3504,21 @@ main (int argc, char **argv) if( argc > 1 ) wrong_args(_("--store [filename]")); if( (rc = encode_store(fname)) ) + { + write_status_failure ("store", rc); log_error ("storing `%s' failed: %s\n", print_fname_stdin(fname),g10_errstr(rc) ); + } break; case aSym: /* encrypt the given file only with the symmetric cipher */ if( argc > 1 ) wrong_args(_("--symmetric [filename]")); if( (rc = encode_symmetric(fname)) ) + { + write_status_failure ("symencrypt", rc); log_error (_("symmetric encryption of `%s' failed: %s\n"), print_fname_stdin(fname),g10_errstr(rc) ); + } break; case aEncr: /* encrypt the given file */ @@ -3523,8 +3529,11 @@ main (int argc, char **argv) if( argc > 1 ) wrong_args(_("--encrypt [filename]")); if( (rc = encode_crypt(fname,remusr,0)) ) - log_error("%s: encryption failed: %s\n", - print_fname_stdin(fname), g10_errstr(rc) ); + { + write_status_failure ("encrypt", rc); + log_error("%s: encryption failed: %s\n", + print_fname_stdin(fname), g10_errstr(rc) ); + } } break; @@ -3544,8 +3553,11 @@ main (int argc, char **argv) else { if( (rc = encode_crypt(fname,remusr,1)) ) - log_error("%s: encryption failed: %s\n", - print_fname_stdin(fname), g10_errstr(rc) ); + { + write_status_failure ("encrypt", rc); + log_error("%s: encryption failed: %s\n", + print_fname_stdin(fname), g10_errstr(rc) ); + } } break; @@ -3564,7 +3576,10 @@ main (int argc, char **argv) } } if( (rc = sign_file( sl, detached_sig, locusr, 0, NULL, NULL)) ) + { + write_status_failure ("sign", rc); log_error("signing failed: %s\n", g10_errstr(rc) ); + } free_strlist(sl); break; @@ -3578,8 +3593,11 @@ main (int argc, char **argv) else sl = NULL; if( (rc = sign_file(sl, detached_sig, locusr, 1, remusr, NULL)) ) + { + write_status_failure ("sign-encrypt", rc); log_error("%s: sign+encrypt failed: %s\n", print_fname_stdin(fname), g10_errstr(rc) ); + } free_strlist(sl); break; @@ -3602,8 +3620,11 @@ main (int argc, char **argv) else sl = NULL; if( (rc = sign_file(sl, detached_sig, locusr, 2, remusr, NULL)) ) - log_error("%s: symmetric+sign+encrypt failed: %s\n", - print_fname_stdin(fname), g10_errstr(rc) ); + { + write_status_failure ("sign-encrypt", rc); + log_error("%s: symmetric+sign+encrypt failed: %s\n", + print_fname_stdin(fname), g10_errstr(rc) ); + } free_strlist(sl); } break; @@ -3613,16 +3634,22 @@ main (int argc, char **argv) wrong_args(_("--sign --symmetric [filename]")); rc = sign_symencrypt_file (fname, locusr); if (rc) + { + write_status_failure ("sign-symencrypt", rc); log_error("%s: sign+symmetric failed: %s\n", print_fname_stdin(fname), g10_errstr(rc) ); + } break; case aClearsign: /* make a clearsig */ if( argc > 1 ) wrong_args(_("--clearsign [filename]")); if( (rc = clearsign_file(fname, locusr, NULL)) ) + { + write_status_failure ("sign", rc); log_error("%s: clearsign failed: %s\n", print_fname_stdin(fname), g10_errstr(rc) ); + } break; case aVerify: @@ -3636,6 +3663,8 @@ main (int argc, char **argv) if( (rc = verify_signatures( argc, argv ) )) log_error("verify signatures failed: %s\n", g10_errstr(rc) ); } + if (rc) + write_status_failure ("verify", rc); break; case aDecrypt: @@ -3646,7 +3675,10 @@ main (int argc, char **argv) if( argc > 1 ) wrong_args(_("--decrypt [filename]")); if( (rc = decrypt_message( fname ) )) - log_error("decrypt_message failed: %s\n", g10_errstr(rc) ); + { + write_status_failure ("decrypt", rc); + log_error("decrypt_message failed: %s\n", g10_errstr(rc)); + } } break; @@ -3780,11 +3812,20 @@ main (int argc, char **argv) if(rc) { if(cmd==aSendKeys) - log_error(_("keyserver send failed: %s\n"),g10_errstr(rc)); + { + write_status_failure ("send-keys", rc); + log_error(_("keyserver send failed: %s\n"),g10_errstr(rc)); + } else if(cmd==aRecvKeys) - log_error(_("keyserver receive failed: %s\n"),g10_errstr(rc)); + { + write_status_failure ("recv-keys", rc); + log_error(_("keyserver receive failed: %s\n"),g10_errstr(rc)); + } else - log_error(_("key export failed: %s\n"),g10_errstr(rc)); + { + write_status_failure ("export", rc); + log_error(_("key export failed: %s\n"),g10_errstr(rc)); + } } free_strlist(sl); break; @@ -3795,7 +3836,10 @@ main (int argc, char **argv) append_to_strlist2( &sl, *argv, utf8_strings ); rc=keyserver_search( sl ); if(rc) - log_error(_("keyserver search failed: %s\n"),g10_errstr(rc)); + { + write_status_failure ("search-keys", rc); + log_error(_("keyserver search failed: %s\n"), g10_errstr(rc)); + } free_strlist(sl); break; @@ -3805,7 +3849,10 @@ main (int argc, char **argv) append_to_strlist2( &sl, *argv, utf8_strings ); rc=keyserver_refresh(sl); if(rc) - log_error(_("keyserver refresh failed: %s\n"),g10_errstr(rc)); + { + write_status_failure ("refresh-keys", rc); + log_error(_("keyserver refresh failed: %s\n"),g10_errstr(rc)); + } free_strlist(sl); break; @@ -3815,7 +3862,10 @@ main (int argc, char **argv) append_to_strlist2( &sl, *argv, utf8_strings ); rc=keyserver_fetch(sl); if(rc) - log_error("key fetch failed: %s\n",g10_errstr(rc)); + { + write_status_failure ("fetch-keys", rc); + log_error("key fetch failed: %s\n",g10_errstr(rc)); + } free_strlist(sl); break; @@ -3856,7 +3906,10 @@ main (int argc, char **argv) wrong_args("--dearmor [file]"); rc = dearmor_file( argc? *argv: NULL ); if( rc ) + { + write_status_failure ("dearmor", rc); log_error(_("dearmoring failed: %s\n"), g10_errstr(rc)); + } break; case aEnArmor: @@ -3864,7 +3917,10 @@ main (int argc, char **argv) wrong_args("--enarmor [file]"); rc = enarmor_file( argc? *argv: NULL ); if( rc ) + { + write_status_failure ("enarmor", rc); log_error(_("enarmoring failed: %s\n"), g10_errstr(rc)); + } break; @@ -4053,7 +4109,7 @@ main (int argc, char **argv) else if (argc == 1) change_pin (atoi (*argv),1); else - wrong_args ("--change-pin [no]"); + wrong_args ("--change-pin [no]"); break; #endif /* ENABLE_CARD_SUPPORT*/ @@ -4105,7 +4161,10 @@ main (int argc, char **argv) } rc = proc_packets(NULL, a ); if( rc ) + { + write_status_failure ("-", rc); log_error("processing message failed: %s\n", g10_errstr(rc) ); + } iobuf_close(a); } break; diff --git a/g10/main.h b/g10/main.h index 4ee1b73..86fbabe 100644 --- a/g10/main.h +++ b/g10/main.h @@ -163,6 +163,7 @@ void set_status_fd ( int fd ); int is_status_enabled ( void ); void write_status ( int no ); void write_status_error (const char *where, int errcode); +void write_status_failure (const char *where, gpg_error_t err); void write_status_text ( int no, const char *text ); void write_status_strings (int no, const char *text, ...) GNUPG_GCC_A_SENTINEL(0); commit 0b01bb7f253fc1f9422e59dc475fa86854b46f69 Author: Werner Koch Date: Fri May 8 16:30:04 2015 +0200 gpg: Avoid cluttering stdout with trustdb info in verbose mode. * g10/trustdb.c (validate_keys): Call dump_key_array only in debug mode. -- I guess that is a left-over from an early attempt to output information on the trustdb for use by other tools. Maybe related to the former --list-trust-path command. Sending it to stdout is probably useful so we do this now only in debug mode. Signed-off-by: Werner Koch Backported to STABLE-BRANCH-2-0 from b03a2647299a6c8764a2574590cbaccdff9e497d by dkg diff --git a/g10/trustdb.c b/g10/trustdb.c index 11b6a26..9b49b06 100644 --- a/g10/trustdb.c +++ b/g10/trustdb.c @@ -2445,7 +2445,7 @@ validate_keys (int interactive) ; /* Store the calculated valididation status somewhere */ - if (opt.verbose > 1) + if (opt.verbose > 1 && DBG_TRUST) dump_key_array (depth, keys); for (kar=keys; kar->keyblock; kar++) ----------------------------------------------------------------------- Summary of changes: AUTHORS | 6 ++-- NEWS | 17 ++++++++++- README | 2 +- common/status.h | 11 +++---- configure.ac | 2 +- g10/cpr.c | 14 +++++++++ g10/gpg.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++---------- g10/main.h | 1 + g10/trustdb.c | 2 +- po/be.po | 20 ++++++++----- po/ca.po | 20 ++++++++----- po/cs.po | 21 ++++++++----- po/da.po | 21 ++++++++----- po/de.po | 22 ++++++++------ po/el.po | 20 ++++++++----- po/eo.po | 20 ++++++++----- po/es.po | 21 ++++++++----- po/et.po | 20 ++++++++----- po/fi.po | 21 ++++++++----- po/fr.po | 21 ++++++++----- po/gl.po | 20 ++++++++----- po/hu.po | 20 ++++++++----- po/id.po | 20 ++++++++----- po/it.po | 20 ++++++++----- po/ja.po | 21 ++++++++----- po/nb.po | 21 ++++++++----- po/nl.po | 21 ++++++++----- po/pl.po | 21 ++++++++----- po/pt.po | 20 ++++++++----- po/pt_BR.po | 20 ++++++++----- po/ro.po | 21 ++++++++----- po/ru.po | 57 +++++++++++++++-------------------- po/sk.po | 20 ++++++++----- po/sv.po | 23 +++++++++------ po/tr.po | 21 ++++++++----- po/uk.po | 23 ++++++++++----- po/zh_CN.po | 21 ++++++++----- po/zh_TW.po | 21 ++++++++----- 38 files changed, 496 insertions(+), 289 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 8 17:42:35 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 08 Sep 2015 17:42:35 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.29-2-g6aa0650 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, STABLE-BRANCH-2-0 has been updated via 6aa065076f532b956f10d59a7d303caf81b41606 (commit) from 0a88cd186f2943eb5ff6839ce0299d313c1d958d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6aa065076f532b956f10d59a7d303caf81b41606 Author: Werner Koch Date: Tue Sep 8 17:39:46 2015 +0200 doc: Allow uploading of a 2.0 manual -- diff --git a/doc/Makefile.am b/doc/Makefile.am index 376a8f3..0be9668 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -140,8 +140,8 @@ online: gnupg.html gnupg.pdf if echo "@PACKAGE_VERSION@" | grep -- "-git" >/dev/null; then \ dashdevel="-devel" ; \ else \ - rsync -v gnupg.pdf $${user}@$${webhost}:webspace/manuals/ ; \ + scp gnupg.pdf $${user}@$${webhost}:webspace/manuals/gnupg-2.0.pdf ; \ fi ; \ cd gnupg.html ; \ rsync -vr --exclude='.git' . \ - $${user}@$${webhost}:webspace/manuals/gnupg$${dashdevel}/ + $${user}@$${webhost}:webspace/manuals/gnupg-2.0$${dashdevel}/ ----------------------------------------------------------------------- Summary of changes: doc/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 8 18:01:53 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 08 Sep 2015 18:01:53 +0200 Subject: [git] gnupg-doc - branch, master, updated. d8c322f0ffa30bc89e87d9510a607b6eec6772cc Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GnuPG website and other docs". The branch, master has been updated via d8c322f0ffa30bc89e87d9510a607b6eec6772cc (commit) from 18bc4dfa1e5a6b7dff10cf99422a5369053060d5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d8c322f0ffa30bc89e87d9510a607b6eec6772cc Author: Werner Koch Date: Tue Sep 8 17:50:49 2015 +0200 swdb: Release of libgcrypt 1.6.4 and GnuPG 2.0.29 diff --git a/web/documentation/mailing-lists.org b/web/documentation/mailing-lists.org index 0568542..ca898a1 100644 --- a/web/documentation/mailing-lists.org +++ b/web/documentation/mailing-lists.org @@ -26,7 +26,6 @@ the service provided at [[http://marc.info/]]. | [[http://lists.gnupg.org/pipermail/gnupg-ru/][gnupg-ru]] | Help among Russian speaking users | ru | | | | | | [[http://lists.gnupg.org/pipermail/gnupg-devel/][gnupg-devel]] | Development discussion and bug tracking | en | -| [[http://lists.gnupg.org/pipermail/gpa-dev/][gpa-dev]] | Development of the GNU Privacy Assistant | en | | [[http://lists.gnupg.org/pipermail/gcrypt-devel/][gcrypt-devel]] | Development of Libgcrypt | en | | [[http://lists.gnupg.org/pipermail/gnupg-doc/][gnupg-doc]] | Development of documentation | en | | [[http://lists.gnupg.org/pipermail/gnupg-commits/][gnupg-commits]] | Commit messages (read-only) | en | diff --git a/web/documentation/manuals.org b/web/documentation/manuals.org index c324329..3dee9ca 100644 --- a/web/documentation/manuals.org +++ b/web/documentation/manuals.org @@ -8,7 +8,7 @@ document features not yet available in the released software version. - GnuPG (2.1) manual : [[file:manuals/gnupg/][HTML]], [[file:manuals/gnupg.pdf][PDF]] -# , [[file:manuals/gnupg-devel/][HTML (draft)]]. + - GnuPG (2.0) manual : [[file:manuals/gnupg-2.0/][HTML]], [[file:manuals/gnupg-2.0.pdf][PDF]] - Libgcrypt manual : [[file:manuals/gcrypt/][HTML]], [[file:manuals/gcrypt.pdf][PDF]], [[file:manuals/gcrypt-devel/][HTML (draft)]]. - Libksba manual : [[file:manuals/ksba/][HTML]], [[file:manuals/ksba.pdf][PDF]]. - Libassuan manual : [[file:manuals/assuan/][HTML]], [[file:manuals/assuan.pdf][PDF]]. diff --git a/web/index.org b/web/index.org index f21adb2..da90d13 100644 --- a/web/index.org +++ b/web/index.org @@ -64,6 +64,16 @@ The latest release news:\\ # GnuPG's latest news are available as [[http://feedvalidator.org/check.cgi?url%3Dhttps://www.gnupg.org/news.en.rss][RSS 2.0 compliant]] feed. Just # point or paste the [[news.en.rss][RSS file]] into your aggregator. +** GnuPG 2.0.29 released (2015-09-08) + +GnuPG 2.0.29 is now available. This release fixes a couple of bugs; +users of GnuPG 2.0.x may want to update to this version. [[http://lists.gnupg.org/pipermail/gnupg-announce/2015q3/000376.html][{more}]] + +** Libgcrypt 1.6.4 released (2015-09-08) + +Libgcrypt version 1.6.4 has been released to fix a few minor bugs and +a crash on newer Windows versions. [[http://lists.gnupg.org/pipermail/gnupg-announce/2015q3/000375.html][{more}]] + ** Libassuan 2.3.0 released (2015-08-28) [[file:related_software/libassuan/index.org][Libassuan]] is a generic [[https://en.wikipedia.org/wiki/Inter-process_communication][IPC]] library used by GnuPG, GPGME, and a few diff --git a/web/swdb.mac b/web/swdb.mac index 81ef4eb..d0aa768 100644 --- a/web/swdb.mac +++ b/web/swdb.mac @@ -10,10 +10,10 @@ # # GnuPG # -#+macro: gnupg_ver 2.0.28 +#+macro: gnupg_ver 2.0.29 #+macro: gnupg_branch STABLE-BRANCH-2-0 -#+macro: gnupg_size 4332k -#+macro: gnupg_sha1 9a1050f72b6c9afe2b4a0a3f2e9dca2abba8e4ef +#+macro: gnupg_size 4313k +#+macro: gnupg_sha1 87eb0df18f9953675f979405a1af10ab6c5322b3 # # GnuPG-2.1 @@ -71,9 +71,9 @@ # # LIBGCRYPT # -#+macro: libgcrypt_ver 1.6.3 -#+macro: libgcrypt_size 2436k -#+macro: libgcrypt_sha1 9456e7b64db9df8360a1407a38c8c958da80bbf1 +#+macro: libgcrypt_ver 1.6.4 +#+macro: libgcrypt_size 2490k +#+macro: libgcrypt_sha1 ed52add1ce635deeb2f5c6650e52667debd4ec70 # ----------------------------------------------------------------------- Summary of changes: web/documentation/mailing-lists.org | 1 - web/documentation/manuals.org | 2 +- web/index.org | 10 ++++++++++ web/swdb.mac | 12 ++++++------ 4 files changed, 17 insertions(+), 8 deletions(-) hooks/post-receive -- The GnuPG website and other docs http://git.gnupg.org From cvs at cvs.gnupg.org Wed Sep 9 10:43:06 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Wed, 09 Sep 2015 10:43:06 +0200 Subject: [git] GPA - branch, master, updated. gpa-0.9.8-1-gdcc5bb7 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Assistant". The branch, master has been updated via dcc5bb7d3407b2bbfa368a89b76423865651183d (commit) via e41f77ac6b55c6b564c9e180a3b73736e3c762bf (commit) via b34ba7483e837da9569e79a3d925891af48799d7 (commit) via ef241c039d8500a8c39927a9c38ccf8b23395bc6 (commit) via 70b3b1415e1fa904e864b32c83fc6b51116e9587 (commit) via dde3d6b27dbc91a84387d6bdbfab1ddd413af013 (commit) from 347e2a436a7d5e936df295875edea8e1d4a22120 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit dcc5bb7d3407b2bbfa368a89b76423865651183d Author: Werner Koch Date: Wed Sep 9 10:39:58 2015 +0200 Post release updates. -- diff --git a/NEWS b/NEWS index efe88ee..88db487 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Noteworthy changes in version 0.9.9 (unreleased) +------------------------------------------------ + + Noteworthy changes in version 0.9.8 (2015-09-09) ------------------------------------------------ diff --git a/configure.ac b/configure.ac index abdcc48..7efcc39 100644 --- a/configure.ac +++ b/configure.ac @@ -28,7 +28,7 @@ min_automake_version="1.10" # (git tag -s gpa-1.n.m) and run "./autogen.sh --force". Please # bump the version number immediately *after* the release and do # another commit and push so that the git magic is able to work. -m4_define([mym4_version], [0.9.8]) +m4_define([mym4_version], [0.9.9]) # Below is m4 magic to extract and compute the git revision number, # the decimalized short revision number, a beta version string and a commit e41f77ac6b55c6b564c9e180a3b73736e3c762bf Author: Werner Koch Date: Wed Sep 9 09:47:45 2015 +0200 Release 0.9.8 Signed-off-by: Werner Koch diff --git a/NEWS b/NEWS index 6d05352..efe88ee 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,16 @@ -Noteworthy changes in version 0.9.8 (unreleased) +Noteworthy changes in version 0.9.8 (2015-09-09) ------------------------------------------------ + * Does start with the clipboard view after a key has been created. + + * Limit the size of dialogs by truncating too long user ids. + + * Make the window frame's close button work as expected. + + * With a decent version of libgpgme the key algorithm and size is + shown using the GnuPG 2.1 format. + + Noteworthy changes in version 0.9.7 (2014-12-12) ------------------------------------------------ diff --git a/configure.ac b/configure.ac index 78441de..abdcc48 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # configure.ac for GPA # Copyright (C) 2000, 2001 Werner Koch # Copyright (C) 2002, 2003, 2004 Miguel Coca -# Copyright (C) 2005-2014 g10 Code GmbH +# Copyright (C) 2005-2015 g10 Code GmbH # # This file is part of GPA. # diff --git a/src/gpa.c b/src/gpa.c index 80f4016..6dbc5cd 100644 --- a/src/gpa.c +++ b/src/gpa.c @@ -1,6 +1,6 @@ /* gpa.c - The GNU Privacy Assistant main file. Copyright (C) 2000-2002 G-N-U GmbH. - Copyright (C) 2005, 2008, 2012, 2014 g10 Code GmbH. + Copyright (C) 2005, 2008, 2012, 2014, 2015 g10 Code GmbH. This file is part of GPA @@ -87,7 +87,7 @@ static gpa_args_t args; /* The copyright notice. */ static const char *copyright = "Copyright (C) 2000-2002 Miguel Coca, G-N-U GmbH, Intevation GmbH.\n" -"Copyright (C) 2005-2014 g10 Code GmbH.\n" +"Copyright (C) 2005-2015 g10 Code GmbH.\n" "This program comes with ABSOLUTELY NO WARRANTY.\n" "This is free software, and you are welcome to redistribute it\n" "under certain conditions. See the file COPYING for details.\n"; diff --git a/src/helpmenu.c b/src/helpmenu.c index 0b1b123..55e1f54 100644 --- a/src/helpmenu.c +++ b/src/helpmenu.c @@ -72,8 +72,8 @@ gpa_help_about (GtkAction *action, GtkWindow *window) static const gchar copyright[] = "Copyright \xc2\xa9 2000-2002 G-N-U GmbH\n" "Copyright \xc2\xa9 2002-2003 Miguel Coca\n" - "Copyright \xc2\xa9 2005-2014 g10 Code GmbH"; - static const gchar website[] = "https://www.gnupg.org/related_software/gpa/"; + "Copyright \xc2\xa9 2005-2015 g10 Code GmbH"; + static const gchar website[] = "https://gnupg.org/related_software/gpa/"; static const gchar website_label[] = "www.gnupg.org"; char *comment; GdkPixbuf *logo; commit b34ba7483e837da9569e79a3d925891af48799d7 Author: Werner Koch Date: Wed Sep 9 09:44:11 2015 +0200 po: Auto-update -- diff --git a/po/ar.po b/po/ar.po index bd80f9c..2656d8c 100644 --- a/po/ar.po +++ b/po/ar.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: GPA\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2011-12-12 10:14+0100\n" "Last-Translator: \n" "Language-Team: Arabic \n" @@ -651,6 +651,9 @@ msgstr "?????????? ????????????????:" msgid "Key ID:" msgstr "???????????? ??????????????:" +msgid "Fingerprint:" +msgstr "????????????:" + msgid "Expiration" msgstr "???????????? ????????????????" @@ -1391,9 +1394,6 @@ msgstr[5] "???????????? %d ??????????" msgid "User name:" msgstr "?????? ????????????????:" -msgid "Fingerprint:" -msgstr "????????????:" - msgid "Expires at:" msgstr "?????????? ????:" diff --git a/po/cs.po b/po/cs.po index 86eb916..deef631 100644 --- a/po/cs.po +++ b/po/cs.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: cs\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2014-09-11 09:17+0100\n" "Last-Translator: Zden??k Hata?? \n" "Language-Team: czech \n" @@ -619,6 +619,9 @@ msgstr "Jm??na u??ivatel??:" msgid "Key ID:" msgstr "ID kl????e:" +msgid "Fingerprint:" +msgstr "Otisk:" + msgid "Expiration" msgstr "Platnost do" @@ -1336,9 +1339,6 @@ msgstr[2] "%d kl?????? vybr??no" msgid "User name:" msgstr "U??ivatelsk?? jm??no:" -msgid "Fingerprint:" -msgstr "Otisk:" - msgid "Expires at:" msgstr "Vypr????:" diff --git a/po/de.po b/po/de.po index 0a21488..d320d50 100644 --- a/po/de.po +++ b/po/de.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: gpa\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2014-12-08 17:36+0100\n" "Last-Translator: Werner Koch \n" "Language-Team: German \n" @@ -620,6 +620,9 @@ msgstr "Benutzernamen:" msgid "Key ID:" msgstr "Schl??sselkennung:" +msgid "Fingerprint:" +msgstr "Fingerabdruck:" + msgid "Expiration" msgstr "Verfallsdatum" @@ -1348,9 +1351,6 @@ msgstr[1] "%d Schl??ssel ausgew??hlt" msgid "User name:" msgstr "Benutzerkennung:" -msgid "Fingerprint:" -msgstr "Fingerabdruck:" - msgid "Expires at:" msgstr "ung??ltig ab:" diff --git a/po/es.po b/po/es.po index 450643a..0cc82e7 100644 --- a/po/es.po +++ b/po/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: GPA 0.7.0\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2008-03-11 09:35+0100\n" "Last-Translator: \n" "Language-Team: Spanish \n" @@ -658,6 +658,9 @@ msgstr "Nombres de Usuario:" msgid "Key ID:" msgstr "ID de Clave:" +msgid "Fingerprint:" +msgstr "Huella dactilar:" + msgid "Expiration" msgstr "Caducidad" @@ -1415,9 +1418,6 @@ msgstr[1] "%d claves seleccionadas" msgid "User name:" msgstr "Nombre de Usuario:" -msgid "Fingerprint:" -msgstr "Huella dactilar:" - msgid "Expires at:" msgstr "Caduca el:" diff --git a/po/fr.po b/po/fr.po index 72ef2f4..077d787 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: GPA 0.8.0\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2014-12-08 17:37+0100\n" "Last-Translator: Eric Lassauge \n" "Language-Team: \n" @@ -647,6 +647,9 @@ msgstr "Noms d'utilisateur :" msgid "Key ID:" msgstr "ID de clef :" +msgid "Fingerprint:" +msgstr "Empreinte :" + msgid "Expiration" msgstr "Expiration" @@ -1381,9 +1384,6 @@ msgstr[1] "%d clefs s??lectionn??es" msgid "User name:" msgstr "Nom d'utilisateur :" -msgid "Fingerprint:" -msgstr "Empreinte :" - msgid "Expires at:" msgstr "Expire le :" diff --git a/po/ja.po b/po/ja.po index e638474..82717cc 100644 --- a/po/ja.po +++ b/po/ja.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: GPA 0.6.1-cvs\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2003-11-03 17:11+0100\n" "Last-Translator: TAKAHASHI Tamotsu \n" "Language-Team: Japanese \n" @@ -669,6 +669,9 @@ msgstr " msgid "Key ID:" msgstr "?? ID:" +msgid "Fingerprint:" +msgstr "????:" + msgid "Expiration" msgstr "????" @@ -1406,9 +1409,6 @@ msgstr[1] "%d msgid "User name:" msgstr "????????:" -msgid "Fingerprint:" -msgstr "????:" - msgid "Expires at:" msgstr "????????:" diff --git a/po/nl.po b/po/nl.po index 9e4ef5b..5885cdf 100644 --- a/po/nl.po +++ b/po/nl.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: GPA 0.5.1\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2003-10-19 14:29+0200\n" "Last-Translator: Michael Anckaert \n" "Language-Team: DUTCH \n" @@ -669,6 +669,9 @@ msgstr "Gebruikers Namen:" msgid "Key ID:" msgstr "Sleutel ID:" +msgid "Fingerprint:" +msgstr "Vingerafdruk:" + msgid "Expiration" msgstr "Vervaldag" @@ -1414,9 +1417,6 @@ msgstr[1] "%d sleutels geselecteerd" msgid "User name:" msgstr "Gebruiker naam:" -msgid "Fingerprint:" -msgstr "Vingerafdruk:" - msgid "Expires at:" msgstr "Vervalt op:" diff --git a/po/pl.po b/po/pl.po index fe3a4cf..83b56ca 100644 --- a/po/pl.po +++ b/po/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gpa-0.7\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2004-08-22 02:23+0200\n" "Last-Translator: Emilian Nowak \n" "Language-Team: Polish \n" @@ -666,6 +666,9 @@ msgstr "Nazwy u??ytkownika:" msgid "Key ID:" msgstr "ID klucza:" +msgid "Fingerprint:" +msgstr "Odcisk klucza:" + msgid "Expiration" msgstr "Data ko??ca wa??no??ci" @@ -1414,9 +1417,6 @@ msgstr[1] "wybranych kluczy - %d" msgid "User name:" msgstr "Nazwa u??ytkownika:" -msgid "Fingerprint:" -msgstr "Odcisk klucza:" - msgid "Expires at:" msgstr "Traci wa??no????:" diff --git a/po/pt_BR.po b/po/pt_BR.po index 4dad738..8ddaf7e 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: GPA 0.6.1\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2003-01-20 18:39+0100\n" "Last-Translator: Renato Martini \n" "Language-Team: PORTUGUES \n" @@ -671,6 +671,9 @@ msgstr "Nomes de Usu msgid "Key ID:" msgstr "Key ID:" +msgid "Fingerprint:" +msgstr "Impress?o digital:" + msgid "Expiration" msgstr "Expira??o" @@ -1411,9 +1414,6 @@ msgstr[1] "%d chaves selecionadas" msgid "User name:" msgstr "Nome do Usu?rio:" -msgid "Fingerprint:" -msgstr "Impress?o digital:" - msgid "Expires at:" msgstr "Expira em:" diff --git a/po/ru.po b/po/ru.po index 67515f4..5dbbdc5 100644 --- a/po/ru.po +++ b/po/ru.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: GPA 0.8\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2011-12-12 10:17+0100\n" "Last-Translator: Sergei Smirnov \n" "Language-Team: Russian \n" @@ -653,6 +653,9 @@ msgstr "??????????:" msgid "Key ID:" msgstr "ID ??????????:" +msgid "Fingerprint:" +msgstr "??????????????????:" + msgid "Expiration" msgstr "???????? ????????????????" @@ -1404,9 +1407,6 @@ msgstr[2] "%d ???????????? ??????????????" msgid "User name:" msgstr "??????:" -msgid "Fingerprint:" -msgstr "??????????????????:" - msgid "Expires at:" msgstr "?????????? ????:" diff --git a/po/sv.po b/po/sv.po index ac6e140..621df01 100644 --- a/po/sv.po +++ b/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: gpa\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2011-12-12 10:13+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" @@ -636,6 +636,9 @@ msgstr "Anv??ndarnamn:" msgid "Key ID:" msgstr "Nyckelidentitet:" +msgid "Fingerprint:" +msgstr "Fingeravtryck:" + msgid "Expiration" msgstr "Utg??ngstid" @@ -1357,9 +1360,6 @@ msgstr[1] "%d nycklar markerade" msgid "User name:" msgstr "Anv??ndarnamn:" -msgid "Fingerprint:" -msgstr "Fingeravtryck:" - msgid "Expires at:" msgstr "G??r ut den:" diff --git a/po/tr.po b/po/tr.po index 08097c3..11d66b4 100644 --- a/po/tr.po +++ b/po/tr.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gpa 0.7.0\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2011-12-12 10:14+0100\n" "Last-Translator: Mert ?etin \n" "Language-Team: xTc & D?j? Vu\n" @@ -664,6 +664,9 @@ msgstr "Kullan msgid "Key ID:" msgstr "Anahtar Kimli?i:" +msgid "Fingerprint:" +msgstr "Parmakizi:" + msgid "Expiration" msgstr "Sona Erme" @@ -1407,9 +1410,6 @@ msgstr[1] "%d anahtar se msgid "User name:" msgstr "Kullan?c? Ad?:" -msgid "Fingerprint:" -msgstr "Parmakizi:" - msgid "Expires at:" msgstr "Bitim tarihi:" diff --git a/po/zh_TW.po b/po/zh_TW.po index 695a955..e74310a 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: gpa-0.7.0\n" -"Report-Msgid-Bugs-To: gpa-dev at gnupg.org\n" +"Report-Msgid-Bugs-To: translations at gnupg.org\n" "PO-Revision-Date: 2003-10-20 11:55+0200\n" "Last-Translator: Shell Hung \n" "Language-Team: Hong Kong Linux User Group \n" @@ -660,6 +660,9 @@ msgstr " msgid "Key ID:" msgstr "?K?_ ID:" +msgid "Fingerprint:" +msgstr "????:" + msgid "Expiration" msgstr "??????" @@ -1388,9 +1391,6 @@ msgstr[1] "%d msgid "User name:" msgstr "?????W?? :" -msgid "Fingerprint:" -msgstr "????:" - msgid "Expires at:" msgstr "????????:" commit ef241c039d8500a8c39927a9c38ccf8b23395bc6 Author: Werner Koch Date: Wed Sep 9 09:45:24 2015 +0200 build: Use AC_PROG_MKDIR_P to silence autoconf warning. * m4/po.m4: Use modern macro. Signed-off-by: Werner Koch diff --git a/m4/po.m4 b/m4/po.m4 index 47f36a4..3c9884b 100644 --- a/m4/po.m4 +++ b/m4/po.m4 @@ -24,7 +24,7 @@ AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + AC_REQUIRE([AC_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that commit 70b3b1415e1fa904e864b32c83fc6b51116e9587 Author: Werner Koch Date: Wed Sep 9 09:46:03 2015 +0200 build: Update config.guess et al. -- diff --git a/build-aux/compile b/build-aux/compile new file mode 100755 index 0000000..531136b --- /dev/null +++ b/build-aux/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/build-aux/config.guess b/build-aux/config.guess index f475ceb..dbfb978 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2013-02-12' +timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ timestamp='2013-02-12' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches with a ChangeLog entry to config-patches at gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -132,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -558,8 +579,9 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -805,7 +827,7 @@ EOF *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -853,21 +875,21 @@ EOF exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -880,59 +902,54 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -951,57 +968,63 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1234,19 +1257,31 @@ EOF exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1337,154 +1372,6 @@ EOF exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +68,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -252,19 +252,20 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc \ + | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ - | fido | fr30 | frv \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -282,8 +283,10 @@ case $basic_machine in | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -295,11 +298,11 @@ case $basic_machine in | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -310,6 +313,7 @@ case $basic_machine in | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -324,7 +328,10 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -366,13 +373,13 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -381,6 +388,7 @@ case $basic_machine in | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -400,8 +408,10 @@ case $basic_machine in | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -413,6 +423,7 @@ case $basic_machine in | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -430,6 +441,7 @@ case $basic_machine in | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -767,6 +779,9 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -794,7 +809,7 @@ case $basic_machine in os=-mingw64 ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -822,6 +837,10 @@ case $basic_machine in basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -830,7 +849,7 @@ case $basic_machine in basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1367,14 +1386,14 @@ case $os in | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1546,6 +1565,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1589,9 +1611,6 @@ case $basic_machine in mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; diff --git a/build-aux/depcomp b/build-aux/depcomp index 91d4bf8..4ebd5b3 100755 --- a/build-aux/depcomp +++ b/build-aux/depcomp @@ -1,7 +1,7 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2012-10-18.11; # UTC +scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. @@ -251,6 +251,41 @@ hp) exit 1 ;; +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, @@ -517,6 +552,7 @@ $ { G p }' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; diff --git a/build-aux/missing b/build-aux/missing index 1c8ff70..db98974 100755 --- a/build-aux/missing +++ b/build-aux/missing @@ -1,11 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2006-05-10.23 +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,9 +17,7 @@ scriptversion=2006-05-10.23 # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -28,66 +25,40 @@ scriptversion=2006-05-10.23 # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi +case $1 in -msg="missing on your system" + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -99,269 +70,146 @@ Send bug reports to ." ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). -case $1 in - lex|yacc) - # Not GNU programs, they don't have --version. - ;; - - tar) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $1 in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG="\${$#}" - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - tar) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi -exit 0 +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: commit dde3d6b27dbc91a84387d6bdbfab1ddd413af013 Author: Werner Koch Date: Tue Sep 8 13:43:11 2015 +0200 Do not mention the now closed gpa-dev list. -- diff --git a/README b/README index 3985583..bbd660b 100644 --- a/README +++ b/README @@ -45,19 +45,17 @@ See the file INSTALL for installation details; in short: make make install -The configure scrits check whether all required libraries are +The configure scripts check whether all required libraries are installed and that they are recent enough. In order to do anything useful with GPA you also need the GNU Privacy Guard (GnuPG) version 2 -installed - see http://www.gnupg.org. - -Please report any problems to gpa-dev at gnupg.org. +installed - see https://gnupg.org. Installation under MS-Windows ============================= Instead of building GPA by yourself, you probably want to download -the ready-to-use installer from http://www.gpg4win.org, the light +the ready-to-use installer from https://www.gpg4win.org, the light installer is sufficient, don't you? ;-) If you want to do it your self, you need to have the Windows diff --git a/po/Makevars b/po/Makevars index a0df5f8..0d87a0d 100644 --- a/po/Makevars +++ b/po/Makevars @@ -18,7 +18,7 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. -COPYRIGHT_HOLDER = +COPYRIGHT_HOLDER = # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: @@ -34,7 +34,7 @@ COPYRIGHT_HOLDER = # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. -MSGID_BUGS_ADDRESS = gpa-dev at gnupg.org +MSGID_BUGS_ADDRESS = translations at gnupg.org # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. ----------------------------------------------------------------------- Summary of changes: NEWS | 16 +- README | 8 +- build-aux/compile | 347 +++++++++++++++++++++++++++++++++++++ build-aux/config.guess | 317 +++++++++++----------------------- build-aux/config.sub | 57 ++++-- build-aux/depcomp | 38 +++- build-aux/missing | 460 +++++++++++++++++-------------------------------- configure.ac | 4 +- m4/po.m4 | 2 +- po/Makevars | 4 +- po/ar.po | 8 +- po/cs.po | 8 +- po/de.po | 8 +- po/es.po | 8 +- po/fr.po | 8 +- po/ja.po | 8 +- po/nl.po | 8 +- po/pl.po | 8 +- po/pt_BR.po | 8 +- po/ru.po | 8 +- po/sv.po | 8 +- po/tr.po | 8 +- po/zh_TW.po | 8 +- src/gpa.c | 4 +- src/helpmenu.c | 4 +- 25 files changed, 757 insertions(+), 608 deletions(-) create mode 100755 build-aux/compile hooks/post-receive -- The GNU Privacy Assistant http://git.gnupg.org From cvs at cvs.gnupg.org Wed Sep 9 11:31:18 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Wed, 09 Sep 2015 11:31:18 +0200 Subject: [git] GPA - branch, master, updated. gpa-0.9.9-1-g2ece041 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Assistant". The branch, master has been updated via 2ece041f8cc18ce8c125a96db23067e4daa3e972 (commit) via d4756cd3638a3b34be7b798ef4d649f31c247e03 (commit) via 0841098155d33d46dcb3ed1fdbe5bb31aa4e1ff4 (commit) from dcc5bb7d3407b2bbfa368a89b76423865651183d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2ece041f8cc18ce8c125a96db23067e4daa3e972 Author: Werner Koch Date: Wed Sep 9 11:28:13 2015 +0200 Post release updates -- diff --git a/NEWS b/NEWS index 34a328a..00c7af0 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Noteworthy changes in version 0.9.10 (unreleased) +------------------------------------------------- + + Noteworthy changes in version 0.9.9 (2015-09-09) ------------------------------------------------ diff --git a/configure.ac b/configure.ac index 7efcc39..ca7c0a8 100644 --- a/configure.ac +++ b/configure.ac @@ -28,7 +28,7 @@ min_automake_version="1.10" # (git tag -s gpa-1.n.m) and run "./autogen.sh --force". Please # bump the version number immediately *after* the release and do # another commit and push so that the git magic is able to work. -m4_define([mym4_version], [0.9.9]) +m4_define([mym4_version], [0.9.10]) # Below is m4 magic to extract and compute the git revision number, # the decimalized short revision number, a beta version string and a commit d4756cd3638a3b34be7b798ef4d649f31c247e03 Author: Werner Koch Date: Wed Sep 9 11:18:40 2015 +0200 Release 0.9.9 diff --git a/NEWS b/NEWS index 88db487..34a328a 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ -Noteworthy changes in version 0.9.9 (unreleased) +Noteworthy changes in version 0.9.9 (2015-09-09) ------------------------------------------------ + * Fixed build problem in 0.9.8 if Libgpgme < 1.6.1 is used. + Noteworthy changes in version 0.9.8 (2015-09-09) ------------------------------------------------ commit 0841098155d33d46dcb3ed1fdbe5bb31aa4e1ff4 Author: Werner Koch Date: Wed Sep 9 11:17:38 2015 +0200 Fix build problem for gpgme < 1.6.1 * src/gpasubkeylist.c (SubkeyListColumn): Fix macro condition. Signed-off-by: Werner Koch diff --git a/src/gpasubkeylist.c b/src/gpasubkeylist.c index b37cf7b..fccef74 100644 --- a/src/gpasubkeylist.c +++ b/src/gpasubkeylist.c @@ -40,7 +40,7 @@ static gboolean query_tooltip_cb (GtkWidget *wdiget, int x, int y, typedef enum { SUBKEY_ID, -#if GPGME_VERSION_NUMBER >= 0x010601 /* GPGME < 1.6.1 */ +#if GPGME_VERSION_NUMBER < 0x010601 /* GPGME < 1.6.1 */ SUBKEY_SIZE, #endif SUBKEY_ALGO, ----------------------------------------------------------------------- Summary of changes: NEWS | 8 +++++++- configure.ac | 2 +- src/gpasubkeylist.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) hooks/post-receive -- The GNU Privacy Assistant http://git.gnupg.org From cvs at cvs.gnupg.org Wed Sep 9 11:42:24 2015 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Wed, 09 Sep 2015 11:42:24 +0200 Subject: [git] gnupg-doc - branch, master, updated. cd99714c8454fe6567e92f85feefdea4559518b8 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GnuPG website and other docs". The branch, master has been updated via cd99714c8454fe6567e92f85feefdea4559518b8 (commit) from d8c322f0ffa30bc89e87d9510a607b6eec6772cc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cd99714c8454fe6567e92f85feefdea4559518b8 Author: Werner Koch Date: Wed Sep 9 10:58:22 2015 +0200 swdb: Release of GPA 0.9.9 diff --git a/web/index.org b/web/index.org index da90d13..4e6be82 100644 --- a/web/index.org +++ b/web/index.org @@ -64,6 +64,13 @@ The latest release news:\\ # GnuPG's latest news are available as [[http://feedvalidator.org/check.cgi?url%3Dhttps://www.gnupg.org/news.en.rss][RSS 2.0 compliant]] feed. Just # point or paste the [[news.en.rss][RSS file]] into your aggregator. + +** GPA 0.9.9 released (2015-09-09) + +A new version of [[file:related_software/gpa/index.org][GPA]], the graphical frontend for GnuPG, is now +available. This release fixes a couple of bugs and has been changed +to show the clipboard view on startup. [[http://lists.gnupg.org/pipermail/gnupg-announce/2015q3/000378.html][{more}]] + ** GnuPG 2.0.29 released (2015-09-08) GnuPG 2.0.29 is now available. This release fixes a couple of bugs; diff --git a/web/swdb.mac b/web/swdb.mac index d0aa768..ae4abb2 100644 --- a/web/swdb.mac +++ b/web/swdb.mac @@ -46,9 +46,9 @@ # # GPA # -#+macro: gpa_ver 0.9.7 -#+macro: gpa_size 718k -#+macro: gpa_sha1 9eb07bcceeb986c7b6dbce8a18b82a2c344b50ce +#+macro: gpa_ver 0.9.9 +#+macro: gpa_size 721k +#+macro: gpa_sha1 1cf86c9e38aa553fdb880c55cbc6755901ad21a4 # ----------------------------------------------------------------------- Summary of changes: web/index.org | 7 +++++++ web/swdb.mac | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) hooks/post-receive -- The GnuPG website and other docs http://git.gnupg.org From cvs at cvs.gnupg.org Wed Sep 9 16:02:37 2015 From: cvs at cvs.gnupg.org (by Frans Spiesschaert) Date: Wed, 09 Sep 2015 16:02:37 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.29-3-g1dea374 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, STABLE-BRANCH-2-0 has been updated via 1dea3746b487666ef108cacc84a426bcc993fe51 (commit) from 6aa065076f532b956f10d59a7d303caf81b41606 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1dea3746b487666ef108cacc84a426bcc993fe51 Author: Frans Spiesschaert Date: Wed Sep 9 15:58:40 2015 +0200 po: Update Dutch translation -- diff --git a/po/nl.po b/po/nl.po index bf40d9f..2e519ac 100644 --- a/po/nl.po +++ b/po/nl.po @@ -1,4 +1,4 @@ -# Dutch translations for gnupg package. +# Dutch translations for package gnupg2. # Copyright (C) 2006 Free Software Foundation, Inc. # This file is distributed under the same license as the gnupg package. # Automatically generated, 2006. @@ -24,20 +24,21 @@ # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. -# Frans Spiesschaert , 2014. +# Frans Spiesschaert , 2014, 2015. # msgid "" msgstr "" -"Project-Id-Version: gnupg 2.0.27\n" +"Project-Id-Version: gnupg 2.0.28\n" "Report-Msgid-Bugs-To: translations at gnupg.org\n" -"PO-Revision-Date: 2014-11-24 21:22+0100\n" +"PO-Revision-Date: 2015-06-07 16:56+0200\n" "Last-Translator: Frans Spiesschaert \n" -"Language-Team: Dutch \n" +"Language-Team: Debian Dutch l10n Team \n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Gtranslator 2.91.6\n" #, c-format msgid "failed to acquire the pinentry lock: %s\n" @@ -54,36 +55,31 @@ msgstr "|pinentry-label|_OK" msgid "|pinentry-label|_Cancel" msgstr "|pinentry-label|_Annuleren" -#, fuzzy #| msgid "|pinentry-label|_OK" msgid "|pinentry-label|_Yes" -msgstr "|pinentry-label|_OK" +msgstr "|pinentry-label|_Ja" -#, fuzzy #| msgid "|pinentry-label|_OK" msgid "|pinentry-label|_No" -msgstr "|pinentry-label|_OK" +msgstr "|pinentry-label|_Nee" msgid "|pinentry-label|PIN:" msgstr "|pinentry-label|Pincode:" -#, fuzzy #| msgid "|pinentry-label|_Cancel" msgid "|pinentry-label|_Save in password manager" -msgstr "|pinentry-label|_Annuleren" +msgstr "|pinentry-label|_Bewaren in de wachtwoordmanager" -#, fuzzy #| msgid "Do you really want to revoke the selected subkeys? (y/N) " msgid "Do you really want to make your passphrase visible on the screen?" -msgstr "Wilt U de geselecteerde subsleutels echt intrekken? (j/N) " +msgstr "Wilt U uw wachtwoordzin echt zichtbaar maken op het scherm?" msgid "|pinentry-tt|Make passphrase visible" -msgstr "" +msgstr "|pinentry-tt|Wachtwoordzin zichtbaar maken" -#, fuzzy #| msgid "invalid passphrase" msgid "|pinentry-tt|Hide passphrase" -msgstr "ongeldige wachtwoordzin" +msgstr "|pinentry-tt|Wachtwoordzin verbergen" #. TRANSLATORS: This string is displayed by Pinentry as the label #. for the quality bar. @@ -414,10 +410,9 @@ msgstr "ssh-ondersteuning mogelijk maken" msgid "enable putty support" msgstr "putty-ondersteuning mogelijk maken" -#, fuzzy #| msgid "do not allow the reuse of old passphrases" msgid "disallow the use of an external password cache" -msgstr "laat het opnieuw gebruiken van oude wachtwoordzinnen niet toe" +msgstr "het gebruik van een externe wachtwoordcache niet toestaan" msgid "|FILE|write environment settings also to FILE" msgstr "|BESTAND|schrijf omgevingsinstellingen ook weg naar BESTAND" @@ -435,7 +430,7 @@ msgid "" "Syntax: gpg-agent [options] [command [args]]\n" "Secret key management for GnuPG\n" msgstr "" -"Syntaxis: gpg-agent [opties] [opdracht [parameters]]\n" +"Syntaxis: gpg-agent [opties] [opdracht [argumenten]]\n" "Beheer van geheime sleutels van GnuPG\n" #, c-format @@ -580,7 +575,7 @@ msgid "" "Syntax: gpg-protect-tool [options] [args]\n" "Secret key maintenance tool\n" msgstr "" -"Syntaxis: gpg-protect-tool [opties] [parameters]\n" +"Syntaxis: gpg-protect-tool [opties] [argumenten]\n" "Hulpmiddel voor het onderhoud van de geheime sleutels\n" msgid "Please enter the passphrase to unprotect the PKCS#12 object." @@ -3133,7 +3128,7 @@ msgid "You must select exactly one key.\n" msgstr "U moet exact ??n sleutel selecteren.\n" msgid "Command expects a filename argument\n" -msgstr "Commando verwacht een bestandsnaam als parameter\n" +msgstr "Commando verwacht een bestandsnaam als argument\n" #, c-format msgid "Can't open `%s': %s\n" @@ -3284,12 +3279,11 @@ msgstr "" " veronderstelde primaire ID worden.\n" msgid "WARNING: Your encryption subkey expires soon.\n" -msgstr "" +msgstr "Waarschuwing: Uw subsleutel voor versleutelen vervalt weldra.\n" -#, fuzzy #| msgid "You can't change the expiration date of a v3 key\n" msgid "You may want to change its expiration date too.\n" -msgstr "U kunt de vervaldatum van een v3-sleutel niet veranderen\n" +msgstr "Misschien wilt u ook zijn vervaldatum wijzigen.\n" msgid "" "WARNING: This is a PGP2-style key. Adding a photo ID may cause some " @@ -3987,11 +3981,6 @@ msgstr " Vingerafdruk van de subsleutel:" msgid " Key fingerprint =" msgstr " Vingerafdruk van de sleutel =" -#, fuzzy, c-format -#| msgid "WARNING: using experimental digest algorithm %s\n" -msgid "WARNING: a PGP-2 fingerprint is not safe\n" -msgstr "WAARSCHUWING: er wordt een experimenteel hashalgoritme %s gebruikt\n" - msgid " Card serial no. =" msgstr " Serienummer van de kaart =" @@ -4953,7 +4942,7 @@ msgid "(Probably you want to select %d here)\n" msgstr "(Wellicht wilt u hier %d kiezen)\n" msgid "Enter an optional description; end it with an empty line:\n" -msgstr "Voer een facultatieve beschrijving in; be?indig met een lege regel:\n" +msgstr "Voer een optionele beschrijving in; be?indig met een lege regel:\n" #, c-format msgid "Reason for revocation: %s\n" @@ -5192,14 +5181,6 @@ msgid "trustdb: sync failed: %s\n" msgstr "betrouwbaarheidsdatabank (trustdb): synchronisatie mislukt: %s\n" #, c-format -msgid "can't create lock for `%s'\n" -msgstr "kan geen grendel maken voor `%s'\n" - -#, c-format -msgid "can't lock `%s'\n" -msgstr "kan `%s' niet vergrendelen\n" - -#, c-format msgid "trustdb rec %lu: lseek failed: %s\n" msgstr "" "betrouwbaarheidsdatabank (trustdb): element %lu: lseek is mislukt: %s\n" @@ -5222,6 +5203,14 @@ msgid "%s: directory does not exist!\n" msgstr "%s: map bestaat niet!\n" #, c-format +msgid "can't create lock for `%s'\n" +msgstr "kan geen grendel maken voor `%s'\n" + +#, c-format +msgid "can't lock `%s'\n" +msgstr "kan `%s' niet vergrendelen\n" + +#, c-format msgid "%s: failed to create version record: %s" msgstr "%s: het registreren van de versie is mislukt: %s" @@ -5476,7 +5465,7 @@ msgid "can't open fd %d: %s\n" msgstr "kan bestandsindicator %d niet openen: %s\n" msgid "argument not expected" -msgstr "onverwachte parameter" +msgstr "onverwacht argument" msgid "read error" msgstr "leesfout" @@ -5485,12 +5474,11 @@ msgid "keyword too long" msgstr "sleutelwoord is te lang" msgid "missing argument" -msgstr "ontbrekende parameter" +msgstr "ontbrekend argument" -#, fuzzy #| msgid "invalid armor" msgid "invalid argument" -msgstr "ongeldig harnas" +msgstr "ongeldig argument" msgid "invalid command" msgstr "ongeldig commando" @@ -5506,16 +5494,16 @@ msgstr "ongeldige optie" #, c-format msgid "missing argument for option \"%.50s\"\n" -msgstr "ontbrekende parameter voor optie \"%.50s\"\n" +msgstr "ontbrekend argument voor optie \"%.50s\"\n" -#, fuzzy, c-format +#, c-format #| msgid "missing argument for option \"%.50s\"\n" msgid "invalid argument for option \"%.50s\"\n" -msgstr "ontbrekende parameter voor optie \"%.50s\"\n" +msgstr "ontbrekend argument voor optie \"%.50s\"\n" #, c-format msgid "option \"%.50s\" does not expect an argument\n" -msgstr "optie \"%.50s\" verwacht geen parameter\n" +msgstr "optie \"%.50s\" verwacht geen argument\n" #, c-format msgid "invalid command \"%.50s\"\n" @@ -6667,7 +6655,7 @@ msgstr "" #, c-format msgid "option \"%s\" requires a program and optional arguments\n" -msgstr "optie \"%s\" vereist een programma en facultatieve parameters\n" +msgstr "optie \"%s\" vereist een programma en optionele argumenten\n" #, c-format msgid "option \"%s\" ignored due to \"%s\"\n" @@ -6859,13 +6847,13 @@ msgid "usage: gpgconf [options] " msgstr "gebruik: gpgconf [opties] " msgid "Need one component argument" -msgstr "Een component als parameter is vereist" +msgstr "Een component als argument is vereist" msgid "Component not found" msgstr "Component niet gevonden" msgid "No argument allowed" -msgstr "Een parameter is niet toegelaten" +msgstr "Een argument is niet toegelaten" msgid "" "@\n" ----------------------------------------------------------------------- Summary of changes: po/nl.po | 86 ++++++++++++++++++++++++++++------------------------------------ 1 file changed, 37 insertions(+), 49 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Thu Sep 10 03:03:52 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Thu, 10 Sep 2015 03:03:52 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.29-4-gd4a2a07 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, STABLE-BRANCH-2-0 has been updated via d4a2a070b4b4d30a6bbdd4248421a23cf824d8c0 (commit) from 1dea3746b487666ef108cacc84a426bcc993fe51 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d4a2a070b4b4d30a6bbdd4248421a23cf824d8c0 Author: NIIBE Yutaka Date: Thu Sep 10 10:00:03 2015 +0900 gpgconf: Fix scdaemon reload. * tools/gpgconf-comp.c (scdaemon_runtime_change): Add "scd bye". -- In GnuPG 2.0.x, it doesn't require newer libassuan which has ASSUAN_FORCE_CLOSE feature. We need to send "scd bye" to let the control finish from command loop. diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index 2454f93..69d160e 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -1064,7 +1064,7 @@ scdaemon_runtime_change (void) { gpg_error_t err; const char *pgmname; - const char *argv[6]; + const char *argv[7]; pid_t pid; /* We use "GETINFO app_running" to see whether the agent is already @@ -1077,8 +1077,9 @@ scdaemon_runtime_change (void) argv[1] = "GETINFO scd_running"; argv[2] = "/if ${! $?}"; argv[3] = "scd killscd"; - argv[4] = "/end"; - argv[5] = NULL; + argv[4] = "scd bye"; + argv[5] = "/end"; + argv[6] = NULL; err = gnupg_spawn_process_fd (pgmname, argv, -1, -1, -1, &pid); if (!err) ----------------------------------------------------------------------- Summary of changes: tools/gpgconf-comp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Thu Sep 10 04:03:44 2015 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Thu, 10 Sep 2015 04:03:44 +0200 Subject: [git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.29-5-gfa3b618 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU Privacy Guard". The branch, STABLE-BRANCH-2-0 has been updated via fa3b618216eb155436abf9b80be9975d7334af20 (commit) from d4a2a070b4b4d30a6bbdd4248421a23cf824d8c0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fa3b618216eb155436abf9b80be9975d7334af20 Author: NIIBE Yutaka Date: Thu Sep 10 11:03:31 2015 +0900 po: Update Japanese Translation. diff --git a/po/ja.po b/po/ja.po index d5415cd..0ebf2c3 100644 --- a/po/ja.po +++ b/po/ja.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: GNU gnupg 2.0.28\n" "Report-Msgid-Bugs-To: translations at gnupg.org\n" -"PO-Revision-Date: 2015-06-16 12:51+0900\n" +"PO-Revision-Date: 2015-09-10 11:02+0900\n" "Last-Translator: NIIBE Yutaka \n" "Language-Team: Japanese \n" "Language: ja\n" @@ -3775,10 +3775,9 @@ msgstr "????????????:" msgid " Key fingerprint =" msgstr " ?????????? =" -#, fuzzy, c-format -#| msgid "WARNING: using experimental digest algorithm %s\n" +#, c-format msgid "WARNING: a PGP-2 fingerprint is not safe\n" -msgstr "*??*: ???????????????? %s???\n" +msgstr "*??*: PGP-2?????????????????????\n" msgid " Card serial no. =" msgstr " ?????????? =" ----------------------------------------------------------------------- Summary of changes: po/ja.po | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) hooks/post-receive -- The GNU Privacy Guard http://git.gnupg.org From cvs at cvs.gnupg.org Thu Sep 10 19:22:56 2015 From: cvs at cvs.gnupg.org (by Andre Heinecke) Date: Thu, 10 Sep 2015 19:22:56 +0200 Subject: [git] GpgOL - branch, master, updated. gpgol-1.2.0-14-g4e0526c Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GnuPG extension for MS Outlook". The branch, master has been updated via 4e0526c1f4820da7f399e35c0a76b0d7ca5f1dc7 (commit) via d3e50de926579bd963b2e6d1f7a19354ccebb218 (commit) via e58b3e105dd665b29709502fb1e2a81d2ba7ad50 (commit) via 8c06bc68c3f0b77980e0f54a3ad8b7830ee052db (commit) via 848af24058512bccba0017654ce6bcf520e9a7b4 (commit) via d1e60f012dea19b1736c84be1d7da16484586b2b (commit) from eb1b9bfc088ce33c398dd6f6b7bf80797fbb9011 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4e0526c1f4820da7f399e35c0a76b0d7ca5f1dc7 Author: Andre Heinecke Date: Thu Sep 10 19:20:36 2015 +0200 Purify COM interface declarations. * src/inspectors.h (IOOMInspectorEvents), src/mailitem.h (IOOMItemEvents): Declare interface methods as pure virtual. -- According to doc it should be done this way and this fixes the undefined reference to vtable errors when compiling with -O0 diff --git a/src/inspectors.h b/src/inspectors.h index 8d33dc7..95148d8 100644 --- a/src/inspectors.h +++ b/src/inspectors.h @@ -79,7 +79,7 @@ DECLARE_INTERFACE_(IOOMInspectorEvents, IDispatch) /*** IOOM_Inspector methods ***/ /* dispid=0xf001 */ - STDMETHOD_(void, Activate)(THIS_); + STDMETHOD_(void, Activate)(THIS_) PURE; /* dispid=0xfa11 */ STDMETHODIMP(BeforeMaximize)(THIS_ PBOOL); /* dispid=0xfa12 */ @@ -89,9 +89,9 @@ DECLARE_INTERFACE_(IOOMInspectorEvents, IDispatch) /* dispid=0xfa14 */ STDMETHODIMP(BeforeSize)(THIS_ PBOOL); /* dispid=0xf008 */ - STDMETHOD_(void, Close)(THIS_); + STDMETHOD_(void, Close)(THIS_) PURE; /* dispid=0xf006 */ - STDMETHOD_(void, Deactivate)(THIS_); + STDMETHOD_(void, Deactivate)(THIS_) PURE; }; diff --git a/src/mailitem.h b/src/mailitem.h index 04b0da5..01063c3 100644 --- a/src/mailitem.h +++ b/src/mailitem.h @@ -56,19 +56,19 @@ DECLARE_INTERFACE_(IOOMItemEvents, IDispatch) vtable layout. However it doesn't matter because we only use it via the IDispatch interface. */ /* dispid=0xf001 */ - STDMETHOD(Read)(THIS_ ); + STDMETHOD(Read)(THIS_ ) PURE; /* dispid=0xf002 */ - STDMETHOD(Write)(THIS_ PBOOL cancel); + STDMETHOD(Write)(THIS_ PBOOL cancel) PURE; /* dispid=0xf003 */ - STDMETHOD(Open)(THIS_ PBOOL cancel); + STDMETHOD(Open)(THIS_ PBOOL cancel) PURE; /* dispid=0xf004 */ - STDMETHOD(Close)(THIS_ PBOOL cancel); + STDMETHOD(Close)(THIS_ PBOOL cancel) PURE; /* dispid=0xf005 */ - STDMETHOD(Send)(THIS_ PBOOL cancel); + STDMETHOD(Send)(THIS_ PBOOL cancel) PURE; /* dispid=0xf006 */ //STDMETHOD(CustomAction)(THIS_ LPDISPATCH action, LPDISPATCH response, commit d3e50de926579bd963b2e6d1f7a19354ccebb218 Author: Andre Heinecke Date: Thu Sep 10 19:16:30 2015 +0200 Correctly declare gpgoladding COM interfaces * src/gpgoladdin.h (IDTExtensibility2, IRibbonExtensibility) (IRibbonCallback): Add IUnknown and IDispatch methods. Purify. -- Not sure why this worked before probably because they did actually implement the relevant methods. All methods even from base classes should be declared. PURE ensures that the vtable is generated correclty fixing the "related undefined reference to vtable" link errors. diff --git a/src/gpgoladdin.h b/src/gpgoladdin.h index 4a755d9..754765d 100644 --- a/src/gpgoladdin.h +++ b/src/gpgoladdin.h @@ -1,5 +1,5 @@ /* gpgoladdin.h - Connect GpgOL to Outlook as an addin - * Copyright (C) 2013 Intevation GmbH + * Copyright (C) 2013, 2015 Intevation GmbH * * This file is part of GpgOL. * @@ -22,6 +22,8 @@ #include +#include "comhelp.h" + class GpgolAddinRibbonExt; class GpgolExt; @@ -60,12 +62,16 @@ DEFINE_GUID(IID_IDTExtensibility2, 0xB65AD801, 0xABAF, 0x11D0, 0xBB, 0x8B, #define INTERFACE IDTExtensibility2 DECLARE_INTERFACE_(IDTExtensibility2, IDispatch) { + DECLARE_IUNKNOWN_METHODS; + DECLARE_IDISPATCH_METHODS; + /*** IDTExtensibility2 methods ***/ + STDMETHOD(OnConnection)(LPDISPATCH, ext_ConnectMode, LPDISPATCH, - SAFEARRAY**); - STDMETHOD(OnDisconnection)(ext_DisconnectMode, SAFEARRAY**); - STDMETHOD(OnAddInsUpdate)(SAFEARRAY **); - STDMETHOD(OnStartupComplete)(SAFEARRAY**); - STDMETHOD(OnBeginShutdown)(SAFEARRAY**); + SAFEARRAY**) PURE; + STDMETHOD(OnDisconnection)(ext_DisconnectMode, SAFEARRAY**) PURE; + STDMETHOD(OnAddInsUpdate)(SAFEARRAY **) PURE; + STDMETHOD(OnStartupComplete)(SAFEARRAY**) PURE; + STDMETHOD(OnBeginShutdown)(SAFEARRAY**) PURE; }; DEFINE_GUID(IID_IRibbonExtensibility, 0x000C0396, 0x0000, 0x0000, 0xC0, 0x00, @@ -78,7 +84,11 @@ typedef struct IRibbonExtensibility *LRIBBONEXTENSIBILITY; #define INTERFACE IRibbonExtensibility DECLARE_INTERFACE_(IRibbonExtensibility, IDispatch) { - STDMETHOD(GetCustomUI)(BSTR RibbonID, BSTR * RibbonXml); + DECLARE_IUNKNOWN_METHODS; + DECLARE_IDISPATCH_METHODS; + + /*** IRibbonExtensibility methods ***/ + STDMETHOD(GetCustomUI)(BSTR RibbonID, BSTR * RibbonXml) PURE; }; DEFINE_GUID(IID_IRibbonCallback, 0xCE895442, 0x9981, 0x4315, 0xAA, 0x85, @@ -89,10 +99,13 @@ typedef struct IRibbonCallback *LRIBBONCALLBACK; #undef INTERFACE #define INTERFACE IRibbonCallback -DECLARE_INTERFACE(IRibbonCallback) +DECLARE_INTERFACE_(IRibbonCallback, IUnknown) { - STDMETHOD(OnRibbonLoad)(IUnknown* pRibbonUIUnk); - STDMETHOD(ButtonClicked)(IDispatch* ribbon); + DECLARE_IUNKNOWN_METHODS; + + /*** IRibbonCallback methods ***/ + STDMETHOD(OnRibbonLoad)(IUnknown* pRibbonUIUnk) PURE; + STDMETHOD(ButtonClicked)(IDispatch* ribbon) PURE; }; DEFINE_GUID(IID_IRibbonControl, 0x000C0395, 0x0000, 0x0000, 0xC0, 0x00, @@ -105,9 +118,12 @@ typedef struct IRibbonControl *LPRIBBONCONTROL; #define INTERFACE IRibbonControl DECLARE_INTERFACE_(IRibbonControl, IDispatch) { - STDMETHOD(get_Id)(BSTR* id); - STDMETHOD(get_Context)(IDispatch** context); - STDMETHOD(get_Tag)(BSTR* Tag); + DECLARE_IUNKNOWN_METHODS; + DECLARE_IDISPATCH_METHODS; + + STDMETHOD(get_Id)(BSTR* id) PURE; + STDMETHOD(get_Context)(IDispatch** context) PURE; + STDMETHOD(get_Tag)(BSTR* Tag) PURE; }; commit e58b3e105dd665b29709502fb1e2a81d2ba7ad50 Author: Andre Heinecke Date: Thu Sep 10 19:11:25 2015 +0200 Declare destructors of COM objects as virtual * src/attached-file-events.h (GpgolAttachedFileEvents), src/eventsink.h (BEGIN_EVENT_SINK) src/gpgoladdin.h (GpgolRibbonExtender GpgolAddin GpgolAddinFactory), src/item-events.h (GpgolItemEvents), src/message-events.h (GpgolMessageEvents), src/property-sheets.h (GpgolPropertySheets), src/session-events.h (GpgolSessionEvents), src/user-events.h (GpgolUserEvents): Make dtors virtual. -- This fixes compiler warnings about non-virtual dtors in conjunction with inheriting a COM interface. diff --git a/src/attached-file-events.h b/src/attached-file-events.h index e259389..310e7f2 100644 --- a/src/attached-file-events.h +++ b/src/attached-file-events.h @@ -31,6 +31,7 @@ class GpgolAttachedFileEvents : public IExchExtAttachedFileEvents { public: GpgolAttachedFileEvents (GpgolExt *pParentInterface); + virtual ~GpgolAttachedFileEvents () {} private: GpgolExt *m_pExchExt; diff --git a/src/eventsink.h b/src/eventsink.h index 4353c0f..f94793b 100644 --- a/src/eventsink.h +++ b/src/eventsink.h @@ -33,7 +33,7 @@ class subcls : public parentcls \ { \ public: \ subcls (void); \ - ~subcls (void); \ + virtual ~subcls (void); \ LPDISPATCH m_object; \ LPCONNECTIONPOINT m_pCP; \ DWORD m_cookie; \ diff --git a/src/gpgoladdin.h b/src/gpgoladdin.h index cf98e8c..4a755d9 100644 --- a/src/gpgoladdin.h +++ b/src/gpgoladdin.h @@ -118,7 +118,7 @@ class GpgolRibbonExtender : public IRibbonExtensibility { public: GpgolRibbonExtender(void); - ~GpgolRibbonExtender(); + virtual ~GpgolRibbonExtender(); /* IUnknown */ STDMETHODIMP QueryInterface (REFIID riid, LPVOID* ppvObj); @@ -150,7 +150,7 @@ class GpgolAddin : public IDTExtensibility2 { public: GpgolAddin(void); - ~GpgolAddin(); + virtual ~GpgolAddin(); public: @@ -197,7 +197,7 @@ class GpgolAddinFactory: public IClassFactory { public: GpgolAddinFactory(): m_lRef(0){} - ~GpgolAddinFactory(){} + virtual ~GpgolAddinFactory(){} STDMETHODIMP QueryInterface (REFIID riid, LPVOID* ppvObj); inline STDMETHODIMP_(ULONG) AddRef() { ++m_lRef; return m_lRef; }; diff --git a/src/item-events.h b/src/item-events.h index 7d1fcaf..160895b 100644 --- a/src/item-events.h +++ b/src/item-events.h @@ -32,6 +32,7 @@ class GpgolItemEvents : public IOutlookExtItemEvents { public: GpgolItemEvents (GpgolExt *pParentInterface); + virtual ~GpgolItemEvents () {} private: GpgolExt *m_pExchExt; diff --git a/src/message-events.h b/src/message-events.h index fda010a..665eb38 100644 --- a/src/message-events.h +++ b/src/message-events.h @@ -31,6 +31,7 @@ class GpgolMessageEvents : public IExchExtMessageEvents /* Constructor. */ public: GpgolMessageEvents (GpgolExt* pParentInterface); + virtual ~GpgolMessageEvents () {} /* Attributes. */ private: diff --git a/src/property-sheets.h b/src/property-sheets.h index cb1ba2f..591227c 100644 --- a/src/property-sheets.h +++ b/src/property-sheets.h @@ -33,6 +33,7 @@ class GpgolPropertySheets : public IExchExtPropertySheets // constructor public: GpgolPropertySheets(GpgolExt* pParentInterface); + virtual ~GpgolPropertySheets () {} // attibutes private: diff --git a/src/session-events.h b/src/session-events.h index cc499b7..fcc2d72 100644 --- a/src/session-events.h +++ b/src/session-events.h @@ -31,6 +31,7 @@ class GpgolSessionEvents : public IExchExtSessionEvents /* Constructor. */ public: GpgolSessionEvents (GpgolExt *pParentInterface); + virtual ~GpgolSessionEvents () {} /* Attributes. */ private: diff --git a/src/user-events.h b/src/user-events.h index 1062359..1bff7c4 100644 --- a/src/user-events.h +++ b/src/user-events.h @@ -31,6 +31,7 @@ class GpgolUserEvents : public IExchExtUserEvents /* Constructor. */ public: GpgolUserEvents (GpgolExt *pParentInterface); + virtual ~GpgolUserEvents () {} /* Attributes. */ private: commit 8c06bc68c3f0b77980e0f54a3ad8b7830ee052db Author: Andre Heinecke Date: Thu Sep 10 19:08:28 2015 +0200 Add comhelp header for common COM definitions * src/comhelp.h: New. Add IUnknown and IDispatch defs. * src/mymapi.h: Use definitions from comhelp. -- This header is intended as a place for interface definitions so that they can be better reused in different source files. diff --git a/src/comhelp.h b/src/comhelp.h new file mode 100644 index 0000000..073c85b --- /dev/null +++ b/src/comhelp.h @@ -0,0 +1,36 @@ +/* comhelp.h - Helper macros to define / declare COM interfaces. + * Copyright (C) 2015 Intevation GmbH + * + * This file is part of GpgOL. + * + * GpgOL is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GpgOL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, see . + */ +#ifndef COMHELP_H +#define COMHELP_H + +/*** IUnknown methods ***/ +#define DECLARE_IUNKNOWN_METHODS \ + STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE; \ + STDMETHOD_(ULONG,AddRef)(THIS) PURE; \ + STDMETHOD_(ULONG,Release)(THIS) PURE + +/*** IDispatch methods ***/ +#define DECLARE_IDISPATCH_METHODS \ + STDMETHOD(GetTypeInfoCount)(THIS_ UINT*) PURE; \ + STDMETHOD(GetTypeInfo)(THIS_ UINT, LCID, LPTYPEINFO*) PURE; \ + STDMETHOD(GetIDsOfNames)(THIS_ REFIID, LPOLESTR*, UINT, LCID, DISPID*) PURE;\ + STDMETHOD(Invoke)(THIS_ DISPID, REFIID, LCID, WORD, \ + DISPPARAMS*, VARIANT*, EXCEPINFO*, UINT*) PURE + +#endif // COMHELP_H diff --git a/src/mymapi.h b/src/mymapi.h index 89bb6a2..f3ca441 100644 --- a/src/mymapi.h +++ b/src/mymapi.h @@ -38,6 +38,8 @@ #ifndef MAPI_H #define MAPI_H +#include "comhelp.h" + #ifdef __cplusplus extern "C" { #endif @@ -677,12 +679,6 @@ struct IMAPIFormContainer; typedef struct IMAPIFormContainer *LPMAPIFORMCONTAINER; -/*** IUnknown methods ***/ -#define MY_IUNKNOWN_METHODS \ - STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE; \ - STDMETHOD_(ULONG,AddRef)(THIS) PURE; \ - STDMETHOD_(ULONG,Release)(THIS) PURE - /*** IMAPIProp methods ***/ #define MY_IMAPIPROP_METHODS \ STDMETHOD(GetLastError)(THIS_ HRESULT, ULONG, LPMAPIERROR FAR*); \ @@ -884,7 +880,7 @@ EXTERN_C const IID IID_IMAPIProp; #define INTERFACE IMAPIProp DECLARE_INTERFACE_(IMAPIProp,IUnknown) { - MY_IUNKNOWN_METHODS; + DECLARE_IUNKNOWN_METHODS; MY_IMAPIPROP_METHODS; }; @@ -895,7 +891,7 @@ EXTERN_C const IID IID_IMsgStore; #define INTERFACE IMsgStore DECLARE_INTERFACE_(IMsgStore,IMAPIProp) { - MY_IUNKNOWN_METHODS; + DECLARE_IUNKNOWN_METHODS; MY_IMAPIPROP_METHODS; MY_IMSGSTORE_METHODS; }; @@ -906,7 +902,7 @@ EXTERN_C const IID IID_IMessage; #define INTERFACE IMessage DECLARE_INTERFACE_(IMessage,IMAPIProp) { - MY_IUNKNOWN_METHODS; + DECLARE_IUNKNOWN_METHODS; MY_IMAPIPROP_METHODS; MY_IMESSAGE_METHODS; }; @@ -917,7 +913,7 @@ EXTERN_C const IID IID_IMAPIContainer; #define INTERFACE IMAPIContainer DECLARE_INTERFACE_(IMAPIContainer,IMAPIProp) { - MY_IUNKNOWN_METHODS; + DECLARE_IUNKNOWN_METHODS; MY_IMAPIPROP_METHODS; MY_IMAPICONTAINER_METHODS; }; @@ -928,7 +924,7 @@ EXTERN_C const IID IID_IMAPIFolder; #define INTERFACE IMAPIFolder DECLARE_INTERFACE_(IMAPIFolder,IMAPIContainer) { - MY_IUNKNOWN_METHODS; + DECLARE_IUNKNOWN_METHODS; MY_IMAPIPROP_METHODS; MY_IMAPICONTAINER_METHODS; MY_IMAPIFOLDER_METHODS; @@ -940,7 +936,7 @@ EXTERN_C const IID IID_IAttachment; #define INTERFACE IAttach DECLARE_INTERFACE_(IAttach, IMAPIProp) { - MY_IUNKNOWN_METHODS; + DECLARE_IUNKNOWN_METHODS; MY_IMAPIPROP_METHODS; /*** IAttach methods ***/ /* No methods */ @@ -952,7 +948,7 @@ EXTERN_C const IID IID_IMAPITableData; #define INTERFACE IMAPITable DECLARE_INTERFACE_(IMAPITable,IUnknown) { - MY_IUNKNOWN_METHODS; + DECLARE_IUNKNOWN_METHODS; MY_IMAPITABLE_METHODS; }; @@ -962,7 +958,7 @@ EXTERN_C const IID IID_IMAPISession; #define INTERFACE IMAPISession DECLARE_INTERFACE_(IMAPISession, IUnknown) { - MY_IUNKNOWN_METHODS; + DECLARE_IUNKNOWN_METHODS; MY_IMAPISESSION_METHODS; }; @@ -974,7 +970,7 @@ EXTERN_C const IID IID_IConverterSession; #define INTERFACE IConverterSession DECLARE_INTERFACE_(IConverterSession, IUnknown) { - MY_IUNKNOWN_METHODS; + DECLARE_IUNKNOWN_METHODS; /*** IConverterSession ***/ @@ -1012,7 +1008,7 @@ EXTERN_C const IID IID_ISpoolerHook; #define INTERFACE ISpoolerHook DECLARE_INTERFACE_(ISpoolerHook, IUnknown) { - MY_IUNKNOWN_METHODS; + DECLARE_IUNKNOWN_METHODS; MY_ISPOOLERHOOK_METHODS; }; @@ -1089,13 +1085,12 @@ EXTERN_C const IID IID_IMAPIFormContainer; #define INTERFACE IMAPIFormContainer DECLARE_INTERFACE_(IMAPIFormContainer, IUnknown) { - MY_IUNKNOWN_METHODS; + DECLARE_IUNKNOWN_METHODS; MY_IMAPIFORMCONTAINER_METHODS; }; -#undef MY_IUNKNOWN_METHODS #undef MY_IMAPIPROP_METHODS #undef MY_IMSGSTORE_METHODS #undef MY_IMESSAGE_METHODS commit 848af24058512bccba0017654ce6bcf520e9a7b4 Author: Andre Heinecke Date: Thu Sep 10 18:22:34 2015 +0200 Do not use ambigouis %S format character * src/gpgoladdin.cpp (getCustomUI): Do not use %S. -- %S in swprintf used to mean "char *" but at least in the context of Outlook this now means "wchar_t *" the wrong interpretation causes undefined behavior and results in crashes. The fix is to avoid this altogether as the rest of the code does and use %hs and %ls instead. diff --git a/src/gpgoladdin.cpp b/src/gpgoladdin.cpp index e24fe85..9c15fe5 100644 --- a/src/gpgoladdin.cpp +++ b/src/gpgoladdin.cpp @@ -576,7 +576,7 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml) memset(buffer, 0, sizeof buffer); - log_debug ("%s:%s: GetCustomUI for id: %S", SRCNAME, __func__, RibbonID); + log_debug ("%s:%s: GetCustomUI for id: %ls", SRCNAME, __func__, RibbonID); if (!RibbonXml) return E_POINTER; @@ -588,61 +588,61 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml) L" " L" " L" " + L" label=\"%hs\">" L" " + L" label=\"%hs\">" L"