- pep8 $(find . -type f | grep -E "\.py$")
- sudo apt-get -y install automake autoconf libtool libssl-dev sed make gawk sed bash
dh-exec
+- sudo pip install twisted
- git clone https://github.com/stefanberger/libtpms
- cd libtpms
- git checkout origin/tpm2-preview.rev146 -b tpm2-preview.rev146
socat,
findutils,
tpm-tools (>= 1.3.8),
+ python-twisted
# linux-image-extra
Package: swtpm
BuildRequires: automake autoconf bash coreutils libtool sed
BuildRequires: libtpms-devel fuse-devel glib2-devel gmp-devel
-BuildRequires: expect bash net-tools nss-devel socat
+BuildRequires: expect bash net-tools nss-devel socat python-twisted
%if %{with_gnutls}
BuildRequires: gnutls >= 3.1.0 gnutls-devel gnutls-utils
BuildRequires: libtasn1-devel libtasn1
BuildRequires: automake autoconf bash coreutils libtool sed
BuildRequires: libtpms-devel fuse-devel glib2-devel gmp-devel
-BuildRequires: expect bash net-tools nss-devel socat
+BuildRequires: expect bash net-tools nss-devel socat python-twisted
%if %{with_gnutls}
BuildRequires: gnutls >= 3.1.0 gnutls-devel gnutls-utils
BuildRequires: libtasn1-devel libtasn1
import subprocess
import time
import struct
+
from array import array
if sys.version_info[0] < 3:
- import _multiprocessing
+ import twisted.python.sendmsg as sendmsg
def toString(arr):
ctrlfd.connect(sock_path)
print("Sending data fd over ctrl fd...")
if sys.version_info[0] < 3:
- ctrlfd.send(cmd_set_data_fd)
- _multiprocessing.sendfd(ctrlfd.fileno(), _fd.fileno())
+ sendmsg.sendmsg(ctrlfd, str(cmd_set_data_fd),
+ [(socket.SOL_SOCKET,
+ sendmsg.SCM_RIGHTS,
+ struct.pack("i", _fd.fileno()))])
else:
ctrlfd.sendmsg([cmd_set_data_fd],
[(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)])