MCPcopy Create free account
hub / github.com/apache/brpc / ComputeDigest

Method ComputeDigest

src/brpc/policy/rtmp_protocol.cpp:518–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516}
517
518bool C2S2Base::ComputeDigest(const void* key, int key_size,
519 const void* c1s1_digest, void* digest) const {
520 char temp_key[EVP_MAX_MD_SIZE];
521 if (openssl_HMACsha256(key, key_size, c1s1_digest, DigestBlock::DIGEST_SIZE,
522 temp_key) != 0) {
523 LOG(WARNING) << "Fail to create temp key";
524 return false;
525 }
526 char tmp_digest[EVP_MAX_MD_SIZE];
527 if (openssl_HMACsha256(temp_key, 32, random, SIZE - DIGEST_SIZE,
528 tmp_digest) != 0) {
529 LOG(WARNING) << "Fail to create temp digest";
530 return false;
531 }
532 memcpy(digest, tmp_digest, 32);
533 return true;
534}
535
536bool C2S2Base::Generate(const void* key, int key_size,
537 const void* c1s1_digest) {

Callers

nothing calls this directly

Calls 1

openssl_HMACsha256Function · 0.85

Tested by

no test coverage detected