diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-23 21:57:01 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-23 21:57:01 +0000 |
commit | 9faeb542fe158c90e1649d544fe723bd26983456 (patch) | |
tree | e6aad8b2de7092a8c65e613709d21ae343e01d6f | |
parent | b4a55308473160cf766428883f536514afcc4bbd (diff) |
Remove unneeded crp_iv field, set the right flags for IV handling in
the crypto device.
-rw-r--r-- | sys/crypto/cryptodev.c | 10 | ||||
-rw-r--r-- | sys/crypto/cryptodev.h | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sys/crypto/cryptodev.c b/sys/crypto/cryptodev.c index 8db25708c39..bd7a16bb185 100644 --- a/sys/crypto/cryptodev.c +++ b/sys/crypto/cryptodev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptodev.c,v 1.15 2001/06/23 18:30:36 deraadt Exp $ */ +/* $OpenBSD: cryptodev.c,v 1.16 2001/06/23 21:56:58 angelos Exp $ */ /* * Copyright (c) 2001 Theo de Raadt @@ -334,9 +334,8 @@ crypto_op(struct csession *cse, struct crypt_op *cop, struct proc *p) crde->crd_flags |= CRD_F_ENCRYPT; else crde->crd_flags &= ~CRD_F_ENCRYPT; - crde->crd_skip = 0; crde->crd_len = cop->len; - crde->crd_inject = 0; /* ??? */ + crde->crd_inject = 0; crde->crd_alg = cse->cipher; crde->crd_key = cse->key; @@ -358,7 +357,10 @@ crypto_op(struct csession *cse, struct crypt_op *cop, struct proc *p) if ((error = copyin(cop->iv, cse->tmp_iv, cse->txform->blocksize))) goto bail; bcopy(cse->tmp_iv, crde->crd_iv, cse->txform->blocksize); - crde->crd_flags |= CRD_F_IV_EXPLICIT; + crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; + } else { + crde->crd_flags |= CRD_F_IV_PRESENT; + crde->crd_skip = cse->txform->blocksize; } if (cop->mac) { diff --git a/sys/crypto/cryptodev.h b/sys/crypto/cryptodev.h index 473637d5fa5..0edd1edea9c 100644 --- a/sys/crypto/cryptodev.h +++ b/sys/crypto/cryptodev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptodev.h,v 1.5 2001/06/23 21:00:49 angelos Exp $ */ +/* $OpenBSD: cryptodev.h,v 1.6 2001/06/23 21:57:00 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) @@ -278,7 +278,6 @@ struct cryptop { int (*crp_callback)(struct cryptop *); /* Callback function */ struct cryptop *crp_next; - caddr_t crp_iv; caddr_t crp_mac; int crp_mac_trunc_len; }; |