CPPFLAGS += $(osl_cppflags)
$(call OD, compress_filter): CFLAGS += -O3
+$(call OD, openssl): CFLAGS += -Wno-deprecated-declarations
+$(object_dir)/%.o: %.c | $(object_dir) $(dep_dir) $(lsg_h) $(yy_h)
define CC_CMD
$(call SAY, CC $<)
$(CC) -c -o $(object_dir)/$(*F).o -MMD -MF \
the startup mood and the time period before fade-out starts. A bunch
of further improvements for this subcommand went in as well.
- Minor cleanup of the net subsystem.
+- The openssl specific code now employs the EVP API to compute hashes.
+ It should compile without warnings against openssl-3.
Downloads:
[tarball](./releases/paraslash-git.tar.xz)
#include <openssl/sha.h>
#include <openssl/bn.h>
#include <openssl/aes.h>
+#include <openssl/evp.h>
#include "para.h"
#include "error.h"
void hash_function(const char *data, unsigned long len, unsigned char *hash)
{
- SHA_CTX c;
- SHA1_Init(&c);
- SHA1_Update(&c, data, len);
- SHA1_Final(hash, &c);
+ EVP_MD_CTX *c = EVP_MD_CTX_new();
+ int ret = EVP_DigestInit_ex(c, EVP_sha1(), NULL);
+ assert(ret != 0);
+ ret = EVP_DigestUpdate(c, data, len);
+ assert(ret != 0);
+ ret = EVP_DigestFinal_ex(c, hash, NULL);
+ assert(ret != 0);
+ EVP_MD_CTX_free(c);
}
void hash2_function(const char *data, unsigned long len, unsigned char *hash)
{
- SHA256_CTX c;
- SHA256_Init(&c);
- SHA256_Update(&c, data, len);
- SHA256_Final(hash, &c);
+ EVP_MD_CTX *c = EVP_MD_CTX_new();
+ int ret = EVP_DigestInit_ex(c, EVP_sha256(), NULL);
+ assert(ret != 0);
+ ret = EVP_DigestUpdate(c, data, len);
+ assert(ret != 0);
+ ret = EVP_DigestFinal_ex(c, hash, NULL);
+ assert(ret != 0);
+ EVP_MD_CTX_free(c);
}