aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-11-25 01:31:00 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2020-11-25 01:31:00 +0000
commita4a23d2137d05fdae3af5987dd590da0cb1c21f6 (patch)
treee2687ca69537ab36c6a1072eb4567efdb748058b /tools
parent81870b54d6b2493e9638e4ff84c9afbc8c2b4976 (diff)
downloadsrc-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 'tools')
-rw-r--r--tools/tools/crypto/cryptokeytest.c5
-rw-r--r--tools/tools/crypto/cryptotest.c16
2 files changed, 3 insertions, 18 deletions
diff --git a/tools/tools/crypto/cryptokeytest.c b/tools/tools/crypto/cryptokeytest.c
index 9db9eb5fd026..5f0ad74b8eba 100644
--- a/tools/tools/crypto/cryptokeytest.c
+++ b/tools/tools/crypto/cryptokeytest.c
@@ -113,10 +113,7 @@ UB_mod_exp(BIGNUM *res, const BIGNUM *a, const BIGNUM *b, const BIGNUM *c)
{
struct crypt_kop kop;
void *ale, *ble, *cle;
- static int crypto_fd = -1;
-
- if (crypto_fd == -1 && ioctl(devcrypto(), CRIOGET, &crypto_fd) == -1)
- err(1, "CRIOGET");
+ int crypto_fd = devcrypto();
if ((ale = bignum_to_le(a)) == NULL)
err(1, "bignum_to_le, a");
diff --git a/tools/tools/crypto/cryptotest.c b/tools/tools/crypto/cryptotest.c
index 7c7480308025..83473e883b17 100644
--- a/tools/tools/crypto/cryptotest.c
+++ b/tools/tools/crypto/cryptotest.c
@@ -229,23 +229,11 @@ crfind(int crid)
bzero(&find, sizeof(find));
find.crid = crid;
- if (ioctl(devcrypto(), CRIOFINDDEV, &find) == -1)
+ if (ioctl(devcrypto(), CIOCFINDDEV, &find) == -1)
err(1, "ioctl(CIOCFINDDEV): crid %d", crid);
return find.name;
}
-int
-crget(void)
-{
- int fd;
-
- if (ioctl(devcrypto(), CRIOGET, &fd) == -1)
- err(1, "ioctl(CRIOGET)");
- if (fcntl(fd, F_SETFD, 1) == -1)
- err(1, "fcntl(F_SETFD) (crget)");
- return fd;
-}
-
char
rdigit(void)
{
@@ -259,7 +247,7 @@ rdigit(void)
void
runtest(struct alg *ealg, struct alg *alg, int count, int size, u_long cmd, struct timeval *tv)
{
- int i, fd = crget();
+ int i, fd = devcrypto();
struct timeval start, stop, dt;
char *cleartext, *ciphertext, *originaltext, *key;
struct session2_op sop;