diff options
author | djm@openbsd.org <djm@openbsd.org> | 2016-07-08 05:44:42 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2016-07-08 05:50:03 +0200 |
commit | 6d31193d0baa3da339c196ac49625b7ba1c2ecc7 (patch) | |
tree | 83c1b9c11099ff8577178f702f2cb34765229d9b /mac.h | |
parent | upstream commit (diff) | |
download | openssh-6d31193d0baa3da339c196ac49625b7ba1c2ecc7.tar.xz openssh-6d31193d0baa3da339c196ac49625b7ba1c2ecc7.zip |
upstream commit
Improve crypto ordering for Encrypt-then-MAC (EtM) mode
MAC algorithms.
Previously we were computing the MAC, decrypting the packet and then
checking the MAC. This gave rise to the possibility of creating a
side-channel oracle in the decryption step, though no such oracle has
been identified.
This adds a mac_check() function that computes and checks the MAC in
one pass, and uses it to advance MAC checking for EtM algorithms to
before payload decryption.
Reported by Jean Paul Degabriele, Kenny Paterson, Torben Hansen and
Martin Albrecht. feedback and ok markus@
Upstream-ID: 1999bb67cab47dda5b10b80d8155fe83d4a1867b
Diffstat (limited to 'mac.h')
-rw-r--r-- | mac.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: mac.h,v 1.9 2015/01/13 19:31:40 markus Exp $ */ +/* $OpenBSD: mac.h,v 1.10 2016/07/08 03:44:42 djm Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * @@ -46,6 +46,8 @@ int mac_setup(struct sshmac *, char *); int mac_init(struct sshmac *); int mac_compute(struct sshmac *, u_int32_t, const u_char *, int, u_char *, size_t); +int mac_check(struct sshmac *, u_int32_t, const u_char *, size_t, + const u_char *, size_t); void mac_clear(struct sshmac *); #endif /* SSHMAC_H */ |