Skip to content

Commit

Permalink
dep/jwt-cpp: Update to latest commit
Browse files Browse the repository at this point in the history
Update to 4620bf43befea5ef69816fb8610723232a609030.
This fixes a Wunused-private-field warning reported in Thalhammer/jwt-cpp#134
  • Loading branch information
Carbenium committed Apr 11, 2021
1 parent 9f643dd commit 008e07d
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions dep/jwt-cpp/include/jwt-cpp/jwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -1049,9 +1049,10 @@ namespace jwt {
/**
* \brief Base class for EdDSA family of algorithms
*
* The EdDSA algorithms were introduced in [OpenSSL
* v1.1.1](https://www.openssl.org/news/openssl-1.1.1-notes.html), so these algorithms are only available when
* building against this version or higher.
* https://tools.ietf.org/html/rfc8032
*
* The EdDSA algorithms were introduced in [OpenSSL v1.1.1](https://www.openssl.org/news/openssl-1.1.1-notes.html),
* so these algorithms are only available when building against this version or higher.
*/
struct eddsa {
/**
Expand All @@ -1062,12 +1063,11 @@ namespace jwt {
* \param public_key_password Password to decrypt public key pem.
* \param private_key_password Password
* to decrypt private key pem.
* \param md Pointer to hash function
* \param name Name of the algorithm
*/
eddsa(const std::string& public_key, const std::string& private_key, const std::string& public_key_password,
const std::string& private_key_password, const EVP_MD* (*md)(), std::string name)
: md(md), alg_name(std::move(name)) {
const std::string& private_key_password, std::string name)
: alg_name(std::move(name)) {
if (!private_key.empty()) {
pkey = helper::load_private_key_from_string(private_key, private_key_password);
} else if (!public_key.empty()) {
Expand Down Expand Up @@ -1173,8 +1173,6 @@ namespace jwt {
private:
/// OpenSSL struct containing keys
std::shared_ptr<EVP_PKEY> pkey;
/// Hash generator
const EVP_MD* (*md)();
/// algorithm's name
const std::string alg_name;
};
Expand Down Expand Up @@ -1453,6 +1451,8 @@ namespace jwt {
/**
* Ed25519 algorithm
*
* https://en.wikipedia.org/wiki/EdDSA#Ed25519
*
* Requires at least OpenSSL 1.1.1.
*/
struct ed25519 : public eddsa {
Expand All @@ -1467,12 +1467,14 @@ namespace jwt {
*/
explicit ed25519(const std::string& public_key, const std::string& private_key = "",
const std::string& public_key_password = "", const std::string& private_key_password = "")
: eddsa(public_key, private_key, public_key_password, private_key_password, EVP_sha512, "EdDSA") {}
: eddsa(public_key, private_key, public_key_password, private_key_password, "EdDSA") {}
};

/**
* Ed448 algorithm
*
* https://en.wikipedia.org/wiki/EdDSA#Ed448
*
* Requires at least OpenSSL 1.1.1.
*/
struct ed448 : public eddsa {
Expand All @@ -1487,7 +1489,7 @@ namespace jwt {
*/
explicit ed448(const std::string& public_key, const std::string& private_key = "",
const std::string& public_key_password = "", const std::string& private_key_password = "")
: eddsa(public_key, private_key, public_key_password, private_key_password, EVP_sha256, "EdDSA") {}
: eddsa(public_key, private_key, public_key_password, private_key_password, "EdDSA") {}
};
#endif

Expand Down

0 comments on commit 008e07d

Please sign in to comment.