Gabriele Contini
2019-11-23 dabc496a2b86869b3e559a87efdd74af108a31f5
src/library/os/openssl/signature_verifier.cpp
File was renamed from src/library/os/linux/verifier.cpp
@@ -12,7 +12,7 @@
#include <public_key.h>
#include "../verifier.hpp"
#include "../signature_verifier.h"
namespace license {
#include "../../base/logger.h"
@@ -26,7 +26,7 @@
   }
}
Verifier::Verifier() {
static void initialize() {
   static int initialized = 0;
   if (initialized == 0) {
      initialized = 1;
@@ -36,13 +36,14 @@
   }
}
FUNCTION_RETURN Verifier::verifySignature(const std::string& stringToVerify, const std::string& signatureB64) {
FUNCTION_RETURN verify_signature(const std::string& stringToVerify, const std::string& signatureB64) {
   EVP_MD_CTX* mdctx = NULL;
   const unsigned char pubKey[] = PUBLIC_KEY;
   int func_ret = 0;
   initialize();
   BIO* bio = BIO_new_mem_buf((void*)(pubKey), PUBLIC_KEY_LEN);
   RSA* rsa = PEM_read_bio_RSAPublicKey(bio, NULL, NULL, NULL);
   BIO* bio = BIO_new_mem_buf((void*)(pubKey), sizeof(pubKey));
   RSA* rsa = d2i_RSAPublicKey_bio(bio, NULL);
   BIO_free(bio);
   if (rsa == NULL) {
      LOG_ERROR("Error reading public key");
@@ -97,9 +98,6 @@
   free_resources(pkey, mdctx);
   return result;
}
Verifier::~Verifier() {
}
} /* namespace license */