summaryrefslogtreecommitdiff
path: root/net/sctp/sm_make_chunk.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r--net/sctp/sm_make_chunk.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 87dc7ad07583..28d1067c3f2b 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1358,7 +1358,7 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
sctp_signed_cookie_t *cookie;
struct scatterlist sg;
int headersize, bodysize;
- unsigned int keylen = SCTP_SECRET_SIZE;
+ unsigned int keylen;
char *key;
headersize = sizeof(sctp_paramhdr_t) + SCTP_SECRET_SIZE;
@@ -1412,10 +1412,11 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
sg.page = virt_to_page(&cookie->c);
sg.offset = (unsigned long)(&cookie->c) % PAGE_SIZE;
sg.length = bodysize;
+ keylen = SCTP_SECRET_SIZE;
key = (char *)ep->secret_key[ep->current_key];
- crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen, &sg, 1,
- cookie->signature);
+ sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen,
+ &sg, 1, cookie->signature);
}
nodata:
@@ -1471,14 +1472,15 @@ struct sctp_association *sctp_unpack_cookie(
key = (char *)ep->secret_key[ep->current_key];
memset(digest, 0x00, sizeof(digest));
- crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen, &sg, 1, digest);
+ sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen, &sg,
+ 1, digest);
if (memcmp(digest, cookie->signature, SCTP_SIGNATURE_SIZE)) {
/* Try the previous key. */
key = (char *)ep->secret_key[ep->last_key];
memset(digest, 0x00, sizeof(digest));
- crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen, &sg, 1,
- digest);
+ sctp_crypto_hmac(sctp_sk(ep->base.sk)->hmac, key, &keylen,
+ &sg, 1, digest);
if (memcmp(digest, cookie->signature, SCTP_SIGNATURE_SIZE)) {
/* Yikes! Still bad signature! */