diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-04-21 05:21:34 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-04-21 05:21:34 +0800 |
commit | 986252ceaf4239d36294d90e75c6acd305e06dfa (patch) | |
tree | 199ef1cc4117b3a9065f0052e7cbca6f42ba4b33 /camel/camel-pkcs7-context.c | |
parent | c36302e415de5eabc850fac77ff570a40d8e129e (diff) | |
download | gsoc2013-evolution-986252ceaf4239d36294d90e75c6acd305e06dfa.tar.gz gsoc2013-evolution-986252ceaf4239d36294d90e75c6acd305e06dfa.tar.zst gsoc2013-evolution-986252ceaf4239d36294d90e75c6acd305e06dfa.zip |
Implemented using the secmime.h convenience functions. (smime_clearsign):
2001-04-20 Jeffrey Stedfast <fejj@ximian.com>
* camel-smime-context.c (smime_sign): Implemented using the
secmime.h convenience functions.
(smime_clearsign): We just error our here, there is no clearsign
for smime.
(smime_verify): Copied code over from the pkcs7 verify - same
state, ugly and unknown :-)
(smime_encrypt): Implemented using the secmime.h convenience
functions.
(smime_decrypt): Same as the code in pkcs7-context.
svn path=/trunk/; revision=9480
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.")); |