Annotation of researchv10no/cmd/descrypt/randblock.c, revision 1.1

1.1     ! root        1: /*
        !             2:  *     Generate a Truly Block 64-bit Block
        !             3:  *     D.P.Mitchell  83/06/28.
        !             4:  */
        !             5: 
        !             6: #include <stdio.h>
        !             7: #include <sys/types.h>
        !             8: #include <sys/stat.h>
        !             9: #include "crypt.h"
        !            10: 
        !            11: char *volatile_file[] = {
        !            12:        "/bin/echo",
        !            13:        "/bin/sh",
        !            14:        "/bin/cat",
        !            15:        "/bin/ls",
        !            16:        "/bin/stty",
        !            17:        "/bin/date",
        !            18:        "/bin/cat",
        !            19:        "/bin/cc",
        !            20:        "/etc/motd",
        !            21:        "/etc/utmp",
        !            22:        "/dev/kmem",
        !            23:        "",
        !            24: };
        !            25: 
        !            26: Block
        !            27: rand_block()
        !            28: {
        !            29:        register i;
        !            30:        Block block;
        !            31:        struct stat buf;
        !            32:        extern long time();
        !            33: 
        !            34:        block.left  ^= 0x9662f394;
        !            35:        block.right ^= 0x9f17c55f;
        !            36:        key_setup(&block, 0);
        !            37:        block.right = NEXT(getpid() + (getuid() << 16));
        !            38:        block.left = NEXT(time((long *)0));
        !            39:        des(&block);
        !            40:        for (i = 0; strlen(volatile_file[i]); i++) {
        !            41:                if (stat(volatile_file[i], &buf) == -1)
        !            42:                        continue;
        !            43:                block.right ^= NEXT(buf.st_atime);
        !            44:                block.left ^= NEXT(buf.st_mtime);
        !            45:                des(&block);
        !            46:        }
        !            47:        return block;
        !            48: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.