Add a bytestogroup macro
[openssl.git] / ssl / statem / extensions.c
index 563eb576997217b70de387a95a842c694d52306f..99326b2b55f58710259fbc587fdc7a95e58f9632 100644 (file)
@@ -1020,7 +1020,7 @@ static int final_key_share(SSL *s, unsigned int context, int sent, int *al)
             size_t num_curves, clnt_num_curves, i;
             unsigned int group_id;
 
-            /* Check a shared group exists */
+            /* Check if a shared group exists */
 
             /* Get the clients list of supported groups. */
             if (!tls1_get_curvelist(s, 1, &clntcurves, &clnt_num_curves)) {
@@ -1039,7 +1039,7 @@ static int final_key_share(SSL *s, unsigned int context, int sent, int *al)
             /* Find the first group we allow that is also in client's list */
             for (i = 0, pcurvestmp = pcurves; i < num_curves;
                  i++, pcurvestmp += 2) {
-                group_id = pcurvestmp[0] << 8 | pcurvestmp[1];
+                group_id = bytestogroup(pcurvestmp);
 
                 if (check_in_list(s, group_id, clntcurves, clnt_num_curves, 1))
                     break;