winlin

refine HMAC sha256 digest algorithm. 0.9.193

@@ -70,7 +70,7 @@ namespace _srs_internal @@ -70,7 +70,7 @@ namespace _srs_internal
70 0x93, 0xB8, 0xE6, 0x36, 0xCF, 0xEB, 0x31, 0xAE 70 0x93, 0xB8, 0xE6, 0x36, 0xCF, 0xEB, 0x31, 0xAE
71 }; // 62 71 }; // 62
72 72
73 - int __openssl_HMACsha256(HMAC_CTX* ctx, const void* data, int data_size, const void* key, int key_size, void* digest, unsigned int* digest_size) 73 + int __openssl_HMACsha256(HMAC_CTX* ctx, const void* data, int data_size, void* digest, unsigned int* digest_size)
74 { 74 {
75 int ret = ERROR_SUCCESS; 75 int ret = ERROR_SUCCESS;
76 76
@@ -104,7 +104,7 @@ namespace _srs_internal @@ -104,7 +104,7 @@ namespace _srs_internal
104 // use data to digest. 104 // use data to digest.
105 // @see ./crypto/sha/sha256t.c 105 // @see ./crypto/sha/sha256t.c
106 // @see ./crypto/evp/digest.c 106 // @see ./crypto/evp/digest.c
107 - if (EVP_Digest(data, data_size, __key, &digest_size, EVP_sha256(), NULL) < 0) 107 + if (EVP_Digest(data, data_size, __digest, &digest_size, EVP_sha256(), NULL) < 0)
108 { 108 {
109 ret = ERROR_OpenSslSha256EvpDigest; 109 ret = ERROR_OpenSslSha256EvpDigest;
110 return ret; 110 return ret;
@@ -122,7 +122,7 @@ namespace _srs_internal @@ -122,7 +122,7 @@ namespace _srs_internal
122 return ret; 122 return ret;
123 } 123 }
124 124
125 - ret = __openssl_HMACsha256(&ctx, data, data_size, __key, key_size, __digest, &digest_size); 125 + ret = __openssl_HMACsha256(&ctx, data, data_size, __digest, &digest_size);
126 HMAC_CTX_cleanup(&ctx); 126 HMAC_CTX_cleanup(&ctx);
127 127
128 if (ret != ERROR_SUCCESS) { 128 if (ret != ERROR_SUCCESS) {