diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/LPdir_nyi.c | 42 | ||||
| -rw-r--r-- | src/lib/libcrypto/LPdir_vms.c | 206 | ||||
| -rw-r--r-- | src/lib/libcrypto/LPdir_win.c | 153 | ||||
| -rw-r--r-- | src/lib/libcrypto/LPdir_win32.c | 30 | ||||
| -rw-r--r-- | src/lib/libcrypto/LPdir_wince.c | 31 | ||||
| -rw-r--r-- | src/lib/libcrypto/crypto/Makefile | 4 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/LPdir_nyi.c | 42 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/LPdir_unix.c | 127 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/LPdir_vms.c | 206 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/LPdir_win.c | 153 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/LPdir_win32.c | 30 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/LPdir_wince.c | 31 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/o_dir.c | 83 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/o_dir.h | 53 | ||||
| -rw-r--r-- | src/lib/libssl/src/ssl/LPdir_unix.c (renamed from src/lib/libcrypto/LPdir_unix.c) | 0 | ||||
| -rw-r--r-- | src/lib/libssl/src/ssl/o_dir.c (renamed from src/lib/libcrypto/o_dir.c) | 0 | ||||
| -rw-r--r-- | src/lib/libssl/src/ssl/o_dir.h (renamed from src/lib/libcrypto/o_dir.h) | 0 | ||||
| -rw-r--r-- | src/lib/libssl/ssl/Makefile | 5 |
18 files changed, 5 insertions, 1191 deletions
diff --git a/src/lib/libcrypto/LPdir_nyi.c b/src/lib/libcrypto/LPdir_nyi.c deleted file mode 100644 index 6c1a50e6a8..0000000000 --- a/src/lib/libcrypto/LPdir_nyi.c +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | /* $LP: LPlib/source/LPdir_win.c,v 1.1 2004/06/14 10:07:56 _cvs_levitte Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 4 | * All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * | ||
| 15 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 25 | * SUCH DAMAGE. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #ifndef LPDIR_H | ||
| 29 | #include "LPdir.h" | ||
| 30 | #endif | ||
| 31 | |||
| 32 | struct LP_dir_context_st { void *dummy; }; | ||
| 33 | const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) | ||
| 34 | { | ||
| 35 | errno = EINVAL; | ||
| 36 | return 0; | ||
| 37 | } | ||
| 38 | int LP_find_file_end(LP_DIR_CTX **ctx) | ||
| 39 | { | ||
| 40 | errno = EINVAL; | ||
| 41 | return 0; | ||
| 42 | } | ||
diff --git a/src/lib/libcrypto/LPdir_vms.c b/src/lib/libcrypto/LPdir_vms.c deleted file mode 100644 index 7613bd254e..0000000000 --- a/src/lib/libcrypto/LPdir_vms.c +++ /dev/null | |||
| @@ -1,206 +0,0 @@ | |||
| 1 | /* $LP: LPlib/source/LPdir_vms.c,v 1.20 2004/08/26 13:36:05 _cvs_levitte Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 4 | * All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * | ||
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #include <stddef.h> | ||
| 29 | #include <stdlib.h> | ||
| 30 | #include <string.h> | ||
| 31 | #include <errno.h> | ||
| 32 | #include <descrip.h> | ||
| 33 | #include <namdef.h> | ||
| 34 | #include <rmsdef.h> | ||
| 35 | #include <libfildef.h> | ||
| 36 | #include <lib$routines.h> | ||
| 37 | #include <strdef.h> | ||
| 38 | #include <str$routines.h> | ||
| 39 | #include <stsdef.h> | ||
| 40 | #ifndef LPDIR_H | ||
| 41 | #include "LPdir.h" | ||
| 42 | #endif | ||
| 43 | #include "vms_rms.h" | ||
| 44 | |||
| 45 | /* Some compiler options hide EVMSERR. */ | ||
| 46 | #ifndef EVMSERR | ||
| 47 | # define EVMSERR 65535 /* error for non-translatable VMS errors */ | ||
| 48 | #endif | ||
| 49 | |||
| 50 | struct LP_dir_context_st | ||
| 51 | { | ||
| 52 | unsigned long VMS_context; | ||
| 53 | char filespec[ NAMX_MAXRSS+ 1]; | ||
| 54 | char result[ NAMX_MAXRSS+ 1]; | ||
| 55 | struct dsc$descriptor_d filespec_dsc; | ||
| 56 | struct dsc$descriptor_d result_dsc; | ||
| 57 | }; | ||
| 58 | |||
| 59 | const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) | ||
| 60 | { | ||
| 61 | int status; | ||
| 62 | char *p, *r; | ||
| 63 | size_t l; | ||
| 64 | unsigned long flags = 0; | ||
| 65 | |||
| 66 | /* Arrange 32-bit pointer to (copied) string storage, if needed. */ | ||
| 67 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 68 | # pragma pointer_size save | ||
| 69 | # pragma pointer_size 32 | ||
| 70 | char *ctx_filespec_32p; | ||
| 71 | # pragma pointer_size restore | ||
| 72 | char ctx_filespec_32[ NAMX_MAXRSS+ 1]; | ||
| 73 | #endif /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 74 | |||
| 75 | #ifdef NAML$C_MAXRSS | ||
| 76 | flags |= LIB$M_FIL_LONG_NAMES; | ||
| 77 | #endif | ||
| 78 | |||
| 79 | if (ctx == NULL || directory == NULL) | ||
| 80 | { | ||
| 81 | errno = EINVAL; | ||
| 82 | return 0; | ||
| 83 | } | ||
| 84 | |||
| 85 | errno = 0; | ||
| 86 | if (*ctx == NULL) | ||
| 87 | { | ||
| 88 | size_t filespeclen = strlen(directory); | ||
| 89 | char *filespec = NULL; | ||
| 90 | |||
| 91 | /* MUST be a VMS directory specification! Let's estimate if it is. */ | ||
| 92 | if (directory[filespeclen-1] != ']' | ||
| 93 | && directory[filespeclen-1] != '>' | ||
| 94 | && directory[filespeclen-1] != ':') | ||
| 95 | { | ||
| 96 | errno = EINVAL; | ||
| 97 | return 0; | ||
| 98 | } | ||
| 99 | |||
| 100 | filespeclen += 4; /* "*.*;" */ | ||
| 101 | |||
| 102 | if (filespeclen > NAMX_MAXRSS) | ||
| 103 | { | ||
| 104 | errno = ENAMETOOLONG; | ||
| 105 | return 0; | ||
| 106 | } | ||
| 107 | |||
| 108 | *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX)); | ||
| 109 | if (*ctx == NULL) | ||
| 110 | { | ||
| 111 | errno = ENOMEM; | ||
| 112 | return 0; | ||
| 113 | } | ||
| 114 | memset(*ctx, '\0', sizeof(LP_DIR_CTX)); | ||
| 115 | |||
| 116 | strcpy((*ctx)->filespec,directory); | ||
| 117 | strcat((*ctx)->filespec,"*.*;"); | ||
| 118 | |||
| 119 | /* Arrange 32-bit pointer to (copied) string storage, if needed. */ | ||
| 120 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 121 | # define CTX_FILESPEC ctx_filespec_32p | ||
| 122 | /* Copy the file name to storage with a 32-bit pointer. */ | ||
| 123 | ctx_filespec_32p = ctx_filespec_32; | ||
| 124 | strcpy( ctx_filespec_32p, (*ctx)->filespec); | ||
| 125 | #else /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 126 | # define CTX_FILESPEC (*ctx)->filespec | ||
| 127 | #endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 128 | |||
| 129 | (*ctx)->filespec_dsc.dsc$w_length = filespeclen; | ||
| 130 | (*ctx)->filespec_dsc.dsc$b_dtype = DSC$K_DTYPE_T; | ||
| 131 | (*ctx)->filespec_dsc.dsc$b_class = DSC$K_CLASS_S; | ||
| 132 | (*ctx)->filespec_dsc.dsc$a_pointer = CTX_FILESPEC; | ||
| 133 | } | ||
| 134 | |||
| 135 | (*ctx)->result_dsc.dsc$w_length = 0; | ||
| 136 | (*ctx)->result_dsc.dsc$b_dtype = DSC$K_DTYPE_T; | ||
| 137 | (*ctx)->result_dsc.dsc$b_class = DSC$K_CLASS_D; | ||
| 138 | (*ctx)->result_dsc.dsc$a_pointer = 0; | ||
| 139 | |||
| 140 | status = lib$find_file(&(*ctx)->filespec_dsc, &(*ctx)->result_dsc, | ||
| 141 | &(*ctx)->VMS_context, 0, 0, 0, &flags); | ||
| 142 | |||
| 143 | if (status == RMS$_NMF) | ||
| 144 | { | ||
| 145 | errno = 0; | ||
| 146 | vaxc$errno = status; | ||
| 147 | return NULL; | ||
| 148 | } | ||
| 149 | |||
| 150 | if(!$VMS_STATUS_SUCCESS(status)) | ||
| 151 | { | ||
| 152 | errno = EVMSERR; | ||
| 153 | vaxc$errno = status; | ||
| 154 | return NULL; | ||
| 155 | } | ||
| 156 | |||
| 157 | /* Quick, cheap and dirty way to discard any device and directory, | ||
| 158 | since we only want file names */ | ||
| 159 | l = (*ctx)->result_dsc.dsc$w_length; | ||
| 160 | p = (*ctx)->result_dsc.dsc$a_pointer; | ||
| 161 | r = p; | ||
| 162 | for (; *p; p++) | ||
| 163 | { | ||
| 164 | if (*p == '^' && p[1] != '\0') /* Take care of ODS-5 escapes */ | ||
| 165 | { | ||
| 166 | p++; | ||
| 167 | } | ||
| 168 | else if (*p == ':' || *p == '>' || *p == ']') | ||
| 169 | { | ||
| 170 | l -= p + 1 - r; | ||
| 171 | r = p + 1; | ||
| 172 | } | ||
| 173 | else if (*p == ';') | ||
| 174 | { | ||
| 175 | l = p - r; | ||
| 176 | break; | ||
| 177 | } | ||
| 178 | } | ||
| 179 | |||
| 180 | strncpy((*ctx)->result, r, l); | ||
| 181 | (*ctx)->result[l] = '\0'; | ||
| 182 | str$free1_dx(&(*ctx)->result_dsc); | ||
| 183 | |||
| 184 | return (*ctx)->result; | ||
| 185 | } | ||
| 186 | |||
| 187 | int LP_find_file_end(LP_DIR_CTX **ctx) | ||
| 188 | { | ||
| 189 | if (ctx != NULL && *ctx != NULL) | ||
| 190 | { | ||
| 191 | int status = lib$find_file_end(&(*ctx)->VMS_context); | ||
| 192 | |||
| 193 | free(*ctx); | ||
| 194 | |||
| 195 | if(!$VMS_STATUS_SUCCESS(status)) | ||
| 196 | { | ||
| 197 | errno = EVMSERR; | ||
| 198 | vaxc$errno = status; | ||
| 199 | return 0; | ||
| 200 | } | ||
| 201 | return 1; | ||
| 202 | } | ||
| 203 | errno = EINVAL; | ||
| 204 | return 0; | ||
| 205 | } | ||
| 206 | |||
diff --git a/src/lib/libcrypto/LPdir_win.c b/src/lib/libcrypto/LPdir_win.c deleted file mode 100644 index 702dbc730f..0000000000 --- a/src/lib/libcrypto/LPdir_win.c +++ /dev/null | |||
| @@ -1,153 +0,0 @@ | |||
| 1 | /* $LP: LPlib/source/LPdir_win.c,v 1.10 2004/08/26 13:36:05 _cvs_levitte Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 4 | * All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * | ||
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 26 | */ | ||
| 27 | #include <windows.h> | ||
| 28 | #include <tchar.h> | ||
| 29 | #ifndef LPDIR_H | ||
| 30 | #include "LPdir.h" | ||
| 31 | #endif | ||
| 32 | |||
| 33 | /* We're most likely overcautious here, but let's reserve for | ||
| 34 | broken WinCE headers and explicitly opt for UNICODE call. | ||
| 35 | Keep in mind that our WinCE builds are compiled with -DUNICODE | ||
| 36 | [as well as -D_UNICODE]. */ | ||
| 37 | #if defined(LP_SYS_WINCE) && !defined(FindFirstFile) | ||
| 38 | # define FindFirstFile FindFirstFileW | ||
| 39 | #endif | ||
| 40 | #if defined(LP_SYS_WINCE) && !defined(FindFirstFile) | ||
| 41 | # define FindNextFile FindNextFileW | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #ifndef NAME_MAX | ||
| 45 | #define NAME_MAX 255 | ||
| 46 | #endif | ||
| 47 | |||
| 48 | struct LP_dir_context_st | ||
| 49 | { | ||
| 50 | WIN32_FIND_DATA ctx; | ||
| 51 | HANDLE handle; | ||
| 52 | char entry_name[NAME_MAX+1]; | ||
| 53 | }; | ||
| 54 | |||
| 55 | const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) | ||
| 56 | { | ||
| 57 | if (ctx == NULL || directory == NULL) | ||
| 58 | { | ||
| 59 | errno = EINVAL; | ||
| 60 | return 0; | ||
| 61 | } | ||
| 62 | |||
| 63 | errno = 0; | ||
| 64 | if (*ctx == NULL) | ||
| 65 | { | ||
| 66 | *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX)); | ||
| 67 | if (*ctx == NULL) | ||
| 68 | { | ||
| 69 | errno = ENOMEM; | ||
| 70 | return 0; | ||
| 71 | } | ||
| 72 | memset(*ctx, '\0', sizeof(LP_DIR_CTX)); | ||
| 73 | |||
| 74 | if (sizeof(TCHAR) != sizeof(char)) | ||
| 75 | { | ||
| 76 | TCHAR *wdir = NULL; | ||
| 77 | /* len_0 denotes string length *with* trailing 0 */ | ||
| 78 | size_t index = 0,len_0 = strlen(directory) + 1; | ||
| 79 | |||
| 80 | wdir = (TCHAR *)malloc(len_0 * sizeof(TCHAR)); | ||
| 81 | if (wdir == NULL) | ||
| 82 | { | ||
| 83 | free(*ctx); | ||
| 84 | *ctx = NULL; | ||
| 85 | errno = ENOMEM; | ||
| 86 | return 0; | ||
| 87 | } | ||
| 88 | |||
| 89 | #ifdef LP_MULTIBYTE_AVAILABLE | ||
| 90 | if (!MultiByteToWideChar(CP_ACP, 0, directory, len_0, (WCHAR *)wdir, len_0)) | ||
| 91 | #endif | ||
| 92 | for (index = 0; index < len_0; index++) | ||
| 93 | wdir[index] = (TCHAR)directory[index]; | ||
| 94 | |||
| 95 | (*ctx)->handle = FindFirstFile(wdir, &(*ctx)->ctx); | ||
| 96 | |||
| 97 | free(wdir); | ||
| 98 | } | ||
| 99 | else | ||
| 100 | (*ctx)->handle = FindFirstFile((TCHAR *)directory, &(*ctx)->ctx); | ||
| 101 | |||
| 102 | if ((*ctx)->handle == INVALID_HANDLE_VALUE) | ||
| 103 | { | ||
| 104 | free(*ctx); | ||
| 105 | *ctx = NULL; | ||
| 106 | errno = EINVAL; | ||
| 107 | return 0; | ||
| 108 | } | ||
| 109 | } | ||
| 110 | else | ||
| 111 | { | ||
| 112 | if (FindNextFile((*ctx)->handle, &(*ctx)->ctx) == FALSE) | ||
| 113 | { | ||
| 114 | return 0; | ||
| 115 | } | ||
| 116 | } | ||
| 117 | |||
| 118 | if (sizeof(TCHAR) != sizeof(char)) | ||
| 119 | { | ||
| 120 | TCHAR *wdir = (*ctx)->ctx.cFileName; | ||
| 121 | size_t index, len_0 = 0; | ||
| 122 | |||
| 123 | while (wdir[len_0] && len_0 < (sizeof((*ctx)->entry_name) - 1)) len_0++; | ||
| 124 | len_0++; | ||
| 125 | |||
| 126 | #ifdef LP_MULTIBYTE_AVAILABLE | ||
| 127 | if (!WideCharToMultiByte(CP_ACP, 0, (WCHAR *)wdir, len_0, (*ctx)->entry_name, | ||
| 128 | sizeof((*ctx)->entry_name), NULL, 0)) | ||
| 129 | #endif | ||
| 130 | for (index = 0; index < len_0; index++) | ||
| 131 | (*ctx)->entry_name[index] = (char)wdir[index]; | ||
| 132 | } | ||
| 133 | else | ||
| 134 | strncpy((*ctx)->entry_name, (const char *)(*ctx)->ctx.cFileName, | ||
| 135 | sizeof((*ctx)->entry_name)-1); | ||
| 136 | |||
| 137 | (*ctx)->entry_name[sizeof((*ctx)->entry_name)-1] = '\0'; | ||
| 138 | |||
| 139 | return (*ctx)->entry_name; | ||
| 140 | } | ||
| 141 | |||
| 142 | int LP_find_file_end(LP_DIR_CTX **ctx) | ||
| 143 | { | ||
| 144 | if (ctx != NULL && *ctx != NULL) | ||
| 145 | { | ||
| 146 | FindClose((*ctx)->handle); | ||
| 147 | free(*ctx); | ||
| 148 | *ctx = NULL; | ||
| 149 | return 1; | ||
| 150 | } | ||
| 151 | errno = EINVAL; | ||
| 152 | return 0; | ||
| 153 | } | ||
diff --git a/src/lib/libcrypto/LPdir_win32.c b/src/lib/libcrypto/LPdir_win32.c deleted file mode 100644 index e39872da52..0000000000 --- a/src/lib/libcrypto/LPdir_win32.c +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | /* $LP: LPlib/source/LPdir_win32.c,v 1.3 2004/08/26 13:36:05 _cvs_levitte Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 4 | * All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * | ||
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #define LP_SYS_WIN32 | ||
| 29 | #define LP_MULTIBYTE_AVAILABLE | ||
| 30 | #include "LPdir_win.c" | ||
diff --git a/src/lib/libcrypto/LPdir_wince.c b/src/lib/libcrypto/LPdir_wince.c deleted file mode 100644 index ab0e1e6f4f..0000000000 --- a/src/lib/libcrypto/LPdir_wince.c +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | /* $LP: LPlib/source/LPdir_wince.c,v 1.3 2004/08/26 13:36:05 _cvs_levitte Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 4 | * All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * | ||
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #define LP_SYS_WINCE | ||
| 29 | /* We might want to define LP_MULTIBYTE_AVAILABLE here. It's currently | ||
| 30 | under investigation what the exact conditions would be */ | ||
| 31 | #include "LPdir_win.c" | ||
diff --git a/src/lib/libcrypto/crypto/Makefile b/src/lib/libcrypto/crypto/Makefile index d95ac156ec..789f92f5b3 100644 --- a/src/lib/libcrypto/crypto/Makefile +++ b/src/lib/libcrypto/crypto/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.1 2014/04/11 22:51:53 miod Exp $ | 1 | # $OpenBSD: Makefile,v 1.2 2014/04/13 15:49:47 miod Exp $ |
| 2 | 2 | ||
| 3 | LIB= crypto | 3 | LIB= crypto |
| 4 | 4 | ||
| @@ -43,7 +43,7 @@ CFLAGS+= -I${LCRYPTO_SRC}/modes -I${LCRYPTO_SRC}/asn1 -I${LCRYPTO_SRC}/evp | |||
| 43 | 43 | ||
| 44 | # crypto/ | 44 | # crypto/ |
| 45 | SRCS+= cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c | 45 | SRCS+= cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c |
| 46 | SRCS+= ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c | 46 | SRCS+= ebcdic.c uid.c o_time.c o_str.c o_fips.c o_init.c fips_ers.c |
| 47 | 47 | ||
| 48 | # aes/ | 48 | # aes/ |
| 49 | SRCS+= aes_misc.c aes_ecb.c aes_cfb.c aes_ofb.c | 49 | SRCS+= aes_misc.c aes_ecb.c aes_cfb.c aes_ofb.c |
diff --git a/src/lib/libssl/src/crypto/LPdir_nyi.c b/src/lib/libssl/src/crypto/LPdir_nyi.c deleted file mode 100644 index 6c1a50e6a8..0000000000 --- a/src/lib/libssl/src/crypto/LPdir_nyi.c +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | /* $LP: LPlib/source/LPdir_win.c,v 1.1 2004/06/14 10:07:56 _cvs_levitte Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 4 | * All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * | ||
| 15 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 25 | * SUCH DAMAGE. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #ifndef LPDIR_H | ||
| 29 | #include "LPdir.h" | ||
| 30 | #endif | ||
| 31 | |||
| 32 | struct LP_dir_context_st { void *dummy; }; | ||
| 33 | const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) | ||
| 34 | { | ||
| 35 | errno = EINVAL; | ||
| 36 | return 0; | ||
| 37 | } | ||
| 38 | int LP_find_file_end(LP_DIR_CTX **ctx) | ||
| 39 | { | ||
| 40 | errno = EINVAL; | ||
| 41 | return 0; | ||
| 42 | } | ||
diff --git a/src/lib/libssl/src/crypto/LPdir_unix.c b/src/lib/libssl/src/crypto/LPdir_unix.c deleted file mode 100644 index b004cd99e8..0000000000 --- a/src/lib/libssl/src/crypto/LPdir_unix.c +++ /dev/null | |||
| @@ -1,127 +0,0 @@ | |||
| 1 | /* $LP: LPlib/source/LPdir_unix.c,v 1.11 2004/09/23 22:07:22 _cvs_levitte Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 4 | * All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * | ||
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #include <stddef.h> | ||
| 29 | #include <stdlib.h> | ||
| 30 | #include <limits.h> | ||
| 31 | #include <string.h> | ||
| 32 | #include <sys/types.h> | ||
| 33 | #include <dirent.h> | ||
| 34 | #include <errno.h> | ||
| 35 | #ifndef LPDIR_H | ||
| 36 | #include "LPdir.h" | ||
| 37 | #endif | ||
| 38 | |||
| 39 | /* The POSIXly macro for the maximum number of characters in a file path | ||
| 40 | is NAME_MAX. However, some operating systems use PATH_MAX instead. | ||
| 41 | Therefore, it seems natural to first check for PATH_MAX and use that, | ||
| 42 | and if it doesn't exist, use NAME_MAX. */ | ||
| 43 | #if defined(PATH_MAX) | ||
| 44 | # define LP_ENTRY_SIZE PATH_MAX | ||
| 45 | #elif defined(NAME_MAX) | ||
| 46 | # define LP_ENTRY_SIZE NAME_MAX | ||
| 47 | #endif | ||
| 48 | |||
| 49 | /* Of course, there's the possibility that neither PATH_MAX nor NAME_MAX | ||
| 50 | exist. It's also possible that NAME_MAX exists but is define to a | ||
| 51 | very small value (HP-UX offers 14), so we need to check if we got a | ||
| 52 | result, and if it meets a minimum standard, and create or change it | ||
| 53 | if not. */ | ||
| 54 | #if !defined(LP_ENTRY_SIZE) || LP_ENTRY_SIZE<255 | ||
| 55 | # undef LP_ENTRY_SIZE | ||
| 56 | # define LP_ENTRY_SIZE 255 | ||
| 57 | #endif | ||
| 58 | |||
| 59 | struct LP_dir_context_st | ||
| 60 | { | ||
| 61 | DIR *dir; | ||
| 62 | char entry_name[LP_ENTRY_SIZE+1]; | ||
| 63 | }; | ||
| 64 | |||
| 65 | const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) | ||
| 66 | { | ||
| 67 | struct dirent *direntry = NULL; | ||
| 68 | |||
| 69 | if (ctx == NULL || directory == NULL) | ||
| 70 | { | ||
| 71 | errno = EINVAL; | ||
| 72 | return 0; | ||
| 73 | } | ||
| 74 | |||
| 75 | errno = 0; | ||
| 76 | if (*ctx == NULL) | ||
| 77 | { | ||
| 78 | *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX)); | ||
| 79 | if (*ctx == NULL) | ||
| 80 | { | ||
| 81 | errno = ENOMEM; | ||
| 82 | return 0; | ||
| 83 | } | ||
| 84 | memset(*ctx, '\0', sizeof(LP_DIR_CTX)); | ||
| 85 | |||
| 86 | (*ctx)->dir = opendir(directory); | ||
| 87 | if ((*ctx)->dir == NULL) | ||
| 88 | { | ||
| 89 | int save_errno = errno; /* Probably not needed, but I'm paranoid */ | ||
| 90 | free(*ctx); | ||
| 91 | *ctx = NULL; | ||
| 92 | errno = save_errno; | ||
| 93 | return 0; | ||
| 94 | } | ||
| 95 | } | ||
| 96 | |||
| 97 | direntry = readdir((*ctx)->dir); | ||
| 98 | if (direntry == NULL) | ||
| 99 | { | ||
| 100 | return 0; | ||
| 101 | } | ||
| 102 | |||
| 103 | strncpy((*ctx)->entry_name, direntry->d_name, sizeof((*ctx)->entry_name) - 1); | ||
| 104 | (*ctx)->entry_name[sizeof((*ctx)->entry_name) - 1] = '\0'; | ||
| 105 | return (*ctx)->entry_name; | ||
| 106 | } | ||
| 107 | |||
| 108 | int LP_find_file_end(LP_DIR_CTX **ctx) | ||
| 109 | { | ||
| 110 | if (ctx != NULL && *ctx != NULL) | ||
| 111 | { | ||
| 112 | int ret = closedir((*ctx)->dir); | ||
| 113 | |||
| 114 | free(*ctx); | ||
| 115 | switch (ret) | ||
| 116 | { | ||
| 117 | case 0: | ||
| 118 | return 1; | ||
| 119 | case -1: | ||
| 120 | return 0; | ||
| 121 | default: | ||
| 122 | break; | ||
| 123 | } | ||
| 124 | } | ||
| 125 | errno = EINVAL; | ||
| 126 | return 0; | ||
| 127 | } | ||
diff --git a/src/lib/libssl/src/crypto/LPdir_vms.c b/src/lib/libssl/src/crypto/LPdir_vms.c deleted file mode 100644 index 7613bd254e..0000000000 --- a/src/lib/libssl/src/crypto/LPdir_vms.c +++ /dev/null | |||
| @@ -1,206 +0,0 @@ | |||
| 1 | /* $LP: LPlib/source/LPdir_vms.c,v 1.20 2004/08/26 13:36:05 _cvs_levitte Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 4 | * All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * | ||
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #include <stddef.h> | ||
| 29 | #include <stdlib.h> | ||
| 30 | #include <string.h> | ||
| 31 | #include <errno.h> | ||
| 32 | #include <descrip.h> | ||
| 33 | #include <namdef.h> | ||
| 34 | #include <rmsdef.h> | ||
| 35 | #include <libfildef.h> | ||
| 36 | #include <lib$routines.h> | ||
| 37 | #include <strdef.h> | ||
| 38 | #include <str$routines.h> | ||
| 39 | #include <stsdef.h> | ||
| 40 | #ifndef LPDIR_H | ||
| 41 | #include "LPdir.h" | ||
| 42 | #endif | ||
| 43 | #include "vms_rms.h" | ||
| 44 | |||
| 45 | /* Some compiler options hide EVMSERR. */ | ||
| 46 | #ifndef EVMSERR | ||
| 47 | # define EVMSERR 65535 /* error for non-translatable VMS errors */ | ||
| 48 | #endif | ||
| 49 | |||
| 50 | struct LP_dir_context_st | ||
| 51 | { | ||
| 52 | unsigned long VMS_context; | ||
| 53 | char filespec[ NAMX_MAXRSS+ 1]; | ||
| 54 | char result[ NAMX_MAXRSS+ 1]; | ||
| 55 | struct dsc$descriptor_d filespec_dsc; | ||
| 56 | struct dsc$descriptor_d result_dsc; | ||
| 57 | }; | ||
| 58 | |||
| 59 | const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) | ||
| 60 | { | ||
| 61 | int status; | ||
| 62 | char *p, *r; | ||
| 63 | size_t l; | ||
| 64 | unsigned long flags = 0; | ||
| 65 | |||
| 66 | /* Arrange 32-bit pointer to (copied) string storage, if needed. */ | ||
| 67 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 68 | # pragma pointer_size save | ||
| 69 | # pragma pointer_size 32 | ||
| 70 | char *ctx_filespec_32p; | ||
| 71 | # pragma pointer_size restore | ||
| 72 | char ctx_filespec_32[ NAMX_MAXRSS+ 1]; | ||
| 73 | #endif /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 74 | |||
| 75 | #ifdef NAML$C_MAXRSS | ||
| 76 | flags |= LIB$M_FIL_LONG_NAMES; | ||
| 77 | #endif | ||
| 78 | |||
| 79 | if (ctx == NULL || directory == NULL) | ||
| 80 | { | ||
| 81 | errno = EINVAL; | ||
| 82 | return 0; | ||
| 83 | } | ||
| 84 | |||
| 85 | errno = 0; | ||
| 86 | if (*ctx == NULL) | ||
| 87 | { | ||
| 88 | size_t filespeclen = strlen(directory); | ||
| 89 | char *filespec = NULL; | ||
| 90 | |||
| 91 | /* MUST be a VMS directory specification! Let's estimate if it is. */ | ||
| 92 | if (directory[filespeclen-1] != ']' | ||
| 93 | && directory[filespeclen-1] != '>' | ||
| 94 | && directory[filespeclen-1] != ':') | ||
| 95 | { | ||
| 96 | errno = EINVAL; | ||
| 97 | return 0; | ||
| 98 | } | ||
| 99 | |||
| 100 | filespeclen += 4; /* "*.*;" */ | ||
| 101 | |||
| 102 | if (filespeclen > NAMX_MAXRSS) | ||
| 103 | { | ||
| 104 | errno = ENAMETOOLONG; | ||
| 105 | return 0; | ||
| 106 | } | ||
| 107 | |||
| 108 | *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX)); | ||
| 109 | if (*ctx == NULL) | ||
| 110 | { | ||
| 111 | errno = ENOMEM; | ||
| 112 | return 0; | ||
| 113 | } | ||
| 114 | memset(*ctx, '\0', sizeof(LP_DIR_CTX)); | ||
| 115 | |||
| 116 | strcpy((*ctx)->filespec,directory); | ||
| 117 | strcat((*ctx)->filespec,"*.*;"); | ||
| 118 | |||
| 119 | /* Arrange 32-bit pointer to (copied) string storage, if needed. */ | ||
| 120 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 121 | # define CTX_FILESPEC ctx_filespec_32p | ||
| 122 | /* Copy the file name to storage with a 32-bit pointer. */ | ||
| 123 | ctx_filespec_32p = ctx_filespec_32; | ||
| 124 | strcpy( ctx_filespec_32p, (*ctx)->filespec); | ||
| 125 | #else /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 126 | # define CTX_FILESPEC (*ctx)->filespec | ||
| 127 | #endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 128 | |||
| 129 | (*ctx)->filespec_dsc.dsc$w_length = filespeclen; | ||
| 130 | (*ctx)->filespec_dsc.dsc$b_dtype = DSC$K_DTYPE_T; | ||
| 131 | (*ctx)->filespec_dsc.dsc$b_class = DSC$K_CLASS_S; | ||
| 132 | (*ctx)->filespec_dsc.dsc$a_pointer = CTX_FILESPEC; | ||
| 133 | } | ||
| 134 | |||
| 135 | (*ctx)->result_dsc.dsc$w_length = 0; | ||
| 136 | (*ctx)->result_dsc.dsc$b_dtype = DSC$K_DTYPE_T; | ||
| 137 | (*ctx)->result_dsc.dsc$b_class = DSC$K_CLASS_D; | ||
| 138 | (*ctx)->result_dsc.dsc$a_pointer = 0; | ||
| 139 | |||
| 140 | status = lib$find_file(&(*ctx)->filespec_dsc, &(*ctx)->result_dsc, | ||
| 141 | &(*ctx)->VMS_context, 0, 0, 0, &flags); | ||
| 142 | |||
| 143 | if (status == RMS$_NMF) | ||
| 144 | { | ||
| 145 | errno = 0; | ||
| 146 | vaxc$errno = status; | ||
| 147 | return NULL; | ||
| 148 | } | ||
| 149 | |||
| 150 | if(!$VMS_STATUS_SUCCESS(status)) | ||
| 151 | { | ||
| 152 | errno = EVMSERR; | ||
| 153 | vaxc$errno = status; | ||
| 154 | return NULL; | ||
| 155 | } | ||
| 156 | |||
| 157 | /* Quick, cheap and dirty way to discard any device and directory, | ||
| 158 | since we only want file names */ | ||
| 159 | l = (*ctx)->result_dsc.dsc$w_length; | ||
| 160 | p = (*ctx)->result_dsc.dsc$a_pointer; | ||
| 161 | r = p; | ||
| 162 | for (; *p; p++) | ||
| 163 | { | ||
| 164 | if (*p == '^' && p[1] != '\0') /* Take care of ODS-5 escapes */ | ||
| 165 | { | ||
| 166 | p++; | ||
| 167 | } | ||
| 168 | else if (*p == ':' || *p == '>' || *p == ']') | ||
| 169 | { | ||
| 170 | l -= p + 1 - r; | ||
| 171 | r = p + 1; | ||
| 172 | } | ||
| 173 | else if (*p == ';') | ||
| 174 | { | ||
| 175 | l = p - r; | ||
| 176 | break; | ||
| 177 | } | ||
| 178 | } | ||
| 179 | |||
| 180 | strncpy((*ctx)->result, r, l); | ||
| 181 | (*ctx)->result[l] = '\0'; | ||
| 182 | str$free1_dx(&(*ctx)->result_dsc); | ||
| 183 | |||
| 184 | return (*ctx)->result; | ||
| 185 | } | ||
| 186 | |||
| 187 | int LP_find_file_end(LP_DIR_CTX **ctx) | ||
| 188 | { | ||
| 189 | if (ctx != NULL && *ctx != NULL) | ||
| 190 | { | ||
| 191 | int status = lib$find_file_end(&(*ctx)->VMS_context); | ||
| 192 | |||
| 193 | free(*ctx); | ||
| 194 | |||
| 195 | if(!$VMS_STATUS_SUCCESS(status)) | ||
| 196 | { | ||
| 197 | errno = EVMSERR; | ||
| 198 | vaxc$errno = status; | ||
| 199 | return 0; | ||
| 200 | } | ||
| 201 | return 1; | ||
| 202 | } | ||
| 203 | errno = EINVAL; | ||
| 204 | return 0; | ||
| 205 | } | ||
| 206 | |||
diff --git a/src/lib/libssl/src/crypto/LPdir_win.c b/src/lib/libssl/src/crypto/LPdir_win.c deleted file mode 100644 index 702dbc730f..0000000000 --- a/src/lib/libssl/src/crypto/LPdir_win.c +++ /dev/null | |||
| @@ -1,153 +0,0 @@ | |||
| 1 | /* $LP: LPlib/source/LPdir_win.c,v 1.10 2004/08/26 13:36:05 _cvs_levitte Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 4 | * All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * | ||
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 26 | */ | ||
| 27 | #include <windows.h> | ||
| 28 | #include <tchar.h> | ||
| 29 | #ifndef LPDIR_H | ||
| 30 | #include "LPdir.h" | ||
| 31 | #endif | ||
| 32 | |||
| 33 | /* We're most likely overcautious here, but let's reserve for | ||
| 34 | broken WinCE headers and explicitly opt for UNICODE call. | ||
| 35 | Keep in mind that our WinCE builds are compiled with -DUNICODE | ||
| 36 | [as well as -D_UNICODE]. */ | ||
| 37 | #if defined(LP_SYS_WINCE) && !defined(FindFirstFile) | ||
| 38 | # define FindFirstFile FindFirstFileW | ||
| 39 | #endif | ||
| 40 | #if defined(LP_SYS_WINCE) && !defined(FindFirstFile) | ||
| 41 | # define FindNextFile FindNextFileW | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #ifndef NAME_MAX | ||
| 45 | #define NAME_MAX 255 | ||
| 46 | #endif | ||
| 47 | |||
| 48 | struct LP_dir_context_st | ||
| 49 | { | ||
| 50 | WIN32_FIND_DATA ctx; | ||
| 51 | HANDLE handle; | ||
| 52 | char entry_name[NAME_MAX+1]; | ||
| 53 | }; | ||
| 54 | |||
| 55 | const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) | ||
| 56 | { | ||
| 57 | if (ctx == NULL || directory == NULL) | ||
| 58 | { | ||
| 59 | errno = EINVAL; | ||
| 60 | return 0; | ||
| 61 | } | ||
| 62 | |||
| 63 | errno = 0; | ||
| 64 | if (*ctx == NULL) | ||
| 65 | { | ||
| 66 | *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX)); | ||
| 67 | if (*ctx == NULL) | ||
| 68 | { | ||
| 69 | errno = ENOMEM; | ||
| 70 | return 0; | ||
| 71 | } | ||
| 72 | memset(*ctx, '\0', sizeof(LP_DIR_CTX)); | ||
| 73 | |||
| 74 | if (sizeof(TCHAR) != sizeof(char)) | ||
| 75 | { | ||
| 76 | TCHAR *wdir = NULL; | ||
| 77 | /* len_0 denotes string length *with* trailing 0 */ | ||
| 78 | size_t index = 0,len_0 = strlen(directory) + 1; | ||
| 79 | |||
| 80 | wdir = (TCHAR *)malloc(len_0 * sizeof(TCHAR)); | ||
| 81 | if (wdir == NULL) | ||
| 82 | { | ||
| 83 | free(*ctx); | ||
| 84 | *ctx = NULL; | ||
| 85 | errno = ENOMEM; | ||
| 86 | return 0; | ||
| 87 | } | ||
| 88 | |||
| 89 | #ifdef LP_MULTIBYTE_AVAILABLE | ||
| 90 | if (!MultiByteToWideChar(CP_ACP, 0, directory, len_0, (WCHAR *)wdir, len_0)) | ||
| 91 | #endif | ||
| 92 | for (index = 0; index < len_0; index++) | ||
| 93 | wdir[index] = (TCHAR)directory[index]; | ||
| 94 | |||
| 95 | (*ctx)->handle = FindFirstFile(wdir, &(*ctx)->ctx); | ||
| 96 | |||
| 97 | free(wdir); | ||
| 98 | } | ||
| 99 | else | ||
| 100 | (*ctx)->handle = FindFirstFile((TCHAR *)directory, &(*ctx)->ctx); | ||
| 101 | |||
| 102 | if ((*ctx)->handle == INVALID_HANDLE_VALUE) | ||
| 103 | { | ||
| 104 | free(*ctx); | ||
| 105 | *ctx = NULL; | ||
| 106 | errno = EINVAL; | ||
| 107 | return 0; | ||
| 108 | } | ||
| 109 | } | ||
| 110 | else | ||
| 111 | { | ||
| 112 | if (FindNextFile((*ctx)->handle, &(*ctx)->ctx) == FALSE) | ||
| 113 | { | ||
| 114 | return 0; | ||
| 115 | } | ||
| 116 | } | ||
| 117 | |||
| 118 | if (sizeof(TCHAR) != sizeof(char)) | ||
| 119 | { | ||
| 120 | TCHAR *wdir = (*ctx)->ctx.cFileName; | ||
| 121 | size_t index, len_0 = 0; | ||
| 122 | |||
| 123 | while (wdir[len_0] && len_0 < (sizeof((*ctx)->entry_name) - 1)) len_0++; | ||
| 124 | len_0++; | ||
| 125 | |||
| 126 | #ifdef LP_MULTIBYTE_AVAILABLE | ||
| 127 | if (!WideCharToMultiByte(CP_ACP, 0, (WCHAR *)wdir, len_0, (*ctx)->entry_name, | ||
| 128 | sizeof((*ctx)->entry_name), NULL, 0)) | ||
| 129 | #endif | ||
| 130 | for (index = 0; index < len_0; index++) | ||
| 131 | (*ctx)->entry_name[index] = (char)wdir[index]; | ||
| 132 | } | ||
| 133 | else | ||
| 134 | strncpy((*ctx)->entry_name, (const char *)(*ctx)->ctx.cFileName, | ||
| 135 | sizeof((*ctx)->entry_name)-1); | ||
| 136 | |||
| 137 | (*ctx)->entry_name[sizeof((*ctx)->entry_name)-1] = '\0'; | ||
| 138 | |||
| 139 | return (*ctx)->entry_name; | ||
| 140 | } | ||
| 141 | |||
| 142 | int LP_find_file_end(LP_DIR_CTX **ctx) | ||
| 143 | { | ||
| 144 | if (ctx != NULL && *ctx != NULL) | ||
| 145 | { | ||
| 146 | FindClose((*ctx)->handle); | ||
| 147 | free(*ctx); | ||
| 148 | *ctx = NULL; | ||
| 149 | return 1; | ||
| 150 | } | ||
| 151 | errno = EINVAL; | ||
| 152 | return 0; | ||
| 153 | } | ||
diff --git a/src/lib/libssl/src/crypto/LPdir_win32.c b/src/lib/libssl/src/crypto/LPdir_win32.c deleted file mode 100644 index e39872da52..0000000000 --- a/src/lib/libssl/src/crypto/LPdir_win32.c +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | /* $LP: LPlib/source/LPdir_win32.c,v 1.3 2004/08/26 13:36:05 _cvs_levitte Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 4 | * All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * | ||
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #define LP_SYS_WIN32 | ||
| 29 | #define LP_MULTIBYTE_AVAILABLE | ||
| 30 | #include "LPdir_win.c" | ||
diff --git a/src/lib/libssl/src/crypto/LPdir_wince.c b/src/lib/libssl/src/crypto/LPdir_wince.c deleted file mode 100644 index ab0e1e6f4f..0000000000 --- a/src/lib/libssl/src/crypto/LPdir_wince.c +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | /* $LP: LPlib/source/LPdir_wince.c,v 1.3 2004/08/26 13:36:05 _cvs_levitte Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 4 | * All rights reserved. | ||
| 5 | * | ||
| 6 | * Redistribution and use in source and binary forms, with or without | ||
| 7 | * modification, are permitted provided that the following conditions | ||
| 8 | * are met: | ||
| 9 | * 1. Redistributions of source code must retain the above copyright | ||
| 10 | * notice, this list of conditions and the following disclaimer. | ||
| 11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 12 | * notice, this list of conditions and the following disclaimer in the | ||
| 13 | * documentation and/or other materials provided with the distribution. | ||
| 14 | * | ||
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| 16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| 19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 26 | */ | ||
| 27 | |||
| 28 | #define LP_SYS_WINCE | ||
| 29 | /* We might want to define LP_MULTIBYTE_AVAILABLE here. It's currently | ||
| 30 | under investigation what the exact conditions would be */ | ||
| 31 | #include "LPdir_win.c" | ||
diff --git a/src/lib/libssl/src/crypto/o_dir.c b/src/lib/libssl/src/crypto/o_dir.c deleted file mode 100644 index 42891ea459..0000000000 --- a/src/lib/libssl/src/crypto/o_dir.c +++ /dev/null | |||
| @@ -1,83 +0,0 @@ | |||
| 1 | /* crypto/o_dir.c -*- mode:C; c-file-style: "eay" -*- */ | ||
| 2 | /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL | ||
| 3 | * project 2004. | ||
| 4 | */ | ||
| 5 | /* ==================================================================== | ||
| 6 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved. | ||
| 7 | * | ||
| 8 | * Redistribution and use in source and binary forms, with or without | ||
| 9 | * modification, are permitted provided that the following conditions | ||
| 10 | * are met: | ||
| 11 | * | ||
| 12 | * 1. Redistributions of source code must retain the above copyright | ||
| 13 | * notice, this list of conditions and the following disclaimer. | ||
| 14 | * | ||
| 15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 16 | * notice, this list of conditions and the following disclaimer in | ||
| 17 | * the documentation and/or other materials provided with the | ||
| 18 | * distribution. | ||
| 19 | * | ||
| 20 | * 3. All advertising materials mentioning features or use of this | ||
| 21 | * software must display the following acknowledgment: | ||
| 22 | * "This product includes software developed by the OpenSSL Project | ||
| 23 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 24 | * | ||
| 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 26 | * endorse or promote products derived from this software without | ||
| 27 | * prior written permission. For written permission, please contact | ||
| 28 | * openssl-core@openssl.org. | ||
| 29 | * | ||
| 30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
| 31 | * nor may "OpenSSL" appear in their names without prior written | ||
| 32 | * permission of the OpenSSL Project. | ||
| 33 | * | ||
| 34 | * 6. Redistributions of any form whatsoever must retain the following | ||
| 35 | * acknowledgment: | ||
| 36 | * "This product includes software developed by the OpenSSL Project | ||
| 37 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 38 | * | ||
| 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 51 | * ==================================================================== | ||
| 52 | * | ||
| 53 | * This product includes cryptographic software written by Eric Young | ||
| 54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
| 55 | * Hudson (tjh@cryptsoft.com). | ||
| 56 | * | ||
| 57 | */ | ||
| 58 | |||
| 59 | #include <errno.h> | ||
| 60 | #include <e_os.h> | ||
| 61 | |||
| 62 | /* The routines really come from the Levitte Programming, so to make | ||
| 63 | life simple, let's just use the raw files and hack the symbols to | ||
| 64 | fit our namespace. */ | ||
| 65 | #define LP_DIR_CTX OPENSSL_DIR_CTX | ||
| 66 | #define LP_dir_context_st OPENSSL_dir_context_st | ||
| 67 | #define LP_find_file OPENSSL_DIR_read | ||
| 68 | #define LP_find_file_end OPENSSL_DIR_end | ||
| 69 | |||
| 70 | #include "o_dir.h" | ||
| 71 | |||
| 72 | #define LPDIR_H | ||
| 73 | #if defined OPENSSL_SYS_UNIX || defined DJGPP | ||
| 74 | #include "LPdir_unix.c" | ||
| 75 | #elif defined OPENSSL_SYS_VMS | ||
| 76 | #include "LPdir_vms.c" | ||
| 77 | #elif defined OPENSSL_SYS_WIN32 | ||
| 78 | #include "LPdir_win32.c" | ||
| 79 | #elif defined OPENSSL_SYS_WINCE | ||
| 80 | #include "LPdir_wince.c" | ||
| 81 | #else | ||
| 82 | #include "LPdir_nyi.c" | ||
| 83 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/o_dir.h b/src/lib/libssl/src/crypto/o_dir.h deleted file mode 100644 index 4b725c0312..0000000000 --- a/src/lib/libssl/src/crypto/o_dir.h +++ /dev/null | |||
| @@ -1,53 +0,0 @@ | |||
| 1 | /* crypto/o_dir.h -*- mode:C; c-file-style: "eay" -*- */ | ||
| 2 | /* Copied from Richard Levitte's (richard@levitte.org) LP library. All | ||
| 3 | * symbol names have been changed, with permission from the author. | ||
| 4 | */ | ||
| 5 | |||
| 6 | /* $LP: LPlib/source/LPdir.h,v 1.1 2004/06/14 08:56:04 _cvs_levitte Exp $ */ | ||
| 7 | /* | ||
| 8 | * Copyright (c) 2004, Richard Levitte <richard@levitte.org> | ||
| 9 | * All rights reserved. | ||
| 10 | * | ||
| 11 | * Redistribution and use in source and binary forms, with or without | ||
| 12 | * modification, are permitted provided that the following conditions | ||
| 13 | * are met: | ||
| 14 | * 1. Redistributions of source code must retain the above copyright | ||
| 15 | * notice, this list of conditions and the following disclaimer. | ||
| 16 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 17 | * notice, this list of conditions and the following disclaimer in the | ||
| 18 | * documentation and/or other materials provided with the distribution. | ||
| 19 | * | ||
| 20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
| 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
| 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 30 | * SUCH DAMAGE. | ||
| 31 | */ | ||
| 32 | |||
| 33 | |||
| 34 | #ifndef O_DIR_H | ||
| 35 | #define O_DIR_H | ||
| 36 | |||
| 37 | #ifdef __cplusplus | ||
| 38 | extern "C" { | ||
| 39 | #endif | ||
| 40 | |||
| 41 | typedef struct OPENSSL_dir_context_st OPENSSL_DIR_CTX; | ||
| 42 | |||
| 43 | /* returns NULL on error or end-of-directory. | ||
| 44 | If it is end-of-directory, errno will be zero */ | ||
| 45 | const char *OPENSSL_DIR_read(OPENSSL_DIR_CTX **ctx, const char *directory); | ||
| 46 | /* returns 1 on success, 0 on error */ | ||
| 47 | int OPENSSL_DIR_end(OPENSSL_DIR_CTX **ctx); | ||
| 48 | |||
| 49 | #ifdef __cplusplus | ||
| 50 | } | ||
| 51 | #endif | ||
| 52 | |||
| 53 | #endif /* LPDIR_H */ | ||
diff --git a/src/lib/libcrypto/LPdir_unix.c b/src/lib/libssl/src/ssl/LPdir_unix.c index b004cd99e8..b004cd99e8 100644 --- a/src/lib/libcrypto/LPdir_unix.c +++ b/src/lib/libssl/src/ssl/LPdir_unix.c | |||
diff --git a/src/lib/libcrypto/o_dir.c b/src/lib/libssl/src/ssl/o_dir.c index 42891ea459..42891ea459 100644 --- a/src/lib/libcrypto/o_dir.c +++ b/src/lib/libssl/src/ssl/o_dir.c | |||
diff --git a/src/lib/libcrypto/o_dir.h b/src/lib/libssl/src/ssl/o_dir.h index 4b725c0312..4b725c0312 100644 --- a/src/lib/libcrypto/o_dir.h +++ b/src/lib/libssl/src/ssl/o_dir.h | |||
diff --git a/src/lib/libssl/ssl/Makefile b/src/lib/libssl/ssl/Makefile index 8c51f2f55e..805070c5fe 100644 --- a/src/lib/libssl/ssl/Makefile +++ b/src/lib/libssl/ssl/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.31 2014/04/11 22:51:54 miod Exp $ | 1 | # $OpenBSD: Makefile,v 1.32 2014/04/13 15:49:50 miod Exp $ |
| 2 | 2 | ||
| 3 | LIB= ssl | 3 | LIB= ssl |
| 4 | 4 | ||
| @@ -9,7 +9,7 @@ CFLAGS+= -DTERMIOS -DANSI_SOURCE | |||
| 9 | CFLAGS+= -DOPENSSL_NO_RC5 -DOPENSSL_NO_KRB5 | 9 | CFLAGS+= -DOPENSSL_NO_RC5 -DOPENSSL_NO_KRB5 |
| 10 | CFLAGS+= -DOPENSSL_NO_SSL2 | 10 | CFLAGS+= -DOPENSSL_NO_SSL2 |
| 11 | CFLAGS+= -DOPENSSL_NO_BUF_FREELISTS -DOPENSSL_NO_HEARTBEATS | 11 | CFLAGS+= -DOPENSSL_NO_BUF_FREELISTS -DOPENSSL_NO_HEARTBEATS |
| 12 | CFLAGS+= -I${SSL_SRC} -I${SSL_SRC}/crypto | 12 | CFLAGS+= -I${SSL_SRC} |
| 13 | 13 | ||
| 14 | SRCS=\ | 14 | SRCS=\ |
| 15 | s2_meth.c s2_srvr.c s2_clnt.c s2_lib.c s2_enc.c s2_pkt.c \ | 15 | s2_meth.c s2_srvr.c s2_clnt.c s2_lib.c s2_enc.c s2_pkt.c \ |
| @@ -23,6 +23,7 @@ SRCS=\ | |||
| 23 | ssl_asn1.c ssl_txt.c ssl_algs.c \ | 23 | ssl_asn1.c ssl_txt.c ssl_algs.c \ |
| 24 | bio_ssl.c ssl_err.c kssl.c tls_srp.c t1_reneg.c | 24 | bio_ssl.c ssl_err.c kssl.c tls_srp.c t1_reneg.c |
| 25 | SRCS+= s3_cbc.c | 25 | SRCS+= s3_cbc.c |
| 26 | SRCS+= o_dir.c | ||
| 26 | 27 | ||
| 27 | HDRS= srtp.h ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h kssl.h | 28 | HDRS= srtp.h ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h kssl.h |
| 28 | 29 | ||
