diff options
author | Martin Willi <martin@revosec.ch> | 2010-12-23 10:29:01 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2010-12-23 10:29:01 +0100 |
commit | 33bfdf6f3782e2f0d6d9da5d15144a425be4b618 (patch) | |
tree | 95d66253d2db2ff19c74775fdf008ccf0b9df99a /src | |
parent | 905ab99fc177977518a494a86be52ef0862fff4a (diff) | |
download | strongswan-33bfdf6f3782e2f0d6d9da5d15144a425be4b618.tar.bz2 strongswan-33bfdf6f3782e2f0d6d9da5d15144a425be4b618.tar.xz |
Fixed public key construction from PKCS#11 private key
Diffstat (limited to 'src')
-rw-r--r-- | src/libstrongswan/plugins/pkcs11/pkcs11_private_key.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.c b/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.c index 1977204ed..b4cc7a805 100644 --- a/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.c +++ b/src/libstrongswan/plugins/pkcs11/pkcs11_private_key.c @@ -424,13 +424,13 @@ static bool find_key(private_pkcs11_private_key_t *this, chunk_t keyid) switch (type) { case CKK_RSA: - if (attr[2].ulValueLen == -1 || attr[3].ulValueLen == -1) + if (attr[1].ulValueLen == -1 || attr[2].ulValueLen == -1) { DBG1(DBG_CFG, "reading modulus/exponent from PKCS#1 failed"); break; } - modulus = chunk_create(attr[2].pValue, attr[2].ulValueLen); - pubexp = chunk_create(attr[3].pValue, attr[3].ulValueLen); + modulus = chunk_create(attr[1].pValue, attr[1].ulValueLen); + pubexp = chunk_create(attr[2].pValue, attr[2].ulValueLen); this->pubkey = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_RSA, BUILD_RSA_MODULUS, modulus, BUILD_RSA_PUB_EXP, pubexp, BUILD_END); |