Style guide fixes for the hkdf class.

Bug: webrtc:9860
Change-Id: I762d175bbf2c240feb476bbf6d91a1a748d9bcbb
Reviewed-on: https://webrtc-review.googlesource.com/c/125125
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26930}
This commit is contained in:
Benjamin Wright 2019-02-28 18:02:57 -08:00 committed by Commit Bot
parent baffae6ec0
commit e4bd9a13d8

View File

@ -10,6 +10,9 @@
#include "rtc_base/openssl_key_derivation_hkdf.h"
#include <algorithm>
#include <utility>
#include <openssl/ossl_typ.h>
#ifdef OPENSSL_IS_BORINGSSL
#include <openssl/digest.h>
@ -17,9 +20,20 @@
#else
#include <openssl/evp.h>
#include <openssl/kdf.h>
#endif
#include <openssl/err.h>
#include <openssl/sha.h>
#include "rtc_base/buffer.h"
#include "rtc_base/openssl.h"
namespace rtc {
#ifndef OPENSSL_IS_BORINGSSL
namespace {
// the function with this interface is static within openssl and hence not
// accessible to the caller. Implementing here to match boringssl.
// HKDF is static within OpenSSL and hence not accessible to the caller.
// This internal implementation allows for compatibility with BoringSSL.
static int HKDF(uint8_t* out_key,
size_t out_len,
const EVP_MD* digest,
@ -43,18 +57,9 @@ static int HKDF(uint8_t* out_key,
EVP_PKEY_CTX_free(pctx);
return 1;
}
} // namespace
#endif
#include <openssl/err.h>
#include <openssl/sha.h>
#include <algorithm>
#include <utility>
#include "rtc_base/buffer.h"
#include "rtc_base/openssl.h"
namespace rtc {
OpenSSLKeyDerivationHKDF::OpenSSLKeyDerivationHKDF() = default;
OpenSSLKeyDerivationHKDF::~OpenSSLKeyDerivationHKDF() = default;