mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
implemented efficient signature merging. Not fully tested yet!
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-OpenPGP@5223 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f50edd228f
commit
1b58ef74f8
5 changed files with 85 additions and 18 deletions
|
@ -9,10 +9,6 @@
|
|||
/* #define DEBUG_PGPUTIL 1 */
|
||||
/****************************/
|
||||
|
||||
#define PGP_PACKET_TAG_PUBLIC_KEY 6
|
||||
#define PGP_PACKET_TAG_USER_ID 13
|
||||
#define PGP_PACKET_TAG_SIGNATURE 2
|
||||
|
||||
#define PGP_CRC24_INIT 0xB704CEL
|
||||
#define PGP_CRC24_POLY 0x1864CFBL
|
||||
|
||||
|
@ -85,11 +81,11 @@ bool PGPKeyManagement::createMinimalKey(const std::string& pgp_certificate,std::
|
|||
|
||||
data += packet_length ;
|
||||
|
||||
if(packet_tag == PGP_PACKET_TAG_PUBLIC_KEY)
|
||||
if(packet_tag == PGPKeyParser::PGP_PACKET_TAG_PUBLIC_KEY)
|
||||
public_key = true ;
|
||||
if(packet_tag == PGP_PACKET_TAG_USER_ID)
|
||||
if(packet_tag == PGPKeyParser::PGP_PACKET_TAG_USER_ID)
|
||||
user_id = true ;
|
||||
if(packet_tag == PGP_PACKET_TAG_SIGNATURE)
|
||||
if(packet_tag == PGPKeyParser::PGP_PACKET_TAG_SIGNATURE)
|
||||
own_signature = true ;
|
||||
|
||||
if(public_key && own_signature && user_id)
|
||||
|
|
|
@ -71,6 +71,10 @@ class PGPKeyManagement
|
|||
class PGPKeyParser
|
||||
{
|
||||
public:
|
||||
static const uint8_t PGP_PACKET_TAG_PUBLIC_KEY = 6 ;
|
||||
static const uint8_t PGP_PACKET_TAG_USER_ID = 13 ;
|
||||
static const uint8_t PGP_PACKET_TAG_SIGNATURE = 2 ;
|
||||
|
||||
static uint64_t read_KeyID(unsigned char *& data) ;
|
||||
static uint32_t read_125Size(unsigned char *& data) ;
|
||||
static uint32_t read_partialBodyLength(unsigned char *& data) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue