scram.c revision d67944fbe3fa0b31893a7116a09b0718eecf6078
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#include <curses.h>
#define _SYS_TERMIO_H /* sys/termio.h is included by curses.h */
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include "wish.h"
#include "vtdefs.h"
#include "token.h"
#include "obj.h"
#include "typetab.h"
#include "partabdefs.h"
#include "parse.h"
#include "retcds.h"
#include "exception.h"
#include "terror.h"
#include "winp.h"
#include "moremacros.h"
#include "sizes.h"
#define KEYSIZE 101
extern char *Home;
static char Passwd[20];
static char Keyprompt[35];
static int cryptit(), mkencrypart();
static char scram_string[] = "scramble";
static char uscram_string[] = "unscramble";
static int check_key();
static int crypt_file();
static int pack();
static int unpack();
static int keysave();
static int keyvalid();
static void regetkey();
/*
* scram -- Scramble an object and pack all its parts into an OEU package
*/
int
register char *file;
{
return (0);
}
/*
* unscram -- Unscramble an object which was packed into an OEU package before
*/
int
register char *file;
{
int keysave();
return (0);
}
static void
regetkey(s, t)
char *s;
token t;
{
int keyvalid();
if (t == TOK_CANCEL)
return;
}
static int
keyvalid(s, t)
char *s;
token t;
{
if (t == TOK_CANCEL)
return (SUCCESS);
mess_temp("The two scramble keys are different.");
return (SUCCESS);
} else {
return (FAIL);
if (mkencrypart() == FAIL ||
return (FAIL);
else {
return (SUCCESS);
}
}
}
static int
keysave(s, t)
char *s;
token t;
{
int check_key();
return (FAIL);
return (FAIL);
}
} else {
/* get_string(keysave, Keyprompt, "", */
/* I_INVISIBLE, FALSE, scram_string, scram_string); */
}
return (SUCCESS);
}
static int
char *package;
{
struct one_part *opt_next_part();
char *part_match();
if (!part_ent) {
return (FAIL);
}
/* abs:added cast */
return (FAIL);
return (SUCCESS);
}
static int
{
return (FAIL);
}
/* remove OTHER parts after packing */
while (ptr) {
}
/* dereference children from parent */
return (SUCCESS);
}
/*
* crypt_file -- encrypt or decrypt using the UNIX "crypt" command
*/
static int
int create_entry;
{
int i;
struct ott_entry *orig_entry;
char *part_match(), *part_construct();
struct opt_entry *obj_to_parts();
/* if either return NULL */
return (FAIL);
continue;
mess_temp("Encryption software not available");
return (FAIL);
}
}
/* if need to create an entry (unscrambling) */
if (create_entry) {
/* since calling other routines */
#ifdef _DEBUG
#endif
/* remake parent so can do children - IF children exist */
/* dupped entry so don't need to & out ~M_DL */
} else if (i != 0) /* add child */
/* NOTE: part has been freed if anything is added after this */
}
}
return (SUCCESS);
}
static int
{
int m, n;
unsigned char buf[51];
char tempstr[3];
for (m = 0; m < 50; m++)
{
n = m + m;
}
return (FAIL);
for (m = 0; m < 50; m++) {
if (buf[m] > 0177) {
return (FAIL); /* encrypted */
}
}
return (SUCCESS); /* not encrypted */
}
static int
{
register int n, m;
char tempstr[3];
unsigned char buf[51];
for (n = 1; n < 50; n++) {
}
return (FAIL);
for (m = 0; m < 50; m++) {
static char hex[] = "0123456789abcdef";
n = m * 2;
}
return (SUCCESS);
}
static int
char *buf;
{
int fd;
mess_temp("Encryption software not available");
return (FAIL);
}
return (SUCCESS);
}