Compare commits
305 Commits
fix/1.18.0
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
5c095553e4 | ||
|
9ab2ce36f9 | ||
|
c69240c843 | ||
|
42e151b34b | ||
|
e6830b58b6 | ||
|
899a572b33 | ||
|
69558f2c0b | ||
|
576d2db9dd | ||
|
aa15a664b3 | ||
|
e46748a0d1 | ||
|
f6d020e24f | ||
|
28542b14c4 | ||
|
2656d3ee5b | ||
|
acf574af64 | ||
|
b7435b31f6 | ||
|
95bd4fa813 | ||
|
de60684500 | ||
|
8b4171680c | ||
|
9c276e762a | ||
|
ec2c6dd8bc | ||
|
6ed5c9a38a | ||
|
7d5df0bf0d | ||
|
09827ffc77 | ||
|
53c367629a | ||
|
c52e1943a7 | ||
|
60b96d149c | ||
|
6c90ec7be2 | ||
|
14b035034a | ||
|
2187a4de8c | ||
|
5b73b0722a | ||
|
3b9815bd8a | ||
|
307256d277 | ||
|
87319b3fc7 | ||
|
29be63ae37 | ||
|
09cc0c81f7 | ||
|
967b6b726e | ||
|
4136928f0d | ||
|
5d9269cb4f | ||
|
25dd284b0c | ||
|
1245b09012 | ||
|
09d81da665 | ||
|
5844d9e700 | ||
|
986c5f0b94 | ||
|
6aa359b1e8 | ||
|
f0d1f2c4c7 | ||
|
15718cb295 | ||
|
e42b72bc2b | ||
|
90eb80134b | ||
|
f2575b6313 | ||
|
adadfac997 | ||
|
ac4bf86bb6 | ||
|
55a1ae4163 | ||
|
c933269d3a | ||
|
333241b286 | ||
|
73403a8ba0 | ||
|
0f5e8182e7 | ||
|
3e3db5784f | ||
|
87061c0260 | ||
|
a73a41109f | ||
|
06db03ea9b | ||
|
882ccc8ea7 | ||
|
e4a95746ad | ||
|
67057d83f5 | ||
|
7158397c09 | ||
|
47f3d92bf3 | ||
|
0011412193 | ||
|
eae22d9a48 | ||
|
cc1f2b5acb | ||
|
e3ae88267f | ||
|
18388f93ab | ||
|
b37efb11be | ||
|
85c7a94d63 | ||
|
7e520213c0 | ||
|
d60d1b7f79 | ||
|
18a0d72b1b | ||
|
c631622484 | ||
|
1dc44b7c5b | ||
|
0b3c8709f7 | ||
|
e77a8ac0cc | ||
|
20b32e0350 | ||
|
a44d84772d | ||
|
b166958b86 | ||
|
60c0fd7c95 | ||
|
5efd3486a9 | ||
|
963ace1f9f | ||
|
0221d7f28a | ||
|
b35bcf0040 | ||
|
d5dafb2ae3 | ||
|
f7d69de030 | ||
|
6baccdc0c3 | ||
|
f212de4a9e | ||
|
1a26db7175 | ||
|
1bbe2d4b70 | ||
|
618fea9e20 | ||
|
278f92b189 | ||
|
185ab7d7ba | ||
|
77e982579c | ||
|
1bfd5e92d0 | ||
|
52d59d75ca | ||
|
ae332749ee | ||
|
cf88690cf4 | ||
|
46f5d5eeb3 | ||
|
8d8985bda1 | ||
|
0a0a5906d5 | ||
|
cadcb38469 | ||
|
a0a4cd411c | ||
|
8faaf7b72b | ||
|
aae967ec9c | ||
|
ab25df8328 | ||
|
5c7e4d252a | ||
|
131384b107 | ||
|
bd448c9cbf | ||
|
57205c1dfa | ||
|
959f976dfc | ||
|
a9e5a25b56 | ||
|
0132a1089f | ||
|
b63d203d3b | ||
|
349a69b5ea | ||
|
8ad22290df | ||
|
d43d787e9a | ||
|
4e321a0f06 | ||
|
927f129663 | ||
|
3e64856208 | ||
|
8fde9cbe22 | ||
|
e36b2d1bce | ||
|
b80d52a1f7 | ||
|
d75b2a9151 | ||
|
3f297387bf | ||
|
aee18a2ab2 | ||
|
24a8c279da | ||
|
d23528cadf | ||
|
2ad36f7114 | ||
|
fb03a5b3df | ||
|
cfeb62d358 | ||
|
8ea7015a23 | ||
|
dacbd51c3f | ||
|
40ca3d5896 | ||
|
c3171d0cf1 | ||
|
7a2a3f317b | ||
|
150a2f9e4e | ||
|
bc98f01c85 | ||
|
d72811a2c0 | ||
|
8701e98937 | ||
|
d91d037fc1 | ||
|
a9b28c79e9 | ||
|
777cf7f2d1 | ||
|
0518ed32e2 | ||
|
e3defc0adf | ||
|
be0e653ce3 | ||
|
ad34fcbbec | ||
|
546d3a982d | ||
|
5bf3e6d075 | ||
|
05ac1ce09f | ||
|
1c2459a592 | ||
|
1a9f192ab4 | ||
|
e608315392 | ||
|
c38b620039 | ||
|
8b9fabf5d5 | ||
|
23526c3ff2 | ||
|
4655b2dc6b | ||
|
6f6b35df50 | ||
|
5811d069d3 | ||
|
cbcea4a09b | ||
|
91bbb1e482 | ||
|
8796456d23 | ||
|
eb68948c43 | ||
|
7e6d51aa6f | ||
|
7990f70107 | ||
|
e2103be390 | ||
|
fbc3963d62 | ||
|
36a68bc530 | ||
|
e622e36f1f | ||
|
d44a473e27 | ||
|
d99156ff08 | ||
|
451ed47434 | ||
|
7351ef32ce | ||
|
a14155d2c1 | ||
|
e80bf34bf8 | ||
|
5bd84cfd3f | ||
|
7d1159c1e9 | ||
|
0c29119e06 | ||
|
806a5d18b9 | ||
|
d256ba7cc5 | ||
|
34cc7daba1 | ||
|
b608c084b9 | ||
|
6d21256c92 | ||
|
18e09b15d5 | ||
|
96a30fdf30 | ||
|
d086653cc3 | ||
|
e50724e1bb | ||
|
98a159eb5e | ||
|
c1f6535f14 | ||
|
76351c4877 | ||
|
73e46b3465 | ||
|
ccff6a96fc | ||
|
ea6f15ed60 | ||
|
9c5506fde7 | ||
|
c0da6f77c6 | ||
|
21283dfd1b | ||
|
41dc3bd22a | ||
|
3aaed9cfbf | ||
|
7098c14b23 | ||
|
fcefc78f74 | ||
|
844e6cd3b9 | ||
|
e0778ed910 | ||
|
52fd0bcde4 | ||
|
1698eec2ae | ||
|
c407728064 | ||
|
7ad717f6ba | ||
|
b3bdf14b37 | ||
|
55c948866f | ||
|
8478064691 | ||
|
7f541547fc | ||
|
5ab9c234d6 | ||
|
343fb33bf0 | ||
|
472f109138 | ||
|
7b2188aca1 | ||
|
d3a8c2c8b6 | ||
|
41a30f6d9f | ||
|
8c4436e73a | ||
|
2b98585c89 | ||
|
5d07f8db77 | ||
|
359378c5b3 | ||
|
577562dd4c | ||
|
3cdcfa33f7 | ||
|
8d672b3b7e | ||
|
2faa031af2 | ||
|
48b11f5762 | ||
|
7afd135cce | ||
|
275a3a2c16 | ||
|
d28ea8c6b3 | ||
|
261245a2e0 | ||
|
1328a57586 | ||
|
3e31f648e5 | ||
|
70aaf05a6a | ||
|
3580bb139b | ||
|
ab7146aa61 | ||
|
5b79b32397 | ||
|
95ea3bf831 | ||
|
419adf41af | ||
|
4c872b6741 | ||
|
29cfcd316d | ||
|
0ca45e48b4 | ||
|
aa201b0bb6 | ||
|
5d8316da1d | ||
|
d56b3bc1cf | ||
|
7a68a1ca64 | ||
|
1a9dfdfccb | ||
|
12e490d97f | ||
|
fbce7deb3b | ||
|
984ff7e3a2 | ||
|
64da77620a | ||
|
2e9d72a0be | ||
|
dc9cc9aa07 | ||
|
e16c368758 | ||
|
398375a0ab | ||
|
18c2c0b250 | ||
|
270d752300 | ||
|
2ba11f9bfb | ||
|
e7953dcf13 | ||
|
c419376b85 | ||
|
d04d7b174f | ||
|
a9921d797b | ||
|
f9cbf2c8a8 | ||
|
5903fa454a | ||
|
ae2057e601 | ||
|
abd51848bd | ||
|
2b7fcbf2f2 | ||
|
6bcfbb3498 | ||
|
b6593bda1f | ||
|
4f874ea431 | ||
|
9f5e117292 | ||
|
9f55dceca0 | ||
|
1c9694f8d5 | ||
|
f1802682c3 | ||
|
830e017e5d | ||
|
d9ac138595 | ||
|
d36905bb80 | ||
|
2ff09f474f | ||
|
1792db5834 | ||
|
55e660ee94 | ||
|
f7a4671428 | ||
|
e6a1b241b4 | ||
|
b2fb26baea | ||
|
4938c24a46 | ||
|
8d019bbb8d | ||
|
8e908029ff | ||
|
b1e5f3b183 | ||
|
ae9258fbf3 | ||
|
fbd9407646 | ||
|
eedaaf7016 | ||
|
80670f60ba | ||
|
1522813888 | ||
|
73e96bfaa8 | ||
|
83176ad7d3 | ||
|
0566180684 | ||
|
f02c20cc9c | ||
|
2e7a61b898 | ||
|
2fa5c80aeb | ||
|
f2b48de26b | ||
|
81d4b7f2d7 | ||
|
c977424a1d | ||
|
5f51a9b458 | ||
|
586846209b | ||
|
7e2ef54b9c |
4
AUTHORS
4
AUTHORS
@ -22,7 +22,7 @@ List of Copyright holders
|
|||||||
|
|
||||||
Copyright (C) 1991-2013 Free Software Foundation, Inc.
|
Copyright (C) 1991-2013 Free Software Foundation, Inc.
|
||||||
Copyright (C) 2000-2001 Werner Koch
|
Copyright (C) 2000-2001 Werner Koch
|
||||||
Copyright (C) 2001-2021 g10 Code GmbH
|
Copyright (C) 2001-2023 g10 Code GmbH
|
||||||
Copyright (C) 2002 Klarälvdalens Datakonsult AB
|
Copyright (C) 2002 Klarälvdalens Datakonsult AB
|
||||||
Copyright (C) 2004-2008 Igor Belyi
|
Copyright (C) 2004-2008 Igor Belyi
|
||||||
Copyright (C) 2002 John Goerzen
|
Copyright (C) 2002 John Goerzen
|
||||||
@ -43,7 +43,7 @@ FSF <gnu@gnu.org>
|
|||||||
src/stpcpy.c, src/w32-ce.c.
|
src/stpcpy.c, src/w32-ce.c.
|
||||||
|
|
||||||
g10 Code GmbH <code@g10code.com>
|
g10 Code GmbH <code@g10code.com>
|
||||||
- All stuff since mid march 2001.
|
- All stuff since mid March 2001.
|
||||||
|
|
||||||
Werner Koch <wk@gnupg.org>
|
Werner Koch <wk@gnupg.org>
|
||||||
- Design and most stuff.
|
- Design and most stuff.
|
||||||
|
@ -36,8 +36,11 @@ DISTCHECK_CONFIGURE_FLAGS =
|
|||||||
|
|
||||||
EXTRA_DIST = autogen.sh autogen.rc gpgme.spec.in \
|
EXTRA_DIST = autogen.sh autogen.rc gpgme.spec.in \
|
||||||
ChangeLog-2011 m4/ChangeLog-2011 \
|
ChangeLog-2011 m4/ChangeLog-2011 \
|
||||||
|
build-aux/libtool-patch.sed \
|
||||||
conf/whatisthis VERSION LICENSES
|
conf/whatisthis VERSION LICENSES
|
||||||
|
|
||||||
|
# This artificial line is to put a dependency to conf/config.h for 'all'
|
||||||
|
BUILT_SOURCES = conf/config.h
|
||||||
|
|
||||||
if RUN_GPG_TESTS
|
if RUN_GPG_TESTS
|
||||||
tests = tests
|
tests = tests
|
||||||
|
378
NEWS
378
NEWS
@ -1,3 +1,379 @@
|
|||||||
|
Noteworthy changes in version 1.24.0 (unrelease)
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
* Extended gpgme_op_decrypt* and gpgme_op_verify* to allow writing the
|
||||||
|
output directly to a file. [T6550]
|
||||||
|
|
||||||
|
* Extended gpgme_op_encrypt*, gpgme_op_encrypt_sign*, and gpgme_op_sign*
|
||||||
|
to allow reading the input data directly from a file. [T6550]
|
||||||
|
|
||||||
|
* Add information about designated revocation keys. [T7118]
|
||||||
|
|
||||||
|
* New context flag "import-options". [T7152]
|
||||||
|
|
||||||
|
* cpp: Provide information about designated revocation keys for a Key.
|
||||||
|
[T7118]
|
||||||
|
|
||||||
|
* cpp: Add safer member function returning text describing an error.
|
||||||
|
[T5960]
|
||||||
|
|
||||||
|
* qt: Build QGpgME for Qt 5 and Qt 6 simultaneously. [T7205]
|
||||||
|
|
||||||
|
* qt: Install headers for Qt 5 and Qt 6 in separate folders. [T7161]
|
||||||
|
|
||||||
|
* qt: Allow reading the data to decrypt/encrypt/sign/verify directly from
|
||||||
|
files. [T6550]
|
||||||
|
|
||||||
|
* qt: Allow writing the decrypted/encrypted/signed/verified data directly
|
||||||
|
to files. [T6550]
|
||||||
|
|
||||||
|
* qt: Allow specifying import options when importing keys. [T7152]
|
||||||
|
|
||||||
|
* qt: Allow appending a detached signature to an existing file. [T6867]
|
||||||
|
|
||||||
|
* Interface changes relative to the 1.23.2 release:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
GPGME_ENCRYPT_FILE NEW.
|
||||||
|
GPGME_SIG_MODE_FILE NEW.
|
||||||
|
gpgme_key_t EXTENDED: New field 'revkeys'.
|
||||||
|
gpgme_revocation_key_t NEW.
|
||||||
|
gpgme_set_ctx_flag EXTENDED: New flag 'import-options'.
|
||||||
|
cpp: Context::EncryptFile NEW.
|
||||||
|
cpp: SignatureMode::SignFile NEW.
|
||||||
|
cpp: RevocationKey NEW.
|
||||||
|
cpp: Key::revocationKey NEW.
|
||||||
|
cpp: Key::numRevocationKeys NEW.
|
||||||
|
cpp: Key::revocationKeys NEW.
|
||||||
|
cpp: Error::asStdString NEW.
|
||||||
|
cpp: Error::asString DEPRECATED.
|
||||||
|
qt: DecryptVerifyJob::setInputFile NEW.
|
||||||
|
qt: DecryptVerifyJob::inputFile NEW.
|
||||||
|
qt: DecryptVerifyJob::setOutputFile NEW.
|
||||||
|
qt: DecryptVerifyJob::outputFile NEW.
|
||||||
|
qt: EncryptJob::setRecipients NEW.
|
||||||
|
qt: EncryptJob::recipients NEW.
|
||||||
|
qt: EncryptJob::setInputFile NEW.
|
||||||
|
qt: EncryptJob::inputFile NEW.
|
||||||
|
qt: EncryptJob::setOutputFile NEW.
|
||||||
|
qt: EncryptJob::outputFile NEW.
|
||||||
|
qt: EncryptJob::setEncryptionFlags NEW.
|
||||||
|
qt: EncryptJob::encryptionFlags NEW.
|
||||||
|
qt: SignEncryptJob::setSigners NEW.
|
||||||
|
qt: SignEncryptJob::signers NEW.
|
||||||
|
qt: SignEncryptJob::setRecipients NEW.
|
||||||
|
qt: SignEncryptJob::recipients NEW.
|
||||||
|
qt: SignEncryptJob::setInputFile NEW.
|
||||||
|
qt: SignEncryptJob::inputFile NEW.
|
||||||
|
qt: SignEncryptJob::setOutputFile NEW.
|
||||||
|
qt: SignEncryptJob::outputFile NEW.
|
||||||
|
qt: SignEncryptJob::setEncryptionFlags NEW.
|
||||||
|
qt: SignEncryptJob::encryptionFlags NEW.
|
||||||
|
qt: SignJob::setSigners NEW.
|
||||||
|
qt: SignJob::signers NEW.
|
||||||
|
qt: SignJob::setInputFile NEW.
|
||||||
|
qt: SignJob::inputFile NEW.
|
||||||
|
qt: SignJob::setOutputFile NEW.
|
||||||
|
qt: SignJob::outputFile NEW.
|
||||||
|
qt: SignJob::setSigningFlags NEW.
|
||||||
|
qt: SignJob::signingFlags NEW.
|
||||||
|
qt: SignJob::setAppendSignature NEW.
|
||||||
|
qt: SignJob::appendSignatureEnabled NEW.
|
||||||
|
qt: VerifyDetachedJob::setSignatureFile NEW.
|
||||||
|
qt: VerifyDetachedJob::signatureFile NEW.
|
||||||
|
qt: VerifyDetachedJob::setSignedFile NEW.
|
||||||
|
qt: VerifyDetachedJob::signedFile NEW.
|
||||||
|
qt: VerifyOpaqueJob::setInputFile NEW.
|
||||||
|
qt: VerifyOpaqueJob::inputFile NEW.
|
||||||
|
qt: VerifyOpaqueJob::setOutputFile NEW.
|
||||||
|
qt: VerifyOpaqueJob::outputFile NEW.
|
||||||
|
qt: ImportJob::setImportOptions NEW.
|
||||||
|
qt: ImportJob::importOptions NEW.
|
||||||
|
|
||||||
|
|
||||||
|
Noteworthy changes in version 1.23.2 (2023-11-28)
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
* Preserve more specific existing failure code. [T6575]
|
||||||
|
|
||||||
|
* qt: Start dirmngr with gpgconf to avoid multiple instances. [T6833]
|
||||||
|
|
||||||
|
* qt: On Windows, use UTF-8 when logging the error text. [T5960]
|
||||||
|
|
||||||
|
* qt: Remove left-over partial files more persistently. [T6584]
|
||||||
|
|
||||||
|
* qt: Use a temporary file name when creating signed or encrypted
|
||||||
|
archives. [T6721]
|
||||||
|
|
||||||
|
* qt: Build Qt 6 bindings with -fPIC if requested or Qt 6 was built with
|
||||||
|
this flag. [T6781]
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
~~~~~~
|
||||||
|
qt: DefaultKeyGenerationJob DEPRECATED.
|
||||||
|
|
||||||
|
[c=C43/A32/R1 cpp=C26/A20/R1 qt=C20/A5/R1]
|
||||||
|
|
||||||
|
Release-info: https://dev.gnupg.org/T6782
|
||||||
|
|
||||||
|
|
||||||
|
Noteworthy changes in version 1.23.1 (2023-10-27)
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
* w32: Change gpgme-w32-spawn to use Unicode arguments. [T6728]
|
||||||
|
|
||||||
|
[c=C43/A32/R0 cpp=C26/A20/R0 qt=C20/A5/R0]
|
||||||
|
|
||||||
|
Release-info: https://dev.gnupg.org/T6774
|
||||||
|
|
||||||
|
|
||||||
|
Noteworthy changes in version 1.23.0 (2023-10-25)
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
* Support GPGME_ENCRYPT_ALWAYS_TRUST also for S/MIME. [T6559]
|
||||||
|
|
||||||
|
* New keylist mode GPGME_KEYLIST_MODE_WITH_V5FPR. [T6705]
|
||||||
|
|
||||||
|
* New key capability flags has_*. [T6748]
|
||||||
|
|
||||||
|
* gpgme-tool: Support use of Windows HANDLE. [T6634]
|
||||||
|
|
||||||
|
* qt: Support refreshing keys via WKD. [T6672]
|
||||||
|
|
||||||
|
* qt: Handle cancel in changeexpiryjob. [T6754]
|
||||||
|
|
||||||
|
* Interface changes relative to the 1.22.0 release:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
GPGME_KEYLIST_MODE_WITH_V5FPR NEW.
|
||||||
|
gpgme_key_t EXTENDED: New field has_encrypt.
|
||||||
|
gpgme_key_t EXTENDED: New field has_sign.
|
||||||
|
gpgme_key_t EXTENDED: New field has_certify.
|
||||||
|
gpgme_key_t EXTENDED: New field has_authenticate.
|
||||||
|
cpp: Key::canCertify NEW.
|
||||||
|
cpp: Key::canSign NEW.
|
||||||
|
cpp: Key::canEncrypt NEW.
|
||||||
|
cpp: Key::canAuthenticate NEW.
|
||||||
|
qt: Protocol::wkdRefreshJob NEW.
|
||||||
|
qt: WKDRefreshJob NEW.
|
||||||
|
|
||||||
|
[c=C43/A32/R0 cpp=C26/A20/R0 qt=C20/A5/R0]
|
||||||
|
|
||||||
|
Release-info: https://dev.gnupg.org/T6774
|
||||||
|
|
||||||
|
|
||||||
|
Noteworthy changes in version 1.22.0 (2023-08-21)
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
* Prevent wrong plaintext when verifying clearsigned signature. [T6622]
|
||||||
|
|
||||||
|
* Return bad data error instead of general error on unexpected data.
|
||||||
|
[T6617]
|
||||||
|
|
||||||
|
* Take care of offline mode for all operations of gpgsm engine.
|
||||||
|
[T6648]
|
||||||
|
|
||||||
|
* Prepare the use of the forthcoming libassuan version 3.
|
||||||
|
|
||||||
|
* New configure option --with-libtool-modification. [T6619]
|
||||||
|
|
||||||
|
* cpp: Expose gpgme_decrypt_result_t.is_mime. [T6199]
|
||||||
|
|
||||||
|
* qt: Clean up after failure or cancel of sign/encrypt archive
|
||||||
|
operation. [T6584]
|
||||||
|
|
||||||
|
* qt: Add setInputEncoding to QGpgMe::EncryptJob. [T6166]
|
||||||
|
|
||||||
|
* qt: Make toLogString helper public. [T6584]
|
||||||
|
|
||||||
|
* Interface changes relative to the 1.21.0 release:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
qt: EncryptJob::setInputEncoding NEW.
|
||||||
|
qt: DecryptionResult::isMime NEW.
|
||||||
|
qt: toLogString NEW.
|
||||||
|
|
||||||
|
[c=C42/A31/R0 cpp=C25/A19/R0 qt=C19/A4/R0]
|
||||||
|
|
||||||
|
Release-info: https://dev.gnupg.org/T6668
|
||||||
|
|
||||||
|
|
||||||
|
Noteworthy changes in version 1.21.0 (2023-07-07)
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
* Extended gpgme_op_encrypt, gpgme_op_encrypt_sign, and gpgme_op_sign
|
||||||
|
to allow writing the output directly to a file. [T6530]
|
||||||
|
|
||||||
|
* Extended gpgme_op_decrypt and gpgme_op_verify to allow reading the
|
||||||
|
input data directly from files. [T6530]
|
||||||
|
|
||||||
|
* For key signing and uid revoking allow an empty user id.
|
||||||
|
[rMfbc3963d62]
|
||||||
|
|
||||||
|
* Pass an input-size-hint also to the gpgsm engine. [T6534]
|
||||||
|
|
||||||
|
* qt: Allow writing the created archives directly to a
|
||||||
|
file. [T6530]
|
||||||
|
|
||||||
|
* qt: Allow reading the signed/encrypted archive to decrypt
|
||||||
|
or verify directly from a file. [T6530]
|
||||||
|
|
||||||
|
* qt: Qt Jobs working with QIODeviceDataProvider now properly
|
||||||
|
handle input-size hints and progress for files larger.
|
||||||
|
2^32 bytes in 32 bit builds. [T6534]
|
||||||
|
|
||||||
|
* cpp: Error::isCanceled now also returns true for error code
|
||||||
|
GPG_ERR_FULLY_CANCELED. [T6510]
|
||||||
|
|
||||||
|
* python: Fix wrong use of write. [T6501]
|
||||||
|
|
||||||
|
* Interface changes relative to the 1.20.0 release:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
cpp: Data::setFlag NEW.
|
||||||
|
cpp: Data::setSizeHint NEW.
|
||||||
|
qt: Job::startIt NEW.
|
||||||
|
qt: DecryptVerifyArchiveJob::setInputFile NEW.
|
||||||
|
qt: DecryptVerifyArchiveJob::inputFile NEW.
|
||||||
|
qt: EncryptArchiveJob::setRecipients NEW.
|
||||||
|
qt: EncryptArchiveJob::recipients NEW.
|
||||||
|
qt: EncryptArchiveJob::setInputPaths NEW.
|
||||||
|
qt: EncryptArchiveJob::inputPaths NEW.
|
||||||
|
qt: EncryptArchiveJob::setOutputFile NEW.
|
||||||
|
qt: EncryptArchiveJob::outputFile NEW.
|
||||||
|
qt: EncryptArchiveJob::setEncryptionFlags NEW.
|
||||||
|
qt: EncryptArchiveJob::encryptionFlags NEW.
|
||||||
|
qt: SignArchiveJob::setSigners NEW.
|
||||||
|
qt: SignArchiveJob::signers NEW.
|
||||||
|
qt: SignArchiveJob::setInputPaths NEW.
|
||||||
|
qt: SignArchiveJob::inputPaths NEW.
|
||||||
|
qt: SignArchiveJob::setOutputFile NEW.
|
||||||
|
qt: SignArchiveJob::outputFile NEW.
|
||||||
|
qt: SignEncryptArchiveJob::setSigners NEW.
|
||||||
|
qt: SignEncryptArchiveJob::signers NEW.
|
||||||
|
qt: SignEncryptArchiveJob::setRecipients NEW.
|
||||||
|
qt: SignEncryptArchiveJob::recipients NEW.
|
||||||
|
qt: SignEncryptArchiveJob::setInputPaths NEW.
|
||||||
|
qt: SignEncryptArchiveJob::inputPaths NEW.
|
||||||
|
qt: SignEncryptArchiveJob::setOutputFile NEW.
|
||||||
|
qt: SignEncryptArchiveJob::outputFile NEW.
|
||||||
|
qt: SignEncryptArchiveJob::setEncryptionFlags NEW.
|
||||||
|
qt: SignEncryptArchiveJob::encryptionFlags NEW.
|
||||||
|
|
||||||
|
[c=C41/A30/R0 cpp=C24/A18/R0 qt=C18/A3/R0]
|
||||||
|
|
||||||
|
Release-info: https://dev.gnupg.org/T6585
|
||||||
|
|
||||||
|
|
||||||
|
Noteworthy changes in version 1.20.0 (2023-04-20)
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
* On Windows, the gettext functions provided by gpgrt are switched
|
||||||
|
into utf8 mode, so that all localized texts returned by GpgME or
|
||||||
|
gpgrt, e.g. the texts for error codes are now UTF-8 encoded.
|
||||||
|
[T5960]
|
||||||
|
|
||||||
|
* Key::canSign now returns false for OpenPGP keys without signing
|
||||||
|
(sub)key. [T6456]
|
||||||
|
|
||||||
|
* The new macOS Homebrew location is now by default supported.
|
||||||
|
[T6440]
|
||||||
|
|
||||||
|
* Fix regression in 1.19.0. [rMb608c084b9]
|
||||||
|
|
||||||
|
* Fix invocation of gpgtar on Windows. [rM0c29119e06]
|
||||||
|
|
||||||
|
* Interface changes relative to the 1.19.0 release:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
gpgme_subkey_t EXTENDED: New field 'can_renc'.
|
||||||
|
gpgme_subkey_t EXTENDED: New field 'can_timestamp'.
|
||||||
|
gpgme_subkey_t EXTENDED: New field 'is_group_owned'.
|
||||||
|
cpp: Subkey::canRenc NEW.
|
||||||
|
cpp: Subkey::canTimestamp NEW.
|
||||||
|
cpp: Subkey::isGroupOwned NEW.
|
||||||
|
cpp: Key::canReallySign DEPRECATED.
|
||||||
|
|
||||||
|
[c=C40/A29/R0 cpp=C23/A17/R0 qt=C17/A2/R1]
|
||||||
|
|
||||||
|
Release-info: https://dev.gnupg.org/T6463
|
||||||
|
|
||||||
|
|
||||||
|
Noteworthy changes in version 1.19.0 (2023-03-17)
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
* New convenience option --identify for gpgme-json.
|
||||||
|
|
||||||
|
* New context flag "no-auto-check-trustdb". [T6261]
|
||||||
|
|
||||||
|
* Optionally, build QGpgME for Qt 6
|
||||||
|
|
||||||
|
* Support component "gpgtar-name" in gpgme_get_dirinfo. [T6342]
|
||||||
|
|
||||||
|
* Extended gpgme_op_encrypt*, gpgme_op_encrypt_sign*, and
|
||||||
|
gpgme_op_sign* to allow creating an encrypted and/or signed
|
||||||
|
archive. [T6342]
|
||||||
|
|
||||||
|
* Extended gpgme_op_decrypt*, gpgme_op_decrypt_verify*, and gpgme_op_verify*
|
||||||
|
to allow extracting an encrypted and/or signed archive. [T6342]
|
||||||
|
|
||||||
|
* cpp: Handle error when trying to sign expired keys. [T6155]
|
||||||
|
|
||||||
|
* cpp: Support encryption flags ThrowKeyIds, EncryptWrap, and WantAddress.
|
||||||
|
[T6359]
|
||||||
|
|
||||||
|
* cpp, qt: Fix building with C++11. [T6141]
|
||||||
|
|
||||||
|
* qt: Fix problem with expiration dates after 2038-01-19 on 32-bit systems
|
||||||
|
when adding an existing subkey to another key. [T6137]
|
||||||
|
|
||||||
|
* cpp: Allow setting the curve to use when generating ECC keys
|
||||||
|
for smart cards. [T4429]
|
||||||
|
|
||||||
|
* qt: Extend ListAllKeysJob to allow disabling the automatic trust database
|
||||||
|
check when listing all keys. [T6261]
|
||||||
|
|
||||||
|
* qt: Allow deferred start of import jobs. [T6323]
|
||||||
|
|
||||||
|
* qt: Support creating and extracting signed and encrypted archives. [T6342]
|
||||||
|
|
||||||
|
* Interface changes relative to the 1.18.0 release:
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
gpgme_get_ctx_flag EXTENDED: New flag 'no-auto-check-trustdb'.
|
||||||
|
gpgme_set_ctx_flag EXTENDED: New flag 'no-auto-check-trustdb'.
|
||||||
|
GPGME_DECRYPT_ARCHIVE NEW.
|
||||||
|
GPGME_ENCRYPT_ARCHIVE NEW.
|
||||||
|
GPGME_SIG_MODE_ARCHIVE NEW.
|
||||||
|
GPGME_VERIFY_ARCHIVE NEW.
|
||||||
|
gpgme_verify_flags_t NEW.
|
||||||
|
gpgme_op_verify_ext_start NEW.
|
||||||
|
gpgme_op_verify_ext NEW.
|
||||||
|
cpp: GpgGenCardKeyInteractor::Curve NEW.
|
||||||
|
cpp: GpgGenCardKeyInteractor::setCurve NEW.
|
||||||
|
cpp: Context::WantAddress NEW.
|
||||||
|
cpp: Context::DecryptArchive NEW.
|
||||||
|
cpp: Context::EncryptArchive NEW.
|
||||||
|
cpp: SignArchive NEW.
|
||||||
|
cpp: Data::setFileName EXTENDED: New overload
|
||||||
|
qt: ListAllKeysJob::Option NEW.
|
||||||
|
qt: ListAllKeysJob::Options NEW.
|
||||||
|
qt: ListAllKeysJob::setOptions NEW.
|
||||||
|
qt: ListAllKeysJob::options NEW.
|
||||||
|
qt: Job::startNow NEW.
|
||||||
|
qt: ImportJob::startLater NEW.
|
||||||
|
qt: FileListDataProvider NEW.
|
||||||
|
qt: DecryptVerifyArchiveJob NEW.
|
||||||
|
qt: EncryptArchiveJob NEW.
|
||||||
|
qt: SignArchiveJob NEW.
|
||||||
|
qt: SignEncryptArchiveJob NEW.
|
||||||
|
qt: Protocol::decryptVerifyArchiveJob NEW.
|
||||||
|
qt: Protocol::encryptArchiveJob NEW.
|
||||||
|
qt: Protocol::signArchiveJob NEW.
|
||||||
|
qt: Protocol::signEncryptArchiveJob NEW.
|
||||||
|
qt: Job::jobProgress NEW.
|
||||||
|
qt: Job::rawProgress NEW.
|
||||||
|
qt: Job::progress DEPRECATED.
|
||||||
|
|
||||||
|
[c=C39/A28/R0 cpp=C22/A16/R0 qt=C17/A2/R0]
|
||||||
|
|
||||||
|
Release-info: https://dev.gnupg.org/T6341
|
||||||
|
|
||||||
|
|
||||||
Noteworthy changes in version 1.18.0 (2022-08-10)
|
Noteworthy changes in version 1.18.0 (2022-08-10)
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|
|
||||||
@ -367,7 +743,7 @@ Noteworthy changes in version 1.13.0 (2019-03-26)
|
|||||||
|
|
||||||
* Several fixes to the Common Lisp bindings.
|
* Several fixes to the Common Lisp bindings.
|
||||||
|
|
||||||
* Fixed minor bugs in gpgme-json. [#4331,#4341,#4342,#4343
|
* Fixed minor bugs in gpgme-json. [#4331,#4341,#4342,#4343]
|
||||||
|
|
||||||
* Require trace level 8 to dump all I/O data.
|
* Require trace level 8 to dump all I/O data.
|
||||||
|
|
||||||
|
8
README
8
README
@ -1,7 +1,7 @@
|
|||||||
GPGME - GnuPG Made Easy
|
GPGME - GnuPG Made Easy
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
Copyright 2001-2021 g10 Code GmbH
|
Copyright 2001-2023 g10 Code GmbH
|
||||||
|
|
||||||
This file is free software; as a special exception the author gives
|
This file is free software; as a special exception the author gives
|
||||||
unlimited permission to copy and/or distribute it, with or without
|
unlimited permission to copy and/or distribute it, with or without
|
||||||
@ -41,11 +41,11 @@ See the file INSTALL for generic installation instructions.
|
|||||||
Check that you have unmodified sources. See below on how to do this.
|
Check that you have unmodified sources. See below on how to do this.
|
||||||
Don't skip it - this is an important step!
|
Don't skip it - this is an important step!
|
||||||
|
|
||||||
To build GPGME, you need to install libgpg-error (>= 1.24) and
|
To build GPGME, you need to install libgpg-error (>= 1.36) and
|
||||||
Libassuan (>= 2.4.2).
|
Libassuan (>= 2.4.2).
|
||||||
|
|
||||||
For support of the OpenPGP and the CMS protocols, you should use the
|
For support of the OpenPGP and the CMS protocols, you should use at
|
||||||
latest version of GnuPG (>= 2.1.18) , available at:
|
least GnuPG version 2.2.41 or 2.4.3, available at:
|
||||||
https://gnupg.org/ftp/gcrypt/gnupg/.
|
https://gnupg.org/ftp/gcrypt/gnupg/.
|
||||||
|
|
||||||
For building the Git version of GPGME please see the file README.GIT
|
For building the Git version of GPGME please see the file README.GIT
|
||||||
|
@ -11,4 +11,4 @@ case "$myhost" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
final_info="./configure --enable-maintainer-mode && make"
|
final_info="mkdir build && cd build && ../configure --enable-maintainer-mode && make"
|
||||||
|
43
autogen.sh
43
autogen.sh
@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# autogen.sh
|
# autogen.sh
|
||||||
# Copyright (C) 2003, 2014, 2017, 2018 g10 Code GmbH
|
# Copyright (C) 2003, 2014, 2017, 2018, 2022 g10 Code GmbH
|
||||||
#
|
#
|
||||||
# This file is free software; as a special exception the author gives
|
# This file is free software; as a special exception the author gives
|
||||||
# unlimited permission to copy and/or distribute it, with or without
|
# unlimited permission to copy and/or distribute it, with or without
|
||||||
@ -15,7 +15,7 @@
|
|||||||
# configure it for the respective package. It is maintained as part of
|
# configure it for the respective package. It is maintained as part of
|
||||||
# GnuPG and source copied by other packages.
|
# GnuPG and source copied by other packages.
|
||||||
#
|
#
|
||||||
# Version: 2018-07-10
|
# Version: 2023-03-15
|
||||||
|
|
||||||
configure_ac="configure.ac"
|
configure_ac="configure.ac"
|
||||||
|
|
||||||
@ -137,8 +137,6 @@ extraoptions=
|
|||||||
# List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.rc
|
# List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.rc
|
||||||
w32_toolprefixes=
|
w32_toolprefixes=
|
||||||
w32_extraoptions=
|
w32_extraoptions=
|
||||||
w32ce_toolprefixes=
|
|
||||||
w32ce_extraoptions=
|
|
||||||
w64_toolprefixes=
|
w64_toolprefixes=
|
||||||
w64_extraoptions=
|
w64_extraoptions=
|
||||||
amd64_toolprefixes=
|
amd64_toolprefixes=
|
||||||
@ -146,7 +144,6 @@ amd64_toolprefixes=
|
|||||||
# What follows are variables which are sourced but default to
|
# What follows are variables which are sourced but default to
|
||||||
# environment variables or lacking them hardcoded values.
|
# environment variables or lacking them hardcoded values.
|
||||||
#w32root=
|
#w32root=
|
||||||
#w32ce_root=
|
|
||||||
#w64root=
|
#w64root=
|
||||||
#amd64root=
|
#amd64root=
|
||||||
|
|
||||||
@ -167,11 +164,6 @@ case "$1" in
|
|||||||
myhost="w32"
|
myhost="w32"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--build-w32ce)
|
|
||||||
myhost="w32"
|
|
||||||
myhostsub="ce"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--build-w64)
|
--build-w64)
|
||||||
myhost="w32"
|
myhost="w32"
|
||||||
myhostsub="64"
|
myhostsub="64"
|
||||||
@ -203,7 +195,7 @@ if [ "$myhost" = "git-build" ]; then
|
|||||||
die_p
|
die_p
|
||||||
make || fatal "error running make"
|
make || fatal "error running make"
|
||||||
die_p
|
die_p
|
||||||
make check || fatal "error running male check"
|
make check || fatal "error running make check"
|
||||||
die_p
|
die_p
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@ -241,10 +233,12 @@ if [ "$myhost" = "find-version" ]; then
|
|||||||
if [ -z "$micro" ]; then
|
if [ -z "$micro" ]; then
|
||||||
matchstr1="$package-$major.[0-9]*"
|
matchstr1="$package-$major.[0-9]*"
|
||||||
matchstr2="$package-$major-base"
|
matchstr2="$package-$major-base"
|
||||||
|
matchstr3=""
|
||||||
vers="$major.$minor"
|
vers="$major.$minor"
|
||||||
else
|
else
|
||||||
matchstr1="$package-$major.$minor.[0-9]*"
|
matchstr1="$package-$major.$minor.[0-9]*"
|
||||||
matchstr2="$package-$major.$minor-base"
|
matchstr2="$package-$major.[0-9]*-base"
|
||||||
|
matchstr3="$package-$major-base"
|
||||||
vers="$major.$minor.$micro"
|
vers="$major.$minor.$micro"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -252,13 +246,22 @@ if [ "$myhost" = "find-version" ]; then
|
|||||||
if [ -e .git ]; then
|
if [ -e .git ]; then
|
||||||
ingit=yes
|
ingit=yes
|
||||||
tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null)
|
tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null)
|
||||||
tmp=$(echo "$tmp" | sed s/^"$package"//)
|
|
||||||
if [ -n "$tmp" ]; then
|
if [ -n "$tmp" ]; then
|
||||||
tmp=$(echo "$tmp" | sed s/^"$package"// \
|
tmp=$(echo "$tmp" | sed s/^"$package"// \
|
||||||
| awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
|
| awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
|
||||||
else
|
else
|
||||||
tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null \
|
# (due tof "-base" in the tag we need to take the 4th field)
|
||||||
| awk -F- '$4!=0{print"-beta"$4}')
|
tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null)
|
||||||
|
if [ -n "$tmp" ]; then
|
||||||
|
tmp=$(echo "$tmp" | sed s/^"$package"// \
|
||||||
|
| awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}')
|
||||||
|
elif [ -n "${matchstr3}" ]; then
|
||||||
|
tmp=$(git describe --match "${matchstr3}" --long 2>/dev/null)
|
||||||
|
if [ -n "$tmp" ]; then
|
||||||
|
tmp=$(echo "$tmp" | sed s/^"$package"// \
|
||||||
|
| awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}')
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
[ -n "$tmp" ] && beta=yes
|
[ -n "$tmp" ] && beta=yes
|
||||||
rev=$(git rev-parse --short HEAD | tr -d '\n\r')
|
rev=$(git rev-parse --short HEAD | tr -d '\n\r')
|
||||||
@ -294,12 +297,6 @@ fi
|
|||||||
# ******************
|
# ******************
|
||||||
if [ "$myhost" = "w32" ]; then
|
if [ "$myhost" = "w32" ]; then
|
||||||
case $myhostsub in
|
case $myhostsub in
|
||||||
ce)
|
|
||||||
w32root="$w32ce_root"
|
|
||||||
[ -z "$w32root" ] && w32root="$HOME/w32ce_root"
|
|
||||||
toolprefixes="$w32ce_toolprefixes arm-mingw32ce"
|
|
||||||
extraoptions="$extraoptions $w32ce_extraoptions"
|
|
||||||
;;
|
|
||||||
64)
|
64)
|
||||||
w32root="$w64root"
|
w32root="$w64root"
|
||||||
[ -z "$w32root" ] && w32root="$HOME/w64root"
|
[ -z "$w32root" ] && w32root="$HOME/w64root"
|
||||||
|
68
build-aux/libtool-patch.sed
Normal file
68
build-aux/libtool-patch.sed
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
#
|
||||||
|
# This is a sed script to patch the generated libtool,
|
||||||
|
# which works well against both of libtool 2.4.2 and 2.4.7.
|
||||||
|
#
|
||||||
|
# You may use this work under the terms of a Creative Commons CC0 1.0
|
||||||
|
# License/Waiver.
|
||||||
|
#
|
||||||
|
# CC0 Public Domain Dedication
|
||||||
|
# https://creativecommons.org/publicdomain/zero/1.0/
|
||||||
|
|
||||||
|
#
|
||||||
|
# This sed script applys two hunks of the patch:
|
||||||
|
#
|
||||||
|
# Part1: after the comment "# bleh windows"
|
||||||
|
# Part2: after the comment "#extension on DOS 8.3..."
|
||||||
|
#
|
||||||
|
# Only when those two parts are patched correctly, it exits with 0 or
|
||||||
|
# else, it exits with 1
|
||||||
|
#
|
||||||
|
|
||||||
|
# Find the part 1, by the comment
|
||||||
|
/^[ \t]*# bleh windows$/b part1_start
|
||||||
|
# Not found the part1, raise an error
|
||||||
|
$ q1
|
||||||
|
b
|
||||||
|
|
||||||
|
:part1_start
|
||||||
|
n
|
||||||
|
# The first line in the part 1 must be the begining of the case statement.
|
||||||
|
/^[ \t]*case \$host in$/! q1
|
||||||
|
n
|
||||||
|
# Insert the entry for x86_64-*mingw32*, for modified versuffix.
|
||||||
|
i\
|
||||||
|
x86_64-*mingw32*)
|
||||||
|
i\
|
||||||
|
func_arith $current - $age
|
||||||
|
i\
|
||||||
|
major=$func_arith_result
|
||||||
|
i\
|
||||||
|
versuffix="6-$major"
|
||||||
|
i\
|
||||||
|
;;
|
||||||
|
:part1_0
|
||||||
|
# Find the end of the case statement
|
||||||
|
/^[ \t]*esac$/b find_part2
|
||||||
|
# Not found the end of the case statement, raise an error
|
||||||
|
$ q1
|
||||||
|
n
|
||||||
|
b part1_0
|
||||||
|
|
||||||
|
:find_part2
|
||||||
|
/^[ \t]*# extension on DOS 8.3 file.*systems.$/b part2_process
|
||||||
|
# Not found the part2, raise an error
|
||||||
|
$ q1
|
||||||
|
n
|
||||||
|
b find_part2
|
||||||
|
|
||||||
|
:part2_process
|
||||||
|
$ q1
|
||||||
|
s/^[ \t]*\(versuffix=\)\(.*\)\(-$major\)\(.*\)$/\t case \$host in\n\t x86_64-*mingw32*)\n\t \1\26\3\4\n\t ;;\n\t *)\n\t \1\2\3\4\n\t ;;\n\t esac/
|
||||||
|
t part2_done
|
||||||
|
n
|
||||||
|
b part2_process
|
||||||
|
|
||||||
|
:part2_done
|
||||||
|
$ q0
|
||||||
|
n
|
||||||
|
b part2_done
|
@ -482,7 +482,7 @@
|
|||||||
% \def\foo{\parsearg\Xfoo}
|
% \def\foo{\parsearg\Xfoo}
|
||||||
% \def\Xfoo#1{...}
|
% \def\Xfoo#1{...}
|
||||||
%
|
%
|
||||||
% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
|
% Actually, I use \csname\string\foo\endcsname, i.e. \\foo, as it is my
|
||||||
% favourite TeX trick. --kasal, 16nov03
|
% favourite TeX trick. --kasal, 16nov03
|
||||||
|
|
||||||
\def\parseargdef#1{%
|
\def\parseargdef#1{%
|
||||||
|
358
configure.ac
358
configure.ac
@ -31,7 +31,7 @@ min_automake_version="1.14"
|
|||||||
# for the LT versions.
|
# for the LT versions.
|
||||||
m4_define([mym4_package],[gpgme])
|
m4_define([mym4_package],[gpgme])
|
||||||
m4_define([mym4_major], [1])
|
m4_define([mym4_major], [1])
|
||||||
m4_define([mym4_minor], [18])
|
m4_define([mym4_minor], [24])
|
||||||
m4_define([mym4_micro], [0])
|
m4_define([mym4_micro], [0])
|
||||||
|
|
||||||
# Below is m4 magic to extract and compute the git revision number,
|
# Below is m4 magic to extract and compute the git revision number,
|
||||||
@ -53,20 +53,20 @@ AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
|
|||||||
# (Interfaces added: AGE++)
|
# (Interfaces added: AGE++)
|
||||||
# (Interfaces removed: AGE=0)
|
# (Interfaces removed: AGE=0)
|
||||||
#
|
#
|
||||||
LIBGPGME_LT_CURRENT=38
|
LIBGPGME_LT_CURRENT=43
|
||||||
LIBGPGME_LT_AGE=27
|
LIBGPGME_LT_AGE=32
|
||||||
LIBGPGME_LT_REVISION=0
|
LIBGPGME_LT_REVISION=1
|
||||||
|
|
||||||
# If there is an ABI break in gpgmepp or qgpgme also bump the
|
# If there is an ABI break in gpgmepp or qgpgme also bump the
|
||||||
# version in IMPORTED_LOCATION in the GpgmeppConfig-w32.cmake.in.in
|
# version in IMPORTED_LOCATION in the GpgmeppConfig-w32.cmake.in.in
|
||||||
|
|
||||||
LIBGPGMEPP_LT_CURRENT=21
|
LIBGPGMEPP_LT_CURRENT=26
|
||||||
LIBGPGMEPP_LT_AGE=15
|
LIBGPGMEPP_LT_AGE=20
|
||||||
LIBGPGMEPP_LT_REVISION=0
|
LIBGPGMEPP_LT_REVISION=1
|
||||||
|
|
||||||
LIBQGPGME_LT_CURRENT=16
|
LIBQGPGME_LT_CURRENT=20
|
||||||
LIBQGPGME_LT_AGE=1
|
LIBQGPGME_LT_AGE=5
|
||||||
LIBQGPGME_LT_REVISION=0
|
LIBQGPGME_LT_REVISION=1
|
||||||
################################################
|
################################################
|
||||||
|
|
||||||
AC_SUBST(LIBGPGME_LT_CURRENT)
|
AC_SUBST(LIBGPGME_LT_CURRENT)
|
||||||
@ -85,7 +85,7 @@ AC_SUBST(LIBQGPGME_LT_REVISION)
|
|||||||
GPGME_CONFIG_API_VERSION=1
|
GPGME_CONFIG_API_VERSION=1
|
||||||
##############################################
|
##############################################
|
||||||
|
|
||||||
NEED_GPG_ERROR_VERSION=1.36
|
NEED_GPG_ERROR_VERSION=1.47
|
||||||
NEED_LIBASSUAN_API=2
|
NEED_LIBASSUAN_API=2
|
||||||
NEED_LIBASSUAN_VERSION=2.4.2
|
NEED_LIBASSUAN_VERSION=2.4.2
|
||||||
|
|
||||||
@ -206,6 +206,44 @@ esac
|
|||||||
|
|
||||||
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
||||||
|
|
||||||
|
#
|
||||||
|
# Specify how we support our local modification of libtool for Windows
|
||||||
|
# 64-bit. Options are:
|
||||||
|
#
|
||||||
|
# (1) apply: when appying patch fails, it results failure of entire build
|
||||||
|
# (2) never: never apply the patch (no try)
|
||||||
|
# (3) try: use patched if it goes well, use original if fails
|
||||||
|
#
|
||||||
|
AC_ARG_WITH([libtool-modification],
|
||||||
|
AS_HELP_STRING([--with-libtool-modification=apply|never|try],
|
||||||
|
[how to handle libtool modification (default=never)]),
|
||||||
|
build_libtool_modification=$withval,
|
||||||
|
build_libtool_modification=never)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Apply a patch (locally maintained one of ours) to libtool
|
||||||
|
#
|
||||||
|
case $host in
|
||||||
|
x86_64-*mingw32*)
|
||||||
|
AC_CONFIG_COMMANDS([libtool-patch],[[
|
||||||
|
if test "$build_selection" = never; then
|
||||||
|
echo "patch not applied"
|
||||||
|
elif (mv -f libtool libtool.orig; \
|
||||||
|
sed -f $srcdir/build-aux/libtool-patch.sed libtool.orig >libtool); then
|
||||||
|
echo "applied successfully"
|
||||||
|
elif test "$build_selection" = try; then
|
||||||
|
mv -f libtool.orig libtool
|
||||||
|
echo "patch failed, thus, using original"
|
||||||
|
else
|
||||||
|
echo "patch failed"
|
||||||
|
as_fn_exit 1
|
||||||
|
fi
|
||||||
|
]],[build_selection=$build_libtool_modification])
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
GPG_DEFAULT=no
|
GPG_DEFAULT=no
|
||||||
GPGSM_DEFAULT=no
|
GPGSM_DEFAULT=no
|
||||||
GPGCONF_DEFAULT=no
|
GPGCONF_DEFAULT=no
|
||||||
@ -218,8 +256,8 @@ have_w64_system=no
|
|||||||
have_macos_system=no
|
have_macos_system=no
|
||||||
build_w32_glib=no
|
build_w32_glib=no
|
||||||
build_w32_qt=no
|
build_w32_qt=no
|
||||||
available_languages="cl cpp python qt"
|
available_languages="cl cpp python qt qt5 qt6"
|
||||||
default_languages="cl cpp python qt"
|
default_languages="cl cpp python qt5 qt6"
|
||||||
case "${host}" in
|
case "${host}" in
|
||||||
x86_64-*mingw32*)
|
x86_64-*mingw32*)
|
||||||
have_w64_system=yes
|
have_w64_system=yes
|
||||||
@ -300,12 +338,44 @@ if test x$fixed_search_path != x ; then
|
|||||||
[Locate binaries only via this PATH])
|
[Locate binaries only via this PATH])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Option --enable-reduce-relocations
|
||||||
|
#
|
||||||
|
# Allow building the Qt 6 bindings explicitly with -fPIC if the automatic
|
||||||
|
# detection fails. Note: We assume that this flag is always available (unless
|
||||||
|
# we built for Windows).
|
||||||
|
AC_ARG_ENABLE([reduce-relocations],
|
||||||
|
AS_HELP_STRING([--enable-reduce-relocations],
|
||||||
|
[build Qt 6 bindings with -fPIC (default is
|
||||||
|
auto)]),
|
||||||
|
[use_reduce_relocations="$enableval"],
|
||||||
|
[use_reduce_relocations=""])
|
||||||
|
|
||||||
|
# Option --enable-no-direct-extern-access
|
||||||
|
#
|
||||||
|
# Some distributions build Qt 6 with -mno-direct-extern-access. Libraries and
|
||||||
|
# applications using Qt then must also be build with this flag. As workaround
|
||||||
|
# for a bug in Qt's pkgconfig files which don't have this flag we allow
|
||||||
|
# building with this flag explicitly.
|
||||||
|
AC_LANG_PUSH(C++)
|
||||||
|
AX_CHECK_COMPILE_FLAG([-mno-direct-extern-access],
|
||||||
|
[have_no_direct_extern_access="yes"],
|
||||||
|
[have_no_direct_extern_access="no"],
|
||||||
|
[-Werror])
|
||||||
|
AC_LANG_POP()
|
||||||
|
AC_ARG_ENABLE([no-direct-extern-access],
|
||||||
|
AS_HELP_STRING([--enable-no-direct-extern-access],
|
||||||
|
[build Qt 6 bindings with
|
||||||
|
-mno-direct-extern-access (default is auto)]),
|
||||||
|
[use_no_direct_extern_access="$enableval"],
|
||||||
|
[use_no_direct_extern_access=""])
|
||||||
|
|
||||||
|
|
||||||
# Note: You need to declare all possible languages also in
|
# Note: You need to declare all possible languages also in
|
||||||
# lang/Makefile.am's DIST_SUBDIRS.
|
# lang/Makefile.am's DIST_SUBDIRS.
|
||||||
AC_ARG_ENABLE([languages],
|
AC_ARG_ENABLE([languages],
|
||||||
AS_HELP_STRING([--enable-languages=languages],
|
AS_HELP_STRING([--enable-languages=languages],
|
||||||
[enable only specific language bindings]),
|
[enable only specific language bindings:
|
||||||
|
cl cpp python qt5 qt6]),
|
||||||
[enabled_languages=`echo $enableval | \
|
[enabled_languages=`echo $enableval | \
|
||||||
tr ',:' ' ' | tr '[A-Z]' '[a-z]' | \
|
tr ',:' ' ' | tr '[A-Z]' '[a-z]' | \
|
||||||
sed 's/c++/cpp/'`],
|
sed 's/c++/cpp/'`],
|
||||||
@ -331,84 +401,179 @@ for language in $enabled_languages; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Enable C++ 11 if cpp language is requested
|
# Check whether qt5 and/or qt6 are enabled
|
||||||
LIST_MEMBER("cpp", $enabled_languages)
|
want_qt5="no"
|
||||||
|
LIST_MEMBER("qt5", $enabled_languages)
|
||||||
if test "$found" = "1"; then
|
if test "$found" = "1"; then
|
||||||
|
if test "$explicit_languages" = "1"; then
|
||||||
|
want_qt5="yes"
|
||||||
|
else
|
||||||
|
want_qt5="maybe"
|
||||||
|
fi
|
||||||
|
# Remove qt5; further down qt will be added
|
||||||
|
enabled_languages=$(echo $enabled_languages | sed 's/qt5//')
|
||||||
|
fi
|
||||||
|
want_qt6="no"
|
||||||
|
LIST_MEMBER("qt6", $enabled_languages)
|
||||||
|
if test "$found" = "1"; then
|
||||||
|
if test "$explicit_languages" = "1"; then
|
||||||
|
want_qt6="yes"
|
||||||
|
else
|
||||||
|
want_qt6="maybe"
|
||||||
|
fi
|
||||||
|
# Remove qt6; further down qt will be added
|
||||||
|
enabled_languages=$(echo $enabled_languages | sed 's/qt6//')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check whether qt is enabled; if yes then it has been enabled explicitly
|
||||||
|
want_qt="no"
|
||||||
|
LIST_MEMBER("qt", $enabled_languages)
|
||||||
|
if test "$found" = "1"; then
|
||||||
|
# Ignore qt if specified together with qt5 or qt6
|
||||||
|
if test "$want_qt5" = "no" -a "$want_qt6" = "no"; then
|
||||||
|
want_qt="yes"
|
||||||
|
fi
|
||||||
|
# Remove qt
|
||||||
|
enabled_languages=$(echo $enabled_languages | sed 's/qt//')
|
||||||
|
AC_MSG_WARN([[
|
||||||
|
***
|
||||||
|
*** Language binding "qt" is deprecated and will be removed in a future version.
|
||||||
|
*** Use "qt5" and/or "qt6" instead.
|
||||||
|
***]])
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure that pkg-config is available for all calls of FIND_QT5/FIND_QT6
|
||||||
|
PKG_PROG_PKG_CONFIG
|
||||||
|
|
||||||
|
# Check for Qt 5 (if qt5 or qt is enabled)
|
||||||
|
if test "$want_qt" = "yes"; then
|
||||||
|
want_qt5="maybe"
|
||||||
|
fi
|
||||||
|
if test "$want_qt5" != "no"; then
|
||||||
|
FIND_QT5
|
||||||
|
if test "$have_qt5_libs" = "yes"; then
|
||||||
|
want_qt5="yes"
|
||||||
|
elif test "$want_qt5" = "yes"; then
|
||||||
|
AC_MSG_ERROR([[
|
||||||
|
***
|
||||||
|
*** Qt5 (Qt5Core) is required for the Qt 5 binding.
|
||||||
|
***]])
|
||||||
|
else
|
||||||
|
want_qt5="no"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for Qt 6 (if qt6 is enabled or if qt is enabled and Qt 5 wasn't found)
|
||||||
|
if test "$want_qt" = "yes" -a "$have_qt5_libs" != "yes"; then
|
||||||
|
want_qt6="maybe"
|
||||||
|
fi
|
||||||
|
if test "$want_qt6" != "no"; then
|
||||||
|
FIND_QT6
|
||||||
|
if test "$have_qt6_libs" = "yes"; then
|
||||||
|
want_qt6="yes";
|
||||||
|
elif test "$want_qt6" = "yes"; then
|
||||||
|
AC_MSG_ERROR([[
|
||||||
|
***
|
||||||
|
*** Qt6 (Qt6Core) is required for the Qt 6 binding.
|
||||||
|
***]])
|
||||||
|
else
|
||||||
|
want_qt6="no"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if any Qt was found (if qt is enabled)
|
||||||
|
if test "$want_qt" = "yes" -a "$have_qt5_libs" != "yes" -a "$have_qt6_libs" != "yes"; then
|
||||||
|
AC_MSG_ERROR([[
|
||||||
|
***
|
||||||
|
*** Qt5 (Qt5Core) or Qt6 (Qt6Core) is required for the Qt bindings.
|
||||||
|
***]])
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check that cpp is enabled if qt5 or qt6 is enabled and was found
|
||||||
|
if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
|
||||||
|
LIST_MEMBER("cpp", $enabled_languages)
|
||||||
|
if test "$found" = "0"; then
|
||||||
|
AC_MSG_ERROR([[
|
||||||
|
***
|
||||||
|
*** The Qt bindings depend on the C++ binding.
|
||||||
|
***]])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Enable C++ 17 if qt6 is requested
|
||||||
|
if test "$want_qt6" = "yes"; then
|
||||||
|
AX_CXX_COMPILE_STDCXX(17, noext, optional)
|
||||||
|
if test "$HAVE_CXX17" != "1"; then
|
||||||
|
if test "$explicit_languages" = "1"; then
|
||||||
|
AC_MSG_ERROR([[
|
||||||
|
***
|
||||||
|
*** A compiler with c++17 support is required for the Qt 6 binding.
|
||||||
|
***]])
|
||||||
|
else
|
||||||
|
want_qt6="no"
|
||||||
|
AC_MSG_WARN([[
|
||||||
|
***
|
||||||
|
*** No c++17 support detected. Qt 6 binding will be disabled.
|
||||||
|
***]])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Enable C++ 11 if cpp is requested (unless C++ 17 was already enabled)
|
||||||
|
LIST_MEMBER("cpp", $enabled_languages)
|
||||||
|
if test "$found" = "1" -a "$HAVE_CXX17" != "1"; then
|
||||||
AX_CXX_COMPILE_STDCXX(11, noext, optional)
|
AX_CXX_COMPILE_STDCXX(11, noext, optional)
|
||||||
if test "$HAVE_CXX11" != "1"; then
|
if test "$HAVE_CXX11" != "1"; then
|
||||||
if test "$explicit_languages" = "1"; then
|
if test "$explicit_languages" = "1"; then
|
||||||
AC_MSG_ERROR([[
|
AC_MSG_ERROR([[
|
||||||
***
|
***
|
||||||
*** A compiler with c++11 support is required for the c++ binding.
|
*** A compiler with c++11 support is required for the C++ binding.
|
||||||
***]])
|
***]])
|
||||||
else
|
else
|
||||||
enabled_languages=$(echo $enabled_languages | sed 's/cpp//')
|
enabled_languages=$(echo $enabled_languages | sed 's/cpp//')
|
||||||
enabled_languages=$(echo $enabled_languages | sed 's/qt//')
|
want_qt5="no"
|
||||||
AC_MSG_WARN([[
|
AC_MSG_WARN([[
|
||||||
***
|
***
|
||||||
*** No c++11 support detected. C++ and Qt bindings will be disabled.
|
*** No c++11 support detected. C++ and Qt 5 bindings will be disabled.
|
||||||
***]])
|
***]])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Now append qt to the list of language bindings (to enable the subdir in lang)
|
||||||
|
if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
|
||||||
|
enabled_languages=$(echo $enabled_languages qt)
|
||||||
|
fi
|
||||||
|
|
||||||
# Check whether compiler supports visibility attribute (if cpp language is enabled)
|
# Check whether compiler supports visibility attribute (if cpp language is enabled)
|
||||||
LIST_MEMBER("cpp", $enabled_languages)
|
LIST_MEMBER("cpp", $enabled_languages)
|
||||||
if test "$found" = "1"; then
|
if test "$found" = "1"; then
|
||||||
AX_GCC_FUNC_ATTRIBUTE(visibility)
|
AX_GCC_FUNC_ATTRIBUTE(visibility)
|
||||||
if test "$ax_cv_have_func_attribute_visibility" = "yes"; then
|
if test "$ax_cv_have_func_attribute_visibility" = "yes"; then
|
||||||
GPGME_CPP_CFLAGS="$GPGME_CPP_CFLAGS -fvisibility=hidden"
|
GPGME_CPP_CFLAGS="$GPGME_CPP_CFLAGS -fvisibility=hidden"
|
||||||
|
if test "$want_qt5" = "yes"; then
|
||||||
|
GPGME_QT5_CFLAGS="$GPGME_QT5_CFLAGS -fvisibility=hidden"
|
||||||
|
fi
|
||||||
|
if test "$want_qt6" = "yes"; then
|
||||||
|
GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS -fvisibility=hidden"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
AC_SUBST(GPGME_CPP_CFLAGS)
|
AC_SUBST(GPGME_CPP_CFLAGS)
|
||||||
|
|
||||||
# Check that if qt is enabled cpp also is enabled
|
AM_CONDITIONAL(WANT_QT5, test "$want_qt5" = yes)
|
||||||
LIST_MEMBER("qt", $enabled_languages)
|
AM_CONDITIONAL(WANT_QT6, test "$want_qt6" = yes)
|
||||||
if test "$found" = "1"; then
|
|
||||||
# We need to ensure that in the language order qt comes after cpp
|
|
||||||
# so we remove qt first and explicitly add it as last list member.
|
|
||||||
enabled_languages=$(echo $enabled_languages | sed 's/qt//')
|
|
||||||
LIST_MEMBER("cpp", $enabled_languages)
|
|
||||||
if test "$found" = "0"; then
|
|
||||||
AC_MSG_ERROR([[
|
|
||||||
***
|
|
||||||
*** Qt language binding depends on cpp binding.
|
|
||||||
***]])
|
|
||||||
fi
|
|
||||||
FIND_QT
|
|
||||||
if test "$have_qt5_libs" != "yes"; then
|
|
||||||
if test "$explicit_languages" = "1"; then
|
|
||||||
AC_MSG_ERROR([[
|
|
||||||
***
|
|
||||||
*** Qt5 (Qt5Core) is required for Qt binding.
|
|
||||||
***]])
|
|
||||||
else
|
|
||||||
AC_MSG_WARN([[
|
|
||||||
***
|
|
||||||
*** Qt5 (Qt5Core) not found Qt Binding will be disabled.
|
|
||||||
***]])
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
enabled_languages=`echo $enabled_languages qt`
|
|
||||||
|
|
||||||
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
# Check for tools for building the Qt binding docs
|
||||||
if test -z "$DOXYGEN";
|
if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then
|
||||||
# This is not highlighted because it's not really important.
|
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
||||||
then AC_MSG_WARN([Doxygen not found - Qt binding doc will not be built.])
|
if test -z "$DOXYGEN"; then
|
||||||
fi
|
# This is not highlighted because it's not really important.
|
||||||
AC_CHECK_PROGS([GRAPHVIZ], [dot])
|
AC_MSG_WARN([Doxygen not found - Qt binding doc will not be built.])
|
||||||
if test -z "$GRAPHVIZ";
|
|
||||||
then AC_MSG_WARN([Graphviz not found - Qt binding doc will not have diagrams.])
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
AC_CHECK_PROGS([GRAPHVIZ], [dot])
|
||||||
|
if test -z "$GRAPHVIZ"; then
|
||||||
# Check if compiler supports visibility attribute (if qt is enabled)
|
AC_MSG_WARN([Graphviz not found - Qt binding doc will not have diagrams.])
|
||||||
LIST_MEMBER("qt", $enabled_languages)
|
|
||||||
if test "$found" = "1"; then
|
|
||||||
AX_GCC_FUNC_ATTRIBUTE(visibility)
|
|
||||||
if test "$ax_cv_have_func_attribute_visibility" = "yes"; then
|
|
||||||
GPGME_QT_CFLAGS="$GPGME_QT_CFLAGS -fvisibility=hidden"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -443,11 +608,12 @@ if test "$found_py" = "1"; then
|
|||||||
if test "$found_py" = "1" -o "$found_py3" = "1"; then
|
if test "$found_py" = "1" -o "$found_py3" = "1"; then
|
||||||
# Reset everything, so that we can look for another Python.
|
# Reset everything, so that we can look for another Python.
|
||||||
m4_foreach([mym4pythonver],
|
m4_foreach([mym4pythonver],
|
||||||
[[2.7],[3.4],[3.5],[3.6],[3.7],[3.8],[3.9],[all]],
|
[[2.7],[3.6],[3.8],[3.9],[3.10],[3.11],[3.12],[all]],
|
||||||
[unset PYTHON
|
[unset PYTHON
|
||||||
unset PYTHON_VERSION
|
unset PYTHON_VERSION
|
||||||
unset PYTHON_CPPFLAGS
|
unset PYTHON_CPPFLAGS
|
||||||
unset PYTHON_LDFLAGS
|
unset PYTHON_LDFLAGS
|
||||||
|
unset PYTHON_LIBS
|
||||||
unset PYTHON_SITE_PKG
|
unset PYTHON_SITE_PKG
|
||||||
unset PYTHON_EXTRA_LIBS
|
unset PYTHON_EXTRA_LIBS
|
||||||
unset PYTHON_EXTRA_LDFLAGS
|
unset PYTHON_EXTRA_LDFLAGS
|
||||||
@ -458,7 +624,7 @@ if test "$found_py" = "1"; then
|
|||||||
unset am_cv_python_pythondir
|
unset am_cv_python_pythondir
|
||||||
unset am_cv_python_pyexecdir
|
unset am_cv_python_pyexecdir
|
||||||
AM_PATH_PYTHON(mym4pythonver, [
|
AM_PATH_PYTHON(mym4pythonver, [
|
||||||
AX_PYTHON_DEVEL
|
AX_PYTHON_DEVEL([], [true])
|
||||||
if test "$PYTHON_VERSION"; then
|
if test "$PYTHON_VERSION"; then
|
||||||
PYTHONS="$(echo $PYTHONS $PYTHON)"
|
PYTHONS="$(echo $PYTHONS $PYTHON)"
|
||||||
PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)"
|
PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)"
|
||||||
@ -842,6 +1008,9 @@ AH_BOTTOM([
|
|||||||
# define GPGME_GCC_A_PURE
|
# define GPGME_GCC_A_PURE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Under Windows we use the gettext code from gpgrt. */
|
||||||
|
#define GPG_ERR_ENABLE_GETTEXT_MACROS 1
|
||||||
|
|
||||||
/* Under WindowsCE we need gpg-error's strerror macro. */
|
/* Under WindowsCE we need gpg-error's strerror macro. */
|
||||||
#define GPG_ERR_ENABLE_ERRNO_MACROS 1
|
#define GPG_ERR_ENABLE_ERRNO_MACROS 1
|
||||||
|
|
||||||
@ -850,11 +1019,45 @@ AH_BOTTOM([
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
# Substitution used for gpgme-config
|
# Substitution used for gpgme-config and gpgme.pc
|
||||||
GPGME_CONFIG_LIBS="-lgpgme"
|
GPGME_CONFIG_LIBS="-lgpgme"
|
||||||
GPGME_CONFIG_CFLAGS=""
|
GPGME_CONFIG_CFLAGS=""
|
||||||
GPGME_CONFIG_HOST="$host"
|
GPGME_CONFIG_HOST="$host"
|
||||||
GPGME_CONFIG_AVAIL_LANG="$enabled_languages"
|
GPGME_CONFIG_AVAIL_LANG="$enabled_languages"
|
||||||
|
|
||||||
|
case "$includedir" in
|
||||||
|
/usr/include|/include) ;;
|
||||||
|
'${prefix}/include')
|
||||||
|
if test "$prefix" != / -a "$prefix" != /usr; then
|
||||||
|
if test -z "$GPGME_CONFIG_CFLAGS"; then
|
||||||
|
GPGME_CONFIG_CFLAGS="-I\${includedir}"
|
||||||
|
else
|
||||||
|
GPGME_CONFIG_CFLAGS="-I\${includedir} $GPGME_CONFIG_CFLAGS"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if test -z "$GPGME_CONFIG_CFLAGS"; then
|
||||||
|
GPGME_CONFIG_CFLAGS="-I\${includedir}"
|
||||||
|
else
|
||||||
|
GPGME_CONFIG_CFLAGS="-I\${includedir} $GPGME_CONFIG_CFLAGS"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
case "$libdir" in
|
||||||
|
/usr/lib|/usr/lib64|/lib|/lib64) ;;
|
||||||
|
'${exec_prefix}/lib'|'${exec_prefix}/lib64')
|
||||||
|
if test "$exec_prefix" = "NONE"; then
|
||||||
|
if test "$prefix" != / -a "$prefix" != /usr; then
|
||||||
|
GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS"
|
||||||
|
fi
|
||||||
|
elif test "$exec_prefix" != / -a "$exec_prefix" != /usr; then
|
||||||
|
GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*) GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
AC_SUBST(GPGME_CONFIG_API_VERSION)
|
AC_SUBST(GPGME_CONFIG_API_VERSION)
|
||||||
AC_SUBST(GPGME_CONFIG_LIBS)
|
AC_SUBST(GPGME_CONFIG_LIBS)
|
||||||
AC_SUBST(GPGME_CONFIG_CFLAGS)
|
AC_SUBST(GPGME_CONFIG_CFLAGS)
|
||||||
@ -933,9 +1136,16 @@ AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig.cmake.in)
|
|||||||
AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfigVersion.cmake)
|
AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfigVersion.cmake)
|
||||||
AC_CONFIG_FILES(lang/cpp/src/gpgmepp_version.h)
|
AC_CONFIG_FILES(lang/cpp/src/gpgmepp_version.h)
|
||||||
AC_CONFIG_FILES(lang/qt/Makefile lang/qt/src/Makefile)
|
AC_CONFIG_FILES(lang/qt/Makefile lang/qt/src/Makefile)
|
||||||
AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig-w32.cmake.in)
|
if test "$want_qt5" = "yes"; then
|
||||||
AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig.cmake.in)
|
AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig-w32.cmake.in)
|
||||||
AC_CONFIG_FILES(lang/qt/src/QGpgmeConfigVersion.cmake)
|
AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig.cmake.in)
|
||||||
|
AC_CONFIG_FILES(lang/qt/src/QGpgmeConfigVersion.cmake)
|
||||||
|
fi
|
||||||
|
if test "$want_qt6" = "yes"; then
|
||||||
|
AC_CONFIG_FILES(lang/qt/src/QGpgmeQt6Config-w32.cmake.in)
|
||||||
|
AC_CONFIG_FILES(lang/qt/src/QGpgmeQt6Config.cmake.in)
|
||||||
|
AC_CONFIG_FILES(lang/qt/src/QGpgmeQt6ConfigVersion.cmake)
|
||||||
|
fi
|
||||||
AC_CONFIG_FILES(lang/qt/tests/Makefile)
|
AC_CONFIG_FILES(lang/qt/tests/Makefile)
|
||||||
AC_CONFIG_FILES(lang/qt/src/qgpgme_version.h)
|
AC_CONFIG_FILES(lang/qt/src/qgpgme_version.h)
|
||||||
AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
|
AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
|
||||||
@ -953,6 +1163,14 @@ AC_CONFIG_FILES([lang/python/Makefile
|
|||||||
AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
|
AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
if test "$want_qt5" = "yes" -a "$want_qt6" = "yes"; then
|
||||||
|
enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 5, Qt 6)/")
|
||||||
|
elif test "$want_qt5" = "yes"; then
|
||||||
|
enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 5)/")
|
||||||
|
elif test "$want_qt6" = "yes"; then
|
||||||
|
enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 6)/")
|
||||||
|
fi
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
GPGME v${VERSION} has been configured as follows:
|
GPGME v${VERSION} has been configured as follows:
|
||||||
|
|
||||||
|
482
doc/gpgme.texi
482
doc/gpgme.texi
@ -421,18 +421,28 @@ directory in which the header file is located to the compilers include
|
|||||||
file search path (via the @option{-I} option).
|
file search path (via the @option{-I} option).
|
||||||
|
|
||||||
However, the path to the include file is determined at the time the
|
However, the path to the include file is determined at the time the
|
||||||
source is configured. To solve this problem, gpgme ships with a small
|
source is configured. To solve this problem, gpgme ships with
|
||||||
helper program @command{gpgme-config} that knows about the path to the
|
@code{gpgme.pc} file, that knows about the path to the include file
|
||||||
include file and other configuration options. The options that need
|
and other configuration options. The command, @command{pkg-config},
|
||||||
to be added to the compiler invocation at compile time are output by
|
can be used to handle information with @code{gpgme.pc} file. In an
|
||||||
the @option{--cflags} option to @command{gpgme-config}. The following
|
environment which doesn't have @command{pkg-config} (like the one in
|
||||||
example shows how it can be used at the command line:
|
early stage of OS bootstrap), for Automake, you can use
|
||||||
|
@code{gpgme.m4} which invokes @command{gpgrt-config} with
|
||||||
|
@code{gpgme.pc}. (In the past, gpgme used to ship with a small helper
|
||||||
|
program @command{gpgme-config}. This functionality of
|
||||||
|
@command{gpgme-config} is replaced by @command{pkg-config} with
|
||||||
|
@code{gpgme.pc} file.)
|
||||||
|
|
||||||
|
The options that need to be added to the compiler invocation at
|
||||||
|
compile time are output by the @option{--cflags} option to
|
||||||
|
@command{pkg-config gpgme}. The following example shows how it can be
|
||||||
|
used at the command line:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
gcc -c foo.c `gpgme-config --cflags`
|
gcc -c foo.c `pkg-config --cflags gpgme`
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Adding the output of @samp{gpgme-config --cflags} to the compiler
|
Adding the output of @samp{pkg-config --cflags gpgme} to the compiler
|
||||||
command line will ensure that the compiler can find the
|
command line will ensure that the compiler can find the
|
||||||
@acronym{GPGME} header file.
|
@acronym{GPGME} header file.
|
||||||
|
|
||||||
@ -440,36 +450,39 @@ A similar problem occurs when linking the program with the library.
|
|||||||
Again, the compiler has to find the library files. For this to work,
|
Again, the compiler has to find the library files. For this to work,
|
||||||
the path to the library files has to be added to the library search
|
the path to the library files has to be added to the library search
|
||||||
path (via the @option{-L} option). For this, the option
|
path (via the @option{-L} option). For this, the option
|
||||||
@option{--libs} to @command{gpgme-config} can be used. For
|
@option{--libs} to @command{pkg-config gpgme} can be used. For
|
||||||
convenience, this option also outputs all other options that are
|
convenience, this option also outputs all other options that are
|
||||||
required to link the program with @acronym{GPGME} (in particular, the
|
required to link the program with @acronym{GPGME} (in particular, the
|
||||||
@samp{-lgpgme} option). The example shows how to link @file{foo.o}
|
@samp{-lgpgme} option). The example shows how to link @file{foo.o}
|
||||||
with the @acronym{GPGME} library to a program @command{foo}.
|
with the @acronym{GPGME} library to a program @command{foo}.
|
||||||
|
|
||||||
@example
|
@example
|
||||||
gcc -o foo foo.o `gpgme-config --libs`
|
gcc -o foo foo.o `pkg-config --libs gpgme`
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Of course you can also combine both examples to a single command by
|
Of course you can also combine both examples to a single command by
|
||||||
specifying both options to @command{gpgme-config}:
|
specifying both options to @command{pkg-config gpgme}:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
gcc -o foo foo.c `gpgme-config --cflags --libs`
|
gcc -o foo foo.c `pkg-config --cflags --libs gpgme`
|
||||||
@end example
|
|
||||||
|
|
||||||
If you need to detect the installed language bindings you can use list
|
|
||||||
them using:
|
|
||||||
|
|
||||||
@example
|
|
||||||
gpgme-config --print-lang
|
|
||||||
@end example
|
|
||||||
|
|
||||||
or test for the availability using
|
|
||||||
|
|
||||||
@example
|
|
||||||
gpgme-config --have-lang=python && echo 'Bindings for Pythons available'
|
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
@c
|
||||||
|
@c Feature not available by pkg-config/gpgrt-config
|
||||||
|
@c
|
||||||
|
@c If you need to detect the installed language bindings you can use list
|
||||||
|
@c them using:
|
||||||
|
@c
|
||||||
|
@c @example
|
||||||
|
@c gpgme-config --print-lang
|
||||||
|
@c @end example
|
||||||
|
@c
|
||||||
|
@c or test for the availability using
|
||||||
|
@c
|
||||||
|
@c @example
|
||||||
|
@c gpgme-config --have-lang=python && echo 'Bindings for Pythons available'
|
||||||
|
@c @end example
|
||||||
|
@c
|
||||||
|
|
||||||
@node Largefile Support (LFS)
|
@node Largefile Support (LFS)
|
||||||
@section Largefile Support (LFS)
|
@section Largefile Support (LFS)
|
||||||
@ -538,7 +551,7 @@ convention for 32 bit Windows by using @code{long} there.
|
|||||||
and thus we are able to use @code{int64_t} instead of @code{off_t}
|
and thus we are able to use @code{int64_t} instead of @code{off_t}
|
||||||
there. For easier migration the typedef @code{gpgme_off_t} has been
|
there. For easier migration the typedef @code{gpgme_off_t} has been
|
||||||
defined. The reason we cannot use @code{off_t} directly is that some
|
defined. The reason we cannot use @code{off_t} directly is that some
|
||||||
toolchains (e.g. mingw64) introduce a POSIX compatible hack for
|
toolchains (e.g., mingw64) introduce a POSIX compatible hack for
|
||||||
@code{off_t}. Some widely used toolkits make use of this hack and in
|
@code{off_t}. Some widely used toolkits make use of this hack and in
|
||||||
turn @acronym{GPGME} would need to use it also. However, this would
|
turn @acronym{GPGME} would need to use it also. However, this would
|
||||||
introduce an ABI break and existing software making use of libgpgme
|
introduce an ABI break and existing software making use of libgpgme
|
||||||
@ -576,45 +589,52 @@ mode (@code{_LARGEFILE64_SOURCE}).
|
|||||||
@cindex automake
|
@cindex automake
|
||||||
@cindex autoconf
|
@cindex autoconf
|
||||||
|
|
||||||
It is much easier if you use GNU Automake instead of writing your own
|
You can simply use @code{PKG_CHECK_MODULES} macro with @command{pkg-config}:
|
||||||
Makefiles. If you do that you do not have to worry about finding and
|
@example
|
||||||
invoking the @command{gpgme-config} script at all. @acronym{GPGME}
|
PKG_CHECK_MODULES([GPGME], [gpgme >= 1.23.1])
|
||||||
provides an extension to Automake that does all the work for you.
|
@end example
|
||||||
|
|
||||||
|
Alternatively, instead of using @command{pkg-config}, for building on
|
||||||
|
an environment with no pkg-config, @acronym{GPGME} provides an
|
||||||
|
extension to Automake that does all the work for you. Please note
|
||||||
|
that it is required to have gpgrt-config from libgpg-error installed
|
||||||
|
in this case.
|
||||||
|
|
||||||
@c A simple macro for optional variables.
|
@c A simple macro for optional variables.
|
||||||
@macro ovar{varname}
|
@macro ovar{varname}
|
||||||
@r{[}@var{\varname\}@r{]}
|
@r{[}@var{\varname\}@r{]}
|
||||||
@end macro
|
@end macro
|
||||||
@defmac AM_PATH_GPGME (@ovar{minimum-version}, @ovar{action-if-found}, @ovar{action-if-not-found})
|
@defmac AM_PATH_GPGME (@ovar{minimum-version}, @ovar{action-if-found}, @ovar{action-if-not-found})
|
||||||
@defmacx AM_PATH_GPGME_PTH (@ovar{minimum-version}, @ovar{action-if-found}, @ovar{action-if-not-found})
|
|
||||||
@defmacx AM_PATH_GPGME_PTHREAD (@ovar{minimum-version}, @ovar{action-if-found}, @ovar{action-if-not-found})
|
|
||||||
Check whether @acronym{GPGME} (at least version @var{minimum-version},
|
Check whether @acronym{GPGME} (at least version @var{minimum-version},
|
||||||
if given) exists on the host system. If it is found, execute
|
if given) exists on the host system. If it is found, execute
|
||||||
@var{action-if-found}, otherwise do @var{action-if-not-found}, if
|
@var{action-if-found}, otherwise do @var{action-if-not-found}, if
|
||||||
given.
|
given.
|
||||||
|
|
||||||
|
This macro locates for @code{gpgme.pc}, with cross-compile support.
|
||||||
|
|
||||||
Additionally, the function defines @code{GPGME_CFLAGS} to the flags
|
Additionally, the function defines @code{GPGME_CFLAGS} to the flags
|
||||||
needed for compilation of the program to find the @file{gpgme.h}
|
needed for compilation of the program to find the @file{gpgme.h}
|
||||||
header file, and @code{GPGME_LIBS} to the linker flags needed to link
|
header file, and @code{GPGME_LIBS} to the linker flags needed to link
|
||||||
the program to the @acronym{GPGME} library. If the used helper script
|
the program to the @acronym{GPGME} library.
|
||||||
does not match the target type you are building for a warning is
|
@c
|
||||||
printed and the string @code{libgcrypt} is appended to the variable
|
@c If the used helper script does not match the target type you are
|
||||||
@code{gpg_config_script_warn}.
|
@c building for a warning is printed and the string @code{gpgme} is
|
||||||
|
@c appended to the variable @code{gpg_config_script_warn}.
|
||||||
|
@c@c@c@c@c@c@c@c
|
||||||
|
@c ^-- About this statement.
|
||||||
|
@c In the past, this might happens, when it was configured by
|
||||||
|
@c --with-*-prefix options, and it located the helper script for
|
||||||
|
@c other target. Cross-build by gpgrt-config has been improved
|
||||||
|
@c (in different way), so it's not relevant now.
|
||||||
|
@c
|
||||||
|
|
||||||
@code{AM_PATH_GPGME_PTHREAD} checks for the version of @acronym{GPGME}
|
|
||||||
that can be used with the native pthread implementation, and defines
|
|
||||||
@code{GPGME_PTHREAD_CFLAGS} and @code{GPGME_PTHREAD_LIBS}. Since
|
|
||||||
version 1.8.0 this is no longer required to GPGME_PTHREAD as
|
|
||||||
@acronym{GPGME} itself is thread safe.
|
|
||||||
|
|
||||||
This macro searches for @command{gpgme-config} along the PATH. If
|
@code{AM_PATH_GPGME_PTHREAD} was provided to check for the version of
|
||||||
you are cross-compiling, it is useful to set the environment variable
|
@acronym{GPGME} with the native pthread implementation, and it defined
|
||||||
@code{SYSROOT} to the top directory of your target. The macro will
|
@code{GPGME_PTHREAD_CFLAGS} and @code{GPGME_PTHREAD_LIBS}. Since
|
||||||
then first look for the helper program in the @file{bin} directory
|
version 1.8.0 this is no longer necessary, as @acronym{GPGME} itself
|
||||||
below that top directory. An absolute directory name must be used for
|
is thread safe. Please use plain @code{AM_PATH_GPGME} instead, with
|
||||||
@code{SYSROOT}. Finally, if the configure command line option
|
@code{GPGME_CFLAGS} and @code{GPGME_LDFLAGS}.
|
||||||
@code{--with-gpgme-prefix} is used, only its value is used for the top
|
|
||||||
directory below which the helper script is expected.
|
|
||||||
|
|
||||||
@end defmac
|
@end defmac
|
||||||
|
|
||||||
@ -632,9 +652,8 @@ LDADD = $(GPGME_LIBS)
|
|||||||
@cindex libtool
|
@cindex libtool
|
||||||
|
|
||||||
The easiest way is to just use GNU Libtool. If you use libtool, and
|
The easiest way is to just use GNU Libtool. If you use libtool, and
|
||||||
link to @code{libgpgme.la}, @code{libgpgme-pth.la} or
|
link to @code{libgpgme.la}, everything will be done automatically by
|
||||||
@code{libgpgme-pthread.la} respectively, everything will be done
|
Libtool.
|
||||||
automatically by Libtool.
|
|
||||||
|
|
||||||
|
|
||||||
@node Library Version Check
|
@node Library Version Check
|
||||||
@ -727,6 +746,13 @@ is not met, GPGME fails early instead of trying to use the existent
|
|||||||
version. The given version must be a string with major, minor, and
|
version. The given version must be a string with major, minor, and
|
||||||
micro number. Example: "2.1.0".
|
micro number. Example: "2.1.0".
|
||||||
|
|
||||||
|
@item inst-type
|
||||||
|
The installation type is used to prefer a certain GnuPG installation.
|
||||||
|
The value is interpreted as an integer: A value of 0 is ignored, a
|
||||||
|
value of 1 indicates an installation scheme as used by Gpg4win, a
|
||||||
|
value of 2 indicates an installation scheme as used by GnuPG Desktop
|
||||||
|
on Windows. All other values are reserved.
|
||||||
|
|
||||||
@item w32-inst-dir
|
@item w32-inst-dir
|
||||||
On Windows GPGME needs to know its installation directory to find its
|
On Windows GPGME needs to know its installation directory to find its
|
||||||
spawn helper. This is in general no problem because a DLL has this
|
spawn helper. This is in general no problem because a DLL has this
|
||||||
@ -961,6 +987,9 @@ Return the name of the directory with GnuPG shared data.
|
|||||||
@item localedir
|
@item localedir
|
||||||
Return the name of the directory with GnuPG locale data.
|
Return the name of the directory with GnuPG locale data.
|
||||||
|
|
||||||
|
@item socketdir
|
||||||
|
Return the name of the directory with the following sockets.
|
||||||
|
|
||||||
@item agent-socket
|
@item agent-socket
|
||||||
Return the name of the socket to connect to the gpg-agent.
|
Return the name of the socket to connect to the gpg-agent.
|
||||||
|
|
||||||
@ -1004,6 +1033,9 @@ Return the name of the pinentry program.
|
|||||||
@item gpg-wks-client-name
|
@item gpg-wks-client-name
|
||||||
Return the name of the Web Key Service tool.
|
Return the name of the Web Key Service tool.
|
||||||
|
|
||||||
|
@item gpgtar-name
|
||||||
|
Return the name of the gpgtar program.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@end deftypefun
|
@end deftypefun
|
||||||
@ -1278,8 +1310,8 @@ returned.
|
|||||||
|
|
||||||
The function @code{gpgme_pubkey_algo_string} is a convenience function
|
The function @code{gpgme_pubkey_algo_string} is a convenience function
|
||||||
to build and return an algorithm string in the same way GnuPG does
|
to build and return an algorithm string in the same way GnuPG does
|
||||||
(e.g. ``rsa2048'' or ``ed25519''). The caller must free the result
|
(e.g., ``rsa2048'' or ``ed25519''). The caller must free the result
|
||||||
using @code{gpgme_free}. On error (e.g. invalid argument or memory
|
using @code{gpgme_free}. On error (e.g., invalid argument or memory
|
||||||
exhausted), the function returns NULL and sets @code{ERRNO}.
|
exhausted), the function returns NULL and sets @code{ERRNO}.
|
||||||
@end deftypefun
|
@end deftypefun
|
||||||
|
|
||||||
@ -1623,6 +1655,11 @@ when requested.
|
|||||||
@item GPG_ERR_CANCELED
|
@item GPG_ERR_CANCELED
|
||||||
This value means that the operation was canceled.
|
This value means that the operation was canceled.
|
||||||
|
|
||||||
|
@item GPG_ERR_FULLY_CANCELED
|
||||||
|
This value means that the operation was canceled. It is sometimes returned
|
||||||
|
instead of @code{GPG_ERR_CANCELED} for internal reasons in GnuPG. You should
|
||||||
|
treat both values identically.
|
||||||
|
|
||||||
@item GPG_ERR_INV_ENGINE
|
@item GPG_ERR_INV_ENGINE
|
||||||
This value means that the engine that implements the desired protocol
|
This value means that the engine that implements the desired protocol
|
||||||
is currently not available. This can either be because the sources
|
is currently not available. This can either be because the sources
|
||||||
@ -1764,7 +1801,7 @@ is used.
|
|||||||
|
|
||||||
On POSIX platforms the @code{gpgme_off_t} type is an alias for
|
On POSIX platforms the @code{gpgme_off_t} type is an alias for
|
||||||
@code{off_t}; it may be used interchangeable. On Windows platforms
|
@code{off_t}; it may be used interchangeable. On Windows platforms
|
||||||
@code{gpgme_off_t} is defined as a long (i.e. 32 bit) for 32 bit
|
@code{gpgme_off_t} is defined as a long (i.e., 32 bit) for 32 bit
|
||||||
Windows and as a 64 bit signed integer for 64 bit Windows.
|
Windows and as a 64 bit signed integer for 64 bit Windows.
|
||||||
@end deftp
|
@end deftp
|
||||||
|
|
||||||
@ -2173,6 +2210,11 @@ associated with the data object. The file name will be stored in the
|
|||||||
output when encrypting or signing the data and will be returned to the
|
output when encrypting or signing the data and will be returned to the
|
||||||
user when decrypting or verifying the output data.
|
user when decrypting or verifying the output data.
|
||||||
|
|
||||||
|
If a signed or encrypted archive is created, then the file name will be
|
||||||
|
interpreted as the base directory for the relative paths of the files and
|
||||||
|
directories to put into the archive. This corresponds to the --directory
|
||||||
|
option of gpgtar.
|
||||||
|
|
||||||
The function returns the error code @code{GPG_ERR_INV_VALUE} if
|
The function returns the error code @code{GPG_ERR_INV_VALUE} if
|
||||||
@var{dh} is not a valid pointer and @code{GPG_ERR_ENOMEM} if not
|
@var{dh} is not a valid pointer and @code{GPG_ERR_ENOMEM} if not
|
||||||
enough memory is available.
|
enough memory is available.
|
||||||
@ -2195,7 +2237,7 @@ for a new data object. The backend will try its best to detect the
|
|||||||
encoding automatically.
|
encoding automatically.
|
||||||
|
|
||||||
@item GPGME_DATA_ENCODING_BINARY
|
@item GPGME_DATA_ENCODING_BINARY
|
||||||
This specifies that the data is encoding in binary form; i.e. there is
|
This specifies that the data is encoding in binary form; i.e., there is
|
||||||
no special encoding.
|
no special encoding.
|
||||||
|
|
||||||
@item GPGME_DATA_ENCODING_BASE64
|
@item GPGME_DATA_ENCODING_BASE64
|
||||||
@ -2235,7 +2277,7 @@ characters percent escaped. This mode is is not yet implemented.
|
|||||||
@deftypefun gpgme_data_encoding_t gpgme_data_get_encoding (@w{gpgme_data_t @var{dh}})
|
@deftypefun gpgme_data_encoding_t gpgme_data_get_encoding (@w{gpgme_data_t @var{dh}})
|
||||||
The function @code{gpgme_data_get_encoding} returns the encoding of
|
The function @code{gpgme_data_get_encoding} returns the encoding of
|
||||||
the data object with the handle @var{dh}. If @var{dh} is not a valid
|
the data object with the handle @var{dh}. If @var{dh} is not a valid
|
||||||
pointer (e.g. @code{NULL}) @code{GPGME_DATA_ENCODING_NONE} is
|
pointer (e.g., @code{NULL}) @code{GPGME_DATA_ENCODING_NONE} is
|
||||||
returned.
|
returned.
|
||||||
@end deftypefun
|
@end deftypefun
|
||||||
|
|
||||||
@ -2336,7 +2378,7 @@ The data is a PKCS#12 message. This is commonly used to exchange
|
|||||||
private keys for X.509.
|
private keys for X.509.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@deftypefun gpgme_data_type_t gpgme_data_identify (@w{gpgme_data_t @var{dh}})
|
@deftypefun gpgme_data_type_t gpgme_data_identify (@w{gpgme_data_t @var{dh}, int @var{reserved}})
|
||||||
@since{1.4.3}
|
@since{1.4.3}
|
||||||
|
|
||||||
The function @code{gpgme_data_identify} returns the type of the data
|
The function @code{gpgme_data_identify} returns the type of the data
|
||||||
@ -2346,6 +2388,7 @@ identification, the function returns zero
|
|||||||
object has been created the identification may not be possible or the
|
object has been created the identification may not be possible or the
|
||||||
data object may change its internal state (file pointer moved). For
|
data object may change its internal state (file pointer moved). For
|
||||||
file or memory based data object, the state should not change.
|
file or memory based data object, the state should not change.
|
||||||
|
@var{reserved} should be zero.
|
||||||
@end deftypefun
|
@end deftypefun
|
||||||
|
|
||||||
|
|
||||||
@ -2564,7 +2607,7 @@ addresses is not supported.
|
|||||||
|
|
||||||
The function @code{gpgme_set_sender} specifies the sender address for
|
The function @code{gpgme_set_sender} specifies the sender address for
|
||||||
use in sign and verify operations. @var{address} is expected to be
|
use in sign and verify operations. @var{address} is expected to be
|
||||||
the ``addr-spec'' part of an address but my also be a complete mailbox
|
the ``addr-spec'' part of an address but may also be a complete mailbox
|
||||||
address, in which case this function extracts the ``addr-spec'' from
|
address, in which case this function extracts the ``addr-spec'' from
|
||||||
it. Using @code{NULL} for @var{address} clears the sender address.
|
it. Using @code{NULL} for @var{address} clears the sender address.
|
||||||
|
|
||||||
@ -2657,8 +2700,9 @@ for example completely disable the use of Dirmngr for any engine.
|
|||||||
|
|
||||||
For the CMS protocol the offline mode specifies whether Dirmngr shall
|
For the CMS protocol the offline mode specifies whether Dirmngr shall
|
||||||
be used to do additional validation that might require connecting
|
be used to do additional validation that might require connecting
|
||||||
external services (e.g. CRL / OCSP checks). Here the offline mode
|
external services (e.g., CRL / OCSP checks). The offline mode is used
|
||||||
only affects the keylist mode @code{GPGME_KEYLIST_MODE_VALIDATE}.
|
for all operations on this context. It has only an effect with
|
||||||
|
GnuPG versions 2.1.6 or later.
|
||||||
|
|
||||||
For the OpenPGP protocol offline mode entirely disables the use of the
|
For the OpenPGP protocol offline mode entirely disables the use of the
|
||||||
Dirmngr and will thus guarantee that no network connections are done
|
Dirmngr and will thus guarantee that no network connections are done
|
||||||
@ -2863,6 +2907,12 @@ option also makes sure that the keygrip is available in the output.
|
|||||||
The @code{GPGME_KEYLIST_MODE_EPHEMERAL} symbol specifies that keys
|
The @code{GPGME_KEYLIST_MODE_EPHEMERAL} symbol specifies that keys
|
||||||
flagged as ephemeral are included in the listing.
|
flagged as ephemeral are included in the listing.
|
||||||
|
|
||||||
|
@item GPGME_KEYLIST_MODE_WITH_V5FPR
|
||||||
|
@since{1.23.0}
|
||||||
|
|
||||||
|
The @code{GPGME_KEYLIST_MODE_WITH_V5FPR} symbol specifies that key
|
||||||
|
listings shall also provide v5 style fingerprints for v4 OpenPGp keys.
|
||||||
|
|
||||||
@item GPGME_KEYLIST_MODE_VALIDATE
|
@item GPGME_KEYLIST_MODE_VALIDATE
|
||||||
@since{0.4.5}
|
@since{0.4.5}
|
||||||
|
|
||||||
@ -3141,8 +3191,8 @@ The string given in @var{value} is passed to the GnuPG engine to override
|
|||||||
the session key for decryption. The format of that session key is
|
the session key for decryption. The format of that session key is
|
||||||
specific to GnuPG and can be retrieved during a decrypt operation when
|
specific to GnuPG and can be retrieved during a decrypt operation when
|
||||||
the context flag "export-session-key" is enabled. Please be aware that
|
the context flag "export-session-key" is enabled. Please be aware that
|
||||||
using this feature with GnuPG < 2.1.16 will leak the session key on
|
using this feature with GnuPG < 2.1.16 or when decrypting an archive
|
||||||
many platforms via ps(1).
|
will leak the session key on many platforms via ps(1).
|
||||||
|
|
||||||
@item "auto-key-retrieve"
|
@item "auto-key-retrieve"
|
||||||
Setting the @var{value} to "1" asks the backend to automatically
|
Setting the @var{value} to "1" asks the backend to automatically
|
||||||
@ -3229,6 +3279,17 @@ The string given in @var{value} is passed to the GnuPG engine to use as
|
|||||||
filter when importing keys. Valid values are documented in the GnuPG
|
filter when importing keys. Valid values are documented in the GnuPG
|
||||||
manual and the gpg man page under the option @option{--import-filter}.
|
manual and the gpg man page under the option @option{--import-filter}.
|
||||||
|
|
||||||
|
@item "import-options"
|
||||||
|
@since{1.24.0}
|
||||||
|
The string given in @var{value} is passed to the GnuPG engine to use as
|
||||||
|
options when importing keys. Valid values are documented in the GnuPG
|
||||||
|
manual and the gpg man page under the option @option{--import-options}.
|
||||||
|
|
||||||
|
@item "no-auto-check-trustdb"
|
||||||
|
@since{1.19.0}
|
||||||
|
Setting the @var{value} to "1" forces the GPG backend to disable the
|
||||||
|
automatic check of the trust database.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
This function returns @code{0} on success.
|
This function returns @code{0} on success.
|
||||||
@ -3412,22 +3473,47 @@ listings if the key could not be validated due to missing
|
|||||||
certificates or unmatched policies.
|
certificates or unmatched policies.
|
||||||
|
|
||||||
@item unsigned int can_encrypt : 1
|
@item unsigned int can_encrypt : 1
|
||||||
This is true if the key (ie one of its subkeys) can be used for
|
This is true if the key or one of its subkeys can be used for
|
||||||
encryption.
|
encryption and the encryption will likely succeed.
|
||||||
|
|
||||||
@item unsigned int can_sign : 1
|
@item unsigned int can_sign : 1
|
||||||
This is true if the key (ie one of its subkeys) can be used to create
|
This is true if the key or one of its subkeys can be used to create
|
||||||
data signatures.
|
data signatures and the signing will likely succeed.
|
||||||
|
|
||||||
@item unsigned int can_certify : 1
|
@item unsigned int can_certify : 1
|
||||||
This is true if the key (ie one of its subkeys) can be used to create
|
This is true if the key or one of its subkeys can be used to create
|
||||||
key certificates.
|
key certificates.
|
||||||
|
|
||||||
@item unsigned int can_authenticate : 1
|
@item unsigned int can_authenticate : 1
|
||||||
@since{0.4.5}
|
@since{0.4.5}
|
||||||
|
|
||||||
This is true if the key (ie one of its subkeys) can be used for
|
This is true if the key (ie one of its subkeys) can be used for
|
||||||
authentication.
|
authentication and the authentication will likely succeed.
|
||||||
|
|
||||||
|
@item unsigned int has_encrypt : 1
|
||||||
|
@since{1.23.0}
|
||||||
|
|
||||||
|
This is true if the key or one of its subkeys is capable of encryption.
|
||||||
|
Note that this flag is set even if the key is expired.
|
||||||
|
|
||||||
|
@item unsigned int has_sign : 1
|
||||||
|
@since{1.23.0}
|
||||||
|
|
||||||
|
This is true if the key or one of its subkeys is capable of signing.
|
||||||
|
Note that this flag is set even if the key is expired.
|
||||||
|
|
||||||
|
@item unsigned int has_certify : 1
|
||||||
|
@since{1.23.0}
|
||||||
|
|
||||||
|
This is true if the key or one of its subkeys is capable of
|
||||||
|
certification. Note that this flag is set even if the key is expired.
|
||||||
|
|
||||||
|
@item unsigned int has_authenticate : 1
|
||||||
|
@since{1.23.0}
|
||||||
|
|
||||||
|
This is true if the key or one of its subkeys is capable of
|
||||||
|
authentication. Note that this flag is set even if the key is
|
||||||
|
expired.
|
||||||
|
|
||||||
@item unsigned int is_qualified : 1
|
@item unsigned int is_qualified : 1
|
||||||
@since{1.1.0}
|
@since{1.1.0}
|
||||||
@ -3486,6 +3572,10 @@ be missing but this field may be set nevertheless.
|
|||||||
|
|
||||||
Reserved for the time of the last update of this key.
|
Reserved for the time of the last update of this key.
|
||||||
|
|
||||||
|
@item gpgme_revocation_key_t revkeys
|
||||||
|
@since{1.24.0}
|
||||||
|
This is a linked list with the revocation keys for the key.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
@end deftp
|
@end deftp
|
||||||
|
|
||||||
@ -3549,7 +3639,7 @@ Brainpool curve.
|
|||||||
|
|
||||||
@item unsigned int secret : 1
|
@item unsigned int secret : 1
|
||||||
This is true if the subkey is a secret key. Note that it will be
|
This is true if the subkey is a secret key. Note that it will be
|
||||||
false if the key is actually a stub key; i.e. a secret key operation
|
false if the key is actually a stub key; i.e., a secret key operation
|
||||||
is currently not possible (offline-key). This is only set if a
|
is currently not possible (offline-key). This is only set if a
|
||||||
listing of secret keys has been requested or if
|
listing of secret keys has been requested or if
|
||||||
@code{GPGME_KEYLIST_MODE_WITH_SECRET} is active.
|
@code{GPGME_KEYLIST_MODE_WITH_SECRET} is active.
|
||||||
@ -3567,6 +3657,10 @@ This is the key ID of the subkey in hexadecimal digits.
|
|||||||
This is the fingerprint of the subkey in hexadecimal digits, if
|
This is the fingerprint of the subkey in hexadecimal digits, if
|
||||||
available.
|
available.
|
||||||
|
|
||||||
|
@item char *v5fpr
|
||||||
|
For a v4 OpenPGP key this is its v5 style fingerprint of the subkey in
|
||||||
|
hexadecimal digits, if available.
|
||||||
|
|
||||||
@item char *keygrip
|
@item char *keygrip
|
||||||
@since{1.7.0}
|
@since{1.7.0}
|
||||||
|
|
||||||
@ -3824,6 +3918,37 @@ This is a linked list with the notation data and policy URLs.
|
|||||||
@end deftp
|
@end deftp
|
||||||
|
|
||||||
|
|
||||||
|
@deftp {Data type} gpgme_revocation_key_t
|
||||||
|
@since{1.24.0}
|
||||||
|
|
||||||
|
The @code{gpgme_revocation_key_t} type is a pointer to a revocation key
|
||||||
|
structure. Revocation key structures are one component of a
|
||||||
|
@code{gpgme_key_t} object. They provide information about the designated
|
||||||
|
revocation keys for a key.
|
||||||
|
|
||||||
|
The revocation key structure has the following members:
|
||||||
|
|
||||||
|
@table @code
|
||||||
|
@item gpgme_revocation_key_t next
|
||||||
|
This is a pointer to the next revocation key structure in the linked list,
|
||||||
|
or @code{NULL} if this is the last element.
|
||||||
|
|
||||||
|
@item gpgme_pubkey_algo_t pubkey_algo
|
||||||
|
This is the public key algorithm of the revocation key.
|
||||||
|
|
||||||
|
@item char *fpr
|
||||||
|
This is the fingerprint of the revocation_key in hexadecimal digits.
|
||||||
|
|
||||||
|
@item unsigned int key_class
|
||||||
|
This is the class of the revocation key signature subpacket.
|
||||||
|
|
||||||
|
@item unsigned int sensitive : 1
|
||||||
|
This is true if the revocation key is marked as sensitive.
|
||||||
|
|
||||||
|
@end table
|
||||||
|
@end deftp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@node Listing Keys
|
@node Listing Keys
|
||||||
@subsection Listing Keys
|
@subsection Listing Keys
|
||||||
@ -4188,7 +4313,7 @@ GnuPG.
|
|||||||
@var{userid} is commonly the mail address associated with the key.
|
@var{userid} is commonly the mail address associated with the key.
|
||||||
GPGME does not require a specific syntax but if more than a mail
|
GPGME does not require a specific syntax but if more than a mail
|
||||||
address is given, RFC-822 style format is suggested. The value is
|
address is given, RFC-822 style format is suggested. The value is
|
||||||
expected to be in UTF-8 encoding (i.e. no IDN encoding for mail
|
expected to be in UTF-8 encoding (i.e., no IDN encoding for mail
|
||||||
addresses). This is a required parameter.
|
addresses). This is a required parameter.
|
||||||
|
|
||||||
@var{algo} specifies the algorithm for the new key (actually a keypair
|
@var{algo} specifies the algorithm for the new key (actually a keypair
|
||||||
@ -4271,6 +4396,14 @@ override this check.
|
|||||||
|
|
||||||
Request generation of keys that do not expire.
|
Request generation of keys that do not expire.
|
||||||
|
|
||||||
|
@item GPGME_CREATE_ADSK
|
||||||
|
@since{1.24.0}
|
||||||
|
|
||||||
|
Add an ADSK to the key. With this flag @var{algo} is expected to be
|
||||||
|
the hexified fingerprint of the ADSK to be added; this must be a
|
||||||
|
subkey. If the string "default" is used for @var{algo} the engine
|
||||||
|
will add all ADSK as it would do for new keys.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
After the operation completed successfully, information about the
|
After the operation completed successfully, information about the
|
||||||
@ -4346,6 +4479,10 @@ values for timestamps and thus can only encode dates up to the year
|
|||||||
@var{flags} takes the same values as described above for
|
@var{flags} takes the same values as described above for
|
||||||
@code{gpgme_op_createkey}.
|
@code{gpgme_op_createkey}.
|
||||||
|
|
||||||
|
If the @code{GPGME_CREATE_ADSK} flag is set, the subkey fingerprint
|
||||||
|
given in the @code{algo} parameter is added as an ADSK
|
||||||
|
to the key.
|
||||||
|
|
||||||
After the operation completed successfully, information about the
|
After the operation completed successfully, information about the
|
||||||
created key can be retrieved with @code{gpgme_op_genkey_result}.
|
created key can be retrieved with @code{gpgme_op_genkey_result}.
|
||||||
|
|
||||||
@ -4397,7 +4534,7 @@ requires at least version 2.1.13 of GnuPG.
|
|||||||
the mail address to be associated with the key. GPGME does not
|
the mail address to be associated with the key. GPGME does not
|
||||||
require a specific syntax but if more than a mail address is given,
|
require a specific syntax but if more than a mail address is given,
|
||||||
RFC-822 style format is suggested. The value is expected to be in
|
RFC-822 style format is suggested. The value is expected to be in
|
||||||
UTF-8 encoding (i.e. no IDN encoding for mail addresses). This is a
|
UTF-8 encoding (i.e., no IDN encoding for mail addresses). This is a
|
||||||
required parameter.
|
required parameter.
|
||||||
|
|
||||||
@var{flags} are currently not used and must be set to zero.
|
@var{flags} are currently not used and must be set to zero.
|
||||||
@ -4606,7 +4743,7 @@ retrieved with @code{gpgme_op_genkey_result}.
|
|||||||
|
|
||||||
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
|
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
|
||||||
operation could be started successfully, @code{GPG_ERR_INV_VALUE} if
|
operation could be started successfully, @code{GPG_ERR_INV_VALUE} if
|
||||||
@var{parms} is not a well-formed string (e.g. does not have the
|
@var{parms} is not a well-formed string (e.g., does not have the
|
||||||
expected tag-like headers and footers), @code{GPG_ERR_NOT_SUPPORTED}
|
expected tag-like headers and footers), @code{GPG_ERR_NOT_SUPPORTED}
|
||||||
if @var{public} or @var{secret} is not valid, and
|
if @var{public} or @var{secret} is not valid, and
|
||||||
@code{GPG_ERR_GENERAL} if no key was created by the backend.
|
@code{GPG_ERR_GENERAL} if no key was created by the backend.
|
||||||
@ -5069,7 +5206,7 @@ The function @code{gpgme_op_import_keys} adds the keys described by
|
|||||||
the @code{NULL} terminated array @var{keys} to the key ring of the
|
the @code{NULL} terminated array @var{keys} to the key ring of the
|
||||||
crypto engine used by @var{ctx}. It is used to actually import and
|
crypto engine used by @var{ctx}. It is used to actually import and
|
||||||
make keys permanent which have been retrieved from an external source
|
make keys permanent which have been retrieved from an external source
|
||||||
(i.e. using @code{GPGME_KEYLIST_MODE_EXTERN}) earlier. The external
|
(i.e., using @code{GPGME_KEYLIST_MODE_EXTERN}) earlier. The external
|
||||||
keylisting must have been made with the same context configuration (in
|
keylisting must have been made with the same context configuration (in
|
||||||
particular the same home directory). @footnote{Thus it is a
|
particular the same home directory). @footnote{Thus it is a
|
||||||
replacement for the usual workaround of exporting and then importing a
|
replacement for the usual workaround of exporting and then importing a
|
||||||
@ -5079,7 +5216,7 @@ require another access to the keyserver over the network.
|
|||||||
Only keys of the currently selected protocol of @var{ctx} are
|
Only keys of the currently selected protocol of @var{ctx} are
|
||||||
considered for import. Other keys specified by the @var{keys} are
|
considered for import. Other keys specified by the @var{keys} are
|
||||||
ignored. As of now all considered keys must have been retrieved using
|
ignored. As of now all considered keys must have been retrieved using
|
||||||
the same method, i.e. the used key listing mode must be identical.
|
the same method, i.e., the used key listing mode must be identical.
|
||||||
|
|
||||||
After the operation completed successfully, the result can be
|
After the operation completed successfully, the result can be
|
||||||
retrieved with @code{gpgme_op_import_result}.
|
retrieved with @code{gpgme_op_import_result}.
|
||||||
@ -5151,7 +5288,7 @@ This is a pointer to the next status structure in the linked list, or
|
|||||||
|
|
||||||
@item char *fpr
|
@item char *fpr
|
||||||
This is the fingerprint of the key that was considered, or @code{NULL}
|
This is the fingerprint of the key that was considered, or @code{NULL}
|
||||||
if the fingerprint of the key is not known, e.g. because the key to
|
if the fingerprint of the key is not known, e.g., because the key to
|
||||||
import was encrypted and decryption failed.
|
import was encrypted and decryption failed.
|
||||||
|
|
||||||
@item gpgme_error_t result
|
@item gpgme_error_t result
|
||||||
@ -5299,16 +5436,19 @@ operation was started successfully, and @code{GPG_ERR_INV_VALUE} if
|
|||||||
@var{ctx} or @var{key} is not a valid pointer.
|
@var{ctx} or @var{key} is not a valid pointer.
|
||||||
@end deftypefun
|
@end deftypefun
|
||||||
|
|
||||||
The following functions allow only to use one particular flag.
|
The following functions allow only to use one particular flag. Their
|
||||||
|
use is thus deprecated.
|
||||||
|
|
||||||
@deftypefun gpgme_error_t gpgme_op_delete (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}})
|
@deftypefun gpgme_error_t gpgme_op_delete (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}})
|
||||||
Similar to @code{gpgme_op_delete_ext}, but only the flag
|
Similar to @code{gpgme_op_delete_ext}, but only the flag
|
||||||
@code{GPGME_DELETE_ALLOW_SECRET} can be provided.
|
@code{GPGME_DELETE_ALLOW_SECRET} can be provided. Actually all true
|
||||||
|
values are mapped to this flag.
|
||||||
@end deftypefun
|
@end deftypefun
|
||||||
|
|
||||||
@deftypefun gpgme_error_t gpgme_op_delete_start (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}})
|
@deftypefun gpgme_error_t gpgme_op_delete_start (@w{gpgme_ctx_t @var{ctx}}, @w{const gpgme_key_t @var{key}}, @w{int @var{allow_secret}})
|
||||||
Similar to @code{gpgme_op_delete_ext_start}, but only the flag
|
Similar to @code{gpgme_op_delete_ext_start}, but only the flag
|
||||||
@code{GPGME_DELETE_ALLOW_SECRET} can be provided.
|
@code{GPGME_DELETE_ALLOW_SECRET} can be provided. Actually all true
|
||||||
|
values are mapped to this flag.
|
||||||
@end deftypefun
|
@end deftypefun
|
||||||
|
|
||||||
|
|
||||||
@ -5550,7 +5690,10 @@ An error code describing the reason why the key was found invalid.
|
|||||||
|
|
||||||
@deftypefun gpgme_error_t gpgme_op_decrypt (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{cipher}}, @w{gpgme_data_t @var{plain}})
|
@deftypefun gpgme_error_t gpgme_op_decrypt (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{cipher}}, @w{gpgme_data_t @var{plain}})
|
||||||
The function @code{gpgme_op_decrypt} decrypts the ciphertext in the
|
The function @code{gpgme_op_decrypt} decrypts the ciphertext in the
|
||||||
data object @var{cipher} and stores it into the data object
|
data object @var{cipher} or, if a file name is set on the data object,
|
||||||
|
the ciphertext stored in the corresponding file. The decrypted
|
||||||
|
ciphertext is stored into the data object @var{plain} or written to
|
||||||
|
the file set with @code{gpgme_data_set_file_name} for the data object
|
||||||
@var{plain}.
|
@var{plain}.
|
||||||
|
|
||||||
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
|
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
|
||||||
@ -5586,6 +5729,12 @@ The function @code{gpgme_op_decrypt_ext} is the same as
|
|||||||
@code{gpgme_op_decrypt} but has an additional argument
|
@code{gpgme_op_decrypt} but has an additional argument
|
||||||
@var{flags}. If @var{flags} is 0 both function behave identically.
|
@var{flags}. If @var{flags} is 0 both function behave identically.
|
||||||
|
|
||||||
|
If the flag @code{GPGME_DECRYPT_ARCHIVE} is set, then an encrypted
|
||||||
|
archive in the data object @var{cipher} is decrypted and extracted.
|
||||||
|
The content of the archive is extracted into a directory named
|
||||||
|
@code{GPGARCH_n_} (where @code{n} is a number) or into the directory
|
||||||
|
set with @code{gpgme_data_set_file_name} for the data object @var{plain}.
|
||||||
|
|
||||||
The value in @var{flags} is a bitwise-or combination of one or
|
The value in @var{flags} is a bitwise-or combination of one or
|
||||||
multiple of the following bit values:
|
multiple of the following bit values:
|
||||||
|
|
||||||
@ -5596,6 +5745,14 @@ multiple of the following bit values:
|
|||||||
The @code{GPGME_DECRYPT_VERIFY} symbol specifies that this function
|
The @code{GPGME_DECRYPT_VERIFY} symbol specifies that this function
|
||||||
shall exactly act as @code{gpgme_op_decrypt_verify}.
|
shall exactly act as @code{gpgme_op_decrypt_verify}.
|
||||||
|
|
||||||
|
@item GPGME_DECRYPT_ARCHIVE
|
||||||
|
@since{1.19.0}
|
||||||
|
|
||||||
|
The @code{GPGME_DECRYPT_ARCHIVE} symbol specifies that the input is an
|
||||||
|
encrypted archive that shall be decrypted and extracted. This feature
|
||||||
|
is currently only supported for the OpenPGP crypto engine and requires
|
||||||
|
GnuPG 2.4.1.
|
||||||
|
|
||||||
@item GPGME_DECRYPT_UNWRAP
|
@item GPGME_DECRYPT_UNWRAP
|
||||||
@since{1.8.0}
|
@since{1.8.0}
|
||||||
|
|
||||||
@ -5750,7 +5907,12 @@ detached signature, then the signed text should be provided in
|
|||||||
Otherwise, if @var{sig} is a normal (or cleartext) signature,
|
Otherwise, if @var{sig} is a normal (or cleartext) signature,
|
||||||
@var{signed_text} should be a null pointer and @var{plain} should be a
|
@var{signed_text} should be a null pointer and @var{plain} should be a
|
||||||
writable data object that will contain the plaintext after successful
|
writable data object that will contain the plaintext after successful
|
||||||
verification.
|
verification. If a file name is set on the data object @var{sig} (or
|
||||||
|
on the data object @var{signed_text}), then the data of the signature
|
||||||
|
(resp. the data of the signed text) is not read from the data object
|
||||||
|
but from the file with the given file name. If a file name is set on
|
||||||
|
the data object @var{plain} then the plaintext is not stored in the
|
||||||
|
data object but it is written to a file with the given file name.
|
||||||
|
|
||||||
The results of the individual signature verifications can be retrieved
|
The results of the individual signature verifications can be retrieved
|
||||||
with @code{gpgme_op_verify_result}.
|
with @code{gpgme_op_verify_result}.
|
||||||
@ -5775,6 +5937,61 @@ operation could be started successfully, @code{GPG_ERR_INV_VALUE} if
|
|||||||
any data to verify.
|
any data to verify.
|
||||||
@end deftypefun
|
@end deftypefun
|
||||||
|
|
||||||
|
|
||||||
|
@deftypefun gpgme_error_t gpgme_op_verify_ext ( @
|
||||||
|
@w{gpgme_ctx_t @var{ctx}}, @
|
||||||
|
@w{gpgme_verify_flags_t @var{flags}}, @
|
||||||
|
@w{gpgme_data_t @var{sig}}, @
|
||||||
|
@w{gpgme_data_t @var{signed_text}}, @
|
||||||
|
@w{gpgme_data_t @var{plain}})
|
||||||
|
|
||||||
|
The function @code{gpgme_op_verify_ext} is the same as
|
||||||
|
@code{gpgme_op_verify} but has an additional argument
|
||||||
|
@var{flags}. If @var{flags} is 0 both function behave identically.
|
||||||
|
|
||||||
|
If the flag @code{GPGME_VERIFY_ARCHIVE} is set, then a signed archive
|
||||||
|
in the data object @var{sig} is verified and extracted. The content of
|
||||||
|
the archive is extracted into a directory named @code{GPGARCH_n_}
|
||||||
|
(where @code{n} is a number) or into the directory set with
|
||||||
|
@code{gpgme_data_set_file_name} for the data object @var{plain}.
|
||||||
|
|
||||||
|
The value in @var{flags} is a bitwise-or combination of one or
|
||||||
|
multiple of the following bit values:
|
||||||
|
|
||||||
|
@table @code
|
||||||
|
@item GPGME_VERIFY_ARCHIVE
|
||||||
|
@since{1.19.0}
|
||||||
|
|
||||||
|
The @code{GPGME_VERIFY_ARCHIVE} symbol specifies that the input is a
|
||||||
|
signed archive that shall be verified and extracted. This feature
|
||||||
|
is currently only supported for the OpenPGP crypto engine and requires
|
||||||
|
GnuPG 2.4.1.
|
||||||
|
|
||||||
|
@end table
|
||||||
|
|
||||||
|
The function returns the error codes as descriped for
|
||||||
|
@code{gpgme_op_decrypt} respective @code{gpgme_op_encrypt}.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
|
@deftypefun gpgme_error_t gpgme_op_verify_ext_start ( @
|
||||||
|
@w{gpgme_ctx_t @var{ctx}}, @
|
||||||
|
@w{gpgme_verify_flags_t @var{flags}}, @
|
||||||
|
@w{gpgme_data_t @var{sig}}, @
|
||||||
|
@w{gpgme_data_t @var{signed_text}}, @
|
||||||
|
@w{gpgme_data_t @var{plain}})
|
||||||
|
|
||||||
|
The function @code{gpgme_op_verify_ext_start} initiates a
|
||||||
|
@code{gpgme_op_verify_ext} operation. It can be completed by calling
|
||||||
|
@code{gpgme_wait} on the context. @xref{Waiting For Completion}.
|
||||||
|
|
||||||
|
The function returns the error code @code{GPG_ERR_NO_ERROR} if the
|
||||||
|
operation could be started successfully, @code{GPG_ERR_INV_VALUE} if
|
||||||
|
@var{ctx}, @var{sig} or @var{plain} is not a valid pointer, and
|
||||||
|
@code{GPG_ERR_NO_DATA} if @var{sig} or @var{plain} does not contain
|
||||||
|
any data to verify.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
|
|
||||||
@deftp {Data type} {gpgme_sig_notation_t}
|
@deftp {Data type} {gpgme_sig_notation_t}
|
||||||
This is a pointer to a structure used to store a part of the result of
|
This is a pointer to a structure used to store a part of the result of
|
||||||
a @code{gpgme_op_verify} operation. The structure contains the
|
a @code{gpgme_op_verify} operation. The structure contains the
|
||||||
@ -5874,7 +6091,7 @@ The defined bits are:
|
|||||||
|
|
||||||
@item GPGME_SIGSUM_RED
|
@item GPGME_SIGSUM_RED
|
||||||
The signature is bad. It might be useful to check other bits and
|
The signature is bad. It might be useful to check other bits and
|
||||||
display more information, i.e. a revoked certificate might not render a
|
display more information, i.e., a revoked certificate might not render a
|
||||||
signature invalid when the message was received prior to the cause for
|
signature invalid when the message was received prior to the cause for
|
||||||
the revocation.
|
the revocation.
|
||||||
|
|
||||||
@ -6120,7 +6337,7 @@ functions in GPGME and GnuPG:
|
|||||||
|
|
||||||
Return the mail address (called ``addr-spec'' in RFC-5322) from the
|
Return the mail address (called ``addr-spec'' in RFC-5322) from the
|
||||||
string @var{uid} which is assumed to be a user id (called ``address''
|
string @var{uid} which is assumed to be a user id (called ``address''
|
||||||
in RFC-5322). All plain ASCII characters (i.e. those with bit 7
|
in RFC-5322). All plain ASCII characters (i.e., those with bit 7
|
||||||
cleared) in the result are converted to lowercase. Caller must free
|
cleared) in the result are converted to lowercase. Caller must free
|
||||||
the result using @code{gpgme_free}. Returns @code{NULL} if no valid
|
the result using @code{gpgme_free}. Returns @code{NULL} if no valid
|
||||||
address was found (in which case @code{ERRNO} is set to @code{EINVAL})
|
address was found (in which case @code{ERRNO} is set to @code{EINVAL})
|
||||||
@ -6207,16 +6424,48 @@ A detached signature is made.
|
|||||||
@item GPGME_SIG_MODE_CLEAR
|
@item GPGME_SIG_MODE_CLEAR
|
||||||
A clear text signature is made. The @acronym{ASCII} armor and text
|
A clear text signature is made. The @acronym{ASCII} armor and text
|
||||||
mode settings of the context are ignored.
|
mode settings of the context are ignored.
|
||||||
|
|
||||||
|
@item GPGME_SIG_MODE_ARCHIVE
|
||||||
|
@since{1.19.0}
|
||||||
|
|
||||||
|
A signed archive is created from the given files and directories. This
|
||||||
|
feature is currently only supported for the OpenPGP crypto engine and requires
|
||||||
|
GnuPG 2.4.1.
|
||||||
|
|
||||||
|
@item GPGME_SIG_MODE_FILE
|
||||||
|
@since{1.24.0}
|
||||||
|
|
||||||
|
The filename set with @code{gpgme_data_set_file_name} for the data object
|
||||||
|
@var{plain} is passed to gpg, so that gpg reads the plaintext directly from
|
||||||
|
this file instead of from the data object @var{plain}. This flag can be
|
||||||
|
combined with @code{GPGME_SIG_MODE_NORMAL}, @code{GPGME_SIG_MODE_DETACH},
|
||||||
|
and @code{GPGME_SIG_MODE_CLEAR}, but not with @code{GPGME_SIG_MODE_ARCHIVE}.
|
||||||
|
This feature is currently only supported for the OpenPGP crypto engine.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
@end deftp
|
@end deftp
|
||||||
|
|
||||||
@deftypefun gpgme_error_t gpgme_op_sign (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{sig}}, @w{gpgme_sig_mode_t @var{mode}})
|
@deftypefun gpgme_error_t gpgme_op_sign (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{sig}}, @w{gpgme_sig_mode_t @var{mode}})
|
||||||
The function @code{gpgme_op_sign} creates a signature for the text in
|
The function @code{gpgme_op_sign} creates a signature for the text in
|
||||||
the data object @var{plain} and returns it in the data object
|
the data object @var{plain} and returns it in the data object
|
||||||
@var{sig}. The type of the signature created is determined by the
|
@var{sig} or writes it directly to the file set with
|
||||||
@acronym{ASCII} armor (or, if that is not set, by the encoding
|
@code{gpgme_data_set_file_name} for the data object @var{sig}. The type
|
||||||
specified for @var{sig}), the text mode attributes set for the context
|
of the signature created is determined by the @acronym{ASCII} armor (or,
|
||||||
@var{ctx} and the requested signature mode @var{mode}.
|
if that is not set, by the encoding specified for @var{sig}), the text
|
||||||
|
mode attributes set for the context @var{ctx} and the requested signature
|
||||||
|
mode @var{mode}.
|
||||||
|
|
||||||
|
If the signature mode flag @code{GPGME_SIG_MODE_FILE} is set and a filename
|
||||||
|
has been set with @code{gpgme_data_set_file_name} for the data object
|
||||||
|
@var{plain}, then this filename is passed to gpg, so that gpg reads the
|
||||||
|
plaintext directly from this file instead of from the data object @var{plain}.
|
||||||
|
|
||||||
|
If signature mode @code{GPGME_SIG_MODE_ARCHIVE} is requested then a
|
||||||
|
signed archive is created from the files and directories given as
|
||||||
|
NUL-separated list in the data object @var{plain}. The paths of the files
|
||||||
|
and directories have to be given as paths relative to the current working
|
||||||
|
directory or relative to the base directory set with
|
||||||
|
@code{gpgme_data_set_file_name} for the data object @var{plain}.
|
||||||
|
|
||||||
After the operation completed successfully, the result can be
|
After the operation completed successfully, the result can be
|
||||||
retrieved with @code{gpgme_op_sign_result}.
|
retrieved with @code{gpgme_op_sign_result}.
|
||||||
@ -6265,7 +6514,8 @@ The public key algorithm used to create this signature.
|
|||||||
The hash algorithm used to create this signature.
|
The hash algorithm used to create this signature.
|
||||||
|
|
||||||
@item unsigned int sig_class
|
@item unsigned int sig_class
|
||||||
The signature class of this signature.
|
The signature class of this signature. Note that only the values 0,
|
||||||
|
1, and 2 are well-defined.
|
||||||
|
|
||||||
@item long int timestamp
|
@item long int timestamp
|
||||||
The creation timestamp of this signature.
|
The creation timestamp of this signature.
|
||||||
@ -6383,10 +6633,26 @@ and then passed to the encryption operation.
|
|||||||
@deftypefun gpgme_error_t gpgme_op_encrypt (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t @var{recp}[]}, @w{gpgme_encrypt_flags_t @var{flags}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{cipher}})
|
@deftypefun gpgme_error_t gpgme_op_encrypt (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t @var{recp}[]}, @w{gpgme_encrypt_flags_t @var{flags}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{cipher}})
|
||||||
The function @code{gpgme_op_encrypt} encrypts the plaintext in the
|
The function @code{gpgme_op_encrypt} encrypts the plaintext in the
|
||||||
data object @var{plain} for the recipients @var{recp} and stores the
|
data object @var{plain} for the recipients @var{recp} and stores the
|
||||||
ciphertext in the data object @var{cipher}. The type of the
|
ciphertext in the data object @var{cipher} or writes it directly to the
|
||||||
ciphertext created is determined by the @acronym{ASCII} armor (or, if
|
file set with @code{gpgme_data_set_file_name} for the data object
|
||||||
that is not set, by the encoding specified for @var{cipher}) and the
|
@var{cipher}. The type of the ciphertext created is determined by the
|
||||||
text mode attributes set for the context @var{ctx}.
|
@acronym{ASCII} armor (or, if that is not set, by the encoding specified
|
||||||
|
for @var{cipher}) and the text mode attributes set for the context
|
||||||
|
@var{ctx}. If a filename has been set with @code{gpgme_data_set_file_name}
|
||||||
|
for the data object @var{plain} then this filename is stored in the
|
||||||
|
ciphertext.
|
||||||
|
|
||||||
|
If the flag @code{GPGME_ENCRYPT_FILE} is set and a filename has been set
|
||||||
|
with @code{gpgme_data_set_file_name} for the data object @var{plain},
|
||||||
|
then this filename is passed to gpg, so that gpg reads the plaintext
|
||||||
|
directly from this file instead of from the data object @var{plain}.
|
||||||
|
|
||||||
|
If the flag @code{GPGME_ENCRYPT_ARCHIVE} is set, then an encrypted
|
||||||
|
archive is created from the files and directories given as NUL-separated
|
||||||
|
list in the data object @var{plain}. The paths of the files and
|
||||||
|
directories have to be given as paths relative to the current working
|
||||||
|
directory or relative to the base directory set with
|
||||||
|
@code{gpgme_data_set_file_name} for the data object @var{plain}.
|
||||||
|
|
||||||
@var{recp} must be a @code{NULL}-terminated array of keys. The user
|
@var{recp} must be a @code{NULL}-terminated array of keys. The user
|
||||||
must keep references for all keys during the whole duration of the
|
must keep references for all keys during the whole duration of the
|
||||||
@ -6403,6 +6669,10 @@ recipients in @var{recp} should be trusted, even if the keys do not
|
|||||||
have a high enough validity in the keyring. This flag should be used
|
have a high enough validity in the keyring. This flag should be used
|
||||||
with care; in general it is not a good idea to use any untrusted keys.
|
with care; in general it is not a good idea to use any untrusted keys.
|
||||||
|
|
||||||
|
For the S/MIME (CMS) protocol this flag allows to encrypt to a
|
||||||
|
certificate without running any checks on the validity of the
|
||||||
|
certificate.
|
||||||
|
|
||||||
@item GPGME_ENCRYPT_NO_ENCRYPT_TO
|
@item GPGME_ENCRYPT_NO_ENCRYPT_TO
|
||||||
@since{1.2.0}
|
@since{1.2.0}
|
||||||
|
|
||||||
@ -6422,7 +6692,7 @@ may reveal information about the plaintext.
|
|||||||
@item GPGME_ENCRYPT_PREPARE
|
@item GPGME_ENCRYPT_PREPARE
|
||||||
@itemx GPGME_ENCRYPT_EXPECT_SIGN
|
@itemx GPGME_ENCRYPT_EXPECT_SIGN
|
||||||
The @code{GPGME_ENCRYPT_PREPARE} symbol is used with the UI Server
|
The @code{GPGME_ENCRYPT_PREPARE} symbol is used with the UI Server
|
||||||
protocol to prepare an encryption (i.e. sending the
|
protocol to prepare an encryption (i.e., sending the
|
||||||
@code{PREP_ENCRYPT} command). With the
|
@code{PREP_ENCRYPT} command). With the
|
||||||
@code{GPGME_ENCRYPT_EXPECT_SIGN} symbol the UI Server is advised to
|
@code{GPGME_ENCRYPT_EXPECT_SIGN} symbol the UI Server is advised to
|
||||||
also expect a sign command.
|
also expect a sign command.
|
||||||
@ -6463,6 +6733,23 @@ of now the key must be specified using the @var{recpstring} argument
|
|||||||
of the extended encrypt functions. This feature is currently only
|
of the extended encrypt functions. This feature is currently only
|
||||||
supported for the OpenPGP crypto engine.
|
supported for the OpenPGP crypto engine.
|
||||||
|
|
||||||
|
@item GPGME_ENCRYPT_ARCHIVE
|
||||||
|
@since{1.19.0}
|
||||||
|
|
||||||
|
The @code{GPGME_ENCRYPT_ARCHIVE} symbol specifies that the input is a
|
||||||
|
NUL-separated list of file paths and directory paths that shall be
|
||||||
|
encrypted into an archive. This feature is currently only supported
|
||||||
|
for the OpenPGP crypto engine and requires GnuPG 2.4.1.
|
||||||
|
|
||||||
|
@item GPGME_ENCRYPT_FILE
|
||||||
|
@since{1.24.0}
|
||||||
|
|
||||||
|
The @code{GPGME_ENCRYPT_FILE} symbol specifies that the filename set
|
||||||
|
with @code{gpgme_data_set_file_name} for the data object @var{plain}
|
||||||
|
is passed to gpg, so that gpg reads the plaintext directly from this
|
||||||
|
file instead of from the data object @var{plain}. This feature is
|
||||||
|
currently only supported for the OpenPGP crypto engine.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
If @code{GPG_ERR_UNUSABLE_PUBKEY} is returned, some recipients in
|
If @code{GPG_ERR_UNUSABLE_PUBKEY} is returned, some recipients in
|
||||||
@ -7798,6 +8085,15 @@ reveal sensitive details like passphrases or other data you use in
|
|||||||
your application. If you are asked to send a log file, make sure that
|
your application. If you are asked to send a log file, make sure that
|
||||||
you run your tests only with play data.
|
you run your tests only with play data.
|
||||||
|
|
||||||
|
The trace function makes use of gpgrt's logging function and thus the
|
||||||
|
special @file{socket://} and @file{tcp://} files may be used. Because
|
||||||
|
this conflicts with the use of colons to separate fields, the following
|
||||||
|
hack is used: If the file name contains the string @code{^//} all
|
||||||
|
carets are replaced by colons. For example to log to TCP port 42042
|
||||||
|
this can be used:
|
||||||
|
@smallexample
|
||||||
|
GPGME_DEBUG=5:tcp^//127.0.0.1^42042
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
@node Deprecated Functions
|
@node Deprecated Functions
|
||||||
@appendix Deprecated Functions
|
@appendix Deprecated Functions
|
||||||
|
@ -498,7 +498,7 @@
|
|||||||
% \def\foo{\parsearg\Xfoo}
|
% \def\foo{\parsearg\Xfoo}
|
||||||
% \def\Xfoo#1{...}
|
% \def\Xfoo#1{...}
|
||||||
%
|
%
|
||||||
% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
|
% Actually, I use \csname\string\foo\endcsname, i.e. \\foo, as it is my
|
||||||
% favourite TeX trick. --kasal, 16nov03
|
% favourite TeX trick. --kasal, 16nov03
|
||||||
|
|
||||||
\def\parseargdef#1{%
|
\def\parseargdef#1{%
|
||||||
|
@ -18,6 +18,12 @@
|
|||||||
# License along with this program; if not, see <https://gnu.org/licenses/>.
|
# License along with this program; if not, see <https://gnu.org/licenses/>.
|
||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
|
||||||
SUBDIRS = src tests
|
if RUN_GPG_TESTS
|
||||||
|
tests = tests
|
||||||
|
else
|
||||||
|
tests =
|
||||||
|
endif
|
||||||
|
|
||||||
|
SUBDIRS = src ${tests}
|
||||||
|
|
||||||
EXTRA_DIST = README
|
EXTRA_DIST = README
|
||||||
|
@ -88,6 +88,14 @@ else
|
|||||||
libsuffix=.so
|
libsuffix=.so
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
copied_headers = $(gpgmepp_headers:%=gpgme++/%) $(interface_headers:%=gpgme++/%)
|
||||||
|
|
||||||
|
$(copied_headers): Makefile.am
|
||||||
|
mkdir -p $(builddir)/gpgme++/interfaces
|
||||||
|
echo -n "#include \"$(abs_srcdir)" > "$@"
|
||||||
|
echo -n "$@" | sed "s/gpgme++//" >> "$@"
|
||||||
|
echo "\"" >> "$@"
|
||||||
|
|
||||||
if HAVE_W32_SYSTEM
|
if HAVE_W32_SYSTEM
|
||||||
GpgmeppConfig.cmake: GpgmeppConfig-w32.cmake.in
|
GpgmeppConfig.cmake: GpgmeppConfig-w32.cmake.in
|
||||||
sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
|
sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \
|
||||||
@ -115,5 +123,8 @@ install-data-local: install-cmake-files
|
|||||||
|
|
||||||
uninstall-local: uninstall-cmake-files
|
uninstall-local: uninstall-cmake-files
|
||||||
|
|
||||||
|
BUILT_SOURCES = $(copied_headers)
|
||||||
|
|
||||||
CLEANFILES = GpgmeppConfig.cmake GpgmeppConfigVersion.cmake \
|
CLEANFILES = GpgmeppConfig.cmake GpgmeppConfigVersion.cmake \
|
||||||
gpgmepp_version.h GpgmeppConfig.cmake.in
|
gpgmepp_version.h GpgmeppConfig.cmake.in \
|
||||||
|
$(copied_headers)
|
||||||
|
@ -257,158 +257,6 @@ Type Option::alternateType() const
|
|||||||
return isNull() ? NoType : static_cast<Type>(opt->alt_type) ;
|
return isNull() ? NoType : static_cast<Type>(opt->alt_type) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static Option::Variant argument_to_variant(gpgme_conf_type_t type, bool list, gpgme_conf_arg_t arg)
|
|
||||||
{
|
|
||||||
assert(arg);
|
|
||||||
switch (type) {
|
|
||||||
case GPGME_CONF_NONE:
|
|
||||||
if (list) {
|
|
||||||
// return the count (number of times set):
|
|
||||||
return arg->value.count;
|
|
||||||
} else {
|
|
||||||
return none;
|
|
||||||
}
|
|
||||||
case GPGME_CONF_INT32:
|
|
||||||
if (list) {
|
|
||||||
std::vector<int> result;
|
|
||||||
for (gpgme_conf_arg_t a = arg ; a ; a = a->next) {
|
|
||||||
result.push_back(a->value.int32);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return arg->value.int32;
|
|
||||||
}
|
|
||||||
case GPGME_CONF_UINT32:
|
|
||||||
if (list) {
|
|
||||||
std::vector<unsigned int> result;
|
|
||||||
for (gpgme_conf_arg_t a = arg ; a ; a = a->next) {
|
|
||||||
result.push_back(a->value.uint32);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return arg->value.uint32;
|
|
||||||
}
|
|
||||||
case GPGME_CONF_FILENAME:
|
|
||||||
case GPGME_CONF_LDAP_SERVER:
|
|
||||||
case GPGME_CONF_KEY_FPR:
|
|
||||||
case GPGME_CONF_PUB_KEY:
|
|
||||||
case GPGME_CONF_SEC_KEY:
|
|
||||||
case GPGME_CONF_ALIAS_LIST:
|
|
||||||
// these should not happen in alt_type, but fall through
|
|
||||||
case GPGME_CONF_STRING:
|
|
||||||
if (list) {
|
|
||||||
std::vector<const char *> result;
|
|
||||||
for (gpgme_conf_arg_t a = arg ; a ; a = a->next) {
|
|
||||||
result.push_back(a->value.string);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
} else {
|
|
||||||
return arg->value.string;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
assert(!"Option: unknown alt_type!");
|
|
||||||
return Option::Variant();
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
inline const void *to_void_star(const char *s)
|
|
||||||
{
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
inline const void *to_void_star(const std::string &s)
|
|
||||||
{
|
|
||||||
return s.c_str();
|
|
||||||
}
|
|
||||||
inline const void *to_void_star(const int &i)
|
|
||||||
{
|
|
||||||
return &i; // const-&: sic!
|
|
||||||
}
|
|
||||||
inline const void *to_void_star(const unsigned int &i)
|
|
||||||
{
|
|
||||||
return &i; // const-&: sic!
|
|
||||||
}
|
|
||||||
|
|
||||||
struct VariantToArgumentVisitor : boost::static_visitor<gpgme_conf_arg_t> {
|
|
||||||
static gpgme_conf_arg_t make_argument(gpgme_conf_type_t type, const void *value)
|
|
||||||
{
|
|
||||||
gpgme_conf_arg_t arg = 0;
|
|
||||||
#ifdef HAVE_GPGME_CONF_ARG_NEW_WITH_CONST_VALUE
|
|
||||||
if (const gpgme_error_t err = gpgme_conf_arg_new(&arg, type, value)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (const gpgme_error_t err = gpgme_conf_arg_new(&arg, type, const_cast<void *>(value))) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
else {
|
|
||||||
return arg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gpgme_conf_arg_t operator()(bool v) const
|
|
||||||
{
|
|
||||||
return v ? make_argument(0) : 0 ;
|
|
||||||
}
|
|
||||||
|
|
||||||
gpgme_conf_arg_t operator()(const char *s) const
|
|
||||||
{
|
|
||||||
return make_argument(s ? s : "");
|
|
||||||
}
|
|
||||||
|
|
||||||
gpgme_conf_arg_t operator()(const std::string &s) const
|
|
||||||
{
|
|
||||||
return operator()(s.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
gpgme_conf_arg_t operator()(int i) const
|
|
||||||
{
|
|
||||||
return make_argument(&i);
|
|
||||||
}
|
|
||||||
|
|
||||||
gpgme_conf_arg_t operator()(unsigned int i) const
|
|
||||||
{
|
|
||||||
return make_argument(&i);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
gpgme_conf_arg_t operator()(const std::vector<T> &value) const
|
|
||||||
{
|
|
||||||
gpgme_conf_arg_t result = 0;
|
|
||||||
gpgme_conf_arg_t last = 0;
|
|
||||||
for (typename std::vector<T>::const_iterator it = value.begin(), end = value.end() ; it != end ; ++it) {
|
|
||||||
if (gpgme_conf_arg_t arg = make_argument(to_void_star(*it))) {
|
|
||||||
if (last) {
|
|
||||||
last = last->next = arg;
|
|
||||||
} else {
|
|
||||||
result = last = arg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
static gpgme_conf_arg_t variant_to_argument(const Option::Variant &value)
|
|
||||||
{
|
|
||||||
VariantToArgumentVisitor v;
|
|
||||||
return apply_visitor(v, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
optional<Option::Variant> Option::defaultValue() const
|
|
||||||
{
|
|
||||||
if (isNull()) {
|
|
||||||
return optional<Variant>();
|
|
||||||
} else {
|
|
||||||
return argument_to_variant(opt->alt_type, opt->flags & GPGME_CONF_LIST, opt->default_value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Argument Option::defaultValue() const
|
Argument Option::defaultValue() const
|
||||||
{
|
{
|
||||||
if (isNull()) {
|
if (isNull()) {
|
||||||
|
@ -98,8 +98,7 @@ public:
|
|||||||
explicit Component(const shared_gpgme_conf_comp_t &gpgme_comp)
|
explicit Component(const shared_gpgme_conf_comp_t &gpgme_comp)
|
||||||
: comp(gpgme_comp) {}
|
: comp(gpgme_comp) {}
|
||||||
|
|
||||||
// copy ctor is ok
|
Component(const Component &other) = default;
|
||||||
|
|
||||||
const Component &operator=(const Component &other)
|
const Component &operator=(const Component &other)
|
||||||
{
|
{
|
||||||
if (this != &other) {
|
if (this != &other) {
|
||||||
@ -149,6 +148,7 @@ public:
|
|||||||
Option(const shared_gpgme_conf_comp_t &gpgme_comp, gpgme_conf_opt_t gpgme_opt)
|
Option(const shared_gpgme_conf_comp_t &gpgme_comp, gpgme_conf_opt_t gpgme_opt)
|
||||||
: comp(gpgme_comp), opt(gpgme_opt) {}
|
: comp(gpgme_comp), opt(gpgme_opt) {}
|
||||||
|
|
||||||
|
Option(const Option &other) = default;
|
||||||
const Option &operator=(const Option &other)
|
const Option &operator=(const Option &other)
|
||||||
{
|
{
|
||||||
if (this != &other) {
|
if (this != &other) {
|
||||||
@ -190,7 +190,7 @@ public:
|
|||||||
|
|
||||||
/*! The value that is in the config file (or null, if it's not set). */
|
/*! The value that is in the config file (or null, if it's not set). */
|
||||||
Argument activeValue() const;
|
Argument activeValue() const;
|
||||||
/*! The value that is in this object, ie. either activeValue(), newValue(), or defaultValue() */
|
/*! The value that is in this object, i.e. either activeValue(), newValue(), or defaultValue() */
|
||||||
Argument currentValue() const;
|
Argument currentValue() const;
|
||||||
|
|
||||||
Argument newValue() const;
|
Argument newValue() const;
|
||||||
|
@ -130,6 +130,13 @@ const char *Error::asString() const
|
|||||||
return mMessage.c_str();
|
return mMessage.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Error::asStdString() const
|
||||||
|
{
|
||||||
|
std::string message;
|
||||||
|
format_error(static_cast<gpgme_error_t>(mErr), message);
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
int Error::code() const
|
int Error::code() const
|
||||||
{
|
{
|
||||||
return gpgme_err_code(mErr);
|
return gpgme_err_code(mErr);
|
||||||
@ -142,16 +149,12 @@ int Error::sourceID() const
|
|||||||
|
|
||||||
bool Error::isCanceled() const
|
bool Error::isCanceled() const
|
||||||
{
|
{
|
||||||
return code() == GPG_ERR_CANCELED;
|
return code() == GPG_ERR_CANCELED || code() == GPG_ERR_FULLY_CANCELED;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Error::toErrno() const
|
int Error::toErrno() const
|
||||||
{
|
{
|
||||||
//#ifdef HAVE_GPGME_GPG_ERROR_WRAPPERS
|
|
||||||
return gpgme_err_code_to_errno(static_cast<gpgme_err_code_t>(code()));
|
return gpgme_err_code_to_errno(static_cast<gpgme_err_code_t>(code()));
|
||||||
//#else
|
|
||||||
// return gpg_err_code_to_errno( static_cast<gpg_err_code_t>( code() ) );
|
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@ -192,7 +195,7 @@ Error Error::fromCode(unsigned int err, unsigned int src)
|
|||||||
|
|
||||||
std::ostream &operator<<(std::ostream &os, const Error &err)
|
std::ostream &operator<<(std::ostream &os, const Error &err)
|
||||||
{
|
{
|
||||||
return os << "GpgME::Error(" << err.encodedError() << " (" << err.asString() << "))";
|
return os << "GpgME::Error(" << err.encodedError() << " (" << err.asStdString() << "))";
|
||||||
}
|
}
|
||||||
|
|
||||||
Context::KeyListModeSaver::KeyListModeSaver(Context *ctx)
|
Context::KeyListModeSaver::KeyListModeSaver(Context *ctx)
|
||||||
@ -1070,7 +1073,7 @@ DecryptionResult Context::decrypt(const Data &cipherText, Data &plainText, const
|
|||||||
const Data::Private *const cdp = cipherText.impl();
|
const Data::Private *const cdp = cipherText.impl();
|
||||||
Data::Private *const pdp = plainText.impl();
|
Data::Private *const pdp = plainText.impl();
|
||||||
d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags), cdp ? cdp->data : nullptr, pdp ? pdp->data : nullptr);
|
d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags), cdp ? cdp->data : nullptr, pdp ? pdp->data : nullptr);
|
||||||
return DecryptionResult(d->ctx, Error(d->lasterr));
|
return decryptionResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
DecryptionResult Context::decrypt(const Data &cipherText, Data &plainText)
|
DecryptionResult Context::decrypt(const Data &cipherText, Data &plainText)
|
||||||
@ -1107,7 +1110,7 @@ VerificationResult Context::verifyDetachedSignature(const Data &signature, const
|
|||||||
const Data::Private *const sdp = signature.impl();
|
const Data::Private *const sdp = signature.impl();
|
||||||
const Data::Private *const tdp = signedText.impl();
|
const Data::Private *const tdp = signedText.impl();
|
||||||
d->lasterr = gpgme_op_verify(d->ctx, sdp ? sdp->data : nullptr, tdp ? tdp->data : nullptr, nullptr);
|
d->lasterr = gpgme_op_verify(d->ctx, sdp ? sdp->data : nullptr, tdp ? tdp->data : nullptr, nullptr);
|
||||||
return VerificationResult(d->ctx, Error(d->lasterr));
|
return verificationResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
VerificationResult Context::verifyOpaqueSignature(const Data &signedData, Data &plainText)
|
VerificationResult Context::verifyOpaqueSignature(const Data &signedData, Data &plainText)
|
||||||
@ -1116,7 +1119,7 @@ VerificationResult Context::verifyOpaqueSignature(const Data &signedData, Data &
|
|||||||
const Data::Private *const sdp = signedData.impl();
|
const Data::Private *const sdp = signedData.impl();
|
||||||
Data::Private *const pdp = plainText.impl();
|
Data::Private *const pdp = plainText.impl();
|
||||||
d->lasterr = gpgme_op_verify(d->ctx, sdp ? sdp->data : nullptr, nullptr, pdp ? pdp->data : nullptr);
|
d->lasterr = gpgme_op_verify(d->ctx, sdp ? sdp->data : nullptr, nullptr, pdp ? pdp->data : nullptr);
|
||||||
return VerificationResult(d->ctx, Error(d->lasterr));
|
return verificationResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
Error Context::startDetachedSignatureVerification(const Data &signature, const Data &signedText)
|
Error Context::startDetachedSignatureVerification(const Data &signature, const Data &signedText)
|
||||||
@ -1138,9 +1141,18 @@ Error Context::startOpaqueSignatureVerification(const Data &signedData, Data &pl
|
|||||||
VerificationResult Context::verificationResult() const
|
VerificationResult Context::verificationResult() const
|
||||||
{
|
{
|
||||||
if (d->lastop & Private::Verify) {
|
if (d->lastop & Private::Verify) {
|
||||||
return VerificationResult(d->ctx, Error(d->lasterr));
|
const auto res = VerificationResult{d->ctx, Error(d->lasterr)};
|
||||||
|
if ((d->lastop == Private::DecryptAndVerify)
|
||||||
|
&& (res.error().code() == GPG_ERR_NO_DATA)
|
||||||
|
&& (res.numSignatures() > 0)) {
|
||||||
|
// ignore "no data" error for verification if there are signatures and
|
||||||
|
// the operation was a combined (tentative) decryption and verification
|
||||||
|
// because then "no data" just indicates that there was nothing to decrypt
|
||||||
|
return VerificationResult{d->ctx, Error{}};
|
||||||
|
}
|
||||||
|
return res;
|
||||||
} else {
|
} else {
|
||||||
return VerificationResult();
|
return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1151,8 +1163,7 @@ std::pair<DecryptionResult, VerificationResult> Context::decryptAndVerify(const
|
|||||||
Data::Private *const pdp = plainText.impl();
|
Data::Private *const pdp = plainText.impl();
|
||||||
d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags | DecryptVerify),
|
d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags | DecryptVerify),
|
||||||
cdp ? cdp->data : nullptr, pdp ? pdp->data : nullptr);
|
cdp ? cdp->data : nullptr, pdp ? pdp->data : nullptr);
|
||||||
return std::make_pair(DecryptionResult(d->ctx, Error(d->lasterr)),
|
return std::make_pair(decryptionResult(), verificationResult());
|
||||||
VerificationResult(d->ctx, Error(d->lasterr)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<DecryptionResult, VerificationResult> Context::decryptAndVerify(const Data &cipherText, Data &plainText)
|
std::pair<DecryptionResult, VerificationResult> Context::decryptAndVerify(const Data &cipherText, Data &plainText)
|
||||||
@ -1278,14 +1289,25 @@ std::vector<Notation> Context::signatureNotations() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpgme_sig_mode_t sigmode2sigmode(SignatureMode mode)
|
static gpgme_sig_mode_t sigflags2sigflags(SignatureMode flags)
|
||||||
{
|
{
|
||||||
switch (mode) {
|
unsigned int result = 0;
|
||||||
default:
|
if (flags & SignatureMode::NormalSignatureMode) {
|
||||||
case NormalSignatureMode: return GPGME_SIG_MODE_NORMAL;
|
result |= GPGME_SIG_MODE_NORMAL;
|
||||||
case Detached: return GPGME_SIG_MODE_DETACH;
|
|
||||||
case Clearsigned: return GPGME_SIG_MODE_CLEAR;
|
|
||||||
}
|
}
|
||||||
|
if (flags & SignatureMode::Detached) {
|
||||||
|
result |= GPGME_SIG_MODE_DETACH;
|
||||||
|
}
|
||||||
|
if (flags & SignatureMode::Clearsigned) {
|
||||||
|
result |= GPGME_SIG_MODE_CLEAR;
|
||||||
|
}
|
||||||
|
if (flags & SignatureMode::SignArchive) {
|
||||||
|
result |= GPGME_SIG_MODE_ARCHIVE;
|
||||||
|
}
|
||||||
|
if (flags & SignatureMode::SignFile) {
|
||||||
|
result |= GPGME_SIG_MODE_FILE;
|
||||||
|
}
|
||||||
|
return static_cast<gpgme_sig_mode_t>(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
SigningResult Context::sign(const Data &plainText, Data &signature, SignatureMode mode)
|
SigningResult Context::sign(const Data &plainText, Data &signature, SignatureMode mode)
|
||||||
@ -1293,7 +1315,7 @@ SigningResult Context::sign(const Data &plainText, Data &signature, SignatureMod
|
|||||||
d->lastop = Private::Sign;
|
d->lastop = Private::Sign;
|
||||||
const Data::Private *const pdp = plainText.impl();
|
const Data::Private *const pdp = plainText.impl();
|
||||||
Data::Private *const sdp = signature.impl();
|
Data::Private *const sdp = signature.impl();
|
||||||
d->lasterr = gpgme_op_sign(d->ctx, pdp ? pdp->data : nullptr, sdp ? sdp->data : nullptr, sigmode2sigmode(mode));
|
d->lasterr = gpgme_op_sign(d->ctx, pdp ? pdp->data : nullptr, sdp ? sdp->data : nullptr, sigflags2sigflags(mode));
|
||||||
return SigningResult(d->ctx, Error(d->lasterr));
|
return SigningResult(d->ctx, Error(d->lasterr));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1302,7 +1324,7 @@ Error Context::startSigning(const Data &plainText, Data &signature, SignatureMod
|
|||||||
d->lastop = Private::Sign;
|
d->lastop = Private::Sign;
|
||||||
const Data::Private *const pdp = plainText.impl();
|
const Data::Private *const pdp = plainText.impl();
|
||||||
Data::Private *const sdp = signature.impl();
|
Data::Private *const sdp = signature.impl();
|
||||||
return Error(d->lasterr = gpgme_op_sign_start(d->ctx, pdp ? pdp->data : nullptr, sdp ? sdp->data : nullptr, sigmode2sigmode(mode)));
|
return Error(d->lasterr = gpgme_op_sign_start(d->ctx, pdp ? pdp->data : nullptr, sdp ? sdp->data : nullptr, sigflags2sigflags(mode)));
|
||||||
}
|
}
|
||||||
|
|
||||||
SigningResult Context::signingResult() const
|
SigningResult Context::signingResult() const
|
||||||
@ -1335,6 +1357,21 @@ static gpgme_encrypt_flags_t encryptflags2encryptflags(Context::EncryptionFlags
|
|||||||
if (flags & Context::Symmetric) {
|
if (flags & Context::Symmetric) {
|
||||||
result |= GPGME_ENCRYPT_SYMMETRIC;
|
result |= GPGME_ENCRYPT_SYMMETRIC;
|
||||||
}
|
}
|
||||||
|
if (flags & Context::ThrowKeyIds) {
|
||||||
|
result |= GPGME_ENCRYPT_THROW_KEYIDS;
|
||||||
|
}
|
||||||
|
if (flags & Context::EncryptWrap) {
|
||||||
|
result |= GPGME_ENCRYPT_WRAP;
|
||||||
|
}
|
||||||
|
if (flags & Context::WantAddress) {
|
||||||
|
result |= GPGME_ENCRYPT_WANT_ADDRESS;
|
||||||
|
}
|
||||||
|
if (flags & Context::EncryptArchive) {
|
||||||
|
result |= GPGME_ENCRYPT_ARCHIVE;
|
||||||
|
}
|
||||||
|
if (flags & Context::EncryptFile) {
|
||||||
|
result |= GPGME_ENCRYPT_FILE;
|
||||||
|
}
|
||||||
return static_cast<gpgme_encrypt_flags_t>(result);
|
return static_cast<gpgme_encrypt_flags_t>(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1765,6 +1802,16 @@ Error Context::startRevokeSignature(const Key &key, const Key &signingKey,
|
|||||||
key.impl(), signingKey.impl(), uids.c_str(), flags));
|
key.impl(), signingKey.impl(), uids.c_str(), flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Error Context::addAdsk(const Key &k, const char *adsk)
|
||||||
|
{
|
||||||
|
return Error(d->lasterr = gpgme_op_createsubkey(d->ctx, k.impl(), adsk, 0, 0, GPGME_CREATE_ADSK));
|
||||||
|
}
|
||||||
|
|
||||||
|
Error Context::startAddAdsk(const Key &k, const char *adsk)
|
||||||
|
{
|
||||||
|
return Error(d->lasterr = gpgme_op_createsubkey_start(d->ctx, k.impl(), adsk, 0, 0, GPGME_CREATE_ADSK));
|
||||||
|
}
|
||||||
|
|
||||||
Error Context::setFlag(const char *name, const char *value)
|
Error Context::setFlag(const char *name, const char *value)
|
||||||
{
|
{
|
||||||
return Error(d->lasterr = gpgme_set_ctx_flag(d->ctx, name, value));
|
return Error(d->lasterr = gpgme_set_ctx_flag(d->ctx, name, value));
|
||||||
@ -1886,7 +1933,8 @@ std::ostream &operator<<(std::ostream &os, KeyListMode mode)
|
|||||||
std::ostream &operator<<(std::ostream &os, SignatureMode mode)
|
std::ostream &operator<<(std::ostream &os, SignatureMode mode)
|
||||||
{
|
{
|
||||||
os << "GpgME::SignatureMode(";
|
os << "GpgME::SignatureMode(";
|
||||||
switch (mode) {
|
#undef CHECK
|
||||||
|
switch (mode & (NormalSignatureMode|Detached|Clearsigned)) {
|
||||||
#define CHECK( x ) case x: os << #x; break
|
#define CHECK( x ) case x: os << #x; break
|
||||||
CHECK(NormalSignatureMode);
|
CHECK(NormalSignatureMode);
|
||||||
CHECK(Detached);
|
CHECK(Detached);
|
||||||
@ -1896,6 +1944,10 @@ std::ostream &operator<<(std::ostream &os, SignatureMode mode)
|
|||||||
os << "???" "(" << static_cast<int>(mode) << ')';
|
os << "???" "(" << static_cast<int>(mode) << ')';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#define CHECK( x ) if ( !(mode & (x)) ) {} else do { os << #x " "; } while (0)
|
||||||
|
CHECK(SignArchive);
|
||||||
|
CHECK(SignFile);
|
||||||
|
#undef CHECK
|
||||||
return os << ')';
|
return os << ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1909,6 +1961,11 @@ std::ostream &operator<<(std::ostream &os, Context::EncryptionFlags flags)
|
|||||||
CHECK(ExpectSign);
|
CHECK(ExpectSign);
|
||||||
CHECK(NoCompress);
|
CHECK(NoCompress);
|
||||||
CHECK(Symmetric);
|
CHECK(Symmetric);
|
||||||
|
CHECK(ThrowKeyIds);
|
||||||
|
CHECK(EncryptWrap);
|
||||||
|
CHECK(WantAddress);
|
||||||
|
CHECK(EncryptArchive);
|
||||||
|
CHECK(EncryptFile);
|
||||||
#undef CHECK
|
#undef CHECK
|
||||||
return os << ')';
|
return os << ')';
|
||||||
}
|
}
|
||||||
|
@ -324,6 +324,9 @@ public:
|
|||||||
Error startRevokeSignature(const Key &key, const Key &signingKey,
|
Error startRevokeSignature(const Key &key, const Key &signingKey,
|
||||||
const std::vector<UserID> &userIds = std::vector<UserID>());
|
const std::vector<UserID> &userIds = std::vector<UserID>());
|
||||||
|
|
||||||
|
Error addAdsk(const Key &k, const char *adsk);
|
||||||
|
Error startAddAdsk(const Key &k, const char *adsk);
|
||||||
|
|
||||||
// using TofuInfo::Policy
|
// using TofuInfo::Policy
|
||||||
Error setTofuPolicy(const Key &k, unsigned int policy);
|
Error setTofuPolicy(const Key &k, unsigned int policy);
|
||||||
Error setTofuPolicyStart(const Key &k, unsigned int policy);
|
Error setTofuPolicyStart(const Key &k, unsigned int policy);
|
||||||
@ -370,6 +373,7 @@ public:
|
|||||||
// Keep in line with core's flags
|
// Keep in line with core's flags
|
||||||
DecryptNone = 0,
|
DecryptNone = 0,
|
||||||
DecryptVerify = 1,
|
DecryptVerify = 1,
|
||||||
|
DecryptArchive = 2,
|
||||||
DecryptUnwrap = 128,
|
DecryptUnwrap = 128,
|
||||||
DecryptMaxValue = 0x80000000
|
DecryptMaxValue = 0x80000000
|
||||||
};
|
};
|
||||||
@ -447,7 +451,10 @@ public:
|
|||||||
NoCompress = 16,
|
NoCompress = 16,
|
||||||
Symmetric = 32,
|
Symmetric = 32,
|
||||||
ThrowKeyIds = 64,
|
ThrowKeyIds = 64,
|
||||||
EncryptWrap = 128
|
EncryptWrap = 128,
|
||||||
|
WantAddress = 256,
|
||||||
|
EncryptArchive = 512,
|
||||||
|
EncryptFile = 1024
|
||||||
};
|
};
|
||||||
EncryptionResult encrypt(const std::vector<Key> &recipients, const Data &plainText, Data &cipherText, EncryptionFlags flags);
|
EncryptionResult encrypt(const std::vector<Key> &recipients, const Data &plainText, Data &cipherText, EncryptionFlags flags);
|
||||||
GpgME::Error encryptSymmetrically(const Data &plainText, Data &cipherText);
|
GpgME::Error encryptSymmetrically(const Data &plainText, Data &cipherText);
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
context_glib.cpp - wraps a gpgme key context, gpgme-glib-specific functions
|
|
||||||
Copyright (C) 2007 Klarälvdalens Datakonsult AB
|
|
||||||
2016 Bundesamt für Sicherheit in der Informationstechnik
|
|
||||||
Software engineering by Intevation GmbH
|
|
||||||
|
|
||||||
This file is part of GPGME++.
|
|
||||||
|
|
||||||
GPGME++ is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Library General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
GPGME++ 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 Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public License
|
|
||||||
along with GPGME++; see the file COPYING.LIB. If not, write to the
|
|
||||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <global.h>
|
|
||||||
|
|
||||||
extern "C" GIOChannel *gpgme_get_fdptr(int);
|
|
||||||
|
|
||||||
GIOChannel *GpgME::getGIOChannel(int fd)
|
|
||||||
{
|
|
||||||
return gpgme_get_fdptr(fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
QIODevice *GpgME::getQIODevice(int fd)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
context_qt.cpp - wraps a gpgme key context, gpgme-qt-specific functions
|
|
||||||
Copyright (C) 2007 Klarälvdalens Datakonsult AB
|
|
||||||
2016 Bundesamt für Sicherheit in der Informationstechnik
|
|
||||||
Software engineering by Intevation GmbH
|
|
||||||
|
|
||||||
This file is part of GPGME++.
|
|
||||||
|
|
||||||
GPGME++ is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Library General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
GPGME++ 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 Library General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Library General Public License
|
|
||||||
along with GPGME++; see the file COPYING.LIB. If not, write to the
|
|
||||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
||||||
Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <global.h>
|
|
||||||
|
|
||||||
extern "C" QIODevice *gpgme_get_fdptr(int);
|
|
||||||
|
|
||||||
GIOChannel *GpgME::getGIOChannel(int)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
QIODevice *GpgME::getQIODevice(int fd)
|
|
||||||
{
|
|
||||||
return gpgme_get_fdptr(fd);
|
|
||||||
}
|
|
@ -217,6 +217,11 @@ GpgME::Error GpgME::Data::setFileName(const char *name)
|
|||||||
return Error(gpgme_data_set_file_name(d->data, name));
|
return Error(gpgme_data_set_file_name(d->data, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpgME::Error GpgME::Data::setFileName(const std::string &name)
|
||||||
|
{
|
||||||
|
return Error(gpgme_data_set_file_name(d->data, name.c_str()));
|
||||||
|
}
|
||||||
|
|
||||||
ssize_t GpgME::Data::read(void *buffer, size_t length)
|
ssize_t GpgME::Data::read(void *buffer, size_t length)
|
||||||
{
|
{
|
||||||
return gpgme_data_read(d->data, buffer, length);
|
return gpgme_data_read(d->data, buffer, length);
|
||||||
@ -275,3 +280,14 @@ std::string GpgME::Data::toString()
|
|||||||
seek (0, SEEK_SET);
|
seek (0, SEEK_SET);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GpgME::Error GpgME::Data::setFlag(const char *name, const char *value)
|
||||||
|
{
|
||||||
|
return Error(gpgme_data_set_flag(d->data, name, value));
|
||||||
|
}
|
||||||
|
|
||||||
|
GpgME::Error GpgME::Data::setSizeHint(uint64_t size)
|
||||||
|
{
|
||||||
|
const std::string val = std::to_string(size);
|
||||||
|
return Error(gpgme_data_set_flag(d->data, "size-hint", val.c_str()));
|
||||||
|
}
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "key.h"
|
#include "key.h"
|
||||||
|
|
||||||
#include <sys/types.h> // for size_t, off_t
|
#include <sys/types.h> // for size_t, off_t
|
||||||
|
#include <cstdint> // unit64_t
|
||||||
#include <cstdio> // FILE
|
#include <cstdio> // FILE
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -60,6 +61,7 @@ public:
|
|||||||
|
|
||||||
static const Null null;
|
static const Null null;
|
||||||
|
|
||||||
|
Data(const Data &other) = default;
|
||||||
const Data &operator=(Data other)
|
const Data &operator=(Data other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
@ -105,6 +107,7 @@ public:
|
|||||||
|
|
||||||
char *fileName() const;
|
char *fileName() const;
|
||||||
Error setFileName(const char *name);
|
Error setFileName(const char *name);
|
||||||
|
Error setFileName(const std::string &name);
|
||||||
|
|
||||||
ssize_t read(void *buffer, size_t length);
|
ssize_t read(void *buffer, size_t length);
|
||||||
ssize_t write(const void *buffer, size_t length);
|
ssize_t write(const void *buffer, size_t length);
|
||||||
@ -120,6 +123,12 @@ public:
|
|||||||
/** Return a copy of the data as std::string. Sets seek pos to 0 */
|
/** Return a copy of the data as std::string. Sets seek pos to 0 */
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
|
/** See gpgme_data_set_flag */
|
||||||
|
Error setFlag(const char *name, const char *value);
|
||||||
|
|
||||||
|
/** Set a size hint for this data e.g. for progress calculations. */
|
||||||
|
Error setSizeHint(uint64_t size);
|
||||||
|
|
||||||
class Private;
|
class Private;
|
||||||
Private *impl()
|
Private *impl()
|
||||||
{
|
{
|
||||||
|
@ -122,6 +122,11 @@ bool GpgME::DecryptionResult::isDeVs() const
|
|||||||
return d && d->res.is_de_vs;
|
return d && d->res.is_de_vs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GpgME::DecryptionResult::isMime() const
|
||||||
|
{
|
||||||
|
return d && d->res.is_mime;
|
||||||
|
}
|
||||||
|
|
||||||
const char *GpgME::DecryptionResult::fileName() const
|
const char *GpgME::DecryptionResult::fileName() const
|
||||||
{
|
{
|
||||||
return d ? d->res.file_name : nullptr ;
|
return d ? d->res.file_name : nullptr ;
|
||||||
|
@ -47,6 +47,7 @@ public:
|
|||||||
DecryptionResult(gpgme_ctx_t ctx, const Error &err);
|
DecryptionResult(gpgme_ctx_t ctx, const Error &err);
|
||||||
explicit DecryptionResult(const Error &err);
|
explicit DecryptionResult(const Error &err);
|
||||||
|
|
||||||
|
DecryptionResult(const DecryptionResult &other) = default;
|
||||||
const DecryptionResult &operator=(DecryptionResult other)
|
const DecryptionResult &operator=(DecryptionResult other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
@ -74,6 +75,7 @@ public:
|
|||||||
}
|
}
|
||||||
bool isWrongKeyUsage() const;
|
bool isWrongKeyUsage() const;
|
||||||
bool isDeVs() const;
|
bool isDeVs() const;
|
||||||
|
bool isMime() const;
|
||||||
|
|
||||||
const char *fileName() const;
|
const char *fileName() const;
|
||||||
|
|
||||||
@ -103,6 +105,7 @@ public:
|
|||||||
Recipient();
|
Recipient();
|
||||||
explicit Recipient(gpgme_recipient_t reci);
|
explicit Recipient(gpgme_recipient_t reci);
|
||||||
|
|
||||||
|
Recipient(const Recipient &other) = default;
|
||||||
const Recipient &operator=(Recipient other)
|
const Recipient &operator=(Recipient other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
|
|
||||||
DefaultAssuanTransaction::DefaultAssuanTransaction()
|
DefaultAssuanTransaction::DefaultAssuanTransaction()
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#ifndef __GPGMEPP_DEFAULTASSUANTRANSACTION_H__
|
#ifndef __GPGMEPP_DEFAULTASSUANTRANSACTION_H__
|
||||||
#define __GPGMEPP_DEFAULTASSUANTRANSACTION_H__
|
#define __GPGMEPP_DEFAULTASSUANTRANSACTION_H__
|
||||||
|
|
||||||
#include <interfaces/assuantransaction.h>
|
#include "interfaces/assuantransaction.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -52,6 +52,7 @@ using namespace GpgME;
|
|||||||
|
|
||||||
static const char *status_to_string(unsigned int status);
|
static const char *status_to_string(unsigned int status);
|
||||||
static Error status_to_error(unsigned int status);
|
static Error status_to_error(unsigned int status);
|
||||||
|
static Error parse_sc_op_failure(const char *args);
|
||||||
|
|
||||||
class EditInteractor::Private
|
class EditInteractor::Private
|
||||||
{
|
{
|
||||||
@ -96,7 +97,19 @@ public:
|
|||||||
|
|
||||||
// advance to next state based on input:
|
// advance to next state based on input:
|
||||||
const unsigned int oldState = ei->state;
|
const unsigned int oldState = ei->state;
|
||||||
ei->state = ei->q->nextState(status, args, err);
|
|
||||||
|
if (ei->q->needsNoResponse(status)) {
|
||||||
|
// keep state
|
||||||
|
} else if (status == GPGME_STATUS_ERROR) {
|
||||||
|
err = ei->q->parseStatusError(args);
|
||||||
|
ei->state = EditInteractor::ErrorState;
|
||||||
|
} else if (status == GPGME_STATUS_SC_OP_FAILURE) {
|
||||||
|
err = parse_sc_op_failure(args);
|
||||||
|
ei->state = EditInteractor::ErrorState;
|
||||||
|
} else {
|
||||||
|
ei->state = ei->q->nextState(status, args, err);
|
||||||
|
}
|
||||||
|
|
||||||
if (ei->debug) {
|
if (ei->debug) {
|
||||||
std::fprintf(ei->debug, "EditInteractor: %u -> nextState( %s, %s ) -> %u\n",
|
std::fprintf(ei->debug, "EditInteractor: %u -> nextState( %s, %s ) -> %u\n",
|
||||||
oldState, status_to_string(status), args ? args : "<null>", ei->state);
|
oldState, status_to_string(status), args ? args : "<null>", ei->state);
|
||||||
@ -125,7 +138,7 @@ public:
|
|||||||
if (writeAll(fd, result, len) != len) {
|
if (writeAll(fd, result, len) != len) {
|
||||||
err = Error::fromSystemError();
|
err = Error::fromSystemError();
|
||||||
if (ei->debug) {
|
if (ei->debug) {
|
||||||
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asString());
|
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asStdString().c_str());
|
||||||
}
|
}
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -134,7 +147,7 @@ public:
|
|||||||
if (writeAll(fd, "\n", 1) != 1) {
|
if (writeAll(fd, "\n", 1) != 1) {
|
||||||
err = Error::fromSystemError();
|
err = Error::fromSystemError();
|
||||||
if (ei->debug) {
|
if (ei->debug) {
|
||||||
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asString());
|
std::fprintf(ei->debug, "EditInteractor: Could not write to fd %d (%s)\n", fd, err.asStdString().c_str());
|
||||||
}
|
}
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -271,6 +284,38 @@ GpgME::Error EditInteractor::parseStatusError(const char *args)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Error sc_op_failure_to_error(unsigned int status)
|
||||||
|
{
|
||||||
|
switch (status) {
|
||||||
|
case 1:
|
||||||
|
// GPG_ERR_CANCELED or GPG_ERR_FULLY_CANCELED
|
||||||
|
return Error::fromCode(GPG_ERR_CANCELED);
|
||||||
|
case 2:
|
||||||
|
// GPG_ERR_BAD_PIN or GPG_ERR_BAD_RESET_CODE [sic]
|
||||||
|
return Error::fromCode(GPG_ERR_BAD_PIN);
|
||||||
|
case 3:
|
||||||
|
return Error::fromCode(GPG_ERR_PIN_BLOCKED);
|
||||||
|
case 4:
|
||||||
|
return Error::fromCode(GPG_ERR_NO_RESET_CODE);
|
||||||
|
}
|
||||||
|
return Error::fromCode(GPG_ERR_CARD);
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
Error parse_sc_op_failure(const char *args)
|
||||||
|
{
|
||||||
|
Error err;
|
||||||
|
|
||||||
|
const auto fields = split(args, ' ');
|
||||||
|
if (fields.size() >= 1) {
|
||||||
|
err = sc_op_failure_to_error(static_cast<unsigned int>(std::stoul(fields[0])));
|
||||||
|
} else {
|
||||||
|
err = Error::fromCode(GPG_ERR_CARD);
|
||||||
|
}
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
static const char *const status_strings[] = {
|
static const char *const status_strings[] = {
|
||||||
"EOF",
|
"EOF",
|
||||||
/* mkstatus processing starts here */
|
/* mkstatus processing starts here */
|
||||||
|
@ -48,6 +48,7 @@ public:
|
|||||||
EncryptionResult(gpgme_ctx_t ctx, const Error &error);
|
EncryptionResult(gpgme_ctx_t ctx, const Error &error);
|
||||||
EncryptionResult(const Error &err);
|
EncryptionResult(const Error &err);
|
||||||
|
|
||||||
|
EncryptionResult(const EncryptionResult &other) = default;
|
||||||
const EncryptionResult &operator=(EncryptionResult other)
|
const EncryptionResult &operator=(EncryptionResult other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
@ -83,6 +84,7 @@ class GPGMEPP_EXPORT InvalidRecipient
|
|||||||
public:
|
public:
|
||||||
InvalidRecipient();
|
InvalidRecipient();
|
||||||
|
|
||||||
|
InvalidRecipient(const InvalidRecipient &other) = default;
|
||||||
const InvalidRecipient &operator=(InvalidRecipient other)
|
const InvalidRecipient &operator=(InvalidRecipient other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -69,6 +69,76 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator < (const Version& other) const
|
||||||
|
{
|
||||||
|
if (major > other.major ||
|
||||||
|
(major == other.major && minor > other.minor) ||
|
||||||
|
(major == other.major && minor == other.minor && patch > other.patch) ||
|
||||||
|
(major >= other.major && minor >= other.minor && patch >= other.patch)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator < (const char* other) const
|
||||||
|
{
|
||||||
|
return operator<(Version(other));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator <= (const Version &other) const
|
||||||
|
{
|
||||||
|
return !operator>(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator <= (const char *other) const
|
||||||
|
{
|
||||||
|
return operator<=(Version(other));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator > (const char* other) const
|
||||||
|
{
|
||||||
|
return operator>(Version(other));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator > (const Version & other) const
|
||||||
|
{
|
||||||
|
return !operator<(other) && !operator==(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator >= (const Version &other) const
|
||||||
|
{
|
||||||
|
return !operator<(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator >= (const char *other) const
|
||||||
|
{
|
||||||
|
return operator>=(Version(other));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator == (const Version& other) const
|
||||||
|
{
|
||||||
|
return major == other.major
|
||||||
|
&& minor == other.minor
|
||||||
|
&& patch == other.patch;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator == (const char* other) const
|
||||||
|
{
|
||||||
|
return operator==(Version(other));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator != (const Version &other) const
|
||||||
|
{
|
||||||
|
return !operator==(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator != (const char *other) const
|
||||||
|
{
|
||||||
|
return operator!=(Version(other));
|
||||||
|
}
|
||||||
|
|
||||||
|
// the non-const overloads of the comparison operators are kept for
|
||||||
|
// binary compatibility
|
||||||
bool operator < (const Version& other)
|
bool operator < (const Version& other)
|
||||||
{
|
{
|
||||||
if (major > other.major ||
|
if (major > other.major ||
|
||||||
@ -151,6 +221,7 @@ public:
|
|||||||
EngineInfo();
|
EngineInfo();
|
||||||
explicit EngineInfo(gpgme_engine_info_t engine);
|
explicit EngineInfo(gpgme_engine_info_t engine);
|
||||||
|
|
||||||
|
EngineInfo(const EngineInfo &other) = default;
|
||||||
const EngineInfo &operator=(EngineInfo other)
|
const EngineInfo &operator=(EngineInfo other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -47,7 +47,11 @@ public:
|
|||||||
explicit Error(unsigned int e) : mErr(e), mMessage() {}
|
explicit Error(unsigned int e) : mErr(e), mMessage() {}
|
||||||
|
|
||||||
const char *source() const;
|
const char *source() const;
|
||||||
const char *asString() const;
|
/* This function is deprecated. Use asStdString() instead. asString() may
|
||||||
|
* return wrongly encoded (i.e. not UTF-8) results on Windows for the main
|
||||||
|
* thread if the function was first called from a secondary thread. */
|
||||||
|
GPGMEPP_DEPRECATED const char *asString() const;
|
||||||
|
std::string asStdString() const;
|
||||||
|
|
||||||
int code() const;
|
int code() const;
|
||||||
int sourceID() const;
|
int sourceID() const;
|
||||||
|
@ -74,7 +74,13 @@ enum KeyListMode {
|
|||||||
KeyListModeMask = 0x3ff
|
KeyListModeMask = 0x3ff
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SignatureMode { NormalSignatureMode, Detached, Clearsigned };
|
enum SignatureMode {
|
||||||
|
NormalSignatureMode = 0,
|
||||||
|
Detached = 1,
|
||||||
|
Clearsigned = 2,
|
||||||
|
SignArchive = 4,
|
||||||
|
SignFile = 8,
|
||||||
|
};
|
||||||
|
|
||||||
enum class RevocationReason {
|
enum class RevocationReason {
|
||||||
Unspecified = 0,
|
Unspecified = 0,
|
||||||
@ -103,7 +109,7 @@ homedir, sysconfdir, bindir, libexecdir, libdir,
|
|||||||
datadir, localedir, agent-socket, agent-ssh-socket,
|
datadir, localedir, agent-socket, agent-ssh-socket,
|
||||||
dirmngr-socket, uiserver-socket, gpgconf-name, gpg-name,
|
dirmngr-socket, uiserver-socket, gpgconf-name, gpg-name,
|
||||||
gpgsm-name, g13-name, keyboxd-name, agent-name, scdaemon-name,
|
gpgsm-name, g13-name, keyboxd-name, agent-name, scdaemon-name,
|
||||||
dirmngr-name, pinentry-name, socketdir.
|
dirmngr-name, pinentry-name, socketdir, gpg-wks-client-name, gpgtar-name.
|
||||||
|
|
||||||
This may be extended in the future.
|
This may be extended in the future.
|
||||||
*/
|
*/
|
||||||
|
@ -105,10 +105,6 @@ unsigned int GpgAddExistingSubkeyEditInteractor::Private::nextState(unsigned int
|
|||||||
static const Error NO_KEY_ERROR = Error::fromCode(GPG_ERR_NO_KEY);
|
static const Error NO_KEY_ERROR = Error::fromCode(GPG_ERR_NO_KEY);
|
||||||
static const Error INV_TIME_ERROR = Error::fromCode(GPG_ERR_INV_TIME);
|
static const Error INV_TIME_ERROR = Error::fromCode(GPG_ERR_INV_TIME);
|
||||||
|
|
||||||
if (q->needsNoResponse(status)) {
|
|
||||||
return q->state();
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (q->state()) {
|
switch (q->state()) {
|
||||||
case START:
|
case START:
|
||||||
if (status == GPGME_STATUS_GET_LINE &&
|
if (status == GPGME_STATUS_GET_LINE &&
|
||||||
@ -136,7 +132,7 @@ unsigned int GpgAddExistingSubkeyEditInteractor::Private::nextState(unsigned int
|
|||||||
strcmp(args, "keygen.flags") == 0) {
|
strcmp(args, "keygen.flags") == 0) {
|
||||||
return FLAGS;
|
return FLAGS;
|
||||||
} else if (status == GPGME_STATUS_GET_LINE &&
|
} else if (status == GPGME_STATUS_GET_LINE &&
|
||||||
strcmp(args, "keygen.keygrip")) {
|
strcmp(args, "keygen.keygrip") == 0) {
|
||||||
err = NO_KEY_ERROR;
|
err = NO_KEY_ERROR;
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
@ -157,7 +153,7 @@ unsigned int GpgAddExistingSubkeyEditInteractor::Private::nextState(unsigned int
|
|||||||
strcmp(args, "keyedit.prompt") == 0) {
|
strcmp(args, "keyedit.prompt") == 0) {
|
||||||
return QUIT;
|
return QUIT;
|
||||||
} else if (status == GPGME_STATUS_GET_LINE &&
|
} else if (status == GPGME_STATUS_GET_LINE &&
|
||||||
strcmp(args, "keygen.valid")) {
|
strcmp(args, "keygen.valid") == 0) {
|
||||||
err = INV_TIME_ERROR;
|
err = INV_TIME_ERROR;
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
@ -120,10 +120,6 @@ unsigned int GpgAddUserIDEditInteractor::nextState(unsigned int status, const ch
|
|||||||
static const Error INV_EMAIL_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID);
|
static const Error INV_EMAIL_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID);
|
||||||
static const Error INV_COMMENT_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID);
|
static const Error INV_COMMENT_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID);
|
||||||
|
|
||||||
if (needsNoResponse(status)) {
|
|
||||||
return state();
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace GpgAddUserIDEditInteractor_Private;
|
using namespace GpgAddUserIDEditInteractor_Private;
|
||||||
|
|
||||||
switch (state()) {
|
switch (state()) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#ifndef __GPGMEPP_GPGADDUSERIDEDITINTERACTOR_H__
|
#ifndef __GPGMEPP_GPGADDUSERIDEDITINTERACTOR_H__
|
||||||
#define __GPGMEPP_GPGADDUSERIDEDITINTERACTOR_H__
|
#define __GPGMEPP_GPGADDUSERIDEDITINTERACTOR_H__
|
||||||
|
|
||||||
#include <editinteractor.h>
|
#include "editinteractor.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
|
|
||||||
GpgAgentGetInfoAssuanTransaction::GpgAgentGetInfoAssuanTransaction(InfoItem item)
|
GpgAgentGetInfoAssuanTransaction::GpgAgentGetInfoAssuanTransaction(InfoItem item)
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#ifndef __GPGMEPP_GPGAGENTGETINFOASSUANTRANSACTION_H__
|
#ifndef __GPGMEPP_GPGAGENTGETINFOASSUANTRANSACTION_H__
|
||||||
#define __GPGMEPP_GPGAGENTGETINFOASSUANTRANSACTION_H__
|
#define __GPGMEPP_GPGAGENTGETINFOASSUANTRANSACTION_H__
|
||||||
|
|
||||||
#include <interfaces/assuantransaction.h>
|
#include "interfaces/assuantransaction.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -36,16 +36,17 @@ using namespace GpgME;
|
|||||||
class GpgGenCardKeyInteractor::Private
|
class GpgGenCardKeyInteractor::Private
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Private() : keysize("2048"), backup(false), algo(RSA)
|
Private() : keysize("2048")
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string name, email, backupFileName, expiry, serial, keysize;
|
std::string name, email, backupFileName, expiry, serial, keysize;
|
||||||
bool backup;
|
bool backup = false;
|
||||||
Algo algo;
|
Algo algo = RSA;
|
||||||
|
std::string curve;
|
||||||
};
|
};
|
||||||
|
|
||||||
GpgGenCardKeyInteractor::~GpgGenCardKeyInteractor() {}
|
GpgGenCardKeyInteractor::~GpgGenCardKeyInteractor() = default;
|
||||||
|
|
||||||
GpgGenCardKeyInteractor::GpgGenCardKeyInteractor(const std::string &serial):
|
GpgGenCardKeyInteractor::GpgGenCardKeyInteractor(const std::string &serial):
|
||||||
d(new Private)
|
d(new Private)
|
||||||
@ -88,6 +89,15 @@ void GpgGenCardKeyInteractor::setAlgo(Algo algo)
|
|||||||
d->algo = algo;
|
d->algo = algo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GpgGenCardKeyInteractor::setCurve(Curve curve)
|
||||||
|
{
|
||||||
|
if (curve == DefaultCurve) {
|
||||||
|
d->curve.clear();
|
||||||
|
} else if (curve >= 1 && curve <= LastCurve) {
|
||||||
|
d->curve = std::to_string(static_cast<int>(curve));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namespace GpgGenCardKeyInteractor_Private
|
namespace GpgGenCardKeyInteractor_Private
|
||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
@ -141,7 +151,7 @@ const char *GpgGenCardKeyInteractor::action(Error &err) const
|
|||||||
case KEY_CURVE1:
|
case KEY_CURVE1:
|
||||||
case KEY_CURVE2:
|
case KEY_CURVE2:
|
||||||
case KEY_CURVE3:
|
case KEY_CURVE3:
|
||||||
return "1"; // Only cv25519 supported.
|
return d->curve.empty() ? "1" : d->curve.c_str(); // default is Curve25519
|
||||||
case NAME:
|
case NAME:
|
||||||
return d->name.c_str();
|
return d->name.c_str();
|
||||||
case EMAIL:
|
case EMAIL:
|
||||||
@ -182,10 +192,6 @@ unsigned int GpgGenCardKeyInteractor::nextState(unsigned int status, const char
|
|||||||
static const Error INV_EMAIL_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID);
|
static const Error INV_EMAIL_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID);
|
||||||
static const Error INV_COMMENT_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID);
|
static const Error INV_COMMENT_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID);
|
||||||
|
|
||||||
if (needsNoResponse(status)) {
|
|
||||||
return state();
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace GpgGenCardKeyInteractor_Private;
|
using namespace GpgGenCardKeyInteractor_Private;
|
||||||
|
|
||||||
switch (state()) {
|
switch (state()) {
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#ifndef __GPGMEPP_GPGGENCARDKEYEDITINTERACTOR_H__
|
#ifndef __GPGMEPP_GPGGENCARDKEYEDITINTERACTOR_H__
|
||||||
#define __GPGMEPP_GPGGENCARDKEYEDITINTERACTOR_H__
|
#define __GPGMEPP_GPGGENCARDKEYEDITINTERACTOR_H__
|
||||||
|
|
||||||
#include <editinteractor.h>
|
#include "editinteractor.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -58,10 +58,27 @@ public:
|
|||||||
|
|
||||||
enum Algo {
|
enum Algo {
|
||||||
RSA = 1,
|
RSA = 1,
|
||||||
ECC = 2
|
ECC = 2,
|
||||||
};
|
};
|
||||||
void setAlgo(Algo algo);
|
void setAlgo(Algo algo);
|
||||||
|
|
||||||
|
// the enum values minus 1 have to match the indexes of the curves used by
|
||||||
|
// ask_curve() in gnupg's g10/keygen.c
|
||||||
|
enum Curve {
|
||||||
|
DefaultCurve = 0, // currently Curve25519
|
||||||
|
Curve25519 = 1,
|
||||||
|
Curve448,
|
||||||
|
NISTP256,
|
||||||
|
NISTP384,
|
||||||
|
NISTP521,
|
||||||
|
BrainpoolP256,
|
||||||
|
BrainpoolP384,
|
||||||
|
BrainpoolP512,
|
||||||
|
Secp256k1,
|
||||||
|
LastCurve = Secp256k1,
|
||||||
|
};
|
||||||
|
void setCurve(Curve curve);
|
||||||
|
|
||||||
std::string backupFileName() const;
|
std::string backupFileName() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -75,4 +75,7 @@ typedef struct _gpgme_tofu_info *gpgme_tofu_info_t;
|
|||||||
struct _gpgme_op_query_swdb_result;
|
struct _gpgme_op_query_swdb_result;
|
||||||
typedef struct _gpgme_op_query_swdb_result *gpgme_query_swdb_result_t;
|
typedef struct _gpgme_op_query_swdb_result *gpgme_query_swdb_result_t;
|
||||||
|
|
||||||
|
struct _gpgme_revocation_key;
|
||||||
|
typedef struct _gpgme_revocation_key *gpgme_revocation_key_t;
|
||||||
|
|
||||||
#endif // __GPGMEPP_GPGMEFW_H__
|
#endif // __GPGMEPP_GPGMEFW_H__
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
#include <gpgme.h>
|
#include <gpgme.h>
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
// avoid conflict (msvc)
|
// avoid conflict (msvc)
|
||||||
@ -112,14 +111,6 @@ unsigned int GpgRevokeKeyEditInteractor::Private::nextState(unsigned int status,
|
|||||||
|
|
||||||
static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL);
|
static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL);
|
||||||
|
|
||||||
if (q->needsNoResponse(status)) {
|
|
||||||
return q->state();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status == GPGME_STATUS_ERROR) {
|
|
||||||
err = q->parseStatusError(args);
|
|
||||||
return ERROR;
|
|
||||||
}
|
|
||||||
switch (const auto state = q->state()) {
|
switch (const auto state = q->state()) {
|
||||||
case START:
|
case START:
|
||||||
if (status == GPGME_STATUS_GET_LINE &&
|
if (status == GPGME_STATUS_GET_LINE &&
|
||||||
@ -146,7 +137,7 @@ unsigned int GpgRevokeKeyEditInteractor::Private::nextState(unsigned int status,
|
|||||||
if (status == GPGME_STATUS_GET_LINE &&
|
if (status == GPGME_STATUS_GET_LINE &&
|
||||||
strcmp(args, "ask_revocation_reason.text") == 0) {
|
strcmp(args, "ask_revocation_reason.text") == 0) {
|
||||||
nextLine++;
|
nextLine++;
|
||||||
return nextLine < reasonLines.size() ? REASON_TEXT : REASON_TEXT_DONE;
|
return static_cast<std::size_t>(nextLine) < reasonLines.size() ? REASON_TEXT : REASON_TEXT_DONE;
|
||||||
}
|
}
|
||||||
err = GENERAL_ERROR;
|
err = GENERAL_ERROR;
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -155,7 +146,7 @@ unsigned int GpgRevokeKeyEditInteractor::Private::nextState(unsigned int status,
|
|||||||
if (status == GPGME_STATUS_GET_LINE &&
|
if (status == GPGME_STATUS_GET_LINE &&
|
||||||
strcmp(args, "ask_revocation_reason.text") == 0) {
|
strcmp(args, "ask_revocation_reason.text") == 0) {
|
||||||
nextLine++;
|
nextLine++;
|
||||||
return nextLine < reasonLines.size() ? state + 1 : REASON_TEXT_DONE;
|
return static_cast<std::size_t>(nextLine) < reasonLines.size() ? state + 1 : REASON_TEXT_DONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = GENERAL_ERROR;
|
err = GENERAL_ERROR;
|
||||||
|
@ -94,10 +94,6 @@ unsigned int GpgSetExpiryTimeEditInteractor::nextState(unsigned int status, cons
|
|||||||
static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL);
|
static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL);
|
||||||
static const Error INV_TIME_ERROR = Error::fromCode(GPG_ERR_INV_TIME);
|
static const Error INV_TIME_ERROR = Error::fromCode(GPG_ERR_INV_TIME);
|
||||||
|
|
||||||
if (needsNoResponse(status)) {
|
|
||||||
return state();
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace GpgSetExpiryTimeEditInteractor_Private;
|
using namespace GpgSetExpiryTimeEditInteractor_Private;
|
||||||
|
|
||||||
switch (state()) {
|
switch (state()) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#ifndef __GPGMEPP_GPGSETEXPIRYTIMEEDITINTERACTOR_H__
|
#ifndef __GPGMEPP_GPGSETEXPIRYTIMEEDITINTERACTOR_H__
|
||||||
#define __GPGMEPP_GPGSETEXPIRYTIMEEDITINTERACTOR_H__
|
#define __GPGMEPP_GPGSETEXPIRYTIMEEDITINTERACTOR_H__
|
||||||
|
|
||||||
#include <editinteractor.h>
|
#include "editinteractor.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -98,10 +98,6 @@ unsigned int GpgSetOwnerTrustEditInteractor::nextState(unsigned int status, cons
|
|||||||
static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL);
|
static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL);
|
||||||
//static const Error INV_TIME_ERROR = Error::fromCode( GPG_ERR_INV_TIME );
|
//static const Error INV_TIME_ERROR = Error::fromCode( GPG_ERR_INV_TIME );
|
||||||
|
|
||||||
if (needsNoResponse(status)) {
|
|
||||||
return state();
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace GpgSetOwnerTrustEditInteractor_Private;
|
using namespace GpgSetOwnerTrustEditInteractor_Private;
|
||||||
|
|
||||||
switch (state()) {
|
switch (state()) {
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
#ifndef __GPGMEPP_GPGSETOWNERTRUSTEDITINTERACTOR_H__
|
#ifndef __GPGMEPP_GPGSETOWNERTRUSTEDITINTERACTOR_H__
|
||||||
#define __GPGMEPP_GPGSETOWNERTRUSTEDITINTERACTOR_H__
|
#define __GPGMEPP_GPGSETOWNERTRUSTEDITINTERACTOR_H__
|
||||||
|
|
||||||
#include <editinteractor.h>
|
#include "editinteractor.h"
|
||||||
#include <key.h>
|
#include "key.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -170,6 +170,7 @@ enum SignKeyState {
|
|||||||
CONFIRM2,
|
CONFIRM2,
|
||||||
DUPE_OK,
|
DUPE_OK,
|
||||||
DUPE_OK2,
|
DUPE_OK2,
|
||||||
|
REJECT_SIGN_EXPIRED,
|
||||||
QUIT,
|
QUIT,
|
||||||
SAVE,
|
SAVE,
|
||||||
ERROR = EditInteractor::ErrorState
|
ERROR = EditInteractor::ErrorState
|
||||||
@ -193,6 +194,7 @@ static GpgSignKeyEditInteractor_Private::TransitionMap makeTable()
|
|||||||
#define addEntry( s1, status, str, s2 ) tab[std::make_tuple( s1, status, str)] = s2
|
#define addEntry( s1, status, str, s2 ) tab[std::make_tuple( s1, status, str)] = s2
|
||||||
addEntry(START, GET_LINE, "keyedit.prompt", COMMAND);
|
addEntry(START, GET_LINE, "keyedit.prompt", COMMAND);
|
||||||
addEntry(COMMAND, GET_BOOL, "keyedit.sign_all.okay", UIDS_ANSWER_SIGN_ALL);
|
addEntry(COMMAND, GET_BOOL, "keyedit.sign_all.okay", UIDS_ANSWER_SIGN_ALL);
|
||||||
|
addEntry(COMMAND, GET_BOOL, "sign_uid.expired_okay", REJECT_SIGN_EXPIRED);
|
||||||
addEntry(COMMAND, GET_BOOL, "sign_uid.okay", CONFIRM);
|
addEntry(COMMAND, GET_BOOL, "sign_uid.okay", CONFIRM);
|
||||||
addEntry(COMMAND, GET_BOOL, "sign_uid.local_promote_okay", CONFIRM2);
|
addEntry(COMMAND, GET_BOOL, "sign_uid.local_promote_okay", CONFIRM2);
|
||||||
addEntry(COMMAND, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK);
|
addEntry(COMMAND, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK);
|
||||||
@ -228,6 +230,7 @@ static GpgSignKeyEditInteractor_Private::TransitionMap makeTable()
|
|||||||
addEntry(DUPE_OK, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK2);
|
addEntry(DUPE_OK, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK2);
|
||||||
addEntry(DUPE_OK2, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK);
|
addEntry(DUPE_OK2, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK);
|
||||||
addEntry(CONFIRM, GET_LINE, "keyedit.prompt", QUIT);
|
addEntry(CONFIRM, GET_LINE, "keyedit.prompt", QUIT);
|
||||||
|
addEntry(REJECT_SIGN_EXPIRED, GET_LINE, "keyedit.prompt", QUIT);
|
||||||
addEntry(ERROR, GET_LINE, "keyedit.prompt", QUIT);
|
addEntry(ERROR, GET_LINE, "keyedit.prompt", QUIT);
|
||||||
addEntry(QUIT, GET_BOOL, "keyedit.save.okay", SAVE);
|
addEntry(QUIT, GET_BOOL, "keyedit.save.okay", SAVE);
|
||||||
#undef addEntry
|
#undef addEntry
|
||||||
@ -263,6 +266,9 @@ const char *GpgSignKeyEditInteractor::action(Error &err) const
|
|||||||
case CONFIRM2:
|
case CONFIRM2:
|
||||||
case CONFIRM:
|
case CONFIRM:
|
||||||
return answer(true);
|
return answer(true);
|
||||||
|
case REJECT_SIGN_EXPIRED:
|
||||||
|
err = Error::fromCode(GPG_ERR_KEY_EXPIRED);
|
||||||
|
return answer(false);
|
||||||
case QUIT:
|
case QUIT:
|
||||||
return "quit";
|
return "quit";
|
||||||
case SAVE:
|
case SAVE:
|
||||||
@ -298,9 +304,6 @@ unsigned int GpgSignKeyEditInteractor::nextState(unsigned int status, const char
|
|||||||
static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL);
|
static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL);
|
||||||
//static const Error INV_TIME_ERROR = Error::fromCode( GPG_ERR_INV_TIME );
|
//static const Error INV_TIME_ERROR = Error::fromCode( GPG_ERR_INV_TIME );
|
||||||
static const TransitionMap table(makeTable());
|
static const TransitionMap table(makeTable());
|
||||||
if (needsNoResponse(status)) {
|
|
||||||
return state();
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace GpgSignKeyEditInteractor_Private;
|
using namespace GpgSignKeyEditInteractor_Private;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#ifndef __GPGMEPP_GPGSIGNKEYEDITINTERACTOR_H__
|
#ifndef __GPGMEPP_GPGSIGNKEYEDITINTERACTOR_H__
|
||||||
#define __GPGMEPP_GPGSIGNKEYEDITINTERACTOR_H__
|
#define __GPGMEPP_GPGSIGNKEYEDITINTERACTOR_H__
|
||||||
|
|
||||||
#include <editinteractor.h>
|
#include "editinteractor.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -152,17 +152,17 @@ void GpgME::ImportResult::mergeWith(const ImportResult &other)
|
|||||||
}
|
}
|
||||||
// was this key also considered during the first import
|
// was this key also considered during the first import
|
||||||
const auto consideredInFirstImports =
|
const auto consideredInFirstImports =
|
||||||
std::any_of(std::begin(d->imports), std::end(d->imports), [fpr](const auto i) {
|
std::any_of(std::begin(d->imports), std::end(d->imports), [fpr](const gpgme_import_status_t i) {
|
||||||
return i->fpr && !strcmp(i->fpr, fpr);
|
return i->fpr && !strcmp(i->fpr, fpr);
|
||||||
});
|
});
|
||||||
// did we see this key already in the list of keys of the other import
|
// did we see this key already in the list of keys of the other import
|
||||||
const auto consideredInPreviousOtherImports =
|
const auto consideredInPreviousOtherImports =
|
||||||
std::any_of(std::begin(other.d->imports), it, [fpr](const auto i) {
|
std::any_of(std::begin(other.d->imports), it, [fpr](const gpgme_import_status_t i) {
|
||||||
return i->fpr && !strcmp(i->fpr, fpr);
|
return i->fpr && !strcmp(i->fpr, fpr);
|
||||||
});
|
});
|
||||||
// was anything added to this key during the other import
|
// was anything added to this key during the other import
|
||||||
const auto changedInOtherImports =
|
const auto changedInOtherImports =
|
||||||
std::any_of(std::begin(other.d->imports), std::end(other.d->imports), [fpr](const auto i) {
|
std::any_of(std::begin(other.d->imports), std::end(other.d->imports), [fpr](const gpgme_import_status_t i) {
|
||||||
return i->fpr && !strcmp(i->fpr, fpr) && (i->status != 0);
|
return i->fpr && !strcmp(i->fpr, fpr) && (i->status != 0);
|
||||||
});
|
});
|
||||||
if (consideredInFirstImports && !consideredInPreviousOtherImports) {
|
if (consideredInFirstImports && !consideredInPreviousOtherImports) {
|
||||||
@ -177,15 +177,15 @@ void GpgME::ImportResult::mergeWith(const ImportResult &other)
|
|||||||
|
|
||||||
// now do the same for the secret key counts
|
// now do the same for the secret key counts
|
||||||
const auto secretKeyConsideredInFirstImports =
|
const auto secretKeyConsideredInFirstImports =
|
||||||
std::any_of(std::begin(d->imports), std::end(d->imports), [fpr](const auto i) {
|
std::any_of(std::begin(d->imports), std::end(d->imports), [fpr](const gpgme_import_status_t i) {
|
||||||
return i->fpr && !strcmp(i->fpr, fpr) && (i->status & GPGME_IMPORT_SECRET);
|
return i->fpr && !strcmp(i->fpr, fpr) && (i->status & GPGME_IMPORT_SECRET);
|
||||||
});
|
});
|
||||||
const auto secretKeyConsideredInPreviousOtherImports =
|
const auto secretKeyConsideredInPreviousOtherImports =
|
||||||
std::any_of(std::begin(other.d->imports), it, [fpr](const auto i) {
|
std::any_of(std::begin(other.d->imports), it, [fpr](const gpgme_import_status_t i) {
|
||||||
return i->fpr && !strcmp(i->fpr, fpr) && (i->status & GPGME_IMPORT_SECRET);
|
return i->fpr && !strcmp(i->fpr, fpr) && (i->status & GPGME_IMPORT_SECRET);
|
||||||
});
|
});
|
||||||
const auto secretKeyChangedInOtherImports =
|
const auto secretKeyChangedInOtherImports =
|
||||||
std::any_of(std::begin(other.d->imports), std::end(other.d->imports), [fpr](const auto i) {
|
std::any_of(std::begin(other.d->imports), std::end(other.d->imports), [fpr](const gpgme_import_status_t i) {
|
||||||
return i->fpr && !strcmp(i->fpr, fpr) && (i->status & GPGME_IMPORT_SECRET) && (i->status != GPGME_IMPORT_SECRET);
|
return i->fpr && !strcmp(i->fpr, fpr) && (i->status & GPGME_IMPORT_SECRET) && (i->status != GPGME_IMPORT_SECRET);
|
||||||
});
|
});
|
||||||
if (secretKeyConsideredInFirstImports && !secretKeyConsideredInPreviousOtherImports) {
|
if (secretKeyConsideredInFirstImports && !secretKeyConsideredInPreviousOtherImports) {
|
||||||
@ -204,7 +204,7 @@ void GpgME::ImportResult::mergeWith(const ImportResult &other)
|
|||||||
d->imports.reserve(d->imports.size() + other.d->imports.size());
|
d->imports.reserve(d->imports.size() + other.d->imports.size());
|
||||||
std::transform(std::begin(other.d->imports), std::end(other.d->imports),
|
std::transform(std::begin(other.d->imports), std::end(other.d->imports),
|
||||||
std::back_inserter(d->imports),
|
std::back_inserter(d->imports),
|
||||||
[](const auto import) {
|
[](const gpgme_import_status_t import) {
|
||||||
gpgme_import_status_t copy = new _gpgme_import_status{*import};
|
gpgme_import_status_t copy = new _gpgme_import_status{*import};
|
||||||
if (import->fpr) {
|
if (import->fpr) {
|
||||||
copy->fpr = strdup(import->fpr);
|
copy->fpr = strdup(import->fpr);
|
||||||
|
@ -47,6 +47,7 @@ public:
|
|||||||
ImportResult(gpgme_ctx_t ctx, const Error &error);
|
ImportResult(gpgme_ctx_t ctx, const Error &error);
|
||||||
explicit ImportResult(const Error &error);
|
explicit ImportResult(const Error &error);
|
||||||
|
|
||||||
|
ImportResult(const ImportResult &other) = default;
|
||||||
const ImportResult &operator=(ImportResult other)
|
const ImportResult &operator=(ImportResult other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
@ -106,6 +107,7 @@ class GPGMEPP_EXPORT Import
|
|||||||
public:
|
public:
|
||||||
Import();
|
Import();
|
||||||
|
|
||||||
|
Import(const Import &other) = default;
|
||||||
const Import &operator=(Import other)
|
const Import &operator=(Import other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#ifndef __GPGMEPP_INTERFACES_ASSUANTRANSACTION_H__
|
#ifndef __GPGMEPP_INTERFACES_ASSUANTRANSACTION_H__
|
||||||
#define __GPGMEPP_INTERFACES_ASSUANTRANSACTION_H__
|
#define __GPGMEPP_INTERFACES_ASSUANTRANSACTION_H__
|
||||||
|
|
||||||
#include "gpgmepp_export.h"
|
#include "../gpgmepp_export.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "gpgmepp_export.h"
|
#include "../gpgmepp_export.h"
|
||||||
|
|
||||||
#include <gpg-error.h>
|
#include <gpg-error.h>
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#ifndef __GPGMEPP_INTERFACES_STATUSCONSUMER_H__
|
#ifndef __GPGMEPP_INTERFACES_STATUSCONSUMER_H__
|
||||||
#define __GPGMEPP_INTERFACES_STATUSCONSUMER_H__
|
#define __GPGMEPP_INTERFACES_STATUSCONSUMER_H__
|
||||||
|
|
||||||
#include "gpgmepp_export.h"
|
#include "../gpgmepp_export.h"
|
||||||
|
|
||||||
namespace GpgME
|
namespace GpgME
|
||||||
{
|
{
|
||||||
|
@ -122,6 +122,37 @@ std::vector<Subkey> Key::subkeys() const
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RevocationKey Key::revocationKey(unsigned int index) const
|
||||||
|
{
|
||||||
|
return RevocationKey(key, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int Key::numRevocationKeys() const
|
||||||
|
{
|
||||||
|
if (!key) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
unsigned int count = 0;
|
||||||
|
for (auto revkey = key->revocation_keys; revkey; revkey = revkey->next) {
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<RevocationKey> Key::revocationKeys() const
|
||||||
|
{
|
||||||
|
if (!key) {
|
||||||
|
return std::vector<RevocationKey>();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<RevocationKey> v;
|
||||||
|
v.reserve(numRevocationKeys());
|
||||||
|
for (auto revkey = key->revocation_keys; revkey; revkey = revkey->next) {
|
||||||
|
v.push_back(RevocationKey(key, revkey));
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
Key::OwnerTrust Key::ownerTrust() const
|
Key::OwnerTrust Key::ownerTrust() const
|
||||||
{
|
{
|
||||||
if (!key) {
|
if (!key) {
|
||||||
@ -208,17 +239,12 @@ bool Key::canEncrypt() const
|
|||||||
|
|
||||||
bool Key::canSign() const
|
bool Key::canSign() const
|
||||||
{
|
{
|
||||||
#ifndef GPGME_CAN_SIGN_ON_SECRET_OPENPGP_KEYLISTING_NOT_BROKEN
|
return key && key->can_sign;
|
||||||
if (key && key->protocol == GPGME_PROTOCOL_OpenPGP) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return canReallySign();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Key::canReallySign() const
|
bool Key::canReallySign() const
|
||||||
{
|
{
|
||||||
return key && key->can_sign;
|
return canSign();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Key::canCertify() const
|
bool Key::canCertify() const
|
||||||
@ -252,6 +278,26 @@ bool Key::isDeVs() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Key::hasCertify() const
|
||||||
|
{
|
||||||
|
return key && key->has_certify;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Key::hasSign() const
|
||||||
|
{
|
||||||
|
return key && key->has_sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Key::hasEncrypt() const
|
||||||
|
{
|
||||||
|
return key && key->has_encrypt;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Key::hasAuthenticate() const
|
||||||
|
{
|
||||||
|
return key && key->has_authenticate;
|
||||||
|
}
|
||||||
|
|
||||||
const char *Key::issuerSerial() const
|
const char *Key::issuerSerial() const
|
||||||
{
|
{
|
||||||
return key ? key->issuer_serial : nullptr ;
|
return key ? key->issuer_serial : nullptr ;
|
||||||
@ -515,6 +561,21 @@ bool Subkey::canAuthenticate() const
|
|||||||
return subkey && subkey->can_authenticate;
|
return subkey && subkey->can_authenticate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Subkey::canRenc() const
|
||||||
|
{
|
||||||
|
return subkey && subkey->can_renc;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Subkey::canTimestamp() const
|
||||||
|
{
|
||||||
|
return subkey && subkey->can_timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Subkey::isGroupOwned() const
|
||||||
|
{
|
||||||
|
return subkey && subkey->is_group_owned;
|
||||||
|
}
|
||||||
|
|
||||||
bool Subkey::isQualified() const
|
bool Subkey::isQualified() const
|
||||||
{
|
{
|
||||||
return subkey && subkey->is_qualified;
|
return subkey && subkey->is_qualified;
|
||||||
@ -1226,6 +1287,68 @@ bool UserID::Signature::isBad() const
|
|||||||
return isNull() || isExpired() || isInvalid();
|
return isNull() || isExpired() || isInvalid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// class RevocationKey
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
static gpgme_revocation_key_t find_revkey(const shared_gpgme_key_t &key, unsigned int idx)
|
||||||
|
{
|
||||||
|
if (key) {
|
||||||
|
for (gpgme_revocation_key_t s = key->revocation_keys; s; s = s->next, --idx) {
|
||||||
|
if (idx == 0) {
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gpgme_revocation_key_t verify_revkey(const shared_gpgme_key_t &key, gpgme_revocation_key_t revkey)
|
||||||
|
{
|
||||||
|
if (key) {
|
||||||
|
for (gpgme_revocation_key_t s = key->revocation_keys; s; s = s->next) {
|
||||||
|
if (s == revkey) {
|
||||||
|
return revkey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
RevocationKey::RevocationKey() : key(), revkey(nullptr) {}
|
||||||
|
|
||||||
|
RevocationKey::RevocationKey(const shared_gpgme_key_t &k, unsigned int idx)
|
||||||
|
: key(k), revkey(find_revkey(k, idx))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
RevocationKey::RevocationKey(const shared_gpgme_key_t &k, gpgme_revocation_key_t sk)
|
||||||
|
: key(k), revkey(verify_revkey(k, sk))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Key RevocationKey::parent() const
|
||||||
|
{
|
||||||
|
return Key(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *RevocationKey::fingerprint() const
|
||||||
|
{
|
||||||
|
return revkey ? revkey->fpr : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RevocationKey::isSensitive() const
|
||||||
|
{
|
||||||
|
return revkey ? revkey->sensitive : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int RevocationKey::algorithm() const
|
||||||
|
{
|
||||||
|
return revkey ? revkey->pubkey_algo : 0;
|
||||||
|
}
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &os, const UserID &uid)
|
std::ostream &operator<<(std::ostream &os, const UserID &uid)
|
||||||
{
|
{
|
||||||
os << "GpgME::UserID(";
|
os << "GpgME::UserID(";
|
||||||
@ -1261,7 +1384,10 @@ std::ostream &operator<<(std::ostream &os, const Subkey &subkey)
|
|||||||
<< "\n canEncrypt: " << subkey.canEncrypt()
|
<< "\n canEncrypt: " << subkey.canEncrypt()
|
||||||
<< "\n canCertify: " << subkey.canCertify()
|
<< "\n canCertify: " << subkey.canCertify()
|
||||||
<< "\n canAuth: " << subkey.canAuthenticate()
|
<< "\n canAuth: " << subkey.canAuthenticate()
|
||||||
|
<< "\n canRenc: " << subkey.canRenc()
|
||||||
|
<< "\n canTimestanp: " << subkey.canTimestamp()
|
||||||
<< "\n isSecret: " << subkey.isSecret()
|
<< "\n isSecret: " << subkey.isSecret()
|
||||||
|
<< "\n isGroupOwned: " << subkey.isGroupOwned()
|
||||||
<< "\n isQualified: " << subkey.isQualified()
|
<< "\n isQualified: " << subkey.isQualified()
|
||||||
<< "\n isDeVs: " << subkey.isDeVs()
|
<< "\n isDeVs: " << subkey.isDeVs()
|
||||||
<< "\n isCardKey: " << subkey.isCardKey()
|
<< "\n isCardKey: " << subkey.isCardKey()
|
||||||
@ -1279,7 +1405,7 @@ std::ostream &operator<<(std::ostream &os, const Key &key)
|
|||||||
<< "\n issuer: " << protect(key.issuerName())
|
<< "\n issuer: " << protect(key.issuerName())
|
||||||
<< "\n fingerprint:" << protect(key.primaryFingerprint())
|
<< "\n fingerprint:" << protect(key.primaryFingerprint())
|
||||||
<< "\n listmode: " << key.keyListMode()
|
<< "\n listmode: " << key.keyListMode()
|
||||||
<< "\n canSign: " << key.canReallySign()
|
<< "\n canSign: " << key.canSign()
|
||||||
<< "\n canEncrypt: " << key.canEncrypt()
|
<< "\n canEncrypt: " << key.canEncrypt()
|
||||||
<< "\n canCertify: " << key.canCertify()
|
<< "\n canCertify: " << key.canCertify()
|
||||||
<< "\n canAuth: " << key.canAuthenticate()
|
<< "\n canAuth: " << key.canAuthenticate()
|
||||||
@ -1292,6 +1418,20 @@ std::ostream &operator<<(std::ostream &os, const Key &key)
|
|||||||
const std::vector<Subkey> subkeys = key.subkeys();
|
const std::vector<Subkey> subkeys = key.subkeys();
|
||||||
std::copy(subkeys.begin(), subkeys.end(),
|
std::copy(subkeys.begin(), subkeys.end(),
|
||||||
std::ostream_iterator<Subkey>(os, "\n"));
|
std::ostream_iterator<Subkey>(os, "\n"));
|
||||||
|
os << " revocationKeys:\n";
|
||||||
|
const std::vector<RevocationKey> revkeys = key.revocationKeys();
|
||||||
|
std::copy(revkeys.begin(), revkeys.end(),
|
||||||
|
std::ostream_iterator<RevocationKey>(os, "\n"));
|
||||||
|
}
|
||||||
|
return os << ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ostream &operator<<(std::ostream &os, const RevocationKey &revkey)
|
||||||
|
{
|
||||||
|
os << "GpgME::RevocationKey(";
|
||||||
|
if (!revkey.isNull()) {
|
||||||
|
os << "\n fingerprint: " << protect(revkey.fingerprint())
|
||||||
|
<< "\n isSensitive: " << revkey.isSensitive();
|
||||||
}
|
}
|
||||||
return os << ')';
|
return os << ')';
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ class Context;
|
|||||||
class Subkey;
|
class Subkey;
|
||||||
class UserID;
|
class UserID;
|
||||||
class TofuInfo;
|
class TofuInfo;
|
||||||
|
class RevocationKey;
|
||||||
|
|
||||||
typedef std::shared_ptr< std::remove_pointer<gpgme_key_t>::type > shared_gpgme_key_t;
|
typedef std::shared_ptr< std::remove_pointer<gpgme_key_t>::type > shared_gpgme_key_t;
|
||||||
|
|
||||||
@ -71,6 +72,7 @@ public:
|
|||||||
|
|
||||||
static const Null null;
|
static const Null null;
|
||||||
|
|
||||||
|
Key(const Key &other) = default;
|
||||||
const Key &operator=(Key other)
|
const Key &operator=(Key other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
@ -99,6 +101,10 @@ public:
|
|||||||
std::vector<UserID> userIDs() const;
|
std::vector<UserID> userIDs() const;
|
||||||
std::vector<Subkey> subkeys() const;
|
std::vector<Subkey> subkeys() const;
|
||||||
|
|
||||||
|
RevocationKey revocationKey(unsigned int index) const;
|
||||||
|
unsigned int numRevocationKeys() const;
|
||||||
|
std::vector<RevocationKey> revocationKeys() const;
|
||||||
|
|
||||||
bool isRevoked() const;
|
bool isRevoked() const;
|
||||||
bool isExpired() const;
|
bool isExpired() const;
|
||||||
bool isDisabled() const;
|
bool isDisabled() const;
|
||||||
@ -108,22 +114,31 @@ public:
|
|||||||
* isDisabled || isInvalid */
|
* isDisabled || isInvalid */
|
||||||
bool isBad() const;
|
bool isBad() const;
|
||||||
|
|
||||||
|
/** Returns true, if the key can be used for encryption (i.e. it's not bad
|
||||||
|
* and has an encryption subkey) or if the primary subkey can encrypt. */
|
||||||
bool canEncrypt() const;
|
bool canEncrypt() const;
|
||||||
/*!
|
/** Returns true, if the key can be used for signing (i.e. it's not bad
|
||||||
This function contains a workaround for old gpgme's: all secret
|
* and has a signing subkey) or if the primary subkey can sign. */
|
||||||
OpenPGP keys canSign() == true, which canReallySign() doesn't
|
|
||||||
have. I don't have time to find what breaks when I remove this
|
|
||||||
workaround, but since Kleopatra merges secret into public keys,
|
|
||||||
the workaround is not necessary there (and actively harms), I've
|
|
||||||
added a new function instead.
|
|
||||||
*/
|
|
||||||
bool canSign() const;
|
bool canSign() const;
|
||||||
bool canReallySign() const;
|
GPGMEPP_DEPRECATED bool canReallySign() const;
|
||||||
|
/** Returns true, if the key can be used for certification (i.e. it's not bad
|
||||||
|
* and has a certification subkey) or if the primary subkey can certify. */
|
||||||
bool canCertify() const;
|
bool canCertify() const;
|
||||||
|
/** Returns true, if the key can be used for authentication (i.e. it's not bad
|
||||||
|
* and has a authentication subkey) or if the primary subkey can authenticate. */
|
||||||
bool canAuthenticate() const;
|
bool canAuthenticate() const;
|
||||||
bool isQualified() const;
|
bool isQualified() const;
|
||||||
bool isDeVs() const;
|
bool isDeVs() const;
|
||||||
|
|
||||||
|
/** Returns true, if the key has a certification subkey. */
|
||||||
|
bool hasCertify() const;
|
||||||
|
/** Returns true, if the key has a signing subkey. */
|
||||||
|
bool hasSign() const;
|
||||||
|
/** Returns true, if the key has an encryption subkey. */
|
||||||
|
bool hasEncrypt() const;
|
||||||
|
/** Returns true, if the key has an authentication subkey. */
|
||||||
|
bool hasAuthenticate() const;
|
||||||
|
|
||||||
bool hasSecret() const;
|
bool hasSecret() const;
|
||||||
GPGMEPP_DEPRECATED bool isSecret() const
|
GPGMEPP_DEPRECATED bool isSecret() const
|
||||||
{
|
{
|
||||||
@ -228,6 +243,7 @@ public:
|
|||||||
Subkey(const shared_gpgme_key_t &key, gpgme_sub_key_t subkey);
|
Subkey(const shared_gpgme_key_t &key, gpgme_sub_key_t subkey);
|
||||||
Subkey(const shared_gpgme_key_t &key, unsigned int idx);
|
Subkey(const shared_gpgme_key_t &key, unsigned int idx);
|
||||||
|
|
||||||
|
Subkey(const Subkey &other) = default;
|
||||||
const Subkey &operator=(Subkey other)
|
const Subkey &operator=(Subkey other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
@ -268,6 +284,9 @@ public:
|
|||||||
bool canSign() const;
|
bool canSign() const;
|
||||||
bool canCertify() const;
|
bool canCertify() const;
|
||||||
bool canAuthenticate() const;
|
bool canAuthenticate() const;
|
||||||
|
bool canRenc() const;
|
||||||
|
bool canTimestamp() const;
|
||||||
|
bool isGroupOwned() const;
|
||||||
bool isQualified() const;
|
bool isQualified() const;
|
||||||
bool isDeVs() const;
|
bool isDeVs() const;
|
||||||
bool isCardKey() const;
|
bool isCardKey() const;
|
||||||
@ -341,6 +360,7 @@ public:
|
|||||||
UserID(const shared_gpgme_key_t &key, gpgme_user_id_t uid);
|
UserID(const shared_gpgme_key_t &key, gpgme_user_id_t uid);
|
||||||
UserID(const shared_gpgme_key_t &key, unsigned int idx);
|
UserID(const shared_gpgme_key_t &key, unsigned int idx);
|
||||||
|
|
||||||
|
UserID(const UserID &other) = default;
|
||||||
const UserID &operator=(UserID other)
|
const UserID &operator=(UserID other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
@ -459,6 +479,7 @@ public:
|
|||||||
Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, gpgme_key_sig_t sig);
|
Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, gpgme_key_sig_t sig);
|
||||||
Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, unsigned int idx);
|
Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, unsigned int idx);
|
||||||
|
|
||||||
|
Signature(const Signature &other) = default;
|
||||||
const Signature &operator=(Signature other)
|
const Signature &operator=(Signature other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
@ -531,9 +552,53 @@ private:
|
|||||||
gpgme_key_sig_t sig;
|
gpgme_key_sig_t sig;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// class RevocationKey
|
||||||
|
//
|
||||||
|
|
||||||
|
class GPGMEPP_EXPORT RevocationKey
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RevocationKey();
|
||||||
|
RevocationKey(const shared_gpgme_key_t &key, gpgme_revocation_key_t revkey);
|
||||||
|
RevocationKey(const shared_gpgme_key_t &key, unsigned int idx);
|
||||||
|
|
||||||
|
// Rule of Zero
|
||||||
|
|
||||||
|
void swap(RevocationKey &other)
|
||||||
|
{
|
||||||
|
using std::swap;
|
||||||
|
swap(this->key, other.key);
|
||||||
|
swap(this->revkey, other.revkey);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isNull() const
|
||||||
|
{
|
||||||
|
return !key || !revkey;
|
||||||
|
}
|
||||||
|
|
||||||
|
Key parent() const;
|
||||||
|
|
||||||
|
const char *fingerprint() const;
|
||||||
|
|
||||||
|
bool isSensitive() const;
|
||||||
|
|
||||||
|
int algorithm() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
shared_gpgme_key_t key;
|
||||||
|
gpgme_revocation_key_t revkey;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline void swap(RevocationKey& v1, RevocationKey& v2)
|
||||||
|
{
|
||||||
|
v1.swap(v2);
|
||||||
|
}
|
||||||
|
|
||||||
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const UserID &uid);
|
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const UserID &uid);
|
||||||
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const Subkey &subkey);
|
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const Subkey &subkey);
|
||||||
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const Key &key);
|
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const Key &key);
|
||||||
|
GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, const RevocationKey &revkey);
|
||||||
|
|
||||||
} // namespace GpgME
|
} // namespace GpgME
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ public:
|
|||||||
KeyGenerationResult(gpgme_ctx_t ctx, const Error &error);
|
KeyGenerationResult(gpgme_ctx_t ctx, const Error &error);
|
||||||
explicit KeyGenerationResult(const Error &err);
|
explicit KeyGenerationResult(const Error &err);
|
||||||
|
|
||||||
|
KeyGenerationResult(const KeyGenerationResult &other) = default;
|
||||||
const KeyGenerationResult &operator=(KeyGenerationResult other)
|
const KeyGenerationResult &operator=(KeyGenerationResult other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -45,6 +45,7 @@ public:
|
|||||||
explicit KeyListResult(const Error &err);
|
explicit KeyListResult(const Error &err);
|
||||||
KeyListResult(const Error &err, const _gpgme_op_keylist_result &res);
|
KeyListResult(const Error &err, const _gpgme_op_keylist_result &res);
|
||||||
|
|
||||||
|
KeyListResult(const KeyListResult &other) = default;
|
||||||
const KeyListResult &operator=(KeyListResult other)
|
const KeyListResult &operator=(KeyListResult other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -44,6 +44,7 @@ public:
|
|||||||
Notation();
|
Notation();
|
||||||
explicit Notation(gpgme_sig_notation_t nota);
|
explicit Notation(gpgme_sig_notation_t nota);
|
||||||
|
|
||||||
|
Notation(const Notation &other) = default;
|
||||||
const Notation &operator=(Notation other)
|
const Notation &operator=(Notation other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#ifndef __GPGMEPP_SCDGETINFOASSUANTRANSACTION_H__
|
#ifndef __GPGMEPP_SCDGETINFOASSUANTRANSACTION_H__
|
||||||
#define __GPGMEPP_SCDGETINFOASSUANTRANSACTION_H__
|
#define __GPGMEPP_SCDGETINFOASSUANTRANSACTION_H__
|
||||||
|
|
||||||
#include <interfaces/assuantransaction.h>
|
#include "interfaces/assuantransaction.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -199,6 +199,8 @@ GpgME::SignatureMode GpgME::CreatedSignature::mode() const
|
|||||||
case GPGME_SIG_MODE_NORMAL: return NormalSignatureMode;
|
case GPGME_SIG_MODE_NORMAL: return NormalSignatureMode;
|
||||||
case GPGME_SIG_MODE_DETACH: return Detached;
|
case GPGME_SIG_MODE_DETACH: return Detached;
|
||||||
case GPGME_SIG_MODE_CLEAR: return Clearsigned;
|
case GPGME_SIG_MODE_CLEAR: return Clearsigned;
|
||||||
|
case GPGME_SIG_MODE_ARCHIVE: return SignArchive; // cannot happen
|
||||||
|
case GPGME_SIG_MODE_FILE: return SignFile; // cannot happen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ public:
|
|||||||
SigningResult(gpgme_ctx_t ctx, const Error &error);
|
SigningResult(gpgme_ctx_t ctx, const Error &error);
|
||||||
explicit SigningResult(const Error &err);
|
explicit SigningResult(const Error &err);
|
||||||
|
|
||||||
|
SigningResult(const SigningResult &other) = default;
|
||||||
const SigningResult &operator=(SigningResult other)
|
const SigningResult &operator=(SigningResult other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
@ -86,6 +87,7 @@ class GPGMEPP_EXPORT InvalidSigningKey
|
|||||||
public:
|
public:
|
||||||
InvalidSigningKey();
|
InvalidSigningKey();
|
||||||
|
|
||||||
|
InvalidSigningKey(const InvalidSigningKey &other) = default;
|
||||||
const InvalidSigningKey &operator=(InvalidSigningKey other)
|
const InvalidSigningKey &operator=(InvalidSigningKey other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
@ -119,6 +121,7 @@ public:
|
|||||||
|
|
||||||
CreatedSignature();
|
CreatedSignature();
|
||||||
|
|
||||||
|
CreatedSignature(const CreatedSignature &other) = default;
|
||||||
const CreatedSignature &operator=(CreatedSignature other)
|
const CreatedSignature &operator=(CreatedSignature other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#ifndef __GPGMEPP_STATUSCONSUMERASSUANTRANSACTION_H__
|
#ifndef __GPGMEPP_STATUSCONSUMERASSUANTRANSACTION_H__
|
||||||
#define __GPGMEPP_STATUSCONSUMERASSUANTRANSACTION_H__
|
#define __GPGMEPP_STATUSCONSUMERASSUANTRANSACTION_H__
|
||||||
|
|
||||||
#include <interfaces/assuantransaction.h>
|
#include "interfaces/assuantransaction.h"
|
||||||
|
|
||||||
namespace GpgME
|
namespace GpgME
|
||||||
{
|
{
|
||||||
|
@ -62,6 +62,7 @@ public:
|
|||||||
const char *iversion = NULL,
|
const char *iversion = NULL,
|
||||||
Error *err = NULL);
|
Error *err = NULL);
|
||||||
|
|
||||||
|
SwdbResult(const SwdbResult &other) = default;
|
||||||
const SwdbResult &operator=(SwdbResult other)
|
const SwdbResult &operator=(SwdbResult other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
TofuInfo();
|
TofuInfo();
|
||||||
explicit TofuInfo(gpgme_tofu_info_t info);
|
explicit TofuInfo(gpgme_tofu_info_t info);
|
||||||
|
|
||||||
|
TofuInfo(const TofuInfo &other) = default;
|
||||||
const TofuInfo &operator=(TofuInfo other)
|
const TofuInfo &operator=(TofuInfo other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#define __GPGMEPP_TRUSTITEM_H__
|
#define __GPGMEPP_TRUSTITEM_H__
|
||||||
|
|
||||||
#include "gpgmefw.h"
|
#include "gpgmefw.h"
|
||||||
#include <key.h>
|
#include "key.h"
|
||||||
#include "gpgmepp_export.h"
|
#include "gpgmepp_export.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -544,32 +544,41 @@ std::ostream &GpgME::operator<<(std::ostream &os, const VerificationResult &resu
|
|||||||
|
|
||||||
std::ostream &GpgME::operator<<(std::ostream &os, Signature::PKAStatus pkaStatus)
|
std::ostream &GpgME::operator<<(std::ostream &os, Signature::PKAStatus pkaStatus)
|
||||||
{
|
{
|
||||||
#define OUTPUT( x ) if ( !(pkaStatus & (GpgME::Signature:: x)) ) {} else do { os << #x " "; } while(0)
|
|
||||||
os << "GpgME::Signature::PKAStatus(";
|
os << "GpgME::Signature::PKAStatus(";
|
||||||
OUTPUT(UnknownPKAStatus);
|
switch (pkaStatus) {
|
||||||
OUTPUT(PKAVerificationFailed);
|
#define OUTPUT( x ) case GpgME::Signature:: x: os << #x; break
|
||||||
OUTPUT(PKAVerificationSucceeded);
|
OUTPUT(UnknownPKAStatus);
|
||||||
|
OUTPUT(PKAVerificationFailed);
|
||||||
|
OUTPUT(PKAVerificationSucceeded);
|
||||||
#undef OUTPUT
|
#undef OUTPUT
|
||||||
|
default:
|
||||||
|
os << "??? (" << static_cast<int>(pkaStatus) << ')';
|
||||||
|
break;
|
||||||
|
}
|
||||||
return os << ')';
|
return os << ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream &GpgME::operator<<(std::ostream &os, Signature::Summary summary)
|
std::ostream &GpgME::operator<<(std::ostream &os, Signature::Summary summary)
|
||||||
{
|
{
|
||||||
#define OUTPUT( x ) if ( !(summary & (GpgME::Signature:: x)) ) {} else do { os << #x " "; } while(0)
|
|
||||||
os << "GpgME::Signature::Summary(";
|
os << "GpgME::Signature::Summary(";
|
||||||
OUTPUT(Valid);
|
if (summary == Signature::None) {
|
||||||
OUTPUT(Green);
|
os << "None";
|
||||||
OUTPUT(Red);
|
} else {
|
||||||
OUTPUT(KeyRevoked);
|
#define OUTPUT( x ) if ( !(summary & (GpgME::Signature:: x)) ) {} else do { os << #x " "; } while(0)
|
||||||
OUTPUT(KeyExpired);
|
OUTPUT(Valid);
|
||||||
OUTPUT(SigExpired);
|
OUTPUT(Green);
|
||||||
OUTPUT(KeyMissing);
|
OUTPUT(Red);
|
||||||
OUTPUT(CrlMissing);
|
OUTPUT(KeyRevoked);
|
||||||
OUTPUT(CrlTooOld);
|
OUTPUT(KeyExpired);
|
||||||
OUTPUT(BadPolicy);
|
OUTPUT(SigExpired);
|
||||||
OUTPUT(SysError);
|
OUTPUT(KeyMissing);
|
||||||
OUTPUT(TofuConflict);
|
OUTPUT(CrlMissing);
|
||||||
|
OUTPUT(CrlTooOld);
|
||||||
|
OUTPUT(BadPolicy);
|
||||||
|
OUTPUT(SysError);
|
||||||
|
OUTPUT(TofuConflict);
|
||||||
#undef OUTPUT
|
#undef OUTPUT
|
||||||
|
}
|
||||||
return os << ')';
|
return os << ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -603,10 +612,14 @@ std::ostream &GpgME::operator<<(std::ostream &os, const Signature &sig)
|
|||||||
std::ostream &GpgME::operator<<(std::ostream &os, Notation::Flags flags)
|
std::ostream &GpgME::operator<<(std::ostream &os, Notation::Flags flags)
|
||||||
{
|
{
|
||||||
os << "GpgME::Notation::Flags(";
|
os << "GpgME::Notation::Flags(";
|
||||||
|
if (flags == Notation::NoFlags) {
|
||||||
|
os << "NoFlags";
|
||||||
|
} else {
|
||||||
#define OUTPUT( x ) if ( !(flags & (GpgME::Notation:: x)) ) {} else do { os << #x " "; } while(0)
|
#define OUTPUT( x ) if ( !(flags & (GpgME::Notation:: x)) ) {} else do { os << #x " "; } while(0)
|
||||||
OUTPUT(HumanReadable);
|
OUTPUT(HumanReadable);
|
||||||
OUTPUT(Critical);
|
OUTPUT(Critical);
|
||||||
#undef OUTPUT
|
#undef OUTPUT
|
||||||
|
}
|
||||||
return os << ')';
|
return os << ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ public:
|
|||||||
VerificationResult(gpgme_ctx_t ctx, const Error &error);
|
VerificationResult(gpgme_ctx_t ctx, const Error &error);
|
||||||
explicit VerificationResult(const Error &err);
|
explicit VerificationResult(const Error &err);
|
||||||
|
|
||||||
|
VerificationResult(const VerificationResult &other) = default;
|
||||||
const VerificationResult &operator=(VerificationResult other)
|
const VerificationResult &operator=(VerificationResult other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
@ -90,6 +91,7 @@ public:
|
|||||||
|
|
||||||
Signature();
|
Signature();
|
||||||
|
|
||||||
|
Signature(const Signature &other) = default;
|
||||||
const Signature &operator=(Signature other)
|
const Signature &operator=(Signature other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -45,6 +45,7 @@ public:
|
|||||||
VfsMountResult(gpgme_ctx_t ctx, const Error &error, const Error &opError);
|
VfsMountResult(gpgme_ctx_t ctx, const Error &error, const Error &opError);
|
||||||
explicit VfsMountResult(const Error &err);
|
explicit VfsMountResult(const Error &err);
|
||||||
|
|
||||||
|
VfsMountResult(const VfsMountResult &other) = default;
|
||||||
const VfsMountResult &operator=(VfsMountResult other)
|
const VfsMountResult &operator=(VfsMountResult other)
|
||||||
{
|
{
|
||||||
swap(other);
|
swap(other);
|
||||||
|
@ -150,7 +150,7 @@ main (int argc, char **argv)
|
|||||||
const GpgME::Key key = ctx->key (*argv, err, only_secret);
|
const GpgME::Key key = ctx->key (*argv, err, only_secret);
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
|
||||||
ss << "Key " << key << " Err: " << err.asString() << "\n";
|
ss << "Key " << key << " Err: " << err.asStdString() << "\n";
|
||||||
|
|
||||||
std::cout << ss.str();
|
std::cout << ss.str();
|
||||||
|
|
||||||
|
@ -153,14 +153,17 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
Error err = ctx->startKeyListing (*argv, only_secret);
|
Error err = ctx->startKeyListing (*argv, only_secret);
|
||||||
if (err) {
|
if (err) {
|
||||||
std::cout << "Error: " << err.asString() << "\n";
|
std::cout << "Error: " << err.asStdString() << "\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
GpgME::Key key;
|
GpgME::Key key;
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
do {
|
do {
|
||||||
key = ctx->nextKey(err);
|
key = ctx->nextKey(err);
|
||||||
ss << key << "\n\n";
|
if (!err)
|
||||||
|
{
|
||||||
|
ss << key << "\n\n";
|
||||||
|
}
|
||||||
} while (!err && !key.isNull());
|
} while (!err && !key.isNull());
|
||||||
|
|
||||||
std::cout << ss.str();
|
std::cout << ss.str();
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
#include "verificationresult.h"
|
#include "verificationresult.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <sstream>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace GpgME;
|
using namespace GpgME;
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include "key.h"
|
#include "key.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <sstream>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
@ -76,49 +75,52 @@ main (int argc, char **argv)
|
|||||||
Error err;
|
Error err;
|
||||||
auto ctx = std::unique_ptr<Context>{Context::createForEngine(AssuanEngine, &err)};
|
auto ctx = std::unique_ptr<Context>{Context::createForEngine(AssuanEngine, &err)};
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
std::cerr << "Failed to get context (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to get context (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string dirmngrSocket = GpgME::dirInfo("dirmngr-socket");
|
const std::string dirmngrSocket = GpgME::dirInfo("dirmngr-socket");
|
||||||
if ((err = ctx->setEngineFileName(dirmngrSocket.c_str()))) {
|
if ((err = ctx->setEngineFileName(dirmngrSocket.c_str()))) {
|
||||||
std::cerr << "Failed to set engine file name (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to set engine file name (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if ((err = ctx->setEngineHomeDirectory(""))) {
|
if ((err = ctx->setEngineHomeDirectory(""))) {
|
||||||
std::cerr << "Failed to set engine home directory (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to set engine home directory (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// try do connect to dirmngr
|
// try to connect to dirmngr
|
||||||
err = ctx->assuanTransact("GETINFO version");
|
err = ctx->assuanTransact("GETINFO version");
|
||||||
if (err && err.code() != GPG_ERR_ASS_CONNECT_FAILED) {
|
if (err && err.code() != GPG_ERR_ASS_CONNECT_FAILED) {
|
||||||
std::cerr << "Failed to start assuan transaction (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to start assuan transaction (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (err.code() == GPG_ERR_ASS_CONNECT_FAILED) {
|
if (err.code() == GPG_ERR_ASS_CONNECT_FAILED) {
|
||||||
std::cerr << "Starting dirmngr ...\n";
|
std::cerr << "Starting dirmngr ...\n";
|
||||||
auto spawnCtx = std::unique_ptr<Context>{Context::createForEngine(SpawnEngine, &err)};
|
auto spawnCtx = std::unique_ptr<Context>{Context::createForEngine(SpawnEngine, &err)};
|
||||||
if (!spawnCtx) {
|
if (!spawnCtx) {
|
||||||
std::cerr << "Failed to get context for spawn engine (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to get context for spawn engine (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto dirmngrProgram = GpgME::dirInfo("dirmngr-name");
|
const auto gpgconfProgram = GpgME::dirInfo("gpgconf-name");
|
||||||
const auto homedir = GpgME::dirInfo("homedir");
|
// replace backslashes with forward slashes in homedir to work around bug T6833
|
||||||
|
std::string homedir{GpgME::dirInfo("homedir")};
|
||||||
|
std::replace(homedir.begin(), homedir.end(), '\\', '/');
|
||||||
const char *argv[] = {
|
const char *argv[] = {
|
||||||
dirmngrProgram,
|
gpgconfProgram,
|
||||||
"--homedir",
|
"--homedir",
|
||||||
homedir,
|
homedir.c_str(),
|
||||||
"--daemon",
|
"--launch",
|
||||||
|
"dirmngr",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
auto ignoreIO = Data{Data::null};
|
auto ignoreIO = Data{Data::null};
|
||||||
err = spawnCtx->spawnAsync(dirmngrProgram, argv,
|
err = spawnCtx->spawn(gpgconfProgram, argv,
|
||||||
ignoreIO, ignoreIO, ignoreIO,
|
ignoreIO, ignoreIO, ignoreIO,
|
||||||
Context::SpawnDetached);
|
Context::SpawnDetached);
|
||||||
if (err) {
|
if (err) {
|
||||||
std::cerr << "Failed to start dirmngr (Error: " << err.asString() << ")\n";
|
std::cerr << "Failed to start dirmngr (Error: " << err.asStdString() << ")\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +137,7 @@ main (int argc, char **argv)
|
|||||||
const auto cmd = std::string{"WKD_GET "} + email;
|
const auto cmd = std::string{"WKD_GET "} + email;
|
||||||
err = ctx->assuanTransact(cmd.c_str());
|
err = ctx->assuanTransact(cmd.c_str());
|
||||||
if (err && err.code() != GPG_ERR_NO_NAME && err.code() != GPG_ERR_NO_DATA) {
|
if (err && err.code() != GPG_ERR_NO_NAME && err.code() != GPG_ERR_NO_DATA) {
|
||||||
std::cerr << "Error: WKD_GET returned " << err.asString() << "\n";
|
std::cerr << "Error: WKD_GET returned " << err.asStdString() << "\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,13 @@ EXTRA_DIST = \
|
|||||||
gpgme.i \
|
gpgme.i \
|
||||||
helpers.c helpers.h private.h
|
helpers.c helpers.h private.h
|
||||||
|
|
||||||
SUBDIRS = . tests examples doc src
|
if RUN_GPG_TESTS
|
||||||
|
tests = tests
|
||||||
|
else
|
||||||
|
tests =
|
||||||
|
endif
|
||||||
|
|
||||||
|
SUBDIRS = . ${tests} examples doc src
|
||||||
|
|
||||||
.PHONY: prepare
|
.PHONY: prepare
|
||||||
prepare: copystamp
|
prepare: copystamp
|
||||||
@ -74,7 +80,7 @@ CLEANFILES = copystamp \
|
|||||||
# 'make distclean' clears the write bit, breaking rm -rf. Fix the
|
# 'make distclean' clears the write bit, breaking rm -rf. Fix the
|
||||||
# permissions.
|
# permissions.
|
||||||
clean-local:
|
clean-local:
|
||||||
rm -rf -- build
|
rm -rf -- build dist gpg.egg-info
|
||||||
for PYTHON in $(PYTHONS); do \
|
for PYTHON in $(PYTHONS); do \
|
||||||
find "$$(basename "$${PYTHON}")-gpg" -type d ! -perm -200 -exec chmod u+w {} ';' ; \
|
find "$$(basename "$${PYTHON}")-gpg" -type d ! -perm -200 -exec chmod u+w {} ';' ; \
|
||||||
rm -rf -- "$$(basename "$${PYTHON}")-gpg" ; \
|
rm -rf -- "$$(basename "$${PYTHON}")-gpg" ; \
|
||||||
@ -95,8 +101,12 @@ install-exec-local:
|
|||||||
done
|
done
|
||||||
|
|
||||||
uninstall-local:
|
uninstall-local:
|
||||||
set -x; GV=$$(echo $(VERSION) | tr - _); for PYTHON in $(PYTHONS); do \
|
set -x; \
|
||||||
|
GV=$$(echo $(VERSION) | tr - _); \
|
||||||
|
normalizedGV=$$(echo $$GV | sed s/_beta/b/); \
|
||||||
|
for PYTHON in $(PYTHONS); do \
|
||||||
PLATLIB="$(prefix)/$$("$${PYTHON}" -c 'import sysconfig, os; print(os.path.relpath(sysconfig.get_path("platlib", scheme="posix_prefix"), sysconfig.get_config_var("prefix")))')" ; \
|
PLATLIB="$(prefix)/$$("$${PYTHON}" -c 'import sysconfig, os; print(os.path.relpath(sysconfig.get_path("platlib", scheme="posix_prefix"), sysconfig.get_config_var("prefix")))')" ; \
|
||||||
rm -rf -- "$(DESTDIR)$${PLATLIB}/gpg" \
|
rm -rf -- "$(DESTDIR)$${PLATLIB}/gpg" \
|
||||||
"$(DESTDIR)$${PLATLIB}"/gpg-$$GV-py*.egg-info ; \
|
"$(DESTDIR)$${PLATLIB}"/gpg-$$GV-py*.egg-info \
|
||||||
|
"$(DESTDIR)$${PLATLIB}"/gpg-$$normalizedGV-py*.egg ; \
|
||||||
done
|
done
|
||||||
|
@ -1612,6 +1612,7 @@ of the entire public keybox.
|
|||||||
|
|
||||||
#+BEGIN_SRC python -i
|
#+BEGIN_SRC python -i
|
||||||
import gpg
|
import gpg
|
||||||
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -1619,6 +1620,9 @@ print("""
|
|||||||
This script exports one or more public keys in minimised form.
|
This script exports one or more public keys in minimised form.
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
def open_0o600(path, flags):
|
||||||
|
return os.open(path, flags, mode=0o600)
|
||||||
|
|
||||||
c = gpg.Context(armor=True)
|
c = gpg.Context(armor=True)
|
||||||
|
|
||||||
if len(sys.argv) >= 4:
|
if len(sys.argv) >= 4:
|
||||||
@ -1654,7 +1658,7 @@ except:
|
|||||||
result = c.key_export_minimal(pattern=None)
|
result = c.key_export_minimal(pattern=None)
|
||||||
|
|
||||||
if result is not None:
|
if result is not None:
|
||||||
with open(keyfile, "wb") as f:
|
with open(keyfile, "wb", opener=open_0o600) as f:
|
||||||
f.write(result)
|
f.write(result)
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
@ -1686,6 +1690,9 @@ This script exports one or more secret keys.
|
|||||||
The gpg-agent and pinentry are invoked to authorise the export.
|
The gpg-agent and pinentry are invoked to authorise the export.
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
def open_0o600(path, flags):
|
||||||
|
return os.open(path, flags, mode=0o600)
|
||||||
|
|
||||||
c = gpg.Context(armor=True)
|
c = gpg.Context(armor=True)
|
||||||
|
|
||||||
if len(sys.argv) >= 4:
|
if len(sys.argv) >= 4:
|
||||||
@ -1735,9 +1742,8 @@ except:
|
|||||||
result = c.key_export_secret(pattern=None)
|
result = c.key_export_secret(pattern=None)
|
||||||
|
|
||||||
if result is not None:
|
if result is not None:
|
||||||
with open(keyfile, "wb") as f:
|
with open(keyfile, "wb", opener=open_0o600)) as f:
|
||||||
f.write(result)
|
f.write(result)
|
||||||
os.chmod(keyfile, 0o600)
|
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@ -2939,7 +2945,7 @@ Save that into a file called =keycount.pyx= and then create a
|
|||||||
=setup.py= file which contains this:
|
=setup.py= file which contains this:
|
||||||
|
|
||||||
#+BEGIN_SRC python -i
|
#+BEGIN_SRC python -i
|
||||||
from distutils.core import setup
|
from setuptools import setup
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
@ -3124,7 +3130,7 @@ minimum required version of GPGME is in use.
|
|||||||
|
|
||||||
For the most part the =gpg.version.versionstr= and
|
For the most part the =gpg.version.versionstr= and
|
||||||
=gpg.version.versionlist= methods have been quite sufficient. The
|
=gpg.version.versionlist= methods have been quite sufficient. The
|
||||||
former returns the same string as =gpgme-config --version=, while the
|
former returns the same string as =pkg-config gpgme --modversion=, while the
|
||||||
latter returns the major, minor and patch values in a list.
|
latter returns the major, minor and patch values in a list.
|
||||||
|
|
||||||
To check if the installed bindings have actually been built against
|
To check if the installed bindings have actually been built against
|
||||||
@ -3135,7 +3141,7 @@ import gpg
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
gpgme_version_call = subprocess.Popen(["gpgme-config", "--version"],
|
gpgme_version_call = subprocess.Popen(["pkg-config", "gpgme", "--modversion"],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
gpgme_version_str = gpgme_version_call.communicate()
|
gpgme_version_str = gpgme_version_call.communicate()
|
||||||
|
@ -498,7 +498,7 @@
|
|||||||
% \def\foo{\parsearg\Xfoo}
|
% \def\foo{\parsearg\Xfoo}
|
||||||
% \def\Xfoo#1{...}
|
% \def\Xfoo#1{...}
|
||||||
%
|
%
|
||||||
% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
|
% Actually, I use \csname\string\foo\endcsname, i.e. \\foo, as it is my
|
||||||
% favourite TeX trick. --kasal, 16nov03
|
% favourite TeX trick. --kasal, 16nov03
|
||||||
|
|
||||||
\def\parseargdef#1{%
|
\def\parseargdef#1{%
|
||||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import gpg
|
import gpg
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from distutils.core import setup
|
from setuptools import setup
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import gpg
|
import gpg
|
||||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import gpg
|
import gpg
|
||||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import gpg
|
import gpg
|
||||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import gpg
|
import gpg
|
||||||
|
@ -24,7 +24,7 @@ import sys
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -24,7 +24,7 @@ import sys
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -25,7 +25,7 @@ from groups import group_lists
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -25,7 +25,7 @@ from groups import group_lists
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -25,7 +25,7 @@ from groups import group_lists
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -25,7 +25,7 @@ import sys
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
|
@ -25,7 +25,7 @@ import sys
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
|
@ -26,7 +26,7 @@ import sys
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
@ -35,6 +35,9 @@ This script exports one or more secret keys.
|
|||||||
The gpg-agent and pinentry are invoked to authorise the export.
|
The gpg-agent and pinentry are invoked to authorise the export.
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
def open_0o600(path, flags):
|
||||||
|
return os.open(path, flags, mode=0o600)
|
||||||
|
|
||||||
c = gpg.Context(armor=True)
|
c = gpg.Context(armor=True)
|
||||||
|
|
||||||
if len(sys.argv) >= 4:
|
if len(sys.argv) >= 4:
|
||||||
@ -84,8 +87,7 @@ except:
|
|||||||
result = c.key_export_secret(pattern=None)
|
result = c.key_export_secret(pattern=None)
|
||||||
|
|
||||||
if result is not None:
|
if result is not None:
|
||||||
with open(keyfile, "wb") as f:
|
with open(keyfile, "wb", opener=open_0o600) as f:
|
||||||
f.write(result)
|
f.write(result)
|
||||||
os.chmod(keyfile, 0o600)
|
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
@ -27,7 +27,7 @@ import sys
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
@ -37,6 +37,9 @@ file formats, saved in files within the user's GPG home directory.
|
|||||||
The gpg-agent and pinentry are invoked to authorise the export.
|
The gpg-agent and pinentry are invoked to authorise the export.
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
def open_0o600(path, flags):
|
||||||
|
return os.open(path, flags, mode=0o600)
|
||||||
|
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
gpgconfcmd = "gpgconf.exe --list-dirs homedir"
|
gpgconfcmd = "gpgconf.exe --list-dirs homedir"
|
||||||
else:
|
else:
|
||||||
@ -119,15 +122,13 @@ except:
|
|||||||
b_result = b.key_export_secret(pattern=None)
|
b_result = b.key_export_secret(pattern=None)
|
||||||
|
|
||||||
if a_result is not None:
|
if a_result is not None:
|
||||||
with open(ascfile, "wb") as f:
|
with open(ascfile, "wb", opener=open_0o600) as f:
|
||||||
f.write(a_result)
|
f.write(a_result)
|
||||||
os.chmod(ascfile, 0o600)
|
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if b_result is not None:
|
if b_result is not None:
|
||||||
with open(gpgfile, "wb") as f:
|
with open(gpgfile, "wb", opener=open_0o600) as f:
|
||||||
f.write(b_result)
|
f.write(b_result)
|
||||||
os.chmod(gpgfile, 0o600)
|
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
@ -20,7 +20,7 @@ from __future__ import absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -27,7 +27,7 @@ del absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
|
@ -25,7 +25,7 @@ import sys
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
|
@ -25,7 +25,7 @@ import sys
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
|
@ -25,7 +25,7 @@ import requests
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
|
@ -25,7 +25,7 @@ import sys
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import gpg
|
import gpg
|
||||||
|
@ -28,7 +28,7 @@ from groups import group_lists
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
|
@ -21,7 +21,7 @@ from __future__ import absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
@ -28,7 +28,7 @@ del absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
|
@ -28,7 +28,7 @@ del absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
|
@ -28,7 +28,7 @@ del absolute_import, division, unicode_literals
|
|||||||
# Lesser General Public License for more details.
|
# Lesser General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License and the GNU
|
# You should have received a copy of the GNU General Public License and the GNU
|
||||||
# Lesser General Public along with this program; if not, see
|
# Lesser General Public License along with this program; if not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
print("""
|
print("""
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user