diff --git a/pyproject.toml b/pyproject.toml index 8e1120c..232abd1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "certbot-onion" -version = "0.1.6" +version = "0.1.7" description = "Certbot authenticator plugin for the onion-csr-01 challenge" authors = [ {name = "Q Misell", email = "q@as207960.net"} @@ -13,7 +13,7 @@ readme = "README.md" [project.urls] "Homepage" = "https://acmeforonions.org" -"Bug Tracker" = "https://github.com/AS207960/certbot-onion" +"Repository" = "https://github.com/AS207960/certbot-onion" [build-system] requires = ["setuptools", "wheel", "setuptools-rust"] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 3bba640..55d799b 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -5,16 +5,17 @@ authors = ["Q Misell "] edition = "2021" [dependencies] -pyo3 = { version = "0.18", features = ["extension-module"] } -ed25519-dalek = "1" +pyo3 = { version = "0.20", features = ["extension-module"] } +ed25519-dalek = { version = "2", features = ["hazmat"] } hex = "0.4" openssl = { version = ">=0.10.25", features = ["vendored", "v111"] } openssl-sys = "0.9" rand = "0.8" libc = "0.2" foreign-types-shared = "0.1" -asn1 = "0.14" +asn1 = "0.15" +sha2 = "0.10.8" [lib] name = "certbot_onion_rust" -crate-type = ["cdylib"] \ No newline at end of file +crate-type = ["cdylib"] diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 545996c..d3c33f7 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -13,9 +13,9 @@ fn _rust(_py: Python<'_>, m: &PyModule) -> PyResult<()> { fn make_csr(priv_key: &[u8], ca_nonce: &[u8]) -> PyResult> { let mut rng = rand::thread_rng(); - let sk = ed25519_dalek::ExpandedSecretKey::from_bytes(priv_key) + let sk = ed25519_dalek::hazmat::ExpandedSecretKey::from_slice(priv_key) .map_err(|e| PyErr::new::(e.to_string()))?; - let pk = ed25519_dalek::PublicKey::from(&sk); + let pk = ed25519_dalek::VerifyingKey::from(&sk); let openssl_pk = openssl::pkey::PKey::public_key_from_raw_bytes( pk.as_bytes(), openssl::pkey::Id::ED25519 ).unwrap(); @@ -49,7 +49,7 @@ fn make_csr(priv_key: &[u8], ca_nonce: &[u8]) -> PyResult> { buf }; - let signature = sk.sign(&tbs_req, &pk).to_bytes(); + let signature = ed25519_dalek::hazmat::raw_sign::(&sk, &tbs_req, &pk).to_bytes(); let tbs_req: asn1::Sequence = asn1::parse_single(&tbs_req).unwrap();