CVS: cvs.openbsd.org: src

2019-11-06 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/11/06 03:28:58

Modified files:
regress/lib/libssl/handshake: Makefile 

Log message:
use curly braces for consistency



CVS: cvs.openbsd.org: src

2019-10-29 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/10/29 20:08:38

Modified files:
lib/libm/src/ld80: k_sincosl.h 

Log message:
Fix declaration of S1 by swapping misplaced ',' and ';'.
This is inside !(defined(__amd64__) || defined(__i386__)),
while the file is only used on those two architectures.

"Free commit! No strings attached! No hidden tricks!" from miod



CVS: cvs.openbsd.org: src

2019-10-27 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/10/27 14:05:13

Modified files:
lib/libutil: Tag: OPENBSD_6_6 Symbols.map ber.c ber.h 
 ber_add_string.3 ber_get_string.3 ber_oid_cmp.3 
 ber_read_elements.3 ber_set_header.3 
regress/lib/libutil/ber: Tag: OPENBSD_6_6 ber_test.c 
 ber_test_int_i.c 
usr.bin/ldap   : Tag: OPENBSD_6_6 aldap.c 
usr.bin/snmp   : Tag: OPENBSD_6_6 smi.c snmp.c snmpc.c usm.c 
usr.sbin/ldapctl: Tag: OPENBSD_6_6 ldapctl.c 
usr.sbin/ldapd : Tag: OPENBSD_6_6 attributes.c auth.c conn.c 
 filter.c index.c ldape.c logmsg.c modify.c 
 schema.c search.c util.c validate.c 
usr.sbin/snmpd : Tag: OPENBSD_6_6 mib.c mps.c parse.y smi.c 
 snmpe.c trap.c traphandler.c usm.c util.c 
usr.sbin/ypldap: Tag: OPENBSD_6_6 aldap.c 

Log message:
The ber_* namespace is used by liblber since time immemorial,
so move our BER API to the unused ober_* prefix to avoid some
breakage in ports.

Problem diagnosed by jmatthew with ber_free() in samba, but
there are many others as pointed out by sthen.

tests & ok rob
ok sthen (who had an almost identical diff for libutil)
"go head hit it" deraadt

OpenBSD 6.6 errata 002



CVS: cvs.openbsd.org: src

2019-10-27 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/10/27 14:01:38

Modified files:
sys/net: Tag: OPENBSD_6_6 bpf.c bpfdesc.h 

Log message:
put bpfdesc reference counting back, revert change introduced in 1.175 as:
BPF: remove redundant reference counting of filedescriptors

Anton@ made problem crystal clear:
I've been looking into a similar bpf panic reported by syzkaller,
which looks somewhat related. The one reported by syzkaller is caused
by issuing ioctl(SIOCIFDESTROY) on the interface which the packet filter
is attached to. This will in turn invoke the following functions
expressed as an inverted stacktrace:
1. bpfsdetach()
2. vdevgone()
3. VOP_REVOKE()
4. vop_generic_revoke()
5. vgonel()
6. vclean(DOCLOSE)
7. VOP_CLOSE()
8. bpfclose()

Note that bpfclose() is called before changing the vnode type. In
bpfclose(), the `struct bpf_d` is immediately removed from the global
bpf_d_list list and might end up sleeping inside taskq_barrier(systq).
Since the bpf file descriptor (fd) is still present and valid, another
thread could perform an ioctl() on the fd only to fault since
bpfilter_lookup() will return NULL. The vnode is not locked in this path
either so it won't end up waiting on the ongoing vclean().

Steps to trigger the similar type of panic are straightforward, let there be
two processes running concurrently:

process A:
while true ; do ifconfig tun0 up ; ifconfig tun0 destroy ; done

process B:
while true ; do tcpdump -i tun0 ; done

panic happens within few secs (Dell PowerEdge 710)

OK @visa, OK @anton

OpenBSD 6.6 errata 001



CVS: cvs.openbsd.org: src

2019-10-24 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/10/24 22:00:10

Modified files:
lib/libutil: ober_get_string.3 

Log message:
Adjust whitespace, so Ta macros are aligned vertically as already done in
ober_add_string.3 and as it was before the ber -> ober rename.



CVS: cvs.openbsd.org: src

2019-10-24 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/10/24 10:03:56

Modified files:
distrib/sets/lists/base: mi 

Log message:
sync



CVS: cvs.openbsd.org: src

2019-10-24 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/10/24 06:39:27

Modified files:
distrib/sets/lists/base: mi 
distrib/sets/lists/comp: mi 
lib/libutil: Makefile Symbols.map ber.c ber.h shlib_version 
regress/lib/libutil/ber: ber_test.c ber_test_int_i.c 
usr.bin/ldap   : aldap.c 
usr.bin/snmp   : smi.c snmp.c snmpc.c usm.c 
usr.sbin/ldapctl: ldapctl.c 
usr.sbin/ldapd : attributes.c auth.c conn.c filter.c index.c 
 ldape.c logmsg.c modify.c schema.c search.c 
 util.c validate.c 
usr.sbin/snmpd : mib.c mps.c parse.y smi.c snmpe.c trap.c 
 traphandler.c usm.c util.c 
usr.sbin/ypldap: aldap.c 
Added files:
lib/libutil: ober_add_string.3 ober_get_string.3 
 ober_oid_cmp.3 ober_read_elements.3 
 ober_set_header.3 
Removed files:
lib/libutil: ber_add_string.3 ber_get_string.3 ber_oid_cmp.3 
 ber_read_elements.3 ber_set_header.3 

Log message:
The ber_* namespace is used by liblber since time immemorial,
so move our BER API to the unused ober_* prefix to avoid some
breakage in ports.

Problem diagnosed by jmatthew with ber_free() in samba, but
there are many others as pointed out by sthen.

tests & ok rob
ok sthen (who had an almost identical diff for libutil)
"go head hit it" deraadt



CVS: cvs.openbsd.org: src

2019-10-19 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/10/19 07:14:23

Modified files:
usr.sbin/syspatch: syspatch.sh 
usr.sbin/sysupgrade: sysupgrade.sh 
distrib/miniroot: install.sub 

Log message:
Determine the OS version in a way that won't break after 9.9.
Do it the same way in all three copies of the code.

Based on a patch from Chris Waddey.
with & ok ajacoutot



CVS: cvs.openbsd.org: www

2019-10-04 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/10/04 12:10:13

Modified files:
.  : 66.html 

Log message:
mention padding oracle fix in PKCS7 and CMS



CVS: cvs.openbsd.org: src

2019-10-04 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/10/04 12:03:56

Modified files:
lib/libcrypto/pkcs7: pk7_doit.c 
lib/libcrypto/cms: cms_env.c cms_lcl.h cms_smime.c 

Log message:
Fix a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey.
(Note that the CMS code is currently disabled.)

Port of Edlinger's Fix for CVE-2019-1563 from OpenSSL 1.1.1 (old license)

tests from bluhm@
ok jsing

commit e21f8cf78a125cd3c8c0d1a1a6c8bb0b901f893f
Author: Bernd Edlinger 
Date:   Sun Sep 1 00:16:28 2019 +0200

Fix a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey

An attack is simple, if the first CMS_recipientInfo is valid but the
second CMS_recipientInfo is chosen ciphertext. If the second
recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct
encryption key will be replaced by garbage, and the message cannot be
decoded, but if the RSA decryption fails, the correct encryption key is
used and the recipient will not notice the attack.

As a work around for this potential attack the length of the decrypted
key must be equal to the cipher default key length, in case the
certifiate is not given and all recipientInfo are tried out.

The old behaviour can be re-enabled in the CMS code by setting the
CMS_DEBUG_DECRYPT flag.

Reviewed-by: Matt Caswell 
(Merged from https://github.com/openssl/openssl/pull/9777)

(cherry picked from commit 5840ed0cd1e6487d247efbc1a04136a41d7b3a37)



CVS: cvs.openbsd.org: www

2019-09-29 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/09/29 04:15:00

Modified files:
.  : 66.html 

Log message:
mention Brumley's cofactor fix



CVS: cvs.openbsd.org: src

2019-09-29 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/09/29 04:09:09

Modified files:
lib/libcrypto/ec: ec.h ec_lib.c ec_err.c 

Log message:
If a NULL or zero cofactor is passed to EC_GROUP_set_generator(),
try to compute it using Hasse's bound.  This works as long as the
cofactor is small enough.

Port of Brumley's fix for CVE-2019-1547 in OpenSSL 1.1.1 (old license)

tests & ok inoguchi
input & ok jsing

commit 30c22fa8b1d840036b8e203585738df62a03cec8
Author: Billy Brumley 
Date:   Thu Sep 5 21:25:37 2019 +0300

[crypto/ec] for ECC parameters with NULL or zero cofactor, compute it

The cofactor argument to EC_GROUP_set_generator is optional, and SCA
mitigations for ECC currently use it. So the library currently falls
back to very old SCA-vulnerable code if the cofactor is not present.

This PR allows EC_GROUP_set_generator to compute the cofactor for all
curves of cryptographic interest. Steering scalar multiplication to more
SCA-robust code.

This issue affects persisted private keys in explicit parameter form,
where the (optional) cofactor field is zero or absent.

It also affects curves not built-in to the library, but constructed
programatically with explicit parameters, then calling
EC_GROUP_set_generator with a nonsensical value (NULL, zero).

The very old scalar multiplication code is known to be vulnerable to
local uarch attacks, outside of the OpenSSL threat model. New results
suggest the code path is also vulnerable to traditional wall clock
timing attacks.

CVE-2019-1547

Reviewed-by: Matt Caswell 
Reviewed-by: Tomas Mraz 
Reviewed-by: Nicola Tuveri 
(Merged from https://github.com/openssl/openssl/pull/9781)



CVS: cvs.openbsd.org: src

2019-09-09 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/09/09 14:26:16

Modified files:
lib/libcrypto/ec: ec_ameth.c 

Log message:
Plug memory leak in error paths. Found while comparing this file
with OpenSSL 1.1.1's version which contains a similar fix.

ok jsing



CVS: cvs.openbsd.org: src

2019-08-14 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/08/14 14:30:19

Modified files:
distrib/syspatch: README 

Log message:
Explain how to take over syspatch builds from another machine.

ok ajacoutot robert



CVS: cvs.openbsd.org: src

2019-08-10 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/08/10 02:14:17

Modified files:
share/man/man7 : hier.7 

Log message:
remove groff leftover. from micah muer



CVS: cvs.openbsd.org: src

2019-08-08 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/08/08 10:52:13

Modified files:
sys/arch/amd64/amd64: Tag: OPENBSD_6_4 codepatch.c cpu.c 
  locore.S vector.S 
sys/arch/amd64/include: Tag: OPENBSD_6_4 codepatch.h frameasm.h 

Log message:
Mitigate CVE-2019-1125: block speculation past conditional jump to mis-skip
or mis-take swapgs in interrupt path and in trap/fault/exception path.  The
latter is improved to have no conditionals around this when Meltdown mitigation
is in effect.  Codepatch out the fences based on the description of CPU bugs
in the (well written) Linux commit message.

feedback from kettenis@
ok deraadt@

OpenBSD 6.4 errata 021



CVS: cvs.openbsd.org: src

2019-08-08 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/08/08 10:50:31

Modified files:
sys/arch/amd64/amd64: Tag: OPENBSD_6_5 codepatch.c cpu.c 
  locore.S vector.S 
sys/arch/amd64/include: Tag: OPENBSD_6_5 codepatch.h frameasm.h 

Log message:
Mitigate CVE-2019-1125: block speculation past conditional jump to mis-skip
or mis-take swapgs in interrupt path and in trap/fault/exception path.  The
latter is improved to have no conditionals around this when Meltdown mitigation
is in effect.  Codepatch out the fences based on the description of CPU bugs
in the (well written) Linux commit message.

feedback from kettenis@
ok deraadt@

OpenBSD 6.5 errata 008



CVS: cvs.openbsd.org: www

2019-07-31 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/07/31 11:16:09

Modified files:
.  : 66.html 

Log message:
credit the work of Samuel Weiser and David Schrammel



CVS: cvs.openbsd.org: src

2019-07-10 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/07/10 01:04:27

Modified files:
usr.bin/ssh: sftp.c 

Log message:
Fix a typo and make  move right to the closest end of a word
just like  moves left to the closest beginning of a word.

ok djm



CVS: cvs.openbsd.org: src

2019-07-08 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/07/08 15:19:54

Modified files:
lib/libc/uuid  : uuid.3 

Log message:
fix typo: RCF -> RFC

>From Evan Silberman



CVS: cvs.openbsd.org: src

2019-07-04 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/07/04 09:25:17

Modified files:
usr.sbin/pkg_add: pkg_info.1 pkg_add.1 

Log message:
PKG_TMPDIR now defaults to /tmp instead of /var/tmp



CVS: cvs.openbsd.org: src

2019-06-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/06/17 11:11:48

Modified files:
lib/libcrypto/bn: bn_lib.c 

Log message:
Make BN_num_bits_word() constant time.

Previously, this function would leak the most significant word of its
argument due to branching and memory access pattern.  This patch is
enough to fix the use of BN_num_bits() on RSA prime factors in the
library.

The diff is a simplified and more readable (but perhaps less efficient)
version of https://github.com/openssl/openssl/commit/972c87df
by Andy Polyakov and David Benjamin (pre license change). Consult that
commit message for details. Subsequent fixes to follow in the near future.

Issue pointed out by David Schrammel and Samuel Weiser as part of
a larger report.

tests & ok inoguchi, ok jsing



CVS: cvs.openbsd.org: src

2019-06-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/06/17 09:20:10

Modified files:
usr.sbin/acme-client: acctproc.c 

Log message:
One NULL-check before EVP_MD_CTX_free() was left in previous.



CVS: cvs.openbsd.org: www

2019-06-13 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/06/13 09:42:34

Modified files:
.  : 66.html 

Log message:
mention RSA_METHOD stuff



CVS: cvs.openbsd.org: src

2019-06-04 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/06/04 22:59:49

Modified files:
lib/libcrypto/man: EVP_SignInit.3 

Log message:
Fix bogus cross reference: EVP_SignDigest* -> EVP_DigestSign*



CVS: cvs.openbsd.org: src

2019-06-04 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/06/04 12:15:27

Modified files:
lib/libcrypto/ecdsa: ecs_ossl.c 

Log message:
Readability tweak in a comment.



CVS: cvs.openbsd.org: src

2019-06-04 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/06/04 12:13:44

Modified files:
lib/libcrypto/ecdsa: ecs_ossl.c 

Log message:
Remove the blinding later to avoid leaking information on the length
of ckinv.

Pointed out and fix suggested by David Schrammel and Samuel Weiser

ok jsing



CVS: cvs.openbsd.org: src

2019-06-04 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/06/04 12:12:26

Modified files:
lib/libcrypto/dsa: dsa_ossl.c 

Log message:
Readability tweaks for comments that explain the blinding.



CVS: cvs.openbsd.org: src

2019-06-04 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/06/04 12:10:11

Modified files:
lib/libcrypto/dsa: dsa_ossl.c 

Log message:
Remove the blinding later to avoid leaking information on the length
of kinv.

Pointed out and fix suggested by David Schrammel and Samuel Weiser

ok jsing



CVS: cvs.openbsd.org: www

2019-05-18 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/05/18 14:12:31

Modified files:
.  : events.html 
Added files:
papers : bsdcan2019-tls13.pdf 

Log message:
add my slides on the tls 1.3 state machine



CVS: cvs.openbsd.org: www

2019-05-16 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/05/16 11:12:03

Modified files:
.  : errata64.html 

Log message:
Only 6.5 is affected by the srtp issue.



CVS: cvs.openbsd.org: src

2019-05-15 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/15 13:25:15

Modified files:
lib/libssl : Tag: OPENBSD_6_5 ssl_tlsext.c 

Log message:
In DTLS, use_srtp is part of the extended server hello while in TLSv1.3,
it is an encrypted extension.  Include it in the server hello for now.
This will have to be revisited once TLSv1.3 gets there. Fixes SRTP
negotiation.

Problem found by two rust-openssl regress failures reported by mikeb.

with & ok beck

OpenBSD 6.5 errata 002



CVS: cvs.openbsd.org: src

2019-05-13 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/13 16:25:27

Modified files:
lib/libc   : shlib_version 

Log message:
Add missing word in comment.



CVS: cvs.openbsd.org: src

2019-05-13 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/13 10:04:49

Modified files:
usr.bin/ftp: ftp.c 

Log message:
ephermal -> ephemeral

>From Hiltjo Posthuma



CVS: cvs.openbsd.org: src

2019-05-12 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/12 16:48:03

Modified files:
usr.bin/ftp: http.c 

Log message:
Fix double free by nulling out pointers after free.

from florian, ok jca



CVS: cvs.openbsd.org: src

2019-05-12 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/12 09:56:31

Modified files:
lib/libcrypto/asn1: t_crl.c 

Log message:
Fix signed overflow in X509_CRL_print().

fixes oss-fuzz #14558

ok beck jsing



CVS: cvs.openbsd.org: src

2019-05-12 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/12 09:52:46

Modified files:
lib/libcrypto/evp: e_aes.c 

Log message:
Revert the other hunk of r1.36 as well: in the case of CCM, ccm.key is
assigned from aesni_ccm_init_key() via CRYPTO_ccm128_init(), so it needs
to be copied over...

Pointed out by Guido Vranken.

ok jsing



CVS: cvs.openbsd.org: src

2019-05-11 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/11 09:55:52

Modified files:
lib/libcrypto/curve25519: curve25519-generic.c curve25519.c 
  curve25519.h curve25519_internal.h 

Log message:
$OpenBSD$



CVS: cvs.openbsd.org: src

2019-05-11 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/11 07:05:25

Modified files:
lib/libcrypto/arch/alpha: Makefile.inc 
lib/libcrypto/arch/arm: Makefile.inc 
lib/libcrypto/arch/hppa: Makefile.inc 
lib/libcrypto/arch/mips64: Makefile.inc 
lib/libcrypto/arch/powerpc: Makefile.inc 
lib/libcrypto/arch/sparc: Makefile.inc 
lib/libcrypto/arch/sparc64: Makefile.inc 

Log message:
Remove commented out rc5 bits



CVS: cvs.openbsd.org: src

2019-05-10 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/10 12:41:17

Modified files:
lib/libcrypto/evp: e_aes.c 

Log message:
Revert part of r1.36: in the case of GCM, gcm.key is assigned from
aesni_gcm_init_key() via CRYPTO_gcm128_init(), so it needs to be
copied over...

Fixes cryptofuzz issue #14352 and likely also #14374.

ok beck jsing



CVS: cvs.openbsd.org: src

2019-05-10 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/10 09:43:20

Modified files:
distrib/sets/lists/base: mi 

Log message:
sync



CVS: cvs.openbsd.org: www

2019-05-09 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/05/09 17:09:15

Modified files:
.  : 66.html 

Log message:
incorrect carry operation for streebog



CVS: cvs.openbsd.org: src

2019-05-09 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/09 17:01:09

Modified files:
regress/lib/libcrypto/evp: evptests.txt 

Log message:
Add a test vector for Streebog 512 from Guido Vranken



CVS: cvs.openbsd.org: src

2019-05-09 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/09 16:54:28

Modified files:
lib/libcrypto/gost: streebog.c 

Log message:
Fix incorrect carry operation in 512 bit addition: in the case
that there is already a carry and Sigma[i-1] == -1, the carry
must be kept.

>From Dmitry Eremin-Solenik.

Fixes incorrect Streebog result reported by Guido Vranken.



CVS: cvs.openbsd.org: www

2019-05-08 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/05/08 18:13:36

Modified files:
.  : 66.html 

Log message:
obligatory bikeshedding now that i can't do that anymore
when the release notes are prepared



CVS: cvs.openbsd.org: src

2019-05-08 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/08 17:49:45

Modified files:
lib/libssl : ssl_tlsext.c 

Log message:
In DTLS, use_srtp is part of the extended server hello while in TLSv1.3,
it is an encrypted extension.  Include it in the server hello for now.
This will have to be revisited once TLSv1.3 gets there. Fixes SRTP
negotiation.

Problem found by two rust-openssl regress failures reported by mikeb.

with & ok beck



Re: CVS: cvs.openbsd.org: src

2019-05-08 Thread Theo Buehler
On Wed, May 08, 2019 at 03:46:56PM -0600, Theo Buehler wrote:
> CVSROOT:  /cvs
> Module name:  src
> Changes by:   t...@cvs.openbsd.org2019/05/08 15:46:56
> 
> Modified files:
>   usr.sbin/httpd : httpd.conf.5 server_http.c 
> 
> Log message:
> The QUERY_STRING macro is not actually URL encoded, so fix the manual.
> Add a QUERY_STRING_ENC macro that is URL encoded.
> 
> Patch from Tim Baumgartner

Sorry, this should have been Tim Baumgard.

> 
> ok reyk
> 



CVS: cvs.openbsd.org: src

2019-05-08 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/08 15:46:56

Modified files:
usr.sbin/httpd : httpd.conf.5 server_http.c 

Log message:
The QUERY_STRING macro is not actually URL encoded, so fix the manual.
Add a QUERY_STRING_ENC macro that is URL encoded.

Patch from Tim Baumgartner

ok reyk



CVS: cvs.openbsd.org: src

2019-05-08 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/08 15:41:06

Modified files:
usr.sbin/httpd : http.h server_fcgi.c server_http.c 

Log message:
Set the REQUEST_URI CGI variable to the requested URI and query string
instead of the rewritten path and query string.

Patch from Tim Baumgard, reminded by Mischa Peters.

ok benno, reyk



CVS: cvs.openbsd.org: src

2019-05-08 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/08 08:18:25

Modified files:
lib/libcrypto/modes: ccm128.c 

Log message:
Make sure that the tag buffer size is equal to the tag size
in CRYPTO_ccm128_tag(). Otherwise the caller might end up
using the part of the tag buffer that was left uninitialized.

Issue found by Guido Vranken.

ok inoguchi



CVS: cvs.openbsd.org: src

2019-05-03 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/05/03 11:16:27

Modified files:
usr.sbin/httpd : httpd.conf.5 httpd.h parse.y server_http.c 

Log message:
Add a "forwarded" log format that extends the "combined" log format
by including the contents of the X-Forwarded-For and X-Forwarded-Port
headers.  If httpd(8) runs behind a proxy like relayd(8), this allows
tracking the origin of the requests.  The format is compatible with
log analyzers such as GoAccess and Webalizer.

Patch from Bruno Flueckiger

ok benno, reyk



CVS: cvs.openbsd.org: src

2019-04-27 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/27 23:05:56

Modified files:
lib/libcrypto/asn1: a_enum.c 

Log message:
Avoid an undefined shift in ASN1_ENUMERATED_get().
(same fix as in a_int.c rev 1.34)

Fixes oss-fuzz issue #13809

ok beck, jsing



CVS: cvs.openbsd.org: src

2019-04-27 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/27 23:03:56

Modified files:
lib/libcrypto/asn1: a_int.c 

Log message:
Avoid an undefined shift in ASN1_INTEGER_get().

Fixes oss-fuzz issue #13804

ok beck, jsing



CVS: cvs.openbsd.org: www

2019-04-27 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/04/27 12:42:41

Modified files:
faq: upgrade65.html 

Log message:
keep packages sorted



CVS: cvs.openbsd.org: src

2019-04-22 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/22 11:32:09

Modified files:
lib/libcrypto/x509v3: v3_pmaps.c 

Log message:
Add error checking to i2v_POLICY_MAPPINGS().

ok jsing



CVS: cvs.openbsd.org: src

2019-04-22 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/22 11:29:13

Modified files:
lib/libcrypto/x509v3: v3_pcons.c 

Log message:
Add error checking to i2v_POLICY_CONSTRAINTS().

ok jsing



CVS: cvs.openbsd.org: src

2019-04-22 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/22 11:26:34

Modified files:
lib/libcrypto/x509v3: v3_extku.c 

Log message:
Add error checking to i2v_EXTENDED_KEY_USAGE().

ok jsing



CVS: cvs.openbsd.org: src

2019-04-22 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/22 11:23:55

Modified files:
lib/libcrypto/x509v3: v3_bitst.c 

Log message:
Add error checking to i2v_ASN1_BIT_STRING().

ok jsing



CVS: cvs.openbsd.org: src

2019-04-22 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/22 11:21:01

Modified files:
lib/libcrypto/x509v3: v3_bcons.c 

Log message:
Add error checking to i2v_BASIC_CONSTRAINTS().

ok jsing



CVS: cvs.openbsd.org: src

2019-04-22 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/22 11:18:30

Modified files:
lib/libcrypto/x509v3: v3_info.c 

Log message:
Add error checking to i2v_AUTHORITY_INFO_ACCESS().  While there, replace
an ugly strlen + malloc + strcat/strcpy dance by a simple asprintf().

ok jsing



CVS: cvs.openbsd.org: src

2019-04-22 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/22 11:10:01

Modified files:
lib/libcrypto/x509v3: v3_akey.c v3_alt.c 

Log message:
Avoid potential double frees in i2v_AUTHORITY_KEYID(), i2v_GENERAL_NAME()
and i2v_GENERAL_NAMES() by taking ownership of the extlist only if we
were passed NULL.  Otherwise it remains the caller's responsibility to
free it.  To do so, we allocate the extlist explicitly instead of using
X509V3_add_value()'s implicit allocation feature.  Preserve behavior in
i2v_AUTHORITY_KEYID() by adding an explicit check that something was
pushed onto the stack.

The other i2v_* functions will receive a similar treatment in upcoming
commits.

ok jsing



CVS: cvs.openbsd.org: src

2019-04-21 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/21 10:50:34

Modified files:
lib/libcrypto/x509v3: v3_akey.c v3_alt.c 

Log message:
Add error checking to i2v_AUTHORITY_KEYID(), i2v_GENERAL_NAME()
and i2v_GENERAL_NAMES().  This fixes a couple of leaks and other
ugliness.

tweaks & ok jsing



CVS: cvs.openbsd.org: src

2019-04-21 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/21 10:38:01

Modified files:
lib/libcrypto/x509v3: v3_pku.c 

Log message:
The noop v2i_PKEY_USAGE_PERIOD() has been commented out since beck
imported OpenSSL 0.9.4 in 1999.  It won't ever be used.



CVS: cvs.openbsd.org: src

2019-04-21 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/21 10:29:57

Modified files:
lib/libcrypto/x509v3: v3_lib.c 

Log message:
Fix awful whitespace in OBJ_bsearch_ext()



CVS: cvs.openbsd.org: src

2019-04-21 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/21 10:25:40

Modified files:
lib/libcrypto/x509v3: pcy_node.c v3_cpols.c v3_crld.c 

Log message:
KNF: use proper wrapping of function return type and name



CVS: cvs.openbsd.org: src

2019-04-21 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/21 02:07:48

Modified files:
lib/libcrypto/x509v3: v3_akey.c 

Log message:
fix some style nits to reduce noise in an upcoming diff



CVS: cvs.openbsd.org: www

2019-04-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/04/17 00:51:25

Modified files:
faq: current.html 

Log message:
roll current.html



CVS: cvs.openbsd.org: www

2019-04-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/04/17 00:48:23

Modified files:
faq: upgrade65.html 

Log message:
fix some validator nits



CVS: cvs.openbsd.org: www

2019-04-16 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/04/16 14:03:08

Modified files:
faq: upgrade64.html 

Log message:
add link to upgrade65.html



CVS: cvs.openbsd.org: www

2019-04-16 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/04/16 14:02:26

Added files:
faq: upgrade65.html 

Log message:
add upgrade notes for 6.4 -> 6.5



CVS: cvs.openbsd.org: src

2019-04-16 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/16 13:42:20

Modified files:
lib/libcrypto/x509v3: v3_utl.c 

Log message:
Rewrite & fix X509V3_add_value()

X509V3_add_value() helpfully allocates a STACK_OF(CONF_VALUE) if it
receives a pointer to a NULL pointer.  If anything fails along the way,
it is however the caller's responsibility to free it.  This can easily
be fixed by freeing *extlist in the error path and zeroing it to avoid
a double free if there happens to be a caller out there that avoids
the leak.

Polish a few things so the function conforms a bit better to our usual
style.

tweak & ok jsing



CVS: cvs.openbsd.org: src

2019-04-16 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/16 13:34:15

Modified files:
lib/libcrypto/x509v3: v3_utl.c 

Log message:
indent err: labels



CVS: cvs.openbsd.org: src

2019-04-16 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/16 13:31:07

Modified files:
lib/libcrypto/x509v3: v3_utl.c 

Log message:
wrap an overlong line and kill a space before a tab



CVS: cvs.openbsd.org: src

2019-04-16 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/16 13:25:36

Modified files:
lib/libcrypto/x509v3: v3_utl.c 

Log message:
Move function types to their own lines; rewrap.



CVS: cvs.openbsd.org: src

2019-04-14 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/14 01:35:18

Modified files:
lib/libcrypto/x509v3: v3_utl.c 

Log message:
Fix previous: I forgot to rename the bn_to_string() prototype.



CVS: cvs.openbsd.org: src

2019-04-13 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/13 16:06:31

Modified files:
regress/lib/libcrypto/bn/general: Makefile 
Added files:
regress/lib/libcrypto/bn/general: bn_to_string.c 

Log message:
Add a test for the bn_to_string() function introduced in v3_utl.c r1.32.



CVS: cvs.openbsd.org: src

2019-04-13 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/13 12:47:58

Modified files:
lib/libtls : tls_util.c 

Log message:
Null out pointers on asprintf() failure.

These pointers will be passed to free. According to asprintf(3), "on
OpenBSD, ret will be set to the null pointer, but this behavior should
not be relied upon."

ok jsing



CVS: cvs.openbsd.org: src

2019-04-13 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/13 12:42:23

Modified files:
lib/libcrypto/x509v3: v3_utl.c 

Log message:
Avoid quadratic behavior of decimal BIGNUM conversion

The complexity of BN_bn2dec(bn) is quadratic in the length of bn.  This
function is used for printing numbers in CRLs which are typically small.
If a BN is larger than 127 bits, dump it as hex because that's cheap and
for numbers this size not significantly harder for humans to parse.

OpenSSL commit 10a3195fcf7d04ba519651cf12e945a8fe470a3c by David Benjamin
(still under the old licence), but significantly simplified.

Ideally, we would catch excessively large numbers on deserialization, but
that is made trickier by the templated ASN1.  Erroring out is also not an
option since the relevant part of the x509v3/ directory doesn't like to
do proper error checking (looking at you v2i and i2v).

Timeout found by oss-fuzz, should fix issues #13823 and #14130.

input & ok jsing



CVS: cvs.openbsd.org: src

2019-04-13 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/13 12:04:05

Modified files:
lib/libssl : ssl_cert.c 

Log message:
Avoid leak in SSL_dup_CA_list()

In the case that X509_NAME_dup() succeeds, but sk_X509_NAME_push()
fails, name is leaked.  The entire function is trying to be clever
and therefore hard to follow.  Let's do it the stupid but safe way.

ok jsing



CVS: cvs.openbsd.org: src

2019-04-07 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/07 10:41:16

Modified files:
regress/lib/libssl/ssl: ssltest.c 

Log message:
exitting -> exiting

>From Michael Scovetta, PR #108



CVS: cvs.openbsd.org: src

2019-04-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/05 14:27:46

Modified files:
distrib/sets/lists/comp: mi 

Log message:
sync



CVS: cvs.openbsd.org: src

2019-04-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/05 14:25:42

Modified files:
regress/lib/libssl/handshake: valid_handshakes_terminate.c 

Log message:
whitespace consistency



CVS: cvs.openbsd.org: src

2019-04-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/05 14:25:25

Modified files:
regress/lib/libssl/handshake: handshake_table.c 

Log message:
Add SERVER_HELLO_RETRY state



CVS: cvs.openbsd.org: src

2019-04-05 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/05 14:23:38

Modified files:
lib/libssl : tls13_client.c tls13_handshake.c 
 tls13_handshake.h tls13_internal.h 

Log message:
By design, our state machine is a DAG contrary to the state machine in
the spec. To avoid the obvious loop in the RFC's state machine, we added
a CLIENT_HELLO_RETRY state which is a second ClientHello with special
rules.  There is, however, no state to react to this second client hello.
This adds a matching SERVER_HELLO_RETRY state to the handshakes table.

This means in particular that the WITH_HRR state cannot be set in
tls13_server_hello_recv(), so remove this now dead check.

ok jsing



CVS: cvs.openbsd.org: src

2019-04-04 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/04 23:13:12

Modified files:
lib/libssl : tls13_handshake.c 

Log message:
Zap two dead #defines that were unused since jsing deleted the
record_type member of the tls13_handshake_action struct.

ok jsing



CVS: cvs.openbsd.org: src

2019-04-04 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/04 15:29:27

Modified files:
regress/lib/libssl/handshake: Makefile 

Log message:
I forgot to mark some targets as .PHONY



CVS: cvs.openbsd.org: src

2019-04-03 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/04/03 09:33:37

Modified files:
lib/libcrypto/evp: e_aes_cbc_hmac_sha1.c 

Log message:
Avoid some out of bound accesses in aesni_cbc_hmac_sha1_cipher().
The plen variable can be NO_PAYLOAD_LENGTH == (size_t)-1, so doing
tls_aad[plen-4] is no good. Also check that the length of the AAD
set via the control interface is equal to 13 since the whole file
is written with that case in mind.

Note that we no longer use this code in LibreSSL/OpenBSD. We
eliminated the use of these control interfaces and stitched cipher
modes in libssl a while ago.

Problem found by Guido Vranken with his cryptofuzz - thanks!

input & ok beck, jsing



CVS: cvs.openbsd.org: src

2019-03-31 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/31 13:29:27

Modified files:
sys/net: art.c 

Log message:
Unbreak tree by removing the bits that were copied to art.h in r1.18
from here.

reported by anton and otto



CVS: cvs.openbsd.org: src

2019-03-29 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/29 14:21:54

Modified files:
lib/libcrypto/man: EC_GROUP_new.3 

Log message:
Use correct capitalization of EC_GROUP_get_curve_GF{2m,p}(3).



CVS: cvs.openbsd.org: src

2019-03-20 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/20 21:16:13

Modified files:
lib/libcrypto/man: EVP_EncryptInit.3 

Log message:
Bring back EVP_chacha20 list item that was accidentally removed
in r1.28 when the AES ciphers were split into their own manual.



CVS: cvs.openbsd.org: src

2019-03-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/17 23:34:29

Modified files:
lib/libcrypto/evp: evp_err.c 

Log message:
Expand the ERR_PACK() macro to ERR_REASON() for consistency.
No binary change.



CVS: cvs.openbsd.org: www

2019-03-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:www
Changes by: t...@cvs.openbsd.org2019/03/17 15:37:37

Modified files:
.  : 65.html 

Log message:
Mention SM4 and AES key wrap via EVP.



CVS: cvs.openbsd.org: src

2019-03-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/17 12:33:01

Modified files:
regress/lib/libcrypto/evp: evptest.c evptests.txt 

Log message:
Add regress tests for the EVP_aes_*_wrap() API.  Based on the tests in
OpenSSL 1.0.2r which is still freely licenced with a tweak by jsing.



CVS: cvs.openbsd.org: src

2019-03-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/17 12:21:25

Modified files:
distrib/sets/lists/base: mi 

Log message:
sync



CVS: cvs.openbsd.org: src

2019-03-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/17 12:19:34

Modified files:
lib/libcrypto  : shlib_version 
lib/libssl : shlib_version 
lib/libtls : shlib_version 

Log message:
bump minors after symbol addition



CVS: cvs.openbsd.org: src

2019-03-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/17 12:17:45

Modified files:
lib/libcrypto  : Symbols.list 
lib/libcrypto/evp: evp.h evp_err.c p_lib.c 

Log message:
Provide EVP_PKEY_get0_hmac(). From OpenSSL 1.1.1 which is still
freely licensed.

>From jsing



CVS: cvs.openbsd.org: src

2019-03-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/17 12:07:41

Modified files:
lib/libcrypto  : Symbols.list 
lib/libcrypto/evp: c_all.c e_aes.c evp.h evp_enc.c evp_err.c 

Log message:
Provide EVP_aes_{128,192,256}_wrap(). This is a compatible
implementation based on the one in OpenSSL 1.0.2r which is
still freely licensed.

The functions are undocumented in OpenSSL. To use them, one
needs to set the undocumented EVP_CIPHER_CTX_FLAG_WRAP_ALLOW
flag on the EVP_CIPHER_CTX.

resolves #505

ok jsing



CVS: cvs.openbsd.org: src

2019-03-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/17 11:51:05

Modified files:
distrib/sets/lists/comp: mi 

Log message:
sync



CVS: cvs.openbsd.org: src

2019-03-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/17 11:49:12

Modified files:
regress/lib/libcrypto: Makefile 

Log message:
link sm4 regress to the build



CVS: cvs.openbsd.org: src

2019-03-17 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2019/03/17 11:48:31

Added files:
regress/lib/libcrypto/sm4: Makefile sm4test.c 

Log message:
Add a regress test for the SM4 block cipher from the Chinese standard
GB/T 32907-2016.

Patch from Daniel Wyatt
ok inoguchi, jsing



  1   2   3   4   5   6   7   8   9   10   >