Revert "[wpa_supplicant] cumilative patch from commit 3a5d1a7e6"
Revert submission 26533062-Supplicant_merge_June24
Reason for revert: https://b.corp.google.com/issues/349780869
Reverted changes: /q/submissionid:26533062-Supplicant_merge_June24
Change-Id: I4a7a5b8ccb6b4822353bacc29649587cd5a3cb80
diff --git a/src/tls/libtommath.c b/src/tls/libtommath.c
index ed595bd..7156744 100644
--- a/src/tls/libtommath.c
+++ b/src/tls/libtommath.c
@@ -59,6 +59,14 @@
/* from tommath.h */
+#ifndef MIN
+ #define MIN(x,y) ((x)<(y)?(x):(y))
+#endif
+
+#ifndef MAX
+ #define MAX(x,y) ((x)>(y)?(x):(y))
+#endif
+
#define OPT_CAST(x)
#ifdef __x86_64__
diff --git a/src/tls/pkcs1.c b/src/tls/pkcs1.c
index 7ea9cc7..49e439d 100644
--- a/src/tls/pkcs1.c
+++ b/src/tls/pkcs1.c
@@ -322,6 +322,8 @@
return -1;
}
+ os_free(decrypted);
+
if (hdr.payload + hdr.length != decrypted + decrypted_len) {
wpa_printf(MSG_INFO,
"PKCS #1: Extra data after signature - reject");
@@ -330,12 +332,8 @@
hdr.payload + hdr.length,
decrypted + decrypted_len - hdr.payload -
hdr.length);
-
- os_free(decrypted);
return -1;
}
- os_free(decrypted);
-
return 0;
}