正在显示
3 个修改的文件
包含
6 行增加
和
25 行删除
| @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 31 | // current release version | 31 | // current release version |
| 32 | #define VERSION_MAJOR "0" | 32 | #define VERSION_MAJOR "0" |
| 33 | #define VERSION_MINOR "9" | 33 | #define VERSION_MINOR "9" |
| 34 | -#define VERSION_REVISION "193" | 34 | +#define VERSION_REVISION "194" |
| 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION | 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION |
| 36 | // server info. | 36 | // server info. |
| 37 | #define RTMP_SIG_SRS_KEY "SRS" | 37 | #define RTMP_SIG_SRS_KEY "SRS" |
| @@ -114,8 +114,8 @@ namespace _srs_internal | @@ -114,8 +114,8 @@ namespace _srs_internal | ||
| 114 | #define __SRS_OpensslHashSize 512 | 114 | #define __SRS_OpensslHashSize 512 |
| 115 | extern u_int8_t SrsGenuineFMSKey[]; | 115 | extern u_int8_t SrsGenuineFMSKey[]; |
| 116 | extern u_int8_t SrsGenuineFPKey[]; | 116 | extern u_int8_t SrsGenuineFPKey[]; |
| 117 | - int openssl_HMACsha256(const void* data, int data_size, const void* key, int key_size, void* digest); | ||
| 118 | - int openssl_generate_key(char* _private_key, char* _public_key, int32_t size); | 117 | + int openssl_HMACsha256(const void* key, int key_size, const void* data, int data_size, void* digest); |
| 118 | + int openssl_generate_key(char* public_key, int32_t size); | ||
| 119 | 119 | ||
| 120 | // calc the offset of key, | 120 | // calc the offset of key, |
| 121 | // the key->offset cannot be used as the offset of key. | 121 | // the key->offset cannot be used as the offset of key. |
| @@ -222,8 +222,8 @@ VOID TEST(ProtocolHandshakeTest, OpensslSha256) | @@ -222,8 +222,8 @@ VOID TEST(ProtocolHandshakeTest, OpensslSha256) | ||
| 222 | char digest[__SRS_OpensslHashSize]; | 222 | char digest[__SRS_OpensslHashSize]; |
| 223 | ASSERT_EQ(ERROR_SUCCESS, | 223 | ASSERT_EQ(ERROR_SUCCESS, |
| 224 | openssl_HMACsha256( | 224 | openssl_HMACsha256( |
| 225 | - random_bytes, sizeof(random_bytes), | ||
| 226 | SrsGenuineFPKey, 30, | 225 | SrsGenuineFPKey, 30, |
| 226 | + random_bytes, sizeof(random_bytes), | ||
| 227 | digest | 227 | digest |
| 228 | ) | 228 | ) |
| 229 | ); | 229 | ); |
| @@ -238,30 +238,11 @@ VOID TEST(ProtocolHandshakeTest, OpensslSha256) | @@ -238,30 +238,11 @@ VOID TEST(ProtocolHandshakeTest, OpensslSha256) | ||
| 238 | // verify the dh key | 238 | // verify the dh key |
| 239 | VOID TEST(ProtocolHandshakeTest, DHKey) | 239 | VOID TEST(ProtocolHandshakeTest, DHKey) |
| 240 | { | 240 | { |
| 241 | - char pri_key[] = { | ||
| 242 | - (char)0x6e, (char)0x65, (char)0x69, (char)0x2d, (char)0x69, (char)0x2d, (char)0x69, (char)0x73, | ||
| 243 | - (char)0x6e, (char)0x69, (char)0x73, (char)0x6c, (char)0x65, (char)0x72, (char)0x69, (char)0x72, | ||
| 244 | - (char)0x76, (char)0x65, (char)0x72, (char)0x69, (char)0x77, (char)0x74, (char)0x2e, (char)0x6e, | ||
| 245 | - (char)0x72, (char)0x76, (char)0x72, (char)0x65, (char)0x72, (char)0x70, (char)0x72, (char)0x69, | ||
| 246 | - (char)0x69, (char)0x70, (char)0x72, (char)0x73, (char)0x6e, (char)0x65, (char)0x72, (char)0x72, | ||
| 247 | - (char)0x6e, (char)0x2d, (char)0x65, (char)0x74, (char)0x72, (char)0x6c, (char)0x69, (char)0x74, | ||
| 248 | - (char)0x69, (char)0x65, (char)0x40, (char)0x69, (char)0x69, (char)0x76, (char)0x77, (char)0x2d, | ||
| 249 | - (char)0x73, (char)0x65, (char)0x72, (char)0x72, (char)0x76, (char)0x73, (char)0x72, (char)0x2e, | ||
| 250 | - (char)0x2d, (char)0x76, (char)0x65, (char)0x31, (char)0x65, (char)0x6d, (char)0x6d, (char)0x73, | ||
| 251 | - (char)0x69, (char)0x73, (char)0x74, (char)0x2e, (char)0x74, (char)0x72, (char)0x65, (char)0x65, | ||
| 252 | - (char)0x72, (char)0x65, (char)0x2d, (char)0x74, (char)0x69, (char)0x31, (char)0x65, (char)0x2d, | ||
| 253 | - (char)0x6f, (char)0x77, (char)0x2e, (char)0x76, (char)0x77, (char)0x2d, (char)0x77, (char)0x72, | ||
| 254 | - (char)0x65, (char)0x65, (char)0x31, (char)0x74, (char)0x73, (char)0x70, (char)0x74, (char)0x6e, | ||
| 255 | - (char)0x72, (char)0x6e, (char)0x73, (char)0x6d, (char)0x2e, (char)0x69, (char)0x72, (char)0x2d, | ||
| 256 | - (char)0x65, (char)0x69, (char)0x77, (char)0x69, (char)0x76, (char)0x72, (char)0x77, (char)0x72, | ||
| 257 | - (char)0x32, (char)0x6e, (char)0x65, (char)0x6c, (char)0x2e, (char)0x2d, (char)0x6e, (char)0x69 | ||
| 258 | - }; | ||
| 259 | - | ||
| 260 | char pub_key1[128]; | 241 | char pub_key1[128]; |
| 261 | - openssl_generate_key(pri_key, pub_key1, 128); | 242 | + openssl_generate_key(pub_key1, 128); |
| 262 | 243 | ||
| 263 | char pub_key2[128]; | 244 | char pub_key2[128]; |
| 264 | - openssl_generate_key(pri_key, pub_key2, 128); | 245 | + openssl_generate_key(pub_key2, 128); |
| 265 | 246 | ||
| 266 | EXPECT_FALSE(srs_bytes_equals(pub_key1, pub_key2, 128)); | 247 | EXPECT_FALSE(srs_bytes_equals(pub_key1, pub_key2, 128)); |
| 267 | } | 248 | } |
-
请 注册 或 登录 后发表评论