gcontini
2019-12-07 74001fb4ce5041c3deb42a0ca252ae338aa571db
src/library/os/os.c
@@ -1,12 +1,12 @@
#include "os.h"
#include "../base/logger.h"
#include "public-key.h"
#include <public_key.h>
#include <stdio.h>
#ifndef _MSC_VER
#ifdef __linux__
#include <openssl/pem.h>
/*
static void free_resources(EVP_PKEY* pkey, EVP_MD_CTX* mdctx) {
   if (pkey) {
      EVP_PKEY_free(pkey);
@@ -14,12 +14,12 @@
   if (mdctx) {
      EVP_MD_CTX_destroy(mdctx);
   }
}
}*/
/*
FUNCTION_RETURN verifySignature(const char* stringToVerify,
      const char* signatureB64) {
   EVP_MD_CTX *mdctx = NULL;
   const char *pubKey = PUBLIC_KEY;
   const char pubKey[] = PUBLIC_KEY;
   int func_ret = 0;
   BIO* bio = BIO_new_mem_buf((void*) (pubKey), strlen(pubKey));
@@ -37,7 +37,7 @@
    RSA *key = 0;
    PEM_read_bio_RSAPublicKey(bo, &key, 0, 0);
    BIO_free(bo);*/
/*
//RSA* rsa = EVP_PKEY_get1_RSA( key );
//RSA * pubKey = d2i_RSA_PUBKEY(NULL, <der encoded byte stream pointer>, <num bytes>);
   unsigned char buffer[512];
@@ -52,7 +52,6 @@
   BIO_free_all(biosig);
   /* Create the Message Digest Context */
   if (!(mdctx = EVP_MD_CTX_create())) {
      free_resources(pkey, mdctx);
      LOG_ERROR("Error creating context");
@@ -79,12 +78,12 @@
   free_resources(pkey, mdctx);
   return result;
}
}*/
#else
#include <iphlpapi.h>
#include <Windows.h>
#include <windows.h>
#pragma comment(lib, "IPHLPAPI.lib")
unsigned char* unbase64(const char* ascii, int len, int *flen);