Skip to content

Commit

Permalink
fix: extension processing in CMP client
Browse files Browse the repository at this point in the history
  • Loading branch information
Akretsch committed Dec 6, 2023
1 parent 2b4ebc2 commit 5756a33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,8 @@ fix: update some dependencies
### 4.0.0 (Nov 8 2023)

feat: implement configurable recipient

### 4.0.1 (Dec 6 2024)

fix: extension processing in CMP client

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<groupId>com.siemens.pki</groupId>
<artifactId>CmpRaComponent</artifactId>
<packaging>jar</packaging>
<version>4.0.0</version>
<version>4.0.1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<parent.basedir>.</parent.basedir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,13 +451,14 @@ public EnrollmentResult invokeEnrollment() {
case PKIBody.TYPE_CERT_REQ:
case PKIBody.TYPE_INIT_REQ: {
final String subject = enrollmentContext.getSubject();
ifNotNull(enrollmentContext.getExtensions(), exts -> exts.stream()
final Extension[] extensions = ifNotNull(enrollmentContext.getExtensions(), exts -> exts.stream()
.map(ext -> new Extension(
new ASN1ObjectIdentifier(ext.getId()), ext.isCritical(), ext.getValue()))
.toArray(Extension[]::new));
final CertTemplateBuilder ctb = new CertTemplateBuilder()
.setSubject(ifNotNull(subject, X500Name::new))
.setPublicKey(enrolledPublicKeyInfo);
.setPublicKey(enrolledPublicKeyInfo)
.setExtensions((Extensions) ifNotNull(extensions, Extensions::new));
requestBody = PkiMessageGenerator.generateIrCrKurBody(
enrollmentType, ctb.build(), null, enrolledPrivateKey);
pvno = enrolledPrivateKey == null ? PKIHeader.CMP_2021 : PKIHeader.CMP_2000;
Expand Down

0 comments on commit 5756a33

Please sign in to comment.