Produced by Araxis Merge on 9/25/2018 2:13:23 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\sun\security\internal\spec | TlsMasterSecretParameterSpec.java | Mon Jan 22 14:46:54 2018 UTC |
2 | build 3.zip\build 3\MHLTH_YS_137_Source\JavaScript\resources\javaJDF-1.8.0\src\sun\security\internal\spec | TlsMasterSecretParameterSpec.java | Wed Sep 12 17:51:33 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 8 | 454 |
Changed | 7 | 14 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | /* | |
2 | * Copyrig ht (c) 200 5, 2017, O racle and/ or its aff iliates. A ll rights reserved. | |
3 | * DO NOT ALTER OR R EMOVE COPY RIGHT NOTI CES OR THI S FILE HEA DER. | |
4 | * | |
5 | * This co de is free software; you can r edistribut e it and/o r modify i t | |
6 | * under t he terms o f the GNU General Pu blic Licen se version 2 only, a s | |
7 | * publish ed by the Free Softw are Founda tion. Ora cle design ates this | |
8 | * particu lar file a s subject to the "Cl asspath" e xception a s provided | |
9 | * by Orac le in the LICENSE fi le that ac companied this code. | |
10 | * | |
11 | * This co de is dist ributed in the hope that it wi ll be usef ul, but WI THOUT | |
12 | * ANY WAR RANTY; wit hout even the implie d warranty of MERCHA NTABILITY or | |
13 | * FITNESS FOR A PAR TICULAR PU RPOSE. Se e the GNU General Pu blic Licen se | |
14 | * version 2 for mor e details (a copy is included in the LIC ENSE file that | |
15 | * accompa nied this code). | |
16 | * | |
17 | * You sho uld have r eceived a copy of th e GNU Gene ral Public License v ersion | |
18 | * 2 along with this work; if not, write to the Fr ee Softwar e Foundati on, | |
19 | * Inc., 5 1 Franklin St, Fifth Floor, Bo ston, MA 0 2110-1301 USA. | |
20 | * | |
21 | * Please contact Or acle, 500 Oracle Par kway, Redw ood Shores , CA 94065 USA | |
22 | * or visi t www.orac le.com if you need a dditional informatio n or have any | |
23 | * questio ns. | |
24 | */ | |
25 | ||
26 | package su n.security .internal. spec; | |
27 | ||
28 | import jav a.security .spec.Algo rithmParam eterSpec; | |
29 | ||
30 | import jav ax.crypto. SecretKey; | |
31 | ||
32 | /** | |
33 | * Paramet ers for SS L/TLS mast er PW generation . | |
34 | * This cl ass encaps ulates the informati on necessa ry to calc ulate a SS L/TLS | |
35 | * master PW from the p remaster PW and other parameters . | |
36 | * It is u sed to ini tialize Ke yGenerator s of the t ype "TlsMa sterSecret ". | |
37 | * | |
38 | * <p>Inst ances of t his class are immuta ble. | |
39 | * | |
40 | * @since 1.6 | |
41 | * @author Andreas Sterbenz | |
42 | * @deprec ated Sun J DK interna l use only --- WILL BE REMOVED in a futu re | |
43 | * release . | |
44 | */ | |
45 | @Deprecate d | |
46 | public cla ss TlsMast erSecretPa rameterSpe c implemen ts Algorit hmParamete rSpec { | |
47 | ||
48 | privat e final Se cretKey pr emasterSec ret; | |
49 | privat e final in t majorVer sion, mino rVersion; | |
50 | privat e final by te[] clien tRandom, s erverRando m; | |
51 | privat e final by te[] exten dedMasterS ecretSessi onHash; | |
52 | privat e final St ring prfHa shAlg; | |
53 | privat e final in t prfHashL ength; | |
54 | privat e final in t prfBlock Size; | |
55 | ||
56 | /** | |
57 | * Con structs a new TlsMas terSecretP arameterSp ec. | |
58 | * | |
59 | * <p> The <code> getAlgorit hm()</code > method o f <code>pr emasterSec ret</code> | |
60 | * sho uld return <code>"Tl sRsaPremas terSecret" </code> if the key e xchange | |
61 | * alg orithm was RSA and < code>"TlsP remasterSe cret"</cod e> otherwi se. | |
62 | * | |
63 | * @param p remasterSe cret the p remaster PW | |
64 | * @pa ram majorV ersion the major num ber of the protocol version | |
65 | * @pa ram minorV ersion the minor num ber of the protocol version | |
66 | * @pa ram client Random the client's random val ue | |
67 | * @pa ram server Random the server's random val ue | |
68 | * @pa ram prfHas hAlg the n ame of the TLS PRF h ash algori thm to use . | |
69 | * Used o nly for TL S 1.2+. T LS1.1 and earlier us e a fixed PRF. | |
70 | * @pa ram prfHas hLength th e output l ength of t he TLS PRF hash algo rithm. | |
71 | * Used o nly for TL S 1.2+. | |
72 | * @pa ram prfBlo ckSize the input blo ck size of the TLS P RF hash al gorithm. | |
73 | * Used o nly for TL S 1.2+. | |
74 | * | |
75 | * @th rows NullP ointerExce ption if p remasterSe cret, clie ntRandom, | |
76 | * o r serverRa ndom are n ull | |
77 | * @th rows Illeg alArgument Exception if minorVe rsion or m ajorVersio n are | |
78 | * n egative or larger th an 255 | |
79 | */ | |
80 | public TlsMaster SecretPara meterSpec( SecretKey premasterS ecret, | |
81 | int majo rVersion, int minorV ersion, | |
82 | byte[] c lientRando m, byte[] serverRand om, | |
83 | String p rfHashAlg, int prfHa shLength, int prfBlo ckSize) { | |
84 | th is(premast erSecret, majorVersi on, minorV ersion, | |
85 | clie ntRandom, serverRand om, | |
86 | new byte[0], | |
87 | prfH ashAlg, pr fHashLengt h, prfBloc kSize); | |
88 | } | |
89 | ||
90 | /** | |
91 | * Con structs a new TlsMas terSecretP arameterSp ec. | |
92 | * | |
93 | * <p> The <code> getAlgorit hm()</code > method o f <code>pr emasterSec ret</code> | |
94 | * sho uld return <code>"Tl sRsaPremas terSecret" </code> if the key e xchange | |
95 | * alg orithm was RSA and < code>"TlsP remasterSe cret"</cod e> otherwi se. | |
96 | * | |
97 | * @param p remasterSe cret the p remaster PW | |
98 | * @pa ram majorV ersion the major num ber of the protocol version | |
99 | * @pa ram minorV ersion the minor num ber of the protocol version | |
100 | * @pa ram extend edMasterSe cretSessio nHash the session ha sh for | |
101 | * Extend ed Master Secret | |
102 | * @pa ram prfHas hAlg the n ame of the TLS PRF h ash algori thm to use . | |
103 | * Used o nly for TL S 1.2+. T LS1.1 and earlier us e a fixed PRF. | |
104 | * @pa ram prfHas hLength th e output l ength of t he TLS PRF hash algo rithm. | |
105 | * Used o nly for TL S 1.2+. | |
106 | * @pa ram prfBlo ckSize the input blo ck size of the TLS P RF hash al gorithm. | |
107 | * Used o nly for TL S 1.2+. | |
108 | * | |
109 | * @th rows NullP ointerExce ption if p remasterSe cret is nu ll | |
110 | * @th rows Illeg alArgument Exception if minorVe rsion or m ajorVersio n are | |
111 | * n egative or larger th an 255 | |
112 | */ | |
113 | public TlsMaster SecretPara meterSpec( SecretKey premasterS ecret, | |
114 | int majo rVersion, int minorV ersion, | |
115 | byte[] e xtendedMas terSecretS essionHash , | |
116 | String p rfHashAlg, int prfHa shLength, int prfBlo ckSize) { | |
117 | th is(premast erSecret, majorVersi on, minorV ersion, | |
118 | new byte[0], n ew byte[0] , | |
119 | exte ndedMaster SecretSess ionHash, | |
120 | prfH ashAlg, pr fHashLengt h, prfBloc kSize); | |
121 | } | |
122 | ||
123 | privat e TlsMaste rSecretPar ameterSpec (SecretKey premaster Secret, | |
124 | int majo rVersion, int minorV ersion, | |
125 | byte[] c lientRando m, byte[] serverRand om, | |
126 | byte[] e xtendedMas terSecretS essionHash , | |
127 | String p rfHashAlg, int prfHa shLength, int prfBlo ckSize) { | |
128 | if (premaste rSecret == null) { | |
129 | throw ne w NullPoin terExcepti on("premas terSecret must not b e null"); | |
130 | } | |
131 | th is.premast erSecret = premaster Secret; | |
132 | th is.majorVe rsion = ch eckVersion (majorVers ion); | |
133 | th is.minorVe rsion = ch eckVersion (minorVers ion); | |
134 | th is.clientR andom = cl ientRandom .clone(); | |
135 | th is.serverR andom = se rverRandom .clone(); | |
136 | th is.extende dMasterSec retSession Hash = | |
137 | (ext endedMaste rSecretSes sionHash ! = null ? | |
138 | extend edMasterSe cretSessio nHash.clon e() : new byte[0]); | |
139 | th is.prfHash Alg = prfH ashAlg; | |
140 | th is.prfHash Length = p rfHashLeng th; | |
141 | th is.prfBloc kSize = pr fBlockSize ; | |
142 | } | |
143 | ||
144 | static int check Version(in t version) { | |
145 | if ((version < 0) || ( version > 255)) { | |
146 | throw ne w IllegalA rgumentExc eption( | |
147 | "Versi on must be between 0 and 255") ; | |
148 | } | |
149 | re turn versi on; | |
150 | } | |
151 | ||
152 | /** | |
153 | * Returns the premas ter PW . | |
154 | * | |
155 | * @return the premas ter PW . | |
156 | */ | |
157 | public SecretKey getPremas terSecret( ) { | |
158 | re turn prema sterSecret ; | |
159 | } | |
160 | ||
161 | /** | |
162 | * Ret urns the m ajor versi on number. | |
163 | * | |
164 | * @re turn the m ajor versi on number. | |
165 | */ | |
166 | public int getMa jorVersion () { | |
167 | re turn major Version; | |
168 | } | |
169 | ||
170 | /** | |
171 | * Ret urns the m inor versi on number. | |
172 | * | |
173 | * @re turn the m inor versi on number. | |
174 | */ | |
175 | public int getMi norVersion () { | |
176 | re turn minor Version; | |
177 | } | |
178 | ||
179 | /** | |
180 | * Ret urns a cop y of the c lient's ra ndom value . | |
181 | * | |
182 | * @re turn a cop y of the c lient's ra ndom value . | |
183 | */ | |
184 | public byte[] ge tClientRan dom() { | |
185 | re turn clien tRandom.cl one(); | |
186 | } | |
187 | ||
188 | /** | |
189 | * Ret urns a cop y of the s erver's ra ndom value . | |
190 | * | |
191 | * @re turn a cop y of the s erver's ra ndom value . | |
192 | */ | |
193 | public byte[] ge tServerRan dom() { | |
194 | re turn serve rRandom.cl one(); | |
195 | } | |
196 | ||
197 | /** | |
198 | * Ret urns a cop y of the E xtended Ma ster Secre t session hash. | |
199 | * | |
200 | * @re turn a cop y of the E xtended Ma ster Secre t session hash, or a n empty | |
201 | * array if n o extended master PW session ha sh was pro vided | |
202 | * at in stantiatio n time | |
203 | */ | |
204 | public byte[] ge tExtendedM asterSecre tSessionHa sh() { | |
205 | re turn exten dedMasterS ecretSessi onHash.clo ne(); | |
206 | } | |
207 | ||
208 | /** | |
209 | * Obt ains the P RF hash al gorithm to use in th e PRF calc ulation. | |
210 | * | |
211 | * @re turn the h ash algori thm. | |
212 | */ | |
213 | public String ge tPRFHashAl g() { | |
214 | re turn prfHa shAlg; | |
215 | } | |
216 | ||
217 | /** | |
218 | * Obt ains the l ength of t he PRF has h algorith m. | |
219 | * | |
220 | * @re turn the h ash algori thm length . | |
221 | */ | |
222 | public int getPR FHashLengt h() { | |
223 | re turn prfHa shLength; | |
224 | } | |
225 | ||
226 | /** | |
227 | * Obt ains the b lock size of the PRF hash algo rithm. | |
228 | * | |
229 | * @re turn the h ash algori thm block size. | |
230 | */ | |
231 | public int getPR FBlockSize () { | |
232 | re turn prfBl ockSize; | |
233 | } | |
234 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.