Commit 46f7dd8b authored by eroman's avatar eroman Committed by Commit bot

Use uint32_t to hold return values from ERR_get_error() and ERR_peek_error().

BUG=None

Review URL: https://codereview.chromium.org/1028873002

Cr-Commit-Position: refs/heads/master@{#321919}
parent b1e2f5ec
...@@ -116,7 +116,7 @@ void EnsureOpenSSLInit() { ...@@ -116,7 +116,7 @@ void EnsureOpenSSLInit() {
void ClearOpenSSLERRStack(const tracked_objects::Location& location) { void ClearOpenSSLERRStack(const tracked_objects::Location& location) {
if (logging::DEBUG_MODE && VLOG_IS_ON(1)) { if (logging::DEBUG_MODE && VLOG_IS_ON(1)) {
int error_num = ERR_peek_error(); uint32_t error_num = ERR_peek_error();
if (error_num == 0) if (error_num == 0)
return; return;
......
...@@ -17,7 +17,7 @@ namespace net { ...@@ -17,7 +17,7 @@ namespace net {
bool TestRootCerts::Add(X509Certificate* certificate) { bool TestRootCerts::Add(X509Certificate* certificate) {
if (!X509_STORE_add_cert(X509Certificate::cert_store(), if (!X509_STORE_add_cert(X509Certificate::cert_store(),
certificate->os_cert_handle())) { certificate->os_cert_handle())) {
unsigned long error_code = ERR_peek_error(); uint32_t error_code = ERR_peek_error();
if (ERR_GET_LIB(error_code) != ERR_LIB_X509 || if (ERR_GET_LIB(error_code) != ERR_LIB_X509 ||
ERR_GET_REASON(error_code) != X509_R_CERT_ALREADY_IN_HASH_TABLE) { ERR_GET_REASON(error_code) != X509_R_CERT_ALREADY_IN_HASH_TABLE) {
crypto::ClearOpenSSLERRStack(FROM_HERE); crypto::ClearOpenSSLERRStack(FROM_HERE);
......
...@@ -26,7 +26,7 @@ void DLogOpenSslErrors() { ...@@ -26,7 +26,7 @@ void DLogOpenSslErrors() {
#ifdef NDEBUG #ifdef NDEBUG
ClearOpenSslErrors(); ClearOpenSslErrors();
#else #else
while (unsigned long error = ERR_get_error()) { while (uint32_t error = ERR_get_error()) {
char buf[120]; char buf[120];
ERR_error_string_n(error, buf, arraysize(buf)); ERR_error_string_n(error, buf, arraysize(buf));
DLOG(ERROR) << "OpenSSL error: " << buf; DLOG(ERROR) << "OpenSSL error: " << buf;
......
...@@ -103,7 +103,7 @@ SSL* CreateSSLContext(SSL_CTX* ssl_ctx) { ...@@ -103,7 +103,7 @@ SSL* CreateSSLContext(SSL_CTX* ssl_ctx) {
void PrintSslError() { void PrintSslError() {
char buf[128]; // this buffer must be at least 120 chars long. char buf[128]; // this buffer must be at least 120 chars long.
int error_num = ERR_get_error(); uint32_t error_num = ERR_get_error();
while (error_num != 0) { while (error_num != 0) {
ERR_error_string_n(error_num, buf, sizeof(buf)); ERR_error_string_n(error_num, buf, sizeof(buf));
LOG(ERROR) << buf; LOG(ERROR) << buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment