From 7f4ed67a9700f241a40860cecba684a61f7dd05c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 14 Oct 2014 20:56:02 +0200 Subject: [PATCH] Fix compile error with armcc in mpi_is_prime() --- ChangeLog | 1 + library/bignum.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ec6410d1f..6244af3a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ Bugfix with non-blocking I/O. * Fix compiler warnings on iOS (found by Sander Niemeijer). * x509_crt_parse() did not increase total_failed on PEM error + * Fix compile error with armcc in mpi_is_prime() Changes * Ciphersuites using SHA-256 or SHA-384 now require TLS 1.x (there is no diff --git a/library/bignum.c b/library/bignum.c index 80cf0f800..448e743d4 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -2057,7 +2057,11 @@ int mpi_is_prime( mpi *X, void *p_rng ) { int ret; - const mpi XX = { 1, X->n, X->p }; /* Abs(X) */ + mpi XX; + + XX.s = 1; + XX.n = X->n; + XX.p = X->p; if( mpi_cmp_int( &XX, 0 ) == 0 || mpi_cmp_int( &XX, 1 ) == 0 )