diff --git a/mqtt-cert-manager/README.md b/mqtt-cert-manager/README.md index a8c4d30..fcf19d0 100644 --- a/mqtt-cert-manager/README.md +++ b/mqtt-cert-manager/README.md @@ -30,7 +30,11 @@ self-signed CA — no external CA or internet dependency. Full device-side wire protocol: see `DEVICE_PROTOCOL.md`. -## Installing this add-on +## Installing this application +1. Add [virarepo repository](https://gitea.viratak.com/bitopa/virarepo) in applications section +2. Look for this project, and click install + +## Offline Installing this application 1. Copy this folder into your Home Assistant add-ons repository (or add it as a local add-on under `/addons/mqtt_cert_manager` on HAOS). diff --git a/mqtt-cert-manager/app/ca.py b/mqtt-cert-manager/app/ca.py index fcfbec0..170b123 100644 --- a/mqtt-cert-manager/app/ca.py +++ b/mqtt-cert-manager/app/ca.py @@ -33,7 +33,7 @@ class CertificateAuthority: # -- setup --------------------------------------------------------- def _generate_root_ca(self): - key = rsa.generate_private_key(public_exponent=65537, key_size=4096) + key = ec.generate_private_key(ec.SECP256R1()) subject = issuer = x509.Name( [x509.NameAttribute(NameOID.COMMON_NAME, CA_COMMON_NAME)] ) @@ -157,7 +157,7 @@ class CertificateAuthority: if not hostnames: raise ValueError("at least one hostname/IP is required") - key = rsa.generate_private_key(public_exponent=65537, key_size=2048) + key = ec.generate_private_key(ec.SECP256R1()) now = datetime.datetime.now(datetime.timezone.utc) subject = x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, hostnames[0])]) @@ -180,7 +180,12 @@ class CertificateAuthority: .add_extension( x509.KeyUsage( digital_signature=True, - key_encipherment=True, + # key_encipherment only applies to RSA (key-transport) + # keys; it's meaningless for an ECDSA key and shouldn't + # be set here now that this is EC. ECDHE cipher suites + # use ephemeral keys for the actual exchange — this + # cert's key is only ever used to sign, not encipher. + key_encipherment=False, content_commitment=False, data_encipherment=False, key_agreement=False, @@ -256,4 +261,4 @@ class CertificateAuthority: return False return True except Exception: - return False + return False \ No newline at end of file diff --git a/mqtt-cert-manager/config.yaml b/mqtt-cert-manager/config.yaml index 9d2cb37..7f7d419 100644 --- a/mqtt-cert-manager/config.yaml +++ b/mqtt-cert-manager/config.yaml @@ -1,5 +1,5 @@ name: "MQTT Certificate Manager" -version: "0.3.5" +version: "0.4.0" slug: "mqtt_cert_manager" description: "Local CA that issues and manages TLS client certificates for MQTT nodes" url: "https://gitea.viratak.com/bitopa/mqtt-cert-manager"