Skip to content

Commit 339b61d

Browse files
committed
Remove crypto_get_random() since it's been agreed that libsrtp should 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.
1 parent c270245 commit 339b61d

File tree

6 files changed

+3
-264
lines changed

6 files changed

+3
-264
lines changed

Makefile.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ runtest: build_table_apps test
3131
test/roc_driver$(EXE) -v >/dev/null
3232
test/replay_driver$(EXE) -v >/dev/null
3333
test/dtls_srtp_driver$(EXE) >/dev/null
34-
crypto/test/rand_gen_soak$(EXE) -v >/dev/null
3534
cd test; $(abspath $(srcdir))/test/rtpw_test.sh >/dev/null
3635
ifeq (1, $(USE_OPENSSL))
3736
cd test; $(abspath $(srcdir))/test/rtpw_test_gcm.sh >/dev/null
@@ -140,8 +139,8 @@ endif
140139

141140
crypto_testapp = $(AES_CALC) crypto/test/cipher_driver$(EXE) \
142141
crypto/test/datatypes_driver$(EXE) crypto/test/kernel_driver$(EXE) \
143-
crypto/test/rand_gen$(EXE) crypto/test/sha1_driver$(EXE) \
144-
crypto/test/stat_driver$(EXE) crypto/test/rand_gen_soak$(EXE)
142+
crypto/test/sha1_driver$(EXE) \
143+
crypto/test/stat_driver$(EXE)
145144

146145
testapp = $(crypto_testapp) test/srtp_driver$(EXE) test/replay_driver$(EXE) \
147146
test/roc_driver$(EXE) test/rdbx_driver$(EXE) test/rtpw$(EXE) \

crypto/Makefile.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ endif
4646

4747
testapp = test/cipher_driver$(EXE) test/datatypes_driver$(EXE) \
4848
test/stat_driver$(EXE) test/sha1_driver$(EXE) \
49-
test/kernel_driver$(EXE) $(AES_CALC) test/rand_gen$(EXE) \
49+
test/kernel_driver$(EXE) $(AES_CALC) \
5050
test/env$(EXE)
5151

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

7978

crypto/include/crypto_kernel.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -254,27 +254,4 @@ crypto_kernel_alloc_auth(auth_type_id_t id,
254254
err_status_t
255255
crypto_kernel_set_debug_module(char *mod_name, int v);
256256

257-
/**
258-
* @brief writes a random octet string.
259-
*
260-
* The function call crypto_get_random(dest, len) writes len octets of
261-
* random data to the location to which dest points, and returns an
262-
* error code. This error code @b must be checked, and if a failure is
263-
* reported, the data in the buffer @b must @b not be used.
264-
*
265-
* @warning If the return code is not checked, then non-random
266-
* data may be in the buffer. This function will fail
267-
* unless it is called after crypto_kernel_init().
268-
*
269-
* @return
270-
* - err_status_ok if no problems occured.
271-
* - [other] a problem occured, and no assumptions should
272-
* be made about the contents of the destination
273-
* buffer.
274-
*
275-
* @ingroup SRTP
276-
*/
277-
err_status_t
278-
crypto_get_random(unsigned char *buffer, unsigned int length);
279-
280257
#endif /* CRYPTO_KERNEL */

crypto/kernel/crypto_kernel.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -584,15 +584,3 @@ crypto_kernel_set_debug_module(char *name, int on) {
584584

585585
return err_status_fail;
586586
}
587-
588-
err_status_t
589-
crypto_get_random(unsigned char *buffer, unsigned int length) {
590-
if (crypto_kernel.state == crypto_kernel_state_secure)
591-
#ifdef OPENSSL
592-
return rand_source_get_octet_string(buffer, length);
593-
#else
594-
return ctr_prng_get_octet_string(buffer, length);
595-
#endif
596-
else
597-
return err_status_fail;
598-
}

crypto/test/rand_gen.c

Lines changed: 0 additions & 144 deletions
This file was deleted.

crypto/test/rand_gen_soak.c

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)