mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-05 01:25:39 -05:00
Merge pull request #73 from AsamK/fix_tlv_deserialization
Fix subtle bug in tlv deserialization of TLV_TYPE_KEYSIGNATURETYPE
This commit is contained in:
commit
296ffd2f2d
@ -649,7 +649,6 @@ bool RsTlvKeySignatureSet::GetTlv(void *data, uint32_t size, uint32_t *offset)
|
|||||||
|
|
||||||
/* get the next type */
|
/* get the next type */
|
||||||
uint16_t tlvsubtype = GetTlvType( &(((uint8_t *) data)[*offset]) );
|
uint16_t tlvsubtype = GetTlvType( &(((uint8_t *) data)[*offset]) );
|
||||||
SignType currType;
|
|
||||||
|
|
||||||
switch(tlvsubtype)
|
switch(tlvsubtype)
|
||||||
{
|
{
|
||||||
@ -659,16 +658,13 @@ bool RsTlvKeySignatureSet::GetTlv(void *data, uint32_t size, uint32_t *offset)
|
|||||||
ok &= sign.GetTlv(data, size, offset);
|
ok &= sign.GetTlv(data, size, offset);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
keySignSet[currType] = sign;
|
keySignSet[sign_type] = sign;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TLV_TYPE_KEYSIGNATURETYPE:
|
case TLV_TYPE_KEYSIGNATURETYPE:
|
||||||
{
|
{
|
||||||
ok = GetTlvUInt32(data, size, offset, TLV_TYPE_KEYSIGNATURETYPE, &sign_type);
|
ok = GetTlvUInt32(data, size, offset, TLV_TYPE_KEYSIGNATURETYPE, &sign_type);
|
||||||
|
|
||||||
if(ok)
|
|
||||||
currType = sign_type;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user