diff options
author | John Baldwin <jhb@FreeBSD.org> | 2020-11-25 01:31:00 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2020-11-25 01:31:00 +0000 |
commit | a4a23d2137d05fdae3af5987dd590da0cb1c21f6 (patch) | |
tree | e2687ca69537ab36c6a1072eb4567efdb748058b /tests/sys/opencrypto | |
parent | 81870b54d6b2493e9638e4ff84c9afbc8c2b4976 (diff) | |
download | src-a4a23d2137d05fdae3af5987dd590da0cb1c21f6.tar.gz src-a4a23d2137d05fdae3af5987dd590da0cb1c21f6.zip |
Remove uses of CRIOGET in OCF tests after r368005.
Pointy hat to: jhb
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27367
Notes
Notes:
svn path=/head/; revision=368008
Diffstat (limited to 'tests/sys/opencrypto')
-rw-r--r-- | tests/sys/opencrypto/blake2_test.c | 13 | ||||
-rw-r--r-- | tests/sys/opencrypto/cryptodev.py | 13 | ||||
-rw-r--r-- | tests/sys/opencrypto/poly1305_test.c | 13 |
3 files changed, 7 insertions, 32 deletions
diff --git a/tests/sys/opencrypto/blake2_test.c b/tests/sys/opencrypto/blake2_test.c index 384b972f2356..87a518fb78bc 100644 --- a/tests/sys/opencrypto/blake2_test.c +++ b/tests/sys/opencrypto/blake2_test.c @@ -88,17 +88,10 @@ lookup_crid(int fd, const char *devname) static int get_handle_fd(void) { - int dc_fd, fd; + int fd; - dc_fd = open("/dev/crypto", O_RDWR); - - /* - * Why do we do this dance instead of just operating on /dev/crypto - * directly? I have no idea. - */ - ATF_REQUIRE(dc_fd >= 0); - ATF_REQUIRE(ioctl(dc_fd, CRIOGET, &fd) != -1); - close(dc_fd); + fd = open("/dev/crypto", O_RDWR); + ATF_REQUIRE(fd >= 0); return (fd); } diff --git a/tests/sys/opencrypto/cryptodev.py b/tests/sys/opencrypto/cryptodev.py index 0fcca6c00244..83d14fc2b205 100644 --- a/tests/sys/opencrypto/cryptodev.py +++ b/tests/sys/opencrypto/cryptodev.py @@ -115,7 +115,6 @@ class CryptAEAD(dpkt.Packet): ) # h2py.py can't handle multiarg macros -CRIOGET = 3221513060 CIOCGSESSION = 3224396645 CIOCFSESSION = 2147771238 CIOCKEY = 3230688104 @@ -131,17 +130,7 @@ else: CIOCCRYPT = 3223085927 CIOCCRYPTAEAD = 3223872365 -def _getdev(): - buf = array.array('I', [0]) - fd = os.open('/dev/crypto', os.O_RDWR) - try: - ioctl(fd, CRIOGET, buf, 1) - finally: - os.close(fd) - - return buf[0] - -_cryptodev = _getdev() +_cryptodev = os.open('/dev/crypto', os.O_RDWR) def str_to_ascii(val): if sys.version_info[0] >= 3: diff --git a/tests/sys/opencrypto/poly1305_test.c b/tests/sys/opencrypto/poly1305_test.c index 64a1f0934263..3687d0c65ec0 100644 --- a/tests/sys/opencrypto/poly1305_test.c +++ b/tests/sys/opencrypto/poly1305_test.c @@ -302,17 +302,10 @@ parse_vector(const struct poly1305_kat *kat, static int get_handle_fd(void) { - int dc_fd, fd; + int fd; - dc_fd = open("/dev/crypto", O_RDWR); - - /* - * Why do we do this dance instead of just operating on /dev/crypto - * directly? I have no idea. - */ - ATF_REQUIRE(dc_fd >= 0); - ATF_REQUIRE(ioctl(dc_fd, CRIOGET, &fd) != -1); - close(dc_fd); + fd = open("/dev/crypto", O_RDWR); + ATF_REQUIRE(fd >= 0); return (fd); } |