diff options
author | David Benjamin <davidben@chromium.org> | 2015-06-07 07:25:15 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-06-09 00:43:15 +0300 |
commit | 58084affbec6fc75d10ef7a9178b060b08eb3152 (patch) | |
tree | bde3789509774d08fce4385efc5bc6b0b5a6e169 /tool | |
parent | 521d4b805a04e4e56115d51891cba3456db9455d (diff) |
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>
Diffstat (limited to 'tool')
-rw-r--r-- | tool/const.cc | 17 | ||||
-rw-r--r-- | tool/internal.h | 8 | ||||
-rw-r--r-- | tool/speed.cc | 11 |
3 files changed, 17 insertions, 19 deletions
diff --git a/tool/const.cc b/tool/const.cc index b364cd41..7b7001e5 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 @@ uint8_t kDERRSAPrivate2048[] = { 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 @@ uint8_t kDERRSAPrivate4096[] = { 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 @@ uint8_t kDERRSAPrivate3Prime2048[] = { 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 95030caf..eae8881b 100644 --- a/tool/internal.h +++ b/tool/internal.h @@ -53,5 +53,13 @@ bool GetUnsigned(unsigned *out, const std::string &arg_name, 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 151dc2b2..6c788ac4 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. |