MCPcopy Create free account
hub / github.com/cisco/libsrtp / srtp_crypto_kernel_load_debug_module

Function srtp_crypto_kernel_load_debug_module

crypto/kernel/crypto_kernel.c:507–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505}
506
507srtp_err_status_t srtp_crypto_kernel_load_debug_module(
508 srtp_debug_module_t *new_dm)
509{
510 srtp_kernel_debug_module_t *kdm, *new;
511
512 /* defensive coding */
513 if (new_dm == NULL || new_dm->name == NULL) {
514 return srtp_err_status_bad_param;
515 }
516
517 /* walk down list, checking if this type is in the list already */
518 kdm = crypto_kernel.debug_module_list;
519 while (kdm != NULL) {
520 if (strncmp(new_dm->name, kdm->mod->name, 64) == 0) {
521 return srtp_err_status_bad_param;
522 }
523 kdm = kdm->next;
524 }
525
526 /* put new_dm at the head of the list */
527 /* allocate memory */
528 new = (srtp_kernel_debug_module_t *)srtp_crypto_alloc(
529 sizeof(srtp_kernel_debug_module_t));
530 if (new == NULL) {
531 return srtp_err_status_alloc_fail;
532 }
533
534 /* set fields */
535 new->mod = new_dm;
536 new->next = crypto_kernel.debug_module_list;
537
538 /* set head of list to new cipher type */
539 crypto_kernel.debug_module_list = new;
540
541 return srtp_err_status_ok;
542}
543
544srtp_err_status_t srtp_crypto_kernel_set_debug_module(const char *name, int on)
545{

Callers 3

srtp_crypto_kernel_initFunction · 0.85
mainFunction · 0.85
srtp_initFunction · 0.85

Calls 1

srtp_crypto_allocFunction · 0.85

Tested by

no test coverage detected