Files
nixpkgs/pkgs/development/python-modules/cryptography/default.nix
Gerhard Schwanzer a7e1a760ab python3Packages.cryptography: 49.0.0 -> 50.0.0
https://cryptography.io/en/latest/changelog/#v50-0-0

This release fixes CVE-2026-69247.

Assisted-by: pi coding agent / Mika (OpenAI gpt-5.6-sol)
2026-08-04 18:06:14 +02:00

100 lines
2.1 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
callPackage,
setuptools,
bcrypt,
certifi,
cffi,
cryptography-vectors ? (callPackage ./vectors.nix { }),
fetchFromGitHub,
isPyPy,
libiconv,
openssl,
pkg-config,
pretend,
pytest-xdist,
pytestCheckHook,
rustPlatform,
}:
buildPythonPackage rec {
pname = "cryptography";
version = "50.0.0";
pyproject = true;
src = fetchFromGitHub {
owner = "pyca";
repo = "cryptography";
tag = version;
hash = "sha256-KHxEVSYr8yrODSVsGNgZowI/YnhG3qnFgae9877H+VE=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
hash = "sha256-heJGLh0MgDPpksWyPLaIkZ5gVEWx8UnaJKv4GvclpmI=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "--benchmark-disable" ""
'';
build-system = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
pkg-config
setuptools
]
++ lib.optionals (!isPyPy) [ cffi ];
buildInputs = [
openssl
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
];
dependencies = lib.optionals (!isPyPy) [ cffi ];
optional-dependencies.ssh = [ bcrypt ];
nativeCheckInputs = [
certifi
cryptography-vectors
pretend
pytestCheckHook
pytest-xdist
]
++ optional-dependencies.ssh;
pytestFlags = [ "--disable-pytest-warnings" ];
disabledTestPaths = [
# save compute time by not running benchmarks
"tests/bench"
];
passthru = {
vectors = cryptography-vectors;
};
meta = {
description = "Package which provides cryptographic recipes and primitives";
longDescription = ''
Cryptography includes both high level recipes and low level interfaces to
common cryptographic algorithms such as symmetric ciphers, message
digests, and key derivation functions.
'';
homepage = "https://github.com/pyca/cryptography";
changelog = "https://cryptography.io/en/latest/changelog/#v" + lib.replaceString "." "-" version;
license = with lib.licenses; [
asl20
bsd3
psfl
];
maintainers = with lib.maintainers; [ mdaniels5757 ];
};
}