View | Details | Raw Unified | Return to bug 246273 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/aimage/Makefile (-8 / +1 lines)
Lines 23-33 Link Here
23
23
24
PLIST_FILES=	bin/aimage
24
PLIST_FILES=	bin/aimage
25
25
26
.include <bsd.port.pre.mk>
26
.include <bsd.port.mk>
27
28
.if ${SSL_DEFAULT} == base
29
BROKEN_FreeBSD_12=	error: field has incomplete type 'EVP_MD_CTX' (aka 'evp_md_ctx_st')
30
BROKEN_FreeBSD_13=	error: field has incomplete type 'EVP_MD_CTX' (aka 'evp_md_ctx_st')
31
.endif
32
33
.include <bsd.port.post.mk>
(-)sysutils/aimage/files/patch-src_hash__t.h (+47 lines)
Line 0 Link Here
1
--- src/hash_t.h.orig	2011-08-17 23:33:08 UTC
2
+++ src/hash_t.h
3
@@ -160,7 +160,7 @@ typedef hash__<sha512_> sha512_t;
4
 template<typename T> 
5
 class hash_generator__:T { 			/* generates the hash */
6
     const EVP_MD *md;
7
-    EVP_MD_CTX mdctx;	     /* the context for computing the value */
8
+    EVP_MD_CTX *mdctx;	     /* the context for computing the value */
9
     bool initialized;	       /* has the context been initialized? */
10
     bool finalized;
11
     /* Static function to determine if something is zero */
12
@@ -189,8 +189,8 @@ class hash_generator__:T { 			/* generates the hash */
13
     }
14
     void init(){
15
 	if(initialized==false){
16
-	    EVP_MD_CTX_init(&mdctx);
17
-	    EVP_DigestInit_ex(&mdctx, md, NULL);
18
+	    mdctx = EVP_MD_CTX_create();
19
+	    EVP_DigestInit_ex(mdctx, md, NULL);
20
 	    initialized = true;
21
 	    finalized = false;
22
 	    hashed_bytes = 0;
23
@@ -202,12 +202,13 @@ class hash_generator__:T { 			/* generates the hash */
24
 	    std::cerr << "hashgen_t::update called after finalized\n";
25
 	    exit(1);
26
 	}
27
-	EVP_DigestUpdate(&mdctx,buf,bufsize);
28
+	EVP_DigestUpdate(mdctx,buf,bufsize);
29
 	hashed_bytes += bufsize;
30
     }
31
     void release(){			/* free allocated memory */
32
 	if(initialized){
33
-	    EVP_MD_CTX_cleanup(&mdctx);
34
+	    EVP_MD_CTX_destroy(mdctx);
35
+	    mdctx = NULL;
36
 	    initialized = false;
37
 	    hashed_bytes = 0;
38
 	}
39
@@ -223,7 +224,7 @@ class hash_generator__:T { 			/* generates the hash */
40
 	}
41
 	hash__<T> val;
42
 	unsigned int len = sizeof(val.digest);
43
-	EVP_DigestFinal(&mdctx,val.digest,&len);
44
+	EVP_DigestFinal(mdctx,val.digest,&len);
45
 	finalized = true;
46
 	return val;
47
     }

Return to bug 246273