Back to index

lightning-sunbird  0.9+nobinonly
sslc.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is the Netscape security libraries.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Netscape Communications Corporation.
00018  * Portions created by the Initial Developer are Copyright (C) 1994-2000
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPL"), or
00025  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00026  * in which case the provisions of the GPL or the LGPL are applicable instead
00027  * of those above. If you wish to allow use of your version of this file only
00028  * under the terms of either the GPL or the LGPL, and not to allow others to
00029  * use your version of this file under the terms of the MPL, indicate your
00030  * decision by deleting the provisions above and replace them with the notice
00031  * and other provisions required by the GPL or the LGPL. If you do not delete
00032  * the provisions above, a recipient may use your version of this file under
00033  * the terms of any one of the MPL, the GPL or the LGPL.
00034  *
00035  * ***** END LICENSE BLOCK ***** */
00036 #ifndef SSLC_H
00037 #define SSLC_H
00038 
00039 #include "ssls.h"
00040 
00041 struct cipherspec {
00042   int sslversion;  /* either 2 or 3 */
00043   int exportable;  /* 0=domestic cipher,  1=exportable */
00044   int ks,sks;      /* key size, secret key size (bits) */
00045   char *name;      /* name expected from SecurityStatus */
00046   int enableid;    /* the cipher id used by SSL_EnableCipher */
00047   int on;          /* 0= do not enable this cipher, 1 = enable */
00048 };
00049 
00050 
00051 /* Ugly way to generate code to fill in cipher_array struct */
00052 /* I wanted to make this part of the static structure initialization,
00053    but some compilers complain that the .on field is not constant */
00054 
00055 #define CIPHER(p_sslversion,p_policy,p_ks,p_sks,p_name,p_x) {\
00056  cipher_array[i].sslversion = p_sslversion; \
00057  cipher_array[i].exportable = p_policy;     \
00058  cipher_array[i].ks         = p_ks;         \
00059  cipher_array[i].sks        = p_sks;        \
00060  cipher_array[i].name       = p_name;       \
00061  cipher_array[i].enableid   = SSL_ ## p_x;  \
00062  cipher_array[i].on         = REP_Cipher_ ## p_x; \
00063  i++; }
00064 
00065 /* A DIPHER is a disabled-cipher (don't run the test suite) */
00066 #define DIPHER(sslversion,policy,ks,sks,name,x)  ;
00067 
00068 
00069 /* These constants are indexes into the 'nicknames' array */
00070 
00071 #define NO_CERT                       -1
00072 #define CLIENT_CERT_VERISIGN          1
00073 #define CLIENT_CERT_HARDCOREII_1024   2
00074 #define CLIENT_CERT_HARDCOREII_512    3
00075 #define CLIENT_CERT_SPARK             4
00076 #define SERVER_CERT_HARDCOREII_512    5
00077 #define SERVER_CERT_VERISIGN_REGULAR  6
00078 #define SERVER_CERT_VERISIGN_STEPUP   7
00079 #define SERVER_CERT_SPARK             8
00080 #define MAX_NICKNAME                  10
00081 
00082 extern struct cipherspec cipher_array[];
00083 extern int cipher_array_size;
00084 
00085 extern void ClearCiphers();
00086 extern void EnableCiphers();
00087 extern void SetPolicy();
00088 extern int  Version2Enable();
00089 extern int  Version3Enable();
00090 extern int  Version23Clear();
00091 extern char *nicknames[];
00092 extern void SetupNickNames();
00093 extern int  SetServerSecParms(struct ThreadData *td);
00094 
00095 
00096 #endif
00097 /* SSLC_H */
00098 
00099