Skip to content
Snippets Groups Projects
Commit 79e266aa authored by Adrien Béraud's avatar Adrien Béraud
Browse files

crypto: don't build getLongID() with old gnutls

parent 9d75ed14
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,9 @@ struct OPENDHT_PUBLIC PublicKey
PublicKey& operator=(PublicKey&& o) noexcept;
InfoHash getId() const;
#if GNUTLS_VERSION_NUMBER >= 0x030401
PkId getLongId() const;
#endif
bool checkSignature(const Blob& data, const Blob& signature) const;
Blob encrypt(const Blob&) const;
......@@ -362,7 +364,9 @@ struct OPENDHT_PUBLIC Certificate {
/** Same as getPublicKey().getId() */
InfoHash getId() const;
#if GNUTLS_VERSION_NUMBER >= 0x030401
PkId getLongId() const;
#endif
/** Read certificate Common Name (CN) */
std::string getName() const;
......
......@@ -51,10 +51,11 @@ public:
InfoHash getId() const {
return key_ ? key_->getPublicKey().getId() : InfoHash();
}
#if GNUTLS_VERSION_NUMBER >= 0x030401
PkId getLongId() const {
return key_ ? key_->getPublicKey().getLongId() : PkId();
}
#endif
ValueType secureType(ValueType&& type);
ValueType secureType(const ValueType& type) {
......
......@@ -532,6 +532,7 @@ PublicKey::getId() const
return id;
}
#if GNUTLS_VERSION_NUMBER >= 0x030401
PkId
PublicKey::getLongId() const
{
......@@ -541,6 +542,7 @@ PublicKey::getLongId() const
return {};
return h;
}
#endif
Certificate::Certificate(const Blob& certData) : cert(nullptr)
{
......@@ -646,6 +648,7 @@ Certificate::getId() const
return id;
}
#if GNUTLS_VERSION_NUMBER >= 0x030401
PkId
Certificate::getLongId() const
{
......@@ -657,6 +660,7 @@ Certificate::getLongId() const
throw CryptoException("Can't get certificate public key ID.");
return id;
}
#endif
static std::string
getDN(gnutls_x509_crt_t cert, const char* oid, bool issuer = false)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment