8296072: CertAttrSet::encode and DerEncoder::derEncode should write into DerOutputStream

Reviewed-by: xuelei, mullan
This commit is contained in:
Weijun Wang 2022-11-01 12:49:11 +00:00
parent 37107fc157
commit 0d0bd7bd40
50 changed files with 209 additions and 314 deletions

View file

@ -26,7 +26,6 @@
package sun.security.x509;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Collections;
import java.util.*;
@ -154,15 +153,14 @@ public class SubjectInfoAccessExtension extends Extension
* @param out the DerOutputStream to write the extension to.
* @exception IOException on encoding errors.
*/
public void encode(OutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
@Override
public void encode(DerOutputStream out) throws IOException {
if (this.extensionValue == null) {
this.extensionId = PKIXExtensions.SubjectInfoAccess_Id;
this.critical = false;
encodeThis();
}
super.encode(tmp);
out.write(tmp.toByteArray());
super.encode(out);
}
/**