aboutsummaryrefslogtreecommitdiffstats
path: root/gpgmeplug/gpgmeplug.c
diff options
context:
space:
mode:
authorKarl-Heinz Zimmer <[email protected]>2001-11-21 14:18:52 +0000
committerKarl-Heinz Zimmer <[email protected]>2001-11-21 14:18:52 +0000
commit168f43d4ec80279f50cba5fd90369be0b8e42274 (patch)
treeec2f17bb7b9d5ae5c39f560f0c4bc38e0525cda7 /gpgmeplug/gpgmeplug.c
parentconfigure struct updated according to modified cryptplug.h (diff)
downloadgpgme-168f43d4ec80279f50cba5fd90369be0b8e42274.tar.gz
gpgme-168f43d4ec80279f50cba5fd90369be0b8e42274.zip
(security checkin) currently working on signing messages
Diffstat (limited to 'gpgmeplug/gpgmeplug.c')
-rw-r--r--gpgmeplug/gpgmeplug.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gpgmeplug/gpgmeplug.c b/gpgmeplug/gpgmeplug.c
index de772f42..7224511c 100644
--- a/gpgmeplug/gpgmeplug.c
+++ b/gpgmeplug/gpgmeplug.c
@@ -636,29 +636,33 @@ bool signMessage( const char* cleartext,
const char** ciphertext,
const char* certificate )
{
-/*
GpgmeCtx ctx;
GpgmeData data, sig;
+ char buf[1024];
+ size_t nread;
+
+
gpgme_new (&ctx);
gpgme_set_armor (ctx, 1);
gpgme_set_textmode (ctx, 1);
- gpgme_data_new_from_mem (&data, mime_object,
- mime_object_len, TRUE );
+ gpgme_data_new_from_mem (&data, cleartext,
+ strlen( cleartext ), 1 );
gpgme_data_new ( &sig );
gpgme_op_sign (ctx, data, sig, GPGME_SIG_MODE_DETACH );
fputs ( "Content-Type: multipart/signed;\r\n"
" protocol=\"application/pgp-signature\";\r\n"
" boundary=\"42=.42=.42=.42\"\r\n"
- "\r\n--42=.42=.42=.42\r\n", stdout );
+ "\r\n--42=.42=.42=.42\r\n",
+ stdout );
gpgme_data_rewind (data);
while ( !gpgme_data_read (data, buf, sizeof buf, &nread ) ) {
fwrite (buf, nread, 1, stdout );
}
- fputs ( "\r\n--42=.42=.42=.42--\r\n"
+ fputs ( "\r\n--42=.42=.42=.42\r\n"
"Content-Type: application/pgp-signature\r\n\r\n", stdout);
gpgme_data_rewind (sig);
@@ -670,7 +674,7 @@ bool signMessage( const char* cleartext,
gpgme_release (ctx);
gpgme_data_release(data);
gpgme_data_release(sig);
-*/
+
return true;
}