mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 10:46:23 +00:00
Reconstruct encryption / signature flags
This commit is contained in:
parent
8c49e0e486
commit
337d428f44
@ -283,6 +283,9 @@ int overlay_mdp_decrypt(struct overlay_frame *f, overlay_mdp_frame *mdp)
|
||||
unsigned char *b = NULL;
|
||||
unsigned char plain_block[len+16];
|
||||
|
||||
/* Indicate MDP message type */
|
||||
mdp->packetTypeAndFlags=MDP_TX;
|
||||
|
||||
switch(f->modifiers&OF_CRYPTO_BITS) {
|
||||
case 0:
|
||||
/* get payload */
|
||||
@ -366,9 +369,6 @@ int overlay_mdp_decrypt(struct overlay_frame *f, overlay_mdp_frame *mdp)
|
||||
int version=(b[0]<<8)+b[1];
|
||||
if (version!=0x0101) RETURN(WHY("Saw unsupported MDP frame version"));
|
||||
|
||||
/* Indicate MDP message type */
|
||||
mdp->packetTypeAndFlags=MDP_TX;
|
||||
|
||||
/* extract MDP port numbers */
|
||||
mdp->in.src.port=(b[2]<<24)+(b[3]<<16)+(b[4]<<8)+b[5];
|
||||
mdp->in.dst.port=(b[6]<<24)+(b[7]<<16)+(b[8]<<8)+b[9];
|
||||
@ -497,7 +497,8 @@ int overlay_saw_mdp_frame(overlay_mdp_frame *mdp, time_ms_t now)
|
||||
if (mdp->out.payload_length<1) {
|
||||
RETURN(WHY("Empty DID in DNA resolution request")); }
|
||||
bcopy(&mdp->out.payload[0],&did[0],pll);
|
||||
did[pll]=0;
|
||||
did[pll]=0;
|
||||
|
||||
int results=0;
|
||||
while(keyring_find_did(keyring,&cn,&in,&kp,did))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user