Skip to contentSkip to conversation

polarssl: use wrappers to access md_info_t member functions

PATCH In review Steffan Karger 2 participants 2 messages Jan 7, 2016 – Jan 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 polarssl: use wrappers to access md_info_t member functions

The md_info_t will become an opaque struct in mbed TLS 2.x, start using the wrapper function in preparation to a future upgrade to 2.x.

---
 src/openvpn/crypto_polarssl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/openvpn/crypto_polarssl.c +3 -3
index cd50fe5..407a176 100644
@@ -214,7 +214,7 @@ show_available_digests ()
 
       if (info)
 	printf ("%s %d bit default key\n",
-		info->name, info->size * 8);
+		md_get_name(info), md_get_size(info) * 8);
       digests++;
     }
   printf ("\n");
@@ -576,10 +576,10 @@ md_kt_get (const char *digest)
   md = md_info_from_string(digest);
   if (!md)
     msg (M_FATAL, "Message hash algorithm '%s' not found", digest);
-  if (md->size > MAX_HMAC_KEY_LENGTH)
+  if (md_get_size(md) > MAX_HMAC_KEY_LENGTH)
     msg (M_FATAL, "Message hash algorithm '%s' uses a default hash size (%d bytes) which is larger than " PACKAGE_NAME "'s current maximum hash size (%d bytes)",
 	 digest,
-	 md->size,
+	 md_get_size(md),
 	 MAX_HMAC_KEY_LENGTH);
   return md;
 }
Signature · 1 line
2.5.0
#1 lore raw

ACK. Tested with "--show-digest" (and t_client test suite).

Your patch has been applied to the master branch.

commit 072fdcd00688d2d16d17745fb7d7b385795d5de1

Author: Steffan Karger
Date:   Thu Jan 7 21:22:12 2016 +0100
     polarssl: use wrappers to access md_info_t member functions

     Signed-off-by: Steffan Karger <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: http://article.gmane.org/gmane.network.openvpn.devel/10955
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering