eclipse-ee4j / eclipse-ee4j/metro-wsit

Replace usage of X509Certificate.getIssuerDN() with getIssuerX500Principal()

Open
#402 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: runtime Priority: Major Type: Bug
Dominant language
Java
Stars
6
Forks
21
Avg merge
10h 2m
Merged PRs (30d)
1

Description

X509Certificate.getIssuerDN() should not be used any more, X509Certificate.getIssuerX500Principal() should be used instead, see:
[http://docs.oracle.com/javase/7/docs/api/java/security/cert/X509Certificate.html#getIssuerDN%28%29](http://docs.oracle.com/javase/7/docs/api/java/security/cert/X509Certificate.html#getIssuerDN%28%29)

Some JCE provider like Bouncy Castle return a wrongly formated String there, because it is not specified.

The return value of "xCert.getIssuerDN().getName()" on a X509Certificate is not specified, but metro assumes that it is a string formated accordingly to RFC 4514 section 2.1, because [http://www.ws-i.org/Profiles/BasicSecurityProfile-1.1.html](http://www.ws-i.org/Profiles/BasicSecurityProfile-1.1.html) says so.

When replacing this call with getIssuerX500Principal() Bouncy Castle returns the correctly formated string.

The main Problem I see is in ws-sx/wssx-impl/src/main/java/com/sun/xml/ws/security/opt/impl/keyinfo/X509TokenBuilder.java

metro returns the following part in the Soap Webservice when using a certificate from Bouncy castle:

CN=bos CA eID Communication Certs,O=bremen online services,C=DE
904391263803916562

The X509IssuerName element should be ordered the other way around.
#### Affected Versions
[2.2.7]

Source: [https://github.com/javaee/metro-jax-ws/issues/1148](https://github.com/javaee/metro-jax-ws/issues/1148)
Author: glassfishrobot

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in ws-sx/wssx-impl/src/main/java/com/sun/xml/ws/security/opt/impl/keyinfo/X509TokenBuilder.java and search the repository for uses of X509Certificate.getIssuerDN(). Review how the issuer name is placed in X509IssuerName, then replace the deprecated lookup with getIssuerX500Principal() and verify that the emitted name follows the expected RFC 4514 ordering.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.