-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relax padding requirement in symmetric keys (#6945)
The upgrade of the base64 dependency introduced a padding requirement. Maintain compatibility with previous versions of iotedge by relaxing the padding requirement and accepting both padded and unpadded symmetric keys.
- Loading branch information
1 parent
f7dd1aa
commit 907eef1
Showing
15 changed files
with
442 additions
and
128 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
edgelet/iotedge/test-files/config/dps-symmetric-key-no-pad/certd.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This file is auto-generated by `iotedge config apply` | ||
# Do not edit it manually; any edits will be lost when the command is run again. | ||
|
||
homedir_path = "/var/lib/aziot/certd" | ||
[cert_issuance.aziot-edged-ca] | ||
method = "self_signed" | ||
expiry_days = 90 | ||
|
||
[cert_issuance.aziot-edged-ca-temp] | ||
method = "self_signed" | ||
expiry_days = 90 | ||
|
||
[preloaded_certs] | ||
aziot-edged-trust-bundle = ["aziot-edged-ca"] | ||
|
||
[[principal]] | ||
uid = 5558 | ||
certs = ["aziot-edged-ca", "aziot-edged/module/*", "aziot-edged-ca-temp"] |
1 change: 1 addition & 0 deletions
1
edgelet/iotedge/test-files/config/dps-symmetric-key-no-pad/device-id
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
aziot-identity-service|aziot-identity-service|aziot-identity-ser |
43 changes: 43 additions & 0 deletions
43
edgelet/iotedge/test-files/config/dps-symmetric-key-no-pad/edged.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# This file is auto-generated by `iotedge config apply` | ||
# Do not edit it manually; any edits will be lost when the command is run again. | ||
|
||
hostname = "my-device" | ||
trust_bundle_cert = "aziot-edged-trust-bundle" | ||
auto_reprovisioning_mode = "Dynamic" | ||
homedir = "/var/lib/aziot/edged" | ||
allow_elevated_docker_permissions = true | ||
|
||
[edge_ca.auto_renew] | ||
rotate_key = true | ||
threshold = "80%" | ||
retry = "4%" | ||
|
||
[agent] | ||
name = "edgeAgent" | ||
type = "docker" | ||
imagePullPolicy = "on-create" | ||
|
||
[agent.config] | ||
image = "mcr.microsoft.com/azureiotedge-agent:1.0" | ||
|
||
[agent.config.createOptions] | ||
|
||
[agent.config.auth] | ||
|
||
[agent.env] | ||
|
||
[connect] | ||
workload_uri = "unix:///var/run/iotedge/workload.sock" | ||
management_uri = "unix:///var/run/iotedge/mgmt.sock" | ||
|
||
[listen] | ||
workload_uri = "fd://aziot-edged.workload.socket" | ||
management_uri = "fd://aziot-edged.mgmt.socket" | ||
min_tls_version = "tls1.0" | ||
|
||
[watchdog] | ||
max_retries = "infinite" | ||
|
||
[moby_runtime] | ||
uri = "unix:///var/run/docker.sock" | ||
network = "azure-iot-edge" |
19 changes: 19 additions & 0 deletions
19
edgelet/iotedge/test-files/config/dps-symmetric-key-no-pad/identityd.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This file is auto-generated by `iotedge config apply` | ||
# Do not edit it manually; any edits will be lost when the command is run again. | ||
|
||
hostname = "my-device" | ||
homedir = "/var/lib/aziot/identityd" | ||
|
||
[provisioning] | ||
source = "dps" | ||
global_endpoint = "https://global.azure-devices-provisioning.net/" | ||
scope_id = "0ab1234C5D6" | ||
|
||
[provisioning.attestation] | ||
method = "symmetric_key" | ||
registration_id = "my-device" | ||
symmetric_key = "device-id" | ||
|
||
[[principal]] | ||
uid = 5558 | ||
name = "aziot-edge" |
20 changes: 20 additions & 0 deletions
20
edgelet/iotedge/test-files/config/dps-symmetric-key-no-pad/keyd.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This file is auto-generated by `iotedge config apply` | ||
# Do not edit it manually; any edits will be lost when the command is run again. | ||
|
||
[aziot_keys] | ||
homedir_path = "/var/lib/aziot/keyd" | ||
|
||
[preloaded_keys] | ||
device-id = "file:///var/secrets/aziot/keyd/device-id" | ||
|
||
[[principal]] | ||
uid = 5556 | ||
keys = ["aziot_identityd_master_id", "device-id"] | ||
|
||
[[principal]] | ||
uid = 5555 | ||
keys = ["aziot-edged-ca", "aziot-edged-ca-temp"] | ||
|
||
[[principal]] | ||
uid = 5558 | ||
keys = ["aziot-edged-ca", "iotedge_master_encryption_id", "aziot-edged-ca-temp"] |
57 changes: 57 additions & 0 deletions
57
edgelet/iotedge/test-files/config/dps-symmetric-key-no-pad/super-config.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
auto_reprovisioning_mode = "Dynamic" | ||
hostname = "my-device" | ||
|
||
[provisioning] | ||
source = "dps" | ||
global_endpoint = "https://global.azure-devices-provisioning.net/" | ||
id_scope = "0ab1234C5D6" | ||
|
||
[provisioning.attestation] | ||
method = "symmetric_key" | ||
registration_id = "my-device" | ||
|
||
[provisioning.attestation.symmetric_key] | ||
value = "YXppb3QtaWRlbnRpdHktc2VydmljZXxhemlvdC1pZGVudGl0eS1zZXJ2aWNlfGF6aW90LWlkZW50aXR5LXNlcg" | ||
|
||
[aziot_keys] | ||
|
||
[preloaded_keys] | ||
|
||
[cert_issuance] | ||
|
||
[preloaded_certs] | ||
|
||
[tpm] | ||
|
||
[agent] | ||
name = "edgeAgent" | ||
type = "docker" | ||
imagePullPolicy = "on-create" | ||
|
||
[agent.config] | ||
image = "mcr.microsoft.com/azureiotedge-agent:1.0" | ||
|
||
[agent.config.createOptions] | ||
|
||
[agent.config.auth] | ||
|
||
[agent.env] | ||
|
||
[connect] | ||
workload_uri = "unix:///var/run/iotedge/workload.sock" | ||
management_uri = "unix:///var/run/iotedge/mgmt.sock" | ||
|
||
[listen] | ||
workload_uri = "fd://aziot-edged.workload.socket" | ||
management_uri = "fd://aziot-edged.mgmt.socket" | ||
min_tls_version = "tls1.0" | ||
|
||
[watchdog] | ||
max_retries = "infinite" | ||
|
||
[edge_ca] | ||
auto_generated_edge_ca_expiry_days = 90 | ||
|
||
[moby_runtime] | ||
uri = "unix:///var/run/docker.sock" | ||
network = "azure-iot-edge" |
3 changes: 3 additions & 0 deletions
3
edgelet/iotedge/test-files/config/dps-symmetric-key-no-pad/tpmd.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This file is auto-generated by `iotedge config apply` | ||
# Do not edit it manually; any edits will be lost when the command is run again. | ||
|
18 changes: 18 additions & 0 deletions
18
edgelet/iotedge/test-files/config/manual-connection-string-no-pad/certd.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This file is auto-generated by `iotedge config apply` | ||
# Do not edit it manually; any edits will be lost when the command is run again. | ||
|
||
homedir_path = "/var/lib/aziot/certd" | ||
[cert_issuance.aziot-edged-ca] | ||
method = "self_signed" | ||
expiry_days = 90 | ||
|
||
[cert_issuance.aziot-edged-ca-temp] | ||
method = "self_signed" | ||
expiry_days = 90 | ||
|
||
[preloaded_certs] | ||
aziot-edged-trust-bundle = ["aziot-edged-ca"] | ||
|
||
[[principal]] | ||
uid = 5558 | ||
certs = ["aziot-edged-ca", "aziot-edged/module/*", "aziot-edged-ca-temp"] |
1 change: 1 addition & 0 deletions
1
edgelet/iotedge/test-files/config/manual-connection-string-no-pad/device-id
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
aziot-identity-service|aziot-ide |
43 changes: 43 additions & 0 deletions
43
edgelet/iotedge/test-files/config/manual-connection-string-no-pad/edged.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# This file is auto-generated by `iotedge config apply` | ||
# Do not edit it manually; any edits will be lost when the command is run again. | ||
|
||
hostname = "my-device" | ||
trust_bundle_cert = "aziot-edged-trust-bundle" | ||
auto_reprovisioning_mode = "OnErrorOnly" | ||
homedir = "/var/lib/aziot/edged" | ||
allow_elevated_docker_permissions = true | ||
|
||
[edge_ca.auto_renew] | ||
rotate_key = true | ||
threshold = "80%" | ||
retry = "4%" | ||
|
||
[agent] | ||
name = "edgeAgent" | ||
type = "docker" | ||
imagePullPolicy = "on-create" | ||
|
||
[agent.config] | ||
image = "mcr.microsoft.com/azureiotedge-agent:1.0" | ||
|
||
[agent.config.createOptions] | ||
|
||
[agent.config.auth] | ||
|
||
[agent.env] | ||
|
||
[connect] | ||
workload_uri = "unix:///var/run/iotedge/workload.sock" | ||
management_uri = "unix:///var/run/iotedge/mgmt.sock" | ||
|
||
[listen] | ||
workload_uri = "fd://aziot-edged.workload.socket" | ||
management_uri = "fd://aziot-edged.mgmt.socket" | ||
min_tls_version = "tls1.0" | ||
|
||
[watchdog] | ||
max_retries = "infinite" | ||
|
||
[moby_runtime] | ||
uri = "unix:///var/run/docker.sock" | ||
network = "azure-iot-edge" |
18 changes: 18 additions & 0 deletions
18
edgelet/iotedge/test-files/config/manual-connection-string-no-pad/identityd.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This file is auto-generated by `iotedge config apply` | ||
# Do not edit it manually; any edits will be lost when the command is run again. | ||
|
||
hostname = "my-device" | ||
homedir = "/var/lib/aziot/identityd" | ||
|
||
[provisioning] | ||
source = "manual" | ||
iothub_hostname = "example.azure-devices.net" | ||
device_id = "my-device" | ||
|
||
[provisioning.authentication] | ||
method = "sas" | ||
device_id_pk = "device-id" | ||
|
||
[[principal]] | ||
uid = 5558 | ||
name = "aziot-edge" |
20 changes: 20 additions & 0 deletions
20
edgelet/iotedge/test-files/config/manual-connection-string-no-pad/keyd.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This file is auto-generated by `iotedge config apply` | ||
# Do not edit it manually; any edits will be lost when the command is run again. | ||
|
||
[aziot_keys] | ||
homedir_path = "/var/lib/aziot/keyd" | ||
|
||
[preloaded_keys] | ||
device-id = "file:///var/secrets/aziot/keyd/device-id" | ||
|
||
[[principal]] | ||
uid = 5556 | ||
keys = ["aziot_identityd_master_id", "device-id"] | ||
|
||
[[principal]] | ||
uid = 5555 | ||
keys = ["aziot-edged-ca", "aziot-edged-ca-temp"] | ||
|
||
[[principal]] | ||
uid = 5558 | ||
keys = ["aziot-edged-ca", "iotedge_master_encryption_id", "aziot-edged-ca-temp"] |
56 changes: 56 additions & 0 deletions
56
edgelet/iotedge/test-files/config/manual-connection-string-no-pad/super-config.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
auto_reprovisioning_mode = "OnErrorOnly" | ||
hostname = "my-device" | ||
|
||
[provisioning] | ||
source = "manual" | ||
iothub_hostname = "example.azure-devices.net" | ||
device_id = "my-device" | ||
|
||
[provisioning.authentication] | ||
method = "sas" | ||
|
||
[provisioning.authentication.device_id_pk] | ||
value = "YXppb3QtaWRlbnRpdHktc2VydmljZXxhemlvdC1pZGU" | ||
|
||
[aziot_keys] | ||
|
||
[preloaded_keys] | ||
|
||
[cert_issuance] | ||
|
||
[preloaded_certs] | ||
|
||
[tpm] | ||
|
||
[agent] | ||
name = "edgeAgent" | ||
type = "docker" | ||
imagePullPolicy = "on-create" | ||
|
||
[agent.config] | ||
image = "mcr.microsoft.com/azureiotedge-agent:1.0" | ||
|
||
[agent.config.createOptions] | ||
|
||
[agent.config.auth] | ||
|
||
[agent.env] | ||
|
||
[connect] | ||
workload_uri = "unix:///var/run/iotedge/workload.sock" | ||
management_uri = "unix:///var/run/iotedge/mgmt.sock" | ||
|
||
[listen] | ||
workload_uri = "fd://aziot-edged.workload.socket" | ||
management_uri = "fd://aziot-edged.mgmt.socket" | ||
min_tls_version = "tls1.0" | ||
|
||
[watchdog] | ||
max_retries = "infinite" | ||
|
||
[edge_ca] | ||
auto_generated_edge_ca_expiry_days = 90 | ||
|
||
[moby_runtime] | ||
uri = "unix:///var/run/docker.sock" | ||
network = "azure-iot-edge" |
3 changes: 3 additions & 0 deletions
3
edgelet/iotedge/test-files/config/manual-connection-string-no-pad/tpmd.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This file is auto-generated by `iotedge config apply` | ||
# Do not edit it manually; any edits will be lost when the command is run again. | ||
|