shishi-commit
[Top][All Lists]
Advanced

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

CVS shishi/lib


From: shishi-commit
Subject: CVS shishi/lib
Date: Thu, 02 Dec 2004 02:50:57 +0100

Update of /home/cvs/shishi/lib
In directory dopio:/tmp/cvs-serv2982

Modified Files:
        key.c 
Log Message:
Use new base64 API.


--- /home/cvs/shishi/lib/key.c  2004/11/09 19:39:20     1.27
+++ /home/cvs/shishi/lib/key.c  2004/12/02 01:50:56     1.28
@@ -327,22 +327,19 @@
 
   if (value)
     {
-      size_t len;
-      char *buf;
+      size_t len = MAX_KEY_LEN;
 
-      buf = xmalloc (strlen (value) + 1);
-
-      len = base64_from (buf, value);
+      if (!base64_decode (value, strlen (value), (*key)->value, &len))
+       {
+         shishi_key_done (*key);
+         return SHISHI_BASE64_ERROR;
+       }
 
       if (len != shishi_key_length (*key))
        {
-         free (buf);
+         shishi_key_done (*key);
          return SHISHI_INVALID_KEY;
        }
-
-      shishi_key_value_set (*key, buf);
-
-      free (buf);
     }
 
   return SHISHI_OK;





reply via email to

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