diff options
| author | Bradley Beddoes <[email protected]> | 2017-08-09 14:20:22 +1000 |
|---|---|---|
| committer | Bradley Beddoes <[email protected]> | 2017-08-09 14:20:22 +1000 |
| commit | c96658387740983610e91d3dc37bf98701f4ce94 (patch) | |
| tree | 36b1312de5f353dcd2ad301bf63fbd75a6cf58a8 /openssl/src | |
| parent | Fix EC_KEY_set_public_key_affine_coordinates (diff) | |
| download | rust-openssl-c96658387740983610e91d3dc37bf98701f4ce94.tar.xz rust-openssl-c96658387740983610e91d3dc37bf98701f4ce94.zip | |
Refine sig for set_public_key_affine_coordinates
This functions signature was originally defined to require mutable
references for `x` / `y` as the underpinning OpenSSL C API
was not `const`.
However the actual OpenSSL implementation makes no changes. This being
the case we've chosen to reflect non mutability at the Rust level.
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/ec.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/openssl/src/ec.rs b/openssl/src/ec.rs index 0a3cfcb6..e221b411 100644 --- a/openssl/src/ec.rs +++ b/openssl/src/ec.rs @@ -462,8 +462,8 @@ impl EcKeyBuilderRef { /// Sets the public key based on affine coordinates. pub fn set_public_key_affine_coordinates(&mut self, - x: &mut BigNumRef, - y: &mut BigNumRef) + x: &BigNumRef, + y: &BigNumRef) -> Result<&mut EcKeyBuilderRef, ErrorStack> { unsafe { cvt(ffi::EC_KEY_set_public_key_affine_coordinates(self.as_ptr(), @@ -571,12 +571,12 @@ mod test { let y = data_encoding::base64url::decode_nopad("4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM".as_bytes()) .unwrap(); - let mut xbn = BigNum::from_slice(&x).unwrap(); - let mut ybn = BigNum::from_slice(&y).unwrap(); + let xbn = BigNum::from_slice(&x).unwrap(); + let ybn = BigNum::from_slice(&y).unwrap(); let mut builder = EcKeyBuilder::new().unwrap(); builder.set_group(&group).unwrap(); - builder.set_public_key_affine_coordinates(&mut xbn, &mut ybn).unwrap(); + builder.set_public_key_affine_coordinates(&xbn, &ybn).unwrap(); let ec_key = builder.build(); assert!(ec_key.check_key().is_ok()); |