More OpenSSL adjustments.

parent 2ac2f005
......@@ -7,6 +7,7 @@
#include <arc/Base64.h>
#include <arc/Logger.h>
#include <arc/external/cJSON/cJSON.h>
#include <arc/crypto/OpenSSL.h>
#include "otokens.h"
#include "jwse_private.h"
......@@ -28,6 +29,8 @@ namespace Arc {
char const* const JWSE::HeaderNameEncryption = "enc";
JWSE::JWSE(): valid_(false), header_(NULL, &cJSON_Delete) {
OpenSSLInit();
header_ = cJSON_CreateObject();
if(!header_)
return;
......@@ -41,6 +44,8 @@ namespace Arc {
}
JWSE::JWSE(std::string const& jwseCompact): valid_(false), header_(NULL, &cJSON_Delete) {
OpenSSLInit();
(void)Input(jwseCompact);
}
......
......@@ -38,7 +38,7 @@ namespace Arc {
return false;
}
rc = 0;
for(int n = 0; n < signatureSize; ++n) rc |= (reinterpret_cast<unsigned char const*>(signature))[n] ^ buffer.Ptr()[n];
for(unsigned int n = 0; n < signatureSize; ++n) rc |= (reinterpret_cast<unsigned char const*>(signature))[n] ^ buffer.Ptr()[n];
std::memset(buffer.Ptr(), 0, signatureSize);
if(rc != 1) return false;
return true;
......
......@@ -12,7 +12,6 @@
#include <openssl/pem.h>
#include <openssl/rsa.h>
#include <openssl/bn.h>
#include <openssl/rsa.h>
#include "otokens.h"
#include "jwse_private.h"
......
......@@ -5,6 +5,10 @@
#include <arc/Utils.h>
#include <arc/external/cJSON/cJSON.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/rsa.h>
#include <openssl/bn.h>
#include "otokens.h"
#include "jwse_private.h"
......
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