From e4bd9a13d856071b96d3ab147621cc381b2ffce8 Mon Sep 17 00:00:00 2001 From: Benjamin Wright Date: Thu, 28 Feb 2019 18:02:57 -0800 Subject: [PATCH] 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 Reviewed-by: Qingsi Wang Commit-Queue: Benjamin Wright Cr-Commit-Position: refs/heads/master@{#26930} --- rtc_base/openssl_key_derivation_hkdf.cc | 29 +++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/rtc_base/openssl_key_derivation_hkdf.cc b/rtc_base/openssl_key_derivation_hkdf.cc index 10e23eceee..6b75e624ca 100644 --- a/rtc_base/openssl_key_derivation_hkdf.cc +++ b/rtc_base/openssl_key_derivation_hkdf.cc @@ -10,6 +10,9 @@ #include "rtc_base/openssl_key_derivation_hkdf.h" +#include +#include + #include #ifdef OPENSSL_IS_BORINGSSL #include @@ -17,9 +20,20 @@ #else #include #include +#endif +#include +#include + +#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 -#include - -#include -#include - -#include "rtc_base/buffer.h" -#include "rtc_base/openssl.h" - -namespace rtc { OpenSSLKeyDerivationHKDF::OpenSSLKeyDerivationHKDF() = default; OpenSSLKeyDerivationHKDF::~OpenSSLKeyDerivationHKDF() = default;