bcrypt 4.2.0__tar.gz → 4.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ include LICENSE README.rst
2
2
 
3
3
  include pyproject.toml
4
4
 
5
- include tox.ini .coveragerc
5
+ include noxfile.py .coveragerc
6
6
 
7
7
  recursive-include src py.typed *.pyi
8
8
  recursive-include src/_bcrypt Cargo.toml Cargo.lock *.rs
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: bcrypt
3
- Version: 4.2.0
3
+ Version: 4.3.0
4
4
  Summary: Modern password hashing for your software and your servers
5
5
  Author-email: The Python Cryptographic Authority developers <cryptography-dev@python.org>
6
6
  License: Apache-2.0
@@ -11,13 +11,13 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
11
11
  Classifier: Programming Language :: Python :: Implementation :: PyPy
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3 :: Only
14
- Classifier: Programming Language :: Python :: 3.7
15
14
  Classifier: Programming Language :: Python :: 3.8
16
15
  Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
19
18
  Classifier: Programming Language :: Python :: 3.12
20
- Requires-Python: >=3.7
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.8
21
21
  Description-Content-Type: text/x-rst
22
22
  License-File: LICENSE
23
23
  Provides-Extra: tests
@@ -44,7 +44,7 @@ Installation
44
44
 
45
45
  To install bcrypt, simply:
46
46
 
47
- .. code:: bash
47
+ .. code:: console
48
48
 
49
49
  $ pip install bcrypt
50
50
 
@@ -53,19 +53,19 @@ compiler and a Rust compiler (the minimum supported Rust version is 1.56.0).
53
53
 
54
54
  For Debian and Ubuntu, the following command will ensure that the required dependencies are installed:
55
55
 
56
- .. code:: bash
56
+ .. code:: console
57
57
 
58
58
  $ sudo apt-get install build-essential cargo
59
59
 
60
60
  For Fedora and RHEL-derivatives, the following command will ensure that the required dependencies are installed:
61
61
 
62
- .. code:: bash
62
+ .. code:: console
63
63
 
64
64
  $ sudo yum install gcc cargo
65
65
 
66
66
  For Alpine, the following command will ensure that the required dependencies are installed:
67
67
 
68
- .. code:: bash
68
+ .. code:: console
69
69
 
70
70
  $ apk add --update musl-dev gcc cargo
71
71
 
@@ -78,6 +78,22 @@ While bcrypt remains an acceptable choice for password storage, depending on you
78
78
  Changelog
79
79
  =========
80
80
 
81
+ Unreleased
82
+ ----------
83
+
84
+ * Dropped support for Python 3.7.
85
+ * We now support free-threaded Python 3.13.
86
+ * We now support PyPy 3.11.
87
+ * We now publish wheels for free-threaded Python 3.13, for PyPy 3.11 on
88
+ ``manylinux``, and for ARMv7l on ``manylinux``.
89
+
90
+ 4.2.1
91
+ -----
92
+
93
+ * Bump Rust dependency versions - this should resolve crashes on Python 3.13
94
+ free-threaded builds.
95
+ * We no longer build ``manylinux`` wheels for PyPy 3.9.
96
+
81
97
  4.2.0
82
98
  -----
83
99
 
@@ -300,7 +316,7 @@ Compatibility
300
316
  -------------
301
317
 
302
318
  This library should be compatible with py-bcrypt and it will run on Python
303
- 3.6+, and PyPy 3.
319
+ 3.8+ (including free-threaded builds), and PyPy 3.
304
320
 
305
321
  Security
306
322
  --------
@@ -17,7 +17,7 @@ Installation
17
17
 
18
18
  To install bcrypt, simply:
19
19
 
20
- .. code:: bash
20
+ .. code:: console
21
21
 
22
22
  $ pip install bcrypt
23
23
 
@@ -26,19 +26,19 @@ compiler and a Rust compiler (the minimum supported Rust version is 1.56.0).
26
26
 
27
27
  For Debian and Ubuntu, the following command will ensure that the required dependencies are installed:
28
28
 
29
- .. code:: bash
29
+ .. code:: console
30
30
 
31
31
  $ sudo apt-get install build-essential cargo
32
32
 
33
33
  For Fedora and RHEL-derivatives, the following command will ensure that the required dependencies are installed:
34
34
 
35
- .. code:: bash
35
+ .. code:: console
36
36
 
37
37
  $ sudo yum install gcc cargo
38
38
 
39
39
  For Alpine, the following command will ensure that the required dependencies are installed:
40
40
 
41
- .. code:: bash
41
+ .. code:: console
42
42
 
43
43
  $ apk add --update musl-dev gcc cargo
44
44
 
@@ -51,6 +51,22 @@ While bcrypt remains an acceptable choice for password storage, depending on you
51
51
  Changelog
52
52
  =========
53
53
 
54
+ Unreleased
55
+ ----------
56
+
57
+ * Dropped support for Python 3.7.
58
+ * We now support free-threaded Python 3.13.
59
+ * We now support PyPy 3.11.
60
+ * We now publish wheels for free-threaded Python 3.13, for PyPy 3.11 on
61
+ ``manylinux``, and for ARMv7l on ``manylinux``.
62
+
63
+ 4.2.1
64
+ -----
65
+
66
+ * Bump Rust dependency versions - this should resolve crashes on Python 3.13
67
+ free-threaded builds.
68
+ * We no longer build ``manylinux`` wheels for PyPy 3.9.
69
+
54
70
  4.2.0
55
71
  -----
56
72
 
@@ -273,7 +289,7 @@ Compatibility
273
289
  -------------
274
290
 
275
291
  This library should be compatible with py-bcrypt and it will run on Python
276
- 3.6+, and PyPy 3.
292
+ 3.8+ (including free-threaded builds), and PyPy 3.
277
293
 
278
294
  Security
279
295
  --------
@@ -0,0 +1,42 @@
1
+ import nox
2
+
3
+ nox.options.reuse_existing_virtualenvs = True
4
+ nox.options.default_venv_backend = "uv|virtualenv"
5
+
6
+
7
+ @nox.session
8
+ def tests(session: nox.Session) -> None:
9
+ session.install("coverage")
10
+ session.install(".[tests]")
11
+
12
+ session.run(
13
+ "coverage", "run", "-m", "pytest", "--strict-markers", *session.posargs
14
+ )
15
+ session.run("coverage", "combine")
16
+ session.run("coverage", "report", "-m", "--fail-under", "100")
17
+
18
+
19
+ @nox.session
20
+ def pep8(session: nox.Session) -> None:
21
+ session.install("ruff")
22
+
23
+ session.run("ruff", "check", ".")
24
+ session.run("ruff", "format", "--check", ".")
25
+
26
+
27
+ @nox.session
28
+ def mypy(session: nox.Session) -> None:
29
+ session.install("mypy")
30
+ session.install(".[tests]")
31
+
32
+ session.run("mypy", "tests/")
33
+
34
+
35
+ @nox.session
36
+ def packaging(session: nox.Session) -> None:
37
+ session.install("setuptools-rust", "check-manifest", "readme_renderer")
38
+
39
+ session.run("check-manifest")
40
+ session.run(
41
+ "python3", "-m", "readme_renderer", "README.rst", "-o", "/dev/null"
42
+ )
@@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta"
11
11
  [project]
12
12
  name = "bcrypt"
13
13
  # When updating this, also update lib.rs
14
- version = "4.2.0"
14
+ version = "4.3.0"
15
15
  authors = [
16
16
  {name = "The Python Cryptographic Authority developers", email = "cryptography-dev@python.org"}
17
17
  ]
@@ -24,14 +24,14 @@ classifiers = [
24
24
  "Programming Language :: Python :: Implementation :: PyPy",
25
25
  "Programming Language :: Python :: 3",
26
26
  "Programming Language :: Python :: 3 :: Only",
27
- "Programming Language :: Python :: 3.7",
28
27
  "Programming Language :: Python :: 3.8",
29
28
  "Programming Language :: Python :: 3.9",
30
29
  "Programming Language :: Python :: 3.10",
31
30
  "Programming Language :: Python :: 3.11",
32
31
  "Programming Language :: Python :: 3.12",
32
+ "Programming Language :: Python :: 3.13",
33
33
  ]
34
- requires-python = ">= 3.7"
34
+ requires-python = ">= 3.8"
35
35
  dynamic = ["readme"]
36
36
 
37
37
  [project.urls]
@@ -72,3 +72,6 @@ warn_redundant_casts = true
72
72
  warn_unused_ignores = true
73
73
  warn_unused_configs = true
74
74
  strict_equality = true
75
+
76
+ [tool.check-manifest]
77
+ ignore = ["tests/reference/*"]
@@ -4,9 +4,9 @@ version = 3
4
4
 
5
5
  [[package]]
6
6
  name = "autocfg"
7
- version = "1.3.0"
7
+ version = "1.4.0"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
9
+ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
10
10
 
11
11
  [[package]]
12
12
  name = "base64"
@@ -16,9 +16,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
16
16
 
17
17
  [[package]]
18
18
  name = "bcrypt"
19
- version = "0.15.1"
19
+ version = "0.17.0"
20
20
  source = "registry+https://github.com/rust-lang/crates.io-index"
21
- checksum = "e65938ed058ef47d92cf8b346cc76ef48984572ade631927e9937b5ffc7662c7"
21
+ checksum = "92758ad6077e4c76a6cadbce5005f666df70d4f13b19976b1a8062eef880040f"
22
22
  dependencies = [
23
23
  "base64",
24
24
  "blowfish",
@@ -50,6 +50,12 @@ dependencies = [
50
50
  "subtle",
51
51
  ]
52
52
 
53
+ [[package]]
54
+ name = "bitflags"
55
+ version = "2.8.0"
56
+ source = "registry+https://github.com/rust-lang/crates.io-index"
57
+ checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36"
58
+
53
59
  [[package]]
54
60
  name = "block-buffer"
55
61
  version = "0.10.4"
@@ -93,9 +99,9 @@ dependencies = [
93
99
 
94
100
  [[package]]
95
101
  name = "cpufeatures"
96
- version = "0.2.12"
102
+ version = "0.2.17"
97
103
  source = "registry+https://github.com/rust-lang/crates.io-index"
98
- checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
104
+ checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
99
105
  dependencies = [
100
106
  "libc",
101
107
  ]
@@ -133,13 +139,14 @@ dependencies = [
133
139
 
134
140
  [[package]]
135
141
  name = "getrandom"
136
- version = "0.2.15"
142
+ version = "0.3.1"
137
143
  source = "registry+https://github.com/rust-lang/crates.io-index"
138
- checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
144
+ checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8"
139
145
  dependencies = [
140
146
  "cfg-if",
141
147
  "libc",
142
148
  "wasi",
149
+ "windows-targets",
143
150
  ]
144
151
 
145
152
  [[package]]
@@ -156,18 +163,18 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
156
163
 
157
164
  [[package]]
158
165
  name = "inout"
159
- version = "0.1.3"
166
+ version = "0.1.4"
160
167
  source = "registry+https://github.com/rust-lang/crates.io-index"
161
- checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
168
+ checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
162
169
  dependencies = [
163
170
  "generic-array",
164
171
  ]
165
172
 
166
173
  [[package]]
167
174
  name = "libc"
168
- version = "0.2.155"
175
+ version = "0.2.170"
169
176
  source = "registry+https://github.com/rust-lang/crates.io-index"
170
- checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
177
+ checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828"
171
178
 
172
179
  [[package]]
173
180
  name = "memoffset"
@@ -180,9 +187,9 @@ dependencies = [
180
187
 
181
188
  [[package]]
182
189
  name = "once_cell"
183
- version = "1.19.0"
190
+ version = "1.20.3"
184
191
  source = "registry+https://github.com/rust-lang/crates.io-index"
185
- checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
192
+ checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
186
193
 
187
194
  [[package]]
188
195
  name = "pbkdf2"
@@ -195,24 +202,24 @@ dependencies = [
195
202
 
196
203
  [[package]]
197
204
  name = "portable-atomic"
198
- version = "1.7.0"
205
+ version = "1.11.0"
199
206
  source = "registry+https://github.com/rust-lang/crates.io-index"
200
- checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265"
207
+ checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e"
201
208
 
202
209
  [[package]]
203
210
  name = "proc-macro2"
204
- version = "1.0.86"
211
+ version = "1.0.93"
205
212
  source = "registry+https://github.com/rust-lang/crates.io-index"
206
- checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
213
+ checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
207
214
  dependencies = [
208
215
  "unicode-ident",
209
216
  ]
210
217
 
211
218
  [[package]]
212
219
  name = "pyo3"
213
- version = "0.22.2"
220
+ version = "0.23.5"
214
221
  source = "registry+https://github.com/rust-lang/crates.io-index"
215
- checksum = "831e8e819a138c36e212f3af3fd9eeffed6bf1510a805af35b0edee5ffa59433"
222
+ checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872"
216
223
  dependencies = [
217
224
  "cfg-if",
218
225
  "indoc",
@@ -228,9 +235,9 @@ dependencies = [
228
235
 
229
236
  [[package]]
230
237
  name = "pyo3-build-config"
231
- version = "0.22.2"
238
+ version = "0.23.5"
232
239
  source = "registry+https://github.com/rust-lang/crates.io-index"
233
- checksum = "1e8730e591b14492a8945cdff32f089250b05f5accecf74aeddf9e8272ce1fa8"
240
+ checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb"
234
241
  dependencies = [
235
242
  "once_cell",
236
243
  "target-lexicon",
@@ -238,9 +245,9 @@ dependencies = [
238
245
 
239
246
  [[package]]
240
247
  name = "pyo3-ffi"
241
- version = "0.22.2"
248
+ version = "0.23.5"
242
249
  source = "registry+https://github.com/rust-lang/crates.io-index"
243
- checksum = "5e97e919d2df92eb88ca80a037969f44e5e70356559654962cbb3316d00300c6"
250
+ checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d"
244
251
  dependencies = [
245
252
  "libc",
246
253
  "pyo3-build-config",
@@ -248,9 +255,9 @@ dependencies = [
248
255
 
249
256
  [[package]]
250
257
  name = "pyo3-macros"
251
- version = "0.22.2"
258
+ version = "0.23.5"
252
259
  source = "registry+https://github.com/rust-lang/crates.io-index"
253
- checksum = "eb57983022ad41f9e683a599f2fd13c3664d7063a3ac5714cae4b7bee7d3f206"
260
+ checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da"
254
261
  dependencies = [
255
262
  "proc-macro2",
256
263
  "pyo3-macros-backend",
@@ -260,9 +267,9 @@ dependencies = [
260
267
 
261
268
  [[package]]
262
269
  name = "pyo3-macros-backend"
263
- version = "0.22.2"
270
+ version = "0.23.5"
264
271
  source = "registry+https://github.com/rust-lang/crates.io-index"
265
- checksum = "ec480c0c51ddec81019531705acac51bcdbeae563557c982aa8263bb96880372"
272
+ checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028"
266
273
  dependencies = [
267
274
  "heck",
268
275
  "proc-macro2",
@@ -273,9 +280,9 @@ dependencies = [
273
280
 
274
281
  [[package]]
275
282
  name = "quote"
276
- version = "1.0.36"
283
+ version = "1.0.38"
277
284
  source = "registry+https://github.com/rust-lang/crates.io-index"
278
- checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
285
+ checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
279
286
  dependencies = [
280
287
  "proc-macro2",
281
288
  ]
@@ -299,9 +306,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
299
306
 
300
307
  [[package]]
301
308
  name = "syn"
302
- version = "2.0.72"
309
+ version = "2.0.98"
303
310
  source = "registry+https://github.com/rust-lang/crates.io-index"
304
- checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
311
+ checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1"
305
312
  dependencies = [
306
313
  "proc-macro2",
307
314
  "quote",
@@ -310,21 +317,21 @@ dependencies = [
310
317
 
311
318
  [[package]]
312
319
  name = "target-lexicon"
313
- version = "0.12.15"
320
+ version = "0.12.16"
314
321
  source = "registry+https://github.com/rust-lang/crates.io-index"
315
- checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2"
322
+ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
316
323
 
317
324
  [[package]]
318
325
  name = "typenum"
319
- version = "1.17.0"
326
+ version = "1.18.0"
320
327
  source = "registry+https://github.com/rust-lang/crates.io-index"
321
- checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
328
+ checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
322
329
 
323
330
  [[package]]
324
331
  name = "unicode-ident"
325
- version = "1.0.12"
332
+ version = "1.0.17"
326
333
  source = "registry+https://github.com/rust-lang/crates.io-index"
327
- checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
334
+ checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe"
328
335
 
329
336
  [[package]]
330
337
  name = "unindent"
@@ -334,15 +341,91 @@ checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
334
341
 
335
342
  [[package]]
336
343
  name = "version_check"
337
- version = "0.9.4"
344
+ version = "0.9.5"
338
345
  source = "registry+https://github.com/rust-lang/crates.io-index"
339
- checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
346
+ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
340
347
 
341
348
  [[package]]
342
349
  name = "wasi"
343
- version = "0.11.0+wasi-snapshot-preview1"
350
+ version = "0.13.3+wasi-0.2.2"
351
+ source = "registry+https://github.com/rust-lang/crates.io-index"
352
+ checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2"
353
+ dependencies = [
354
+ "wit-bindgen-rt",
355
+ ]
356
+
357
+ [[package]]
358
+ name = "windows-targets"
359
+ version = "0.52.6"
360
+ source = "registry+https://github.com/rust-lang/crates.io-index"
361
+ checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
362
+ dependencies = [
363
+ "windows_aarch64_gnullvm",
364
+ "windows_aarch64_msvc",
365
+ "windows_i686_gnu",
366
+ "windows_i686_gnullvm",
367
+ "windows_i686_msvc",
368
+ "windows_x86_64_gnu",
369
+ "windows_x86_64_gnullvm",
370
+ "windows_x86_64_msvc",
371
+ ]
372
+
373
+ [[package]]
374
+ name = "windows_aarch64_gnullvm"
375
+ version = "0.52.6"
376
+ source = "registry+https://github.com/rust-lang/crates.io-index"
377
+ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
378
+
379
+ [[package]]
380
+ name = "windows_aarch64_msvc"
381
+ version = "0.52.6"
344
382
  source = "registry+https://github.com/rust-lang/crates.io-index"
345
- checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
383
+ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
384
+
385
+ [[package]]
386
+ name = "windows_i686_gnu"
387
+ version = "0.52.6"
388
+ source = "registry+https://github.com/rust-lang/crates.io-index"
389
+ checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
390
+
391
+ [[package]]
392
+ name = "windows_i686_gnullvm"
393
+ version = "0.52.6"
394
+ source = "registry+https://github.com/rust-lang/crates.io-index"
395
+ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
396
+
397
+ [[package]]
398
+ name = "windows_i686_msvc"
399
+ version = "0.52.6"
400
+ source = "registry+https://github.com/rust-lang/crates.io-index"
401
+ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
402
+
403
+ [[package]]
404
+ name = "windows_x86_64_gnu"
405
+ version = "0.52.6"
406
+ source = "registry+https://github.com/rust-lang/crates.io-index"
407
+ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
408
+
409
+ [[package]]
410
+ name = "windows_x86_64_gnullvm"
411
+ version = "0.52.6"
412
+ source = "registry+https://github.com/rust-lang/crates.io-index"
413
+ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
414
+
415
+ [[package]]
416
+ name = "windows_x86_64_msvc"
417
+ version = "0.52.6"
418
+ source = "registry+https://github.com/rust-lang/crates.io-index"
419
+ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
420
+
421
+ [[package]]
422
+ name = "wit-bindgen-rt"
423
+ version = "0.33.0"
424
+ source = "registry+https://github.com/rust-lang/crates.io-index"
425
+ checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c"
426
+ dependencies = [
427
+ "bitflags",
428
+ ]
346
429
 
347
430
  [[package]]
348
431
  name = "zeroize"
@@ -6,12 +6,12 @@ edition = "2018"
6
6
  publish = false
7
7
 
8
8
  [dependencies]
9
- pyo3 = { version = "0.22", features = ["abi3"] }
10
- bcrypt = "0.15"
9
+ pyo3 = { version = "0.23.5", features = ["abi3"] }
10
+ bcrypt = "0.17"
11
11
  bcrypt-pbkdf = "0.10.0"
12
12
  base64 = "0.22.1"
13
13
  subtle = "2.6"
14
- getrandom = "0.2"
14
+ getrandom = "0.3"
15
15
 
16
16
  [features]
17
17
  extension-module = ["pyo3/extension-module"]
@@ -16,6 +16,7 @@ use base64::Engine;
16
16
  use pyo3::types::PyBytesMethods;
17
17
  use pyo3::PyTypeInfo;
18
18
  use std::convert::TryInto;
19
+ use std::ffi::CString;
19
20
  use std::io::Write;
20
21
  use subtle::ConstantTimeEq;
21
22
 
@@ -45,11 +46,11 @@ fn gensalt<'p>(
45
46
  }
46
47
 
47
48
  let mut salt = [0; 16];
48
- getrandom::getrandom(&mut salt).unwrap();
49
+ getrandom::fill(&mut salt).unwrap();
49
50
 
50
51
  let encoded_salt = BASE64_ENGINE.encode(salt);
51
52
 
52
- pyo3::types::PyBytes::new_bound_with(
53
+ pyo3::types::PyBytes::new_with(
53
54
  py,
54
55
  1 + prefix.len() + 1 + 2 + 1 + encoded_salt.len(),
55
56
  |mut b| {
@@ -82,14 +83,14 @@ fn hashpw<'p>(
82
83
  // salt here is not just the salt bytes, but rather an encoded value
83
84
  // containing a version number, number of rounds, and the salt.
84
85
  // Should be [prefix, cost, hash]. This logic is copied from `bcrypt`
85
- let raw_parts: Vec<_> = salt
86
+ let [raw_version, raw_cost, remainder]: [&[u8]; 3] = salt
86
87
  .split(|&b| b == b'$')
87
88
  .filter(|s| !s.is_empty())
88
- .collect();
89
- if raw_parts.len() != 3 {
90
- return Err(pyo3::exceptions::PyValueError::new_err("Invalid salt"));
91
- }
92
- let version = match raw_parts[0] {
89
+ .collect::<Vec<_>>()
90
+ .try_into()
91
+ .map_err(|_| pyo3::exceptions::PyValueError::new_err("Invalid salt"))?;
92
+
93
+ let version = match raw_version {
93
94
  b"2y" => bcrypt::Version::TwoY,
94
95
  b"2b" => bcrypt::Version::TwoB,
95
96
  b"2a" => bcrypt::Version::TwoA,
@@ -98,15 +99,20 @@ fn hashpw<'p>(
98
99
  return Err(pyo3::exceptions::PyValueError::new_err("Invalid salt"));
99
100
  }
100
101
  };
101
- let cost = std::str::from_utf8(raw_parts[1])
102
+ let cost = std::str::from_utf8(raw_cost)
102
103
  .map_err(|_| pyo3::exceptions::PyValueError::new_err("Invalid salt"))?
103
104
  .parse::<u32>()
104
105
  .map_err(|_| pyo3::exceptions::PyValueError::new_err("Invalid salt"))?;
106
+
107
+ if remainder.len() < 22 {
108
+ return Err(pyo3::exceptions::PyValueError::new_err("Invalid salt"));
109
+ }
110
+
105
111
  // The last component can contain either just the salt, or the salt and
106
112
  // the result hash, depending on if the `salt` value come from `hashpw` or
107
113
  // `gensalt`.
108
114
  let raw_salt = BASE64_ENGINE
109
- .decode(&raw_parts[2][..22])
115
+ .decode(&remainder[..22])
110
116
  .map_err(|_| pyo3::exceptions::PyValueError::new_err("Invalid salt"))?
111
117
  .try_into()
112
118
  .map_err(|_| pyo3::exceptions::PyValueError::new_err("Invalid salt"))?;
@@ -114,7 +120,7 @@ fn hashpw<'p>(
114
120
  let hashed = py
115
121
  .allow_threads(|| bcrypt::hash_with_salt(password, cost, raw_salt))
116
122
  .map_err(|_| pyo3::exceptions::PyValueError::new_err("Invalid salt"))?;
117
- Ok(pyo3::types::PyBytes::new_bound(
123
+ Ok(pyo3::types::PyBytes::new(
118
124
  py,
119
125
  hashed.format_for_version(version).as_bytes(),
120
126
  ))
@@ -160,15 +166,15 @@ fn kdf<'p>(
160
166
  // They probably think bcrypt.kdf()'s rounds parameter is logarithmic,
161
167
  // expecting this value to be slow enough (it probably would be if this
162
168
  // were bcrypt). Emit a warning.
163
- pyo3::PyErr::warn_bound(
169
+ pyo3::PyErr::warn(
164
170
  py,
165
- &pyo3::exceptions::PyUserWarning::type_object_bound(py),
166
- &format!("Warning: bcrypt.kdf() called with only {rounds} round(s). This few is not secure: the parameter is linear, like PBKDF2."),
171
+ &pyo3::exceptions::PyUserWarning::type_object(py),
172
+ &CString::new(format!("Warning: bcrypt.kdf() called with only {rounds} round(s). This few is not secure: the parameter is linear, like PBKDF2.")).unwrap(),
167
173
  3
168
174
  )?;
169
175
  }
170
176
 
171
- pyo3::types::PyBytes::new_bound_with(py, desired_key_bytes, |output| {
177
+ pyo3::types::PyBytes::new_with(py, desired_key_bytes, |output| {
172
178
  py.allow_threads(|| {
173
179
  bcrypt_pbkdf::bcrypt_pbkdf(password, salt, rounds, output).unwrap();
174
180
  });
@@ -176,7 +182,7 @@ fn kdf<'p>(
176
182
  })
177
183
  }
178
184
 
179
- #[pyo3::pymodule]
185
+ #[pyo3::pymodule(gil_used = false)]
180
186
  mod _bcrypt {
181
187
  use pyo3::types::PyModuleMethods;
182
188
 
@@ -196,14 +202,14 @@ mod _bcrypt {
196
202
  // When updating this, also update pyproject.toml
197
203
  // This isn't named __version__ because passlib treats the existence of
198
204
  // that attribute as proof that we're a different module
199
- m.add("__version_ex__", "4.2.0")?;
205
+ m.add("__version_ex__", "4.3.0")?;
200
206
 
201
207
  let author = "The Python Cryptographic Authority developers";
202
208
  m.add("__author__", author)?;
203
209
  m.add("__email__", "cryptography-dev@python.org")?;
204
210
 
205
211
  m.add("__license__", "Apache License, Version 2.0")?;
206
- m.add("__copyright__", format!("Copyright 2013-2024 {author}"))?;
212
+ m.add("__copyright__", format!("Copyright 2013-2025 {author}"))?;
207
213
 
208
214
  Ok(())
209
215
  }
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: bcrypt
3
- Version: 4.2.0
3
+ Version: 4.3.0
4
4
  Summary: Modern password hashing for your software and your servers
5
5
  Author-email: The Python Cryptographic Authority developers <cryptography-dev@python.org>
6
6
  License: Apache-2.0
@@ -11,13 +11,13 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
11
11
  Classifier: Programming Language :: Python :: Implementation :: PyPy
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3 :: Only
14
- Classifier: Programming Language :: Python :: 3.7
15
14
  Classifier: Programming Language :: Python :: 3.8
16
15
  Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
19
18
  Classifier: Programming Language :: Python :: 3.12
20
- Requires-Python: >=3.7
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.8
21
21
  Description-Content-Type: text/x-rst
22
22
  License-File: LICENSE
23
23
  Provides-Extra: tests
@@ -44,7 +44,7 @@ Installation
44
44
 
45
45
  To install bcrypt, simply:
46
46
 
47
- .. code:: bash
47
+ .. code:: console
48
48
 
49
49
  $ pip install bcrypt
50
50
 
@@ -53,19 +53,19 @@ compiler and a Rust compiler (the minimum supported Rust version is 1.56.0).
53
53
 
54
54
  For Debian and Ubuntu, the following command will ensure that the required dependencies are installed:
55
55
 
56
- .. code:: bash
56
+ .. code:: console
57
57
 
58
58
  $ sudo apt-get install build-essential cargo
59
59
 
60
60
  For Fedora and RHEL-derivatives, the following command will ensure that the required dependencies are installed:
61
61
 
62
- .. code:: bash
62
+ .. code:: console
63
63
 
64
64
  $ sudo yum install gcc cargo
65
65
 
66
66
  For Alpine, the following command will ensure that the required dependencies are installed:
67
67
 
68
- .. code:: bash
68
+ .. code:: console
69
69
 
70
70
  $ apk add --update musl-dev gcc cargo
71
71
 
@@ -78,6 +78,22 @@ While bcrypt remains an acceptable choice for password storage, depending on you
78
78
  Changelog
79
79
  =========
80
80
 
81
+ Unreleased
82
+ ----------
83
+
84
+ * Dropped support for Python 3.7.
85
+ * We now support free-threaded Python 3.13.
86
+ * We now support PyPy 3.11.
87
+ * We now publish wheels for free-threaded Python 3.13, for PyPy 3.11 on
88
+ ``manylinux``, and for ARMv7l on ``manylinux``.
89
+
90
+ 4.2.1
91
+ -----
92
+
93
+ * Bump Rust dependency versions - this should resolve crashes on Python 3.13
94
+ free-threaded builds.
95
+ * We no longer build ``manylinux`` wheels for PyPy 3.9.
96
+
81
97
  4.2.0
82
98
  -----
83
99
 
@@ -300,7 +316,7 @@ Compatibility
300
316
  -------------
301
317
 
302
318
  This library should be compatible with py-bcrypt and it will run on Python
303
- 3.6+, and PyPy 3.
319
+ 3.8+ (including free-threaded builds), and PyPy 3.
304
320
 
305
321
  Security
306
322
  --------
@@ -2,8 +2,8 @@
2
2
  LICENSE
3
3
  MANIFEST.in
4
4
  README.rst
5
+ noxfile.py
5
6
  pyproject.toml
6
- tox.ini
7
7
  src/_bcrypt/Cargo.lock
8
8
  src/_bcrypt/Cargo.toml
9
9
  src/_bcrypt/src/lib.rs
@@ -1,3 +1,6 @@
1
+ import uuid
2
+ from concurrent.futures import ThreadPoolExecutor
3
+
1
4
  import pytest
2
5
 
3
6
  import bcrypt
@@ -171,7 +174,7 @@ _2y_test_vectors = [
171
174
  ]
172
175
 
173
176
 
174
- def test_gensalt_basic(monkeypatch):
177
+ def test_gensalt_basic():
175
178
  salt = bcrypt.gensalt()
176
179
  assert salt.startswith(b"$2b$12$")
177
180
 
@@ -219,7 +222,7 @@ def test_gensalt_bad_prefix():
219
222
  bcrypt.gensalt(prefix=b"bad")
220
223
 
221
224
 
222
- def test_gensalt_2a_prefix(monkeypatch):
225
+ def test_gensalt_2a_prefix():
223
226
  salt = bcrypt.gensalt(prefix=b"2a")
224
227
  assert salt.startswith(b"$2a$12$")
225
228
 
@@ -275,6 +278,8 @@ def test_checkpw_bad_salt():
275
278
  b"password",
276
279
  b"$2b$3$mdEQPMOtfPX.WGZNXgF66OhmBlOGKEd66SQ7DyJPGucYYmvTJYviy",
277
280
  )
281
+ with pytest.raises(ValueError):
282
+ bcrypt.checkpw(b"password", b"$2b$12$incorrect")
278
283
 
279
284
 
280
285
  def test_checkpw_str_password():
@@ -492,3 +497,24 @@ def test_2a_wraparound_bug():
492
497
  )
493
498
  == b"$2a$04$R1lJ2gkNaoPGdafE.H.16.1MKHPvmKwryeulRe225LKProWYwt9Oi"
494
499
  )
500
+
501
+
502
+ def test_multithreading():
503
+ def create_user(pw):
504
+ salt = bcrypt.gensalt(4)
505
+ hash_ = bcrypt.hashpw(pw, salt)
506
+ key = bcrypt.kdf(pw, salt, 32, 50)
507
+ assert bcrypt.checkpw(pw, hash_)
508
+ return (salt, hash_, key)
509
+
510
+ user_creator = ThreadPoolExecutor(max_workers=4)
511
+ pws = [uuid.uuid4().bytes for _ in range(50)]
512
+
513
+ futures = [user_creator.submit(create_user, pw) for pw in pws]
514
+
515
+ users = [future.result() for future in futures]
516
+
517
+ for pw, (salt, hash_, key) in zip(pws, users):
518
+ assert bcrypt.hashpw(pw, salt) == hash_
519
+ assert bcrypt.checkpw(pw, hash_)
520
+ assert bcrypt.kdf(pw, salt, 32, 50) == key
bcrypt-4.2.0/tox.ini DELETED
@@ -1,43 +0,0 @@
1
- [tox]
2
- isolated_build = True
3
-
4
- [testenv]
5
- extras =
6
- tests
7
- deps =
8
- coverage
9
- passenv =
10
- RUSTUP_HOME
11
- commands =
12
- coverage run -m pytest --strict-markers {posargs}
13
- coverage combine
14
- coverage report -m --fail-under 100
15
-
16
- [testenv:pep8]
17
- deps =
18
- ruff
19
- commands =
20
- ruff check .
21
- ruff format --check .
22
-
23
- [testenv:mypy]
24
- extras =
25
- tests
26
- deps =
27
- mypy
28
- commands =
29
- mypy tests/
30
-
31
- [testenv:packaging]
32
- deps =
33
- setuptools-rust
34
- check-manifest
35
- readme_renderer
36
- commands =
37
- check-manifest
38
- python3 -m readme_renderer README.rst -o /dev/null
39
-
40
-
41
- [check-manifest]
42
- ignore =
43
- tests/reference/*
File without changes
File without changes
File without changes
@@ -28,16 +28,16 @@ from ._bcrypt import (
28
28
  )
29
29
 
30
30
  __all__ = [
31
- "gensalt",
32
- "hashpw",
33
- "checkpw",
34
- "kdf",
35
- "__title__",
36
- "__summary__",
37
- "__uri__",
38
- "__version__",
39
31
  "__author__",
32
+ "__copyright__",
40
33
  "__email__",
41
34
  "__license__",
42
- "__copyright__",
35
+ "__summary__",
36
+ "__title__",
37
+ "__uri__",
38
+ "__version__",
39
+ "checkpw",
40
+ "gensalt",
41
+ "hashpw",
42
+ "kdf",
43
43
  ]
File without changes
File without changes