Skip to content

Commit

Permalink
Make code buildable with BoringSSL
Browse files Browse the repository at this point in the history
Checked with the latest code f7b830d8df9f5578c748aa0283d44c59ea7eeb25
  • Loading branch information
maskit committed Sep 25, 2019
1 parent 71fc9d3 commit 6c0eb63
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ dump_context(const char *ca_path, const char *ck_path)

// Serial number
int64_t sn = 0;
#if OPENSSL_VERSION_NUMBER >= 0x010100000
#if !defined(OPENSSL_IS_BORINGSSL) && (OPENSSL_VERSION_NUMBER >= 0x010100000)
ASN1_INTEGER_get_int64(&sn, serial);
#else
sn = ASN1_INTEGER_get(serial);
Expand Down
8 changes: 8 additions & 0 deletions iocore/net/P_SSLNetVConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,20 @@ class SSLNetVConnection : public UnixNetVConnection, public ALPNSupport
return nullptr;
}

#ifndef OPENSSL_IS_BORINGSSL
int curve_nid = SSL_get_shared_curve(ssl, 0);

if (curve_nid == NID_undef) {
return nullptr;
}
return OBJ_nid2sn(curve_nid);
#else
if (uint16_t curve_id = SSL_get_curve_id(ssl); curve_id != 0) {
return SSL_get_curve_name(curve_id);
} else {
return nullptr;
}
#endif
}

bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ dump_context(const char *ca_path, const char *ck_path)

// Serial number
int64_t sn = 0;
#if OPENSSL_VERSION_NUMBER >= 0x010100000
#if !defined(OPENSSL_IS_BORINGSSL) && (OPENSSL_VERSION_NUMBER >= 0x010100000)
ASN1_INTEGER_get_int64(&sn, serial);
#else
sn = ASN1_INTEGER_get(serial);
Expand Down

0 comments on commit 6c0eb63

Please sign in to comment.