Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107520740
D32100.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
D32100.diff
View Options
diff --git a/sys/crypto/openssl/ossl.c b/sys/crypto/openssl/ossl.c
--- a/sys/crypto/openssl/ossl.c
+++ b/sys/crypto/openssl/ossl.c
@@ -172,6 +172,13 @@
if (ossl_lookup_cipher(csp) == NULL)
return (EINVAL);
break;
+ case CSP_MODE_ETA:
+ if (!sc->has_aes ||
+ csp->csp_cipher_alg == CRYPTO_CHACHA20 ||
+ ossl_lookup_hash(csp) == NULL ||
+ ossl_lookup_cipher(csp) == NULL)
+ return (EINVAL);
+ break;
case CSP_MODE_AEAD:
switch (csp->csp_cipher_alg) {
case CRYPTO_CHACHA20_POLY1305:
@@ -268,6 +275,10 @@
case CSP_MODE_CIPHER:
error = ossl_newsession_cipher(s, csp);
break;
+ case CSP_MODE_ETA:
+ ossl_newsession_hash(s, csp);
+ error = ossl_newsession_cipher(s, csp);
+ break;
}
return (error);
@@ -341,6 +352,25 @@
return (error);
}
+static int
+ossl_process_eta(struct ossl_session *s, struct cryptop *crp,
+ const struct crypto_session_params *csp)
+{
+ int error;
+
+ if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) {
+ error = s->cipher.cipher->process(&s->cipher, crp, csp);
+ if (error == 0)
+ error = ossl_process_hash(s, crp, csp);
+ } else {
+ error = ossl_process_hash(s, crp, csp);
+ if (error == 0)
+ error = s->cipher.cipher->process(&s->cipher, crp, csp);
+ }
+
+ return (error);
+}
+
static int
ossl_process(device_t dev, struct cryptop *crp, int hint)
{
@@ -366,6 +396,9 @@
case CSP_MODE_CIPHER:
error = s->cipher.cipher->process(&s->cipher, crp, csp);
break;
+ case CSP_MODE_ETA:
+ error = ossl_process_eta(s, crp, csp);
+ break;
case CSP_MODE_AEAD:
if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op))
error = ossl_chacha20_poly1305_encrypt(crp, csp);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 16, 9:17 AM (20 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15823220
Default Alt Text
D32100.diff (1 KB)
Attached To
Mode
D32100: ossl: Add support for ETA mode
Attached
Detach File
Event Timeline
Log In to Comment