Skip to content

Commit

Permalink
Relax padding requirement in symmetric keys (#6945)
Browse files Browse the repository at this point in the history
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
gordonwang0 authored Mar 10, 2023
1 parent f7dd1aa commit 907eef1
Show file tree
Hide file tree
Showing 15 changed files with 442 additions and 128 deletions.
250 changes: 122 additions & 128 deletions edgelet/Cargo.lock

Large diffs are not rendered by default.

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"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aziot-identity-service|aziot-identity-service|aziot-identity-ser
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"
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"
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"]
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"
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.

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"]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aziot-identity-service|aziot-ide
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"
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"
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"]
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"
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.

0 comments on commit 907eef1

Please sign in to comment.