Skip to content

Commit 2e73ca4

Browse files
authored
bump rust-openssl dep and update EcPoint::mul_generator to mul_generator2 (#14789)
1 parent 82ebd3b commit 2e73ca4

4 files changed

Lines changed: 10 additions & 11 deletions

File tree

Cargo.lock

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ cc = "1.2.61"
2727
cfg-if = "1"
2828
foreign-types = "0.3"
2929
foreign-types-shared = "0.1"
30-
openssl = "0.10.77"
31-
openssl-sys = "0.9.111"
30+
openssl = "0.10.79"
31+
openssl-sys = "0.9.115"
3232
pem = { version = "3", default-features = false }
3333
pyo3 = { version = "0.28", features = ["abi3"] }
3434
pyo3-build-config = { version = "0.28" }

src/rust/cryptography-key-parsing/src/ec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub fn parse_pkcs1_private_key(
160160
} else {
161161
let mut public_point = openssl::ec::EcPoint::new(&group)?;
162162
public_point
163-
.mul_generator(&group, &private_number, &bn_ctx)
163+
.mul_generator2(&group, &private_number, &mut bn_ctx)
164164
.map_err(|_| crate::KeyParsingError::InvalidKey)?;
165165
public_point
166166
};

src/rust/src/backend/ec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ fn derive_private_key(
155155
let private_value = utils::py_int_to_bn(py, py_private_value)?;
156156

157157
let mut point = openssl::ec::EcPoint::new(&curve)?;
158-
let bn_ctx = openssl::bn::BigNumContext::new()?;
159-
point.mul_generator(&curve, &private_value, &bn_ctx)?;
158+
let mut bn_ctx = openssl::bn::BigNumContext::new()?;
159+
point.mul_generator2(&curve, &private_value, &mut bn_ctx)?;
160160
let ec = openssl::ec::EcKey::from_private_components(&curve, &private_value, &point)
161161
.map_err(|_| pyo3::exceptions::PyValueError::new_err("Invalid EC key"))?;
162162
ec.check_key().map_err(|_| {
@@ -555,7 +555,7 @@ impl EllipticCurvePrivateNumbers {
555555

556556
let mut bn_ctx = openssl::bn::BigNumContext::new()?;
557557
let mut expected_pub = openssl::ec::EcPoint::new(&curve)?;
558-
expected_pub.mul_generator(&curve, &private_value, &bn_ctx)?;
558+
expected_pub.mul_generator2(&curve, &private_value, &mut bn_ctx)?;
559559
if !expected_pub.eq(&curve, public_key.public_key(), &mut bn_ctx)? {
560560
return Err(CryptographyError::from(
561561
pyo3::exceptions::PyValueError::new_err("Invalid EC key."),

0 commit comments

Comments
 (0)