8286024: PKCS12 keystore shows "DES/CBC" as the algorithm of a DES SecretKeyEntry

Reviewed-by: valeriep
This commit is contained in:
Weijun Wang 2022-05-02 22:37:32 +00:00
parent f973b78383
commit 50a4df87c8
2 changed files with 53 additions and 1 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
@ -405,6 +405,9 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
// decode secret key
} else {
byte[] keyBytes = in.getOctetString();
if (keyAlgo.equals(KnownOIDs.OIW_DES_CBC.stdName())) {
keyAlgo = "DES";
}
SecretKeySpec secretKeySpec =
new SecretKeySpec(keyBytes, keyAlgo);