diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2014-09-05 10:45:21 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2014-09-05 10:45:21 +0300 |
commit | fc3192d1b98db57874f17f61f151db4dd56ccb82 (patch) | |
tree | cfeeac4d0cc6714979208559efcdf6dd7d30d153 /main/lua-ossl | |
parent | e863942c9a26d0c2e8f1f4693b97d058101b9e76 (diff) | |
download | aports-fc3192d1b98db57874f17f61f151db4dd56ccb82.tar.bz2 aports-fc3192d1b98db57874f17f61f151db4dd56ccb82.tar.xz |
main/lua-ossl: parse CRLs from PEM and DER formats
Diffstat (limited to 'main/lua-ossl')
-rw-r--r-- | main/lua-ossl/0001-parse-CRLs-from-PEM-and-DER-formats.patch | 61 | ||||
-rw-r--r-- | main/lua-ossl/APKBUILD | 12 |
2 files changed, 69 insertions, 4 deletions
diff --git a/main/lua-ossl/0001-parse-CRLs-from-PEM-and-DER-formats.patch b/main/lua-ossl/0001-parse-CRLs-from-PEM-and-DER-formats.patch new file mode 100644 index 0000000000..94539b2045 --- /dev/null +++ b/main/lua-ossl/0001-parse-CRLs-from-PEM-and-DER-formats.patch @@ -0,0 +1,61 @@ +From fd6efb22e98d51b441b9b4d9e440c099ba07ca4a Mon Sep 17 00:00:00 2001 +From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> +Date: Fri, 5 Sep 2014 10:38:43 +0300 +Subject: [PATCH] parse CRLs from PEM and DER formats + +--- + src/openssl.c | 33 ++++++++++++++++++++++++++++++--- + 1 file changed, 30 insertions(+), 3 deletions(-) + +diff --git a/src/openssl.c b/src/openssl.c +index 757bbf0..9845bcc 100644 +--- a/src/openssl.c ++++ b/src/openssl.c +@@ -3070,14 +3070,41 @@ int luaopen__openssl_x509_csr(lua_State *L) { + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + static int xx_new(lua_State *L) { ++ const char *data; ++ size_t len; + X509_CRL **ud; + ++ lua_settop(L, 2); ++ + ud = prepsimple(L, X509_CRL_CLASS); + +- if (!(*ud = X509_CRL_new())) +- return throwssl(L, "x509.crl.new"); ++ if ((data = luaL_optlstring(L, 1, NULL, &len))) { ++ int type = optencoding(L, 2, "*", X509_ANY|X509_PEM|X509_DER); ++ BIO *tmp; ++ int ok = 0; ++ ++ if (!(tmp = BIO_new_mem_buf((char *)data, len))) ++ return throwssl(L, "x509.crl.new"); ++ ++ if (type == X509_PEM || type == X509_ANY) { ++ ok = !!(*ud = PEM_read_bio_X509_CRL(tmp, NULL, 0, "")); /* no password */ ++ } ++ ++ if (!ok && (type == X509_DER || type == X509_ANY)) { ++ ok = !!(*ud = d2i_X509_CRL_bio(tmp, NULL)); ++ } + +- X509_gmtime_adj(X509_CRL_get_lastUpdate(*ud), 0); ++ BIO_free(tmp); ++ ++ if (!ok) ++ return throwssl(L, "x509.crl.new"); ++ } ++ else { ++ if (!(*ud = X509_CRL_new())) ++ return throwssl(L, "x509.crl.new"); ++ ++ X509_gmtime_adj(X509_CRL_get_lastUpdate(*ud), 0); ++ } + + return 1; + } /* xx_new() */ +-- +1.8.3.1 + diff --git a/main/lua-ossl/APKBUILD b/main/lua-ossl/APKBUILD index 6b46abe18c..fa1d9f9950 100644 --- a/main/lua-ossl/APKBUILD +++ b/main/lua-ossl/APKBUILD @@ -3,7 +3,7 @@ pkgname=lua-ossl pkgver=20140718 _ver=${pkgver%_git*} -pkgrel=0 +pkgrel=1 pkgdesc="comprehensive OpenSSL Lua module" url="http://25thandclement.com/~william/projects/luaossl.html" arch="all" @@ -15,6 +15,7 @@ install="" subpackages="" source="luaossl-$_ver.tar.gz::https://github.com/wahern/luaossl/archive/rel-$_ver.tar.gz musl-fixes.patch + 0001-parse-CRLs-from-PEM-and-DER-formats.patch " _builddir="$srcdir"/luaossl-rel-$_ver @@ -41,8 +42,11 @@ package() { } md5sums="38d7c4527580e03335299349be4d70bc luaossl-20140718.tar.gz -7d03f360ebc62b60279ff0f2066ed6f6 musl-fixes.patch" +7d03f360ebc62b60279ff0f2066ed6f6 musl-fixes.patch +0ec967f53f6abaac1c9143338811e160 0001-parse-CRLs-from-PEM-and-DER-formats.patch" sha256sums="5711dc079ecb2c01b6a5eb753839efbb599ee92ce0bd971ea55fe696d0bb39e0 luaossl-20140718.tar.gz -49694f9ab7f7a90074471d8e55580f13ff8fc6f7a158a5793f8d55df11147c0e musl-fixes.patch" +49694f9ab7f7a90074471d8e55580f13ff8fc6f7a158a5793f8d55df11147c0e musl-fixes.patch +227756f93b4db793dbbfbd05f576531a032c4c3e6356e91f774e7663101a16c9 0001-parse-CRLs-from-PEM-and-DER-formats.patch" sha512sums="5944ff745e08472e2be6b95c1fabdaaed46aeae8221d4e59fdbe8b8a4ee70368eb1d9cd39f619274a20151a46f5882445c89f69fc83cc54d812c01908ba1123d luaossl-20140718.tar.gz -370467081c87c0e4b0c96a72ff81918d3d492dfa90578b34f51004461d9a983ffd486accb44471a34d092b1a08743ad60462c6937096f80f72a39a335ccd81be musl-fixes.patch" +370467081c87c0e4b0c96a72ff81918d3d492dfa90578b34f51004461d9a983ffd486accb44471a34d092b1a08743ad60462c6937096f80f72a39a335ccd81be musl-fixes.patch +d01c2b5efc95d6ddd79456ce6bfcce366b2863a10dfaed48b7dbe6f881da318b2e69a93ca64bbdba6a1dadcabbbefd398569c37364e7f87331d307eed311d55c 0001-parse-CRLs-from-PEM-and-DER-formats.patch" |