gsasl-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS gsasl/lib/src


From: gsasl-commit
Subject: CVS gsasl/lib/src
Date: Tue, 30 Nov 2004 04:05:47 +0100

Update of /home/cvs/gsasl/lib/src
In directory dopio:/tmp/cvs-serv2956/lib/src

Modified Files:
        Makefile.am gsasl-compat.h gsasl.h.in obsolete.c 
Removed Files:
        stringprep.c 
Log Message:
Obsolete gsasl_stringprep_nfkc, gsasl_stringprep_saslprep,
and gsasl_stringprep_trace.  Use gsasl_saslprep instead.


--- /home/cvs/gsasl/lib/src/Makefile.am 2004/11/30 02:51:30     1.18
+++ /home/cvs/gsasl/lib/src/Makefile.am 2004/11/30 03:05:47     1.19
@@ -41,7 +41,7 @@
        supportp.c suggest.c listmech.c \
        xstart.c xstep.c xfinish.c xcode.c \
        base64.c md5pwd.c crypto.c obsolete.c \
-       stringprep.c saslprep.c
+       saslprep.c
 
 # Plugins:
 if EXTERNAL
--- /home/cvs/gsasl/lib/src/gsasl-compat.h      2004/11/27 03:28:34     1.16
+++ /home/cvs/gsasl/lib/src/gsasl-compat.h      2004/11/30 03:05:47     1.17
@@ -126,6 +126,13 @@
                                char *target, size_t targsize)
   __attribute__ ((deprecated));
 
+extern char *gsasl_stringprep_nfkc (const char *in, ssize_t len)
+  __attribute__ ((deprecated));
+extern char *gsasl_stringprep_saslprep (const char *in, int *stringprep_rc)
+  __attribute__ ((deprecated));
+extern char *gsasl_stringprep_trace (const char *in, int *stringprep_rc)
+  __attribute__ ((deprecated));
+
 /* Callback prototypes */
 typedef int (*Gsasl_client_callback_anonymous) (Gsasl_session * sctx,
                                                char *out, size_t * outlen);
--- /home/cvs/gsasl/lib/src/gsasl.h.in  2004/11/30 02:11:53     1.50
+++ /home/cvs/gsasl/lib/src/gsasl.h.in  2004/11/30 03:05:47     1.51
@@ -119,6 +119,12 @@
     GSASL_CIPHER_AES = 32
   } Gsasl_cipher;
 
+  /* SASLprep flags, see gsasl_saslprep(). */
+  typedef enum
+    {
+      GSASL_ALLOW_UNASSIGNED = 1
+    } Gsasl_saslprep_flags;
+
   /* Library handles */
   typedef struct Gsasl Gsasl;
   typedef struct Gsasl_session Gsasl_session;
@@ -227,10 +233,8 @@
   extern const char *gsasl_strerror (int err);
 
   /* Internationalized string processing: stringprep.c */
-  extern int gsasl_saslprep (const char *in, int allowunassigned, char **out);
-  extern char *gsasl_stringprep_nfkc (const char *in, ssize_t len);
-  extern char *gsasl_stringprep_saslprep (const char *in, int *stringprep_rc);
-  extern char *gsasl_stringprep_trace (const char *in, int *stringprep_rc);
+  extern int gsasl_saslprep (const char *in, Gsasl_saslprep_flags flags,
+                            char **out, int *stringpreprc);
 
   /* Utilities: base64.c, md5pwd.c, crypto.c */
   extern int gsasl_base64_to (const char *in, size_t inlen,
--- /home/cvs/gsasl/lib/src/obsolete.c  2004/11/28 06:11:46     1.20
+++ /home/cvs/gsasl/lib/src/obsolete.c  2004/11/30 03:05:47     1.21
@@ -1542,6 +1542,110 @@
   return ctx ? ctx->cbs_service : NULL;
 }
 
+#include <stringprep.h>
+
+/**
+ * gsasl_stringprep_nfkc:
+ * @in: a UTF-8 encoded string.
+ * @len: length of @str, in bytes, or -1 if @str is nul-terminated.
+ *
+ * Converts a string into canonical form, standardizing such issues as
+ * whether a character with an accent is represented as a base
+ * character and combining accent or as a single precomposed
+ * character.
+ *
+ * The normalization mode is NFKC (ALL COMPOSE).  It standardizes
+ * differences that do not affect the text content, such as the
+ * above-mentioned accent representation. It standardizes the
+ * "compatibility" characters in Unicode, such as SUPERSCRIPT THREE to
+ * the standard forms (in this case DIGIT THREE). Formatting
+ * information may be lost but for most text operations such
+ * characters should be considered the same. It returns a result with
+ * composed forms rather than a maximally decomposed form.
+ *
+ * Return value: Return a newly allocated string, that is the NFKC
+ *   normalized form of @str, o %NULL on error.
+ *
+ * Deprecated: No replacement functionality in GNU SASL, use GNU
+ * Libidn instead.  Note that in SASL, you most likely want to use
+ * SASLprep and not bare NFKC, see gsasl_saslprep().
+ **/
+char *
+gsasl_stringprep_nfkc (const char *in, ssize_t len)
+{
+  char *out;
+
+  out = stringprep_utf8_nfkc_normalize (in, len);
+
+  return out;
+}
+
+/**
+ * gsasl_stringprep_saslprep:
+ * @in: input ASCII or UTF-8 string with data to prepare according to SASLprep.
+ * @stringprep_rc: pointer to output variable with stringprep error code,
+ *   or %NULL to indicate that you don't care about it.
+ *
+ * Process a Unicode string for comparison, according to the
+ * "SASLprep" stringprep profile.  This function is intended to be
+ * used by Simple Authentication and Security Layer (SASL) mechanisms
+ * (such as PLAIN, CRAM-MD5, and DIGEST-MD5) as well as other
+ * protocols exchanging user names and/or passwords.
+ *
+ * Return value: Return a newly allocated string that is the
+ *   "SASLprep" processed form of the input string, or %NULL on error,
+ *   in which case @stringprep_rc contain the stringprep library error
+ *   code.
+ *
+ * Deprecated: Use gsasl_saslprep() instead.
+ **/
+char *
+gsasl_stringprep_saslprep (const char *in, int *stringprep_rc)
+{
+  char *out;
+  int rc;
+
+  rc = stringprep_profile (in, &out, "SASLprep", 0);
+  if (stringprep_rc)
+    *stringprep_rc = rc;
+  if (rc != STRINGPREP_OK)
+    out = NULL;
+
+  return out;
+}
+
+/**
+ * gsasl_stringprep_trace:
+ * @in: input ASCII or UTF-8 string with data to prepare according to "trace".
+ * @stringprep_rc: pointer to output variable with stringprep error code,
+ *   or %NULL to indicate that you don't care about it.
+ *
+ * Process a Unicode string for use as trace information, according to
+ * the "trace" stringprep profile.  The profile is designed for use
+ * with the SASL ANONYMOUS Mechanism.
+ *
+ * Return value: Return a newly allocated string that is the "trace"
+ *   processed form of the input string, or %NULL on error, in which
+ *   case @stringprep_rc contain the stringprep library error code.
+ *
+ * Deprecated: No replacement functionality in GNU SASL, use GNU
+ * Libidn instead.
+ **/
+char *
+gsasl_stringprep_trace (const char *in, int *stringprep_rc)
+{
+  char *out;
+  int rc;
+
+  rc = stringprep_profile (in, &out, "trace", 0);
+  if (stringprep_rc)
+    *stringprep_rc = rc;
+  if (rc != STRINGPREP_OK)
+    out = NULL;
+
+  return out;
+}
+
 /*
  * Copyright (c) 1996-1999 by Internet Software Consortium.
  *





reply via email to

[Prev in Thread] Current Thread [Next in Thread]