Home | History | Annotate | Download | only in jsse
      1 /*
      2  *  Licensed to the Apache Software Foundation (ASF) under one or more
      3  *  contributor license agreements.  See the NOTICE file distributed with
      4  *  this work for additional information regarding copyright ownership.
      5  *  The ASF licenses this file to You under the Apache License, Version 2.0
      6  *  (the "License"); you may not use this file except in compliance with
      7  *  the License.  You may obtain a copy of the License at
      8  *
      9  *     http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  *  Unless required by applicable law or agreed to in writing, software
     12  *  distributed under the License is distributed on an "AS IS" BASIS,
     13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  *  See the License for the specific language governing permissions and
     15  *  limitations under the License.
     16  */
     17 
     18 package org.apache.harmony.xnet.provider.jsse;
     19 
     20 /**
     21  *
     22  * Contains SSL 3.0 constants
     23  * @see <a href="http://wp.netscape.com/eng/ssl3">SSL 3.0 Spec.</a>
     24  */
     25 public class SSLv3Constants {
     26 
     27     /**
     28      * Client is a sender. Used in hash calculating for finished message.
     29      * @see <a href="http://wp.netscape.com/eng/ssl3">SSL 3.0 Spec., 5.6.9
     30      * Finished</a>
     31      */
     32     static final byte[] client = new byte[] { 0x43, 0x4C, 0x4E, 0x54 };
     33 
     34     /**
     35      * Server is a sender. Used in hash calculating for finished message.
     36      * @see <a href="http://wp.netscape.com/eng/ssl3">SSL 3.0 Spec., 5.6.9
     37      * Finished</a>
     38      */
     39     static final byte[] server = new byte[] { 0x53, 0x52, 0x56, 0x52 };
     40 
     41     /**
     42      * pad_1 for MD5
     43      * @see <a href="http://wp.netscape.com/eng/ssl3">SSL 3.0 Spec., 5.2.3.1
     44      * Null or standard stream cipher</a>
     45      */
     46     static final byte[] MD5pad1 = new byte[] { 0x36, 0x36, 0x36, 0x36,
     47             0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
     48             0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
     49             0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
     50             0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36 };
     51 
     52     /**
     53      * pad_1 for SHA
     54      * @see <a href="http://wp.netscape.com/eng/ssl3">SSL 3.0 Spec., 5.2.3.1
     55      * Null or standard stream cipher</a>
     56      */
     57     static final byte[] SHApad1 = new byte[] { 0x36, 0x36, 0x36, 0x36,
     58             0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
     59             0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
     60             0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
     61             0x36, 0x36, 0x36 };
     62 
     63     /**
     64      * pad_2 for MD5
     65      * @see <a href="http://wp.netscape.com/eng/ssl3">SSL 3.0 Spec., 5.2.3.1
     66      * Null or standard stream cipher</a>
     67      */
     68     static final byte[] MD5pad2 = new byte[] { 0x5C, 0x5C, 0x5C, 0x5C,
     69             0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
     70             0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
     71             0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
     72             0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C };
     73 
     74     /**
     75      * pad_2 for SHA
     76      * @see <a href="http://wp.netscape.com/eng/ssl3">SSL 3.0 Spec., 5.2.3.1
     77      * Null or standard stream cipher</a>
     78      */
     79     static final byte[] SHApad2 = new byte[] { 0x5C, 0x5C, 0x5C, 0x5C,
     80             0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
     81             0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
     82             0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
     83             0x5C, 0x5C, 0x5C };
     84 }
     85