bcrypt 4.1.1__tar.gz → 4.1.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bcrypt
3
- Version: 4.1.1
3
+ Version: 4.1.3
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
@@ -78,10 +78,23 @@ While bcrypt remains an acceptable choice for password storage, depending on you
78
78
  Changelog
79
79
  =========
80
80
 
81
+ 4.1.3
82
+ -----
83
+
84
+ * Bump Rust dependency versions
85
+
86
+ 4.1.2
87
+ -----
88
+
89
+ * Publish both ``py37`` and ``py39`` wheels. This should resolve some errors
90
+ relating to initializing a module multiple times per process.
91
+
81
92
  4.1.1
82
93
  -----
83
94
 
84
95
  * Fixed the type signature on the ``kdf`` method.
96
+ * Fixed packaging bug on Windows.
97
+ * Fixed incompatibility with passlib package detection assumptions.
85
98
 
86
99
  4.1.0
87
100
  -----
@@ -283,11 +296,6 @@ Compatibility
283
296
  This library should be compatible with py-bcrypt and it will run on Python
284
297
  3.6+, and PyPy 3.
285
298
 
286
- C Code
287
- ------
288
-
289
- This library uses code from OpenBSD.
290
-
291
299
  Security
292
300
  --------
293
301
 
@@ -51,10 +51,23 @@ While bcrypt remains an acceptable choice for password storage, depending on you
51
51
  Changelog
52
52
  =========
53
53
 
54
+ 4.1.3
55
+ -----
56
+
57
+ * Bump Rust dependency versions
58
+
59
+ 4.1.2
60
+ -----
61
+
62
+ * Publish both ``py37`` and ``py39`` wheels. This should resolve some errors
63
+ relating to initializing a module multiple times per process.
64
+
54
65
  4.1.1
55
66
  -----
56
67
 
57
68
  * Fixed the type signature on the ``kdf`` method.
69
+ * Fixed packaging bug on Windows.
70
+ * Fixed incompatibility with passlib package detection assumptions.
58
71
 
59
72
  4.1.0
60
73
  -----
@@ -256,11 +269,6 @@ Compatibility
256
269
  This library should be compatible with py-bcrypt and it will run on Python
257
270
  3.6+, and PyPy 3.
258
271
 
259
- C Code
260
- ------
261
-
262
- This library uses code from OpenBSD.
263
-
264
272
  Security
265
273
  --------
266
274
 
@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"
12
12
  [project]
13
13
  name = "bcrypt"
14
14
  # When updating this, also update lib.rs
15
- version = "4.1.1"
15
+ version = "4.1.3"
16
16
  authors = [
17
17
  {name = "The Python Cryptographic Authority developers", email = "cryptography-dev@python.org"}
18
18
  ]
@@ -37,7 +37,7 @@ try:
37
37
  RustExtension(
38
38
  "bcrypt._bcrypt",
39
39
  "src/_bcrypt/Cargo.toml",
40
- py_limited_api=True,
40
+ py_limited_api="auto",
41
41
  rust_version=(
42
42
  ">=1.64.0"
43
43
  if os.environ.get("BCRYPT_ALLOW_RUST_163", "0") != "0"
@@ -4,21 +4,21 @@ version = 3
4
4
 
5
5
  [[package]]
6
6
  name = "autocfg"
7
- version = "1.1.0"
7
+ version = "1.3.0"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
9
+ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
10
10
 
11
11
  [[package]]
12
12
  name = "base64"
13
- version = "0.21.5"
13
+ version = "0.22.1"
14
14
  source = "registry+https://github.com/rust-lang/crates.io-index"
15
- checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
15
+ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
16
16
 
17
17
  [[package]]
18
18
  name = "bcrypt"
19
- version = "0.15.0"
19
+ version = "0.15.1"
20
20
  source = "registry+https://github.com/rust-lang/crates.io-index"
21
- checksum = "28d1c9c15093eb224f0baa400f38fcd713fc1391a6f1c389d886beef146d60a3"
21
+ checksum = "e65938ed058ef47d92cf8b346cc76ef48984572ade631927e9937b5ffc7662c7"
22
22
  dependencies = [
23
23
  "base64",
24
24
  "blowfish",
@@ -52,9 +52,9 @@ dependencies = [
52
52
 
53
53
  [[package]]
54
54
  name = "bitflags"
55
- version = "1.3.2"
55
+ version = "2.5.0"
56
56
  source = "registry+https://github.com/rust-lang/crates.io-index"
57
- checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
57
+ checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
58
58
 
59
59
  [[package]]
60
60
  name = "block-buffer"
@@ -99,9 +99,9 @@ dependencies = [
99
99
 
100
100
  [[package]]
101
101
  name = "cpufeatures"
102
- version = "0.2.11"
102
+ version = "0.2.12"
103
103
  source = "registry+https://github.com/rust-lang/crates.io-index"
104
- checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0"
104
+ checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
105
105
  dependencies = [
106
106
  "libc",
107
107
  ]
@@ -139,9 +139,9 @@ dependencies = [
139
139
 
140
140
  [[package]]
141
141
  name = "getrandom"
142
- version = "0.2.11"
142
+ version = "0.2.14"
143
143
  source = "registry+https://github.com/rust-lang/crates.io-index"
144
- checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f"
144
+ checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c"
145
145
  dependencies = [
146
146
  "cfg-if",
147
147
  "libc",
@@ -156,9 +156,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
156
156
 
157
157
  [[package]]
158
158
  name = "indoc"
159
- version = "2.0.4"
159
+ version = "2.0.5"
160
160
  source = "registry+https://github.com/rust-lang/crates.io-index"
161
- checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8"
161
+ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
162
162
 
163
163
  [[package]]
164
164
  name = "inout"
@@ -171,15 +171,15 @@ dependencies = [
171
171
 
172
172
  [[package]]
173
173
  name = "libc"
174
- version = "0.2.150"
174
+ version = "0.2.154"
175
175
  source = "registry+https://github.com/rust-lang/crates.io-index"
176
- checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
176
+ checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346"
177
177
 
178
178
  [[package]]
179
179
  name = "lock_api"
180
- version = "0.4.11"
180
+ version = "0.4.12"
181
181
  source = "registry+https://github.com/rust-lang/crates.io-index"
182
- checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
182
+ checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
183
183
  dependencies = [
184
184
  "autocfg",
185
185
  "scopeguard",
@@ -187,24 +187,24 @@ dependencies = [
187
187
 
188
188
  [[package]]
189
189
  name = "memoffset"
190
- version = "0.9.0"
190
+ version = "0.9.1"
191
191
  source = "registry+https://github.com/rust-lang/crates.io-index"
192
- checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
192
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
193
193
  dependencies = [
194
194
  "autocfg",
195
195
  ]
196
196
 
197
197
  [[package]]
198
198
  name = "once_cell"
199
- version = "1.18.0"
199
+ version = "1.19.0"
200
200
  source = "registry+https://github.com/rust-lang/crates.io-index"
201
- checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
201
+ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
202
202
 
203
203
  [[package]]
204
204
  name = "parking_lot"
205
- version = "0.12.1"
205
+ version = "0.12.2"
206
206
  source = "registry+https://github.com/rust-lang/crates.io-index"
207
- checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
207
+ checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb"
208
208
  dependencies = [
209
209
  "lock_api",
210
210
  "parking_lot_core",
@@ -212,9 +212,9 @@ dependencies = [
212
212
 
213
213
  [[package]]
214
214
  name = "parking_lot_core"
215
- version = "0.9.9"
215
+ version = "0.9.10"
216
216
  source = "registry+https://github.com/rust-lang/crates.io-index"
217
- checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
217
+ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
218
218
  dependencies = [
219
219
  "cfg-if",
220
220
  "libc",
@@ -232,26 +232,33 @@ dependencies = [
232
232
  "digest",
233
233
  ]
234
234
 
235
+ [[package]]
236
+ name = "portable-atomic"
237
+ version = "1.6.0"
238
+ source = "registry+https://github.com/rust-lang/crates.io-index"
239
+ checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
240
+
235
241
  [[package]]
236
242
  name = "proc-macro2"
237
- version = "1.0.70"
243
+ version = "1.0.81"
238
244
  source = "registry+https://github.com/rust-lang/crates.io-index"
239
- checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
245
+ checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba"
240
246
  dependencies = [
241
247
  "unicode-ident",
242
248
  ]
243
249
 
244
250
  [[package]]
245
251
  name = "pyo3"
246
- version = "0.20.0"
252
+ version = "0.21.2"
247
253
  source = "registry+https://github.com/rust-lang/crates.io-index"
248
- checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b"
254
+ checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8"
249
255
  dependencies = [
250
256
  "cfg-if",
251
257
  "indoc",
252
258
  "libc",
253
259
  "memoffset",
254
260
  "parking_lot",
261
+ "portable-atomic",
255
262
  "pyo3-build-config",
256
263
  "pyo3-ffi",
257
264
  "pyo3-macros",
@@ -260,9 +267,9 @@ dependencies = [
260
267
 
261
268
  [[package]]
262
269
  name = "pyo3-build-config"
263
- version = "0.20.0"
270
+ version = "0.21.2"
264
271
  source = "registry+https://github.com/rust-lang/crates.io-index"
265
- checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5"
272
+ checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50"
266
273
  dependencies = [
267
274
  "once_cell",
268
275
  "target-lexicon",
@@ -270,9 +277,9 @@ dependencies = [
270
277
 
271
278
  [[package]]
272
279
  name = "pyo3-ffi"
273
- version = "0.20.0"
280
+ version = "0.21.2"
274
281
  source = "registry+https://github.com/rust-lang/crates.io-index"
275
- checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b"
282
+ checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403"
276
283
  dependencies = [
277
284
  "libc",
278
285
  "pyo3-build-config",
@@ -280,9 +287,9 @@ dependencies = [
280
287
 
281
288
  [[package]]
282
289
  name = "pyo3-macros"
283
- version = "0.20.0"
290
+ version = "0.21.2"
284
291
  source = "registry+https://github.com/rust-lang/crates.io-index"
285
- checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b"
292
+ checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c"
286
293
  dependencies = [
287
294
  "proc-macro2",
288
295
  "pyo3-macros-backend",
@@ -292,30 +299,31 @@ dependencies = [
292
299
 
293
300
  [[package]]
294
301
  name = "pyo3-macros-backend"
295
- version = "0.20.0"
302
+ version = "0.21.2"
296
303
  source = "registry+https://github.com/rust-lang/crates.io-index"
297
- checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424"
304
+ checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c"
298
305
  dependencies = [
299
306
  "heck",
300
307
  "proc-macro2",
308
+ "pyo3-build-config",
301
309
  "quote",
302
310
  "syn",
303
311
  ]
304
312
 
305
313
  [[package]]
306
314
  name = "quote"
307
- version = "1.0.33"
315
+ version = "1.0.36"
308
316
  source = "registry+https://github.com/rust-lang/crates.io-index"
309
- checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
317
+ checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
310
318
  dependencies = [
311
319
  "proc-macro2",
312
320
  ]
313
321
 
314
322
  [[package]]
315
323
  name = "redox_syscall"
316
- version = "0.4.1"
324
+ version = "0.5.1"
317
325
  source = "registry+https://github.com/rust-lang/crates.io-index"
318
- checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
326
+ checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e"
319
327
  dependencies = [
320
328
  "bitflags",
321
329
  ]
@@ -339,9 +347,9 @@ dependencies = [
339
347
 
340
348
  [[package]]
341
349
  name = "smallvec"
342
- version = "1.11.2"
350
+ version = "1.13.2"
343
351
  source = "registry+https://github.com/rust-lang/crates.io-index"
344
- checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
352
+ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
345
353
 
346
354
  [[package]]
347
355
  name = "subtle"
@@ -351,9 +359,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
351
359
 
352
360
  [[package]]
353
361
  name = "syn"
354
- version = "2.0.39"
362
+ version = "2.0.60"
355
363
  source = "registry+https://github.com/rust-lang/crates.io-index"
356
- checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
364
+ checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3"
357
365
  dependencies = [
358
366
  "proc-macro2",
359
367
  "quote",
@@ -362,9 +370,9 @@ dependencies = [
362
370
 
363
371
  [[package]]
364
372
  name = "target-lexicon"
365
- version = "0.12.12"
373
+ version = "0.12.14"
366
374
  source = "registry+https://github.com/rust-lang/crates.io-index"
367
- checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a"
375
+ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
368
376
 
369
377
  [[package]]
370
378
  name = "typenum"
@@ -398,13 +406,14 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
398
406
 
399
407
  [[package]]
400
408
  name = "windows-targets"
401
- version = "0.48.5"
409
+ version = "0.52.5"
402
410
  source = "registry+https://github.com/rust-lang/crates.io-index"
403
- checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
411
+ checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
404
412
  dependencies = [
405
413
  "windows_aarch64_gnullvm",
406
414
  "windows_aarch64_msvc",
407
415
  "windows_i686_gnu",
416
+ "windows_i686_gnullvm",
408
417
  "windows_i686_msvc",
409
418
  "windows_x86_64_gnu",
410
419
  "windows_x86_64_gnullvm",
@@ -413,45 +422,51 @@ dependencies = [
413
422
 
414
423
  [[package]]
415
424
  name = "windows_aarch64_gnullvm"
416
- version = "0.48.5"
425
+ version = "0.52.5"
417
426
  source = "registry+https://github.com/rust-lang/crates.io-index"
418
- checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
427
+ checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
419
428
 
420
429
  [[package]]
421
430
  name = "windows_aarch64_msvc"
422
- version = "0.48.5"
431
+ version = "0.52.5"
423
432
  source = "registry+https://github.com/rust-lang/crates.io-index"
424
- checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
433
+ checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
425
434
 
426
435
  [[package]]
427
436
  name = "windows_i686_gnu"
428
- version = "0.48.5"
437
+ version = "0.52.5"
438
+ source = "registry+https://github.com/rust-lang/crates.io-index"
439
+ checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
440
+
441
+ [[package]]
442
+ name = "windows_i686_gnullvm"
443
+ version = "0.52.5"
429
444
  source = "registry+https://github.com/rust-lang/crates.io-index"
430
- checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
445
+ checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
431
446
 
432
447
  [[package]]
433
448
  name = "windows_i686_msvc"
434
- version = "0.48.5"
449
+ version = "0.52.5"
435
450
  source = "registry+https://github.com/rust-lang/crates.io-index"
436
- checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
451
+ checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
437
452
 
438
453
  [[package]]
439
454
  name = "windows_x86_64_gnu"
440
- version = "0.48.5"
455
+ version = "0.52.5"
441
456
  source = "registry+https://github.com/rust-lang/crates.io-index"
442
- checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
457
+ checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
443
458
 
444
459
  [[package]]
445
460
  name = "windows_x86_64_gnullvm"
446
- version = "0.48.5"
461
+ version = "0.52.5"
447
462
  source = "registry+https://github.com/rust-lang/crates.io-index"
448
- checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
463
+ checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
449
464
 
450
465
  [[package]]
451
466
  name = "windows_x86_64_msvc"
452
- version = "0.48.5"
467
+ version = "0.52.5"
453
468
  source = "registry+https://github.com/rust-lang/crates.io-index"
454
- checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
469
+ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
455
470
 
456
471
  [[package]]
457
472
  name = "zeroize"
@@ -6,10 +6,10 @@ edition = "2018"
6
6
  publish = false
7
7
 
8
8
  [dependencies]
9
- pyo3 = { version = "0.20.0", features = ["abi3-py37"] }
9
+ pyo3 = { version = "0.21", features = ["abi3"] }
10
10
  bcrypt = "0.15"
11
11
  bcrypt-pbkdf = "0.10.0"
12
- base64 = "0.21.5"
12
+ base64 = "0.22.1"
13
13
  subtle = "2.5"
14
14
  getrandom = "0.2"
15
15
 
@@ -1,10 +1,19 @@
1
- // This file is dual licensed under the terms of the Apache License, Version
2
- // 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
- // for complete details.
1
+ // Licensed under the Apache License, Version 2.0 (the "License");
2
+ // you may not use this file except in compliance with the License.
3
+ // You may obtain a copy of the License at
4
+ //
5
+ // http://www.apache.org/licenses/LICENSE-2.0
6
+ //
7
+ // Unless required by applicable law or agreed to in writing, software
8
+ // distributed under the License is distributed on an "AS IS" BASIS,
9
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ // See the License for the specific language governing permissions and
11
+ // limitations under the License.
4
12
 
5
13
  #![deny(rust_2018_idioms)]
6
14
 
7
15
  use base64::Engine;
16
+ use pyo3::prelude::PyBytesMethods;
8
17
  use pyo3::PyTypeInfo;
9
18
  use std::convert::TryInto;
10
19
  use std::io::Write;
@@ -20,7 +29,7 @@ fn gensalt<'p>(
20
29
  py: pyo3::Python<'p>,
21
30
  rounds: Option<u16>,
22
31
  prefix: Option<&[u8]>,
23
- ) -> pyo3::PyResult<&'p pyo3::types::PyBytes> {
32
+ ) -> pyo3::PyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {
24
33
  let rounds = rounds.unwrap_or(12);
25
34
  let prefix = prefix.unwrap_or(b"2b");
26
35
 
@@ -39,7 +48,7 @@ fn gensalt<'p>(
39
48
 
40
49
  let encoded_salt = BASE64_ENGINE.encode(salt);
41
50
 
42
- pyo3::types::PyBytes::new_with(
51
+ pyo3::types::PyBytes::new_bound_with(
43
52
  py,
44
53
  1 + prefix.len() + 1 + 2 + 1 + encoded_salt.len(),
45
54
  |mut b| {
@@ -60,7 +69,7 @@ fn hashpw<'p>(
60
69
  py: pyo3::Python<'p>,
61
70
  password: &[u8],
62
71
  salt: &[u8],
63
- ) -> pyo3::PyResult<&'p pyo3::types::PyBytes> {
72
+ ) -> pyo3::PyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {
64
73
  // bcrypt originally suffered from a wraparound bug:
65
74
  // http://www.openwall.com/lists/oss-security/2012/01/02/4
66
75
  // This bug was corrected in the OpenBSD source by truncating inputs to 72
@@ -104,18 +113,14 @@ fn hashpw<'p>(
104
113
  let hashed = py
105
114
  .allow_threads(|| bcrypt::hash_with_salt(password, cost, raw_salt))
106
115
  .map_err(|_| pyo3::exceptions::PyValueError::new_err("Invalid salt"))?;
107
- Ok(pyo3::types::PyBytes::new(
116
+ Ok(pyo3::types::PyBytes::new_bound(
108
117
  py,
109
118
  hashed.format_for_version(version).as_bytes(),
110
119
  ))
111
120
  }
112
121
 
113
122
  #[pyo3::prelude::pyfunction]
114
- fn checkpw(
115
- py: pyo3::Python<'_>,
116
- password: &[u8],
117
- hashed_password: &[u8],
118
- ) -> pyo3::PyResult<bool> {
123
+ fn checkpw(py: pyo3::Python<'_>, password: &[u8], hashed_password: &[u8]) -> pyo3::PyResult<bool> {
119
124
  Ok(hashpw(py, password, hashed_password)?
120
125
  .as_bytes()
121
126
  .ct_eq(hashed_password)
@@ -130,7 +135,7 @@ fn kdf<'p>(
130
135
  desired_key_bytes: usize,
131
136
  rounds: u32,
132
137
  ignore_few_rounds: Option<bool>,
133
- ) -> pyo3::PyResult<&'p pyo3::types::PyBytes> {
138
+ ) -> pyo3::PyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {
134
139
  let ignore_few_rounds = ignore_few_rounds.unwrap_or(false);
135
140
 
136
141
  if password.is_empty() || salt.is_empty() {
@@ -155,15 +160,15 @@ fn kdf<'p>(
155
160
  // They probably think bcrypt.kdf()'s rounds parameter is logarithmic,
156
161
  // expecting this value to be slow enough (it probably would be if this
157
162
  // were bcrypt). Emit a warning.
158
- pyo3::PyErr::warn(
163
+ pyo3::PyErr::warn_bound(
159
164
  py,
160
- pyo3::exceptions::PyUserWarning::type_object(py),
165
+ &pyo3::exceptions::PyUserWarning::type_object_bound(py),
161
166
  &format!("Warning: bcrypt.kdf() called with only {rounds} round(s). This few is not secure: the parameter is linear, like PBKDF2."),
162
167
  3
163
168
  )?;
164
169
  }
165
170
 
166
- pyo3::types::PyBytes::new_with(py, desired_key_bytes, |output| {
171
+ pyo3::types::PyBytes::new_bound_with(py, desired_key_bytes, |output| {
167
172
  py.allow_threads(|| {
168
173
  bcrypt_pbkdf::bcrypt_pbkdf(password, salt, rounds, output).unwrap();
169
174
  });
@@ -172,27 +177,33 @@ fn kdf<'p>(
172
177
  }
173
178
 
174
179
  #[pyo3::prelude::pymodule]
175
- fn _bcrypt(_py: pyo3::Python<'_>, m: &pyo3::types::PyModule) -> pyo3::PyResult<()> {
180
+ fn _bcrypt(
181
+ _py: pyo3::Python<'_>,
182
+ m: &pyo3::Bound<'_, pyo3::types::PyModule>,
183
+ ) -> pyo3::PyResult<()> {
176
184
  m.add_function(pyo3::wrap_pyfunction!(gensalt, m)?)?;
177
185
  m.add_function(pyo3::wrap_pyfunction!(hashpw, m)?)?;
178
186
  m.add_function(pyo3::wrap_pyfunction!(checkpw, m)?)?;
179
187
  m.add_function(pyo3::wrap_pyfunction!(kdf, m)?)?;
180
188
 
181
189
  m.add("__title__", "bcrypt")?;
182
- m.add("__summary__", "Modern(-ish) password hashing for your software and your servers")?;
190
+ m.add(
191
+ "__summary__",
192
+ "Modern(-ish) password hashing for your software and your servers",
193
+ )?;
183
194
  m.add("__uri__", "https://github.com/pyca/bcrypt/")?;
184
195
 
185
196
  // When updating this, also update pyproject.toml
186
197
  // This isn't named __version__ because passlib treats the existence of
187
198
  // that attribute as proof that we're a different module
188
- m.add("__version_ex__", "4.1.1")?;
199
+ m.add("__version_ex__", "4.1.3")?;
189
200
 
190
201
  let author = "The Python Cryptographic Authority developers";
191
202
  m.add("__author__", author)?;
192
203
  m.add("__email__", "cryptography-dev@python.org")?;
193
204
 
194
205
  m.add("__license__", "Apache License, Version 2.0")?;
195
- m.add("__copyright__", format!("Copyright 2013-2023 {author}"))?;
206
+ m.add("__copyright__", format!("Copyright 2013-2024 {author}"))?;
196
207
 
197
208
  Ok(())
198
209
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bcrypt
3
- Version: 4.1.1
3
+ Version: 4.1.3
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
@@ -78,10 +78,23 @@ While bcrypt remains an acceptable choice for password storage, depending on you
78
78
  Changelog
79
79
  =========
80
80
 
81
+ 4.1.3
82
+ -----
83
+
84
+ * Bump Rust dependency versions
85
+
86
+ 4.1.2
87
+ -----
88
+
89
+ * Publish both ``py37`` and ``py39`` wheels. This should resolve some errors
90
+ relating to initializing a module multiple times per process.
91
+
81
92
  4.1.1
82
93
  -----
83
94
 
84
95
  * Fixed the type signature on the ``kdf`` method.
96
+ * Fixed packaging bug on Windows.
97
+ * Fixed incompatibility with passlib package detection assumptions.
85
98
 
86
99
  4.1.0
87
100
  -----
@@ -283,11 +296,6 @@ Compatibility
283
296
  This library should be compatible with py-bcrypt and it will run on Python
284
297
  3.6+, and PyPy 3.
285
298
 
286
- C Code
287
- ------
288
-
289
- This library uses code from OpenBSD.
290
-
291
299
  Security
292
300
  --------
293
301
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes