Skip to content

Commit

Permalink
fix vlas in libsignal-protocol-c
Browse files Browse the repository at this point in the history
  • Loading branch information
hrxi committed Nov 6, 2023
1 parent 8712d6f commit e31f9e8
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
2 changes: 1 addition & 1 deletion subprojects/libsignal-protocol-c.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source_url = https://github.com/WhisperSystems/libsignal-protocol-c/archive/v2.3
source_filename = libsignal-protocol-c-2.3.3.tar.gz
source_hash = c22e7690546e24d46210ca92dd808f17c3102e1344cd2f9a370136a96d22319d
patch_directory = libsignal-protocol-c
diff_files = libsignal-protocol-c/dllexport.patch
diff_files = libsignal-protocol-c/dllexport.patch, libsignal-protocol-c/dllexport.patch

[provide]
dependency_names = libsignal-protocol-c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ include_directories = include_directories(
'curve25519/ed25519/nacl_includes',
'curve25519/ed25519/tests',
)
c_args = []
c_args = ['-DBUILDING_SIGNAL']
public_c_args = []
if cc.has_function('SecureZeroMemory', prefix: '#include <Windows.h>')
c_args += ['-DSECUREZEROMEMORY']
Expand Down
72 changes: 72 additions & 0 deletions subprojects/packagefiles/libsignal-protocol-c/vla.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
diff --git a/src/curve25519/ed25519/tests/internal_fast_tests.c b/src/curve25519/ed25519/tests/internal_fast_tests.c
index 6566e25..5e5db58 100644
--- a/src/curve25519/ed25519/tests/internal_fast_tests.c
+++ b/src/curve25519/ed25519/tests/internal_fast_tests.c
@@ -27,6 +27,7 @@
} \
} while (0)

+#define MSG_LEN 200

int sha512_fast_test(int silent)
{
@@ -293,7 +294,6 @@ int curvesigs_fast_test(int silent)
0x0b, 0xd6, 0xc1, 0x97, 0x3f, 0x7d, 0x78, 0x0a,
0xb3, 0x95, 0x18, 0x62, 0x68, 0x03, 0xd7, 0x82,
};
- const int MSG_LEN = 200;
unsigned char privkey[32];
unsigned char pubkey[32];
unsigned char signature[64];
@@ -333,7 +333,6 @@ int xeddsa_fast_test(int silent)
0x69, 0xad, 0xa5, 0x76, 0xd6, 0x3d, 0xca, 0xf2,
0xac, 0x32, 0x6c, 0x11, 0xd0, 0xb9, 0x77, 0x02,
};
- const int MSG_LEN = 200;
unsigned char privkey[32];
unsigned char pubkey[32];
unsigned char signature[64];
diff --git a/src/curve25519/ed25519/tests/internal_slow_tests.c b/src/curve25519/ed25519/tests/internal_slow_tests.c
index 740ddbe..af870e6 100644
--- a/src/curve25519/ed25519/tests/internal_slow_tests.c
+++ b/src/curve25519/ed25519/tests/internal_slow_tests.c
@@ -26,6 +26,7 @@
} \
} while (0)

+#define MSG_LEN 200


int curvesigs_slow_test(int silent, int iterations)
@@ -43,7 +44,6 @@ int curvesigs_slow_test(int silent, int iterations)
};

int count;
- const int MSG_LEN = 200;
unsigned char privkey[32];
unsigned char pubkey[32];
unsigned char signature[64];
@@ -110,7 +110,6 @@ int xeddsa_slow_test(int silent, int iterations)
};

int count;
- const int MSG_LEN = 200;
unsigned char privkey[32];
unsigned char pubkey[32];
unsigned char signature[96];
@@ -177,7 +176,6 @@ int xeddsa_to_curvesigs_slow_test(int silent, int iterations)
};

int count;
- const int MSG_LEN = 200;
unsigned char privkey[32];
unsigned char pubkey[32];
unsigned char signature[96];
@@ -294,7 +292,6 @@ int generalized_xveddsa_slow_test(int silent, int iterations)
*/

int count;
- const int MSG_LEN = 200;
unsigned char privkey[32];
unsigned char pubkey[32];
unsigned char signature[96];

0 comments on commit e31f9e8

Please sign in to comment.