Send the generic-key subList request with the generic key - #527
Merged
Merged
Conversation
The i:1 / t:subList form is answered with the generic key, but its request pack was encrypted with the device key. A probe on a GR-Gcloud V3.2.M gateway (PR 507) showed the gateway ignores that pack: device, generic and random keys all got the same answer, 3 units, readable with the generic key. So the request now uses the generic key too, and the form uses one key both ways. The form stays in the union, because it adds units on some gateways.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Send the generic-key subList request with the generic key
Symptom. None visible. The generic-key form (
i:1, envelopet:"subList") of the sub-device list request used the device key for its request pack and the generic key for its reply. @p-monteiro flagged that asymmetry while porting PR 507 to 5.0 (#522).Evidence. @meirlo ran a read-only probe on a GR-Gcloud V3.2.M gateway (comment on #507). A request pack encrypted with the device key, the generic key and a random key all got the same answer: 3 units, readable with the generic key. So the gateway ignores the pack of this form.
Change.
get_subunits_list()encrypts the generic-key form with the generic key. The form now uses one key both ways. It stays in the union with the other two forms, because on some gateways it adds units that the other forms miss.Testing
subCnt0, so discovery never sends this in normal use):get_subunits_list()called directly from the dev container. Bind OK, no form answered, result{'list': []}, one warning, no crash. No command sent.test_vrf.pyharness (fake gateways and units in the dev container): the fake gateway now ignores the request pack of this form, like the real one, and records which key opened it. New check A13 asserts the generic key. 40/40 on this branch; 39/40 on 4.0.9, where only A13 fails (device).ruff check --isolatedshows the same findings as before the change.Notes