pwdauth.c File Reference

#include <sys/types.h>
#include <pwd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

Include dependency graph for pwdauth.c:

Go to the source code of this file.

Data Structures

struct  block
struct  ordering

Defines

#define nil   0
#define crypt   CRYPT
#define LEN   1024

Functions

int main (int argc, char **argv)
static void transpose (struct block *data, struct ordering *t, int n)
static void rotate (struct block *key)
static void f (int i, struct block *key, struct block *a, struct block *x)
static void setkey (char *k)
static void encrypt (char *blck, int edflag)
char * crypt (const char *pw, const char *salt)

Variables

char SHADOW [] = "/etc/shadow"
static struct block key
static struct ordering InitialTr
static struct ordering FinalTr
static struct ordering swap
static struct ordering KeyTr1
static struct ordering KeyTr2
static struct ordering etr
static struct ordering ptr
static unsigned char s_boxes [8][64]
static int rots []
static struct orderingEP = &etr


Define Documentation

#define crypt   CRYPT
 

Definition at line 19 of file pwdauth.c.

Referenced by doPASS(), main(), passnone(), and passpass().

#define LEN   1024
 

Definition at line 27 of file pwdauth.c.

Referenced by crypt(), and main().

#define nil   0
 

Definition at line 18 of file pwdauth.c.


Function Documentation

char* crypt const char *  pw,
const char *  salt
 

Definition at line 289 of file pwdauth.c.

References c, cp, EP, etr, i, j, ordering::o_data, p, result, setkey(), and t.

static void encrypt char *  blck,
int  edflag
[static]
 

Definition at line 265 of file pwdauth.c.

References b, i, InitialTr, j, k, p, transpose(), and x.

static void f int  i,
struct block key,
struct block a,
struct block x
[static]
 

Definition at line 220 of file pwdauth.c.

References a, block::b_data, e, EP, k, key, KeyTr2, p, r, rotate(), rots, s_boxes, transpose(), x, and y.

int main int  argc,
char **  argv
 

Definition at line 30 of file pwdauth.c.

References crypt, getpwnam(), key, LEN, n, nil, passwd::pw_passwd, read, setpwfile(), SHADOW, strcmp, strlen(), and write.

static void rotate struct block key  )  [static]
 

Definition at line 207 of file pwdauth.c.

References ep, key, and p.

Referenced by f(), and gzscan().

static void setkey char *  k  )  [static]
 

Definition at line 258 of file pwdauth.c.

References key, KeyTr1, and transpose().

Referenced by crypt().

static void transpose struct block data,
struct ordering t,
int  n
[static]
 

Definition at line 196 of file pwdauth.c.

References data, t, and x.


Variable Documentation

struct ordering* EP = &etr [static]
 

Definition at line 218 of file pwdauth.c.

Referenced by crypt(), and f().

struct ordering etr [static]
 

Initial value:

 {
        32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9,
         8, 9,10,11,12,13,12,13,14,15,16,17,
        16,17,18,19,20,21,20,21,22,23,24,25,
        24,25,26,27,28,29,28,29,30,31,32, 1,
}

Definition at line 130 of file pwdauth.c.

Referenced by crypt().

struct ordering FinalTr [static]
 

Initial value:

 {
        40, 8,48,16,56,24,64,32,39, 7,47,15,55,23,63,31,
        38, 6,46,14,54,22,62,30,37, 5,45,13,53,21,61,29,
        36, 4,44,12,52,20,60,28,35, 3,43,11,51,19,59,27,
        34, 2,42,10,50,18,58,26,33, 1,41, 9,49,17,57,25,
}

Definition at line 102 of file pwdauth.c.

struct ordering InitialTr [static]
 

Initial value:

 {
        58,50,42,34,26,18,10, 2,60,52,44,36,28,20,12, 4,
        62,54,46,38,30,22,14, 6,64,56,48,40,32,24,16, 8,
        57,49,41,33,25,17, 9, 1,59,51,43,35,27,19,11, 3,
        61,53,45,37,29,21,13, 5,63,55,47,39,31,23,15, 7,
}

Definition at line 95 of file pwdauth.c.

Referenced by encrypt().

struct block key [static]
 

Definition at line 93 of file pwdauth.c.

struct ordering KeyTr1 [static]
 

Initial value:

 {
        57,49,41,33,25,17, 9, 1,58,50,42,34,26,18,
        10, 2,59,51,43,35,27,19,11, 3,60,52,44,36,
        63,55,47,39,31,23,15, 7,62,54,46,38,30,22,
        14, 6,61,53,45,37,29,21,13, 5,28,20,12, 4,
}

Definition at line 116 of file pwdauth.c.

Referenced by setkey().

struct ordering KeyTr2 [static]
 

Initial value:

 {
        14,17,11,24, 1, 5, 3,28,15, 6,21,10,
        23,19,12, 4,26, 8,16, 7,27,20,13, 2,
        41,52,31,37,47,55,30,40,51,45,33,48,
        44,49,39,56,34,53,46,42,50,36,29,32,
}

Definition at line 123 of file pwdauth.c.

Referenced by f().

struct ordering ptr [static]
 

Initial value:

 {
        16, 7,20,21,29,12,28,17, 1,15,23,26, 5,18,31,10,
         2, 8,24,14,32,27, 3, 9,19,13,30, 6,22,11, 4,25,
}

Definition at line 137 of file pwdauth.c.

Referenced by _basename(), _fprintPwd(), add_path(), alloc_buff(), basename(), bc_malloc(), bf_align(), BZ2_blockSort(), checksum(), ckglob(), clear_header(), complement(), do_svrctl(), doglob(), Expand(), fgets(), filename(), find(), free_buff(), generateMTFValues(), getptr(), gets(), gid_name(), inflate_fast(), load_mtab(), lookup(), main(), make_file(), make_header(), make_name(), mattrib(), memalloc(), myalloc(), name_gid(), name_uid(), new_field(), newwin(), print_table(), push_b10_const(), read_line(), ReadFileMemory(), recover(), recurs_dos_loop(), regnode(), scroll(), sort(), storename(), str2size(), sys_newmap(), tmpsave(), uid_name(), unix_target_lookup(), wclrtobot(), wclrtoeol(), and xmalloc().

int rots[] [static]
 

Initial value:

 {
        1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1,
}

Definition at line 192 of file pwdauth.c.

Referenced by f().

unsigned char s_boxes[8][64] [static]
 

Definition at line 142 of file pwdauth.c.

Referenced by f().

char SHADOW[] = "/etc/shadow"
 

Definition at line 28 of file pwdauth.c.

Referenced by main().

struct ordering swap [static]
 

Initial value:

 {
        33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,
        49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,
         1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,
        17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,
}

Definition at line 109 of file pwdauth.c.

Referenced by adf4(), main(), and oneC_sum().


Generated on Fri Apr 14 23:07:14 2006 for minix by  doxygen 1.4.6