Skip to content

Commit ab0dc11

Browse files
Bump pyo3 to 0.22 (#822)
* Bump pyo3 from 0.21.2 to 0.22.0 in /src/_bcrypt Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.21.2 to 0.22.0. - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md) - [Commits](PyO3/pyo3@v0.21.2...v0.22.0) --- updated-dependencies: - dependency-name: pyo3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Fix build on pyo3 0.22 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent beda3ae commit ab0dc11

File tree

3 files changed

+20
-144
lines changed

3 files changed

+20
-144
lines changed

src/_bcrypt/Cargo.lock

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

src/_bcrypt/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2018"
66
publish = false
77

88
[dependencies]
9-
pyo3 = { version = "0.21", features = ["abi3"] }
9+
pyo3 = { version = "0.22", features = ["abi3"] }
1010
bcrypt = "0.15"
1111
bcrypt-pbkdf = "0.10.0"
1212
base64 = "0.22.1"

src/_bcrypt/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#![deny(rust_2018_idioms)]
1414

1515
use base64::Engine;
16-
use pyo3::prelude::PyBytesMethods;
16+
use pyo3::prelude::{PyBytesMethods, PyModuleMethods};
1717
use pyo3::PyTypeInfo;
1818
use std::convert::TryInto;
1919
use std::io::Write;
@@ -25,6 +25,7 @@ pub const BASE64_ENGINE: base64::engine::GeneralPurpose = base64::engine::Genera
2525
);
2626

2727
#[pyo3::prelude::pyfunction]
28+
#[pyo3(signature = (rounds=None, prefix=None))]
2829
fn gensalt<'p>(
2930
py: pyo3::Python<'p>,
3031
rounds: Option<u16>,
@@ -128,16 +129,15 @@ fn checkpw(py: pyo3::Python<'_>, password: &[u8], hashed_password: &[u8]) -> pyo
128129
}
129130

130131
#[pyo3::prelude::pyfunction]
132+
#[pyo3(signature = (password, salt, desired_key_bytes, rounds, ignore_few_rounds=false))]
131133
fn kdf<'p>(
132134
py: pyo3::Python<'p>,
133135
password: &[u8],
134136
salt: &[u8],
135137
desired_key_bytes: usize,
136138
rounds: u32,
137-
ignore_few_rounds: Option<bool>,
139+
ignore_few_rounds: bool,
138140
) -> pyo3::PyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {
139-
let ignore_few_rounds = ignore_few_rounds.unwrap_or(false);
140-
141141
if password.is_empty() || salt.is_empty() {
142142
return Err(pyo3::exceptions::PyValueError::new_err(
143143
"password and salt must not be empty",

0 commit comments

Comments
 (0)