Skip to content

Commit

Permalink
Remove crypto_get_random() since it's been agreed that libsrtp should…
Browse files Browse the repository at this point in the history
… not be used as a general purpose crypto library. The RNG provided by libsrtp is old and not current with the latest standards, such as SP800-90.
  • Loading branch information
jfigus committed Nov 4, 2014
1 parent c270245 commit 339b61d
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 264 deletions.
5 changes: 2 additions & 3 deletions Makefile.in
Expand Up @@ -31,7 +31,6 @@ runtest: build_table_apps test
test/roc_driver$(EXE) -v >/dev/null
test/replay_driver$(EXE) -v >/dev/null
test/dtls_srtp_driver$(EXE) >/dev/null
crypto/test/rand_gen_soak$(EXE) -v >/dev/null
cd test; $(abspath $(srcdir))/test/rtpw_test.sh >/dev/null
ifeq (1, $(USE_OPENSSL))
cd test; $(abspath $(srcdir))/test/rtpw_test_gcm.sh >/dev/null
Expand Down Expand Up @@ -140,8 +139,8 @@ endif

crypto_testapp = $(AES_CALC) crypto/test/cipher_driver$(EXE) \
crypto/test/datatypes_driver$(EXE) crypto/test/kernel_driver$(EXE) \
crypto/test/rand_gen$(EXE) crypto/test/sha1_driver$(EXE) \
crypto/test/stat_driver$(EXE) crypto/test/rand_gen_soak$(EXE)
crypto/test/sha1_driver$(EXE) \
crypto/test/stat_driver$(EXE)

testapp = $(crypto_testapp) test/srtp_driver$(EXE) test/replay_driver$(EXE) \
test/roc_driver$(EXE) test/rdbx_driver$(EXE) test/rtpw$(EXE) \
Expand Down
3 changes: 1 addition & 2 deletions crypto/Makefile.in
Expand Up @@ -46,7 +46,7 @@ endif

testapp = test/cipher_driver$(EXE) test/datatypes_driver$(EXE) \
test/stat_driver$(EXE) test/sha1_driver$(EXE) \
test/kernel_driver$(EXE) $(AES_CALC) test/rand_gen$(EXE) \
test/kernel_driver$(EXE) $(AES_CALC) \
test/env$(EXE)

# data values used to test the aes_calc application for AES-128
Expand All @@ -73,7 +73,6 @@ endif
test/stat_driver$(EXE) >/dev/null
test/sha1_driver$(EXE) -v >/dev/null
test/kernel_driver$(EXE) -v >/dev/null
test/rand_gen$(EXE) -n 256 >/dev/null
@echo "crypto test applications passed."


Expand Down
23 changes: 0 additions & 23 deletions crypto/include/crypto_kernel.h
Expand Up @@ -254,27 +254,4 @@ crypto_kernel_alloc_auth(auth_type_id_t id,
err_status_t
crypto_kernel_set_debug_module(char *mod_name, int v);

/**
* @brief writes a random octet string.
*
* The function call crypto_get_random(dest, len) writes len octets of
* random data to the location to which dest points, and returns an
* error code. This error code @b must be checked, and if a failure is
* reported, the data in the buffer @b must @b not be used.
*
* @warning If the return code is not checked, then non-random
* data may be in the buffer. This function will fail
* unless it is called after crypto_kernel_init().
*
* @return
* - err_status_ok if no problems occured.
* - [other] a problem occured, and no assumptions should
* be made about the contents of the destination
* buffer.
*
* @ingroup SRTP
*/
err_status_t
crypto_get_random(unsigned char *buffer, unsigned int length);

#endif /* CRYPTO_KERNEL */
12 changes: 0 additions & 12 deletions crypto/kernel/crypto_kernel.c
Expand Up @@ -584,15 +584,3 @@ crypto_kernel_set_debug_module(char *name, int on) {

return err_status_fail;
}

err_status_t
crypto_get_random(unsigned char *buffer, unsigned int length) {
if (crypto_kernel.state == crypto_kernel_state_secure)
#ifdef OPENSSL
return rand_source_get_octet_string(buffer, length);
#else
return ctr_prng_get_octet_string(buffer, length);
#endif
else
return err_status_fail;
}
144 changes: 0 additions & 144 deletions crypto/test/rand_gen.c

This file was deleted.

80 changes: 0 additions & 80 deletions crypto/test/rand_gen_soak.c

This file was deleted.

0 comments on commit 339b61d

Please sign in to comment.