summaryrefslogtreecommitdiffstats
path: root/crypto/bio/bss_file.c
AgeCommit message (Collapse)Author
2017-12-18Add comments to NULL func ptrs in bio_method_stDaniel Bevenius
This commit adds comments to bio_method_st definitions where the function pointers are defined as NULL. Most of the structs have comments but some where missing and not all consitent. CLA: trivial Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4881)
2017-10-13Remove email addresses from source code.Rich Salz
Names were not removed. Some comments were updated. Replace Andy's address with openssl.org Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/4516)
2017-07-07BIO range checking.Pauli
Add length limits to avoid problems with sprintf, strcpy and strcat. This replaces recently removed code but also guards some previously missing function calls (for DOS & Windows). Reworked the BIO_dump_indent_cb code to reduce temporary storage. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3870)
2017-07-05Undo commit d420ac2Rich Salz
[extended tests] Original text: Use BUF_strlcpy() instead of strcpy(). Use BUF_strlcat() instead of strcat(). Use BIO_snprintf() instead of sprintf(). In some cases, keep better track of buffer lengths. This is part of a large change submitted by Markus Friedl <markus@openbsd.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/3701)
2017-04-28Check fflush on BIO_ctrl callRich Salz
Bug found and fix suggested by Julian Rüth. Push error if fflush fails Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3266)
2016-10-28Fix stdio build following BIO size_t workMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-10-28Create BIO_write_ex() which handles size_t argumentsMatt Caswell
Also extend BIO_METHOD to be able to supply an implementation for the new BIO_write_ex function. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-10-28Create BIO_read_ex() which handles size_t argumentsMatt Caswell
Also extend BIO_METHOD to be able to supply an implementation for the new BIO_read function. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-09-08If errno is ENXIO in BSS_new_file(), set BIO_R_NO_SUCH_FILERichard Levitte
VMS sets that errno when the device part of a file spec is malformed or a logical name that doesn't exist. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-22Move OS-specific fopen quirks to o_fopen.c.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-17Copyright consolidation 09/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-12DJGPP adjustmentsRichard Levitte
* Configure: Replaced -DTERMIO by -DTERMIOS in CFLAGS. * crypto/bio/bss_dgram.c [WATT32]: Remove obsolete redefinition of function names: sock_write, sock_read and sock_puts. * crypto/bio/bss_sock.c [WATT32]: For Watt-32 2.2.11 sock_write, sock_read and sock_puts are redefined to their private names so their names must be undefined first before they can be redefined again. * crypto/bio/bss_file.c (file_fopen) [__DJGPP__]: Make a copy of the passed file name and replace the leading dots in the dirname part and the basname part of the file name, unless LFN is supported. * e_os.h [__DJGPP__]: Undefine macro DEVRANDOM_EGD. Neither MS-DOS nor FreeDOS provide 'egd' sockets. New macro HAS_LFN_SUPPORT checks if underlying file system supports long file names or not. Include sys/un.h. Define WATT32_NO_OLDIES. * INSTALL.DJGPP: Update URL of WATT-32 library. Submitted by Juan Manuel Guerrero <juan.guerrero@gmx.de> RT#4217 Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-04-11BIO: respect opening in text modeRichard Levitte
When a file is opened with BIO_new_file(), make sure that the internal mode TEXT vs BINARY setting reflects what's given in the mode string. Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-04-07bio/bss_file.c: since VS2015 one can't tell apart own and "alien" FILEAndy Polyakov
pointers, except for minimal std[in|out|err]. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-21RT4660: BIO_METHODs should be const.David Benjamin
BIO_new, etc., don't need a non-const BIO_METHOD. This allows all the built-in method tables to live in .rodata. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-17Remove Netware and OS/2Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-05GH601: Various spelling fixes.FdaSilvaYY
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-03Refactoring BIO: Small adjustmentsRichard Levitte
Because of the way bio_lcl.h is organised, we must not include internal/cryptlib.h before it. As a matter of fact, bio_lcl.h includes internal/cryptlib.h on its own. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-12-16Rename some BUF_xxx to OPENSSL_xxxRich Salz
Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} Add #define's for the old names. Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-29Fix no-stdio buildDavid Woodhouse
Much related/similar work also done by Ivan Nestlerode <ivan.nestlerode@sonos.com> +Replace FILE BIO's with dummy ops that fail. +Include <stdio.h> for sscanf() even with no-stdio (since the declaration is there). We rely on sscanf() to parse the OPENSSL_ia32cap environment variable, since it can be larger than a 'long'. And we don't rely on the availability of strtoull(). +Remove OPENSSL_stderr(); not used. +Make OPENSSL_showfatal() do nothing (currently without stdio there's nothing we can do). +Remove file-based functionality from ssl/. The function prototypes were already gone, but not the functions themselves. +Remove unviable conf functionality via SYS_UEFI +Add fallback definition of BUFSIZ. +Remove functions taking FILE * from header files. +Add missing DECLARE_PEM_write_fp_const +Disable X509_LOOKUP_hash_dir(). X509_LOOKUP_file() was already compiled out, so remove its prototype. +Use OPENSSL_showfatal() in CRYPTO_destroy_dynlockid(). +Eliminate SRP_VBASE_init() and supporting functions. Users will need to build the verifier manually instead. +Eliminate compiler warning for unused do_pk8pkey_fp(). +Disable TEST_ENG_OPENSSL_PKEY. +Disable GOST engine as is uses [f]printf all over the place. +Eliminate compiler warning for unused send_fp_chars(). Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-21RT3479: Add UTF8 support to BIO_read_filename()David Woodhouse
If we use BIO_new_file(), on Windows it'll jump through hoops to work around their unusual charset/Unicode handling. it'll convert a UTF-8 filename to UCS-16LE and attempt to use _wfopen(). If you use BIO_read_filename(), it doesn't do this. Shouldn't it be consistent? It would certainly be nice if SSL_use_certificate_chain_file() worked. Also made BIO_C_SET_FILENAME work (rsalz) Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-05-14Identify and move common internal libcrypto header filesRichard Levitte
There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-03Add OSSL_NELEM macro.Dr. Stephen Henson
Add OSSL_NELEM macro to e_os.h to determine the number of elements in an array. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Rerun util/openssl-format-source -v -c .master-post-auto-reformatMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22indent has problems with comments that are on the right hand side of a line.Matt Caswell
Sometimes it fails to format them very well, and sometimes it corrupts them! This commit moves some particularly problematic ones. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22More commentsMatt Caswell
Conflicts: crypto/dsa/dsa_vrf.c crypto/ec/ec2_smpl.c crypto/ec/ecp_smpl.c Conflicts: demos/bio/saccept.c ssl/d1_clnt.c Conflicts: bugs/dggccbug.c demos/tunala/cb.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-12RT3548: Remove unsupported platformsRich Salz
This last one for this ticket. Removes WIN16. So long, MS_CALLBACK and MS_FAR. We won't miss you. Reviewed-by: Richard Levitte <levitte@openssl.org>
2010-12-11bss_file.c: refine UTF8 logic.Andy Polyakov
PR: 2382
2010-04-28bss_file.c: refine UTF-8 logic on Windows.Andy Polyakov
2010-04-21bss_file.c: reserve for option to encode file name with UTF-8.Andy Polyakov
2010-03-22bss_file.c: fix MSC 6.0 warning.Andy Polyakov
2010-03-15Fix UPLINK typo.Andy Polyakov
2009-10-04Prevent ignored return value warningDr. Stephen Henson
2008-12-22This _WIN32-specific patch makes it possible to "wrap" OpenSSL in anotherAndy Polyakov
.DLL, in particular static build. The issue has been discussed in RT#1230 and later on openssl-dev, and mutually exclusive approaches were suggested. This completes compromise solution suggested in RT#1230. PR: 1230
2008-01-03Netware support.Dr. Stephen Henson
Submitted by: Guenter Knauf <eflash@gmx.net>
2006-01-29add additional checks + cleanupNils Larsch
Submitted by: David Hartman <david_hartman@symantec.com>
2005-12-18Keep disclaiming 16-bit platform support. For now remove WIN16 referencesAndy Polyakov
from .h files...
2005-11-03Make cygwin work in directories mounted with 'text' attribute.Andy Polyakov
2005-09-29Fix typo.Andy Polyakov
2005-09-29Fix missing applink call.Andy Polyakov
2005-06-06Allow BIO_s_file to open and sequentially access files larger than 2GB onAndy Polyakov
affected platforms. PR: 973
2005-05-18Engage Applink in mingw. Note that application-side module is notAndy Polyakov
compiled into *our* aplpications. That's because mingw is always consistent with itself. Having library-side code linked into .dll makes it possible to deploy the .dll with user-code compiled with another compiler [which is pretty much the whole point behind Applink].
2005-05-17OPENSSL_Applink update.Andy Polyakov
2004-12-27Minor cygwin update.Andy Polyakov
PR: 949
2004-03-24Don't define fd for platforms that do not use it, as some may not declare ↵Richard Levitte
fileno() properly
2004-03-21Make sure fd is defined where it should.Richard Levitte
PR: 849
2003-12-27Use BUF_strlcpy() instead of strcpy().Richard Levitte
Use BUF_strlcat() instead of strcat(). Use BIO_snprintf() instead of sprintf(). In some cases, keep better track of buffer lengths. This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-11-28Netware-specific changes,Richard Levitte
PR: 780 Submitted by: Verdon Walker <VWalker@novell.com> Reviewed by: Richard Levitte