diff options
Diffstat (limited to 'src/lib/libcrypto/ui')
| -rw-r--r-- | src/lib/libcrypto/ui/Makefile | 111 | ||||
| -rw-r--r-- | src/lib/libcrypto/ui/Makefile.ssl | 117 | ||||
| -rw-r--r-- | src/lib/libcrypto/ui/ui_compat.c | 67 | ||||
| -rw-r--r-- | src/lib/libcrypto/ui/ui_openssl.c | 5 |
4 files changed, 297 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ui/Makefile b/src/lib/libcrypto/ui/Makefile new file mode 100644 index 0000000000..4755e206f6 --- /dev/null +++ b/src/lib/libcrypto/ui/Makefile | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | # | ||
| 2 | # OpenSSL/crypto/ui/Makefile | ||
| 3 | # | ||
| 4 | |||
| 5 | DIR= ui | ||
| 6 | TOP= ../.. | ||
| 7 | CC= cc | ||
| 8 | INCLUDES= -I.. -I$(TOP) -I../../include | ||
| 9 | CFLAG=-g | ||
| 10 | MAKEFILE= Makefile | ||
| 11 | AR= ar r | ||
| 12 | |||
| 13 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
| 14 | |||
| 15 | GENERAL=Makefile | ||
| 16 | #TEST= uitest.c | ||
| 17 | TEST= | ||
| 18 | APPS= | ||
| 19 | |||
| 20 | COMPATSRC= ui_compat.c | ||
| 21 | COMPATOBJ= ui_compat.o | ||
| 22 | |||
| 23 | LIB=$(TOP)/libcrypto.a | ||
| 24 | LIBSRC= ui_err.c ui_lib.c ui_openssl.c ui_util.c $(COMPATSRC) | ||
| 25 | LIBOBJ= ui_err.o ui_lib.o ui_openssl.o ui_util.o $(COMPATOBJ) | ||
| 26 | |||
| 27 | SRC= $(LIBSRC) | ||
| 28 | |||
| 29 | EXHEADER= ui.h ui_compat.h | ||
| 30 | HEADER= $(EXHEADER) ui_locl.h | ||
| 31 | |||
| 32 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
| 33 | |||
| 34 | top: | ||
| 35 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
| 36 | |||
| 37 | all: lib | ||
| 38 | |||
| 39 | lib: $(LIBOBJ) | ||
| 40 | $(ARX) $(LIB) $(LIBOBJ) | ||
| 41 | $(RANLIB) $(LIB) || echo Never mind. | ||
| 42 | @touch lib | ||
| 43 | |||
| 44 | files: | ||
| 45 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | ||
| 46 | |||
| 47 | links: | ||
| 48 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) | ||
| 49 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) | ||
| 50 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) | ||
| 51 | |||
| 52 | install: | ||
| 53 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... | ||
| 54 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ | ||
| 55 | do \ | ||
| 56 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | ||
| 57 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | ||
| 58 | done; | ||
| 59 | |||
| 60 | tags: | ||
| 61 | ctags $(SRC) | ||
| 62 | |||
| 63 | tests: | ||
| 64 | |||
| 65 | lint: | ||
| 66 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
| 67 | |||
| 68 | depend: | ||
| 69 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... | ||
| 70 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) | ||
| 71 | |||
| 72 | dclean: | ||
| 73 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
| 74 | mv -f Makefile.new $(MAKEFILE) | ||
| 75 | |||
| 76 | clean: | ||
| 77 | rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
| 78 | |||
| 79 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
| 80 | |||
| 81 | ui_compat.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | ||
| 82 | ui_compat.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | ||
| 83 | ui_compat.o: ../../include/openssl/stack.h ../../include/openssl/ui.h | ||
| 84 | ui_compat.o: ../../include/openssl/ui_compat.h ui_compat.c | ||
| 85 | ui_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h | ||
| 86 | ui_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
| 87 | ui_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
| 88 | ui_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
| 89 | ui_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
| 90 | ui_err.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h ui_err.c | ||
| 91 | ui_lib.o: ../../e_os.h ../../include/openssl/bio.h | ||
| 92 | ui_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
| 93 | ui_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
| 94 | ui_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
| 95 | ui_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
| 96 | ui_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
| 97 | ui_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
| 98 | ui_lib.o: ../cryptlib.h ui_lib.c ui_locl.h | ||
| 99 | ui_openssl.o: ../../e_os.h ../../include/openssl/bio.h | ||
| 100 | ui_openssl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
| 101 | ui_openssl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
| 102 | ui_openssl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
| 103 | ui_openssl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
| 104 | ui_openssl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
| 105 | ui_openssl.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
| 106 | ui_openssl.o: ../cryptlib.h ui_locl.h ui_openssl.c | ||
| 107 | ui_util.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
| 108 | ui_util.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 109 | ui_util.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | ||
| 110 | ui_util.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 111 | ui_util.o: ../../include/openssl/ui.h ui_locl.h 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 | |||
| 5 | DIR= ui | ||
| 6 | TOP= ../.. | ||
| 7 | CC= cc | ||
| 8 | INCLUDES= -I.. -I$(TOP) -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 | MAKEDEPPROG= makedepend | ||
| 15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
| 16 | MAKEFILE= Makefile.ssl | ||
| 17 | AR= ar r | ||
| 18 | |||
| 19 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
| 20 | |||
| 21 | GENERAL=Makefile | ||
| 22 | #TEST= uitest.c | ||
| 23 | TEST= | ||
| 24 | APPS= | ||
| 25 | |||
| 26 | COMPATSRC= ui_compat.c | ||
| 27 | COMPATOBJ= ui_compat.o | ||
| 28 | |||
| 29 | LIB=$(TOP)/libcrypto.a | ||
| 30 | LIBSRC= ui_err.c ui_lib.c ui_openssl.c ui_util.c $(COMPATSRC) | ||
| 31 | LIBOBJ= ui_err.o ui_lib.o ui_openssl.o ui_util.o $(COMPATOBJ) | ||
| 32 | |||
| 33 | SRC= $(LIBSRC) | ||
| 34 | |||
| 35 | EXHEADER= ui.h ui_compat.h | ||
| 36 | HEADER= $(EXHEADER) ui_locl.h | ||
| 37 | |||
| 38 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
| 39 | |||
| 40 | top: | ||
| 41 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
| 42 | |||
| 43 | all: lib | ||
| 44 | |||
| 45 | lib: $(LIBOBJ) | ||
| 46 | $(AR) $(LIB) $(LIBOBJ) | ||
| 47 | $(RANLIB) $(LIB) || echo Never mind. | ||
| 48 | @touch lib | ||
| 49 | |||
| 50 | files: | ||
| 51 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | ||
| 52 | |||
| 53 | links: | ||
| 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 | |||
| 59 | install: | ||
| 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 | |||
| 66 | tags: | ||
| 67 | ctags $(SRC) | ||
| 68 | |||
| 69 | tests: | ||
| 70 | |||
| 71 | lint: | ||
| 72 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
| 73 | |||
| 74 | depend: | ||
| 75 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) | ||
| 76 | |||
| 77 | dclean: | ||
| 78 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
| 79 | mv -f Makefile.new $(MAKEFILE) | ||
| 80 | |||
| 81 | clean: | ||
| 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 | |||
| 86 | ui_compat.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
| 87 | ui_compat.o: ../../include/openssl/opensslconf.h | ||
| 88 | ui_compat.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
| 89 | ui_compat.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 90 | ui_compat.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
| 91 | ui_compat.o: ui_compat.c | ||
| 92 | ui_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h | ||
| 93 | ui_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
| 94 | ui_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
| 95 | ui_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
| 96 | ui_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 97 | ui_err.o: ../../include/openssl/ui.h ui_err.c | ||
| 98 | ui_lib.o: ../../e_os.h ../../include/openssl/bio.h | ||
| 99 | ui_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
| 100 | ui_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
| 101 | ui_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
| 102 | ui_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
| 103 | ui_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
| 104 | ui_lib.o: ../../include/openssl/ui.h ../cryptlib.h ui_lib.c ui_locl.h | ||
| 105 | ui_openssl.o: ../../e_os.h ../../include/openssl/bio.h | ||
| 106 | ui_openssl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
| 107 | ui_openssl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
| 108 | ui_openssl.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
| 109 | ui_openssl.o: ../../include/openssl/opensslv.h | ||
| 110 | ui_openssl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
| 111 | ui_openssl.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
| 112 | ui_openssl.o: ../cryptlib.h ui_locl.h ui_openssl.c | ||
| 113 | ui_util.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
| 114 | ui_util.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
| 115 | ui_util.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
| 116 | ui_util.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
| 117 | ui_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 | |||
| 59 | int _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 | |||
| 64 | int _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_openssl.c b/src/lib/libcrypto/ui/ui_openssl.c index ef930bf247..8446673ed4 100644 --- a/src/lib/libcrypto/ui/ui_openssl.c +++ b/src/lib/libcrypto/ui/ui_openssl.c | |||
| @@ -396,7 +396,8 @@ static void read_till_nl(FILE *in) | |||
| 396 | char buf[SIZE+1]; | 396 | char buf[SIZE+1]; |
| 397 | 397 | ||
| 398 | do { | 398 | do { |
| 399 | fgets(buf,SIZE,in); | 399 | if (fgets(buf,sizeof(buf),in) == NULL) |
| 400 | break; | ||
| 400 | } while (strchr(buf,'\n') == NULL); | 401 | } while (strchr(buf,'\n') == NULL); |
| 401 | } | 402 | } |
| 402 | 403 | ||
| @@ -677,8 +678,6 @@ static int noecho_fgets(char *buf, int size, FILE *tty) | |||
| 677 | size--; | 678 | size--; |
| 678 | #ifdef WIN16TTY | 679 | #ifdef WIN16TTY |
| 679 | i=_inchar(); | 680 | i=_inchar(); |
| 680 | #elif defined(_WIN32) | ||
| 681 | i=_getch(); | ||
| 682 | #else | 681 | #else |
| 683 | i=getch(); | 682 | i=getch(); |
| 684 | #endif | 683 | #endif |
