MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sctp_clear_cachedkeys

Function sctp_clear_cachedkeys

freebsd/netinet/sctp_auth.c:1144–1158  ·  view source on GitHub ↗

- * clear any cached key(s) if they match the given key id on an association. * the cached key(s) will be recomputed and re-cached at next use. * ASSUMES TCB_LOCK is already held */

Source from the content-addressed store, hash-verified

1142 * ASSUMES TCB_LOCK is already held
1143 */
1144void
1145sctp_clear_cachedkeys(struct sctp_tcb *stcb, uint16_t keyid)
1146{
1147 if (stcb == NULL)
1148 return;
1149
1150 if (keyid == stcb->asoc.authinfo.assoc_keyid) {
1151 sctp_free_key(stcb->asoc.authinfo.assoc_key);
1152 stcb->asoc.authinfo.assoc_key = NULL;
1153 }
1154 if (keyid == stcb->asoc.authinfo.recv_keyid) {
1155 sctp_free_key(stcb->asoc.authinfo.recv_key);
1156 stcb->asoc.authinfo.recv_key = NULL;
1157 }
1158}
1159
1160/*-
1161 * clear any cached key(s) if they match the given key id for all assocs on

Callers 5

sctp_setoptFunction · 0.85
sctp_clear_cachedkeys_epFunction · 0.85
sctp_delete_sharedkeyFunction · 0.85

Calls 1

sctp_free_keyFunction · 0.85

Tested by

no test coverage detected