void-packages/srcpkgs/sssd/patches/libressl.patch
Đoàn Trần Công Danh 4b97cd2fb4 srcpkgs/s*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

26 lines
1.2 KiB
Diff

diff -Naurp0 a/p11_child/p11_child_openssl.c b/p11_child/p11_child_openssl.c
--- a/src/p11_child/p11_child_openssl.c 2020-09-06 16:39:47.663132167 +0200
+++ b/src/p11_child/p11_child_openssl.c 2020-09-06 16:39:51.887060887 +0200
@@ -33,0 +34 @@
+#include <limits.h>
diff -Naurp0 a/util/crypto/libcrypto/crypto_hmac_sha1.c b/util/crypto/libcrypto/crypto_hmac_sha1.c
--- a/src/util/crypto/libcrypto/crypto_hmac_sha1.c 2020-09-06 16:39:47.705131458 +0200
+++ b/src/util/crypto/libcrypto/crypto_hmac_sha1.c 2020-09-06 16:39:51.870061174 +0200
@@ -19,0 +20 @@
+#include <limits.h>
--- a/src/lib/certmap/sss_cert_content_crypto.c 2020-10-12 12:16:19.000000000 +0200
+++ b/src/lib/certmap/sss_cert_content_crypto.c 2020-10-12 12:16:19.000000000 +0200
@@ -771,8 +771,13 @@
ret = EIO;
goto done;
}
+#ifdef LIBRESSL_VERSION_NUMBER
+ if (cert->ex_flags & EXFLAG_KUSAGE) {
+ cont->key_usage = cert->ex_kusage;
+#else
if ((X509_get_extension_flags(cert) & EXFLAG_KUSAGE)) {
cont->key_usage = X509_get_key_usage(cert);
+#endif
} else {
/* According to X.509 https://www.itu.int/rec/T-REC-X.509-201610-I
* section 13.3.2 "Certificate match" "keyUsage matches if all of the