tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY [AMMENDED] How to check password with C2 Security.
@ 1999-04-16 15:08 Michael H. Martel
  0 siblings, 0 replies; only message in thread
From: Michael H. Martel @ 1999-04-16 15:08 UTC (permalink / raw)
  To: tru64-unix-managers

After posting my Summary I got a message from John Ferlan --

Well technically that works, it may not work for all cases....The problem
with
the above code is that an enhanced security profile could use one of at
least 3
different algorithms to encrypt the password and it may not necessarily be
bigcrypt()...

If all you are doing is validating the password is correct when wanting to
authenticate a user or start a session you could use:

sia_validate_user(3)

the sia_validate_user() routine knows how to determine which algorithm was
used
and to "do the right thing".

--

John Ferlan   DTN: 264-0854  Office: ZKO3-3/Y26
Compaq Computer Corporation
110 Spit Brook Rd.
M/S: ZKO3-3/W20
Nashua, NH 03062-2698

---

So the modified file looks like this. You still need the set_auth_params()
in main.

-- In main.c --

	     set_auth_parameters( argc,argv );


-- end main.c --

Then the login_unix_shadow.c file looks like the one below.
sia_validate_user needs an argv and argv combo for logging, so I'm just
passing it the daemon's name (imspd).

-- login_unix_shadow.c --

#include <stdio.h>
#include <stdlib.h>
#include </usr/include/prot.h>
#include <sia.h>
#include <siad.h>

/*
        #include <sysexits.h>
        #include <acte.h>
*/

/*
 * Unix passwd-authenticated login
 */

int
login_plaintext(user, pass, reply)
char *user;
char *pass;
char **reply;
{
	int auth_status;
        int myargc;
        char *myargv[2];

        myargc = 1;
        myargv[0] = "imspd";
        myargv[1] = NULL;

	auth_status
=sia_validate_user(NULL,myargc,myargv,NULL,user,NULL,0,NULL,pass);

        if( auth_status )!=SIASUCCESS){
                *reply = "wrong password";
                return(1);
        }
        return 0;
}
  
int
login_authenticate(authtype, mech, authproc)
char *authtype;
struct acte_server **mech;
int (**authproc)();
{
    return 1;
}

-- end login_unix_shadow.c --

Michael

-- 

   -------------------------------o--------------------------------
   Michael H. Martel              | Vermont State Colleges        
   mailto:martelm@quark.vsc.edu   | Technical Support Specialist
   http://probe.vsc.edu/~michael  | PH:802-241-2535 FX:802-241-3363

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-04-16 15:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-04-16 15:08 SUMMARY [AMMENDED] How to check password with C2 Security Michael H. Martel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox