Changeset View
Changeset View
Standalone View
Standalone View
sys/netipsec/xform_ah.c
Context not available. | |||||
memset(&csp, 0, sizeof(csp)); | memset(&csp, 0, sizeof(csp)); | ||||
csp.csp_mode = CSP_MODE_DIGEST; | csp.csp_mode = CSP_MODE_DIGEST; | ||||
if (sav->flags & SADB_X_SAFLAGS_ESN) | |||||
csp.csp_flags |= CSP_F_ESN; | |||||
error = ah_init0(sav, xsp, &csp); | error = ah_init0(sav, xsp, &csp); | ||||
return error ? error : | return error ? error : | ||||
crypto_newsession(&sav->tdb_cryptoid, &csp, V_crypto_support); | crypto_newsession(&sav->tdb_cryptoid, &csp, V_crypto_support); | ||||
Context not available. | |||||
crp->crp_callback = ah_input_cb; | crp->crp_callback = ah_input_cb; | ||||
crp->crp_opaque = xd; | crp->crp_opaque = xd; | ||||
if (sav->flags & SADB_X_SAFLAGS_ESN && | |||||
sav->replay != NULL && sav->replay->wsize != 0) { | |||||
seqh = htonl(seqh); | |||||
memcpy(crp->crp_esn, &seqh, 4); | |||||
gnn: Please change the magic number (4) to either a #define or sizeof(seqh) | |||||
} | |||||
/* These are passed as-is to the callback. */ | /* These are passed as-is to the callback. */ | ||||
xd->sav = sav; | xd->sav = sav; | ||||
xd->nxt = hl; | xd->nxt = hl; | ||||
Context not available. | |||||
uint16_t iplen; | uint16_t iplen; | ||||
int error, rplen, authsize, ahsize, maxpacketsize, roff; | int error, rplen, authsize, ahsize, maxpacketsize, roff; | ||||
uint8_t prot; | uint8_t prot; | ||||
uint32_t seqh; | |||||
IPSEC_ASSERT(sav != NULL, ("null SA")); | IPSEC_ASSERT(sav != NULL, ("null SA")); | ||||
ahx = sav->tdb_authalgxform; | ahx = sav->tdb_authalgxform; | ||||
Context not available. | |||||
crp->crp_callback = ah_output_cb; | crp->crp_callback = ah_output_cb; | ||||
crp->crp_opaque = xd; | crp->crp_opaque = xd; | ||||
if (sav->flags & SADB_X_SAFLAGS_ESN && sav->replay != NULL) { | |||||
seqh = htonl((uint32_t)(sav->replay->count >> 32)); | |||||
memcpy(crp->crp_esn, &seqh, 4); | |||||
Done Inline ActionsSame as previous memcpy gnn: Same as previous memcpy | |||||
} | |||||
/* These are passed as-is to the callback. */ | /* These are passed as-is to the callback. */ | ||||
xd->sp = sp; | xd->sp = sp; | ||||
xd->sav = sav; | xd->sav = sav; | ||||
Context not available. |
Please change the magic number (4) to either a #define or sizeof(seqh)