/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* lib/krb5/os/read_pwd.c
*
* Copyright 1990,1991 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
*
* libos: krb5_read_password for BSD 4.3
*/
#include "k5-int.h"
#if !defined(_WIN32)
#define DEFINED_KRB5_READ_PASSWORD
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <setjmp.h>
#ifndef ECHO_PASSWORD
#include <termios.h>
#endif /* ECHO_PASSWORD */
char *return_pwd, unsigned int *size_return)
{
if (!verify_data.data)
return ENOMEM;
if (retval == 0) {
/* compare */
}
}
if (!retval)
else
return retval;
}
#endif
#if defined(_WIN32)
#define DEFINED_KRB5_READ_PASSWORD
#include <io.h>
typedef struct {
char *pwd_prompt;
char *pwd_prompt2;
char *pwd_return_pwd;
int *pwd_size_return;
} pwd_params;
void
{
RECT r;
return;
GetWindowRect(hwnd, &r);
}
#ifdef _WIN32
static krb5_error_code
const char * prompt,
const char * prompt2,
char * password,
int * pwsize)
{
char *tmpstr = 0;
char *ptr;
int scratchchar;
if (handle == INVALID_HANDLE_VALUE)
return ENOTTY;
return ENOTTY;
new_mode &= ~( ENABLE_ECHO_INPUT );
return ENOTTY;
(void) putchar('\n');
goto cleanup;
}
(void) putchar('\n');
*ptr = '\0';
else /* need to flush */
do {
scratchchar = getchar();
if (prompt2) {
goto cleanup;
}
(void) putchar('\n');
goto cleanup;
}
(void) putchar('\n');
*ptr = '\0';
else /* need to flush */
do {
scratchchar = getchar();
goto cleanup;
}
}
if (tmpstr) {
}
if (errcode)
else
return errcode;
}
#endif
static int CALLBACK
{
switch(msg) {
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch (wParam) {
case IDOK:
*(dp->pwd_size_return) =
break;
case IDCANCEL:
*(dp->pwd_size_return) = 0;
break;
}
return TRUE;
default:
return FALSE;
}
}
const char *prompt;
const char *prompt2;
char *return_pwd;
int *size_return;
{
int rc;
#ifdef _WIN32
return(read_console_password
#endif
hinst = get_lib_instance();
#ifdef _WIN32
#else
#endif
#ifndef _WIN32
#endif
return 0;
}
#endif
#ifndef DEFINED_KRB5_READ_PASSWORD
#define DEFINED_KRB5_READ_PASSWORD
/*
* Don't expect to be called, just define it for sanity and the linker.
*/
const char *prompt;
const char *prompt2;
char *return_pwd;
int *size_return;
{
*size_return = 0;
return KRB5_LIBOS_CANTREADPWD;
}
#endif