automatic version update by autodist [release 20200106-1mamba;Thu Mar 14 2024]

This commit is contained in:
Automatic Build System 2025-01-04 17:43:20 +01:00
parent 9f2aa80074
commit cbf3305ec1
2 changed files with 7 additions and 97 deletions

View File

@ -1,90 +0,0 @@
diff --git a/tgl/crypto/rsa_pem_openssl.c b/tgl/crypto/rsa_pem_openssl.c
index db653f2..5e6a697 100644
--- a/tgl/crypto/rsa_pem_openssl.c
+++ b/tgl/crypto/rsa_pem_openssl.c
@@ -36,6 +36,12 @@ TGLC_WRAPPER_ASSOC(rsa,RSA)
// TODO: Refactor crucial struct-identity into its own header.
TGLC_WRAPPER_ASSOC(bn,BIGNUM)
+/*
+ * Since OpenSSL version 1.1.0 the RSA struct (rsa_st) is opaque,
+ * see also https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes
+ */
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
+
TGLC_rsa *TGLC_rsa_new (unsigned long e, int n_bytes, const unsigned char *n) {
RSA *ret = RSA_new ();
ret->e = unwrap_bn (TGLC_bn_new ());
@@ -47,7 +53,30 @@ TGLC_rsa *TGLC_rsa_new (unsigned long e, int n_bytes, const unsigned char *n) {
#define RSA_GETTER(M) \
TGLC_bn *TGLC_rsa_ ## M (TGLC_rsa *key) { \
return wrap_bn (unwrap_rsa (key)->M); \
- } \
+ }
+
+#else // OPENSSL_VERSION_NUMBER
+
+TGLC_rsa *TGLC_rsa_new (unsigned long e, int n_bytes, const unsigned char *n) {
+ RSA *ret = RSA_new ();
+ BIGNUM *ret_e = unwrap_bn (TGLC_bn_new ());
+ BIGNUM *ret_n = unwrap_bn (TGLC_bn_bin2bn (n, n_bytes, NULL));
+ RSA_set0_key (ret, ret_n, ret_e, NULL);
+ TGLC_bn_set_word (wrap_bn (ret_e), e);
+ return wrap_rsa (ret);
+}
+
+#define RSA_GETTER(M) \
+TGLC_bn *TGLC_rsa_ ## M (TGLC_rsa *key) { \
+ BIGNUM *rsa_n, *rsa_e, *rsa_d; \
+ RSA_get0_key(unwrap_rsa (key), \
+ (const BIGNUM **) &rsa_n, \
+ (const BIGNUM **) &rsa_e, \
+ (const BIGNUM **) &rsa_d); \
+ return wrap_bn (rsa_ ## M); \
+}
+
+#endif // OPENSSL_VERSION_NUMBER
RSA_GETTER(n);
RSA_GETTER(e);
@@ -60,4 +89,4 @@ TGLC_rsa *TGLC_pem_read_RSAPublicKey (FILE *fp) {
return wrap_rsa (PEM_read_RSAPublicKey (fp, NULL, NULL, NULL));
}
-#endif
+#endif // TGL_AVOID_OPENSSL
diff --git a/tgl/mtproto-utils.c b/tgl/mtproto-utils.c
index 0948bc8..cfdb216 100644
--- a/tgl/mtproto-utils.c
+++ b/tgl/mtproto-utils.c
@@ -98,7 +98,7 @@ static unsigned long long BN2ull (TGLC_bn *b) {
if (sizeof (unsigned long) == 8) {
return TGLC_bn_get_word (b);
} else if (sizeof (unsigned long long) == 8) {
- assert (0); // As long as nobody ever uses this code, assume it is broken.
+// assert (0); // As long as nobody ever uses this code, assume it is broken.
unsigned long long tmp;
/* Here be dragons, but it should be okay due to be64toh */
TGLC_bn_bn2bin (b, (unsigned char *) &tmp);
@@ -112,7 +112,7 @@ static void ull2BN (TGLC_bn *b, unsigned long long val) {
if (sizeof (unsigned long) == 8 || val < (1ll << 32)) {
TGLC_bn_set_word (b, val);
} else if (sizeof (unsigned long long) == 8) {
- assert (0); // As long as nobody ever uses this code, assume it is broken.
+// assert (0); // As long as nobody ever uses this code, assume it is broken.
htobe64(val);
/* Here be dragons, but it should be okay due to htobe64 */
TGLC_bn_bin2bn ((unsigned char *) &val, 8, b);
diff --git a/tgl/tl-parser/tl-parser.c b/tgl/tl-parser/tl-parser.c
index 524b196..aeadbd2 100644
--- a/tgl/tl-parser/tl-parser.c
+++ b/tgl/tl-parser/tl-parser.c
@@ -1903,7 +1903,7 @@ struct tl_combinator_tree *tl_parse_args134 (struct tree *T) {
//assert (S->data);
char *name = S->data;
if (!name) {
- static char s[20];
+ static char s[21];
sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());
name = s;
}

View File

@ -1,6 +1,6 @@
%define gittag %(echo %version | cut -d. -f3)
Name: telegram-cli
Version: 1.3.1.20220726git.7f8f739
Version: 20200106
Release: 1mamba
Summary: Telegram messenger CLI
Group: Applications/Communication
@ -8,9 +8,7 @@ Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/vysheng/tg
Source: https://github.com/kenorb-contrib/tg.git/master@%{gittag}/tg-%{version}.tar.bz2
#Source: https://github.com/vysheng/tg.git/master/tg-%{version}.tar.bz2
Patch0: telegram-cli-1.3.1.20171031git-fixes.patch
Source: https://github.com/kenorb-contrib/tg.git/%{version}/tg-%{version}.tar.bz2
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
@ -20,7 +18,6 @@ BuildRequires: libjansson-devel
BuildRequires: liblua-devel
BuildRequires: libopenssl-devel
BuildRequires: libreadline-devel
BuildRequires: libtermcap-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
@ -31,11 +28,11 @@ Telegram messenger CLI.
%prep
%setup -q -n tg-%{version}
#%patch0 -p1
%build
%configure \
LDFLAGS="-ltermcap"
CFLAGS="%{optflags} -L%{_libdir}" \
LDFLAGS="-L%{_libdir} -Wl,--allow-multiple-definition"
%make
@ -55,6 +52,9 @@ install -D -m0755 bin/telegram-cli %{buildroot}%{_bindir}/telegram-cli
%doc LICENSE
%changelog
* Thu Mar 14 2024 Automatic Build System <autodist@openmamba.org> 20200106-1mamba
- automatic version update by autodist
* Thu Sep 14 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 1.3.1.20220726git.7f8f739-1mamba
- update to 1.3.1.20220726git.7f8f739