Lines Matching refs:authkey
3687 struct sctp_authkey *authkey; in sctp_setsockopt_auth_key() local
3696 optlen = min_t(unsigned int, optlen, USHRT_MAX + sizeof(*authkey)); in sctp_setsockopt_auth_key()
3698 authkey = memdup_user(optval, optlen); in sctp_setsockopt_auth_key()
3699 if (IS_ERR(authkey)) in sctp_setsockopt_auth_key()
3700 return PTR_ERR(authkey); in sctp_setsockopt_auth_key()
3702 if (authkey->sca_keylength > optlen - sizeof(*authkey)) in sctp_setsockopt_auth_key()
3705 asoc = sctp_id2assoc(sk, authkey->sca_assoc_id); in sctp_setsockopt_auth_key()
3706 if (!asoc && authkey->sca_assoc_id > SCTP_ALL_ASSOC && in sctp_setsockopt_auth_key()
3711 ret = sctp_auth_set_key(ep, asoc, authkey); in sctp_setsockopt_auth_key()
3716 authkey->sca_assoc_id = SCTP_FUTURE_ASSOC; in sctp_setsockopt_auth_key()
3718 if (authkey->sca_assoc_id == SCTP_FUTURE_ASSOC || in sctp_setsockopt_auth_key()
3719 authkey->sca_assoc_id == SCTP_ALL_ASSOC) { in sctp_setsockopt_auth_key()
3720 ret = sctp_auth_set_key(ep, asoc, authkey); in sctp_setsockopt_auth_key()
3727 if (authkey->sca_assoc_id == SCTP_CURRENT_ASSOC || in sctp_setsockopt_auth_key()
3728 authkey->sca_assoc_id == SCTP_ALL_ASSOC) { in sctp_setsockopt_auth_key()
3730 int res = sctp_auth_set_key(ep, asoc, authkey); in sctp_setsockopt_auth_key()
3738 kzfree(authkey); in sctp_setsockopt_auth_key()