[dovecot-cvs] dovecot/src/auth auth-digest-md5.c,1.11,1.12

cras at procontrol.fi cras at procontrol.fi
Sun Dec 22 00:03:00 EET 2002


Update of /home/cvs/dovecot/src/auth
In directory danu:/tmp/cvs-serv15300/auth

Modified Files:
	auth-digest-md5.c 
Log Message:
Replaced TempString with a String which can use any memory pool and uses
Buffer internally.



Index: auth-digest-md5.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/auth-digest-md5.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- auth-digest-md5.c	21 Dec 2002 13:08:49 -0000	1.11
+++ auth-digest-md5.c	21 Dec 2002 22:02:57 -0000	1.12
@@ -8,7 +8,7 @@
 #include "hex-binary.h"
 #include "md5.h"
 #include "randgen.h"
-#include "temp-string.h"
+#include "str.h"
 
 #include "auth.h"
 #include "cookie.h"
@@ -57,7 +57,7 @@
 
 static const char *get_digest_challenge(AuthData *auth)
 {
-	TempString *qoplist, *realms;
+	String *qoplist, *realms;
 	Buffer *buf;
 	char *const *tmp;
 	unsigned char nonce[16];
@@ -86,24 +86,24 @@
 	t_pop();
 
 	/* get list of allowed QoPs */
-	qoplist = t_string_new(32);
+	qoplist = t_str_new(32);
 	for (i = 0; i < QOP_COUNT; i++) {
 		if (auth->qop & (1 << i)) {
-			if (qoplist->len > 0)
-				t_string_append_c(qoplist, ',');
-			t_string_append(qoplist, qop_names[i]);
+			if (str_len(qoplist) > 0)
+				str_append_c(qoplist, ',');
+			str_append(qoplist, qop_names[i]);
 		}
 	}
 
-	realms = t_string_new(128);
+	realms = t_str_new(128);
 	for (tmp = auth_realms; *tmp != NULL; tmp++) {
-		t_string_printfa(realms, "realm=\"%s\"", *tmp);
-		t_string_append_c(realms, ',');
+		str_printfa(realms, "realm=\"%s\"", *tmp);
+		str_append_c(realms, ',');
 	}
 
-	return t_strconcat(realms->str,
+	return t_strconcat(str_c(realms),
 			   "nonce=\"", auth->nonce, "\",",
-			   "qop-options=\"", qoplist->str, "\",",
+			   "qop-options=\"", str_c(qoplist), "\",",
 			   "charset=\"utf-8\",",
 			   "algorithm=\"md5-sess\"",
 			   NULL);




More information about the dovecot-cvs mailing list