--- ghasher-1.2.1-patched1/ghasher.h 2005-11-22 18:23:33.000000000 +0100 +++ ghasher-1.2.1-patched1/ghasher.h 2026-10-18 14:58:21.430261761 +0200 @@ -27,7 +27,7 @@ struct GHApp { struct SumContext { struct GHApp *app; - EVP_MD_CTX ctx; + EVP_MD_CTX *ctx; const EVP_MD *md; int currentfile; struct stat statbuf; --- ghasher-1.2.1-patched1/gui.c 2005-11-22 18:25:01.000000000 +0100 +++ ghasher-1.2.1-patched1/gui.c 2026-10-18 14:58:21.430456909 +0200 @@ -58,19 +58,19 @@ static void destroy_sum_context(struct S /*openssl prior to 0.9.7 needs a Final else we leak memory afaik, above 0.9.7 openssl provides a _cleanup function. */ #if OPENSSL_VERSION_NUMBER < 0x00907000L - EVP_DigestFinal(&s_ctx->ctx, b, &md_len); + EVP_DigestFinal(s_ctx->ctx, b, &md_len); #endif if (s_ctx->allok) { #if OPENSSL_VERSION_NUMBER >= 0x00907000L - EVP_DigestFinal(&s_ctx->ctx, b, &md_len); + EVP_DigestFinal(s_ctx->ctx, b, &md_len); #endif hex_dump(b, md_len, b_hex, md_len * 2 + 1); set_hashfield(GTK_TREE_VIEW(s_ctx->app->listview), b_hex, g_ptr_array_index(s_ctx->app->files, s_ctx->app->currentfile - 1)); } #if OPENSSL_VERSION_NUMBER >= 0x00907000L - EVP_MD_CTX_cleanup(&s_ctx->ctx); + EVP_MD_CTX_free(s_ctx->ctx); #endif g_free(s_ctx); } @@ -103,13 +103,15 @@ struct SumContext *new_sum_context(struc } - EVP_DigestInit(&s_ctx->ctx, s_ctx->md); + s_ctx->ctx = EVP_MD_CTX_new(); + EVP_DigestInit(s_ctx->ctx, s_ctx->md); s_ctx->currentfile = open(filename, O_RDONLY); if (s_ctx->currentfile < 0) { gchar *error; error = g_strdup_printf("Failed: %s", g_strerror(errno)); set_hashfield(GTK_TREE_VIEW(app->listview), error, g_ptr_array_index(app->files, app->currentfile)); g_free(error); + EVP_MD_CTX_free(s_ctx->ctx); g_free(s_ctx); return NULL; @@ -160,7 +162,7 @@ static gboolean hash_some(struct SumCont ret = read(s_ctx->currentfile, buffer, s_ctx->statbuf.st_blksize * BLOCKSZ); if (ret > 0) { - EVP_DigestUpdate(&s_ctx->ctx, buffer, (unsigned long) ret); + EVP_DigestUpdate(s_ctx->ctx, buffer, (unsigned long) ret); s_ctx->read_acc += (off_t) ret; } else if (ret == 0) { s_ctx->allok = TRUE;