diff options
Diffstat (limited to 'camel/camel-pkcs7-context.c')
-rw-r--r-- | camel/camel-pkcs7-context.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/camel/camel-pkcs7-context.c b/camel/camel-pkcs7-context.c index 7d9091758a..fee277e079 100644 --- a/camel/camel-pkcs7-context.c +++ b/camel/camel-pkcs7-context.c @@ -412,18 +412,18 @@ pkcs7_clearsign (CamelCipherContext *ctx, const char *userid, CamelCipherHash ha #if 0 /* this is just meant as a reference so I can see what the valid enums are */ typedef enum { - certUsageSSLClient, - certUsageSSLServer, - certUsageSSLServerWithStepUp, - certUsageSSLCA, - certUsageEmailSigner, - certUsageEmailRecipient, - certUsageObjectSigner, - certUsageUserCertImport, - certUsageVerifyCA, - certUsageProtectedObjectSigner, - certUsageStatusResponder, - certUsageAnyCA + certUsageSSLClient, + certUsageSSLServer, + certUsageSSLServerWithStepUp, + certUsageSSLCA, + certUsageEmailSigner, + certUsageEmailRecipient, + certUsageObjectSigner, + certUsageUserCertImport, + certUsageVerifyCA, + certUsageProtectedObjectSigner, + certUsageStatusResponder, + certUsageAnyCA } SECCertUsage; #endif @@ -509,6 +509,9 @@ pkcs7_verify (CamelCipherContext *ctx, CamelCipherHash hash, CamelStream *istrea SEC_PKCS7DestroyContentInfo (cinfo); + /* FIXME: set a meaningful description...in UTF8 */ + camel_cipher_validity_set_description (valid, ""); + return valid; } @@ -549,9 +552,17 @@ pkcs7_encrypt (CamelCipherContext *ctx, gboolean sign, const char *userid, GPtrA goto exception; } - cinfo = SEC_PKCS7CreateEnvelopedData (cert, certUsageEmailRecipient, - NULL, SEC_OID_DES_EDE3_CBC, 0, - NULL, NULL); + data = g_new (struct _GetPasswdData, 1); + data->session = session; + data->userid = userid; + data->ex = ex; + + /* FIXME: extend CamelCipherContext to allow selecting an encryption algorithm?? */ + cinfo = SEC_PKCS7CreateEncryptedData (SEC_OID_DES_EDE3_CBC, 0, + get_password, data); + + g_free (data); + if (!cinfo) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Could not encrypt: failed to create enveloped data.")); |