- * deactivates a shared key from the endpoint * ASSUMES INP_WLOCK is already held */
| 1330 | * ASSUMES INP_WLOCK is already held |
| 1331 | */ |
| 1332 | int |
| 1333 | sctp_deact_sharedkey_ep(struct sctp_inpcb *inp, uint16_t keyid) |
| 1334 | { |
| 1335 | sctp_sharedkey_t *skey; |
| 1336 | |
| 1337 | if (inp == NULL) |
| 1338 | return (-1); |
| 1339 | |
| 1340 | /* is the keyid the active sending key on the endpoint */ |
| 1341 | if (keyid == inp->sctp_ep.default_keyid) |
| 1342 | return (-1); |
| 1343 | |
| 1344 | /* does the key exist? */ |
| 1345 | skey = sctp_find_sharedkey(&inp->sctp_ep.shared_keys, keyid); |
| 1346 | if (skey == NULL) |
| 1347 | return (-1); |
| 1348 | |
| 1349 | /* endpoint keys are not refcounted */ |
| 1350 | |
| 1351 | /* remove it */ |
| 1352 | LIST_REMOVE(skey, next); |
| 1353 | sctp_free_sharedkey(skey); /* frees skey->key as well */ |
| 1354 | |
| 1355 | return (0); |
| 1356 | } |
| 1357 | |
| 1358 | /* |
| 1359 | * get local authentication parameters from cookie (from INIT-ACK) |
no test coverage detected