summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/buffer/buffer.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2015-06-17Clean up alert codes and add references.jsing2-42/+58
2015-06-17Keep alerts sorted by alert code.jsing5-14/+15
2015-06-17Remove pointless comments.jsing2-14/+6
2015-06-17Convert ssl_next_proto_validate to CBS.doug2-22/+24
ok miod@, tweak + ok jsing@
2015-06-17Convert tls1_check_curve to CBS.doug2-8/+20
ok miod@ jsing@
2015-06-17KNF whitespace.doug4-34/+38
ok miod@ jsing@
2015-06-17Use explicit int in bs_cbs.c.doug4-44/+48
ok miod@ jsing@
2015-06-17Use explicit int in bs_ber.c.doug2-16/+16
ok miod@ jsing@
2015-06-17Add tests for CBS_offset() and CBS_write_bytes().doug1-2/+70
"no problem" miod@, tweak + ok jsing@
2015-06-17Add CBS_write_bytes() to copy the remaining CBS bytes to the caller.doug4-4/+48
This is a common operation when dealing with CBS. ok miod@ jsing@
2015-06-17Add a new function CBS_offset() to report the current offset in the data.doug4-4/+30
"why not" miod@, sure jsing@
2015-06-17Cleanup SSL_OP_* compat flags in ssl.h.doug2-62/+48
These were recently removed and are now set to 0: SSL_OP_NETSCAPE_CA_DN_BUG SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG SSL_OP_SSLEAY_080_CLIENT_DH_BUG The code associated with these was deleted in the past at some point and these are also now 0: SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION SSL_OP_EPHEMERAL_RSA SSL_OP_MICROSOFT_SESS_ID_BUG SSL_OP_NETSCAPE_CHALLENGE_BUG SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG The SSL_OP_ALL macro has been updated to reflect the removals. ok miod@ jsing@
2015-06-16Be more strict about BER and DER terminology.doug5-71/+84
bs_ber.c does not convert BER to DER. It's a hack to convert a DER-like encoding with one violation (indefinite form) to strict DER. Rename the functions to reflect this. ok miod@ jsing@
2015-06-16Simplify cbs_get_any_asn1_element_internal based on comments from jsing@doug4-34/+26
2015-06-16Add support for OPTION_DISCARD.doug1-1/+4
ok jsing@
2015-06-15Make CBS_get_any_asn1_element() more compliant with DER encoding.doug6-56/+172
CBS_get_any_asn1_element violates DER encoding by allowing indefinite form. All callers except bs_ber.c expect DER encoding. The callers must check to see if it was indefinite or not. Rather than exposing all callers to this behavior, cbs_get_any_asn1_element_internal() allows specifying whether you want to allow the normally forbidden indefinite form. This is used by CBS_get_any_asn1_element() for strict DER encoding and by a new static function in bs_ber.c for the relaxed version. While I was here, I added comments to differentiate between ASN.1 restrictions and CBS limitations. ok miod@
2015-06-15Remove ancient SSL_OP_NETSCAPE_CA_DN_BUG from SSLeay days.doug8-106/+40
This commit matches the OpenSSL removal in commit 3c33c6f6b10864355553961e638514a6d1bb00f6. ok deraadt@
2015-06-15Remove ancient compat hack SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG.doug5-81/+11
This was imported into OpenSSL from SSLeay. It was recently deleted in OpenSSL commit 7a4dadc3a6a487db92619622b820eb4f7be512c9
2015-06-15Remove 1997's compat hack SSL_OP_SSLEAY_080_CLIENT_DH_BUG.doug4-22/+16
This is a hack for an old version of SSLeay which predates OpenSSL.
2015-06-15Update SSL_OP_* to remove ancient hacks that are no longer enabled.doug2-26/+22
2015-06-13Split up the logic in CBB_flush to separately handle the lengths.doug2-42/+64
Also, add comments about assuming short-form. ok miod@, tweak + ok jsing@
2015-06-13Explain the ASN.1 restriction that requires extra logic for encoding.doug2-4/+36
ok miod@ jsing@
2015-06-13When initial capacity is 0, always use NULL buffer.doug2-14/+16
malloc(0) is implementation defined and there's no reason to introduce that ambiguity here. Added a few cosmetic changes in sizeof and free. ok miod@ jsing@
2015-06-13Add comments about how the CBS constants are constructed.doug2-24/+86
Also, introduce a few more #defines to make it obvious. ok miod@ jsing@
2015-06-13Reject long-form tags in CBS_peek_asn1_tag.doug2-2/+16
Currently, CBS only handles short-form tags. ok miod@ jsing@
2015-06-13Fix bad indenting in LibreSSL.doug10-24/+24
jsg@ noticed that some of the lines in libssl and libcrypto are not indented properly. At a quick glance, it looks like it has a different control flow than it really does. I checked the history in our tree and in OpenSSL to make sure these were simple mistakes. ok miod@ jsing@
2015-06-13Remove unneeded sys/sysctl.h on linux.bcook2-4/+2
This only provides the sysctl wrapper in glibc, which we do not use and is not available in other libc implementations for Linux. Thanks to ncopa from github.
2015-06-11Avoid an infinite loop that can occur when verifying a message with anlibressl-v2.2.0jsing2-4/+4
unknown hash function OID. Diff based on OpenSSL. Fixes CVE-2015-1792 (however, this code is not enabled/built in LibreSSL). ok doug@ miod@
2015-06-11Avoid a potential out-of-bounds read in X509_cmp_time(), due to missingjsing2-8/+54
length checks. Diff based on changes in OpenSSL. Fixes CVE-2015-1789. ok doug@
2015-06-11Avoid an infinite loop that can be triggered by parsing an ASN.1jsing2-6/+16
ECParameters structure that has a specially malformed binary polynomial field. Issue reported by Joseph Barr-Pixton and fix based on OpenSSL. Fixes CVE-2015-1788. ok doug@ miod@
2015-06-05Link ssl and crypto via BSDOBJDIR, works with native and cross buildstobiasu1-3/+3
ok mpi@
2015-06-05Fix library search path so we link against the freshly built libcrypto.sotobiasu1-2/+2
instead of a stale one. ok miod@ mpi@
2015-06-04force reseeding if pid has changed.eric1-2/+7
ok deraadt@
2015-05-29Need to operate of CXXFLAGS now.miod1-3/+3
2015-05-26Use a relative path against BSDOBJDIR to pick libcrypto; makes cross-libmiod1-2/+2
work again.
2015-05-26Add OPENSSL_NO_EGD to opensslfeatures.h.bcook2-0/+2
Since RAND_egd has been removed from LibreSSL, simplify porting software that relies on it. See https://github.com/libressl-portable/openbsd/pull/34 from Bernard Spil, ok deraadt@
2015-05-25Make SSL_CIPHER_get_bits() report ChaCha20-Poly1305 ciphers as usingguenther2-8/+8
256bit keys problem noted by Tim Kuijsten (info (at) netsend.nl) ok deraadt@ miod@ bcook@
2015-05-24Maximilian dot Fillinger at uni-duesseldorf dot deschwarze3-74/+109
starts helping with the pod2mdoc(1)-based conversion of LibreSSL crypto manuals from perlpod(1) to mdoc(7). Here comes the first file, slightly tweaked by me.
2015-05-23bump to version 2.2bcook2-4/+4
ok deraadt@
2015-05-20No need to check the return value of memcpy() if you actually checked thismiod2-6/+4
pointer for NULL the line above; ok doug@
2015-05-17Record inter-library dependencies between libcrypto, libssl and libtlskettenis6-2/+11
2015-05-15Make index/rindex weak aliases of strchr/strrchr since they are notmillert4-90/+6
part of the ISO C standard and have also been dropped from POSIX. OK guenther@ kettenis@
2015-05-15Fix return paths with missing EVP_CIPHER_CTX_cleanup() calls.jsg10-30/+32
ok doug@
2015-05-14rev 1.3 introduced a check to an if statement without adding braces.jsg1-3/+1
Claudio points out the size is checked by an earlier test so just remove it to restore the original handling of the partial octet case. Discussed with claudio and gilles.
2015-05-13If crypt(3) is called with an unknown setting, return NULL insteadbluhm1-1/+3
of some undefined value. OK tedu@
2015-05-12Add dlclose(3) to SEE ALSOguenther1-2/+3
ok millert@ jmc@ schwarze@
2015-05-11When checking flags that will be passed to open(), test the O_ACCMODE portionguenther1-2/+3
separately to avoid false negatives. ok miod@ millert@
2015-05-08Make this run on strict alignment architectures.miod1-6/+9
2015-05-04Add SwissSign CA root certificates. Requested by robert@, ok dcoppa@ aja@ miod@sthen1-0/+381
2015-04-30use strdup() to init stringderaadt2-6/+4
ok doug millert