Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106012878
D12451.id33298.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12451.id33298.diff
View Options
Index: sys/opencrypto/crypto.c
===================================================================
--- sys/opencrypto/crypto.c
+++ sys/opencrypto/crypto.c
@@ -432,8 +432,11 @@
* Use specified driver; verify it is capable.
*/
cap = crypto_checkdriver(crid);
- if (cap != NULL && !driver_suitable(cap, cri))
- cap = NULL;
+ if (cap != NULL && !driver_suitable(cap, cri)) {
+ CRYPTDEB("driver missing capability");
+ err = EOPNOTSUPP;
+ goto out;
+ }
} else {
/*
* No requested driver; select based on crid flags.
@@ -462,6 +465,7 @@
CRYPTDEB("no driver");
err = EINVAL;
}
+out:
CRYPTO_DRIVER_UNLOCK();
return err;
}
Index: tests/sys/opencrypto/cryptotest.py
===================================================================
--- tests/sys/opencrypto/cryptotest.py
+++ tests/sys/opencrypto/cryptotest.py
@@ -29,6 +29,7 @@
# $FreeBSD$
#
+import errno
import cryptodev
import itertools
import os
@@ -283,8 +284,14 @@
if len(key) > blocksize:
continue
- c = Crypto(mac=alg, mackey=key,
- crid=crid)
+ try:
+ c = Crypto(mac=alg, mackey=key,
+ crid=crid)
+ # Can't test hashes the driver does not support.
+ except EnvironmentError, e:
+ if e.errno != errno.EOPNOTSUPP:
+ raise
+ continue
_, r = c.encrypt(msg, iv="")
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 9:41 PM (16 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15591168
Default Alt Text
D12451.id33298.diff (1 KB)
Attached To
Mode
D12451: crypto(9): Use a more specific error code when a capable driver is not found
Attached
Detach File
Event Timeline
Log In to Comment