[Help-gnutls] Re: Slight enum vs. `int' typo

Simon Josefsson simon at josefsson.org
Wed Apr 11 15:35:13 CEST 2007


ludo at chbouib.org (Ludovic Courtès) writes:

> Hi,
>
> The last argument of `gnutls_psk_set_client_credentials ()' should have
> type `gnutls_psk_key_flags' instead of `unsigned int' (hopefully the
> size of both types is the same on C89-compliant platforms ;-)).  I
> believe that last argument should also be renamed to `format' for
> clarity.

Applied, thanks.

/Simon

Index: NEWS
===================================================================
RCS file: /cvs/gnutls/gnutls/NEWS,v
retrieving revision 2.860
diff -u -p -r2.860 NEWS
--- NEWS	10 Apr 2007 17:49:29 -0000	2.860
+++ NEWS	11 Apr 2007 13:31:41 -0000
@@ -40,6 +40,12 @@ gnutls_cipher_suite_info.  Suggested by 
 
 ** New configure option --disable-tls-authorization to disable tls-authz.
 
+** Fix prototype for `gnutls_psk_set_client_credentials'.
+The last parameter was renamed from 'flags' to 'format' and the type
+changed from 'unsigned int' to 'gnutls_psk_key_flags' (an enum type),
+which shouldn't cause any ABI changes.  Reported by ludo at chbouib.org
+(Ludovic Courtès).
+
 ** API and ABI modifications:
 gnutls_x509_dn_t: ADD.
 gnutls_x509_ava_st: ADD.
Index: includes/gnutls/gnutls.h.in
===================================================================
RCS file: /cvs/gnutls/gnutls/includes/gnutls/gnutls.h.in,v
retrieving revision 1.39
diff -u -p -r1.39 gnutls.h.in
--- includes/gnutls/gnutls.h.in	4 Apr 2007 14:12:52 -0000	1.39
+++ includes/gnutls/gnutls.h.in	11 Apr 2007 13:31:41 -0000
@@ -920,7 +920,7 @@ extern "C"
   int gnutls_psk_set_client_credentials (gnutls_psk_client_credentials_t res,
 					 const char *username,
 					 const gnutls_datum * key,
-					 unsigned int flags);
+					 gnutls_psk_key_flags format);
   typedef enum gnutls_psk_key_flags
   {
     GNUTLS_PSK_KEY_RAW = 0,
Index: lib/gnutls_psk.c
===================================================================
RCS file: /cvs/gnutls/gnutls/lib/gnutls_psk.c,v
retrieving revision 2.9
diff -u -p -r2.9 gnutls_psk.c
--- lib/gnutls_psk.c	15 Dec 2005 13:24:30 -0000	2.9
+++ lib/gnutls_psk.c	11 Apr 2007 13:31:41 -0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Free Software Foundation
+ * Copyright (C) 2005, 2007 Free Software Foundation
  *
  * Author: Nikos Mavroyanopoulos
  *
@@ -78,6 +78,8 @@ gnutls_psk_allocate_client_credentials (
   * @res: is an #gnutls_psk_client_credentials_t structure.
   * @username: is the user's zero-terminated userid
   * @key: is the user's key
+  * @format: indicate the format of the key, either
+  * %GNUTLS_PSK_KEY_RAW or %GNUTLS_PSK_KEY_HEX.
   *
   * This function sets the username and password, in a
   * gnutls_psk_client_credentials_t structure.  Those will be used in
@@ -92,7 +94,7 @@ int
 gnutls_psk_set_client_credentials (gnutls_psk_client_credentials_t res,
 				   const char *username,
 				   const gnutls_datum * key,
-				   unsigned int flags)
+				   gnutls_psk_key_flags flags)
 {
   int ret;
 





More information about the Gnutls-help mailing list