{
switch (type) {
case CAMEL_PGP_TYPE_PGP2:
- return "PGP2.x";
+ return "PGP 2.6.x";
case CAMEL_PGP_TYPE_PGP5:
- return "PGP5";
+ return "PGP 5.x";
case CAMEL_PGP_TYPE_PGP6:
- return "PGP6";
+ return "PGP 6.x";
case CAMEL_PGP_TYPE_GPG:
return "GnuPG";
default:
char passwd_fd[32];
int retval, i;
+ /* check for the now unsupported pgp 2.6.x type */
+ if (context->priv->type == CAMEL_PGP_TYPE_PGP2) {
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ "PGP 2.6.x is no longer supported.");
+ return -1;
+ }
+
/* get the plaintext in a form we can use */
plaintext = g_byte_array_new ();
stream = camel_stream_mem_new ();
camel_object_unref (CAMEL_OBJECT (stream));
if (!plaintext->len) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot sign this message: no plaintext to sign"));
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot sign this message: no plaintext to sign"));
goto exception;
}
pass_free (passphrase);
if (retval != 0 || !*ciphertext) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "%s", diagnostics);
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, diagnostics);
g_free (diagnostics);
g_free (ciphertext);
pgp_forget_passphrase (ctx->session, context->priv->type, (char *) userid);
char passwd_fd[32];
int retval, i;
+ /* check for the now unsupported pgp 2.6.x type */
+ if (context->priv->type == CAMEL_PGP_TYPE_PGP2) {
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ "PGP 2.6.x is no longer supported.");
+ return -1;
+ }
+
/* get the plaintext in a form we can use */
plaintext = g_byte_array_new ();
stream = camel_stream_mem_new ();
camel_object_unref (CAMEL_OBJECT (stream));
if (!plaintext->len) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot sign this message: no plaintext to clearsign"));
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot sign this message: no plaintext to clearsign"));
goto exception;
}
pass_free (passphrase);
if (retval != 0 || !*ciphertext) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "%s", diagnostics);
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, diagnostics);
g_free (diagnostics);
g_free (ciphertext);
pgp_forget_passphrase (ctx->session, context->priv->type, (char *) userid);
char *sigfile = NULL;
int retval, i, clearlen;
+ /* check for the now unsupported pgp 2.6.x type */
+ if (context->priv->type == CAMEL_PGP_TYPE_PGP2) {
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ "PGP 2.6.x is no longer supported.");
+ return NULL;
+ }
+
/* get the plaintext in a form we can use */
plaintext = g_byte_array_new ();
stream = camel_stream_mem_new ();
camel_object_unref (CAMEL_OBJECT (stream));
if (!plaintext->len) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot verify this message: no plaintext to verify"));
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot verify this message: no plaintext to verify"));
goto exception;
}
valid = camel_cipher_validity_new ();
if (retval != 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "%s", diagnostics);
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, diagnostics);
camel_cipher_validity_set_valid (valid, FALSE);
} else {
char passwd_fd[32];
char *passphrase = NULL;
+ /* check for the now unsupported pgp 2.6.x type */
+ if (context->priv->type == CAMEL_PGP_TYPE_PGP2) {
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ "PGP 2.6.x is no longer supported.");
+ return -1;
+ }
+
/* get the plaintext in a form we can use */
plaintext = g_byte_array_new ();
stream = camel_stream_mem_new ();
camel_object_unref (CAMEL_OBJECT (stream));
if (!plaintext->len) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot encrypt this message: no plaintext to encrypt"));
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot encrypt this message: no plaintext to encrypt"));
goto exception;
}
/* check to make sure we have recipients */
if (recipients->len == 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot encrypt this message: no recipients specified"));
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot encrypt this message: no recipients specified"));
goto exception;
}
g_ptr_array_free (argv, TRUE);
if (retval != 0 || !*ciphertext) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "%s", diagnostics);
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, diagnostics);
g_free (diagnostics);
g_free (ciphertext);
if (sign)
char passwd_fd[32];
int retval, i;
+ /* check for the now unsupported pgp 2.6.x type */
+ if (context->priv->type == CAMEL_PGP_TYPE_PGP2) {
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ "PGP 2.6.x is no longer supported.");
+ return -1;
+ }
+
/* get the ciphertext in a form we can use */
ciphertext = g_byte_array_new ();
stream = camel_stream_mem_new ();
camel_object_unref (CAMEL_OBJECT (stream));
if (!ciphertext->len) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot decrypt this message: no ciphertext to decrypt"));
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot decrypt this message: no ciphertext to decrypt"));
goto exception;
}
passphrase = pgp_get_passphrase (ctx->session, context->priv->type, NULL);
if (!passphrase) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_USER_CANCEL,
- _("Cannot decrypt this message: no password provided"));
+ camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
+ _("Cannot decrypt this message: no password provided"));
goto exception;
}
/* gpg returns '1' if it succeedes in decrypting but can't verify the signature */
if (retval != 0 || (context->priv->type == CAMEL_PGP_TYPE_GPG && retval == 1) || !*plaintext) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "%s", diagnostics);
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, diagnostics);
g_free (plaintext);
g_free (diagnostics);