diff options
Diffstat (limited to 'system/Attic')
-rw-r--r-- | system/Attic/Attic.SlackBuild | 7 | ||||
-rw-r--r-- | system/Attic/openssl.diff | 59 |
2 files changed, 66 insertions, 0 deletions
diff --git a/system/Attic/Attic.SlackBuild b/system/Attic/Attic.SlackBuild index 05f6254f3a62..e721261435a7 100644 --- a/system/Attic/Attic.SlackBuild +++ b/system/Attic/Attic.SlackBuild @@ -73,6 +73,8 @@ cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION +# thanks void maintainers +patch -p1 -i $CWD/openssl.diff chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -80,6 +82,11 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +for _file in attic/*.pyx; do + rm ${_file/pyx/c} +done + +python3 setup.py sdist python3 setup.py install --root=$PKG find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ diff --git a/system/Attic/openssl.diff b/system/Attic/openssl.diff new file mode 100644 index 000000000000..7ebc0a9d3a7a --- /dev/null +++ b/system/Attic/openssl.diff @@ -0,0 +1,59 @@ +--- a/attic/crypto.pyx ++++ b/attic/crypto.pyx +@@ -23,8 +23,9 @@ cdef extern from "openssl/evp.h": + pass + const EVP_MD *EVP_sha256() + const EVP_CIPHER *EVP_aes_256_ctr() +- void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a) +- void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a) ++ EVP_CIPHER_CTX *EVP_CIPHER_CTX_new() ++ const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *a) ++ void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a) + + int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, + const unsigned char *key, const unsigned char *iv) +@@ -84,16 +85,16 @@ def get_random_bytes(n): + cdef class AES: + """A thin wrapper around the OpenSSL EVP cipher API + """ +- cdef EVP_CIPHER_CTX ctx ++ cdef EVP_CIPHER_CTX * ctx + + def __cinit__(self, key, iv=None): +- EVP_CIPHER_CTX_init(&self.ctx) +- if not EVP_EncryptInit_ex(&self.ctx, EVP_aes_256_ctr(), NULL, NULL, NULL): ++ self.ctx = EVP_CIPHER_CTX_new(); ++ if not EVP_EncryptInit_ex(self.ctx, EVP_aes_256_ctr(), NULL, NULL, NULL): + raise Exception('EVP_EncryptInit_ex failed') + self.reset(key, iv) + + def __dealloc__(self): +- EVP_CIPHER_CTX_cleanup(&self.ctx) ++ EVP_CIPHER_CTX_free(self.ctx) + + def reset(self, key=None, iv=None): + cdef const unsigned char *key2 = NULL +@@ -102,12 +103,12 @@ cdef class AES: + key2 = key + if iv: + iv2 = iv +- if not EVP_EncryptInit_ex(&self.ctx, NULL, NULL, key2, iv2): ++ if not EVP_EncryptInit_ex(self.ctx, NULL, NULL, key2, iv2): + raise Exception('EVP_EncryptInit_ex failed') + + @property + def iv(self): +- return self.ctx.iv[:16] ++ return EVP_CIPHER_CTX_iv(self.ctx)[:16] + + def encrypt(self, data): + cdef int inl = len(data) +@@ -116,7 +117,7 @@ cdef class AES: + if not out: + raise MemoryError + try: +- if not EVP_EncryptUpdate(&self.ctx, out, &outl, data, inl): ++ if not EVP_EncryptUpdate(self.ctx, out, &outl, data, inl): + raise Exception('EVP_EncryptUpdate failed') + return out[:inl] + finally: |