mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #421 from PhenomRetroShare/Fix_UnitTestCompilation
Fix UnitTest Compilation
This commit is contained in:
commit
bc04f3c94b
@ -155,7 +155,7 @@ public:
|
||||
* @return a pointer to a valid profile if successful, otherwise NULL
|
||||
*
|
||||
*/
|
||||
bool getKey(const RsGxsId &id, RsTlvPrublicRSAKey& key){ return false; }
|
||||
bool getKey(const RsGxsId &id, RsTlvPublicRSAKey& key){ return false; }
|
||||
bool getPrivateKey(const RsGxsId &id, RsTlvPrivateRSAKey& key){ return false; } // For signing outgoing messages.
|
||||
|
||||
private:
|
||||
|
@ -35,8 +35,8 @@
|
||||
|
||||
TEST(libretroshare_gxs, GxsSecurity)
|
||||
{
|
||||
RsTlvSecurityKey_deprecated pub_key ;
|
||||
RsTlvSecurityKey_deprecated priv_key ;
|
||||
RsTlvPublicRSAKey pub_key ;
|
||||
RsTlvPrivateRSAKey priv_key ;
|
||||
|
||||
EXPECT_TRUE(GxsSecurity::generateKeyPair(pub_key,priv_key)) ;
|
||||
|
||||
@ -45,7 +45,7 @@ TEST(libretroshare_gxs, GxsSecurity)
|
||||
EXPECT_TRUE( pub_key.keyId == priv_key.keyId );
|
||||
EXPECT_TRUE( pub_key.startTS == priv_key.startTS );
|
||||
|
||||
RsTlvSecurityKey_deprecated pub_key2 ;
|
||||
RsTlvPublicRSAKey pub_key2 ;
|
||||
EXPECT_TRUE(GxsSecurity::extractPublicKey(priv_key,pub_key2)) ;
|
||||
|
||||
EXPECT_TRUE( pub_key.keyId == pub_key2.keyId );
|
||||
|
@ -70,7 +70,7 @@ void init_item(RsTlvSecurityKeySet& ks)
|
||||
RsGxsId a_str;
|
||||
a_str = RsGxsId::random();
|
||||
|
||||
RsTlvSecurityKey_deprecated& a_key = ks.keys[a_str];
|
||||
RsTlvPublicRSAKey& a_key = ks.public_keys[a_str];
|
||||
init_item(a_key);
|
||||
a_key.keyId = a_str;
|
||||
}
|
||||
@ -81,10 +81,10 @@ bool operator==(const RsTlvSecurityKeySet& l, const RsTlvSecurityKeySet& r)
|
||||
|
||||
if(l.groupId != r.groupId) return false;
|
||||
|
||||
std::map<RsGxsId, RsTlvSecurityKey_deprecated>::const_iterator l_cit = l.keys.begin(),
|
||||
r_cit = r.keys.begin();
|
||||
std::map<RsGxsId, RsTlvPublicRSAKey>::const_iterator l_cit = l.public_keys.begin(),
|
||||
r_cit = r.public_keys.begin();
|
||||
|
||||
for(; l_cit != l.keys.end(); l_cit++, r_cit++){
|
||||
for(; l_cit != l.public_keys.end(); l_cit++, r_cit++){
|
||||
if(l_cit->first != r_cit->first) return false;
|
||||
if(!(l_cit->second == r_cit->second)) return false;
|
||||
}
|
||||
@ -94,7 +94,7 @@ bool operator==(const RsTlvSecurityKeySet& l, const RsTlvSecurityKeySet& r)
|
||||
|
||||
|
||||
|
||||
bool operator==(const RsTlvSecurityKey_deprecated& sk1, const RsTlvSecurityKey_deprecated& sk2)
|
||||
bool operator==(const RsTlvPublicRSAKey& sk1, const RsTlvPublicRSAKey& sk2)
|
||||
{
|
||||
|
||||
if(sk1.startTS != sk2.startTS) return false;
|
||||
@ -183,7 +183,7 @@ bool operator==(const RsTlvBinaryData& bd1, const RsTlvBinaryData& bd2)
|
||||
}
|
||||
|
||||
|
||||
void init_item(RsTlvSecurityKey_deprecated& sk)
|
||||
void init_item(RsTlvPublicRSAKey& sk)
|
||||
{
|
||||
int randnum = rand()%313131;
|
||||
|
||||
|
@ -58,7 +58,7 @@ void randString(const uint32_t, std::wstring&);
|
||||
|
||||
/* for testing compound tlv items */
|
||||
|
||||
void init_item(RsTlvSecurityKey_deprecated&);
|
||||
void init_item(RsTlvPublicRSAKey&);
|
||||
void init_item(RsTlvSecurityKeySet&);
|
||||
void init_item(RsTlvKeySignature&);
|
||||
void init_item(RsTlvKeySignatureSet&);
|
||||
@ -70,7 +70,7 @@ void init_item(RsTlvPeerIdSet&);
|
||||
void init_item(RsTlvImage&);
|
||||
void init_item(RsTlvPeerIdSet&);
|
||||
|
||||
bool operator==(const RsTlvSecurityKey_deprecated&, const RsTlvSecurityKey_deprecated& );
|
||||
bool operator==(const RsTlvPublicRSAKey&, const RsTlvPublicRSAKey& );
|
||||
bool operator==(const RsTlvSecurityKeySet&, const RsTlvSecurityKeySet& );
|
||||
bool operator==(const RsTlvKeySignature&, const RsTlvKeySignature& );
|
||||
bool operator==(const RsTlvBinaryData&, const RsTlvBinaryData&);
|
||||
|
@ -65,10 +65,10 @@ bool test_SetTlvItem(RsTlvItem *item, uint16_t type, void *data, uint32_t size,
|
||||
|
||||
int test_TlvRandom(void *data, uint32_t len, uint32_t offset)
|
||||
{
|
||||
uint32_t tmpoffset = 0;
|
||||
//uint32_t tmpoffset = 0;
|
||||
|
||||
/* List of all the TLV types it could be! */
|
||||
RsTlvSecurityKey_deprecated skey;
|
||||
RsTlvPublicRSAKey skey;
|
||||
RsTlvSecurityKeySet skeyset;
|
||||
RsTlvKeySignature keysign;
|
||||
|
||||
@ -114,7 +114,7 @@ int test_TlvRandom(void *data, uint32_t len, uint32_t offset)
|
||||
EXPECT_TRUE(test_SetTlvItem(&kv, TLV_TYPE_KEYVALUE, data, len, offset));
|
||||
EXPECT_TRUE(test_SetTlvItem(&kvset, TLV_TYPE_KEYVALUESET, data, len, offset));
|
||||
std::cerr << "test_TlvRandom:: Testing Keys (TYPESET)" << std::endl;
|
||||
EXPECT_TRUE(test_SetTlvItem(&skey, TLV_TYPE_SECURITYKEY_deprecated, data, len, offset));
|
||||
EXPECT_TRUE(test_SetTlvItem(&skey, TLV_TYPE_SECURITY_KEY, data, len, offset));
|
||||
EXPECT_TRUE(test_SetTlvItem(&skeyset, TLV_TYPE_SECURITYKEYSET, data, len, offset));
|
||||
EXPECT_TRUE(test_SetTlvItem(&keysign, TLV_TYPE_KEYSIGNATURE, data, len, offset));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user