Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Refactoring: added packUniqueData(..) function #2229

Merged
merged 1 commit into from
Jan 24, 2022

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Jan 21, 2022

The code related to forming an original data packet for sending has been moved to a separate function packUniqueData(..).
The encryption of the payload has been moved inside that function as well, as it is only needed to encrypt the original payload. Once encrypted, it is stored so in the sender buffer, thus the second encryption call is needed when the packet is being retransmitted.
Moving the encryption inside the packUniqueData(..) also means that packet timestamp and destination socket ID are not yet set in the header of the packet. However, only the packet sequence number is used as the counter for the AES encryption, therefore this change is safe.

Changes extracted from PR #2180.

Tests

Checked encryption and decryption including KM refresh using srt-xtransmit:

(receiver)
./srt-xtransmit receive "srt://:4200?passphrase=abcdefghij" --enable-metrics -v

(sender)
./srt-xtransmit generate "srt://127.0.0.1:4200?passphrase=abcdefghij&kmrefreshrate=1000&kmpreannounce=200" \
                         --enable-metrics --sendrate 10Mbps --duration 60s -v

@maxsharabayko maxsharabayko added Type: Maintenance Work required to maintain or clean up the code [core] Area: Changes in SRT library core labels Jan 21, 2022
@maxsharabayko maxsharabayko added this to the v1.4.5 milestone Jan 21, 2022
@maxsharabayko maxsharabayko self-assigned this Jan 21, 2022
@maxsharabayko maxsharabayko changed the title [core] Refactoring: added packUniqueData(..) func [core] Refactoring: added packUniqueData(..) function Jan 21, 2022
@maxsharabayko maxsharabayko merged commit a31e618 into Haivision:master Jan 24, 2022
@maxsharabayko maxsharabayko deleted the develop/pack-unique branch January 24, 2022 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant