summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ui')
-rw-r--r--src/lib/libcrypto/ui/Makefile115
-rw-r--r--src/lib/libcrypto/ui/Makefile.ssl117
-rw-r--r--src/lib/libcrypto/ui/ui_compat.c67
-rw-r--r--src/lib/libcrypto/ui/ui_err.c48
4 files changed, 321 insertions, 26 deletions
diff --git a/src/lib/libcrypto/ui/Makefile b/src/lib/libcrypto/ui/Makefile
new file mode 100644
index 0000000000..fcb2a66a39
--- /dev/null
+++ b/src/lib/libcrypto/ui/Makefile
@@ -0,0 +1,115 @@
1#
2# OpenSSL/crypto/ui/Makefile
3#
4
5DIR= ui
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
12INSTALLTOP=/usr/local/ssl
13MAKEDEPPROG= makedepend
14MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
15MAKEFILE= Makefile
16AR= ar r
17
18CFLAGS= $(INCLUDES) $(CFLAG)
19
20GENERAL=Makefile
21#TEST= uitest.c
22TEST=
23APPS=
24
25COMPATSRC= ui_compat.c
26COMPATOBJ= ui_compat.o
27
28LIB=$(TOP)/libcrypto.a
29LIBSRC= ui_err.c ui_lib.c ui_openssl.c ui_util.c $(COMPATSRC)
30LIBOBJ= ui_err.o ui_lib.o ui_openssl.o ui_util.o $(COMPATOBJ)
31
32SRC= $(LIBSRC)
33
34EXHEADER= ui.h ui_compat.h
35HEADER= $(EXHEADER) ui_locl.h
36
37ALL= $(GENERAL) $(SRC) $(HEADER)
38
39top:
40 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
41
42all: lib
43
44lib: $(LIBOBJ)
45 $(AR) $(LIB) $(LIBOBJ)
46 $(RANLIB) $(LIB) || echo Never mind.
47 @touch lib
48
49files:
50 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
51
52links:
53 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
54 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
55 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
56
57install:
58 @headerlist="$(EXHEADER)"; for i in $$headerlist ; \
59 do \
60 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
61 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
62 done;
63
64tags:
65 ctags $(SRC)
66
67tests:
68
69lint:
70 lint -DLINT $(INCLUDES) $(SRC)>fluff
71
72depend:
73 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
74
75dclean:
76 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
77 mv -f Makefile.new $(MAKEFILE)
78
79clean:
80 rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
81
82# DO NOT DELETE THIS LINE -- make depend depends on it.
83
84ui_compat.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
85ui_compat.o: ../../include/openssl/opensslconf.h
86ui_compat.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
87ui_compat.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
88ui_compat.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
89ui_compat.o: ui_compat.c
90ui_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
91ui_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
92ui_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
93ui_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
94ui_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
95ui_err.o: ../../include/openssl/ui.h ui_err.c
96ui_lib.o: ../../e_os.h ../../include/openssl/bio.h
97ui_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
98ui_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
99ui_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
100ui_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
101ui_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
102ui_lib.o: ../../include/openssl/ui.h ../cryptlib.h ui_lib.c ui_locl.h
103ui_openssl.o: ../../e_os.h ../../include/openssl/bio.h
104ui_openssl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
105ui_openssl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
106ui_openssl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
107ui_openssl.o: ../../include/openssl/opensslv.h
108ui_openssl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
109ui_openssl.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
110ui_openssl.o: ../cryptlib.h ui_locl.h ui_openssl.c
111ui_util.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
112ui_util.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
113ui_util.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
114ui_util.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
115ui_util.o: ui_util.c
diff --git a/src/lib/libcrypto/ui/Makefile.ssl b/src/lib/libcrypto/ui/Makefile.ssl
new file mode 100644
index 0000000000..ba46951d1c
--- /dev/null
+++ b/src/lib/libcrypto/ui/Makefile.ssl
@@ -0,0 +1,117 @@
1#
2# OpenSSL/crypto/ui/Makefile
3#
4
5DIR= ui
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
12INSTALLTOP=/usr/local/ssl
13MAKE= make -f Makefile.ssl
14MAKEDEPPROG= makedepend
15MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
16MAKEFILE= Makefile.ssl
17AR= ar r
18
19CFLAGS= $(INCLUDES) $(CFLAG)
20
21GENERAL=Makefile
22#TEST= uitest.c
23TEST=
24APPS=
25
26COMPATSRC= ui_compat.c
27COMPATOBJ= ui_compat.o
28
29LIB=$(TOP)/libcrypto.a
30LIBSRC= ui_err.c ui_lib.c ui_openssl.c ui_util.c $(COMPATSRC)
31LIBOBJ= ui_err.o ui_lib.o ui_openssl.o ui_util.o $(COMPATOBJ)
32
33SRC= $(LIBSRC)
34
35EXHEADER= ui.h ui_compat.h
36HEADER= $(EXHEADER) ui_locl.h
37
38ALL= $(GENERAL) $(SRC) $(HEADER)
39
40top:
41 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
42
43all: lib
44
45lib: $(LIBOBJ)
46 $(AR) $(LIB) $(LIBOBJ)
47 $(RANLIB) $(LIB) || echo Never mind.
48 @touch lib
49
50files:
51 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
52
53links:
54 @sh $(TOP)/util/point.sh Makefile.ssl Makefile
55 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
56 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
57 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
58
59install:
60 @for i in $(EXHEADER) ; \
61 do \
62 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
63 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
64 done;
65
66tags:
67 ctags $(SRC)
68
69tests:
70
71lint:
72 lint -DLINT $(INCLUDES) $(SRC)>fluff
73
74depend:
75 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
76
77dclean:
78 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
79 mv -f Makefile.new $(MAKEFILE)
80
81clean:
82 rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
83
84# DO NOT DELETE THIS LINE -- make depend depends on it.
85
86ui_compat.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
87ui_compat.o: ../../include/openssl/opensslconf.h
88ui_compat.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
89ui_compat.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
90ui_compat.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
91ui_compat.o: ui_compat.c
92ui_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
93ui_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
94ui_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
95ui_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
96ui_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
97ui_err.o: ../../include/openssl/ui.h ui_err.c
98ui_lib.o: ../../e_os.h ../../include/openssl/bio.h
99ui_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
100ui_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
101ui_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
102ui_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
103ui_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
104ui_lib.o: ../../include/openssl/ui.h ../cryptlib.h ui_lib.c ui_locl.h
105ui_openssl.o: ../../e_os.h ../../include/openssl/bio.h
106ui_openssl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
107ui_openssl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
108ui_openssl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
109ui_openssl.o: ../../include/openssl/opensslv.h
110ui_openssl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
111ui_openssl.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
112ui_openssl.o: ../cryptlib.h ui_locl.h ui_openssl.c
113ui_util.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
114ui_util.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
115ui_util.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
116ui_util.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
117ui_util.o: ui_util.c
diff --git a/src/lib/libcrypto/ui/ui_compat.c b/src/lib/libcrypto/ui/ui_compat.c
new file mode 100644
index 0000000000..13e0f70d90
--- /dev/null
+++ b/src/lib/libcrypto/ui/ui_compat.c
@@ -0,0 +1,67 @@
1/* crypto/ui/ui_compat.c -*- mode:C; c-file-style: "eay" -*- */
2/* ====================================================================
3 * Copyright (c) 2001-2002 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#include <string.h>
57#include <openssl/ui_compat.h>
58
59int _ossl_old_des_read_pw_string(char *buf,int length,const char *prompt,int verify)
60 {
61 return UI_UTIL_read_pw_string(buf, length, prompt, verify);
62 }
63
64int _ossl_old_des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify)
65 {
66 return UI_UTIL_read_pw(buf, buff, size, prompt, verify);
67 }
diff --git a/src/lib/libcrypto/ui/ui_err.c b/src/lib/libcrypto/ui/ui_err.c
index d983cdd66f..39a62ae737 100644
--- a/src/lib/libcrypto/ui/ui_err.c
+++ b/src/lib/libcrypto/ui/ui_err.c
@@ -1,6 +1,6 @@
1/* crypto/ui/ui_err.c */ 1/* crypto/ui/ui_err.c */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
@@ -64,36 +64,32 @@
64 64
65/* BEGIN ERROR CODES */ 65/* BEGIN ERROR CODES */
66#ifndef OPENSSL_NO_ERR 66#ifndef OPENSSL_NO_ERR
67
68#define ERR_FUNC(func) ERR_PACK(ERR_LIB_UI,func,0)
69#define ERR_REASON(reason) ERR_PACK(ERR_LIB_UI,0,reason)
70
71static ERR_STRING_DATA UI_str_functs[]= 67static ERR_STRING_DATA UI_str_functs[]=
72 { 68 {
73{ERR_FUNC(UI_F_GENERAL_ALLOCATE_BOOLEAN), "GENERAL_ALLOCATE_BOOLEAN"}, 69{ERR_PACK(0,UI_F_GENERAL_ALLOCATE_BOOLEAN,0), "GENERAL_ALLOCATE_BOOLEAN"},
74{ERR_FUNC(UI_F_GENERAL_ALLOCATE_PROMPT), "GENERAL_ALLOCATE_PROMPT"}, 70{ERR_PACK(0,UI_F_GENERAL_ALLOCATE_PROMPT,0), "GENERAL_ALLOCATE_PROMPT"},
75{ERR_FUNC(UI_F_GENERAL_ALLOCATE_STRING), "GENERAL_ALLOCATE_STRING"}, 71{ERR_PACK(0,UI_F_GENERAL_ALLOCATE_STRING,0), "GENERAL_ALLOCATE_STRING"},
76{ERR_FUNC(UI_F_UI_CTRL), "UI_ctrl"}, 72{ERR_PACK(0,UI_F_UI_CTRL,0), "UI_ctrl"},
77{ERR_FUNC(UI_F_UI_DUP_ERROR_STRING), "UI_dup_error_string"}, 73{ERR_PACK(0,UI_F_UI_DUP_ERROR_STRING,0), "UI_dup_error_string"},
78{ERR_FUNC(UI_F_UI_DUP_INFO_STRING), "UI_dup_info_string"}, 74{ERR_PACK(0,UI_F_UI_DUP_INFO_STRING,0), "UI_dup_info_string"},
79{ERR_FUNC(UI_F_UI_DUP_INPUT_BOOLEAN), "UI_dup_input_boolean"}, 75{ERR_PACK(0,UI_F_UI_DUP_INPUT_BOOLEAN,0), "UI_dup_input_boolean"},
80{ERR_FUNC(UI_F_UI_DUP_INPUT_STRING), "UI_dup_input_string"}, 76{ERR_PACK(0,UI_F_UI_DUP_INPUT_STRING,0), "UI_dup_input_string"},
81{ERR_FUNC(UI_F_UI_DUP_VERIFY_STRING), "UI_dup_verify_string"}, 77{ERR_PACK(0,UI_F_UI_DUP_VERIFY_STRING,0), "UI_dup_verify_string"},
82{ERR_FUNC(UI_F_UI_GET0_RESULT), "UI_get0_result"}, 78{ERR_PACK(0,UI_F_UI_GET0_RESULT,0), "UI_get0_result"},
83{ERR_FUNC(UI_F_UI_NEW_METHOD), "UI_new_method"}, 79{ERR_PACK(0,UI_F_UI_NEW_METHOD,0), "UI_new_method"},
84{ERR_FUNC(UI_F_UI_SET_RESULT), "UI_set_result"}, 80{ERR_PACK(0,UI_F_UI_SET_RESULT,0), "UI_set_result"},
85{0,NULL} 81{0,NULL}
86 }; 82 };
87 83
88static ERR_STRING_DATA UI_str_reasons[]= 84static ERR_STRING_DATA UI_str_reasons[]=
89 { 85 {
90{ERR_REASON(UI_R_COMMON_OK_AND_CANCEL_CHARACTERS),"common ok and cancel characters"}, 86{UI_R_COMMON_OK_AND_CANCEL_CHARACTERS ,"common ok and cancel characters"},
91{ERR_REASON(UI_R_INDEX_TOO_LARGE) ,"index too large"}, 87{UI_R_INDEX_TOO_LARGE ,"index too large"},
92{ERR_REASON(UI_R_INDEX_TOO_SMALL) ,"index too small"}, 88{UI_R_INDEX_TOO_SMALL ,"index too small"},
93{ERR_REASON(UI_R_NO_RESULT_BUFFER) ,"no result buffer"}, 89{UI_R_NO_RESULT_BUFFER ,"no result buffer"},
94{ERR_REASON(UI_R_RESULT_TOO_LARGE) ,"result too large"}, 90{UI_R_RESULT_TOO_LARGE ,"result too large"},
95{ERR_REASON(UI_R_RESULT_TOO_SMALL) ,"result too small"}, 91{UI_R_RESULT_TOO_SMALL ,"result too small"},
96{ERR_REASON(UI_R_UNKNOWN_CONTROL_COMMAND),"unknown control command"}, 92{UI_R_UNKNOWN_CONTROL_COMMAND ,"unknown control command"},
97{0,NULL} 93{0,NULL}
98 }; 94 };
99 95
@@ -107,8 +103,8 @@ void ERR_load_UI_strings(void)
107 { 103 {
108 init=0; 104 init=0;
109#ifndef OPENSSL_NO_ERR 105#ifndef OPENSSL_NO_ERR
110 ERR_load_strings(0,UI_str_functs); 106 ERR_load_strings(ERR_LIB_UI,UI_str_functs);
111 ERR_load_strings(0,UI_str_reasons); 107 ERR_load_strings(ERR_LIB_UI,UI_str_reasons);
112#endif 108#endif
113 109
114 } 110 }