Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/crypto/t4_crypto.c
Show First 20 Lines • Show All 589 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static int | static int | ||||
ccr_hash_done(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, | ccr_hash_done(struct ccr_softc *sc, struct ccr_session *s, struct cryptop *crp, | ||||
const struct cpl_fw6_pld *cpl, int error) | const struct cpl_fw6_pld *cpl, int error) | ||||
{ | { | ||||
uint8_t hash[HASH_MAX_LEN]; | uint8_t hash[HASH_MAX_LEN]; | ||||
if (error) | if (error || (crp->crp_op & CRYPTO_OP_SKIP_DIGEST) != 0) | ||||
return (error); | return (error); | ||||
if (crp->crp_op & CRYPTO_OP_VERIFY_DIGEST) { | if (crp->crp_op & CRYPTO_OP_VERIFY_DIGEST) { | ||||
crypto_copydata(crp, crp->crp_digest_start, s->hmac.hash_len, | crypto_copydata(crp, crp->crp_digest_start, s->hmac.hash_len, | ||||
hash); | hash); | ||||
if (timingsafe_bcmp((cpl + 1), hash, s->hmac.hash_len) != 0) | if (timingsafe_bcmp((cpl + 1), hash, s->hmac.hash_len) != 0) | ||||
return (EBADMSG); | return (EBADMSG); | ||||
} else | } else | ||||
▲ Show 20 Lines • Show All 2,446 Lines • Show Last 20 Lines |