summaryrefslogtreecommitdiff
path: root/cipher/rsa.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2009-02-16 21:05:37 +0000
committerWerner Koch <wk@gnupg.org>2009-02-16 21:05:37 +0000
commit9ecd705ab395d6fa9c192471fe81dc160dfeafac (patch)
tree0ea203f7807d5671d8da3b3c699c1054f844ddb8 /cipher/rsa.c
parentba1c1d7456745adbd3b6b94bc935cacc914126eb (diff)
downloadlibgcrypt-9ecd705ab395d6fa9c192471fe81dc160dfeafac.tar.gz
Portability fixes.
Diffstat (limited to 'cipher/rsa.c')
-rw-r--r--cipher/rsa.c24
1 files changed, 17 insertions, 7 deletions
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);