Provide a software-only solution using the CCSDS Space Data Link Security Protocol - Extended Procedures (SDLS-EP) to secure communications between a spacecraft running the core Flight System (cFS) and a ground station.
Currently, the Crypto_Key_OTAR works only with an IV with length 12 bytes.
As you can see below, the value 30 is calculating by summing the Session Key ID (2 bytes), the IV len (12 bytes) and the MAC len (16 bytes):
int pdu_keys = (sdls_frame.pdu.pdu_len - 30) / (2 + KEY_SIZE);
Moreover, keys are extracted from the 14th byte (2 bytes for Session Key ID and 12 bytes for IV):
gcry_error = gcry_cipher_decrypt(
tmp_hd,
&(sdls_frame.pdu.data[14]), // plaintext output
pdu_keys * (2 + KEY_SIZE), // length of data
NULL, // in place decryption
0 // in data length
);
for (int count = 14; x < pdu_keys; x++)
The IV len for OTAR should be a managed parameter so I suggest to add it as a DEFINE.
Currently, the Crypto_Key_OTAR works only with an IV with length 12 bytes.
As you can see below, the value 30 is calculating by summing the Session Key ID (2 bytes), the IV len (12 bytes) and the MAC len (16 bytes):
Moreover, keys are extracted from the 14th byte (2 bytes for Session Key ID and 12 bytes for IV):
The IV len for OTAR should be a managed parameter so I suggest to add it as a DEFINE.