Make constants in bssl tool actually const.

Change-Id: Iedf6a1bafbe195b689e1aebd2293332e38c1f4c7
Reviewed-on: https://boringssl-review.googlesource.com/5042
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/tool/const.cc b/tool/const.cc
index b364cd4..7b7001e 100644
--- a/tool/const.cc
+++ b/tool/const.cc
@@ -15,9 +15,10 @@
 #include <stddef.h>
 #include <stdint.h>
 
-extern "C" {
+#include "internal.h"
 
-uint8_t kDERRSAPrivate2048[] = {
+
+const uint8_t kDERRSAPrivate2048[] = {
     0x30, 0x82, 0x04, 0xa3, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00,
     0xd0, 0x02, 0xde, 0x5d, 0x19, 0x33, 0x48, 0x15, 0xc7, 0x86, 0xde, 0xa3,
     0xec, 0x63, 0x89, 0x14, 0x63, 0x99, 0x30, 0x1f, 0x5d, 0x25, 0xb2, 0xfa,
@@ -120,9 +121,9 @@
     0x77, 0xe6, 0xd3,
 };
 
-size_t kDERRSAPrivate2048Len = sizeof(kDERRSAPrivate2048);
+const size_t kDERRSAPrivate2048Len = sizeof(kDERRSAPrivate2048);
 
-uint8_t kDERRSAPrivate4096[] = {
+const uint8_t kDERRSAPrivate4096[] = {
     0x30, 0x82, 0x09, 0x28, 0x02, 0x01, 0x00, 0x02, 0x82, 0x02, 0x01, 0x00,
     0xc3, 0x82, 0x01, 0xda, 0x03, 0xe1, 0x0d, 0x78, 0xf4, 0x86, 0xf1, 0x28,
     0xf0, 0x4c, 0x34, 0xa6, 0x73, 0x0c, 0xfb, 0x22, 0xfa, 0x35, 0xc9, 0x3a,
@@ -321,9 +322,9 @@
     0x59, 0x8e, 0xd7, 0x45, 0x87, 0x86, 0x05, 0x9d,
 };
 
-size_t kDERRSAPrivate4096Len = sizeof(kDERRSAPrivate4096);
+const size_t kDERRSAPrivate4096Len = sizeof(kDERRSAPrivate4096);
 
-uint8_t kDERRSAPrivate3Prime2048[] = {
+const uint8_t kDERRSAPrivate3Prime2048[] = {
     0x30, 0x82, 0x04, 0xd7, 0x02, 0x01, 0x01, 0x02, 0x82, 0x01, 0x00, 0x62,
     0x91, 0xe9, 0xea, 0xb3, 0x5d, 0x6c, 0x29, 0xae, 0x21, 0x83, 0xbb, 0xb5,
     0x82, 0xb1, 0x9e, 0xea, 0xe0, 0x64, 0x5b, 0x1e, 0x2f, 0x5e, 0x2c, 0x0a,
@@ -430,6 +431,4 @@
     0xe8, 0x9f, 0xd0, 0x62, 0x96, 0xca, 0xcf,
 };
 
-size_t kDERRSAPrivate3Prime2048Len = sizeof(kDERRSAPrivate3Prime2048);
-
-}  /* extern "C" */
+const size_t kDERRSAPrivate3Prime2048Len = sizeof(kDERRSAPrivate3Prime2048);
diff --git a/tool/internal.h b/tool/internal.h
index 95030ca..eae8881 100644
--- a/tool/internal.h
+++ b/tool/internal.h
@@ -53,5 +53,13 @@
                  unsigned default_value,
                  const std::map<std::string, std::string> &args);
 
+// These values are DER encoded, RSA private keys.
+extern const uint8_t kDERRSAPrivate2048[];
+extern const size_t kDERRSAPrivate2048Len;
+extern const uint8_t kDERRSAPrivate4096[];
+extern const size_t kDERRSAPrivate4096Len;
+extern const uint8_t kDERRSAPrivate3Prime2048[];
+extern const size_t kDERRSAPrivate3Prime2048Len;
+
 
 #endif /* !OPENSSL_HEADER_TOOL_INTERNAL_H */
diff --git a/tool/speed.cc b/tool/speed.cc
index 151dc2b..6c788ac 100644
--- a/tool/speed.cc
+++ b/tool/speed.cc
@@ -36,18 +36,9 @@
 #endif
 
 #include "../crypto/test/scoped_types.h"
+#include "internal.h"
 
 
-extern "C" {
-// These values are DER encoded, RSA private keys.
-extern const uint8_t kDERRSAPrivate2048[];
-extern size_t kDERRSAPrivate2048Len;
-extern const uint8_t kDERRSAPrivate4096[];
-extern size_t kDERRSAPrivate4096Len;
-extern const uint8_t kDERRSAPrivate3Prime2048[];
-extern size_t kDERRSAPrivate3Prime2048Len;
-}
-
 // TimeResults represents the results of benchmarking a function.
 struct TimeResults {
   // num_calls is the number of function calls done in the time period.