Navigation Menu

Skip to content

Commit

Permalink
null PIN gives access to public objects in keystore
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Borgul committed Aug 1, 2011
1 parent 0179201 commit 86c57ee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkcs11/java/src/org/opensc/pkcs11/spi/PKCS11KeyStoreSpi.java
Expand Up @@ -463,6 +463,8 @@ public void engineStore(OutputStream arg0, char[] arg1) throws IOException,

/* (non-Javadoc)
* @see java.security.KeyStoreSpi#engineLoad(java.io.InputStream, char[])
*
* If pin is null then keystore will contain only public objects
*/
@Override
public void engineLoad(InputStream file, char[] pin) throws IOException,
Expand All @@ -472,9 +474,9 @@ public void engineLoad(InputStream file, char[] pin) throws IOException,
throw new IOException ("PKCS11 Key Store requires a null InputStream a the first argument.");

PKCS11LoadStoreParameter param = new PKCS11LoadStoreParameter();

param.setProtectionParameter(new PasswordProtection(pin));

if (pin != null) {
param.setProtectionParameter(new PasswordProtection(pin));
}
engineLoad(param);
}

Expand Down

0 comments on commit 86c57ee

Please sign in to comment.