From f5106362b82b035dcd8e487d755316e886de3440 Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周六, 23 11月 2019 22:48:18 +0800 Subject: [PATCH] signature verified, tests --- src/library/os/os.c | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/library/os/os.c b/src/library/os/os.c index ad4803b..ed602ac 100644 --- a/src/library/os/os.c +++ b/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> #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,7 +78,7 @@ free_resources(pkey, mdctx); return result; -} +}*/ #else -- Gitblit v1.9.1