diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | mac.c | 15 | ||||
-rw-r--r-- | myproposal.h | 3 | ||||
-rw-r--r-- | ssh.1 | 6 | ||||
-rw-r--r-- | ssh_config.5 | 6 | ||||
-rw-r--r-- | sshd.8 | 6 | ||||
-rw-r--r-- | sshd_config.5 | 6 | ||||
-rw-r--r-- | umac.h | 8 |
8 files changed, 38 insertions, 15 deletions
@@ -28,6 +28,9 @@ | |||
28 | - djm@cvs.openbsd.org 2012/10/02 07:07:45 | 28 | - djm@cvs.openbsd.org 2012/10/02 07:07:45 |
29 | [ssh-keygen.c] | 29 | [ssh-keygen.c] |
30 | fix -z option, broken in revision 1.215 | 30 | fix -z option, broken in revision 1.215 |
31 | - markus@cvs.openbsd.org 2012/10/04 13:21:50 | ||
32 | [myproposal.h ssh_config.5 umac.h sshd_config.5 ssh.1 sshd.8 mac.c] | ||
33 | add umac128 variant; ok djm@ at n2k12 | ||
31 | 34 | ||
32 | 20120917 | 35 | 20120917 |
33 | - (dtucker) OpenBSD CVS Sync | 36 | - (dtucker) OpenBSD CVS Sync |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: mac.c,v 1.18 2012/06/28 05:07:45 dtucker Exp $ */ | 1 | /* $OpenBSD: mac.c,v 1.19 2012/10/04 13:21:50 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2001 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -48,6 +48,7 @@ | |||
48 | 48 | ||
49 | #define SSH_EVP 1 /* OpenSSL EVP-based MAC */ | 49 | #define SSH_EVP 1 /* OpenSSL EVP-based MAC */ |
50 | #define SSH_UMAC 2 /* UMAC (not integrated with OpenSSL) */ | 50 | #define SSH_UMAC 2 /* UMAC (not integrated with OpenSSL) */ |
51 | #define SSH_UMAC128 3 | ||
51 | 52 | ||
52 | struct { | 53 | struct { |
53 | char *name; | 54 | char *name; |
@@ -68,6 +69,7 @@ struct { | |||
68 | { "hmac-ripemd160", SSH_EVP, EVP_ripemd160, 0, -1, -1 }, | 69 | { "hmac-ripemd160", SSH_EVP, EVP_ripemd160, 0, -1, -1 }, |
69 | { "hmac-ripemd160@openssh.com", SSH_EVP, EVP_ripemd160, 0, -1, -1 }, | 70 | { "hmac-ripemd160@openssh.com", SSH_EVP, EVP_ripemd160, 0, -1, -1 }, |
70 | { "umac-64@openssh.com", SSH_UMAC, NULL, 0, 128, 64 }, | 71 | { "umac-64@openssh.com", SSH_UMAC, NULL, 0, 128, 64 }, |
72 | { "umac-128@openssh.com", SSH_UMAC128, NULL, 0, 128, 128 }, | ||
71 | { NULL, 0, NULL, 0, -1, -1 } | 73 | { NULL, 0, NULL, 0, -1, -1 } |
72 | }; | 74 | }; |
73 | 75 | ||
@@ -122,6 +124,9 @@ mac_init(Mac *mac) | |||
122 | case SSH_UMAC: | 124 | case SSH_UMAC: |
123 | mac->umac_ctx = umac_new(mac->key); | 125 | mac->umac_ctx = umac_new(mac->key); |
124 | return 0; | 126 | return 0; |
127 | case SSH_UMAC128: | ||
128 | mac->umac_ctx = umac128_new(mac->key); | ||
129 | return 0; | ||
125 | default: | 130 | default: |
126 | return -1; | 131 | return -1; |
127 | } | 132 | } |
@@ -151,6 +156,11 @@ mac_compute(Mac *mac, u_int32_t seqno, u_char *data, int datalen) | |||
151 | umac_update(mac->umac_ctx, data, datalen); | 156 | umac_update(mac->umac_ctx, data, datalen); |
152 | umac_final(mac->umac_ctx, m, nonce); | 157 | umac_final(mac->umac_ctx, m, nonce); |
153 | break; | 158 | break; |
159 | case SSH_UMAC128: | ||
160 | put_u64(nonce, seqno); | ||
161 | umac128_update(mac->umac_ctx, data, datalen); | ||
162 | umac128_final(mac->umac_ctx, m, nonce); | ||
163 | break; | ||
154 | default: | 164 | default: |
155 | fatal("mac_compute: unknown MAC type"); | 165 | fatal("mac_compute: unknown MAC type"); |
156 | } | 166 | } |
@@ -163,6 +173,9 @@ mac_clear(Mac *mac) | |||
163 | if (mac->type == SSH_UMAC) { | 173 | if (mac->type == SSH_UMAC) { |
164 | if (mac->umac_ctx != NULL) | 174 | if (mac->umac_ctx != NULL) |
165 | umac_delete(mac->umac_ctx); | 175 | umac_delete(mac->umac_ctx); |
176 | } else if (mac->type == SSH_UMAC128) { | ||
177 | if (mac->umac_ctx != NULL) | ||
178 | umac128_delete(mac->umac_ctx); | ||
166 | } else if (mac->evp_md != NULL) | 179 | } else if (mac->evp_md != NULL) |
167 | HMAC_cleanup(&mac->evp_ctx); | 180 | HMAC_cleanup(&mac->evp_ctx); |
168 | mac->evp_md = NULL; | 181 | mac->evp_md = NULL; |
diff --git a/myproposal.h b/myproposal.h index b9b819c0a..996c40765 100644 --- a/myproposal.h +++ b/myproposal.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: myproposal.h,v 1.29 2012/06/28 05:07:45 dtucker Exp $ */ | 1 | /* $OpenBSD: myproposal.h,v 1.30 2012/10/04 13:21:50 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
@@ -86,6 +86,7 @@ | |||
86 | "hmac-md5," \ | 86 | "hmac-md5," \ |
87 | "hmac-sha1," \ | 87 | "hmac-sha1," \ |
88 | "umac-64@openssh.com," \ | 88 | "umac-64@openssh.com," \ |
89 | + "umac-128@openssh.com," \ | ||
89 | SHA2_HMAC_MODES \ | 90 | SHA2_HMAC_MODES \ |
90 | "hmac-ripemd160," \ | 91 | "hmac-ripemd160," \ |
91 | "hmac-ripemd160@openssh.com," \ | 92 | "hmac-ripemd160@openssh.com," \ |
@@ -33,8 +33,8 @@ | |||
33 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 33 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
34 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 34 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: ssh.1,v 1.329 2012/09/26 16:12:13 jmc Exp $ | 36 | .\" $OpenBSD: ssh.1,v 1.330 2012/10/04 13:21:50 markus Exp $ |
37 | .Dd $Mdocdate: September 26 2012 $ | 37 | .Dd $Mdocdate: October 4 2012 $ |
38 | .Dt SSH 1 | 38 | .Dt SSH 1 |
39 | .Os | 39 | .Os |
40 | .Sh NAME | 40 | .Sh NAME |
@@ -674,7 +674,7 @@ it provides additional mechanisms for confidentiality | |||
674 | (the traffic is encrypted using AES, 3DES, Blowfish, CAST128, or Arcfour) | 674 | (the traffic is encrypted using AES, 3DES, Blowfish, CAST128, or Arcfour) |
675 | and integrity (hmac-md5, hmac-sha1, | 675 | and integrity (hmac-md5, hmac-sha1, |
676 | hmac-sha2-256, hmac-sha2-512, | 676 | hmac-sha2-256, hmac-sha2-512, |
677 | umac-64, hmac-ripemd160). | 677 | umac-64, umac-128, hmac-ripemd160). |
678 | Protocol 1 lacks a strong mechanism for ensuring the | 678 | Protocol 1 lacks a strong mechanism for ensuring the |
679 | integrity of the connection. | 679 | integrity of the connection. |
680 | .Pp | 680 | .Pp |
diff --git a/ssh_config.5 b/ssh_config.5 index 36b1af195..d3e801df0 100644 --- a/ssh_config.5 +++ b/ssh_config.5 | |||
@@ -33,8 +33,8 @@ | |||
33 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 33 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
34 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 34 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: ssh_config.5,v 1.157 2012/06/29 13:57:25 naddy Exp $ | 36 | .\" $OpenBSD: ssh_config.5,v 1.158 2012/10/04 13:21:50 markus Exp $ |
37 | .Dd $Mdocdate: June 29 2012 $ | 37 | .Dd $Mdocdate: October 4 2012 $ |
38 | .Dt SSH_CONFIG 5 | 38 | .Dt SSH_CONFIG 5 |
39 | .Os | 39 | .Os |
40 | .Sh NAME | 40 | .Sh NAME |
@@ -792,7 +792,7 @@ for data integrity protection. | |||
792 | Multiple algorithms must be comma-separated. | 792 | Multiple algorithms must be comma-separated. |
793 | The default is: | 793 | The default is: |
794 | .Bd -literal -offset indent | 794 | .Bd -literal -offset indent |
795 | hmac-md5,hmac-sha1,umac-64@openssh.com, | 795 | hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com, |
796 | hmac-sha2-256,hmac-sha2-512,hmac-ripemd160, | 796 | hmac-sha2-256,hmac-sha2-512,hmac-ripemd160, |
797 | hmac-sha1-96,hmac-md5-96 | 797 | hmac-sha1-96,hmac-md5-96 |
798 | .Ed | 798 | .Ed |
@@ -33,8 +33,8 @@ | |||
33 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 33 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
34 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 34 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: sshd.8,v 1.266 2012/06/18 12:07:07 dtucker Exp $ | 36 | .\" $OpenBSD: sshd.8,v 1.267 2012/10/04 13:21:50 markus Exp $ |
37 | .Dd $Mdocdate: June 18 2012 $ | 37 | .Dd $Mdocdate: October 4 2012 $ |
38 | .Dt SSHD 8 | 38 | .Dt SSHD 8 |
39 | .Os | 39 | .Os |
40 | .Sh NAME | 40 | .Sh NAME |
@@ -316,7 +316,7 @@ The client selects the encryption algorithm | |||
316 | to use from those offered by the server. | 316 | to use from those offered by the server. |
317 | Additionally, session integrity is provided | 317 | Additionally, session integrity is provided |
318 | through a cryptographic message authentication code | 318 | through a cryptographic message authentication code |
319 | (hmac-md5, hmac-sha1, umac-64, hmac-ripemd160, | 319 | (hmac-md5, hmac-sha1, umac-64, umac-128, hmac-ripemd160, |
320 | hmac-sha2-256 or hmac-sha2-512). | 320 | hmac-sha2-256 or hmac-sha2-512). |
321 | .Pp | 321 | .Pp |
322 | Finally, the server and the client enter an authentication dialog. | 322 | Finally, the server and the client enter an authentication dialog. |
diff --git a/sshd_config.5 b/sshd_config.5 index 314ecfb0e..987558ae8 100644 --- a/sshd_config.5 +++ b/sshd_config.5 | |||
@@ -33,8 +33,8 @@ | |||
33 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 33 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
34 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 34 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: sshd_config.5,v 1.144 2012/06/29 13:57:25 naddy Exp $ | 36 | .\" $OpenBSD: sshd_config.5,v 1.145 2012/10/04 13:21:50 markus Exp $ |
37 | .Dd $Mdocdate: June 29 2012 $ | 37 | .Dd $Mdocdate: October 4 2012 $ |
38 | .Dt SSHD_CONFIG 5 | 38 | .Dt SSHD_CONFIG 5 |
39 | .Os | 39 | .Os |
40 | .Sh NAME | 40 | .Sh NAME |
@@ -656,7 +656,7 @@ for data integrity protection. | |||
656 | Multiple algorithms must be comma-separated. | 656 | Multiple algorithms must be comma-separated. |
657 | The default is: | 657 | The default is: |
658 | .Bd -literal -offset indent | 658 | .Bd -literal -offset indent |
659 | hmac-md5,hmac-sha1,umac-64@openssh.com, | 659 | hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com, |
660 | hmac-sha2-256,hmac-sha2-512,hmac-ripemd160, | 660 | hmac-sha2-256,hmac-sha2-512,hmac-ripemd160, |
661 | hmac-sha1-96,hmac-md5-96 | 661 | hmac-sha1-96,hmac-md5-96 |
662 | .Ed | 662 | .Ed |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: umac.h,v 1.1 2007/06/07 19:37:34 pvalchev Exp $ */ | 1 | /* $OpenBSD: umac.h,v 1.2 2012/10/04 13:21:50 markus Exp $ */ |
2 | /* ----------------------------------------------------------------------- | 2 | /* ----------------------------------------------------------------------- |
3 | * | 3 | * |
4 | * umac.h -- C Implementation UMAC Message Authentication | 4 | * umac.h -- C Implementation UMAC Message Authentication |
@@ -116,6 +116,12 @@ int uhash(uhash_ctx_t ctx, | |||
116 | 116 | ||
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | /* matching umac-128 API, we reuse umac_ctx, since it's opaque */ | ||
120 | struct umac_ctx *umac128_new(u_char key[]); | ||
121 | int umac128_update(struct umac_ctx *ctx, u_char *input, long len); | ||
122 | int umac128_final(struct umac_ctx *ctx, u_char tag[], u_char nonce[8]); | ||
123 | int umac128_delete(struct umac_ctx *ctx); | ||
124 | |||
119 | #ifdef __cplusplus | 125 | #ifdef __cplusplus |
120 | } | 126 | } |
121 | #endif | 127 | #endif |