mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8281628: KeyAgreement : generateSecret intermittently not resetting
Reviewed-by: valeriep
This commit is contained in:
parent
b6c35ae44a
commit
1485883c9e
2 changed files with 77 additions and 1 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
|
||||
|
@ -344,6 +344,8 @@ extends KeyAgreementSpi {
|
|||
} else {
|
||||
// Array too short, pad it w/ leading 0s
|
||||
if (secret.length < expectedLen) {
|
||||
Arrays.fill(sharedSecret, offset,
|
||||
offset + (expectedLen - secret.length), (byte)0);
|
||||
System.arraycopy(secret, 0, sharedSecret,
|
||||
offset + (expectedLen - secret.length),
|
||||
secret.length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue