[gmime] fixed the build
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime] fixed the build
- Date: Sun, 19 Feb 2017 15:19:54 +0000 (UTC)
commit e2ae9a2995cf386842140a850a1fed9fa586bec3
Author: Jeffrey Stedfast <fejj gnome org>
Date: Sat Feb 18 18:20:17 2017 -0500
fixed the build
examples/basic-example.c | 2 +-
gmime/gmime-multipart-encrypted.c | 4 ++--
tests/test-pgp.c | 7 +++----
tests/test-pgpmime.c | 20 +++-----------------
tests/test-pkcs7.c | 11 ++++++-----
tests/test-smime.c | 16 +++-------------
6 files changed, 18 insertions(+), 42 deletions(-)
---
diff --git a/examples/basic-example.c b/examples/basic-example.c
index fb7ebce..7f467cc 100644
--- a/examples/basic-example.c
+++ b/examples/basic-example.c
@@ -148,7 +148,7 @@ verify_foreach_callback (GMimeObject *parent, GMimeObject *part, gpointer user_d
const char *str;
int i;
- if (!(signatures = g_mime_multipart_signed_verify (mps, &err))) {
+ if (!(signatures = g_mime_multipart_signed_verify (mps, GMIME_VERIFY_FLAGS_NONE, &err))) {
/* an error occured - probably couldn't start gpg? */
/* for more information about GError, see:
diff --git a/gmime/gmime-multipart-encrypted.c b/gmime/gmime-multipart-encrypted.c
index 4125b45..f37dfff 100644
--- a/gmime/gmime-multipart-encrypted.c
+++ b/gmime/gmime-multipart-encrypted.c
@@ -160,7 +160,7 @@ g_mime_multipart_encrypted_new (void)
int
g_mime_multipart_encrypted_encrypt (GMimeMultipartEncrypted *mpe, GMimeObject *content,
GMimeCryptoContext *ctx, gboolean sign, const char *userid,
- GMimeDigestAlgo digest, GMimeEncryptFLags flags,
+ GMimeDigestAlgo digest, GMimeEncryptFlags flags,
GPtrArray *recipients, GError **err)
{
GMimeParserOptions *options = g_mime_parser_options_get_default ();
@@ -296,7 +296,7 @@ g_mime_data_wrapper_get_decoded_stream (GMimeDataWrapper *wrapper)
* @err to provide information as to why the failure occured.
**/
GMimeObject *
-g_mime_multipart_encrypted_decrypt (GMimeMultipartEncrypted *mpe, GMimeDecryptFLags flags,
+g_mime_multipart_encrypted_decrypt (GMimeMultipartEncrypted *mpe, GMimeDecryptFlags flags,
const char *session_key, GMimeDecryptResult **result,
GError **err)
{
diff --git a/tests/test-pgp.c b/tests/test-pgp.c
index 0624d32..f5d9e2b 100644
--- a/tests/test-pgp.c
+++ b/tests/test-pgp.c
@@ -97,7 +97,7 @@ test_verify (GMimeCryptoContext *ctx, GMimeStream *cleartext, GMimeStream *ciphe
GError *err = NULL;
Exception *ex;
- signatures = g_mime_crypto_context_verify (ctx, GMIME_DIGEST_ALGO_DEFAULT,
+ signatures = g_mime_crypto_context_verify (ctx, 0, GMIME_DIGEST_ALGO_DEFAULT,
cleartext, ciphertext, &err);
if (signatures == NULL) {
@@ -127,7 +127,7 @@ test_encrypt (GMimeCryptoContext *ctx, gboolean sign, GMimeStream *cleartext, GM
g_ptr_array_add (recipients, "no.user@no.domain");
g_mime_crypto_context_encrypt (ctx, sign, "no.user@no.domain", GMIME_DIGEST_ALGO_SHA256,
- recipients, cleartext, ciphertext, &err);
+ GMIME_ENCRYPT_FLAGS_ALWAYS_TRUST, recipients, cleartext, ciphertext,
&err);
g_ptr_array_free (recipients, TRUE);
@@ -154,7 +154,7 @@ test_decrypt (GMimeCryptoContext *ctx, gboolean sign, GMimeStream *cleartext, GM
stream = g_mime_stream_mem_new ();
- if (!(result = g_mime_crypto_context_decrypt (ctx, NULL, ciphertext, stream, &err))) {
+ if (!(result = g_mime_crypto_context_decrypt (ctx, 0, NULL, ciphertext, stream, &err))) {
g_object_unref (stream);
ex = exception_new ("%s", err->message);
g_error_free (err);
@@ -313,7 +313,6 @@ int main (int argc, char **argv)
ctx = g_mime_gpg_context_new ();
g_mime_crypto_context_set_request_password (ctx, request_passwd);
- g_mime_crypto_context_set_always_trust (ctx, TRUE);
testsuite_check ("GMimeGpgContext::import");
try {
diff --git a/tests/test-pgpmime.c b/tests/test-pgpmime.c
index 6ba5526..338abfa 100644
--- a/tests/test-pgpmime.c
+++ b/tests/test-pgpmime.c
@@ -244,7 +244,7 @@ test_multipart_signed (GMimeCryptoContext *ctx)
mps = (GMimeMultipartSigned *) message->mime_part;
v(fputs ("Trying to verify signature... ", stdout));
- if (!(signatures = g_mime_multipart_signed_verify (mps, &err))) {
+ if (!(signatures = g_mime_multipart_signed_verify (mps, 0, &err))) {
ex = exception_new ("%s", err->message);
v(fputs ("failed.\n", stdout));
g_error_free (err);
@@ -299,7 +299,7 @@ create_encrypted_message (GMimeCryptoContext *ctx, gboolean sign,
g_ptr_array_add (recipients, "no.user@no.domain");
g_mime_multipart_encrypted_encrypt (mpe, GMIME_OBJECT (part), ctx, sign,
"no.user@no.domain", GMIME_DIGEST_ALGO_SHA256,
- recipients, &err);
+ GMIME_ENCRYPT_FLAGS_ALWAYS_TRUST, recipients, &err);
g_ptr_array_free (recipients, TRUE);
g_object_unref (part);
@@ -377,7 +377,7 @@ test_multipart_encrypted (GMimeCryptoContext *ctx, gboolean sign,
mpe = (GMimeMultipartEncrypted *) message->mime_part;
/* okay, now to test our decrypt function... */
- decrypted = g_mime_multipart_encrypted_decrypt (mpe, session_key, &result, &err);
+ decrypted = g_mime_multipart_encrypted_decrypt (mpe, GMIME_DECRYPT_FLAGS_EXPORT_SESSION_KEY,
session_key, &result, &err);
if (!decrypted || err != NULL) {
ex = exception_new ("decryption failed: %s", err->message);
g_error_free (err);
@@ -484,20 +484,6 @@ int main (int argc, char *argv[])
ctx = g_mime_gpg_context_new ();
g_mime_crypto_context_set_request_password (ctx, request_passwd);
- g_mime_crypto_context_set_always_trust (ctx, TRUE);
-
- if (g_mime_crypto_context_set_retrieve_session_key (ctx, TRUE, &err) != 0) {
- fprintf (stderr, "Failed to set retrieve_session_key on GMimeGpgContext: %s\n",
- err ? err->message : "no error info returned" );
- if (err)
- g_error_free (err);
- return EXIT_FAILURE;
- }
-
- if (!g_mime_crypto_context_get_retrieve_session_key (ctx)) {
- fprintf (stderr, "We set retrieve_session_key on GMimeGpgContext, but it did not stay
set.\n");
- return EXIT_FAILURE;
- }
testsuite_check ("GMimeGpgContext::import");
try {
diff --git a/tests/test-pkcs7.c b/tests/test-pkcs7.c
index 197bc8a..34936a2 100644
--- a/tests/test-pkcs7.c
+++ b/tests/test-pkcs7.c
@@ -98,7 +98,7 @@ test_verify (GMimeCryptoContext *ctx, GMimeStream *cleartext, GMimeStream *ciphe
GError *err = NULL;
Exception *ex;
- signatures = g_mime_crypto_context_verify (ctx, GMIME_DIGEST_ALGO_DEFAULT,
+ signatures = g_mime_crypto_context_verify (ctx, 0, GMIME_DIGEST_ALGO_DEFAULT,
cleartext, ciphertext, &err);
if (signatures == NULL) {
@@ -128,8 +128,10 @@ test_encrypt (GMimeCryptoContext *ctx, gboolean sign, GMimeStream *cleartext, GM
g_ptr_array_add (recipients, "alice example net");
g_mime_crypto_context_encrypt (ctx, sign, "alice example net",
- GMIME_DIGEST_ALGO_SHA256, recipients,
- cleartext, ciphertext, &err);
+ GMIME_DIGEST_ALGO_SHA256,
+ GMIME_ENCRYPT_FLAGS_ALWAYS_TRUST,
+ recipients, cleartext, ciphertext,
+ &err);
g_ptr_array_free (recipients, TRUE);
@@ -156,7 +158,7 @@ test_decrypt (GMimeCryptoContext *ctx, gboolean sign, GMimeStream *cleartext, GM
stream = g_mime_stream_mem_new ();
- if (!(result = g_mime_crypto_context_decrypt (ctx, NULL, ciphertext, stream, &err))) {
+ if (!(result = g_mime_crypto_context_decrypt (ctx, 0, NULL, ciphertext, stream, &err))) {
g_object_unref (stream);
ex = exception_new ("%s", err->message);
g_error_free (err);
@@ -314,7 +316,6 @@ int main (int argc, char **argv)
ctx = g_mime_pkcs7_context_new ();
g_mime_crypto_context_set_request_password (ctx, request_passwd);
- g_mime_crypto_context_set_always_trust (ctx, TRUE);
testsuite_check ("GMimePkcs7Context::import");
try {
diff --git a/tests/test-smime.c b/tests/test-smime.c
index abd822c..57e7011 100644
--- a/tests/test-smime.c
+++ b/tests/test-smime.c
@@ -245,7 +245,7 @@ test_multipart_signed (GMimeCryptoContext *ctx)
mps = (GMimeMultipartSigned *) message->mime_part;
v(fputs ("Trying to verify signature... ", stdout));
- if (!(signatures = g_mime_multipart_signed_verify (mps, &err))) {
+ if (!(signatures = g_mime_multipart_signed_verify (mps, 0, &err))) {
ex = exception_new ("%s", err->message);
v(fputs ("failed.\n", stdout));
g_error_free (err);
@@ -304,7 +304,7 @@ test_multipart_encrypted (GMimeCryptoContext *ctx, gboolean sign)
g_ptr_array_add (recipients, "alice example net");
g_mime_multipart_encrypted_encrypt (mpe, GMIME_OBJECT (part), ctx, sign,
"alice example net", GMIME_DIGEST_ALGO_SHA256,
- recipients, &err);
+ GMIME_ENCRYPT_FLAGS_ALWAYS_TRUST, recipients, &err);
g_ptr_array_free (recipients, TRUE);
g_object_unref (part);
@@ -359,7 +359,7 @@ test_multipart_encrypted (GMimeCryptoContext *ctx, gboolean sign)
mpe = (GMimeMultipartEncrypted *) message->mime_part;
/* okay, now to test our decrypt function... */
- decrypted = g_mime_multipart_encrypted_decrypt (mpe, NULL, &result, &err);
+ decrypted = g_mime_multipart_encrypted_decrypt (mpe, 0, NULL, &result, &err);
if (!decrypted || err != NULL) {
ex = exception_new ("decryption failed: %s", err->message);
g_object_unref (cleartext);
@@ -454,16 +454,6 @@ int main (int argc, char *argv[])
ctx = g_mime_pkcs7_context_new ();
g_mime_crypto_context_set_request_password (ctx, request_passwd);
- g_mime_crypto_context_set_always_trust (ctx, TRUE);
-
- if (g_mime_crypto_context_set_retrieve_session_key (ctx, TRUE, NULL) == 0) {
- fprintf (stderr, "GMimePkcs7Context should not have allowed us to set retrieve_session_key to
TRUE, since it is not implemented.\n");
- return EXIT_FAILURE;
- }
- if (g_mime_crypto_context_get_retrieve_session_key (ctx)) {
- fprintf (stderr, "GMimePkcs7Context should have returned FALSE for
get_retrieve_session_key.\n");
- return EXIT_FAILURE;
- }
testsuite_check ("GMimePkcs7Context::import");
try {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]