equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
97 * Properly orders the output of the data written to the wrap call. |
97 * Properly orders the output of the data written to the wrap call. |
98 * This is only handshake data, application data goes through the |
98 * This is only handshake data, application data goes through the |
99 * other writeRecord. |
99 * other writeRecord. |
100 */ |
100 */ |
101 synchronized void writeRecord(EngineOutputRecord outputRecord, |
101 synchronized void writeRecord(EngineOutputRecord outputRecord, |
102 Authenticator authenticator, |
102 MAC writeMAC, CipherBox writeCipher) throws IOException { |
103 CipherBox writeCipher) throws IOException { |
|
104 |
103 |
105 /* |
104 /* |
106 * Only output if we're still open. |
105 * Only output if we're still open. |
107 */ |
106 */ |
108 if (outboundClosed) { |
107 if (outboundClosed) { |
109 throw new IOException("writer side was already closed."); |
108 throw new IOException("writer side was already closed."); |
110 } |
109 } |
111 |
110 |
112 outputRecord.write(authenticator, writeCipher); |
111 outputRecord.write(writeMAC, writeCipher); |
113 |
112 |
114 /* |
113 /* |
115 * Did our handshakers notify that we just sent the |
114 * Did our handshakers notify that we just sent the |
116 * Finished message? |
115 * Finished message? |
117 * |
116 * |
150 * Shouldn't expect to have an IOException here. |
149 * Shouldn't expect to have an IOException here. |
151 * |
150 * |
152 * Return any determined status. |
151 * Return any determined status. |
153 */ |
152 */ |
154 synchronized HandshakeStatus writeRecord( |
153 synchronized HandshakeStatus writeRecord( |
155 EngineOutputRecord outputRecord, EngineArgs ea, |
154 EngineOutputRecord outputRecord, EngineArgs ea, MAC writeMAC, |
156 Authenticator authenticator, |
|
157 CipherBox writeCipher) throws IOException { |
155 CipherBox writeCipher) throws IOException { |
158 |
156 |
159 /* |
157 /* |
160 * If we have data ready to go, output this first before |
158 * If we have data ready to go, output this first before |
161 * trying to consume app data. |
159 * trying to consume app data. |
181 */ |
179 */ |
182 if (outboundClosed) { |
180 if (outboundClosed) { |
183 throw new IOException("The write side was already closed"); |
181 throw new IOException("The write side was already closed"); |
184 } |
182 } |
185 |
183 |
186 outputRecord.write(ea, authenticator, writeCipher); |
184 outputRecord.write(ea, writeMAC, writeCipher); |
187 |
185 |
188 if (debug != null && Debug.isOn("packet")) { |
186 if (debug != null && Debug.isOn("packet")) { |
189 dumpPacket(ea, false); |
187 dumpPacket(ea, false); |
190 } |
188 } |
191 |
189 |