diff options
author | Tim Rice <tim@multitalents.net> | 2010-03-04 12:48:05 -0800 |
---|---|---|
committer | Tim Rice <tim@multitalents.net> | 2010-03-04 12:48:05 -0800 |
commit | 179eee081a560f3e10506ae3a2facdc1c766f0f6 (patch) | |
tree | ebc022eb7b5931738edcea62228533054b93249e /ssh-pkcs11.c | |
parent | f2b70cad7585a67f7098119ccb6ae31573f2dc60 (diff) | |
download | openssh-git-179eee081a560f3e10506ae3a2facdc1c766f0f6.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.c | 15 |
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 */ |