Page MenuHomeFreeBSD

D12451.id33298.diff
No OneTemporary

D12451.id33298.diff

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

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)

Event Timeline