diff options
| author | Karl-Heinz Zimmer <[email protected]> | 2001-11-25 03:37:13 +0000 | 
|---|---|---|
| committer | Karl-Heinz Zimmer <[email protected]> | 2001-11-25 03:37:13 +0000 | 
| commit | 49b7969a491f798607f5abc14b716246c5bf3021 (patch) | |
| tree | 7886ffe261240b238f9108bd0dd378fd2da719d8 | |
| parent | Guess what. (diff) | |
| download | gpgme-49b7969a491f798607f5abc14b716246c5bf3021.tar.gz gpgme-49b7969a491f798607f5abc14b716246c5bf3021.zip | |
adjusted 'encryptMessage' parameters: now also the addressee is given
Diffstat (limited to '')
| -rw-r--r-- | gpgmeplug/cryptplug.h | 8 | ||||
| -rw-r--r-- | gpgmeplug/gpgmeplug.c | 33 | 
2 files changed, 17 insertions, 24 deletions
| diff --git a/gpgmeplug/cryptplug.h b/gpgmeplug/cryptplug.h index 73176fab..e809fca1 100644 --- a/gpgmeplug/cryptplug.h +++ b/gpgmeplug/cryptplug.h @@ -833,9 +833,9 @@ void appendDirectoryServer( const char* servername, int port,  /*! \ingroup groupConfigDir  */  struct DirectoryServer { -    const char* servername; +    char* servername;      int port; -    const char* description; +    char* description;  }; @@ -952,7 +952,9 @@ bool storeCertificatesFromMessage( const char* ciphertext );            \c true, otherwise            \c false.  */ -bool encryptMessage( const char* cleartext, const char** ciphertext ); +bool encryptMessage( const char*  cleartext, +                     const char** ciphertext, +                     const char*  addressee );  /*! \ingroup groupCryptAct     \brief Combines the functionality of diff --git a/gpgmeplug/gpgmeplug.c b/gpgmeplug/gpgmeplug.c index b2e61bb0..03e1a92f 100644 --- a/gpgmeplug/gpgmeplug.c +++ b/gpgmeplug/gpgmeplug.c @@ -755,34 +755,21 @@ bool signMessage( const char*  cleartext,    gpgme_data_new ( &sig );    gpgme_op_sign (ctx, data, sig, GPGME_SIG_MODE_DETACH ); -  rData = gpgme_data_release_and_get_mem( data, &rDLen );    rSig  = gpgme_data_release_and_get_mem( sig,  &rSLen ); +  gpgme_release( data ); -  *ciphertext = malloc( rDLen + rSLen + 1000 ); +  *ciphertext = malloc( rSLen + 1 );    if( *ciphertext ) { -/* -    strcpy( (char*)*ciphertext, -            "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\r\n" ); -*/ -/* -    strcpy( (char*)*ciphertext, "--42=.42=.42=.42\r\n" -            "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n" -            "Content-Transfer-Encoding: 7bit\r\n\r\n" ); -    strncat((char*)*ciphertext, rData, rDLen ); -    strcat( (char*)*ciphertext, -            "\r\n\r\n--42=.42=.42=.42\r\n" -            "Content-Type: application/pgp-signature\r\n\r\n" ); -*/ -    strncpy((char*)*ciphertext, rSig, rSLen ); +    if( rSLen ) { +      bOk = true; +      strncpy((char*)*ciphertext, rSig, rSLen ); +    }      ((char*)(*ciphertext))[rSLen] = 0;    }    gpgme_release (ctx); -  return true; +  return bOk;  }  bool checkMessageSignature( const char* ciphertext, const char** @@ -793,7 +780,11 @@ bool storeCertificatesFromMessage(  bool encryptMessage( const char* cleartext, -                     const char** ciphertext ){ return true; } +                     const char** ciphertext, +                     const char* addressee ) +{ +  return true; +}  bool encryptAndSignMessage( const char* cleartext,            const char** ciphertext, const char* certificate, | 
