Default VirtualEventBase
[folly.git] / folly / ssl / OpenSSLHash.h
index 5081faec14b40beee50df775284383f6a8dc6673..da05bb0b0205cdcb9441f9d4c5a0846ce5f75c61 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,10 +53,10 @@ class OpenSSLHash {
     }
     void hash_final(MutableByteRange out) {
       const auto size = EVP_MD_size(md_);
-      check_out_size(size, out);
+      check_out_size(size_t(size), out);
       unsigned int len = 0;
       check_libssl_result(1, EVP_DigestFinal_ex(&ctx_, out.data(), &len));
-      check_libssl_result(size, len);
+      check_libssl_result(size, int(len));
       md_ = nullptr;
     }
    private:
@@ -118,7 +118,7 @@ class OpenSSLHash {
     }
     void hash_final(MutableByteRange out) {
       const auto size = EVP_MD_size(md_);
-      check_out_size(size, out);
+      check_out_size(size_t(size), out);
       unsigned int len = 0;
       check_libssl_result(1, HMAC_Final(&ctx_, out.data(), &len));
       check_libssl_result(size, int(len));
@@ -173,7 +173,9 @@ class OpenSSLHash {
     }
     check_out_size_throw(size, out);
   }
-  static void check_out_size_throw(size_t size, MutableByteRange out);
+  [[noreturn]] static void check_out_size_throw(
+      size_t size,
+      MutableByteRange out);
 
   static inline void check_libssl_result(int expected, int result) {
     if (LIKELY(result == expected)) {
@@ -181,8 +183,7 @@ class OpenSSLHash {
     }
     check_libssl_result_throw();
   }
-  static void check_libssl_result_throw();
-
+  [[noreturn]] static void check_libssl_result_throw();
 };
 
 }