/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <signal.h>
#include <fcntl.h>
#include <errno.h>
#include <thread.h>
#include <unistd.h>
#include <strings.h>
#include <crypt.h>
#include "des_soft.h"
#include "lib_gen.h"
#define READER 0
/* Global Variables */
struct header {
long offset;
unsigned int count;
};
static int cryptopen();
static int writekey();
void _exit();
int
{
(void) mutex_lock(&lock);
if (cryptopen(p) == -1) {
(void) mutex_unlock(&lock);
return (-1);
}
if (*key == 0) {
(void) crypt_close_nolock(p);
(void) mutex_unlock(&lock);
return (0);
}
(void) mutex_unlock(&lock);
return (-1);
}
(void) mutex_unlock(&lock);
return (1);
}
static int
{
char c;
return (-1);
/* other end */
(void) crypt_close(p); /* remove defunct process */
return (-1);
}
return (1);
}
static int
{
void (*pstat) ();
/* death */
(void) crypt_close(p); /* remove defunct process */
return (-1);
}
return (1);
}
int
{
void (*pstat) ();
(void) mutex_lock(&lock);
!= sizeof (header)) {
(void) crypt_close_nolock(p);
(void) mutex_unlock(&lock);
return (-1);
}
(void) crypt_close_nolock(p);
(void) mutex_unlock(&lock);
return (-1);
}
(void) crypt_close_nolock(p);
(void) mutex_unlock(&lock);
return (-1);
}
(void) mutex_unlock(&lock);
return (0);
}
int
{
int i;
long gorp;
(void) mutex_lock(&lock);
a = key;
for (i = 0; i < KSIZE; i++)
temp[i] = *a++;
for (i = 0; i < 4; i++)
if (cryptopen(b) == -1) {
(void) mutex_unlock(&lock);
return (-1);
}
(void) mutex_unlock(&lock);
return (-1);
}
(void) mutex_unlock(&lock);
return (0);
}
int
{
if (p[0] == 0 && p[1] == 0 || p[0] < 0 || p[1] < 0) {
return (-1);
}
}
int
{
(void) mutex_lock(&lock);
(void) crypt_close_nolock(p);
(void) mutex_unlock(&lock);
return (0);
}