A bunch of multicast work... in progress.
This commit is contained in:
parent
0d2c87fe4e
commit
540ee69773
11 changed files with 139 additions and 911 deletions
|
@ -260,6 +260,27 @@ public:
|
|||
*/
|
||||
ZT_ALWAYS_INLINE const Address &address() const { return _address; }
|
||||
|
||||
/**
|
||||
* Attempt to generate an older type identity from a newer type
|
||||
*
|
||||
* If this identity has its private key this is not transferred to
|
||||
* the downgraded identity.
|
||||
*
|
||||
* @param dest Destination to fill with downgraded identity
|
||||
* @param toType Desired identity type
|
||||
*/
|
||||
inline bool downgrade(Identity &dest,const Type toType)
|
||||
{
|
||||
if ((_type == P384)&&(toType == C25519)) {
|
||||
dest._address = _address;
|
||||
dest._type = C25519;
|
||||
dest._hasPrivate = false;
|
||||
memcpy(dest._pub.c25519,_pub.c25519,ZT_C25519_PUBLIC_KEY_LEN);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize this identity (binary)
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue