0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 07:23:53 +01:00

ircd::openssl: Minor rename function.

This commit is contained in:
Jason Volk 2018-01-04 21:59:39 -08:00
parent 6aec038479
commit 35ad641251
3 changed files with 27 additions and 27 deletions

View file

@ -90,8 +90,8 @@ namespace ircd::openssl
string_view write_pem(const mutable_buffer &out, const X509 &);
string_view print(const mutable_buffer &buf, const X509 &);
string_view genX509(const mutable_buffer &out, const json::object &opts);
const X509 &get_peer_cert(const SSL &);
X509 &get_peer_cert(SSL &);
const X509 &peer_cert(const SSL &);
X509 &peer_cert(SSL &);
}
/// OpenSSL BIO convenience utils and wraps; also secure file IO closures

View file

@ -201,7 +201,7 @@ ircd::net::peer_cert_der(const mutable_raw_buffer &buf,
const socket &socket)
{
const SSL &ssl(socket);
const X509 &cert(openssl::get_peer_cert(ssl));
const X509 &cert{openssl::peer_cert(ssl)};
return openssl::i2d(buf, cert);
}

View file

@ -57,6 +57,30 @@ namespace ircd::openssl
void append_entries(X509 &cert, const json::object &opts);
}
X509 &
ircd::openssl::peer_cert(SSL &ssl)
{
auto *const ret
{
SSL_get_peer_certificate(&ssl)
};
assert(ret);
return *ret;
}
const X509 &
ircd::openssl::peer_cert(const SSL &ssl)
{
const auto *const ret
{
SSL_get_peer_certificate(&ssl)
};
assert(ret);
return *ret;
}
ircd::string_view
ircd::openssl::genX509(const mutable_buffer &out,
const json::object &opts)
@ -316,30 +340,6 @@ ircd::openssl::i2d(const mutable_raw_buffer &buf,
return ret;
}
X509 &
ircd::openssl::get_peer_cert(SSL &ssl)
{
auto *const ret
{
SSL_get_peer_certificate(&ssl)
};
assert(ret);
return *ret;
}
const X509 &
ircd::openssl::get_peer_cert(const SSL &ssl)
{
const auto *const ret
{
SSL_get_peer_certificate(&ssl)
};
assert(ret);
return *ret;
}
//
// RSA
//