77 |
77 |
78 /* Class and subclass dynamic debugging support */ |
78 /* Class and subclass dynamic debugging support */ |
79 public static final Debug debug = Debug.getInstance("ssl"); |
79 public static final Debug debug = Debug.getInstance("ssl"); |
80 |
80 |
81 // enum HandshakeType: |
81 // enum HandshakeType: |
|
82 // |
|
83 // Please update the isUnsupported() method accordingly if the handshake |
|
84 // types get updated in the future. |
82 static final byte ht_hello_request = 0; // RFC 5246 |
85 static final byte ht_hello_request = 0; // RFC 5246 |
83 static final byte ht_client_hello = 1; // RFC 5246 |
86 static final byte ht_client_hello = 1; // RFC 5246 |
84 static final byte ht_server_hello = 2; // RFC 5246 |
87 static final byte ht_server_hello = 2; // RFC 5246 |
85 static final byte ht_hello_verify_request = 3; // RFC 6347 |
88 static final byte ht_hello_verify_request = 3; // RFC 6347 |
86 static final byte ht_new_session_ticket = 4; // RFC 4507 |
89 static final byte ht_new_session_ticket = 4; // RFC 4507 |
126 byte[] newarray = new byte[n]; |
129 byte[] newarray = new byte[n]; |
127 System.arraycopy(b, 1, newarray, 0, n); |
130 System.arraycopy(b, 1, newarray, 0, n); |
128 b = newarray; |
131 b = newarray; |
129 } |
132 } |
130 return b; |
133 return b; |
|
134 } |
|
135 |
|
136 static boolean isUnsupported(byte handshakeType) { |
|
137 return (handshakeType != ht_hello_request) && |
|
138 (handshakeType != ht_client_hello) && |
|
139 (handshakeType != ht_server_hello) && |
|
140 (handshakeType != ht_hello_verify_request) && |
|
141 (handshakeType != ht_new_session_ticket) && |
|
142 (handshakeType != ht_certificate) && |
|
143 (handshakeType != ht_server_key_exchange) && |
|
144 (handshakeType != ht_certificate_request) && |
|
145 (handshakeType != ht_server_hello_done) && |
|
146 (handshakeType != ht_certificate_verify) && |
|
147 (handshakeType != ht_client_key_exchange) && |
|
148 (handshakeType != ht_finished) && |
|
149 (handshakeType != ht_certificate_url) && |
|
150 (handshakeType != ht_certificate_status) && |
|
151 (handshakeType != ht_supplemental_data); |
131 } |
152 } |
132 |
153 |
133 private static byte[] genPad(int b, int count) { |
154 private static byte[] genPad(int b, int count) { |
134 byte[] padding = new byte[count]; |
155 byte[] padding = new byte[count]; |
135 Arrays.fill(padding, (byte)b); |
156 Arrays.fill(padding, (byte)b); |