Skip to content

Commit d95befd

Browse files
committed
Release openssl v0.10.36
1 parent 040ec64 commit d95befd

File tree

4 files changed

+44
-33
lines changed

4 files changed

+44
-33
lines changed

openssl-sys/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@
221221
* Added `X509_verify` and `X509_REQ_verify`.
222222
* Added `EVP_MD_type` and `EVP_GROUP_get_curve_name`.
223223

224-
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.65...master
224+
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.66...master
225+
[v0.9.66]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.65...openssl-sys-v0.9.66
225226
[v0.9.65]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.64...openssl-sys-v0.9.65
226227
[v0.9.64]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.63...openssl-sys-v0.9.64
227228
[v0.9.63]: https://github.com/sfackler/rust-openssl/compare/openssl-sys-v0.9.62...openssl-sys-v0.9.63

openssl/CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
## [Unreleased]
44

5+
## [v0.10.36] - 2021-08-17
6+
7+
### Added
8+
9+
* Added `Asn1Object::as_slice`.
10+
* Added `PKeyRef::{raw_public_key, raw_private_key, private_key_to_pkcs8_passphrase}` and
11+
`PKey::{private_key_from_raw_bytes, public_key_from_raw_bytes}`.
12+
* Added `Cipher::{seed_cbc, seed_cfb128, seed_ecb, seed_ofb}`.
13+
514
## [v0.10.35] - 2021-06-18
615

716
### Fixed
@@ -547,7 +556,8 @@
547556

548557
Look at the [release tags] for information about older releases.
549558

550-
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.35...master
559+
[Unreleased]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.36...master
560+
[v0.10.36]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.35...openssl-v0.10.36
551561
[v0.10.35]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.34...openssl-v0.10.35
552562
[v0.10.34]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.33...openssl-v0.10.34
553563
[v0.10.33]: https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.32...openssl-v0.10.33

openssl/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "openssl"
3-
version = "0.10.35"
3+
version = "0.10.36"
44
authors = ["Steven Fackler <[email protected]>"]
55
license = "Apache-2.0"
66
description = "OpenSSL bindings"
@@ -26,7 +26,7 @@ foreign-types = "0.3.1"
2626
libc = "0.2"
2727
once_cell = "1.5.2"
2828

29-
ffi = { package = "openssl-sys", version = "0.9.64", path = "../openssl-sys" }
29+
ffi = { package = "openssl-sys", version = "0.9.66", path = "../openssl-sys" }
3030

3131
[dev-dependencies]
3232
tempdir = "0.3"

openssl/src/pkey.rs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,35 @@ where
340340
Ok(buf)
341341
}
342342
}
343+
344+
/// Serializes a private key into a DER-formatted PKCS#8, using the supplied password to
345+
/// encrypt the key.
346+
///
347+
/// # Panics
348+
///
349+
/// Panics if `passphrase` contains an embedded null.
350+
pub fn private_key_to_pkcs8_passphrase(
351+
&self,
352+
cipher: Cipher,
353+
passphrase: &[u8],
354+
) -> Result<Vec<u8>, ErrorStack> {
355+
unsafe {
356+
let bio = MemBio::new()?;
357+
let len = passphrase.len();
358+
let passphrase = CString::new(passphrase).unwrap();
359+
cvt(ffi::i2d_PKCS8PrivateKey_bio(
360+
bio.as_ptr(),
361+
self.as_ptr(),
362+
cipher.as_ptr(),
363+
passphrase.as_ptr() as *const _ as *mut _,
364+
len as ::libc::c_int,
365+
None,
366+
ptr::null_mut(),
367+
))?;
368+
369+
Ok(bio.get_buf().to_owned())
370+
}
371+
}
343372
}
344373

345374
impl<T> fmt::Debug for PKey<T> {
@@ -683,35 +712,6 @@ impl PKey<Private> {
683712
}
684713
}
685714

686-
/// Serializes a private key into a DER-formatted PKCS#8, using the supplied password to
687-
/// encrypt the key.
688-
///
689-
/// # Panics
690-
///
691-
/// Panics if `passphrase` contains an embedded null.
692-
pub fn private_key_to_pkcs8_passphrase(
693-
&self,
694-
cipher: Cipher,
695-
passphrase: &[u8],
696-
) -> Result<Vec<u8>, ErrorStack> {
697-
unsafe {
698-
let bio = MemBio::new()?;
699-
let len = passphrase.len();
700-
let passphrase = CString::new(passphrase).unwrap();
701-
cvt(ffi::i2d_PKCS8PrivateKey_bio(
702-
bio.as_ptr(),
703-
self.as_ptr(),
704-
cipher.as_ptr(),
705-
passphrase.as_ptr() as *const _ as *mut _,
706-
len as ::libc::c_int,
707-
None,
708-
ptr::null_mut(),
709-
))?;
710-
711-
Ok(bio.get_buf().to_owned())
712-
}
713-
}
714-
715715
/// Creates a private key from its raw byte representation
716716
///
717717
/// Algorithm types that support raw private keys are HMAC, X25519, ED25519, X448 or ED448

0 commit comments

Comments
 (0)