summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprovos <provos@openbsd.org>2000-12-13 08:34:05 +0000
committerprovos <provos@openbsd.org>2000-12-13 08:34:05 +0000
commit4e76590c601de6680a98c9664f411e35b2a74bd9 (patch)
tree7d849ffdecf8ae2aee8609db6839f9b415888cf2
parentKNF (diff)
downloadwireguard-openbsd-4e76590c601de6680a98c9664f411e35b2a74bd9.tar.xz
wireguard-openbsd-4e76590c601de6680a98c9664f411e35b2a74bd9.zip
make the 31-bit code work on 32-bit machines.
-rw-r--r--sys/crypto/crypto.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/crypto/crypto.c b/sys/crypto/crypto.c
index 57fa0b3be58..03b642fe32e 100644
--- a/sys/crypto/crypto.c
+++ b/sys/crypto/crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypto.c,v 1.14 2000/09/07 18:44:29 deraadt Exp $ */
+/* $OpenBSD: crypto.c,v 1.15 2000/12/13 08:34:05 provos Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -106,7 +106,7 @@ crypto_newsession(u_int64_t *sid, struct cryptoini *cri)
if (err == 0)
{
(*sid) = hid;
- (*sid) <<= 31;
+ (*sid) <<= 32;
(*sid) |= (lid & 0xffffffff);
crypto_drivers[hid].cc_sessions++;
}
@@ -128,7 +128,7 @@ crypto_freesession(u_int64_t sid)
return EINVAL;
/* Determine two IDs */
- hid = (sid >> 31) & 0xffffffff;
+ hid = (sid >> 32) & 0xffffffff;
if (hid >= crypto_drivers_num)
return ENOENT;
@@ -317,7 +317,7 @@ crypto_invoke(struct cryptop *crp)
return 0;
}
- hid = (crp->crp_sid >> 31) & 0xffffffff;
+ hid = (crp->crp_sid >> 32) & 0xffffffff;
if (hid >= crypto_drivers_num)
{