summaryrefslogtreecommitdiff
path: root/mac.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2016-07-08 03:44:42 +0000
committerDamien Miller <djm@mindrot.org>2016-07-08 13:50:03 +1000
commit6d31193d0baa3da339c196ac49625b7ba1c2ecc7 (patch)
tree83c1b9c11099ff8577178f702f2cb34765229d9b /mac.h
parent71f5598f06941f645a451948c4a5125c83828e1c (diff)
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.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/mac.h b/mac.h
index e5f6b84d9..0b119d7a1 100644
--- a/mac.h
+++ b/mac.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: mac.h,v 1.9 2015/01/13 19:31:40 markus Exp $ */ 1/* $OpenBSD: mac.h,v 1.10 2016/07/08 03:44:42 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -46,6 +46,8 @@ int mac_setup(struct sshmac *, char *);
46int mac_init(struct sshmac *); 46int mac_init(struct sshmac *);
47int mac_compute(struct sshmac *, u_int32_t, const u_char *, int, 47int mac_compute(struct sshmac *, u_int32_t, const u_char *, int,
48 u_char *, size_t); 48 u_char *, size_t);
49int mac_check(struct sshmac *, u_int32_t, const u_char *, size_t,
50 const u_char *, size_t);
49void mac_clear(struct sshmac *); 51void mac_clear(struct sshmac *);
50 52
51#endif /* SSHMAC_H */ 53#endif /* SSHMAC_H */