Summary: | KeyStoreResolver iterator returns null for symmetric keys | ||
---|---|---|---|
Product: | Security - Now in JIRA | Reporter: | Clement Pellerin <Clement_Pellerin> |
Component: | Encryption | Assignee: | XML Security Developers Mailing List <security-dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows NT | ||
Bug Depends on: | |||
Bug Blocks: | 49450 | ||
Attachments: | patch to solve problem including new junit test |
Thanks for the patch, I'll take a look. Colm. This patch has a bug in the implementation of next() because it never returns NoSuchElementException. See an improvement in the incremental patch attached to Bug 49450. Patch applied, thanks. Colm. |
Created attachment 25599 [details] patch to solve problem including new junit test When iterating the certificates in a KeyStoreResolver, the iterator might return null even though hasNext() says there are more elements. This happens because hasNext() only checks if there are more aliases. If the next alias contains a symmetric key, there is no certificate in the KeyStore entry and next() returns null. When you look at the KeyResolvers, they are not prepared to handle a null value, this will cause a NullPointerException. To reproduce, use the junit KeyStoreResolverTest in the attachment.