added the ability to produce raw signatures, without signer id nor time stamp

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6273 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-03-22 23:54:54 +00:00
parent ae49bbc1ac
commit 404e9362dc
4 changed files with 15 additions and 8 deletions

View file

@ -986,7 +986,7 @@ bool PGPHandler::decryptTextFromFile(const PGPIdType&,std::string& text,const st
return (bool)res ;
}
bool PGPHandler::SignDataBin(const PGPIdType& id,const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen)
bool PGPHandler::SignDataBin(const PGPIdType& id,const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,bool use_raw_signature)
{
RsStackMutex mtx(pgphandlerMtx) ; // lock access to PGP memory structures.
// need to find the key and to decrypt it.
@ -1022,7 +1022,8 @@ bool PGPHandler::SignDataBin(const PGPIdType& id,const void *data, const uint32_
// then do the signature.
ops_memory_t *memres = ops_sign_buf(data,len,(ops_sig_type_t)0x00,secret_key,ops_false,ops_false) ;
ops_boolean_t not_raw = !use_raw_signature ;
ops_memory_t *memres = ops_sign_buf(data,len,(ops_sig_type_t)0x00,secret_key,ops_false,ops_false,not_raw,not_raw) ;
if(!memres)
return false ;

View file

@ -88,7 +88,7 @@ class PGPHandler
std::string SaveCertificateToString(const PGPIdType& id,bool include_signatures) const ;
bool exportPublicKey(const PGPIdType& id,unsigned char *& mem,size_t& mem_size,bool armoured,bool include_signatures) const ;
bool SignDataBin(const PGPIdType& id,const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen) ;
bool SignDataBin(const PGPIdType& id,const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,bool make_raw_signature=false) ;
bool VerifySignBin(const void *data, uint32_t data_len, unsigned char *sign, unsigned int sign_len, const PGPFingerprintType& withfingerprint) ;
bool privateSignCertificate(const PGPIdType& own_id,const PGPIdType& id_of_key_to_sign) ;