aboutsummaryrefslogtreecommitdiffstats
path: root/gpgmeplug/gpgmeplug.c
diff options
context:
space:
mode:
authorKarl-Heinz Zimmer <[email protected]>2002-03-05 21:23:58 +0000
committerKarl-Heinz Zimmer <[email protected]>2002-03-05 21:23:58 +0000
commit704a1b05b324ca30ed9dd0dbbbfc849f8f56b914 (patch)
treee0b8c3123a1d08a115ed96be7c15263a1c16c3c6 /gpgmeplug/gpgmeplug.c
parent2002-03-05 Marcus Brinkmann <[email protected]> (diff)
downloadgpgme-704a1b05b324ca30ed9dd0dbbbfc849f8f56b914.tar.gz
gpgme-704a1b05b324ca30ed9dd0dbbbfc849f8f56b914.zip
Changed interface: additionally we now pass the following parameters into the checkMessageSignature function: bool signatureIsBinary - telling us whether the signature is armored ASCII or binary data, int signatureLen - holding the TRUE length of the signature if (and only if) this is binary data
Diffstat (limited to '')
-rw-r--r--gpgmeplug/gpgmeplug.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gpgmeplug/gpgmeplug.c b/gpgmeplug/gpgmeplug.c
index 0de5d491..d9d8ea1f 100644
--- a/gpgmeplug/gpgmeplug.c
+++ b/gpgmeplug/gpgmeplug.c
@@ -865,7 +865,7 @@ bool signMessage( const char* cleartext,
break;
}
gpgme_set_include_certs (ctx, sendCerts);
-
+
// PENDING(g10) Implement this
//gpgme_set_signature_algorithm( ctx, config.signatureAlgorithm );
@@ -973,6 +973,8 @@ sig_status_to_string( GpgmeSigStat status )
bool checkMessageSignature( const char* ciphertext,
const char* signaturetext,
+ bool signatureIsBinary,
+ int signatureLen,
struct SignatureMetaData* sigmeta )
{
GpgmeCtx ctx;
@@ -987,10 +989,18 @@ bool checkMessageSignature( const char* ciphertext,
gpgme_new( &ctx );
gpgme_set_protocol (ctx, GPGMEPLUG_PROTOCOL);
+ gpgme_set_armor (ctx, signatureIsBinary ? 0 : 1);
+// gpgme_set_textmode (ctx, signatureIsBinary ? 0 : 1);
+
gpgme_data_new_from_mem( &datapart, ciphertext,
1+strlen( ciphertext ), 1 );
- gpgme_data_new_from_mem( &sigpart, signaturetext,
- 1+strlen( signaturetext ), 1 );
+
+ gpgme_data_new_from_mem( &sigpart,
+ signaturetext,
+ signatureIsBinary
+ ? signatureLen
+ : (1+strlen( signaturetext )),
+ 1 );
gpgme_op_verify( ctx, sigpart, datapart, &status );
gpgme_data_release( datapart );