Page MenuHomeFreeBSD

D32565.id.diff
No OneTemporary

D32565.id.diff

diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c
--- a/sys/opencrypto/ktls_ocf.c
+++ b/sys/opencrypto/ktls_ocf.c
@@ -48,7 +48,7 @@
#include <opencrypto/cryptodev.h>
#include <opencrypto/ktls.h>
-struct ocf_session {
+struct ktls_ocf_session {
crypto_session_t sid;
crypto_session_t mac_sid;
struct mtx lock;
@@ -64,7 +64,7 @@
};
struct ocf_operation {
- struct ocf_session *os;
+ struct ktls_ocf_session *os;
bool done;
};
@@ -142,7 +142,7 @@
}
static int
-ktls_ocf_dispatch(struct ocf_session *os, struct cryptop *crp)
+ktls_ocf_dispatch(struct ktls_ocf_session *os, struct cryptop *crp)
{
struct ocf_operation oo;
int error;
@@ -228,7 +228,7 @@
struct uio *uio;
struct tls_mac_data *ad;
struct cryptop *crp;
- struct ocf_session *os;
+ struct ktls_ocf_session *os;
struct iovec iov[m->m_epg_npgs + 2];
u_int pgoff;
int i, error;
@@ -237,7 +237,7 @@
MPASS(outiovcnt + 1 <= nitems(iov));
- os = tls->cipher;
+ os = tls->ocf_session;
hdr = (const struct tls_record_layer *)m->m_epg_hdr;
crp = &state->crp;
uio = &state->uio;
@@ -376,11 +376,11 @@
struct uio *uio;
struct tls_aead_data *ad;
struct cryptop *crp;
- struct ocf_session *os;
+ struct ktls_ocf_session *os;
int error;
uint16_t tls_comp_len;
- os = tls->cipher;
+ os = tls->ocf_session;
hdr = (const struct tls_record_layer *)m->m_epg_hdr;
crp = &state->crp;
uio = &state->uio;
@@ -457,12 +457,12 @@
{
struct tls_aead_data ad;
struct cryptop crp;
- struct ocf_session *os;
+ struct ktls_ocf_session *os;
struct ocf_operation oo;
int error;
uint16_t tls_comp_len;
- os = tls->cipher;
+ os = tls->ocf_session;
oo.os = os;
oo.done = false;
@@ -526,11 +526,11 @@
struct uio *uio;
struct tls_aead_data_13 *ad;
struct cryptop *crp;
- struct ocf_session *os;
+ struct ktls_ocf_session *os;
char nonce[12];
int error;
- os = tls->cipher;
+ os = tls->ocf_session;
hdr = (const struct tls_record_layer *)m->m_epg_hdr;
crp = &state->crp;
uio = &state->uio;
@@ -598,9 +598,9 @@
void
ktls_ocf_free(struct ktls_session *tls)
{
- struct ocf_session *os;
+ struct ktls_ocf_session *os;
- os = tls->cipher;
+ os = tls->ocf_session;
crypto_freesession(os->sid);
mtx_destroy(&os->lock);
zfree(os, M_KTLS_OCF);
@@ -610,7 +610,7 @@
ktls_ocf_try(struct socket *so, struct ktls_session *tls, int direction)
{
struct crypto_session_params csp, mac_csp;
- struct ocf_session *os;
+ struct ktls_ocf_session *os;
int error, mac_len;
memset(&csp, 0, sizeof(csp));
@@ -745,7 +745,7 @@
}
mtx_init(&os->lock, "ktls_ocf", NULL, MTX_DEF);
- tls->cipher = os;
+ tls->ocf_session = os;
if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16 ||
tls->params.cipher_algorithm == CRYPTO_CHACHA20_POLY1305) {
if (direction == KTLS_TX) {
diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h
--- a/sys/sys/ktls.h
+++ b/sys/sys/ktls.h
@@ -167,6 +167,7 @@
#define KTLS_RX 2
struct iovec;
+struct ktls_ocf_session;
struct ktls_ocf_encrypt_state;
struct ktls_session;
struct m_snd_tag;
@@ -184,7 +185,7 @@
uint64_t seqno, int *trailer_len);
};
union {
- void *cipher;
+ struct ktls_ocf_session *ocf_session;
struct m_snd_tag *snd_tag;
};
struct tls_session_params params;

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 19, 7:10 AM (2 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27735326
Default Alt Text
D32565.id.diff (3 KB)

Event Timeline