summaryrefslogtreecommitdiffstats
path: root/libraries
diff options
context:
space:
mode:
author С. С. Болоканаръ <bolokanar@bulgars.org>2025-06-05 12:01:42 +0300
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2025-06-06 23:32:18 +0700
commit379cb812883fbf8af0e783dfd0ff6c4b945760ec (patch)
treed6755f3435ee5175c888e41b6898799eb1bd29ba /libraries
parentddfa3290e6212972e82ba8b5c3a3ae82eb0f1b37 (diff)
downloadslackbuilds-379cb812883fbf8af0e783dfd0ff6c4b945760ec.tar.gz
slackbuilds-379cb812883fbf8af0e783dfd0ff6c4b945760ec.tar.xz
libraries/liboauth: openssl-1.1.x patch rebase.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries')
-rw-r--r--libraries/liboauth/liboauth-1.0.3-openssl-1.1.0-3.patch (renamed from libraries/liboauth/liboauth-1.0.3-openssl-1.1.0-2.patch)43
-rw-r--r--libraries/liboauth/liboauth.SlackBuild4
2 files changed, 26 insertions, 21 deletions
diff --git a/libraries/liboauth/liboauth-1.0.3-openssl-1.1.0-2.patch b/libraries/liboauth/liboauth-1.0.3-openssl-1.1.0-3.patch
index eafd3eb9bf..a6ff453def 100644
--- a/libraries/liboauth/liboauth-1.0.3-openssl-1.1.0-2.patch
+++ b/libraries/liboauth/liboauth-1.0.3-openssl-1.1.0-3.patch
@@ -1,20 +1,24 @@
-Submitted by: DJ Lucas (dj_AT_linuxfromscratch_DOT_org)
+Submitted by: DJ Lucas (dj at linuxfromscratch dot org)
Date: 2017-05-27
Initial Package Version: 1.0.3
Update by: Bruce Dubbs
Date: 2017-06-14
+Update by (#2): Douglas R. Reno <renodr at linuxfromscratch dot org>
+Date: 2019-01-02
Upstream Status: Submitted
Origin: https://github.com/x42/liboauth/issues/9
-Description: Fixes build issue with OpenSSL-1.1.0.
-Update: Additional fix from upstream. Three lines changed.
+Description: Fixes build issue with OpenSSL_1.1.0.
+Update: Additional fix from upstream. Three lines changed.
+Update #2: Rebased patch, and fixed one more missed reference to md_ctx.
-diff -Naurp liboauth-1.0.3-orig/src/hash.c liboauth-1.0.3/src/hash.c
---- liboauth-1.0.3-orig/src/hash.c 2013-10-04 08:02:50.000000000 -0500
-+++ liboauth-1.0.3/src/hash.c 2017-05-27 00:51:04.708633351 -0500
-@@ -362,6 +362,11 @@ looser:
+diff -Naurp liboauth-1.0.3.orig/src/hash.c liboauth-1.0.3/src/hash.c
+--- liboauth-1.0.3.orig/src/hash.c 2013-10-04 08:02:50.000000000 -0500
++++ liboauth-1.0.3/src/hash.c 2019-01-01 23:41:47.027037421 -0600
+@@ -362,6 +362,12 @@ looser:
#include "oauth.h" // base64 encode fn's.
#include <openssl/hmac.h>
++
+#if OPENSSL_VERSION_NUMBER < 0x10100000
+#define EVP_MD_CTX_new EVP_MD_CTX_create
+#define EVP_MD_CTX_free EVP_MD_CTX_destroy
@@ -23,7 +27,7 @@ diff -Naurp liboauth-1.0.3-orig/src/hash.c liboauth-1.0.3/src/hash.c
char *oauth_sign_hmac_sha1 (const char *m, const char *k) {
return(oauth_sign_hmac_sha1_raw (m, strlen(m), k, strlen(k)));
}
-@@ -386,7 +391,7 @@ char *oauth_sign_rsa_sha1 (const char *m
+@@ -386,7 +392,7 @@ char *oauth_sign_rsa_sha1 (const char *m
unsigned char *sig = NULL;
unsigned char *passphrase = NULL;
unsigned int len=0;
@@ -32,13 +36,13 @@ diff -Naurp liboauth-1.0.3-orig/src/hash.c liboauth-1.0.3/src/hash.c
EVP_PKEY *pkey;
BIO *in;
-@@ -399,24 +404,31 @@ char *oauth_sign_rsa_sha1 (const char *m
+@@ -399,24 +405,31 @@ char *oauth_sign_rsa_sha1 (const char *m
return xstrdup("liboauth/OpenSSL: can not read private key");
}
+ md_ctx = EVP_MD_CTX_new();
+ if (md_ctx == NULL) {
-+ return xstrdup("liboauth/OpenSSL: failed to allocate EVP_MD_CTX");
++ return xstrdup("liboauth/OpenSSL: failed to allocate EVP_MD_CTX");
+ }
+
len = EVP_PKEY_size(pkey);
@@ -68,15 +72,16 @@ diff -Naurp liboauth-1.0.3-orig/src/hash.c liboauth-1.0.3/src/hash.c
EVP_PKEY *pkey;
BIO *in;
X509 *cert = NULL;
-@@ -437,13 +449,18 @@ int oauth_verify_rsa_sha1 (const char *m
+@@ -437,13 +450,19 @@ int oauth_verify_rsa_sha1 (const char *m
return -2;
}
-+ md_ctx = EVP_MD_CTX_new();
-+ if (md_ctx == NULL) {
-+ return -2;
-+ }
+
++ md_ctx = EVP_MD_CTX_new();
++ if (md_ctx == NULL) {
++ return -2;
++ }
++
b64d= (unsigned char*) xmalloc(sizeof(char)*strlen(s));
slen = oauth_decode_base64(b64d, s);
@@ -87,11 +92,11 @@ diff -Naurp liboauth-1.0.3-orig/src/hash.c liboauth-1.0.3/src/hash.c
+ EVP_VerifyInit(md_ctx, EVP_sha1());
+ EVP_VerifyUpdate(md_ctx, m, strlen(m));
+ err = EVP_VerifyFinal(md_ctx, b64d, slen, pkey);
-+ EVP_MD_CTX_free(pkey);
++ EVP_MD_CTX_free(md_ctx);
EVP_PKEY_free(pkey);
xfree(b64d);
return (err);
-@@ -455,35 +472,41 @@ int oauth_verify_rsa_sha1 (const char *m
+@@ -455,35 +474,41 @@ int oauth_verify_rsa_sha1 (const char *m
*/
char *oauth_body_hash_file(char *filename) {
unsigned char fb[BUFSIZ];
@@ -106,7 +111,7 @@ diff -Naurp liboauth-1.0.3-orig/src/hash.c liboauth-1.0.3/src/hash.c
- EVP_DigestInit(&ctx,EVP_sha1());
+ ctx = EVP_MD_CTX_new();
+ if (ctx == NULL) {
-+ return xstrdup("liboauth/OpenSSL: failed to allocate EVP_MD_CTX");
++ return xstrdup("liboauth/OpenSSL: failed to allocate EVP_MD_CTX");
+ }
+ EVP_DigestInit(ctx,EVP_sha1());
while (!feof(F) && (len=fread(fb,sizeof(char),BUFSIZ, F))>0) {
@@ -136,7 +141,7 @@ diff -Naurp liboauth-1.0.3-orig/src/hash.c liboauth-1.0.3/src/hash.c
- EVP_MD_CTX_cleanup(&ctx);
+ ctx = EVP_MD_CTX_new();
+ if (ctx == NULL) {
-+ return xstrdup("liboauth/OpenSSL: failed to allocate EVP_MD_CTX");
++ return xstrdup("liboauth/OpenSSL: failed to allocate EVP_MD_CTX");
+ }
+ EVP_DigestInit(ctx,EVP_sha1());
+ EVP_DigestUpdate(ctx, data, length);
diff --git a/libraries/liboauth/liboauth.SlackBuild b/libraries/liboauth/liboauth.SlackBuild
index 38893e0d55..cf4be82ca7 100644
--- a/libraries/liboauth/liboauth.SlackBuild
+++ b/libraries/liboauth/liboauth.SlackBuild
@@ -33,7 +33,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=liboauth
VERSION=${VERSION:-1.0.3}
-BUILD=${BUILD:-5}
+BUILD=${BUILD:-6}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -99,7 +99,7 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
# port to openssl-1.1.x
-patch -p1 < $CWD/liboauth-1.0.3-openssl-1.1.0-2.patch
+patch -p1 < $CWD/liboauth-1.0.3-openssl-1.1.0-3.patch
# compile in clean dir
mkdir -v build