Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115766147
D32109.id96378.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
960 B
Referenced Files
None
Subscribers
None
D32109.id96378.diff
View Options
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c
--- a/sys/opencrypto/cryptodev.c
+++ b/sys/opencrypto/cryptodev.c
@@ -781,7 +781,7 @@
}
if (cse->txform) {
- if (cop->len == 0 || (cop->len % cse->txform->blocksize) != 0) {
+ if ((cop->len % cse->txform->blocksize) != 0) {
SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__);
return (EINVAL);
}
@@ -836,6 +836,12 @@
}
break;
case CSP_MODE_CIPHER:
+ if (cop->len == 0 ||
+ (cop->iv == NULL && cop->len == cse->ivsize)) {
+ SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__);
+ error = EINVAL;
+ goto bail;
+ }
switch (cop->op) {
case COP_ENCRYPT:
crp->crp_op = CRYPTO_OP_ENCRYPT;
@@ -919,8 +925,9 @@
goto bail;
}
crp->crp_iv_start = 0;
- crp->crp_payload_start += cse->ivsize;
crp->crp_payload_length -= cse->ivsize;
+ if (crp->crp_payload_length != 0)
+ crp->crp_payload_start = cse->ivsize;
dst += cse->ivsize;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 29, 8:51 AM (13 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17836220
Default Alt Text
D32109.id96378.diff (960 B)
Attached To
Mode
D32109: cryptodev: Allow some CIOCCRYPT operations with an empty payload.
Attached
Detach File
Event Timeline
Log In to Comment