Changeset View
Changeset View
Standalone View
Standalone View
sys/crypto/ccp/ccp.c
Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | ccp_detach(device_t dev) | ||||
mtx_destroy(&sc->lock); | mtx_destroy(&sc->lock); | ||||
return (0); | return (0); | ||||
} | } | ||||
static void | static void | ||||
ccp_init_hmac_digest(struct ccp_session *s, const char *key, int klen) | ccp_init_hmac_digest(struct ccp_session *s, const char *key, int klen) | ||||
{ | { | ||||
union authctx auth_ctx; | union authctx auth_ctx; | ||||
struct auth_hash *axf; | const struct auth_hash *axf; | ||||
u_int i; | u_int i; | ||||
/* | /* | ||||
* If the key is larger than the block size, use the digest of | * If the key is larger than the block size, use the digest of | ||||
* the key as the key instead. | * the key as the key instead. | ||||
*/ | */ | ||||
axf = s->hmac.auth_hash; | axf = s->hmac.auth_hash; | ||||
if (klen > axf->blocksize) { | if (klen > axf->blocksize) { | ||||
▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static int | static int | ||||
ccp_newsession(device_t dev, crypto_session_t cses, | ccp_newsession(device_t dev, crypto_session_t cses, | ||||
const struct crypto_session_params *csp) | const struct crypto_session_params *csp) | ||||
{ | { | ||||
struct ccp_softc *sc; | struct ccp_softc *sc; | ||||
struct ccp_session *s; | struct ccp_session *s; | ||||
struct auth_hash *auth_hash; | const struct auth_hash *auth_hash; | ||||
enum ccp_aes_mode cipher_mode; | enum ccp_aes_mode cipher_mode; | ||||
unsigned auth_mode; | unsigned auth_mode; | ||||
unsigned q; | unsigned q; | ||||
/* XXX reconcile auth_mode with use by ccp_sha */ | /* XXX reconcile auth_mode with use by ccp_sha */ | ||||
switch (csp->csp_auth_alg) { | switch (csp->csp_auth_alg) { | ||||
case CRYPTO_SHA1_HMAC: | case CRYPTO_SHA1_HMAC: | ||||
auth_hash = &auth_hash_hmac_sha1; | auth_hash = &auth_hash_hmac_sha1; | ||||
▲ Show 20 Lines • Show All 378 Lines • Show Last 20 Lines |