From 9ecd705ab395d6fa9c192471fe81dc160dfeafac Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 16 Feb 2009 21:05:37 +0000 Subject: Portability fixes. --- cipher/rsa.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'cipher/rsa.c') diff --git a/cipher/rsa.c b/cipher/rsa.c index cf278c25..8ee60183 100644 --- a/cipher/rsa.c +++ b/cipher/rsa.c @@ -444,18 +444,28 @@ generate_x931 (RSA_secret_key *sk, unsigned int nbits, unsigned long e_value, else { /* Parameters to derive the key are given. */ + /* Note that we explicitly need to setup the values of tbl + because some compilers (e.g. OpenWatcom, IRIX) don't allow + to initialize a structure with automatic variables. */ struct { const char *name; gcry_mpi_t *value; } tbl[] = { - { "Xp1", &xp1 }, - { "Xp2", &xp2 }, - { "Xp", &xp }, - { "Xq1", &xq1 }, - { "Xq2", &xq2 }, - { "Xq", &xq }, - { NULL, NULL } + { "Xp1" }, + { "Xp2" }, + { "Xp" }, + { "Xq1" }, + { "Xq2" }, + { "Xq" }, + { NULL } }; int idx; gcry_sexp_t oneparm; + tbl[0].value = &xp1; + tbl[1].value = &xp2; + tbl[2].value = &xp; + tbl[3].value = &xq1; + tbl[4].value = &xq2; + tbl[5].value = &xq; + for (idx=0; tbl[idx].name; idx++) { oneparm = gcry_sexp_find_token (deriveparms, tbl[idx].name, 0); -- cgit v1.2.1