Added connexion to the msg system and fingerprint into grouter addresses. flushing current changes before 0.6 merge.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7072 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-01-30 22:14:37 +00:00
parent 1aa2e221d2
commit e12929d9d7
8 changed files with 90 additions and 19 deletions

View file

@ -288,6 +288,38 @@ bool setRawSSLId(void *data,uint32_t size,uint32_t *offset,const SSLIdType& cs)
return true ;
}
bool getRawPGPFingerprint(void *data,uint32_t size,uint32_t *offset,PGPFingerprintType& cs)
{
uint32_t len = 20 ; // SSL id type
/* check there is space for string */
if (size < *offset + len)
{
std::cerr << "getRawPGPFingerprint() not enough size" << std::endl;
return false;
}
bool ok = true ;
cs = PGPFingerprintType(&((uint8_t*)data)[*offset]) ;
*offset += 20 ;
return ok ;
}
bool setRawPGPFingerprint(void *data,uint32_t size,uint32_t *offset,const PGPFingerprintType& cs)
{
uint32_t len = 20 ; // SHA1 length in bytes
if (size < *offset + len)
{
std::cerr << "setRawPGPFingerprint() Not enough size" << std::endl;
return false;
}
memcpy((void *) &(((uint8_t *) data)[*offset]), cs.toByteArray(), 20);
*offset += 20 ;
return true ;
}
bool getRawString(void *data, uint32_t size, uint32_t *offset, std::string &outStr)
{
uint32_t len = 0;