comparison src/c/urweb.c @ 734:f2a2be93331c

Cookie signing working for forms
author Adam Chlipala <adamc@hcoop.net>
date Thu, 16 Apr 2009 19:12:12 -0400
parents 9864b64b1700
children 796e42c93c48
comparison
equal deleted inserted replaced
733:15ddd64a5113 734:f2a2be93331c
1979 } 1979 }
1980 1980
1981 uw_Basis_string uw_Basis_bless(uw_context ctx, uw_Basis_string s) { 1981 uw_Basis_string uw_Basis_bless(uw_context ctx, uw_Basis_string s) {
1982 return s; 1982 return s;
1983 } 1983 }
1984
1985 uw_Basis_string uw_unnull(uw_Basis_string s) {
1986 return s ? s : "";
1987 }
1988
1989 extern int uw_hash_blocksize;
1990
1991 uw_Basis_string uw_Basis_makeSigString(uw_context ctx, uw_Basis_string sig) {
1992 uw_Basis_string r = uw_malloc(ctx, 2 * uw_hash_blocksize + 1);
1993 int i;
1994
1995 for (i = 0; i < uw_hash_blocksize; ++i)
1996 sprintf(&r[2*i], "%.02X", ((unsigned char *)sig)[i]);
1997
1998 return r;
1999 }
2000
2001 extern uw_Basis_string uw_cookie_sig(uw_context);
2002
2003 uw_Basis_string uw_Basis_sigString(uw_context ctx, uw_unit u) {
2004 return uw_cookie_sig(ctx);
2005 }