View | Details | Raw Unified | Return to bug 237560
Collapse All | Expand All

(-)Makefile (-4 / +5 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	attic
4
PORTNAME=	attic
5
PORTVERSION=	0.16
5
PORTVERSION=	0.16
6
PORTREVISION=	1
6
PORTREVISION=	2
7
CATEGORIES=	archivers python
7
CATEGORIES=	archivers python
8
MASTER_SITES=	CHEESESHOP
8
MASTER_SITES=	CHEESESHOP
9
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
9
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
Lines 15-28 Link Here
15
LICENSE=	BSD3CLAUSE
15
LICENSE=	BSD3CLAUSE
16
LICENSE_FILE=	${WRKSRC}/LICENSE
16
LICENSE_FILE=	${WRKSRC}/LICENSE
17
17
18
BROKEN_FreeBSD_12=	does not build with OpenSSL 1.1
18
DEPRECATED=	Unsupported by upstream, please migrate to archivers/py-borg. \
19
BROKEN_FreeBSD_13=	does not build with OpenSSL 1.1
19
		See https://borgbackup.readthedocs.io/en/stable/usage/upgrade.html\#borg-upgrade
20
EXPIRATION_DATE=	2019-09-01
20
21
21
BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}msgpack>=0.1.10:devel/py-msgpack@${PY_FLAVOR}
22
BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}msgpack>=0.1.10:devel/py-msgpack@${PY_FLAVOR}
22
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}msgpack>=0.1.10:devel/py-msgpack@${PY_FLAVOR}
23
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}msgpack>=0.1.10:devel/py-msgpack@${PY_FLAVOR}
23
24
24
USES=		python:3.3-3.6 ssl
25
USES=		python:3.3-3.6 ssl
25
USE_PYTHON=	autoplist distutils
26
USE_PYTHON=	autoplist cython distutils
26
27
27
PYDISTUTILS_BUILDPATH=${BUILD_WRKSRC}/build/lib.${OPSYS:tl}-${UNAMER}-${ARCH}-${PYTHON_VER}
28
PYDISTUTILS_BUILDPATH=${BUILD_WRKSRC}/build/lib.${OPSYS:tl}-${UNAMER}-${ARCH}-${PYTHON_VER}
28
REINPLACE_ARGS=	-i ''
29
REINPLACE_ARGS=	-i ''
(-)files/patch-attic_crypto.pyx (+59 lines)
Line 0 Link Here
1
--- attic/crypto.pyx.orig	2015-04-27 20:15:50 UTC
2
+++ attic/crypto.pyx
3
@@ -23,8 +23,9 @@ cdef extern from "openssl/evp.h":
4
         pass
5
     const EVP_MD *EVP_sha256()
6
     const EVP_CIPHER *EVP_aes_256_ctr()
7
-    void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a)
8
-    void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a)
9
+    EVP_CIPHER_CTX *EVP_CIPHER_CTX_new()
10
+    const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *a)
11
+    void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a)
12
 
13
     int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl,
14
                            const unsigned char *key, const unsigned char *iv)
15
@@ -84,16 +85,16 @@ def get_random_bytes(n):
16
 cdef class AES:
17
     """A thin wrapper around the OpenSSL EVP cipher API
18
     """
19
-    cdef EVP_CIPHER_CTX ctx
20
+    cdef EVP_CIPHER_CTX * ctx
21
 
22
     def __cinit__(self, key, iv=None):
23
-        EVP_CIPHER_CTX_init(&self.ctx)
24
-        if not EVP_EncryptInit_ex(&self.ctx, EVP_aes_256_ctr(), NULL, NULL, NULL):
25
+        self.ctx = EVP_CIPHER_CTX_new();
26
+        if not EVP_EncryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, NULL, NULL):
27
             raise Exception('EVP_EncryptInit_ex failed')
28
         self.reset(key, iv)
29
 
30
     def __dealloc__(self):
31
-        EVP_CIPHER_CTX_cleanup(&self.ctx)
32
+        EVP_CIPHER_CTX_free(self.ctx)
33
 
34
     def reset(self, key=None, iv=None):
35
         cdef const unsigned char *key2 = NULL
36
@@ -102,12 +103,12 @@ cdef class AES:
37
             key2 = key
38
         if iv:
39
             iv2 = iv
40
-        if not EVP_EncryptInit_ex(&self.ctx, NULL, NULL, key2, iv2):
41
+        if not EVP_EncryptInit_ex(self.ctx, NULL, NULL, key2, iv2):
42
             raise Exception('EVP_EncryptInit_ex failed')
43
 
44
     @property
45
     def iv(self):
46
-        return self.ctx.iv[:16]
47
+        return EVP_CIPHER_CTX_iv(self.ctx)[:16]
48
 
49
     def encrypt(self, data):
50
         cdef int inl = len(data)
51
@@ -116,7 +117,7 @@ cdef class AES:
52
         if not out:
53
             raise MemoryError
54
         try:
55
-            if not EVP_EncryptUpdate(&self.ctx, out, &outl, data, inl):
56
+            if not EVP_EncryptUpdate(self.ctx, out, &outl, data, inl):
57
                 raise Exception('EVP_EncryptUpdate failed')
58
             return out[:inl]
59
         finally:

Return to bug 237560