summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/conf
diff options
context:
space:
mode:
authorryker <>1998-10-05 20:13:14 +0000
committerryker <>1998-10-05 20:13:14 +0000
commitaeeae06a79815dc190061534d47236cec09f9e32 (patch)
tree851692b9c2f9c04f077666855641900f19fdb217 /src/lib/libcrypto/conf
parenta4f79641824cbf9f60ca9d1168d1fcc46717a82a (diff)
downloadopenbsd-aeeae06a79815dc190061534d47236cec09f9e32.tar.gz
openbsd-aeeae06a79815dc190061534d47236cec09f9e32.tar.bz2
openbsd-aeeae06a79815dc190061534d47236cec09f9e32.zip
Import of SSLeay-0.9.0b with RSA and IDEA stubbed + OpenBSD build
functionality for shared libs. Note that routines such as sslv2_init and friends that use RSA will not work due to lack of RSA in this library. Needs documentation and help from ports for easy upgrade to full functionality where legally possible.
Diffstat (limited to 'src/lib/libcrypto/conf')
-rw-r--r--src/lib/libcrypto/conf/conf.h114
-rw-r--r--src/lib/libcrypto/conf/conf_err.c96
-rw-r--r--src/lib/libcrypto/conf/keysets.pl61
-rw-r--r--src/lib/libcrypto/conf/ssleay.cnf78
4 files changed, 349 insertions, 0 deletions
diff --git a/src/lib/libcrypto/conf/conf.h b/src/lib/libcrypto/conf/conf.h
new file mode 100644
index 0000000000..1446226a16
--- /dev/null
+++ b/src/lib/libcrypto/conf/conf.h
@@ -0,0 +1,114 @@
1/* crypto/conf/conf.h */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef HEADER_CONF_H
60#define HEADER_CONF_H
61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#include "stack.h"
67#include "lhash.h"
68
69typedef struct
70 {
71 char *section;
72 char *name;
73 char *value;
74 } CONF_VALUE;
75
76#ifndef NOPROTO
77
78LHASH *CONF_load(LHASH *conf,char *file,long *eline);
79STACK *CONF_get_section(LHASH *conf,char *section);
80char *CONF_get_string(LHASH *conf,char *group,char *name);
81long CONF_get_number(LHASH *conf,char *group,char *name);
82void CONF_free(LHASH *conf);
83void ERR_load_CONF_strings(void );
84
85#else
86
87LHASH *CONF_load();
88STACK *CONF_get_section();
89char *CONF_get_string();
90long CONF_get_number();
91void CONF_free();
92void ERR_load_CONF_strings();
93
94#endif
95
96/* BEGIN ERROR CODES */
97/* Error codes for the CONF functions. */
98
99/* Function codes. */
100#define CONF_F_CONF_LOAD 100
101#define CONF_F_STR_COPY 101
102
103/* Reason codes. */
104#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
105#define CONF_R_MISSING_EQUAL_SIGN 101
106#define CONF_R_NO_CLOSE_BRACE 102
107#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
108#define CONF_R_VARIABLE_HAS_NO_VALUE 104
109
110#ifdef __cplusplus
111}
112#endif
113#endif
114
diff --git a/src/lib/libcrypto/conf/conf_err.c b/src/lib/libcrypto/conf/conf_err.c
new file mode 100644
index 0000000000..a8db8f266f
--- /dev/null
+++ b/src/lib/libcrypto/conf/conf_err.c
@@ -0,0 +1,96 @@
1/* lib/conf/conf_err.c */
2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58#include <stdio.h>
59#include "err.h"
60#include "conf.h"
61
62/* BEGIN ERROR CODES */
63#ifndef NO_ERR
64static ERR_STRING_DATA CONF_str_functs[]=
65 {
66{ERR_PACK(0,CONF_F_CONF_LOAD,0), "CONF_load"},
67{ERR_PACK(0,CONF_F_STR_COPY,0), "STR_COPY"},
68{0,NULL},
69 };
70
71static ERR_STRING_DATA CONF_str_reasons[]=
72 {
73{CONF_R_MISSING_CLOSE_SQUARE_BRACKET ,"missing close square bracket"},
74{CONF_R_MISSING_EQUAL_SIGN ,"missing equal sign"},
75{CONF_R_NO_CLOSE_BRACE ,"no close brace"},
76{CONF_R_UNABLE_TO_CREATE_NEW_SECTION ,"unable to create new section"},
77{CONF_R_VARIABLE_HAS_NO_VALUE ,"variable has no value"},
78{0,NULL},
79 };
80
81#endif
82
83void ERR_load_CONF_strings()
84 {
85 static int init=1;
86
87 if (init);
88 {;
89 init=0;
90#ifndef NO_ERR
91 ERR_load_strings(ERR_LIB_CONF,CONF_str_functs);
92 ERR_load_strings(ERR_LIB_CONF,CONF_str_reasons);
93#endif
94
95 }
96 }
diff --git a/src/lib/libcrypto/conf/keysets.pl b/src/lib/libcrypto/conf/keysets.pl
new file mode 100644
index 0000000000..e40fed0ca1
--- /dev/null
+++ b/src/lib/libcrypto/conf/keysets.pl
@@ -0,0 +1,61 @@
1#!/usr/bin/perl
2
3$NUMBER=0x01;
4$UPPER=0x02;
5$LOWER=0x04;
6$EOF=0x08;
7$WS=0x10;
8$ESC=0x20;
9$QUOTE=0x40;
10$COMMENT=0x80;
11$UNDER=0x100;
12
13foreach (0 .. 127)
14 {
15 $v=0;
16 $c=sprintf("%c",$_);
17 $v|=$NUMBER if ($c =~ /[0-9]/);
18 $v|=$UPPER if ($c =~ /[A-Z]/);
19 $v|=$LOWER if ($c =~ /[a-z]/);
20 $v|=$UNDER if ($c =~ /_/);
21 $v|=$WS if ($c =~ / \t\r\n/);
22 $v|=$ESC if ($c =~ /\\/);
23 $v|=$QUOTE if ($c =~ /['`"]/);
24 $v|=$COMMENT if ($c =~ /\#/);
25 $v|=$EOF if ($c =~ /\0/);
26
27 push(@V,$v);
28 }
29
30print <<"EOF";
31#define CONF_NUMBER $NUMBER
32#define CONF_UPPER $UPPER
33#define CONF_LOWER $LOWER
34#define CONF_EOF $EOF
35#define CONF_WS $WS
36#define CONF_ESC $ESC
37#define CONF_QUOTE $QUOTE
38#define CONF_COMMENT $COMMENT
39#define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
40#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
41#define CONF_UNDER $UNDER
42
43#define IS_COMMENT(a) (CONF_COMMENT&(CONF_type[(a)&0x7f]))
44#define IS_EOF(a) ((a) == '\\0')
45#define IS_ESC(a) ((a) == '\\\\')
46#define IS_NUMER(a) (CONF_type[(a)&0x7f]&CONF_NUMBER)
47#define IS_WS(a) (CONF_type[(a)&0x7f]&CONF_WS)
48#define IS_ALPHA_NUMERIC(a) (CONF_type[(a)&0x7f]&CONF_ALPHA_NUMERIC)
49#define IS_QUOTE(a) (CONF_type[(a)&0x7f]&CONF_QUOTE)
50
51EOF
52
53print "static unsigned short CONF_type[128]={";
54
55for ($i=0; $i<128; $i++)
56 {
57 print "\n\t" if ($i % 8) == 0;
58 printf "0x%03X,",$V[$i];
59 }
60
61print "\n\t};\n";
diff --git a/src/lib/libcrypto/conf/ssleay.cnf b/src/lib/libcrypto/conf/ssleay.cnf
new file mode 100644
index 0000000000..ed33af601e
--- /dev/null
+++ b/src/lib/libcrypto/conf/ssleay.cnf
@@ -0,0 +1,78 @@
1#
2# This is a test configuration file for use in SSLeay etc...
3#
4
5init = 5
6in\#it1 =10
7init2='10'
8init3='10\''
9init4="10'"
10init5='='10\'' again'
11
12SSLeay::version = 0.5.0
13
14[genrsa]
15default_bits = 512
16SSLEAY::version = 0.5.0
17
18[gendh]
19default_bits = 512
20def_generator = 2
21
22[s_client]
23cipher1 = DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5\
24cipher2 = 'DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5'
25cipher3 = "DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5"
26cipher4 = DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
27
28[ default ]
29cert_dir = $ENV::HOME/.ca_certs
30
31HOME = /tmp/eay
32
33tmp_cert_dir = $HOME/.ca_certs
34tmp2_cert_dir = thisis$(HOME)stuff
35
36LOGNAME = Eric Young (home=$HOME)
37
38[ special ]
39
40H=$HOME
41H=$default::HOME
42H=$ENV::HOME
43#
44# SSLeay example configuration file.
45# This is mostly being used for generation of certificate requests.
46#
47
48RANDFILE = $HOME/.rand
49
50[ req ]
51default_bits = 512
52default_keyfile = privkey.pem
53
54Attribute_type_1 = countryName
55Attribute_text_1 = Country Name (2 letter code)
56Attribute_default_1 = AU
57
58Attribute_type_2 = stateOrProvinceName
59Attribute_text_2 = State or Province Name (full name)
60Attribute_default_2 = Queensland
61
62Attribute_type_3 = localityName
63Attribute_text_3 = Locality Name (eg, city)
64
65Attribute_type_4 = organizationName
66Attribute_text_4 = Organization Name (eg, company)
67Attribute_default_4 = Mincom Pty Ltd
68
69Attribute_type_5 = organizationalUnitName
70Attribute_text_5 = Organizational Unit Name (eg, section)
71Attribute_default_5 = TR
72
73Attribute_type_6 = commonName
74Attribute_text_6 = Common Name (eg, YOUR name)
75
76Attribute_type_7 = emailAddress
77Attribute_text_7 = Email Address
78