if (new_ct->id != id) { return srtp_err_status_bad_param;
}
/* check cipher type by running self-test */
status = srtp_cipher_type_self_test(new_ct); if (status) { return status;
}
/* walk down list, checking if this type is in the list already */
ctype = crypto_kernel.cipher_type_list; while (ctype != NULL) { if (id == ctype->id) { if (!replace) { return srtp_err_status_bad_param;
}
status =
srtp_cipher_type_test(new_ct, ctype->cipher_type->test_data); if (status) { return status;
}
new_ctype = ctype; break;
} elseif (new_ct == ctype->cipher_type) { return srtp_err_status_bad_param;
}
ctype = ctype->next;
}
/* if not found, put new_ct at the head of the list */ if (ctype == NULL) { /* allocate memory */
new_ctype = (srtp_kernel_cipher_type_t *)srtp_crypto_alloc( sizeof(srtp_kernel_cipher_type_t)); if (new_ctype == NULL) { return srtp_err_status_alloc_fail;
}
new_ctype->next = crypto_kernel.cipher_type_list;
/* set head of list to new cipher type */
crypto_kernel.cipher_type_list = new_ctype;
}
/* set fields */
new_ctype->cipher_type = new_ct;
new_ctype->id = id;
if (new_at->id != id) { return srtp_err_status_bad_param;
}
/* check auth type by running self-test */
status = srtp_auth_type_self_test(new_at); if (status) { return status;
}
/* walk down list, checking if this type is in the list already */
atype = crypto_kernel.auth_type_list; while (atype != NULL) { if (id == atype->id) { if (!replace) { return srtp_err_status_bad_param;
}
status = srtp_auth_type_test(new_at, atype->auth_type->test_data); if (status) { return status;
}
new_atype = atype; break;
} elseif (new_at == atype->auth_type) { return srtp_err_status_bad_param;
}
atype = atype->next;
}
/* if not found, put new_at at the head of the list */ if (atype == NULL) { /* allocate memory */
new_atype = (srtp_kernel_auth_type_t *)srtp_crypto_alloc( sizeof(srtp_kernel_auth_type_t)); if (new_atype == NULL) { return srtp_err_status_alloc_fail;
}
new_atype->next = crypto_kernel.auth_type_list; /* set head of list to new auth type */
crypto_kernel.auth_type_list = new_atype;
}
/* set fields */
new_atype->auth_type = new_at;
new_atype->id = id;
/* walk down list, looking for id */
ctype = crypto_kernel.cipher_type_list; while (ctype != NULL) { if (id == ctype->id) { return ctype->cipher_type;
}
ctype = ctype->next;
}
/* haven't found the right one, indicate failure by returning NULL */ return NULL;
}
srtp_err_status_t srtp_crypto_kernel_alloc_cipher(srtp_cipher_type_id_t id,
srtp_cipher_pointer_t *cp, int key_len, int tag_len)
{ const srtp_cipher_type_t *ct;
/* walk down list, looking for id */
atype = crypto_kernel.auth_type_list; while (atype != NULL) { if (id == atype->id) { return atype->auth_type;
}
atype = atype->next;
}
/* haven't found the right one, indicate failure by returning NULL */ return NULL;
}
srtp_err_status_t srtp_crypto_kernel_alloc_auth(srtp_auth_type_id_t id,
srtp_auth_pointer_t *ap, int key_len, int tag_len)
{ const srtp_auth_type_t *at;
/* walk down list, checking if this type is in the list already */
kdm = crypto_kernel.debug_module_list; while (kdm != NULL) { if (strncmp(new_dm->name, kdm->mod->name, 64) == 0) { return srtp_err_status_bad_param;
}
kdm = kdm->next;
}
/* put new_dm at the head of the list */ /* allocate memory */ new = (srtp_kernel_debug_module_t *)srtp_crypto_alloc( sizeof(srtp_kernel_debug_module_t)); if (new == NULL) { return srtp_err_status_alloc_fail;
}
/* set fields */ new->mod = new_dm; new->next = crypto_kernel.debug_module_list;
/* set head of list to new cipher type */
crypto_kernel.debug_module_list = new;
return srtp_err_status_ok;
}
srtp_err_status_t srtp_crypto_kernel_set_debug_module(constchar *name, int on)
{
srtp_kernel_debug_module_t *kdm;
/* walk down list, checking if this type is in the list already */
kdm = crypto_kernel.debug_module_list; while (kdm != NULL) { if (strncmp(name, kdm->mod->name, 64) == 0) {
kdm->mod->on = on; return srtp_err_status_ok;
}
kdm = kdm->next;
}
return srtp_err_status_fail;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.