diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/src/rsaref/Makefile.ssl | 102 | ||||
-rw-r--r-- | src/lib/libssl/src/rsaref/install.com | 69 | ||||
-rw-r--r-- | src/lib/libssl/src/rsaref/rsar_err.c | 119 | ||||
-rw-r--r-- | src/lib/libssl/src/rsaref/rsaref-lib.com | 902 | ||||
-rw-r--r-- | src/lib/libssl/src/rsaref/rsaref.c | 308 | ||||
-rw-r--r-- | src/lib/libssl/src/rsaref/rsaref.h | 180 |
6 files changed, 0 insertions, 1680 deletions
diff --git a/src/lib/libssl/src/rsaref/Makefile.ssl b/src/lib/libssl/src/rsaref/Makefile.ssl deleted file mode 100644 index 4085e9dba0..0000000000 --- a/src/lib/libssl/src/rsaref/Makefile.ssl +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | # | ||
2 | # SSLeay/rsaref/Makefile | ||
3 | # | ||
4 | |||
5 | DIR= rsaref | ||
6 | TOP= .. | ||
7 | CC= cc | ||
8 | INCLUDES= -I../crypto -I../include | ||
9 | CFLAG=-g | ||
10 | INSTALL_PREFIX= | ||
11 | OPENSSLDIR= /usr/local/ssl | ||
12 | INSTALLTOP=/usr/local/ssl | ||
13 | MAKE= make -f Makefile.ssl | ||
14 | MAKEDEPEND= $(TOP)/util/domd $(TOP) | ||
15 | MAKEFILE= Makefile.ssl | ||
16 | AR= ar r | ||
17 | |||
18 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
19 | |||
20 | GENERAL=Makefile rsaref-lib.com install.com | ||
21 | TEST= | ||
22 | APPS= | ||
23 | |||
24 | LIB=$(TOP)/libRSAglue.a | ||
25 | LIBSRC= rsaref.c rsar_err.c | ||
26 | LIBOBJ= rsaref.o rsar_err.o | ||
27 | |||
28 | SRC= $(LIBSRC) | ||
29 | |||
30 | EXHEADER= rsaref.h | ||
31 | HEADER= $(EXHEADER) | ||
32 | |||
33 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
34 | |||
35 | top: | ||
36 | (cd ..; $(MAKE) DIRS=rsaref all) | ||
37 | |||
38 | all: lib | ||
39 | |||
40 | lib: $(LIBOBJ) | ||
41 | $(AR) $(LIB) $(LIBOBJ) | ||
42 | @echo You may get an error following this line. Please ignore. | ||
43 | - $(RANLIB) $(LIB) | ||
44 | @touch lib | ||
45 | |||
46 | files: | ||
47 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | ||
48 | |||
49 | links: | ||
50 | @sh $(TOP)/util/point.sh Makefile.ssl Makefile | ||
51 | @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER) | ||
52 | @$(PERL) $(TOP)/util/mklink.pl ../test $(TEST) | ||
53 | @$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS) | ||
54 | |||
55 | install: | ||
56 | -@if [ "x`echo x $(EX_LIBS) | grep RSAglue`" != x ]; then \ | ||
57 | echo "installing libRSAglue.a"; \ | ||
58 | cp $(LIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/libRSAglue.a; \ | ||
59 | $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/libRSAglue.a; \ | ||
60 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/libRSAglue.a; \ | ||
61 | fi | ||
62 | |||
63 | # @for i in $(EXHEADER) ; \ | ||
64 | # do \ | ||
65 | # (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | ||
66 | # chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | ||
67 | # done; | ||
68 | |||
69 | tags: | ||
70 | ctags $(SRC) | ||
71 | |||
72 | tests: | ||
73 | |||
74 | lint: | ||
75 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
76 | |||
77 | depend: | ||
78 | $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) | ||
79 | |||
80 | dclean: | ||
81 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
82 | mv -f Makefile.new $(MAKEFILE) | ||
83 | |||
84 | clean: | ||
85 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
86 | |||
87 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
88 | |||
89 | rsar_err.o: ../include/openssl/bio.h ../include/openssl/bn.h | ||
90 | rsar_err.o: ../include/openssl/crypto.h ../include/openssl/err.h | ||
91 | rsar_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
92 | rsar_err.o: ../include/openssl/opensslv.h ../include/openssl/rsa.h | ||
93 | rsar_err.o: ../include/openssl/rsaref.h ../include/openssl/safestack.h | ||
94 | rsar_err.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
95 | rsaref.o: ../crypto/cryptlib.h ../include/openssl/bio.h ../include/openssl/bn.h | ||
96 | rsaref.o: ../include/openssl/buffer.h ../include/openssl/crypto.h | ||
97 | rsaref.o: ../include/openssl/e_os.h ../include/openssl/e_os2.h | ||
98 | rsaref.o: ../include/openssl/err.h ../include/openssl/lhash.h | ||
99 | rsaref.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
100 | rsaref.o: ../include/openssl/rand.h ../include/openssl/rsa.h | ||
101 | rsaref.o: ../include/openssl/rsaref.h ../include/openssl/safestack.h | ||
102 | rsaref.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
diff --git a/src/lib/libssl/src/rsaref/install.com b/src/lib/libssl/src/rsaref/install.com deleted file mode 100644 index c32cea5da8..0000000000 --- a/src/lib/libssl/src/rsaref/install.com +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | $! INSTALL.COM -- Installs the files in a given directory tree | ||
2 | $! | ||
3 | $! Author: Richard Levitte <richard@levitte.org> | ||
4 | $! Time of creation: 22-MAY-1998 10:13 | ||
5 | $! | ||
6 | $! P1 root of the directory tree | ||
7 | $! | ||
8 | $ IF P1 .EQS. "" | ||
9 | $ THEN | ||
10 | $ WRITE SYS$OUTPUT "First argument missing." | ||
11 | $ WRITE SYS$OUTPUT "Should be the directory where you want things installed." | ||
12 | $ EXIT | ||
13 | $ ENDIF | ||
14 | $ | ||
15 | $ ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0" | ||
16 | $ ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY") | ||
17 | $ ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") - | ||
18 | - "[000000." - "][" - "[" - "]" | ||
19 | $ ROOT = ROOT_DEV + "[" + ROOT_DIR | ||
20 | $ | ||
21 | $ DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC | ||
22 | $ DEFINE/NOLOG WRK_SSLVLIB WRK_SSLROOT:[VAX_LIB] | ||
23 | $ DEFINE/NOLOG WRK_SSLALIB WRK_SSLROOT:[ALPHA_LIB] | ||
24 | $ | ||
25 | $ IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN - | ||
26 | CREATE/DIR/LOG WRK_SSLROOT:[000000] | ||
27 | $ IF F$PARSE("WRK_SSLVLIB:") .EQS. "" THEN - | ||
28 | CREATE/DIR/LOG WRK_SSLVLIB: | ||
29 | $ IF F$PARSE("WRK_SSLALIB:") .EQS. "" THEN - | ||
30 | CREATE/DIR/LOG WRK_SSLALIB: | ||
31 | $ | ||
32 | $ LIBS := LIBRSAGLUE | ||
33 | $ | ||
34 | $ VEXE_DIR := [-.VAX.EXE.CRYPTO] | ||
35 | $ AEXE_DIR := [-.AXP.EXE.CRYPTO] | ||
36 | $ | ||
37 | $ I = 0 | ||
38 | $ LOOP_LIB: | ||
39 | $ E = F$EDIT(F$ELEMENT(I, ",", LIBS),"TRIM") | ||
40 | $ I = I + 1 | ||
41 | $ IF E .EQS. "," THEN GOTO LOOP_LIB_END | ||
42 | $ SET NOON | ||
43 | $ IF F$SEARCH(VEXE_DIR+E+".OLB") .NES. "" | ||
44 | $ THEN | ||
45 | $ COPY 'VEXE_DIR''E'.OLB WRK_SSLVLIB:'E'.OLB/log | ||
46 | $ SET FILE/PROT=W:RE WRK_SSLVLIB:'E'.OLB | ||
47 | $ ENDIF | ||
48 | $ ! Preparing for the time when we have shareable images | ||
49 | $ IF F$SEARCH(VEXE_DIR+E+".EXE") .NES. "" | ||
50 | $ THEN | ||
51 | $ COPY 'VEXE_DIR''E'.EXE WRK_SSLVLIB:'E'.EXE/log | ||
52 | $ SET FILE/PROT=W:RE WRK_SSLVLIB:'E'.EXE | ||
53 | $ ENDIF | ||
54 | $ IF F$SEARCH(AEXE_DIR+E+".OLB") .NES. "" | ||
55 | $ THEN | ||
56 | $ COPY 'AEXE_DIR''E'.OLB WRK_SSLALIB:'E'.OLB/log | ||
57 | $ SET FILE/PROT=W:RE WRK_SSLALIB:'E'.OLB | ||
58 | $ ENDIF | ||
59 | $ ! Preparing for the time when we have shareable images | ||
60 | $ IF F$SEARCH(AEXE_DIR+E+".EXE") .NES. "" | ||
61 | $ THEN | ||
62 | $ COPY 'AEXE_DIR''E'.EXE WRK_SSLALIB:'E'.EXE/log | ||
63 | $ SET FILE/PROT=W:RE WRK_SSLALIB:'E'.EXE | ||
64 | $ ENDIF | ||
65 | $ SET ON | ||
66 | $ GOTO LOOP_LIB | ||
67 | $ LOOP_LIB_END: | ||
68 | $ | ||
69 | $ EXIT | ||
diff --git a/src/lib/libssl/src/rsaref/rsar_err.c b/src/lib/libssl/src/rsaref/rsar_err.c deleted file mode 100644 index 5e7871f803..0000000000 --- a/src/lib/libssl/src/rsaref/rsar_err.c +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | /* rsaref/rsar_err.c */ | ||
2 | /* ==================================================================== | ||
3 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions | ||
7 | * are met: | ||
8 | * | ||
9 | * 1. Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * | ||
12 | * 2. Redistributions in binary form must reproduce the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer in | ||
14 | * the documentation and/or other materials provided with the | ||
15 | * distribution. | ||
16 | * | ||
17 | * 3. All advertising materials mentioning features or use of this | ||
18 | * software must display the following acknowledgment: | ||
19 | * "This product includes software developed by the OpenSSL Project | ||
20 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
21 | * | ||
22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
23 | * endorse or promote products derived from this software without | ||
24 | * prior written permission. For written permission, please contact | ||
25 | * openssl-core@OpenSSL.org. | ||
26 | * | ||
27 | * 5. Products derived from this software may not be called "OpenSSL" | ||
28 | * nor may "OpenSSL" appear in their names without prior written | ||
29 | * permission of the OpenSSL Project. | ||
30 | * | ||
31 | * 6. Redistributions of any form whatsoever must retain the following | ||
32 | * acknowledgment: | ||
33 | * "This product includes software developed by the OpenSSL Project | ||
34 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
35 | * | ||
36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
47 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
48 | * ==================================================================== | ||
49 | * | ||
50 | * This product includes cryptographic software written by Eric Young | ||
51 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
52 | * Hudson (tjh@cryptsoft.com). | ||
53 | * | ||
54 | */ | ||
55 | |||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | ||
57 | * made to it will be overwritten when the script next updates this file, | ||
58 | * only reason strings will be preserved. | ||
59 | */ | ||
60 | |||
61 | #include <stdio.h> | ||
62 | #include <openssl/err.h> | ||
63 | #include <openssl/rsaref.h> | ||
64 | |||
65 | /* BEGIN ERROR CODES */ | ||
66 | #ifndef NO_ERR | ||
67 | static ERR_STRING_DATA RSAREF_str_functs[]= | ||
68 | { | ||
69 | {ERR_PACK(0,RSAREF_F_BN_REF_MOD_EXP,0), "BN_REF_MOD_EXP"}, | ||
70 | {ERR_PACK(0,RSAREF_F_RSAREF_BN2BIN,0), "RSAREF_BN2BIN"}, | ||
71 | {ERR_PACK(0,RSAREF_F_RSA_BN2BIN,0), "RSA_BN2BIN"}, | ||
72 | {ERR_PACK(0,RSAREF_F_RSA_PRIVATE_DECRYPT,0), "RSA_private_decrypt"}, | ||
73 | {ERR_PACK(0,RSAREF_F_RSA_PRIVATE_ENCRYPT,0), "RSA_private_encrypt"}, | ||
74 | {ERR_PACK(0,RSAREF_F_RSA_PUBLIC_DECRYPT,0), "RSA_public_decrypt"}, | ||
75 | {ERR_PACK(0,RSAREF_F_RSA_PUBLIC_ENCRYPT,0), "RSA_public_encrypt"}, | ||
76 | {ERR_PACK(0,RSAREF_F_RSA_REF_BN2BIN,0), "RSA_REF_BN2BIN"}, | ||
77 | {ERR_PACK(0,RSAREF_F_RSA_REF_MOD_EXP,0), "RSA_REF_MOD_EXP"}, | ||
78 | {ERR_PACK(0,RSAREF_F_RSA_REF_PRIVATE_DECRYPT,0), "RSA_REF_PRIVATE_DECRYPT"}, | ||
79 | {ERR_PACK(0,RSAREF_F_RSA_REF_PRIVATE_ENCRYPT,0), "RSA_REF_PRIVATE_ENCRYPT"}, | ||
80 | {ERR_PACK(0,RSAREF_F_RSA_REF_PUBLIC_DECRYPT,0), "RSA_REF_PUBLIC_DECRYPT"}, | ||
81 | {ERR_PACK(0,RSAREF_F_RSA_REF_PUBLIC_ENCRYPT,0), "RSA_REF_PUBLIC_ENCRYPT"}, | ||
82 | {0,NULL} | ||
83 | }; | ||
84 | |||
85 | static ERR_STRING_DATA RSAREF_str_reasons[]= | ||
86 | { | ||
87 | {RSAREF_R_CONTENT_ENCODING ,"content encoding"}, | ||
88 | {RSAREF_R_DATA ,"data"}, | ||
89 | {RSAREF_R_DIGEST_ALGORITHM ,"digest algorithm"}, | ||
90 | {RSAREF_R_ENCODING ,"encoding"}, | ||
91 | {RSAREF_R_ENCRYPTION_ALGORITHM ,"encryption algorithm"}, | ||
92 | {RSAREF_R_KEY ,"key"}, | ||
93 | {RSAREF_R_KEY_ENCODING ,"key encoding"}, | ||
94 | {RSAREF_R_LEN ,"len"}, | ||
95 | {RSAREF_R_MODULUS_LEN ,"modulus len"}, | ||
96 | {RSAREF_R_NEED_RANDOM ,"need random"}, | ||
97 | {RSAREF_R_PRIVATE_KEY ,"private key"}, | ||
98 | {RSAREF_R_PUBLIC_KEY ,"public key"}, | ||
99 | {RSAREF_R_SIGNATURE ,"signature"}, | ||
100 | {RSAREF_R_SIGNATURE_ENCODING ,"signature encoding"}, | ||
101 | {0,NULL} | ||
102 | }; | ||
103 | |||
104 | #endif | ||
105 | |||
106 | void ERR_load_RSAREF_strings(void) | ||
107 | { | ||
108 | static int init=1; | ||
109 | |||
110 | if (init) | ||
111 | { | ||
112 | init=0; | ||
113 | #ifndef NO_ERR | ||
114 | ERR_load_strings(ERR_LIB_RSAREF,RSAREF_str_functs); | ||
115 | ERR_load_strings(ERR_LIB_RSAREF,RSAREF_str_reasons); | ||
116 | #endif | ||
117 | |||
118 | } | ||
119 | } | ||
diff --git a/src/lib/libssl/src/rsaref/rsaref-lib.com b/src/lib/libssl/src/rsaref/rsaref-lib.com deleted file mode 100644 index 53193720b6..0000000000 --- a/src/lib/libssl/src/rsaref/rsaref-lib.com +++ /dev/null | |||
@@ -1,902 +0,0 @@ | |||
1 | $! | ||
2 | $! RSAREF-LIB.COM | ||
3 | $! Written By: Robert Byer | ||
4 | $! Vice-President | ||
5 | $! A-Com Computing, Inc. | ||
6 | $! byer@mail.all-net.net | ||
7 | $! | ||
8 | $! Changes by Richard Levitte <richard@levitte.org> | ||
9 | $! | ||
10 | $! This command files compiles and creates the "[.xxx.EXE.RSAREF]LIBRSAGLUE.OLB" | ||
11 | $! library. The "xxx" denotes the machine architecture of AXP or VAX. | ||
12 | $! | ||
13 | $! Specify one of the following to build just that part or "ALL" to | ||
14 | $! just build everything. | ||
15 | $! | ||
16 | $! ALL To Just Build "Everything". | ||
17 | $! LIBRARY To Just Build The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library. | ||
18 | $! DHDEMO To Just Build The [.xxx.EXE.RSAREF]DHDEMO.EXE Program. | ||
19 | $! RDEMO To Just Build The [.xxx.EXE.RSAREF]RDEMO.EXE Program. | ||
20 | $! | ||
21 | $! Specify DEBUG or NODEBUG as P2 to compile with or without debugging | ||
22 | $! information. | ||
23 | $! | ||
24 | $! Specify which compiler at P3 to try to compile under. | ||
25 | $! | ||
26 | $! VAXC For VAX C. | ||
27 | $! DECC For DEC C. | ||
28 | $! GNUC For GNU C. | ||
29 | $! | ||
30 | $! If you don't speficy a compiler, it will prompt you for one. | ||
31 | $! | ||
32 | $! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) | ||
33 | $! | ||
34 | $! | ||
35 | $! Check Which Architecture We Are Using. | ||
36 | $! | ||
37 | $ IF (F$GETSYI("CPU").GE.128) | ||
38 | $ THEN | ||
39 | $! | ||
40 | $! The Architecture Is AXP | ||
41 | $! | ||
42 | $ ARCH := AXP | ||
43 | $! | ||
44 | $! Else... | ||
45 | $! | ||
46 | $ ELSE | ||
47 | $! | ||
48 | $! The Architecture Is VAX. | ||
49 | $! | ||
50 | $ ARCH := VAX | ||
51 | $! | ||
52 | $! End The Architecture Check. | ||
53 | $! | ||
54 | $ ENDIF | ||
55 | $! | ||
56 | $! Check To Make Sure We Have Valid Command Line Parameters. | ||
57 | $! | ||
58 | $ GOSUB CHECK_OPTIONS | ||
59 | $! | ||
60 | $! Initialise logical names and such | ||
61 | $! | ||
62 | $ GOSUB INITIALISE | ||
63 | $! | ||
64 | $! Tell The User What Kind of Machine We Run On. | ||
65 | $! | ||
66 | $ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine." | ||
67 | $! | ||
68 | $! Define The OBJ Directory Name. | ||
69 | $! | ||
70 | $ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.RSAREF] | ||
71 | $! | ||
72 | $! Check To See If The Architecture Specific OBJ Directory Exists. | ||
73 | $! | ||
74 | $ IF (F$PARSE(OBJ_DIR).EQS."") | ||
75 | $ THEN | ||
76 | $! | ||
77 | $! It Dosen't Exist, So Create It. | ||
78 | $! | ||
79 | $ CREATE/DIR 'OBJ_DIR' | ||
80 | $! | ||
81 | $! End The Architecture Specific OBJ Directory Check. | ||
82 | $! | ||
83 | $ ENDIF | ||
84 | $! | ||
85 | $! Define The EXE Directory Name. | ||
86 | $! | ||
87 | $ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.RSAREF] | ||
88 | $! | ||
89 | $! Check To See If The Architecture Specific EXE Directory Exists. | ||
90 | $! | ||
91 | $ IF (F$PARSE(EXE_DIR).EQS."") | ||
92 | $ THEN | ||
93 | $! | ||
94 | $! It Dosen't Exist, So Create It. | ||
95 | $! | ||
96 | $ CREATE/DIR 'EXE_DIR' | ||
97 | $! | ||
98 | $! End The Architecture Specific EXE Directory Check. | ||
99 | $! | ||
100 | $ ENDIF | ||
101 | $! | ||
102 | $! Define The Library Name. | ||
103 | $! | ||
104 | $ LIB_NAME := 'EXE_DIR'LIBRSAGLUE.OLB | ||
105 | $! | ||
106 | $! Check To See What We Are To Do. | ||
107 | $! | ||
108 | $ IF (BUILDALL.EQS."TRUE") | ||
109 | $ THEN | ||
110 | $! | ||
111 | $! Since Nothing Special Was Specified, Do Everything. | ||
112 | $! | ||
113 | $ GOSUB LIBRARY | ||
114 | $ GOSUB DHDEMO | ||
115 | $ GOSUB RDEMO | ||
116 | $! | ||
117 | $! Else... | ||
118 | $! | ||
119 | $ ELSE | ||
120 | $! | ||
121 | $! Build Just What The User Wants Us To Build. | ||
122 | $! | ||
123 | $ GOSUB 'BUILDALL' | ||
124 | $! | ||
125 | $! End The BUILDALL Check. | ||
126 | $! | ||
127 | $ ENDIF | ||
128 | $! | ||
129 | $! Time To EXIT. | ||
130 | $! | ||
131 | $ EXIT: | ||
132 | $ GOSUB CLEANUP | ||
133 | $ EXIT | ||
134 | $! | ||
135 | $ LIBRARY: | ||
136 | $! | ||
137 | $! Tell The User That We Are Compiling. | ||
138 | $! | ||
139 | $ WRITE SYS$OUTPUT "Compiling The ",LIB_NAME," Files." | ||
140 | $! | ||
141 | $! Check To See If We Already Have A "LIBRSAGLUE.OLB" Library... | ||
142 | $! | ||
143 | $ IF (F$SEARCH(LIB_NAME).EQS."") | ||
144 | $ THEN | ||
145 | $! | ||
146 | $! Guess Not, Create The Library. | ||
147 | $! | ||
148 | $ LIBRARY/CREATE/OBJECT 'LIB_NAME' | ||
149 | $! | ||
150 | $! End The Library Exist Check. | ||
151 | $! | ||
152 | $ ENDIF | ||
153 | $! | ||
154 | $! Define The RSAREF Library Files. | ||
155 | $! | ||
156 | $ LIB_RSAREF = "DESC,DIGIT,MD2C,MD5C,NN,PRIME,RSA,R_DH,R_ENCODE,R_ENHANC," + - | ||
157 | "R_KEYGEN,R_RANDOM,R_STDLIB" | ||
158 | $! | ||
159 | $! Define A File Counter And Set It To "0". | ||
160 | $! | ||
161 | $ FILE_COUNTER = 0 | ||
162 | $! | ||
163 | $! Top Of The File Loop. | ||
164 | $! | ||
165 | $ NEXT_FILE: | ||
166 | $! | ||
167 | $! O.K, Extract The File Name From The File List. | ||
168 | $! | ||
169 | $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",LIB_RSAREF) | ||
170 | $! | ||
171 | $! Check To See If We Are At The End Of The File List. | ||
172 | $! | ||
173 | $ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE | ||
174 | $! | ||
175 | $! Increment The Counter. | ||
176 | $! | ||
177 | $ FILE_COUNTER = FILE_COUNTER + 1 | ||
178 | $! | ||
179 | $! Create The Source File Name. | ||
180 | $! | ||
181 | $ SOURCE_FILE = "SYS$DISK:[.SOURCE]" + FILE_NAME + ".C" | ||
182 | $! | ||
183 | $! Tell The User We Are Compiling The Source File. | ||
184 | $! | ||
185 | $ WRITE SYS$OUTPUT " ",FILE_NAME,".C" | ||
186 | $! | ||
187 | $! Create The Object File Name. | ||
188 | $! | ||
189 | $ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ" | ||
190 | $ ON WARNING THEN GOTO NEXT_FILE | ||
191 | $! | ||
192 | $! Check To See If The File We Want To Compile Actually Exists. | ||
193 | $! | ||
194 | $ IF (F$SEARCH(SOURCE_FILE).EQS."") | ||
195 | $ THEN | ||
196 | $! | ||
197 | $! Tell The User That The File Dosen't Exist. | ||
198 | $! | ||
199 | $ WRITE SYS$OUTPUT "" | ||
200 | $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist." | ||
201 | $ WRITE SYS$OUTPUT "" | ||
202 | $! | ||
203 | $! Exit The Build. | ||
204 | $! | ||
205 | $ EXIT | ||
206 | $! | ||
207 | $! End The File Exist Check. | ||
208 | $! | ||
209 | $ ENDIF | ||
210 | $! | ||
211 | $! Compile The File. | ||
212 | $! | ||
213 | $ ON ERROR THEN GOTO NEXT_FILE | ||
214 | $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' | ||
215 | $! | ||
216 | $! Add It To The Library. | ||
217 | $! | ||
218 | $ LIBRARY/REPLACE/OBJECT 'LIB_NAME' 'OBJECT_FILE' | ||
219 | $! | ||
220 | $! Time To Clean Up The Object File. | ||
221 | $! | ||
222 | $ DELETE 'OBJECT_FILE';* | ||
223 | $! | ||
224 | $! Go Back And Do It Again. | ||
225 | $! | ||
226 | $ GOTO NEXT_FILE | ||
227 | $! | ||
228 | $! All Done With This Library Part. | ||
229 | $! | ||
230 | $ FILE_DONE: | ||
231 | $! | ||
232 | $! Tell The User That We Are All Done. | ||
233 | $! | ||
234 | $ WRITE SYS$OUTPUT "Library ",LIB_NAME," Built." | ||
235 | $! | ||
236 | $! All Done, Time To Return. | ||
237 | $! | ||
238 | $ RETURN | ||
239 | $! | ||
240 | $! Compile The [.xxx.EXE.RSAREF]DHDEMO Program. | ||
241 | $! | ||
242 | $ DHDEMO: | ||
243 | $! | ||
244 | $! Check To See If We Have The Proper Libraries. | ||
245 | $! | ||
246 | $ GOSUB LIB_CHECK | ||
247 | $! | ||
248 | $! Check To See If We Have A Linker Option File. | ||
249 | $! | ||
250 | $ GOSUB CHECK_OPT_FILE | ||
251 | $! | ||
252 | $! Check To See If The File We Want To Compile Actually Exists. | ||
253 | $! | ||
254 | $ IF (F$SEARCH("SYS$DISK:[.RDEMO]DHDEMO.C").EQS."") | ||
255 | $ THEN | ||
256 | $! | ||
257 | $! Tell The User That The File Dosen't Exist. | ||
258 | $! | ||
259 | $ WRITE SYS$OUTPUT "" | ||
260 | $ WRITE SYS$OUTPUT "The File [.RDEMO]DHDEMO.C Dosen't Exist." | ||
261 | $ WRITE SYS$OUTPUT "" | ||
262 | $! | ||
263 | $! Exit The Build. | ||
264 | $! | ||
265 | $ EXIT | ||
266 | $! | ||
267 | $! End The [.RDEMO]DHDEMO.C File Check. | ||
268 | $! | ||
269 | $ ENDIF | ||
270 | $! | ||
271 | $! Tell The User What We Are Building. | ||
272 | $! | ||
273 | $ WRITE SYS$OUTPUT "Building ",EXE_DIR,"DHDEMO.EXE" | ||
274 | $! | ||
275 | $! Compile The DHDEMO Program. | ||
276 | $! | ||
277 | $ CC/OBJECT='OBJ_DIR'DHDEMO.OBJ SYS$DISK:[.RDEMO]DHDEMO.C | ||
278 | $! | ||
279 | $! Link The DHDEMO Program. | ||
280 | $! | ||
281 | $ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS - | ||
282 | /EXE='EXE_DIR'DHDEMO.EXE 'OBJ_DIR'DHDEMO.OBJ, - | ||
283 | 'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION | ||
284 | $! | ||
285 | $! All Done, Time To Return. | ||
286 | $! | ||
287 | $ RETURN | ||
288 | $! | ||
289 | $! Compile The RDEMO Program. | ||
290 | $! | ||
291 | $ RDEMO: | ||
292 | $! | ||
293 | $! Check To See If We Have The Proper Libraries. | ||
294 | $! | ||
295 | $ GOSUB LIB_CHECK | ||
296 | $! | ||
297 | $! Check To See If We Have A Linker Option File. | ||
298 | $! | ||
299 | $ GOSUB CHECK_OPT_FILE | ||
300 | $! | ||
301 | $! Check To See If The File We Want To Compile Actually Exists. | ||
302 | $! | ||
303 | $ IF (F$SEARCH("SYS$DISK:[.RDEMO]RDEMO.C").EQS."") | ||
304 | $ THEN | ||
305 | $! | ||
306 | $! Tell The User That The File Dosen't Exist. | ||
307 | $! | ||
308 | $ WRITE SYS$OUTPUT "" | ||
309 | $ WRITE SYS$OUTPUT "The File [.RDEMO]RDEMO.C Dosen't Exist." | ||
310 | $ WRITE SYS$OUTPUT "" | ||
311 | $! | ||
312 | $! Exit The Build. | ||
313 | $! | ||
314 | $ EXIT | ||
315 | $! | ||
316 | $! End The [.RDEMO]RDEMO.C File Check. | ||
317 | $! | ||
318 | $ ENDIF | ||
319 | $! | ||
320 | $! Tell The User What We Are Building. | ||
321 | $! | ||
322 | $ WRITE SYS$OUTPUT "Building ",EXE_DIR,"RDEMO.EXE" | ||
323 | $! | ||
324 | $! Compile The RDEMO Program. | ||
325 | $! | ||
326 | $ CC/OBJECT='OBJ_DIR'RDEMO.OBJ SYS$DISK:[.RDEMO]RDEMO.C | ||
327 | $! | ||
328 | $! Link The RDEMO Program. | ||
329 | $! | ||
330 | $ LINK/'DEBUGGER'/'TRACEBACK'/CONTIGUOUS - | ||
331 | /EXE='EXE_DIR'RDEMO.EXE 'OBJ_DIR'RDEMO.OBJ, - | ||
332 | 'LIB_NAME'/LIBRARY,'OPT_FILE'/OPTION | ||
333 | $! | ||
334 | $! All Done, Time To Return. | ||
335 | $! | ||
336 | $ RETURN | ||
337 | $! | ||
338 | $! Check For The Link Option FIle. | ||
339 | $! | ||
340 | $ CHECK_OPT_FILE: | ||
341 | $! | ||
342 | $! Check To See If We Need To Make A VAX C Option File. | ||
343 | $! | ||
344 | $ IF (COMPILER.EQS."VAXC") | ||
345 | $ THEN | ||
346 | $! | ||
347 | $! Check To See If We Already Have A VAX C Linker Option File. | ||
348 | $! | ||
349 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
350 | $ THEN | ||
351 | $! | ||
352 | $! We Need A VAX C Linker Option File. | ||
353 | $! | ||
354 | $ CREATE 'OPT_FILE' | ||
355 | $DECK | ||
356 | ! | ||
357 | ! Default System Options File To Link Agianst | ||
358 | ! The Sharable VAX C Runtime Library. | ||
359 | ! | ||
360 | SYS$SHARE:VAXCRTL.EXE/SHARE | ||
361 | $EOD | ||
362 | $! | ||
363 | $! End The Option File Check. | ||
364 | $! | ||
365 | $ ENDIF | ||
366 | $! | ||
367 | $! End The VAXC Check. | ||
368 | $! | ||
369 | $ ENDIF | ||
370 | $! | ||
371 | $! Check To See If We Need A GNU C Option File. | ||
372 | $! | ||
373 | $ IF (COMPILER.EQS."GNUC") | ||
374 | $ THEN | ||
375 | $! | ||
376 | $! Check To See If We Already Have A GNU C Linker Option File. | ||
377 | $! | ||
378 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
379 | $ THEN | ||
380 | $! | ||
381 | $! We Need A GNU C Linker Option File. | ||
382 | $! | ||
383 | $ CREATE 'OPT_FILE' | ||
384 | $DECK | ||
385 | ! | ||
386 | ! Default System Options File To Link Agianst | ||
387 | ! The Sharable C Runtime Library. | ||
388 | ! | ||
389 | GNU_CC:[000000]GCCLIB/LIBRARY | ||
390 | SYS$SHARE:VAXCRTL/SHARE | ||
391 | $EOD | ||
392 | $! | ||
393 | $! End The Option File Check. | ||
394 | $! | ||
395 | $ ENDIF | ||
396 | $! | ||
397 | $! End The GNU C Check. | ||
398 | $! | ||
399 | $ ENDIF | ||
400 | $! | ||
401 | $! Check To See If We Need A DEC C Option File. | ||
402 | $! | ||
403 | $ IF (COMPILER.EQS."DECC") | ||
404 | $ THEN | ||
405 | $! | ||
406 | $! Check To See If We Already Have A DEC C Linker Option File. | ||
407 | $! | ||
408 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
409 | $ THEN | ||
410 | $! | ||
411 | $! Figure Out If We Need An AXP Or A VAX Linker Option File. | ||
412 | $! | ||
413 | $ IF (ARCH.EQS."VAX") | ||
414 | $ THEN | ||
415 | $! | ||
416 | $! We Need A DEC C Linker Option File For VAX. | ||
417 | $! | ||
418 | $ CREATE 'OPT_FILE' | ||
419 | $DECK | ||
420 | ! | ||
421 | ! Default System Options File To Link Agianst | ||
422 | ! The Sharable DEC C Runtime Library. | ||
423 | ! | ||
424 | SYS$SHARE:DECC$SHR.EXE/SHARE | ||
425 | $EOD | ||
426 | $! | ||
427 | $! Else... | ||
428 | $! | ||
429 | $ ELSE | ||
430 | $! | ||
431 | $! Create The AXP Linker Option File. | ||
432 | $! | ||
433 | $ CREATE 'OPT_FILE' | ||
434 | $DECK | ||
435 | ! | ||
436 | ! Default System Options File For AXP To Link Agianst | ||
437 | ! The Sharable C Runtime Library. | ||
438 | ! | ||
439 | SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE | ||
440 | SYS$SHARE:CMA$OPEN_RTL/SHARE | ||
441 | $EOD | ||
442 | $! | ||
443 | $! End The VAX/AXP DEC C Option File Check. | ||
444 | $! | ||
445 | $ ENDIF | ||
446 | $! | ||
447 | $! End The Option File Search. | ||
448 | $! | ||
449 | $ ENDIF | ||
450 | $! | ||
451 | $! End The DEC C Check. | ||
452 | $! | ||
453 | $ ENDIF | ||
454 | $! | ||
455 | $! Tell The User What Linker Option File We Are Using. | ||
456 | $! | ||
457 | $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." | ||
458 | $! | ||
459 | $! Time To RETURN. | ||
460 | $! | ||
461 | $ RETURN | ||
462 | $ LIB_CHECK: | ||
463 | $! | ||
464 | $! Look For The Library LIBRSAGLUE.OLB. | ||
465 | $! | ||
466 | $ IF (F$SEARCH(LIB_NAME).EQS."") | ||
467 | $ THEN | ||
468 | $! | ||
469 | $! Tell The User We Can't Find The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library. | ||
470 | $! | ||
471 | $ WRITE SYS$OUTPUT "" | ||
472 | $ WRITE SYS$OUTPUT "Can't Find The Library ",LIB_NAME,"." | ||
473 | $ WRITE SYS$OUTPUT "We Can't Link Without It." | ||
474 | $ WRITE SYS$OUTPUT "" | ||
475 | $! | ||
476 | $! And Ask If They Would Like To Build It. | ||
477 | $! | ||
478 | $ INQUIRE YESNO "Would You Like To Build The Library Now (Y/N)?" | ||
479 | $! | ||
480 | $! Check The Answer. | ||
481 | $! | ||
482 | $ IF (YESNO.EQS."Y").OR.(YESNO.EQS."y") | ||
483 | $ THEN | ||
484 | $! | ||
485 | $! Then Build The Library. | ||
486 | $! | ||
487 | $ GOSUB LIBRARY | ||
488 | $! | ||
489 | $! When Done With That, RETURN To Finish What Ever We Were Doing | ||
490 | $! That Needed The Library. | ||
491 | $! | ||
492 | $ RETURN | ||
493 | $! | ||
494 | $! Else... | ||
495 | $! | ||
496 | $ ELSE | ||
497 | $! | ||
498 | $! Since We Can't Link Without It, Exit. | ||
499 | $! | ||
500 | $ EXIT | ||
501 | $! | ||
502 | $! End The Answer Check. | ||
503 | $! | ||
504 | $ ENDIF | ||
505 | $! | ||
506 | $! End The Library Check. | ||
507 | $! | ||
508 | $ ENDIF | ||
509 | $! | ||
510 | $! Time To Return. | ||
511 | $! | ||
512 | $ RETURN | ||
513 | $! | ||
514 | $! Check The User's Options. | ||
515 | $! | ||
516 | $ CHECK_OPTIONS: | ||
517 | $! | ||
518 | $! Check To See If P1 Is Blank. | ||
519 | $! | ||
520 | $ IF (P1.EQS."ALL") | ||
521 | $ THEN | ||
522 | $! | ||
523 | $! P1 Is Blank, So Build Everything. | ||
524 | $! | ||
525 | $ BUILDALL = "TRUE" | ||
526 | $! | ||
527 | $! Else... | ||
528 | $! | ||
529 | $ ELSE | ||
530 | $! | ||
531 | $! Else, Check To See If P1 Has A Valid Arguement. | ||
532 | $! | ||
533 | $ IF (P1.EQS."LIBRARY").OR.(P1.EQS."DHDEMO").OR.(P1.EQS."RDEMO") | ||
534 | $ THEN | ||
535 | $! | ||
536 | $! A Valid Arguement. | ||
537 | $! | ||
538 | $ BUILDALL = P1 | ||
539 | $! | ||
540 | $! Else.... | ||
541 | $! | ||
542 | $ ELSE | ||
543 | $! | ||
544 | $! Tell The User We Don't Know What They Want. | ||
545 | $! | ||
546 | $ WRITE SYS$OUTPUT "" | ||
547 | $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:" | ||
548 | $ WRITE SYS$OUTPUT "" | ||
549 | $ WRITE SYS$OUTPUT " ALL : To Just Build Everything." | ||
550 | $ WRITE SYS$OUTPUT " LIBRARY : To Compile Just The [.xxx.EXE.RSAREF]LIBRSAGLUE.OLB Library." | ||
551 | $ WRITE SYS$OUTPUT " DHDEMO : To Compile Just The [.xxx.EXE.RSAREF]DHDEMO Program." | ||
552 | $ WRITE SYS$OUTPUT " RDEMO : To Compile Just The [.xxx.EXE.RSAREF]RDEMO Program. | ||
553 | $ WRITE SYS$OUTPUT "" | ||
554 | $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:" | ||
555 | $ WRITE SYS$OUTPUT "" | ||
556 | $ WRITE SYS$OUTPUT " AXP : Alpha Architecture." | ||
557 | $ WRITE SYS$OUTPUT " VAX : VAX Architecture." | ||
558 | $ WRITE SYS$OUTPUT "" | ||
559 | $! | ||
560 | $! Time To EXIT. | ||
561 | $! | ||
562 | $ EXIT | ||
563 | $! | ||
564 | $! End The Valid Arguement Check. | ||
565 | $! | ||
566 | $ ENDIF | ||
567 | $! | ||
568 | $! End The P1 Check. | ||
569 | $! | ||
570 | $ ENDIF | ||
571 | $! | ||
572 | $! Check To See If P2 Is Blank. | ||
573 | $! | ||
574 | $ IF (P2.EQS."NODEBUG") | ||
575 | $ THEN | ||
576 | $! | ||
577 | $! P2 Is "NODEBUG" So Compile Without Debugger Information. | ||
578 | $! | ||
579 | $ DEBUGGER = "NODEBUG" | ||
580 | $ TRACEBACK = "NOTRACEBACK" | ||
581 | $ GCC_OPTIMIZE = "OPTIMIZE" | ||
582 | $ CC_OPTIMIZE = "OPTIMIZE" | ||
583 | $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." | ||
584 | $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." | ||
585 | $ ELSE | ||
586 | $! | ||
587 | $! Check To See If We Are To Compile With Debugger Information. | ||
588 | $! | ||
589 | $ IF (P2.EQS."DEBUG") | ||
590 | $ THEN | ||
591 | $! | ||
592 | $! Compile With Debugger Information. | ||
593 | $! | ||
594 | $ DEBUGGER = "DEBUG" | ||
595 | $ TRACEBACK = "TRACEBACK" | ||
596 | $ GCC_OPTIMIZE = "NOOPTIMIZE" | ||
597 | $ CC_OPTIMIZE = "NOOPTIMIZE" | ||
598 | $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." | ||
599 | $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." | ||
600 | $ ELSE | ||
601 | $! | ||
602 | $! Tell The User Entered An Invalid Option.. | ||
603 | $! | ||
604 | $ WRITE SYS$OUTPUT "" | ||
605 | $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" | ||
606 | $ WRITE SYS$OUTPUT "" | ||
607 | $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." | ||
608 | $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." | ||
609 | $ WRITE SYS$OUTPUT "" | ||
610 | $! | ||
611 | $! Time To EXIT. | ||
612 | $! | ||
613 | $ EXIT | ||
614 | $! | ||
615 | $! End The Valid Arguement Check. | ||
616 | $! | ||
617 | $ ENDIF | ||
618 | $! | ||
619 | $! End The P2 Check. | ||
620 | $! | ||
621 | $ ENDIF | ||
622 | $! | ||
623 | $! Special Threads For OpenVMS v7.1 Or Later. | ||
624 | $! | ||
625 | $! Written By: Richard Levitte | ||
626 | $! richard@levitte.org | ||
627 | $! | ||
628 | $! | ||
629 | $! Check To See If We Have A Option For P4. | ||
630 | $! | ||
631 | $ IF (P4.EQS."") | ||
632 | $ THEN | ||
633 | $! | ||
634 | $! Get The Version Of VMS We Are Using. | ||
635 | $! | ||
636 | $ ISSEVEN := | ||
637 | $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION"))) | ||
638 | $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP)) | ||
639 | $! | ||
640 | $! Check To See If The VMS Version Is v7.1 Or Later. | ||
641 | $! | ||
642 | $ IF (TMP.GE.71) | ||
643 | $ THEN | ||
644 | $! | ||
645 | $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads. | ||
646 | $! | ||
647 | $ ISSEVEN := ,PTHREAD_USE_D4 | ||
648 | $! | ||
649 | $! End The VMS Version Check. | ||
650 | $! | ||
651 | $ ENDIF | ||
652 | $! | ||
653 | $! End The P4 Check. | ||
654 | $! | ||
655 | $ ENDIF | ||
656 | $! | ||
657 | $! Check To See If P3 Is Blank. | ||
658 | $! | ||
659 | $ IF (P3.EQS."") | ||
660 | $ THEN | ||
661 | $! | ||
662 | $! O.K., The User Didn't Specify A Compiler, Let's Try To | ||
663 | $! Find Out Which One To Use. | ||
664 | $! | ||
665 | $! Check To See If We Have GNU C. | ||
666 | $! | ||
667 | $ IF (F$TRNLNM("GNU_CC").NES."") | ||
668 | $ THEN | ||
669 | $! | ||
670 | $! Looks Like GNUC, Set To Use GNUC. | ||
671 | $! | ||
672 | $ COMPILER = "GNUC" | ||
673 | $! | ||
674 | $! End The GNU C Compiler Check. | ||
675 | $! | ||
676 | $ ELSE | ||
677 | $! | ||
678 | $! Check To See If We Have VAXC Or DECC. | ||
679 | $! | ||
680 | $ IF (ARCH.EQS."ALPHA").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."") | ||
681 | $ THEN | ||
682 | $! | ||
683 | $! Looks Like DECC, Set To Use DECC. | ||
684 | $! | ||
685 | $ COMPILER = "DECC" | ||
686 | $! | ||
687 | $! Tell The User We Are Using DECC. | ||
688 | $! | ||
689 | $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." | ||
690 | $! | ||
691 | $! Else... | ||
692 | $! | ||
693 | $ ELSE | ||
694 | $! | ||
695 | $! Looks Like VAXC, Set To Use VAXC. | ||
696 | $! | ||
697 | $ COMPILER = "VAXC" | ||
698 | $! | ||
699 | $! End The VAXC Compiler Check. | ||
700 | $! | ||
701 | $ ENDIF | ||
702 | $! | ||
703 | $! End The DECC & VAXC Compiler Check. | ||
704 | $! | ||
705 | $ ENDIF | ||
706 | $! | ||
707 | $! End The Compiler Check. | ||
708 | $! | ||
709 | $ ENDIF | ||
710 | $! | ||
711 | $! Set Up Initial CC Definitions, Possibly With User Ones | ||
712 | $! | ||
713 | $ CCDEFS = "VMS=1" | ||
714 | $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS | ||
715 | $ CCEXTRAFLAGS = "" | ||
716 | $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS | ||
717 | $ CCDISABLEWARNINGS = "" | ||
718 | $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - | ||
719 | CCDISABLEWARNINGS = USER_CCDISABLEWARNINGS | ||
720 | $! | ||
721 | $! Check To See If The User Entered A Valid Paramter. | ||
722 | $! | ||
723 | $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC") | ||
724 | $ THEN | ||
725 | $! | ||
726 | $! Check To See If The User Wanted DECC. | ||
727 | $! | ||
728 | $ IF (P3.EQS."DECC") | ||
729 | $ THEN | ||
730 | $! | ||
731 | $! Looks Like DECC, Set To Use DECC. | ||
732 | $! | ||
733 | $ COMPILER = "DECC" | ||
734 | $! | ||
735 | $! Tell The User We Are Using DECC. | ||
736 | $! | ||
737 | $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." | ||
738 | $! | ||
739 | $! Use DECC... | ||
740 | $! | ||
741 | $ CC = "CC" | ||
742 | $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - | ||
743 | THEN CC = "CC/DECC" | ||
744 | $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + - | ||
745 | "/NOLIST/PREFIX=ALL" + - | ||
746 | "/INCLUDE=(SYS$DISK:[-.CRYPTO],SYS$DISK:[.SOURCE])" + CCEXTRAFLAGS | ||
747 | $! | ||
748 | $! Define The Linker Options File Name. | ||
749 | $! | ||
750 | $ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT" | ||
751 | $! | ||
752 | $! End DECC Check. | ||
753 | $! | ||
754 | $ ENDIF | ||
755 | $! | ||
756 | $! Check To See If We Are To Use VAXC. | ||
757 | $! | ||
758 | $ IF (P3.EQS."VAXC") | ||
759 | $ THEN | ||
760 | $! | ||
761 | $! Looks Like VAXC, Set To Use VAXC. | ||
762 | $! | ||
763 | $ COMPILER = "VAXC" | ||
764 | $! | ||
765 | $! Tell The User We Are Using VAX C. | ||
766 | $! | ||
767 | $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." | ||
768 | $! | ||
769 | $! Compile Using VAXC. | ||
770 | $! | ||
771 | $ CC = "CC" | ||
772 | $ IF ARCH.EQS."AXP" | ||
773 | $ THEN | ||
774 | $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!" | ||
775 | $ EXIT | ||
776 | $ ENDIF | ||
777 | $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" | ||
778 | $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - | ||
779 | "/INCLUDE=(SYS$DISK:[-.CRYPTO],SYS$DISK:[.SOURCE])" + CCEXTRAFLAGS | ||
780 | $ CCDEFS = CCDEFS + ",""VAXC""" | ||
781 | $! | ||
782 | $! Define <sys> As SYS$COMMON:[SYSLIB] | ||
783 | $! | ||
784 | $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] | ||
785 | $! | ||
786 | $! Define The Linker Options File Name. | ||
787 | $! | ||
788 | $ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT" | ||
789 | $! | ||
790 | $! End VAXC Check | ||
791 | $! | ||
792 | $ ENDIF | ||
793 | $! | ||
794 | $! Check To See If We Are To Use GNU C. | ||
795 | $! | ||
796 | $ IF (P3.EQS."GNUC") | ||
797 | $ THEN | ||
798 | $! | ||
799 | $! Looks Like GNUC, Set To Use GNUC. | ||
800 | $! | ||
801 | $ COMPILER = "GNUC" | ||
802 | $! | ||
803 | $! Tell The User We Are Using GNUC. | ||
804 | $! | ||
805 | $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." | ||
806 | $! | ||
807 | $! Use GNU C... | ||
808 | $! | ||
809 | $ IF F$TYPE(GCC) .EQS. "" THEN GCC := GCC | ||
810 | $ CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - | ||
811 | "/INCLUDE=(SYS$DISK:[-.CRYPTO],SYS$DISK:[.SOURCE])" + CCEXTRAFLAGS | ||
812 | $! | ||
813 | $! Define The Linker Options File Name. | ||
814 | $! | ||
815 | $ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT" | ||
816 | $! | ||
817 | $! End The GNU C Check. | ||
818 | $! | ||
819 | $ ENDIF | ||
820 | $! | ||
821 | $! Set up default defines | ||
822 | $! | ||
823 | $ CCDEFS = """FLAT_INC=1""," + CCDEFS | ||
824 | $ CCDEFS = CCDEFS + ",""RSAref=1""" | ||
825 | $! | ||
826 | $! Finish up the definition of CC. | ||
827 | $! | ||
828 | $ IF COMPILER .EQS. "DECC" | ||
829 | $ THEN | ||
830 | $ IF CCDISABLEWARNINGS .NES. "" | ||
831 | $ THEN | ||
832 | $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" | ||
833 | $ ENDIF | ||
834 | $ ELSE | ||
835 | $ CCDISABLEWARNINGS = "" | ||
836 | $ ENDIF | ||
837 | $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS | ||
838 | $! | ||
839 | $! Show user the result | ||
840 | $! | ||
841 | $ WRITE SYS$OUTPUT "Main Compiling Command: ",CC | ||
842 | $! | ||
843 | $! Else The User Entered An Invalid Arguement. | ||
844 | $! | ||
845 | $ ELSE | ||
846 | $! | ||
847 | $! Tell The User We Don't Know What They Want. | ||
848 | $! | ||
849 | $ WRITE SYS$OUTPUT "" | ||
850 | $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" | ||
851 | $ WRITE SYS$OUTPUT "" | ||
852 | $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." | ||
853 | $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." | ||
854 | $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C." | ||
855 | $ WRITE SYS$OUTPUT "" | ||
856 | $! | ||
857 | $! Time To EXIT. | ||
858 | $! | ||
859 | $ EXIT | ||
860 | $! | ||
861 | $! End The P3 Check. | ||
862 | $! | ||
863 | $ ENDIF | ||
864 | $! | ||
865 | $! Time To RETURN... | ||
866 | $! | ||
867 | $ RETURN | ||
868 | $! | ||
869 | $ INITIALISE: | ||
870 | $! | ||
871 | $! Save old value of the logical name OPENSSL | ||
872 | $! | ||
873 | $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE") | ||
874 | $! | ||
875 | $! Save directory information | ||
876 | $! | ||
877 | $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;" | ||
878 | $ __TOP = __HERE - "RSAREF]" | ||
879 | $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" | ||
880 | $! | ||
881 | $! Set up the logical name OPENSSL to point at the include directory | ||
882 | $! | ||
883 | $ DEFINE OPENSSL/NOLOG '__INCLUDE' | ||
884 | $! | ||
885 | $! Done | ||
886 | $! | ||
887 | $ RETURN | ||
888 | $! | ||
889 | $ CLEANUP: | ||
890 | $! | ||
891 | $! Restore the logical name OPENSSL if it had a value | ||
892 | $! | ||
893 | $ IF __SAVE_OPENSSL .EQS. "" | ||
894 | $ THEN | ||
895 | $ DEASSIGN OPENSSL | ||
896 | $ ELSE | ||
897 | $ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL' | ||
898 | $ ENDIF | ||
899 | $! | ||
900 | $! Done | ||
901 | $! | ||
902 | $ RETURN | ||
diff --git a/src/lib/libssl/src/rsaref/rsaref.c b/src/lib/libssl/src/rsaref/rsaref.c deleted file mode 100644 index ae70feb3e9..0000000000 --- a/src/lib/libssl/src/rsaref/rsaref.c +++ /dev/null | |||
@@ -1,308 +0,0 @@ | |||
1 | /* rsaref/rsaref.c */ | ||
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 NO_RSA | ||
60 | #include <stdio.h> | ||
61 | #include "cryptlib.h" | ||
62 | #include <openssl/bn.h> | ||
63 | #include <openssl/rsa.h> | ||
64 | #include <openssl/rsaref.h> | ||
65 | #include <openssl/rand.h> | ||
66 | |||
67 | static int RSAref_bn2bin(BIGNUM * from, unsigned char* to, int max); | ||
68 | #ifdef undef | ||
69 | static BIGNUM* RSAref_bin2bn(unsigned char* from, BIGNUM * to, int max); | ||
70 | #endif | ||
71 | static int RSAref_Public_eay2ref(RSA * from, RSArefPublicKey * to); | ||
72 | static int RSAref_Private_eay2ref(RSA * from, RSArefPrivateKey * to); | ||
73 | int RSA_ref_private_decrypt(int len, unsigned char *from, | ||
74 | unsigned char *to, RSA *rsa, int padding); | ||
75 | int RSA_ref_private_encrypt(int len, unsigned char *from, | ||
76 | unsigned char *to, RSA *rsa, int padding); | ||
77 | int RSA_ref_public_encrypt(int len, unsigned char *from, | ||
78 | unsigned char *to, RSA *rsa, int padding); | ||
79 | int RSA_ref_public_decrypt(int len, unsigned char *from, | ||
80 | unsigned char *to, RSA *rsa, int padding); | ||
81 | static int BN_ref_mod_exp(BIGNUM *r,BIGNUM *a,const BIGNUM *p,const BIGNUM *m, | ||
82 | BN_CTX *ctx, BN_MONT_CTX *m_ctx); | ||
83 | static int RSA_ref_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa); | ||
84 | static RSA_METHOD rsa_pkcs1_ref_meth={ | ||
85 | "RSAref PKCS#1 RSA", | ||
86 | RSA_ref_public_encrypt, | ||
87 | RSA_ref_public_decrypt, | ||
88 | RSA_ref_private_encrypt, | ||
89 | RSA_ref_private_decrypt, | ||
90 | RSA_ref_mod_exp, | ||
91 | BN_ref_mod_exp, | ||
92 | NULL, | ||
93 | NULL, | ||
94 | 0, | ||
95 | NULL, | ||
96 | }; | ||
97 | |||
98 | RSA_METHOD *RSA_PKCS1_RSAref(void) | ||
99 | { | ||
100 | return(&rsa_pkcs1_ref_meth); | ||
101 | } | ||
102 | |||
103 | static int RSA_ref_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa) | ||
104 | { | ||
105 | RSAREFerr(RSAREF_F_RSA_REF_MOD_EXP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
106 | return(0); | ||
107 | } | ||
108 | |||
109 | static int BN_ref_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, | ||
110 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx) | ||
111 | { | ||
112 | RSAREFerr(RSAREF_F_BN_REF_MOD_EXP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
113 | return(0); | ||
114 | } | ||
115 | |||
116 | /* unsigned char *to: [max] */ | ||
117 | static int RSAref_bn2bin(BIGNUM *from, unsigned char *to, int max) | ||
118 | { | ||
119 | int i; | ||
120 | |||
121 | i=BN_num_bytes(from); | ||
122 | if (i > max) | ||
123 | { | ||
124 | RSAREFerr(RSAREF_F_RSAREF_BN2BIN,RSAREF_R_LEN); | ||
125 | return(0); | ||
126 | } | ||
127 | |||
128 | memset(to,0,(unsigned int)max); | ||
129 | if (!BN_bn2bin(from,&(to[max-i]))) | ||
130 | return(0); | ||
131 | return(1); | ||
132 | } | ||
133 | |||
134 | #ifdef undef | ||
135 | /* unsigned char *from: [max] */ | ||
136 | static BIGNUM *RSAref_bin2bn(unsigned char *from, BIGNUM *to, int max) | ||
137 | { | ||
138 | int i; | ||
139 | BIGNUM *ret; | ||
140 | |||
141 | for (i=0; i<max; i++) | ||
142 | if (from[i]) break; | ||
143 | |||
144 | ret=BN_bin2bn(&(from[i]),max-i,to); | ||
145 | return(ret); | ||
146 | } | ||
147 | |||
148 | static int RSAref_Public_ref2eay(RSArefPublicKey *from, RSA *to) | ||
149 | { | ||
150 | to->n=RSAref_bin2bn(from->m,NULL,RSAref_MAX_LEN); | ||
151 | to->e=RSAref_bin2bn(from->e,NULL,RSAref_MAX_LEN); | ||
152 | if ((to->n == NULL) || (to->e == NULL)) return(0); | ||
153 | return(1); | ||
154 | } | ||
155 | #endif | ||
156 | |||
157 | static int RSAref_Public_eay2ref(RSA *from, RSArefPublicKey *to) | ||
158 | { | ||
159 | to->bits=BN_num_bits(from->n); | ||
160 | if (!RSAref_bn2bin(from->n,to->m,RSAref_MAX_LEN)) return(0); | ||
161 | if (!RSAref_bn2bin(from->e,to->e,RSAref_MAX_LEN)) return(0); | ||
162 | return(1); | ||
163 | } | ||
164 | |||
165 | #ifdef undef | ||
166 | static int RSAref_Private_ref2eay(RSArefPrivateKey *from, RSA *to) | ||
167 | { | ||
168 | if ((to->n=RSAref_bin2bn(from->m,NULL,RSAref_MAX_LEN)) == NULL) | ||
169 | return(0); | ||
170 | if ((to->e=RSAref_bin2bn(from->e,NULL,RSAref_MAX_LEN)) == NULL) | ||
171 | return(0); | ||
172 | if ((to->d=RSAref_bin2bn(from->d,NULL,RSAref_MAX_LEN)) == NULL) | ||
173 | return(0); | ||
174 | if ((to->p=RSAref_bin2bn(from->prime[0],NULL,RSAref_MAX_PLEN)) == NULL) | ||
175 | return(0); | ||
176 | if ((to->q=RSAref_bin2bn(from->prime[1],NULL,RSAref_MAX_PLEN)) == NULL) | ||
177 | return(0); | ||
178 | if ((to->dmp1=RSAref_bin2bn(from->pexp[0],NULL,RSAref_MAX_PLEN)) | ||
179 | == NULL) | ||
180 | return(0); | ||
181 | if ((to->dmq1=RSAref_bin2bn(from->pexp[1],NULL,RSAref_MAX_PLEN)) | ||
182 | == NULL) | ||
183 | return(0); | ||
184 | if ((to->iqmp=RSAref_bin2bn(from->coef,NULL,RSAref_MAX_PLEN)) == NULL) | ||
185 | return(0); | ||
186 | return(1); | ||
187 | } | ||
188 | #endif | ||
189 | |||
190 | static int RSAref_Private_eay2ref(RSA *from, RSArefPrivateKey *to) | ||
191 | { | ||
192 | to->bits=BN_num_bits(from->n); | ||
193 | if (!RSAref_bn2bin(from->n,to->m,RSAref_MAX_LEN)) return(0); | ||
194 | if (!RSAref_bn2bin(from->e,to->e,RSAref_MAX_LEN)) return(0); | ||
195 | if (!RSAref_bn2bin(from->d,to->d,RSAref_MAX_LEN)) return(0); | ||
196 | if (!RSAref_bn2bin(from->p,to->prime[0],RSAref_MAX_PLEN)) return(0); | ||
197 | if (!RSAref_bn2bin(from->q,to->prime[1],RSAref_MAX_PLEN)) return(0); | ||
198 | if (!RSAref_bn2bin(from->dmp1,to->pexp[0],RSAref_MAX_PLEN)) return(0); | ||
199 | if (!RSAref_bn2bin(from->dmq1,to->pexp[1],RSAref_MAX_PLEN)) return(0); | ||
200 | if (!RSAref_bn2bin(from->iqmp,to->coef,RSAref_MAX_PLEN)) return(0); | ||
201 | return(1); | ||
202 | } | ||
203 | |||
204 | int RSA_ref_private_decrypt(int len, unsigned char *from, unsigned char *to, | ||
205 | RSA *rsa, int padding) | ||
206 | { | ||
207 | int i,outlen= -1; | ||
208 | RSArefPrivateKey RSAkey; | ||
209 | |||
210 | if (!RSAref_Private_eay2ref(rsa,&RSAkey)) | ||
211 | goto err; | ||
212 | if ((i=RSAPrivateDecrypt(to,&outlen,from,len,&RSAkey)) != 0) | ||
213 | { | ||
214 | RSAREFerr(RSAREF_F_RSA_REF_PRIVATE_DECRYPT,i); | ||
215 | outlen= -1; | ||
216 | } | ||
217 | err: | ||
218 | memset(&RSAkey,0,sizeof(RSAkey)); | ||
219 | return(outlen); | ||
220 | } | ||
221 | |||
222 | int RSA_ref_private_encrypt(int len, unsigned char *from, unsigned char *to, | ||
223 | RSA *rsa, int padding) | ||
224 | { | ||
225 | int i,outlen= -1; | ||
226 | RSArefPrivateKey RSAkey; | ||
227 | |||
228 | if (padding != RSA_PKCS1_PADDING) | ||
229 | { | ||
230 | RSAREFerr(RSAREF_F_RSA_REF_PRIVATE_ENCRYPT, RSA_R_UNKNOWN_PADDING_TYPE); | ||
231 | goto err; | ||
232 | } | ||
233 | if (!RSAref_Private_eay2ref(rsa,&RSAkey)) | ||
234 | goto err; | ||
235 | if ((i=RSAPrivateEncrypt(to,&outlen,from,len,&RSAkey)) != 0) | ||
236 | { | ||
237 | RSAREFerr(RSAREF_F_RSA_REF_PRIVATE_ENCRYPT,i); | ||
238 | outlen= -1; | ||
239 | } | ||
240 | err: | ||
241 | memset(&RSAkey,0,sizeof(RSAkey)); | ||
242 | return(outlen); | ||
243 | } | ||
244 | |||
245 | int RSA_ref_public_decrypt(int len, unsigned char *from, unsigned char *to, | ||
246 | RSA *rsa, int padding) | ||
247 | { | ||
248 | int i,outlen= -1; | ||
249 | RSArefPublicKey RSAkey; | ||
250 | |||
251 | if (!RSAref_Public_eay2ref(rsa,&RSAkey)) | ||
252 | goto err; | ||
253 | if ((i=RSAPublicDecrypt(to,&outlen,from,len,&RSAkey)) != 0) | ||
254 | { | ||
255 | RSAREFerr(RSAREF_F_RSA_REF_PUBLIC_DECRYPT,i); | ||
256 | outlen= -1; | ||
257 | } | ||
258 | err: | ||
259 | memset(&RSAkey,0,sizeof(RSAkey)); | ||
260 | return(outlen); | ||
261 | } | ||
262 | |||
263 | int RSA_ref_public_encrypt(int len, unsigned char *from, unsigned char *to, | ||
264 | RSA *rsa, int padding) | ||
265 | { | ||
266 | int outlen= -1; | ||
267 | int i; | ||
268 | RSArefPublicKey RSAkey; | ||
269 | RSARandomState rnd; | ||
270 | unsigned char buf[16]; | ||
271 | |||
272 | if (padding != RSA_PKCS1_PADDING && padding != RSA_SSLV23_PADDING) | ||
273 | { | ||
274 | RSAREFerr(RSAREF_F_RSA_REF_PUBLIC_ENCRYPT, RSA_R_UNKNOWN_PADDING_TYPE); | ||
275 | goto err; | ||
276 | } | ||
277 | |||
278 | R_RandomInit(&rnd); | ||
279 | R_GetRandomBytesNeeded((unsigned int *)&i,&rnd); | ||
280 | while (i > 0) | ||
281 | { | ||
282 | if (RAND_bytes(buf,16) <= 0) | ||
283 | goto err; | ||
284 | R_RandomUpdate(&rnd,buf,(unsigned int)((i>16)?16:i)); | ||
285 | i-=16; | ||
286 | } | ||
287 | |||
288 | if (!RSAref_Public_eay2ref(rsa,&RSAkey)) | ||
289 | goto err; | ||
290 | if ((i=RSAPublicEncrypt(to,&outlen,from,len,&RSAkey,&rnd)) != 0) | ||
291 | { | ||
292 | RSAREFerr(RSAREF_F_RSA_REF_PUBLIC_ENCRYPT,i); | ||
293 | outlen= -1; | ||
294 | goto err; | ||
295 | } | ||
296 | err: | ||
297 | memset(&RSAkey,0,sizeof(RSAkey)); | ||
298 | R_RandomFinal(&rnd); | ||
299 | memset(&rnd,0,sizeof(rnd)); | ||
300 | return(outlen); | ||
301 | } | ||
302 | #else /* !NO_RSA */ | ||
303 | |||
304 | # if PEDANTIC | ||
305 | static void *dummy=&dummy; | ||
306 | # endif | ||
307 | |||
308 | #endif | ||
diff --git a/src/lib/libssl/src/rsaref/rsaref.h b/src/lib/libssl/src/rsaref/rsaref.h deleted file mode 100644 index 498449f40e..0000000000 --- a/src/lib/libssl/src/rsaref/rsaref.h +++ /dev/null | |||
@@ -1,180 +0,0 @@ | |||
1 | /* rsaref/rsaref.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_RSAREF_H | ||
60 | #define HEADER_RSAREF_H | ||
61 | |||
62 | #ifndef NO_RSA | ||
63 | #include <openssl/rsa.h> | ||
64 | |||
65 | #ifdef __cplusplus | ||
66 | extern "C" { | ||
67 | #endif | ||
68 | |||
69 | /* RSAeuro */ | ||
70 | /*#define RSAref_MAX_BITS 2048*/ | ||
71 | |||
72 | /* RSAref */ | ||
73 | #define RSAref_MAX_BITS 1024 | ||
74 | |||
75 | #define RSAref_MIN_BITS 508 | ||
76 | #define RSAref_MAX_LEN ((RSAref_MAX_BITS+7)/8) | ||
77 | #define RSAref_MAX_PBITS (RSAref_MAX_BITS+1)/2 | ||
78 | #define RSAref_MAX_PLEN ((RSAref_MAX_PBITS+7)/8) | ||
79 | |||
80 | typedef struct RSArefPublicKey_st | ||
81 | { | ||
82 | unsigned int bits; | ||
83 | unsigned char m[RSAref_MAX_LEN]; | ||
84 | unsigned char e[RSAref_MAX_LEN]; | ||
85 | } RSArefPublicKey; | ||
86 | |||
87 | typedef struct RSArefPrivateKey_st | ||
88 | { | ||
89 | unsigned int bits; | ||
90 | unsigned char m[RSAref_MAX_LEN]; | ||
91 | unsigned char e[RSAref_MAX_LEN]; | ||
92 | unsigned char d[RSAref_MAX_LEN]; | ||
93 | unsigned char prime[2][RSAref_MAX_PLEN];/* p & q */ | ||
94 | unsigned char pexp[2][RSAref_MAX_PLEN]; /* dmp1 & dmq1 */ | ||
95 | unsigned char coef[RSAref_MAX_PLEN]; /* iqmp */ | ||
96 | } RSArefPrivateKey; | ||
97 | |||
98 | typedef struct RSARandomState_st | ||
99 | { | ||
100 | unsigned int needed; | ||
101 | unsigned char state[16]; | ||
102 | unsigned int outputnum; | ||
103 | unsigned char output[16]; | ||
104 | } RSARandomState; | ||
105 | |||
106 | #define RE_CONTENT_ENCODING 0x0400 | ||
107 | #define RE_DATA 0x0401 | ||
108 | #define RE_DIGEST_ALGORITHM 0x0402 | ||
109 | #define RE_ENCODING 0x0403 | ||
110 | #define RE_KEY 0x0404 | ||
111 | #define RE_KEY_ENCODING 0x0405 | ||
112 | #define RE_LEN 0x0406 | ||
113 | #define RE_MODULUS_LEN 0x0407 | ||
114 | #define RE_NEED_RANDOM 0x0408 | ||
115 | #define RE_PRIVATE_KEY 0x0409 | ||
116 | #define RE_PUBLIC_KEY 0x040a | ||
117 | #define RE_SIGNATURE 0x040b | ||
118 | #define RE_SIGNATURE_ENCODING 0x040c | ||
119 | #define RE_ENCRYPTION_ALGORITHM 0x040d | ||
120 | |||
121 | int RSAPrivateDecrypt(unsigned char *to, int *outlen, unsigned char *from, | ||
122 | int len, RSArefPrivateKey *RSAkey); | ||
123 | int RSAPrivateEncrypt(unsigned char *to, int *outlen, unsigned char *from, | ||
124 | int len, RSArefPrivateKey *RSAkey); | ||
125 | int RSAPublicDecrypt(unsigned char *to, int *outlen, unsigned char *from, | ||
126 | int len, RSArefPublicKey *RSAkey); | ||
127 | int RSAPublicEncrypt(unsigned char *to, int *outlen, unsigned char *from, | ||
128 | int len, RSArefPublicKey *RSAkey,RSARandomState *rnd); | ||
129 | int R_RandomInit(RSARandomState *rnd); | ||
130 | int R_GetRandomBytesNeeded(unsigned int *,RSARandomState *rnd); | ||
131 | int R_RandomUpdate(RSARandomState *rnd, unsigned char *data, unsigned int n); | ||
132 | int R_RandomFinal(RSARandomState *rnd); | ||
133 | |||
134 | void ERR_load_RSAREF_strings(void ); | ||
135 | RSA_METHOD *RSA_PKCS1_RSAref(void ); | ||
136 | |||
137 | #ifdef __cplusplus | ||
138 | } | ||
139 | #endif | ||
140 | #endif | ||
141 | |||
142 | /* BEGIN ERROR CODES */ | ||
143 | /* The following lines are auto generated by the script mkerr.pl. Any changes | ||
144 | * made after this point may be overwritten when the script is next run. | ||
145 | */ | ||
146 | |||
147 | /* Error codes for the RSAREF functions. */ | ||
148 | |||
149 | /* Function codes. */ | ||
150 | #define RSAREF_F_BN_REF_MOD_EXP 100 | ||
151 | #define RSAREF_F_RSAREF_BN2BIN 101 | ||
152 | #define RSAREF_F_RSA_BN2BIN 102 | ||
153 | #define RSAREF_F_RSA_PRIVATE_DECRYPT 103 | ||
154 | #define RSAREF_F_RSA_PRIVATE_ENCRYPT 104 | ||
155 | #define RSAREF_F_RSA_PUBLIC_DECRYPT 105 | ||
156 | #define RSAREF_F_RSA_PUBLIC_ENCRYPT 106 | ||
157 | #define RSAREF_F_RSA_REF_BN2BIN 107 | ||
158 | #define RSAREF_F_RSA_REF_MOD_EXP 108 | ||
159 | #define RSAREF_F_RSA_REF_PRIVATE_DECRYPT 109 | ||
160 | #define RSAREF_F_RSA_REF_PRIVATE_ENCRYPT 110 | ||
161 | #define RSAREF_F_RSA_REF_PUBLIC_DECRYPT 111 | ||
162 | #define RSAREF_F_RSA_REF_PUBLIC_ENCRYPT 112 | ||
163 | |||
164 | /* Reason codes. */ | ||
165 | #define RSAREF_R_CONTENT_ENCODING 0x0400 | ||
166 | #define RSAREF_R_DATA 0x0401 | ||
167 | #define RSAREF_R_DIGEST_ALGORITHM 0x0402 | ||
168 | #define RSAREF_R_ENCODING 0x0403 | ||
169 | #define RSAREF_R_ENCRYPTION_ALGORITHM 0x040d | ||
170 | #define RSAREF_R_KEY 0x0404 | ||
171 | #define RSAREF_R_KEY_ENCODING 0x0405 | ||
172 | #define RSAREF_R_LEN 0x0406 | ||
173 | #define RSAREF_R_MODULUS_LEN 0x0407 | ||
174 | #define RSAREF_R_NEED_RANDOM 0x0408 | ||
175 | #define RSAREF_R_PRIVATE_KEY 0x0409 | ||
176 | #define RSAREF_R_PUBLIC_KEY 0x040a | ||
177 | #define RSAREF_R_SIGNATURE 0x040b | ||
178 | #define RSAREF_R_SIGNATURE_ENCODING 0x040c | ||
179 | |||
180 | #endif | ||