srtp_create fail for first few packets in armv7
Hi Team, I have been seeing this issue consistently in raspberry pi3 armv7. When I debugged the source code it looks like cypher types are not initialized. Meaning the following function return some invalid or big integer for cypher type in place of 1, 2 or 3.
crypto_kernel.c +491 (v1.5.x)
srtp_crypto_kernel_get_cipher_type()
I have tried 1.4.5 the old release of srtp in raspberry pi3 and still seeing this issue. As the title says it gets better after 5 or 10 packets encrypt/decrypt failure. Am I missing something or do I need to add something in the build configuration? Please advise.
Thanks, Robel Sharma
Is it the sender that it sending wrong data? The ciphers are not going to auto-configure later. They would have been configured upon initialization, so it doesn't make any sense that it would suddenly start working after 10 packets or so.
There was an issue (#304) discovered for big endian processors. As I understand, the ARM can operate in either mode and, obviously, if the endianness isn't right, the behavior can be quite unpredictable. Might be be related to that?
It reproduces for both (send and receive) in raspberry pi. It's been initialized at the beginning and I found that the same code base works on the android phone. Looks like my pi is little endian.
If you do a "run maketest", do all the tests pass? I'm baffled as to why the first few packets would fail to decrypt (or encrypt) properly.
Have cloned the branch 1_5_x_throttle as I am using 1.5.x and here is the output for run maketest,
gcc -DHAVE_CONFIG_H -Icrypto/include -I./include -I./crypto/include -fPIC -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops -L. -o test/dtls_srtp_driver test/dtls_srtp_driver.c test/getopt_s.c libsrtp.a -lsrtp Build done. Please run 'make runtest' to run self tests. running libsrtp test applications... crypto/test/cipher_driver -v >/dev/null crypto/test/kernel_driver -v >/dev/null test/rdbx_driver -v >/dev/null test/srtp_driver -v >/dev/null test/roc_driver -v >/dev/null test/replay_driver -v >/dev/null test/dtls_srtp_driver >/dev/null crypto/test/rand_gen_soak -v >/dev/null cd test; /home/root/srtp/libsrtp/test/rtpw_test.sh >/dev/null ./rtpw: couldn't open file /usr/share/dict/words make: *** [Makefile:35: runtest] Error 255
The error is due to the missing dictionary file. We're changing that in the upcoming 2.1 release, but for now is it possible to either install the "words", "wordlist", or "spell" package (not sure which one will contain that file /usr/share/dict/words on your system, just create a file with that name with some random words out of a dictionary, or modify the source to point to a different file for the same purpose? (It's a #define in the test code somewhere). (I suspect all tests will pass, because the tests made it this far...)
@robelsharma Is this still an issues for you? As of release 2.1.0 there is no longer a dependency on /usr/share/dict/words so performing a make runtest should work.
There is a 1.6.x throttle branch that will be used to create a new 1.X release, if you use that branch does the problem still exists?
@robelsharma I will close this issues now as there has been no progress for a while. If this is still a problem then please reopen. I would suggest moving to libsrtp 2.1 if possible.
Sorry, pabuhler. I went with those few packet failure. Looks like now it is fixed on the new version. I will do a dry run sometime later.