- * set the active key on an endpoint * ASSUMES INP_WLOCK is already held */
| 1277 | * ASSUMES INP_WLOCK is already held |
| 1278 | */ |
| 1279 | int |
| 1280 | sctp_auth_setactivekey_ep(struct sctp_inpcb *inp, uint16_t keyid) |
| 1281 | { |
| 1282 | sctp_sharedkey_t *skey; |
| 1283 | |
| 1284 | /* find the key */ |
| 1285 | skey = sctp_find_sharedkey(&inp->sctp_ep.shared_keys, keyid); |
| 1286 | if (skey == NULL) { |
| 1287 | /* that key doesn't exist */ |
| 1288 | return (-1); |
| 1289 | } |
| 1290 | inp->sctp_ep.default_keyid = keyid; |
| 1291 | return (0); |
| 1292 | } |
| 1293 | |
| 1294 | /*- |
| 1295 | * deactivates a shared key from the association |
no test coverage detected