Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108553308
D32109.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.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
Mon, Jan 27, 6:59 AM (1 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16188700
Default Alt Text
D32109.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