[arch-commits] Commit in bzrtp/trunk (PKGBUILD mbedtls2.patch)
Sergej Pupykin
spupykin at archlinux.org
Mon Sep 21 19:25:19 UTC 2015
Date: Monday, September 21, 2015 @ 21:25:19
Author: spupykin
Revision: 141403
Modified:
bzrtp/trunk/PKGBUILD
bzrtp/trunk/mbedtls2.patch
----------------+
PKGBUILD | 2 +-
mbedtls2.patch | 52 ++++++++++++++++++++++++++++++++++++++++++----------
2 files changed, 43 insertions(+), 11 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2015-09-21 19:25:07 UTC (rev 141402)
+++ PKGBUILD 2015-09-21 19:25:19 UTC (rev 141403)
@@ -15,7 +15,7 @@
mbedtls2.patch)
md5sums=('b52fa670fb319022166cb10d641da4e6'
'SKIP'
- 'a644dda812e1535523068e42e6882a0b')
+ 'a5c77d9bcfda0aed17572a32b4cab69d')
prepare() {
cd ${pkgname}-${pkgver}
Modified: mbedtls2.patch
===================================================================
--- mbedtls2.patch 2015-09-21 19:25:07 UTC (rev 141402)
+++ mbedtls2.patch 2015-09-21 19:25:19 UTC (rev 141403)
@@ -1,6 +1,18 @@
-diff -wbBur bzrtp-1.0.2.org/configure.ac bzrtp-1.0.2/configure.ac
---- bzrtp-1.0.2.org/configure.ac 2015-05-07 18:45:29.000000000 +0300
-+++ bzrtp-1.0.2/configure.ac 2015-07-30 15:19:26.965083810 +0300
+diff -wbBur bzrtp-1.0.2/configure bzrtp-1.0.2,my/configure
+--- bzrtp-1.0.2/configure 2015-05-07 18:49:06.000000000 +0300
++++ bzrtp-1.0.2,my/configure 2015-09-21 22:13:24.471826101 +0300
+@@ -12488,7 +12488,7 @@
+ POLARSSL_LIBS="-L${polarssl_prefix}/lib"
+ fi
+
+-POLARSSL_LIBS="$POLARSSL_LIBS -lpolarssl"
++POLARSSL_LIBS="$POLARSSL_LIBS -lmbedtls"
+
+
+
+diff -wbBur bzrtp-1.0.2/configure.ac bzrtp-1.0.2,my/configure.ac
+--- bzrtp-1.0.2/configure.ac 2015-05-07 18:45:29.000000000 +0300
++++ bzrtp-1.0.2,my/configure.ac 2015-09-21 22:13:00.985159704 +0300
@@ -42,7 +42,7 @@
POLARSSL_LIBS="-L${polarssl_prefix}/lib"
fi
@@ -10,9 +22,9 @@
AC_SUBST(POLARSSL_LIBS)
AC_SUBST(POLARSSL_CFLAGS)
-diff -wbBur bzrtp-1.0.2.org/src/cryptoPolarssl.c bzrtp-1.0.2/src/cryptoPolarssl.c
---- bzrtp-1.0.2.org/src/cryptoPolarssl.c 2015-05-07 18:14:36.000000000 +0300
-+++ bzrtp-1.0.2/src/cryptoPolarssl.c 2015-07-30 15:18:40.811751008 +0300
+diff -wbBur bzrtp-1.0.2/src/cryptoPolarssl.c bzrtp-1.0.2,my/src/cryptoPolarssl.c
+--- bzrtp-1.0.2/src/cryptoPolarssl.c 2015-05-07 18:14:36.000000000 +0300
++++ bzrtp-1.0.2,my/src/cryptoPolarssl.c 2015-09-21 22:21:04.521820813 +0300
@@ -25,17 +25,18 @@
#include <string.h>
@@ -25,7 +37,7 @@
/* Hash function sha1(sha2 is different for polarssl v1.2 and v1.3 ) */
-#include "polarssl/sha1.h"
-+#include "mbedtls/sha1.h"
++#include "mbedtls/md.h"
/* Asymmetrics encryption */
-#include "polarssl/dhm.h"
@@ -47,7 +59,17 @@
return NULL;
}
-@@ -396,11 +398,11 @@
+@@ -183,7 +185,8 @@
+ uint8_t *output)
+ {
+ uint8_t hmacOutput[20];
+- sha1_hmac(key, keyLength, input, inputLength, hmacOutput);
++ const mbedtls_md_info_t *mdinfo = mbedtls_md_info_from_type(MBEDTLS_MD_SHA1);
++ mbedtls_md_hmac(mdinfo, key, keyLength, input, inputLength, hmacOutput);
+
+ /* check output length, can't be>20 */
+ if (hmacLength>20) {
+@@ -396,11 +399,11 @@
/*** End of code common to polarSSL version 1.2 and 1.3 ***/
/* check polarssl version */
@@ -61,7 +83,17 @@
/*
* @brief SHA256 wrapper
-@@ -464,7 +466,7 @@
+@@ -444,7 +447,8 @@
+ uint8_t *output)
+ {
+ uint8_t hmacOutput[32];
+- sha256_hmac(key, keyLength, input, inputLength, hmacOutput, 0); /* last param to zero to select SHA256 and not SHA224 */
++ const mbedtls_md_info_t *mdinfo = mbedtls_md_info_from_type(MBEDTLS_MD_SHA256);
++ mbedtls_md_hmac(mdinfo, key, keyLength, input, inputLength, hmacOutput);
+
+ /* check output length, can't be>32 */
+ if (hmacLength>32) {
+@@ -464,7 +468,7 @@
/* compute the secret key */
keyLength = context->primeLength; /* undocumented but this value seems to be in/out, so we must set it to the expected key length */
context->key = (uint8_t *)malloc(keyLength*sizeof(uint8_t)); /* allocate key buffer */
@@ -70,7 +102,7 @@
}
-@@ -472,7 +474,7 @@
+@@ -472,7 +476,7 @@
#else /* POLAR SSL VERSION 1.2 */
/* Hashs */
More information about the arch-commits
mailing list