summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/labs.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-12-07Make GOST compile with a strict C compiler - in this case incrementing ajsing6-20/+24
void pointer is undefined and initialising an array with {} is a syntax error. Based on a diff from kinichiro inoguchi.
2014-12-07Correctly output the result in STREEBOG512_Final() when running on a big-endianmiod2-10/+56
system. *blush*
2014-12-07Fix a memory leak in tls_check_subject_altname() by callingjsing1-2/+2
sk_GENERAL_NAME_pop_free() instead of sk_GENERAL_NAME_free(). The latter only frees the stack itself and does not free the items. From Basskrapfen on github.
2014-12-07Make sure to load absolute symbol address with `dla' instead of `la' whenmiod4-10/+34
generating code for 64-bit mips userland.
2014-12-07revert previous change for now, adjusting based on comments from jsing@bcook4-36/+27
2014-12-07Revert to the use of C code for the basic BN routines (bn_add_words,miod2-4/+14
bn_div_words, bn_mul_add_words, bn_mul_words, bn_sqr_words, bn_sub_words) on sgi, because the generated assembly code isn't R4000-safe.
2014-12-07Remove OPENSSL_FIPSCANISTER mentions.miod8-34/+2
2014-12-07Remove unused variable.jsing1-5/+1
From Benjamin Baier <programmer at netzbasis.de>
2014-12-07Allow specific libtls hostname validation errors to propagate.bcook4-27/+36
Remove direct calls to printf from the tls_check_hostname() path. This allows NUL byte error messages to bubble up to the caller, to be logged in a program-appropriate way. It also removes non-portable calls to getprogname(). The semantics of tls_error() are changed slightly: the last error message is not necessarily preserved between subsequent calls into the library. When the previous call to libtls succeeds, client programs should treat the return value of tls_error() as undefined. ok tedu@
2014-12-07Handle GF(2^m) EC curves for C code generation.jsing1-5/+7
From Minux Ma.
2014-12-07Remove get_optional_pkey_id() - it is a hack that existed due to GOSTjsing2-92/+16
only sometimes being available... and when it was available it was via the crypto engine. GOST is now part of libcrypto proper. Instead of trying to do EVP PKEY lookups via string literals and the ASN1 interfaces, lookup the methods directly using the appropriate NID. ok bcook@
2014-12-06fix manual names that clash with other manualsschwarze4-4/+4
2014-12-06delete four MLINKS that are both duplicate and wrongschwarze1-5/+1
2014-12-06Avoid modifying input on failure in X509_(TRUST|PURPOSE)_add.doug4-34/+42
If X509_TRUST_add() or X509_PURPOSE_add() fail, they will leave the object in an inconsistent state since the name is already freed. This commit avoids changing the original name unless the *_add() call will succeed. Based on BoringSSL's commit: ab2815eaff6219ef57aedca2f7b1b72333c27fd0 ok miod@
2014-12-06malloc(3) is in the "comp" install set, malloc.conf(5) in "man",schwarze2-128/+10
breaking the hardlink between file system entries, confusing apropos(1). Split malloc.conf(5) out of malloc(3) as suggested by deraadt@. Feedback and OK jmc@, OK deraadt@ tedu@ jasper@.
2014-12-06Remove now bogus comment that got missed in the GOST commit.jsing2-10/+4
2014-12-06Fix some horrible style(9) violations...jsing2-126/+126
2014-12-06Remove client handling of RSA in ServerKeyExchange messages, along withjsing8-198/+52
the associated peer_rsa_tmp goop. This was only needed for export cipher handling and intentional RFC violations. The export cipher suites have already been removed and previous cleanup means that we will never send ServerKeyExchange messages from the server side for RSA.
2014-12-06Use appropriate internal types for EC curves and formats, rather thanjsing6-222/+248
storing and processing in wire encoded form. Inspired by boringssl. ok miod@
2014-12-06Ensure that the client specified EC curve list length is a multiple of two.jsing2-4/+6
The EC curve handling code assumes this to be the case and will read one byte off the end of the curve list during processing, in the case where it is not. ok miod@
2014-12-06Fix two cases where it is possible to read one or two bytes past the end ofjsing2-6/+30
the buffer. The later size check would catch this, however reading first and checking later is less than ideal. ok miod@
2014-12-06The -ssl2 flag does nothing - remove the flag and any tests that werejsing2-34/+4
using it.
2014-12-04add missing .Fn macros in the SYNOPSIS; found with mandoc.db(5)schwarze2-10/+10
2014-12-03Allow overriding the path to the testssl and openssl binaries.bcook1-9/+9
This is needed by the portable tree to point directly to the newly-built binaries when running unit tests. discussed with jsing@ and others
2014-12-03Move Windows OS-specific functions to make porting easier.bcook4-31/+165
Several functions that need to be redefined for a Windows port are right in the middle of other code that is relatively portable. This patch isolates the functions that need Windows-specific implementations so they can be built conditionally in the portable tree. Add calls to BIO_sock_init() as-needed to openssl(1) so that socket IO works on Windows. Sorry, these are no-op on other platforms. ok jsing@ deraadt@
2014-12-03Move Windows OS-specific functions to make porting easier.bcook5-53/+183
Several functions that need to be redefined for a Windows port are right in the middle of other code that is relatively portable. This patch isolates the functions that need Windows-specific implementations so they can be built conditionally in the portable tree. ok jsing@ deraadt@
2014-12-03We're not supporting 16-bit Windows, remove cast.bcook2-6/+4
ok jsing@ deraadt@
2014-12-03handle the (impossible) situation of a size_t - 1 buffer fromderaadt2-4/+4
EC_POINT_point2oct so that later allocation does not overflow with miod
2014-12-03Spotted another opportunity to use reallocarray().deraadt2-4/+4
ok miod
2014-12-03Fill the buffer with 'z' instead of 'a' since 'a' is part of themillert2-38/+150
string we are testing. Add tests to verify that we get SIGSEGV when passed a NULL src or dst. It is better to crash than for an implementation to check for NULL and try to recover.
2014-12-02Add brainpool curves to eccurves_default[], accidentally missing from 1.32;miod2-4/+10
from OpenSSL HEAD via Thomas Jakobi.
2014-12-02Add simple strlcpy regressmillert3-3/+123
2014-12-02convert select() to poll(). This is one of the most complicatedderaadt2-40/+63
conversions in the tree, because the original code is very rotten and fragile. Please test and report any failures. Assistance from millert, bcook, and jsing.
2014-12-02Conversion of braindead select() path to braindead poll() path.deraadt1-17/+17
Also looked at by bcook
2014-12-02Add simple strlcat regressmillert3-2/+124
2014-12-02Add strnlen to SUBDIRS so we actually run its tests.millert1-2/+2
2014-12-02add some openbsd tags, and a first pass at cleanup;jmc166-210/+708
2014-12-02macro cleanup; kaspars at bankovskis dot netschwarze2-49/+55
2014-11-30Replace all 14 instances of .St -ansiC-99 in our tree with .St -isoC-99.schwarze11-33/+33
The former is not used anywhere in NetBSD, FreeBSD, or DragonFly and not supported by groff, so i'm going to delete it from mandoc(1). We don't need two macros for the same thing.
2014-11-30obvious STANDARDS updateschwarze2-14/+10
2014-11-30restructure libc/string + libc/arch/*/string coperation regardingderaadt8-155/+309
(potentially) MD versions (function dependent, not filename dependent) split out memcpy/memmove/bcopy and strchr/index/strrchr/rindex Bring back amd64 .S versions And the final touch: switch all architectures temporarily to MI memcpy.c, which contains syslog + abort for overlapping copies. A nice harsh undefined behaviour. We will clean the entire userland of the remaining issues in this catagory, then switch to the optimised memcpy which skips the memmove check. I tried to cut this change into pieces, but testing each sub-step on every architecture is too time consuming and mindnumbing. ok miod
2014-11-30Remove non-portable use of .Pf that doesn't work with groff;schwarze2-16/+8
found because the groff_mdoc(7) macros warn about it.
2014-11-27Ensure that sess_cert is not NULL at the start ofjsing2-50/+18
ssl3_send_client_key_exchange(), rather than checking it in the key exchange algorithm specific code. ok beck@ miod@
2014-11-27Avoid a double-free in an error path.jsing2-4/+2
Reported by Felix Groebert of the Google Security Team. ok beck@ miod@
2014-11-27Avoid a NULL dereference in the DTLS client that can be triggered by ajsing2-2/+18
crafted server response used in conjunction with an anonymous DH or anonymous ECDH ciphersuite. Fixes CVE-2014-3510, which is effectively a repeat of CVE-2014-3470 in copied code. Reported by Felix Groebert of the Google Security Team. ok beck@ miod@
2014-11-26prefer memcmp to bcmp.bcook1-2/+2
ok tedu@ miod@ deraadt@
2014-11-26remove superflous gettimeofday wrapper.bcook2-18/+4
ok beck@ tedu@ miod@ guenther@ doug@ deraadt@
2014-11-26memset like a normal human.bcook2-20/+20
ok beck@ tedu@ miod@
2014-11-26normalize set/getsockopt usage.bcook6-90/+54
Remove the remaining random casts on optval. Fixups for this can be handled by the portability layer all in once place. Remove remaining fake socklen_t unions, though beck@ points out that this also removes support for socklen_t changing its length at runtime. RIP. ok tedu@ beck@ miod@ deraadt@
2014-11-26Linux has had IP_MTU since 2005, don't force it.bcook2-16/+8
ok beck@ miod@ tedu@ deraadt@