summaryrefslogtreecommitdiff
path: root/ssh-pkcs11.c
diff options
context:
space:
mode:
authortim <tim>2010-03-04 20:48:05 +0000
committertim <tim>2010-03-04 20:48:05 +0000
commitc313df1a1b2b014f2ffb31a1954f5db372d07ed1 (patch)
tree43771b6ae6075aed484b7a485eac61dd8e87dc89 /ssh-pkcs11.c
parenta396799a9b905f77d286a1544e81289b762a5755 (diff)
downloadopenssh-c313df1a1b2b014f2ffb31a1954f5db372d07ed1.tar.gz
- (tim) [ssh-pkcs11.c] Fix "non-constant initializer" errors in older
compilers. OK djm@
Diffstat (limited to 'ssh-pkcs11.c')
-rw-r--r--ssh-pkcs11.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/ssh-pkcs11.c b/ssh-pkcs11.c
index 7536f92a..f0192dcf 100644
--- a/ssh-pkcs11.c
+++ b/ssh-pkcs11.c
@@ -204,13 +204,18 @@ pkcs11_rsa_private_encrypt(int flen, const u_char *from, u_char *to, RSA *rsa,
CKM_RSA_PKCS, NULL_PTR, 0
};
CK_ATTRIBUTE key_filter[] = {
- {CKA_CLASS, &private_key_class, sizeof(private_key_class) },
+ {CKA_CLASS, NULL, sizeof(private_key_class) },
{CKA_ID, NULL, 0},
- {CKA_SIGN, &true_val, sizeof(true_val) }
+ {CKA_SIGN, NULL, sizeof(true_val) }
};
char *pin, prompt[1024];
int rval = -1;
+ /* some compilers complain about non-constant initializer so we
+ use NULL in CK_ATTRIBUTE above and set the values here */
+ key_filter[0].pValue = &private_key_class;
+ key_filter[2].pValue = &true_val;
+
if ((k11 = RSA_get_app_data(rsa)) == NULL) {
error("RSA_get_app_data failed for rsa %p", rsa);
return (-1);
@@ -371,7 +376,7 @@ pkcs11_fetch_keys(struct pkcs11_provider *p, CK_ULONG slotidx, Key ***keysp,
CK_FUNCTION_LIST *f;
CK_OBJECT_CLASS pubkey_class = CKO_PUBLIC_KEY;
CK_ATTRIBUTE pubkey_filter[] = {
- { CKA_CLASS, &pubkey_class, sizeof(pubkey_class) }
+ { CKA_CLASS, NULL, sizeof(pubkey_class) }
};
CK_ATTRIBUTE attribs[] = {
{ CKA_ID, NULL, 0 },
@@ -379,6 +384,10 @@ pkcs11_fetch_keys(struct pkcs11_provider *p, CK_ULONG slotidx, Key ***keysp,
{ CKA_PUBLIC_EXPONENT, NULL, 0 }
};
+ /* some compilers complain about non-constant initializer so we
+ use NULL in CK_ATTRIBUTE above and set the value here */
+ pubkey_filter[0].pValue = &pubkey_class;
+
f = p->function_list;
session = p->slotinfo[slotidx].session;
/* setup a filter the looks for public keys */