Merge pull request #183778 from pennae/pass-secret-service

pass-secret-service: unstable-2022-03-21 -> unstable-2022-07-18
This commit is contained in:
Winter 2022-07-29 16:59:41 -04:00 committed by GitHub
commit 80011d7dce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 31 deletions

View File

@ -12,21 +12,15 @@ python3.pkgs.buildPythonApplication rec {
# PyPI has old alpha version. Since then the project has switched from using a
# seemingly abandoned D-Bus package pydbus and started using maintained
# dbus-next. So let's use latest from GitHub.
version = "unstable-2022-03-21";
version = "unstable-2022-07-18";
src = fetchFromGitHub {
owner = "mdellweg";
repo = "pass_secret_service";
rev = "149f8557e07098eee2f46561eea61e83255ac59b";
sha256 = "sha256-+/pFi6+K8rl0Ihm6cp/emUQVtau6+Apl8/VEr9AI0Xs=";
rev = "fadc09be718ae1e507eeb8719f3a2ea23edb6d7a";
hash = "sha256-lrNU5bkG4/fMu5rDywfiI8vNHyBsMf/fiWIeEHug03c=";
};
patches = [
# Only needed until https://github.com/mdellweg/pass_secret_service/pull/30
# is merged.
./int_from_bytes-deprecation-fix.patch
];
# Need to specify session.conf file for tests because it won't be found under
# /etc/ in check phase.
postPatch = ''

View File

@ -1,22 +0,0 @@
--- a/pass_secret_service/interfaces/session.py
+++ b/pass_secret_service/interfaces/session.py
@@ -4,7 +4,6 @@
import os
import hmac
from hashlib import sha256
-from cryptography.utils import int_from_bytes
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher
from cryptography.hazmat.primitives.ciphers.modes import CBC
@@ -27,9 +26,9 @@ class Session(ServiceInterface, SerialMixin):
@classmethod
@run_in_executor
def _create_dh(cls, input):
- priv_key = int_from_bytes(os.urandom(0x80), "big")
+ priv_key = int.from_bytes(os.urandom(0x80), "big")
pub_key = pow(2, priv_key, dh_prime)
- shared_secret = pow(int_from_bytes(input, "big"), priv_key, dh_prime)
+ shared_secret = pow(int.from_bytes(input, "big"), priv_key, dh_prime)
salt = b"\x00" * 0x20
shared_key = hmac.new(salt, shared_secret.to_bytes(0x80, "big"), sha256).digest()
aes_key = hmac.new(shared_key, b"\x01", sha256).digest()[:0x10]