* Information about the recipients of an encrypted text is now
available at decryption time.
+ * New status GPGME_STATUS_PLAINTEXT. This is analyzed by the decrypt
+ and verify handlers, the information about the plaintext filename,
+ if available is made available in the new field plaintext_filename
+ of the respective result structure.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gpgme_set_engine_info NEW
gpgme_ctx_get_engine_info NEW
GPGME_STATUS_SC_OP_SUCCESS NEW
GPGME_STATUS_CARDCTRL NEW
GPGME_STATUS_BACKUP_KEY_CREATED NEW
+gpgme_decrypt_result_t EXTENDED: New field plaintext_filename.
+gpgme_verify_result_t EXTENDED: New field plaintext_filename.
+GPGME_STATUS_PLAINTEXT NEW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+2005-07-27 Marcus Brinkmann <marcus@g10code.de>
+
+ * gpgme.texi (Decrypt): Add plaintext_filename to
+ gpgme_decrypt_result_t.
+ (Verify): Likewise for gpgme_verify_result_t.
+
2005-06-03 Marcus Brinkmann <marcus@g10code.de>
* gpgme.texi (Verify): Add information about new fields in
@item gpgme_recipient_t recipient
This is a linked list of recipients to which this message was encrypted.
+
+@item char *plaintext_filename
+This is the filename of the original plaintext message file if it is
+known, otherwise this is a null pointer.
@end table
@end deftp
@item gpgme_signature_t signatures
A linked list with information about all signatures for which a
verification was attempted.
+
+@item char *plaintext_filename
+This is the filename of the original plaintext message file if it is
+known, otherwise this is a null pointer.
@end table
@end deftp
+2005-07-27 Marcus Brinkmann <marcus@g10code.de>
+
+ * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
+ (struct _gpgme_op_decrypt_result): New member plaintext_filename.
+ (struct _gpgme_op_verify_result): Likewise.
+ * ops.h (_gpgme_parse_plaintext): Add prototype.
+ * op-support.c (_gpgme_parse_plaintext): New function.
+ * decrypt.c (release_op_data): Release
+ OPD->result.plaintext_filename.
+ (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
+ * verify.c (release_op_data): Release
+ OPD->result.plaintext_filename.
+ (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
+
2005-07-26 Marcus Brinkmann <marcus@g10code.de>
* keylist.c (gpgme_get_key): Allow key IDs.
if (opd->result.unsupported_algorithm)
free (opd->result.unsupported_algorithm);
+
+ if (opd->result.plaintext_filename)
+ free (opd->result.plaintext_filename);
}
}
break;
+ case GPGME_STATUS_PLAINTEXT:
+ err = _gpgme_parse_plaintext (args, &opd->result.plaintext_filename);
+ if (err)
+ return err;
+
default:
break;
}
GPGME_STATUS_SC_OP_FAILURE,
GPGME_STATUS_SC_OP_SUCCESS,
GPGME_STATUS_CARDCTRL,
- GPGME_STATUS_BACKUP_KEY_CREATED
+ GPGME_STATUS_BACKUP_KEY_CREATED,
+
+ GPGME_STATUS_PLAINTEXT
}
gpgme_status_code_t;
int _unused : 31;
gpgme_recipient_t recipients;
+
+ /* The original filename of the plaintext message, if available. */
+ char *plaintext_filename;
};
typedef struct _gpgme_op_decrypt_result *gpgme_decrypt_result_t;
struct _gpgme_op_verify_result
{
gpgme_signature_t signatures;
+
+ /* The original filename of the plaintext message, if available. */
+ char *plaintext_filename;
};
typedef struct _gpgme_op_verify_result *gpgme_verify_result_t;
}
\f
+/* Parse the INV_RECP status line in ARGS and return the result in
+ KEY. */
gpgme_error_t
_gpgme_parse_inv_recp (char *args, gpgme_invalid_key_t *key)
{
*key = inv_key;
return 0;
}
+
+
+/* Parse the PLAINTEXT status line in ARGS and return the result in
+ FILENAMEP. */
+gpgme_error_t
+_gpgme_parse_plaintext (char *args, char **filenamep)
+{
+ char *tail;
+
+ while (*args == ' ')
+ args++;
+ if (*args == '\0')
+ return 0;
+
+ /* First argument is file type. */
+ while (*args != ' ' && *args != '\0')
+ args++;
+ while (*args == ' ')
+ args++;
+ if (*args == '\0')
+ return 0;
+
+ /* Second argument is the timestamp. */
+ while (*args != ' ' && *args != '\0')
+ args++;
+ while (*args == ' ')
+ args++;
+ if (*args == '\0')
+ return 0;
+
+ tail = args;
+ while (*tail != ' ' && *tail != '\0')
+ tail++;
+ *tail = '\0';
+ if (filenamep && *args != '\0')
+ {
+ char *filename = strdup (args);
+ if (!filename)
+ return gpg_error_from_errno (errno);
+
+ *filenamep = filename;
+ }
+ return 0;
+}
KEY. */
gpgme_error_t _gpgme_parse_inv_recp (char *args, gpgme_invalid_key_t *key);
+/* Parse the PLAINTEXT status line in ARGS and return the result in
+ FILENAMEP. */
+gpgme_error_t _gpgme_parse_plaintext (char *args, char **filenamep);
+
+
\f
/* From verify.c. */
gpgme_error_t _gpgme_op_verify_init_result (gpgme_ctx_t ctx);
free (sig);
sig = next;
}
+
+ if (opd->result.plaintext_filename)
+ free (opd->result.plaintext_filename);
}
opd->only_newsig_seen = 0;
break;
+ case GPGME_STATUS_PLAINTEXT:
+ err = _gpgme_parse_plaintext (args, &opd->result.plaintext_filename);
+ if (err)
+ return err;
+
default:
break;
}