[pubcookie-dev] WEBISO CVS update: willey;
flavor_basic.c,1.42.2.4,1.42.2.5 verify_uwsecurid.c,1.1.2.1,1.1.2.2
Stephen Willey
willey at cac.washington.edu
Wed Oct 8 16:18:22 PDT 2003
Update of /usr/local/cvsroot/webiso/pubcookie/src
In directory webiso-cvs.cac.washington.edu:/var/tmp/cvs-serv12088
Modified Files:
Tag: UWash3
flavor_uwsecurid.c flavor_basic.c verify_uwsecurid.c
Log Message:
- added login page sub-template for bad authentications when the username is
pre-filled and static.
- cleaned-up login for pre-filled static username fields
- added CRN=PRN logic for UWash SecurID.
Index: webiso/pubcookie/src/flavor_uwsecurid.c
diff -c webiso/pubcookie/src/flavor_uwsecurid.c:1.1.2.7 webiso/pubcookie/src/flavor_uwsecurid.c:1.1.2.8
*** webiso/pubcookie/src/flavor_uwsecurid.c:1.1.2.7 Wed Oct 1 14:08:24 2003
--- webiso/pubcookie/src/flavor_uwsecurid.c Wed Oct 8 16:18:20 2003
***************
*** 11,17 ****
*/
/*
! $Id: flavor_uwsecurid.c,v 1.1.2.7 2003/10/01 21:08:24 willey Exp $
*/
#ifdef HAVE_CONFIG_H
--- 11,17 ----
*/
/*
! $Id: flavor_uwsecurid.c,v 1.1.2.8 2003/10/08 23:18:20 willey Exp $
*/
#ifdef HAVE_CONFIG_H
***************
*** 345,354 ****
: (c != NULL ? c->user : NULL));
/* if it's a reauth then the user field can't be changed */
! if ( (reason == FLB_REAUTH && c != NULL && c->user != NULL) ||
! (reason == FLB_BAD_AUTH && c != NULL && c->user != NULL) ||
! (reason == FLB_CACHE_CREDS_WRONG && c != NULL && c->user != NULL) ||
! (reason == FLB_LCOOKIE_EXPIRED && c->user != NULL) ) {
return(get_field_html(p,
libpbc_config_getstring(p, "tmpl_login_user_static",
"login_user_static" ), loser));
--- 345,351 ----
: (c != NULL ? c->user : NULL));
/* if it's a reauth then the user field can't be changed */
! if ( c != NULL && c->user != NULL ) {
return(get_field_html(p,
libpbc_config_getstring(p, "tmpl_login_user_static",
"login_user_static" ), loser));
***************
*** 447,454 ****
switch (reason) {
case FLB_BAD_AUTH:
! reasonpage = libpbc_config_getstring(p, "tmpl_login_bad_auth_uwsecurid",
! "login_bad_auth_uwsecurid" );
break;
case FLB_REAUTH:
reasonpage = libpbc_config_getstring(p, "tmpl_login_reauth",
--- 444,459 ----
switch (reason) {
case FLB_BAD_AUTH:
! /* username will be static and prefilled use a different bad
! auth message, one without comments about the username */
! if( c != NULL && c->user != NULL )
! reasonpage = libpbc_config_getstring(p,
! "tmpl_login_bad_auth_uwsecurid_static_user",
! "login_bad_auth_uwsecurid_static_user" );
! else
! reasonpage = libpbc_config_getstring(p,
! "tmpl_login_bad_auth_uwsecurid",
! "login_bad_auth_uwsecurid" );
break;
case FLB_REAUTH:
reasonpage = libpbc_config_getstring(p, "tmpl_login_reauth",
Index: webiso/pubcookie/src/flavor_basic.c
diff -c webiso/pubcookie/src/flavor_basic.c:1.42.2.4 webiso/pubcookie/src/flavor_basic.c:1.42.2.5
*** webiso/pubcookie/src/flavor_basic.c:1.42.2.4 Wed Oct 1 14:08:24 2003
--- webiso/pubcookie/src/flavor_basic.c Wed Oct 8 16:18:20 2003
***************
*** 13,19 ****
* will pass l->realm to the verifier and append it to the username when
* 'append_realm' is set
*
! * $Id: flavor_basic.c,v 1.42.2.4 2003/10/01 21:08:24 willey Exp $
*/
--- 13,19 ----
* will pass l->realm to the verifier and append it to the username when
* 'append_realm' is set
*
! * $Id: flavor_basic.c,v 1.42.2.5 2003/10/08 23:18:20 willey Exp $
*/
***************
*** 313,319 ****
switch (reason) {
case FLB_BAD_AUTH:
! reasonpage = libpbc_config_getstring(p, "tmpl_login_bad_auth",
"login_bad_auth" );
break;
case FLB_REAUTH:
--- 313,326 ----
switch (reason) {
case FLB_BAD_AUTH:
! /* username will be static and prefilled use a different bad
! auth message, one without comments about the username */
! /* left the default file the same only config key is different */
! if( c != NULL && c->user != NULL )
! reasonpage = libpbc_config_getstring(p, "tmpl_login_bad_auth_static_user",
! "login_bad_auth" );
! else
! reasonpage = libpbc_config_getstring(p, "tmpl_login_bad_auth",
"login_bad_auth" );
break;
case FLB_REAUTH:
***************
*** 444,454 ****
/* if it's a reauth then the user field can't be changed */
/* and set focus */
! if ( (reason == FLB_REAUTH && c != NULL && c->user != NULL) ||
! (reason == FLB_BAD_AUTH && c != NULL && c->user != NULL) ||
! (reason == FLB_CACHE_CREDS_WRONG && c != NULL && c->user != NULL) ||
! (reason == FLB_PINIT && c != NULL && c->user != NULL) ||
! (reason == FLB_LCOOKIE_EXPIRED && c != NULL && c->user != NULL) ) {
user_field = get_user_field(p,
libpbc_config_getstring(p, "tmpl_login_user_static",
"login_user_static" ),
--- 451,457 ----
/* if it's a reauth then the user field can't be changed */
/* and set focus */
! if ( c != NULL && c->user != NULL ) {
user_field = get_user_field(p,
libpbc_config_getstring(p, "tmpl_login_user_static",
"login_user_static" ),
Index: webiso/pubcookie/src/verify_uwsecurid.c
diff -c webiso/pubcookie/src/verify_uwsecurid.c:1.1.2.1 webiso/pubcookie/src/verify_uwsecurid.c:1.1.2.2
*** webiso/pubcookie/src/verify_uwsecurid.c:1.1.2.1 Tue Sep 23 11:49:03 2003
--- webiso/pubcookie/src/verify_uwsecurid.c Wed Oct 8 16:18:20 2003
***************
*** 32,38 ****
* @return 0 on success, -1 if sid lookup fails, -3 next PRN,
* -2 on system error
*
! * $Id: verify_uwsecurid.c,v 1.1.2.1 2003/09/23 18:49:03 willey Exp $
*/
#ifdef HAVE_CONFIG_H
--- 32,38 ----
* @return 0 on success, -1 if sid lookup fails, -3 next PRN,
* -2 on system error
*
! * $Id: verify_uwsecurid.c,v 1.1.2.2 2003/10/08 23:18:20 willey Exp $
*/
#ifdef HAVE_CONFIG_H
***************
*** 304,310 ****
#ifdef ENABLE_UWSECURID /* ENABLE_UWSECURID */
static int uwsecurid_v(pool * p, const char *userid,
! const char *passwd,
const char *service,
const char *user_realm,
struct credentials **creds,
--- 304,310 ----
#ifdef ENABLE_UWSECURID /* ENABLE_UWSECURID */
static int uwsecurid_v(pool * p, const char *userid,
! const char *sid,
const char *service,
const char *user_realm,
struct credentials **creds,
***************
*** 312,325 ****
{
char *reason = NULL; /* dunno about this */
! char *card_id = NULL; /* get this */
int result;
/* what do we do with the card_id? */
result = securid(reason,
userid,
card_id,
! passwd,
1,
SECURID_TYPE_NORM,
SECURID_DO_SID);
--- 312,343 ----
{
char *reason = NULL; /* dunno about this */
! char *card_id = NULL;
int result;
+ char *ptr;
+ char *prn = NULL;
+
+ /* if the securid field is in the form card_id=prn seperate it */
+ card_id = malloc((strlen(sid)>strlen(userid)
+ ? strlen(sid) : strlen(userid))+1);
+ ptr = card_id = (char *)sid;
+ while( *ptr ) {
+ if( *ptr == '=' ) {
+ *ptr = '\0';
+ prn = ++ptr;
+ }
+ ptr++;
+ }
+ if( prn == NULL ) {
+ card_id = (char *)userid;
+ prn = (char *)sid;
+ }
/* what do we do with the card_id? */
result = securid(reason,
userid,
card_id,
! prn,
1,
SECURID_TYPE_NORM,
SECURID_DO_SID);
end of message
More information about the pubcookie-dev
mailing list