1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

finish utest for handshake.

This commit is contained in:
winlin 2014-03-19 23:34:50 +08:00
parent 6b84a5e14c
commit a470330383
5 changed files with 157 additions and 105 deletions

View file

@ -97,7 +97,7 @@ namespace srs
"EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381" \
"FFFFFFFFFFFFFFFF"
int __openssl_generate_key(
u_int8_t*& _private_key, u_int8_t*& _public_key, int32_t& size,
u_int8_t* _private_key, u_int8_t* _public_key, int32_t& size,
DH*& pdh, int32_t& bits_count, u_int8_t*& shared_key, int32_t& shared_key_length, BIGNUM*& peer_public_key
){
int ret = ERROR_SUCCESS;
@ -200,7 +200,7 @@ namespace srs
BIGNUM* peer_public_key = NULL;
ret = __openssl_generate_key(
(u_int8_t*&)_private_key, (u_int8_t*&)_public_key, size,
(u_int8_t*)_private_key, (u_int8_t*)_public_key, size,
pdh, bits_count, shared_key, shared_key_length, peer_public_key
);
@ -543,6 +543,14 @@ namespace srs
u_int8_t* a = (u_int8_t*)pa;
u_int8_t* b = (u_int8_t*)pb;
if (!a && !b) {
return true;
}
if (!a || !b) {
return false;
}
for(int i = 0; i < size; i++){
if(a[i] != b[i]){
return false;