mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8296072: CertAttrSet::encode and DerEncoder::derEncode should write into DerOutputStream
Reviewed-by: xuelei, mullan
This commit is contained in:
parent
37107fc157
commit
0d0bd7bd40
50 changed files with 209 additions and 314 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -26,7 +26,6 @@
|
|||
package sun.security.x509;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Enumeration;
|
||||
|
||||
|
@ -198,7 +197,8 @@ implements CertAttrSet<String> {
|
|||
* @param out the DerOutputStream to write the extension to.
|
||||
* @exception IOException on encoding errors.
|
||||
*/
|
||||
public void encode(OutputStream out) throws IOException {
|
||||
@Override
|
||||
public void encode(DerOutputStream out) throws IOException {
|
||||
encode(out, PKIXExtensions.CRLNumber_Id, true);
|
||||
}
|
||||
|
||||
|
@ -206,18 +206,15 @@ implements CertAttrSet<String> {
|
|||
* Write the extension to the DerOutputStream.
|
||||
* (Also called by the subclass)
|
||||
*/
|
||||
protected void encode(OutputStream out, ObjectIdentifier extensionId,
|
||||
boolean isCritical) throws IOException {
|
||||
|
||||
DerOutputStream tmp = new DerOutputStream();
|
||||
protected void encode(DerOutputStream out, ObjectIdentifier extensionId,
|
||||
boolean isCritical) throws IOException {
|
||||
|
||||
if (this.extensionValue == null) {
|
||||
this.extensionId = extensionId;
|
||||
this.critical = isCritical;
|
||||
encodeThis();
|
||||
}
|
||||
super.encode(tmp);
|
||||
out.write(tmp.toByteArray());
|
||||
super.encode(out);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue