1 | /* |
1 | /* |
2 | connection.h -- header for connection.C |
2 | connection.h -- header for connection.C |
3 | Copyright (C) 2003-2008,2013 Marc Lehmann <gvpe@schmorp.de> |
3 | Copyright (C) 2003-2008,2013,2016 Marc Lehmann <gvpe@schmorp.de> |
4 | |
4 | |
5 | This file is part of GVPE. |
5 | This file is part of GVPE. |
6 | |
6 | |
7 | GVPE is free software; you can redistribute it and/or modify it |
7 | GVPE is free software; you can redistribute it and/or modify it |
8 | under the terms of the GNU General Public License as published by the |
8 | under the terms of the GNU General Public License as published by the |
… | |
… | |
94 | |
94 | |
95 | struct hmac_packet : net_packet |
95 | struct hmac_packet : net_packet |
96 | { |
96 | { |
97 | u8 hmac[HMACLENGTH]; // each and every packet has a hmac field, but that is not (yet) checked everywhere |
97 | u8 hmac[HMACLENGTH]; // each and every packet has a hmac field, but that is not (yet) checked everywhere |
98 | |
98 | |
99 | void hmac_set (crypto_ctx * ctx); |
99 | void hmac_set (crypto_ctx *ctx); |
100 | bool hmac_chk (crypto_ctx * ctx); |
100 | bool hmac_chk (crypto_ctx *ctx); |
101 | |
101 | |
102 | private: |
102 | private: |
103 | void hmac_gen (crypto_ctx * ctx, u8 *hmac_digest); |
103 | void hmac_gen (crypto_ctx *ctx, u8 *hmac_digest); |
104 | }; |
104 | }; |
105 | |
105 | |
106 | struct vpn_packet : hmac_packet |
106 | struct vpn_packet : hmac_packet |
107 | { |
107 | { |
108 | enum ptype |
108 | enum ptype |