os/ossrv/ssl/libcrypto/src/crypto/ui/ui_locl.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ssl/libcrypto/src/crypto/ui/ui_locl.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,153 @@
     1.4 +/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */
     1.5 +/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
     1.6 + * project 2001.
     1.7 + */
     1.8 +/* ====================================================================
     1.9 + * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.
    1.10 + *
    1.11 + * Redistribution and use in source and binary forms, with or without
    1.12 + * modification, are permitted provided that the following conditions
    1.13 + * are met:
    1.14 + *
    1.15 + * 1. Redistributions of source code must retain the above copyright
    1.16 + *    notice, this list of conditions and the following disclaimer. 
    1.17 + *
    1.18 + * 2. Redistributions in binary form must reproduce the above copyright
    1.19 + *    notice, this list of conditions and the following disclaimer in
    1.20 + *    the documentation and/or other materials provided with the
    1.21 + *    distribution.
    1.22 + *
    1.23 + * 3. All advertising materials mentioning features or use of this
    1.24 + *    software must display the following acknowledgment:
    1.25 + *    "This product includes software developed by the OpenSSL Project
    1.26 + *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
    1.27 + *
    1.28 + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
    1.29 + *    endorse or promote products derived from this software without
    1.30 + *    prior written permission. For written permission, please contact
    1.31 + *    openssl-core@openssl.org.
    1.32 + *
    1.33 + * 5. Products derived from this software may not be called "OpenSSL"
    1.34 + *    nor may "OpenSSL" appear in their names without prior written
    1.35 + *    permission of the OpenSSL Project.
    1.36 + *
    1.37 + * 6. Redistributions of any form whatsoever must retain the following
    1.38 + *    acknowledgment:
    1.39 + *    "This product includes software developed by the OpenSSL Project
    1.40 + *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
    1.41 + *
    1.42 + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
    1.43 + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.44 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    1.45 + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
    1.46 + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.47 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    1.48 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    1.49 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    1.50 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
    1.51 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    1.52 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
    1.53 + * OF THE POSSIBILITY OF SUCH DAMAGE.
    1.54 + * ====================================================================
    1.55 + *
    1.56 + * This product includes cryptographic software written by Eric Young
    1.57 + * (eay@cryptsoft.com).  This product includes software written by Tim
    1.58 + * Hudson (tjh@cryptsoft.com).
    1.59 + *
    1.60 + */
    1.61 +
    1.62 +#ifndef HEADER_UI_LOCL_H
    1.63 +#define HEADER_UI_LOCL_H
    1.64 +
    1.65 +#include <openssl/ui.h>
    1.66 +#include <openssl/crypto.h>
    1.67 +
    1.68 +#ifdef _
    1.69 +#undef _
    1.70 +#endif
    1.71 +
    1.72 +struct ui_method_st
    1.73 +	{
    1.74 +	char *name;
    1.75 +
    1.76 +	/* All the functions return 1 or non-NULL for success and 0 or NULL
    1.77 +	   for failure */
    1.78 +
    1.79 +	/* Open whatever channel for this, be it the console, an X window
    1.80 +	   or whatever.
    1.81 +	   This function should use the ex_data structure to save
    1.82 +	   intermediate data. */
    1.83 +	int (*ui_open_session)(UI *ui);
    1.84 +
    1.85 +	int (*ui_write_string)(UI *ui, UI_STRING *uis);
    1.86 +
    1.87 +	/* Flush the output.  If a GUI dialog box is used, this function can
    1.88 +	   be used to actually display it. */
    1.89 +	int (*ui_flush)(UI *ui);
    1.90 +
    1.91 +	int (*ui_read_string)(UI *ui, UI_STRING *uis);
    1.92 +
    1.93 +	int (*ui_close_session)(UI *ui);
    1.94 +
    1.95 +	/* Construct a prompt in a user-defined manner.  object_desc is a
    1.96 +	   textual short description of the object, for example "pass phrase",
    1.97 +	   and object_name is the name of the object (might be a card name or
    1.98 +	   a file name.
    1.99 +	   The returned string shall always be allocated on the heap with
   1.100 +	   OPENSSL_malloc(), and need to be free'd with OPENSSL_free(). */
   1.101 +	char *(*ui_construct_prompt)(UI *ui, const char *object_desc,
   1.102 +		const char *object_name);
   1.103 +	};
   1.104 +
   1.105 +struct ui_string_st
   1.106 +	{
   1.107 +	enum UI_string_types type; /* Input */
   1.108 +	const char *out_string;	/* Input */
   1.109 +	int input_flags;	/* Flags from the user */
   1.110 +
   1.111 +	/* The following parameters are completely irrelevant for UIT_INFO,
   1.112 +	   and can therefore be set to 0 or NULL */
   1.113 +	char *result_buf;	/* Input and Output: If not NULL, user-defined
   1.114 +				   with size in result_maxsize.  Otherwise, it
   1.115 +				   may be allocated by the UI routine, meaning
   1.116 +				   result_minsize is going to be overwritten.*/
   1.117 +	union
   1.118 +		{
   1.119 +		struct
   1.120 +			{
   1.121 +			int result_minsize;	/* Input: minimum required
   1.122 +						   size of the result.
   1.123 +						*/
   1.124 +			int result_maxsize;	/* Input: maximum permitted
   1.125 +						   size of the result */
   1.126 +
   1.127 +			const char *test_buf;	/* Input: test string to verify
   1.128 +						   against */
   1.129 +			} string_data;
   1.130 +		struct
   1.131 +			{
   1.132 +			const char *action_desc; /* Input */
   1.133 +			const char *ok_chars; /* Input */
   1.134 +			const char *cancel_chars; /* Input */
   1.135 +			} boolean_data;
   1.136 +		} _;
   1.137 +
   1.138 +#define OUT_STRING_FREEABLE 0x01
   1.139 +	int flags;		/* flags for internal use */
   1.140 +	};
   1.141 +
   1.142 +struct ui_st
   1.143 +	{
   1.144 +	const UI_METHOD *meth;
   1.145 +	STACK_OF(UI_STRING) *strings; /* We might want to prompt for more
   1.146 +					 than one thing at a time, and
   1.147 +					 with different echoing status.  */
   1.148 +	void *user_data;
   1.149 +	CRYPTO_EX_DATA ex_data;
   1.150 +
   1.151 +#define UI_FLAG_REDOABLE	0x0001
   1.152 +#define UI_FLAG_PRINT_ERRORS	0x0100
   1.153 +	int flags;
   1.154 +	};
   1.155 +
   1.156 +#endif