mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 11:51:57 +00:00
fix utest build failed, sync with src changed.
This commit is contained in:
parent
ad2c996bd8
commit
7adbe7f456
3 changed files with 6 additions and 25 deletions
|
@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
// current release version
|
// current release version
|
||||||
#define VERSION_MAJOR "0"
|
#define VERSION_MAJOR "0"
|
||||||
#define VERSION_MINOR "9"
|
#define VERSION_MINOR "9"
|
||||||
#define VERSION_REVISION "193"
|
#define VERSION_REVISION "194"
|
||||||
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
|
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
|
||||||
// server info.
|
// server info.
|
||||||
#define RTMP_SIG_SRS_KEY "SRS"
|
#define RTMP_SIG_SRS_KEY "SRS"
|
||||||
|
|
|
@ -114,8 +114,8 @@ namespace _srs_internal
|
||||||
#define __SRS_OpensslHashSize 512
|
#define __SRS_OpensslHashSize 512
|
||||||
extern u_int8_t SrsGenuineFMSKey[];
|
extern u_int8_t SrsGenuineFMSKey[];
|
||||||
extern u_int8_t SrsGenuineFPKey[];
|
extern u_int8_t SrsGenuineFPKey[];
|
||||||
int openssl_HMACsha256(const void* data, int data_size, const void* key, int key_size, void* digest);
|
int openssl_HMACsha256(const void* key, int key_size, const void* data, int data_size, void* digest);
|
||||||
int openssl_generate_key(char* _private_key, char* _public_key, int32_t size);
|
int openssl_generate_key(char* public_key, int32_t size);
|
||||||
|
|
||||||
// calc the offset of key,
|
// calc the offset of key,
|
||||||
// the key->offset cannot be used as the offset of key.
|
// the key->offset cannot be used as the offset of key.
|
||||||
|
|
|
@ -222,8 +222,8 @@ VOID TEST(ProtocolHandshakeTest, OpensslSha256)
|
||||||
char digest[__SRS_OpensslHashSize];
|
char digest[__SRS_OpensslHashSize];
|
||||||
ASSERT_EQ(ERROR_SUCCESS,
|
ASSERT_EQ(ERROR_SUCCESS,
|
||||||
openssl_HMACsha256(
|
openssl_HMACsha256(
|
||||||
random_bytes, sizeof(random_bytes),
|
|
||||||
SrsGenuineFPKey, 30,
|
SrsGenuineFPKey, 30,
|
||||||
|
random_bytes, sizeof(random_bytes),
|
||||||
digest
|
digest
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -238,30 +238,11 @@ VOID TEST(ProtocolHandshakeTest, OpensslSha256)
|
||||||
// verify the dh key
|
// verify the dh key
|
||||||
VOID TEST(ProtocolHandshakeTest, DHKey)
|
VOID TEST(ProtocolHandshakeTest, DHKey)
|
||||||
{
|
{
|
||||||
char pri_key[] = {
|
|
||||||
(char)0x6e, (char)0x65, (char)0x69, (char)0x2d, (char)0x69, (char)0x2d, (char)0x69, (char)0x73,
|
|
||||||
(char)0x6e, (char)0x69, (char)0x73, (char)0x6c, (char)0x65, (char)0x72, (char)0x69, (char)0x72,
|
|
||||||
(char)0x76, (char)0x65, (char)0x72, (char)0x69, (char)0x77, (char)0x74, (char)0x2e, (char)0x6e,
|
|
||||||
(char)0x72, (char)0x76, (char)0x72, (char)0x65, (char)0x72, (char)0x70, (char)0x72, (char)0x69,
|
|
||||||
(char)0x69, (char)0x70, (char)0x72, (char)0x73, (char)0x6e, (char)0x65, (char)0x72, (char)0x72,
|
|
||||||
(char)0x6e, (char)0x2d, (char)0x65, (char)0x74, (char)0x72, (char)0x6c, (char)0x69, (char)0x74,
|
|
||||||
(char)0x69, (char)0x65, (char)0x40, (char)0x69, (char)0x69, (char)0x76, (char)0x77, (char)0x2d,
|
|
||||||
(char)0x73, (char)0x65, (char)0x72, (char)0x72, (char)0x76, (char)0x73, (char)0x72, (char)0x2e,
|
|
||||||
(char)0x2d, (char)0x76, (char)0x65, (char)0x31, (char)0x65, (char)0x6d, (char)0x6d, (char)0x73,
|
|
||||||
(char)0x69, (char)0x73, (char)0x74, (char)0x2e, (char)0x74, (char)0x72, (char)0x65, (char)0x65,
|
|
||||||
(char)0x72, (char)0x65, (char)0x2d, (char)0x74, (char)0x69, (char)0x31, (char)0x65, (char)0x2d,
|
|
||||||
(char)0x6f, (char)0x77, (char)0x2e, (char)0x76, (char)0x77, (char)0x2d, (char)0x77, (char)0x72,
|
|
||||||
(char)0x65, (char)0x65, (char)0x31, (char)0x74, (char)0x73, (char)0x70, (char)0x74, (char)0x6e,
|
|
||||||
(char)0x72, (char)0x6e, (char)0x73, (char)0x6d, (char)0x2e, (char)0x69, (char)0x72, (char)0x2d,
|
|
||||||
(char)0x65, (char)0x69, (char)0x77, (char)0x69, (char)0x76, (char)0x72, (char)0x77, (char)0x72,
|
|
||||||
(char)0x32, (char)0x6e, (char)0x65, (char)0x6c, (char)0x2e, (char)0x2d, (char)0x6e, (char)0x69
|
|
||||||
};
|
|
||||||
|
|
||||||
char pub_key1[128];
|
char pub_key1[128];
|
||||||
openssl_generate_key(pri_key, pub_key1, 128);
|
openssl_generate_key(pub_key1, 128);
|
||||||
|
|
||||||
char pub_key2[128];
|
char pub_key2[128];
|
||||||
openssl_generate_key(pri_key, pub_key2, 128);
|
openssl_generate_key(pub_key2, 128);
|
||||||
|
|
||||||
EXPECT_FALSE(srs_bytes_equals(pub_key1, pub_key2, 128));
|
EXPECT_FALSE(srs_bytes_equals(pub_key1, pub_key2, 128));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue