Commit Graph

16 Commits

Author SHA1 Message Date
Martin Storsjö 016387fe0f rtmpdh: Don't use the OpenSSL DH struct
Instead use our own struct, which we already use when using
gcrypt and gnutls.

In OpenSSL 1.1, the DH struct has been made opaque.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-10-23 22:02:01 +03:00
Diego Biurrun d12b5b2f13 build: Split test programs off into separate files
This avoids spurious library rebuilds when only the test program
code is changed and simplifies the build system.
2016-04-07 16:14:42 +02:00
Anton Khirnov 704a397697 rtmpdh: add an stdio.h include
The test uses printf.
2016-03-25 14:53:37 +01:00
Diego Biurrun 439929859a testprogs: Clean up #includes 2016-03-24 19:17:23 +01:00
Martin Storsjö 63ce9fd23c rtmpdh: Use GMP functions directly, instead of nettle wrappers
mpz_import and mpz_export were added in GMP 4.1, in 2002.

This simplifies the DH code by clarifying that it only uses pure
bignum functions, no other parts of nettle/hogweed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-06-01 10:38:54 +03:00
Martin Storsjö b2f0f37d24 rtmpdh: Generate the whole private exponent using av_get_random_seed() with nettle/gmp
Don't use a PRNG for generating it; that defies the intended use
within the cryptograhic handshake.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 23:33:03 +03:00
Martin Storsjö e9e86d9ef6 rtmpdh: Create sufficiently long private keys for gcrypt/nettle
There was a misunderstanding betewen bits and bytes for the parameter
value for generating random big numbers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:41 +03:00
Martin Storsjö 8016a1bd3b rtmpdh: Remove an unnecessary check in the gcrypt/nettle dh_compute_key
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:38 +03:00
Martin Storsjö 063f7467e4 rtmpdh: Add fate test for the DH handshake routine
This helps if these functions need to be implemented using another
crypto API.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:35 +03:00
Martin Storsjö 0508faaa11 rtmpdh: Pass the actual buffer size of the output secret key
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:32 +03:00
Martin Storsjö 9f1b3050d9 rtmpdh: Check the output buffer size in the openssl version of dh_compute_key
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:30 +03:00
Martin Storsjö 127d813bcb rtmpdh: Fix a local variable name in the nettle/gcrypt codepath
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:28 +03:00
Martin Storsjö 78efc69e7c rtmpdh: Make sure ret is initialized in the nettle version of bn_hex2bn
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:24 +03:00
Samuel Pitoiset 8337b5db96 rtmpdh: Do not generate the same private key every time when using libnettle
Replace mpz_random by mpz_urandomb with a random state initialization in
order to improve the randomness.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-17 23:51:53 +03:00
Martin Storsjö 6a433fdba8 rtmp: Add credit/copyright to librtmp authors for parts of the RTMPE code
Our implementation of RTMPE is heavily based on librtmp.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-24 18:13:26 +03:00
Samuel Pitoiset acd554c103 RTMPE protocol support
This adds two protocols, but one of them is an internal implementation
detail just used as an abstraction layer/generalization in the code. The
RTMPE protocol implementation uses ffrtmpcrypt:// as an alternative to the
tcp:// protocol. This allows moving most of the lower level logic out
from the higher level generic rtmp code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-23 16:32:07 +03:00