Record.java revision 2362
2362N/A * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * SSL/TLS records, as pulled off (and put onto) a TCP stream. This is 0N/A * the base interface, which defines common information and interfaces 0N/A * used by both Input and Output records. 0N/A * @author David Brownell 0N/A * There are four SSL record types, which are part of the interface 0N/A * to this level (along with the maximum record size) 0N/A * enum { change_cipher_spec(20), alert(21), handshake(22), 0N/A * application_data(23), (255) } ContentType; 0N/A * SSL has a maximum record size. It's header, (compressed) data, 0N/A * padding, and a trailer for the MAC. 0N/A * Some compression algorithms have rare cases where they expand the data. 0N/A * As we don't support compression at this time, leave that out. 0N/A * The maximum large record size. 0N/A * Some SSL/TLS implementations support large fragment upto 2^15 bytes, 0N/A * such as Microsoft. We support large incoming fragments. 0N/A * The maximum large record size is defined as maxRecordSize plus 2^14, 0N/A * this is the amount OpenSSL is using. 0N/A * Maximum record size for alert and change cipher spec records. 0N/A * They only contain 2 and 1 bytes of data, respectively. 0N/A * Allocate a smaller array.