MCPcopy Create free account
hub / github.com/F-Stack/f-stack / copyin_tls_enable

Function copyin_tls_enable

freebsd/netinet/tcp_usrreq.c:2009–2036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2007
2008#ifdef KERN_TLS
2009static int
2010copyin_tls_enable(struct sockopt *sopt, struct tls_enable *tls)
2011{
2012 struct tls_enable_v0 tls_v0;
2013 int error;
2014
2015 if (sopt->sopt_valsize == sizeof(tls_v0)) {
2016 error = sooptcopyin(sopt, &tls_v0, sizeof(tls_v0),
2017 sizeof(tls_v0));
2018 if (error)
2019 return (error);
2020 memset(tls, 0, sizeof(*tls));
2021 tls->cipher_key = tls_v0.cipher_key;
2022 tls->iv = tls_v0.iv;
2023 tls->auth_key = tls_v0.auth_key;
2024 tls->cipher_algorithm = tls_v0.cipher_algorithm;
2025 tls->cipher_key_len = tls_v0.cipher_key_len;
2026 tls->iv_len = tls_v0.iv_len;
2027 tls->auth_algorithm = tls_v0.auth_algorithm;
2028 tls->auth_key_len = tls_v0.auth_key_len;
2029 tls->flags = tls_v0.flags;
2030 tls->tls_vmajor = tls_v0.tls_vmajor;
2031 tls->tls_vminor = tls_v0.tls_vminor;
2032 return (0);
2033 }
2034
2035 return (sooptcopyin(sopt, tls, sizeof(*tls), sizeof(*tls)));
2036}
2037#endif
2038
2039int

Callers 1

tcp_default_ctloutputFunction · 0.85

Calls 2

sooptcopyinFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected