new openssl headers - removed files
This commit is contained in:
parent
dc84a2bfca
commit
453b37fcc0
@ -1,94 +0,0 @@
|
||||
#define APPLINK_STDIN 1
|
||||
#define APPLINK_STDOUT 2
|
||||
#define APPLINK_STDERR 3
|
||||
#define APPLINK_FPRINTF 4
|
||||
#define APPLINK_FGETS 5
|
||||
#define APPLINK_FREAD 6
|
||||
#define APPLINK_FWRITE 7
|
||||
#define APPLINK_FSETMOD 8
|
||||
#define APPLINK_FEOF 9
|
||||
#define APPLINK_FCLOSE 10 /* should not be used */
|
||||
|
||||
#define APPLINK_FOPEN 11 /* solely for completeness */
|
||||
#define APPLINK_FSEEK 12
|
||||
#define APPLINK_FTELL 13
|
||||
#define APPLINK_FFLUSH 14
|
||||
#define APPLINK_FERROR 15
|
||||
#define APPLINK_CLEARERR 16
|
||||
#define APPLINK_FILENO 17 /* to be used with below */
|
||||
|
||||
#define APPLINK_OPEN 18 /* formally can't be used, as flags can vary */
|
||||
#define APPLINK_READ 19
|
||||
#define APPLINK_WRITE 20
|
||||
#define APPLINK_LSEEK 21
|
||||
#define APPLINK_CLOSE 22
|
||||
#define APPLINK_MAX 22 /* always same as last macro */
|
||||
|
||||
#ifndef APPMACROS_ONLY
|
||||
#include <stdio.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
static void *app_stdin(void) { return stdin; }
|
||||
static void *app_stdout(void) { return stdout; }
|
||||
static void *app_stderr(void) { return stderr; }
|
||||
static int app_feof(FILE *fp) { return feof(fp); }
|
||||
static int app_ferror(FILE *fp) { return ferror(fp); }
|
||||
static void app_clearerr(FILE *fp) { clearerr(fp); }
|
||||
static int app_fileno(FILE *fp) { return _fileno(fp); }
|
||||
static int app_fsetmod(FILE *fp,char mod)
|
||||
{ return _setmode (_fileno(fp),mod=='b'?_O_BINARY:_O_TEXT); }
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
__declspec(dllexport)
|
||||
void **
|
||||
#if defined(__BORLANDC__)
|
||||
__stdcall /* __stdcall appears to be the only way to get the name
|
||||
* decoration right with Borland C. Otherwise it works
|
||||
* purely incidentally, as we pass no parameters. */
|
||||
#else
|
||||
__cdecl
|
||||
#endif
|
||||
OPENSSL_Applink(void)
|
||||
{ static int once=1;
|
||||
static void *OPENSSL_ApplinkTable[APPLINK_MAX+1]={(void *)APPLINK_MAX};
|
||||
|
||||
if (once)
|
||||
{ OPENSSL_ApplinkTable[APPLINK_STDIN] = app_stdin;
|
||||
OPENSSL_ApplinkTable[APPLINK_STDOUT] = app_stdout;
|
||||
OPENSSL_ApplinkTable[APPLINK_STDERR] = app_stderr;
|
||||
OPENSSL_ApplinkTable[APPLINK_FPRINTF] = fprintf;
|
||||
OPENSSL_ApplinkTable[APPLINK_FGETS] = fgets;
|
||||
OPENSSL_ApplinkTable[APPLINK_FREAD] = fread;
|
||||
OPENSSL_ApplinkTable[APPLINK_FWRITE] = fwrite;
|
||||
OPENSSL_ApplinkTable[APPLINK_FSETMOD] = app_fsetmod;
|
||||
OPENSSL_ApplinkTable[APPLINK_FEOF] = app_feof;
|
||||
OPENSSL_ApplinkTable[APPLINK_FCLOSE] = fclose;
|
||||
|
||||
OPENSSL_ApplinkTable[APPLINK_FOPEN] = fopen;
|
||||
OPENSSL_ApplinkTable[APPLINK_FSEEK] = fseek;
|
||||
OPENSSL_ApplinkTable[APPLINK_FTELL] = ftell;
|
||||
OPENSSL_ApplinkTable[APPLINK_FFLUSH] = fflush;
|
||||
OPENSSL_ApplinkTable[APPLINK_FERROR] = app_ferror;
|
||||
OPENSSL_ApplinkTable[APPLINK_CLEARERR] = app_clearerr;
|
||||
OPENSSL_ApplinkTable[APPLINK_FILENO] = app_fileno;
|
||||
|
||||
OPENSSL_ApplinkTable[APPLINK_OPEN] = _open;
|
||||
OPENSSL_ApplinkTable[APPLINK_READ] = _read;
|
||||
OPENSSL_ApplinkTable[APPLINK_WRITE] = _write;
|
||||
OPENSSL_ApplinkTable[APPLINK_LSEEK] = _lseek;
|
||||
OPENSSL_ApplinkTable[APPLINK_CLOSE] = _close;
|
||||
|
||||
once = 0;
|
||||
}
|
||||
|
||||
return OPENSSL_ApplinkTable;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@ -1,445 +0,0 @@
|
||||
/* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */
|
||||
|
||||
/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
||||
*
|
||||
* The function names in here are deprecated and are only present to
|
||||
* provide an interface compatible with openssl 0.9.6 and older as
|
||||
* well as libdes. OpenSSL now provides functions where "des_" has
|
||||
* been replaced with "DES_" in the names, to make it possible to
|
||||
* make incompatible changes that are needed for C type security and
|
||||
* other stuff.
|
||||
*
|
||||
* This include files has two compatibility modes:
|
||||
*
|
||||
* - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API
|
||||
* that is compatible with libdes and SSLeay.
|
||||
* - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an
|
||||
* API that is compatible with OpenSSL 0.9.5x to 0.9.6x.
|
||||
*
|
||||
* Note that these modes break earlier snapshots of OpenSSL, where
|
||||
* libdes compatibility was the only available mode or (later on) the
|
||||
* prefered compatibility mode. However, after much consideration
|
||||
* (and more or less violent discussions with external parties), it
|
||||
* was concluded that OpenSSL should be compatible with earlier versions
|
||||
* of itself before anything else. Also, in all honesty, libdes is
|
||||
* an old beast that shouldn't really be used any more.
|
||||
*
|
||||
* Please consider starting to use the DES_ functions rather than the
|
||||
* des_ ones. The des_ functions will disappear completely before
|
||||
* OpenSSL 1.0!
|
||||
*
|
||||
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
|
||||
*/
|
||||
|
||||
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
|
||||
* project 2001.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_DES_H
|
||||
#define HEADER_DES_H
|
||||
|
||||
#include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */
|
||||
|
||||
#ifdef OPENSSL_NO_DES
|
||||
#error DES is disabled.
|
||||
#endif
|
||||
|
||||
#ifndef HEADER_NEW_DES_H
|
||||
#error You must include des.h, not des_old.h directly.
|
||||
#endif
|
||||
|
||||
#ifdef _KERBEROS_DES_H
|
||||
#error <openssl/des_old.h> replaces <kerberos/des.h>.
|
||||
#endif
|
||||
|
||||
#include <openssl/symhacks.h>
|
||||
|
||||
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
|
||||
# undef OPENSSL_EXTERN
|
||||
# define OPENSSL_EXTERN OPENSSL_EXPORT
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _
|
||||
#undef _
|
||||
#endif
|
||||
|
||||
typedef unsigned char _ossl_old_des_cblock[8];
|
||||
typedef struct _ossl_old_des_ks_struct
|
||||
{
|
||||
union {
|
||||
_ossl_old_des_cblock _;
|
||||
/* make sure things are correct size on machines with
|
||||
* 8 byte longs */
|
||||
DES_LONG pad[2];
|
||||
} ks;
|
||||
} _ossl_old_des_key_schedule[16];
|
||||
|
||||
#ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
|
||||
#define des_cblock DES_cblock
|
||||
#define const_des_cblock const_DES_cblock
|
||||
#define des_key_schedule DES_key_schedule
|
||||
#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
|
||||
DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))
|
||||
#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
|
||||
DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))
|
||||
#define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\
|
||||
DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))
|
||||
#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
|
||||
DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))
|
||||
#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
|
||||
DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))
|
||||
#define des_options()\
|
||||
DES_options()
|
||||
#define des_cbc_cksum(i,o,l,k,iv)\
|
||||
DES_cbc_cksum((i),(o),(l),&(k),(iv))
|
||||
#define des_cbc_encrypt(i,o,l,k,iv,e)\
|
||||
DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))
|
||||
#define des_ncbc_encrypt(i,o,l,k,iv,e)\
|
||||
DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))
|
||||
#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
|
||||
DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))
|
||||
#define des_cfb_encrypt(i,o,n,l,k,iv,e)\
|
||||
DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))
|
||||
#define des_ecb_encrypt(i,o,k,e)\
|
||||
DES_ecb_encrypt((i),(o),&(k),(e))
|
||||
#define des_encrypt1(d,k,e)\
|
||||
DES_encrypt1((d),&(k),(e))
|
||||
#define des_encrypt2(d,k,e)\
|
||||
DES_encrypt2((d),&(k),(e))
|
||||
#define des_encrypt3(d,k1,k2,k3)\
|
||||
DES_encrypt3((d),&(k1),&(k2),&(k3))
|
||||
#define des_decrypt3(d,k1,k2,k3)\
|
||||
DES_decrypt3((d),&(k1),&(k2),&(k3))
|
||||
#define des_xwhite_in2out(k,i,o)\
|
||||
DES_xwhite_in2out((k),(i),(o))
|
||||
#define des_enc_read(f,b,l,k,iv)\
|
||||
DES_enc_read((f),(b),(l),&(k),(iv))
|
||||
#define des_enc_write(f,b,l,k,iv)\
|
||||
DES_enc_write((f),(b),(l),&(k),(iv))
|
||||
#define des_fcrypt(b,s,r)\
|
||||
DES_fcrypt((b),(s),(r))
|
||||
#if 0
|
||||
#define des_crypt(b,s)\
|
||||
DES_crypt((b),(s))
|
||||
#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
|
||||
#define crypt(b,s)\
|
||||
DES_crypt((b),(s))
|
||||
#endif
|
||||
#endif
|
||||
#define des_ofb_encrypt(i,o,n,l,k,iv)\
|
||||
DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))
|
||||
#define des_pcbc_encrypt(i,o,l,k,iv,e)\
|
||||
DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))
|
||||
#define des_quad_cksum(i,o,l,c,s)\
|
||||
DES_quad_cksum((i),(o),(l),(c),(s))
|
||||
#define des_random_seed(k)\
|
||||
_ossl_096_des_random_seed((k))
|
||||
#define des_random_key(r)\
|
||||
DES_random_key((r))
|
||||
#define des_read_password(k,p,v) \
|
||||
DES_read_password((k),(p),(v))
|
||||
#define des_read_2passwords(k1,k2,p,v) \
|
||||
DES_read_2passwords((k1),(k2),(p),(v))
|
||||
#define des_set_odd_parity(k)\
|
||||
DES_set_odd_parity((k))
|
||||
#define des_check_key_parity(k)\
|
||||
DES_check_key_parity((k))
|
||||
#define des_is_weak_key(k)\
|
||||
DES_is_weak_key((k))
|
||||
#define des_set_key(k,ks)\
|
||||
DES_set_key((k),&(ks))
|
||||
#define des_key_sched(k,ks)\
|
||||
DES_key_sched((k),&(ks))
|
||||
#define des_set_key_checked(k,ks)\
|
||||
DES_set_key_checked((k),&(ks))
|
||||
#define des_set_key_unchecked(k,ks)\
|
||||
DES_set_key_unchecked((k),&(ks))
|
||||
#define des_string_to_key(s,k)\
|
||||
DES_string_to_key((s),(k))
|
||||
#define des_string_to_2keys(s,k1,k2)\
|
||||
DES_string_to_2keys((s),(k1),(k2))
|
||||
#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
|
||||
DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))
|
||||
#define des_ofb64_encrypt(i,o,l,ks,iv,n)\
|
||||
DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))
|
||||
|
||||
|
||||
#define des_ecb2_encrypt(i,o,k1,k2,e) \
|
||||
des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
|
||||
|
||||
#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
|
||||
des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
|
||||
|
||||
#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
|
||||
des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
|
||||
|
||||
#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
|
||||
des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
|
||||
|
||||
#define des_check_key DES_check_key
|
||||
#define des_rw_mode DES_rw_mode
|
||||
#else /* libdes compatibility */
|
||||
/* Map all symbol names to _ossl_old_des_* form, so we avoid all
|
||||
clashes with libdes */
|
||||
#define des_cblock _ossl_old_des_cblock
|
||||
#define des_key_schedule _ossl_old_des_key_schedule
|
||||
#define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
|
||||
_ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))
|
||||
#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
|
||||
_ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))
|
||||
#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
|
||||
_ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))
|
||||
#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
|
||||
_ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))
|
||||
#define des_options()\
|
||||
_ossl_old_des_options()
|
||||
#define des_cbc_cksum(i,o,l,k,iv)\
|
||||
_ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))
|
||||
#define des_cbc_encrypt(i,o,l,k,iv,e)\
|
||||
_ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))
|
||||
#define des_ncbc_encrypt(i,o,l,k,iv,e)\
|
||||
_ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))
|
||||
#define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
|
||||
_ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))
|
||||
#define des_cfb_encrypt(i,o,n,l,k,iv,e)\
|
||||
_ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))
|
||||
#define des_ecb_encrypt(i,o,k,e)\
|
||||
_ossl_old_des_ecb_encrypt((i),(o),(k),(e))
|
||||
#define des_encrypt(d,k,e)\
|
||||
_ossl_old_des_encrypt((d),(k),(e))
|
||||
#define des_encrypt2(d,k,e)\
|
||||
_ossl_old_des_encrypt2((d),(k),(e))
|
||||
#define des_encrypt3(d,k1,k2,k3)\
|
||||
_ossl_old_des_encrypt3((d),(k1),(k2),(k3))
|
||||
#define des_decrypt3(d,k1,k2,k3)\
|
||||
_ossl_old_des_decrypt3((d),(k1),(k2),(k3))
|
||||
#define des_xwhite_in2out(k,i,o)\
|
||||
_ossl_old_des_xwhite_in2out((k),(i),(o))
|
||||
#define des_enc_read(f,b,l,k,iv)\
|
||||
_ossl_old_des_enc_read((f),(b),(l),(k),(iv))
|
||||
#define des_enc_write(f,b,l,k,iv)\
|
||||
_ossl_old_des_enc_write((f),(b),(l),(k),(iv))
|
||||
#define des_fcrypt(b,s,r)\
|
||||
_ossl_old_des_fcrypt((b),(s),(r))
|
||||
#define des_crypt(b,s)\
|
||||
_ossl_old_des_crypt((b),(s))
|
||||
#if 0
|
||||
#define crypt(b,s)\
|
||||
_ossl_old_crypt((b),(s))
|
||||
#endif
|
||||
#define des_ofb_encrypt(i,o,n,l,k,iv)\
|
||||
_ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))
|
||||
#define des_pcbc_encrypt(i,o,l,k,iv,e)\
|
||||
_ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))
|
||||
#define des_quad_cksum(i,o,l,c,s)\
|
||||
_ossl_old_des_quad_cksum((i),(o),(l),(c),(s))
|
||||
#define des_random_seed(k)\
|
||||
_ossl_old_des_random_seed((k))
|
||||
#define des_random_key(r)\
|
||||
_ossl_old_des_random_key((r))
|
||||
#define des_read_password(k,p,v) \
|
||||
_ossl_old_des_read_password((k),(p),(v))
|
||||
#define des_read_2passwords(k1,k2,p,v) \
|
||||
_ossl_old_des_read_2passwords((k1),(k2),(p),(v))
|
||||
#define des_set_odd_parity(k)\
|
||||
_ossl_old_des_set_odd_parity((k))
|
||||
#define des_is_weak_key(k)\
|
||||
_ossl_old_des_is_weak_key((k))
|
||||
#define des_set_key(k,ks)\
|
||||
_ossl_old_des_set_key((k),(ks))
|
||||
#define des_key_sched(k,ks)\
|
||||
_ossl_old_des_key_sched((k),(ks))
|
||||
#define des_string_to_key(s,k)\
|
||||
_ossl_old_des_string_to_key((s),(k))
|
||||
#define des_string_to_2keys(s,k1,k2)\
|
||||
_ossl_old_des_string_to_2keys((s),(k1),(k2))
|
||||
#define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
|
||||
_ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))
|
||||
#define des_ofb64_encrypt(i,o,l,ks,iv,n)\
|
||||
_ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))
|
||||
|
||||
|
||||
#define des_ecb2_encrypt(i,o,k1,k2,e) \
|
||||
des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
|
||||
|
||||
#define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
|
||||
des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
|
||||
|
||||
#define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
|
||||
des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
|
||||
|
||||
#define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
|
||||
des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
|
||||
|
||||
#define des_check_key DES_check_key
|
||||
#define des_rw_mode DES_rw_mode
|
||||
#endif
|
||||
|
||||
const char *_ossl_old_des_options(void);
|
||||
void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
|
||||
_ossl_old_des_key_schedule ks1,_ossl_old_des_key_schedule ks2,
|
||||
_ossl_old_des_key_schedule ks3, int enc);
|
||||
DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
|
||||
long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
|
||||
void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
|
||||
_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
|
||||
void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
|
||||
_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
|
||||
void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
|
||||
_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,
|
||||
_ossl_old_des_cblock *inw,_ossl_old_des_cblock *outw,int enc);
|
||||
void _ossl_old_des_cfb_encrypt(unsigned char *in,unsigned char *out,int numbits,
|
||||
long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
|
||||
void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
|
||||
_ossl_old_des_key_schedule ks,int enc);
|
||||
void _ossl_old_des_encrypt(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
|
||||
void _ossl_old_des_encrypt2(DES_LONG *data,_ossl_old_des_key_schedule ks, int enc);
|
||||
void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
|
||||
_ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
|
||||
void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
|
||||
_ossl_old_des_key_schedule ks2, _ossl_old_des_key_schedule ks3);
|
||||
void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, _ossl_old_des_cblock *output,
|
||||
long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
|
||||
_ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int enc);
|
||||
void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,
|
||||
long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
|
||||
_ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num, int enc);
|
||||
void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,
|
||||
long length, _ossl_old_des_key_schedule ks1, _ossl_old_des_key_schedule ks2,
|
||||
_ossl_old_des_key_schedule ks3, _ossl_old_des_cblock *ivec, int *num);
|
||||
|
||||
void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), _ossl_old_des_cblock (*in_white),
|
||||
_ossl_old_des_cblock (*out_white));
|
||||
|
||||
int _ossl_old_des_enc_read(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
|
||||
_ossl_old_des_cblock *iv);
|
||||
int _ossl_old_des_enc_write(int fd,char *buf,int len,_ossl_old_des_key_schedule sched,
|
||||
_ossl_old_des_cblock *iv);
|
||||
char *_ossl_old_des_fcrypt(const char *buf,const char *salt, char *ret);
|
||||
char *_ossl_old_des_crypt(const char *buf,const char *salt);
|
||||
#if !defined(PERL5) && !defined(NeXT)
|
||||
char *_ossl_old_crypt(const char *buf,const char *salt);
|
||||
#endif
|
||||
void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out,
|
||||
int numbits,long length,_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec);
|
||||
void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,long length,
|
||||
_ossl_old_des_key_schedule schedule,_ossl_old_des_cblock *ivec,int enc);
|
||||
DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,_ossl_old_des_cblock *output,
|
||||
long length,int out_count,_ossl_old_des_cblock *seed);
|
||||
void _ossl_old_des_random_seed(_ossl_old_des_cblock key);
|
||||
void _ossl_old_des_random_key(_ossl_old_des_cblock ret);
|
||||
int _ossl_old_des_read_password(_ossl_old_des_cblock *key,const char *prompt,int verify);
|
||||
int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2,
|
||||
const char *prompt,int verify);
|
||||
void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key);
|
||||
int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key);
|
||||
int _ossl_old_des_set_key(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
|
||||
int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,_ossl_old_des_key_schedule schedule);
|
||||
void _ossl_old_des_string_to_key(char *str,_ossl_old_des_cblock *key);
|
||||
void _ossl_old_des_string_to_2keys(char *str,_ossl_old_des_cblock *key1,_ossl_old_des_cblock *key2);
|
||||
void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, long length,
|
||||
_ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num, int enc);
|
||||
void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, long length,
|
||||
_ossl_old_des_key_schedule schedule, _ossl_old_des_cblock *ivec, int *num);
|
||||
|
||||
void _ossl_096_des_random_seed(des_cblock *key);
|
||||
|
||||
/* The following definitions provide compatibility with the MIT Kerberos
|
||||
* library. The _ossl_old_des_key_schedule structure is not binary compatible. */
|
||||
|
||||
#define _KERBEROS_DES_H
|
||||
|
||||
#define KRBDES_ENCRYPT DES_ENCRYPT
|
||||
#define KRBDES_DECRYPT DES_DECRYPT
|
||||
|
||||
#ifdef KERBEROS
|
||||
# define ENCRYPT DES_ENCRYPT
|
||||
# define DECRYPT DES_DECRYPT
|
||||
#endif
|
||||
|
||||
#ifndef NCOMPAT
|
||||
# define C_Block des_cblock
|
||||
# define Key_schedule des_key_schedule
|
||||
# define KEY_SZ DES_KEY_SZ
|
||||
# define string_to_key des_string_to_key
|
||||
# define read_pw_string des_read_pw_string
|
||||
# define random_key des_random_key
|
||||
# define pcbc_encrypt des_pcbc_encrypt
|
||||
# define set_key des_set_key
|
||||
# define key_sched des_key_sched
|
||||
# define ecb_encrypt des_ecb_encrypt
|
||||
# define cbc_encrypt des_cbc_encrypt
|
||||
# define ncbc_encrypt des_ncbc_encrypt
|
||||
# define xcbc_encrypt des_xcbc_encrypt
|
||||
# define cbc_cksum des_cbc_cksum
|
||||
# define quad_cksum des_quad_cksum
|
||||
# define check_parity des_check_key_parity
|
||||
#endif
|
||||
|
||||
#define des_fixup_key_parity DES_fixup_key_parity
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* for DES_read_pw_string et al */
|
||||
#include <openssl/ui_compat.h>
|
||||
|
||||
#endif
|
||||
@ -1,368 +0,0 @@
|
||||
/* dso.h -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
|
||||
* project 2000.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_DSO_H
|
||||
#define HEADER_DSO_H
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* These values are used as commands to DSO_ctrl() */
|
||||
#define DSO_CTRL_GET_FLAGS 1
|
||||
#define DSO_CTRL_SET_FLAGS 2
|
||||
#define DSO_CTRL_OR_FLAGS 3
|
||||
|
||||
/* By default, DSO_load() will translate the provided filename into a form
|
||||
* typical for the platform (more specifically the DSO_METHOD) using the
|
||||
* dso_name_converter function of the method. Eg. win32 will transform "blah"
|
||||
* into "blah.dll", and dlfcn will transform it into "libblah.so". The
|
||||
* behaviour can be overriden by setting the name_converter callback in the DSO
|
||||
* object (using DSO_set_name_converter()). This callback could even utilise
|
||||
* the DSO_METHOD's converter too if it only wants to override behaviour for
|
||||
* one or two possible DSO methods. However, the following flag can be set in a
|
||||
* DSO to prevent *any* native name-translation at all - eg. if the caller has
|
||||
* prompted the user for a path to a driver library so the filename should be
|
||||
* interpreted as-is. */
|
||||
#define DSO_FLAG_NO_NAME_TRANSLATION 0x01
|
||||
/* An extra flag to give if only the extension should be added as
|
||||
* translation. This is obviously only of importance on Unix and
|
||||
* other operating systems where the translation also may prefix
|
||||
* the name with something, like 'lib', and ignored everywhere else.
|
||||
* This flag is also ignored if DSO_FLAG_NO_NAME_TRANSLATION is used
|
||||
* at the same time. */
|
||||
#define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02
|
||||
|
||||
/* The following flag controls the translation of symbol names to upper
|
||||
* case. This is currently only being implemented for OpenVMS.
|
||||
*/
|
||||
#define DSO_FLAG_UPCASE_SYMBOL 0x10
|
||||
|
||||
/* This flag loads the library with public symbols.
|
||||
* Meaning: The exported symbols of this library are public
|
||||
* to all libraries loaded after this library.
|
||||
* At the moment only implemented in unix.
|
||||
*/
|
||||
#define DSO_FLAG_GLOBAL_SYMBOLS 0x20
|
||||
|
||||
|
||||
typedef void (*DSO_FUNC_TYPE)(void);
|
||||
|
||||
typedef struct dso_st DSO;
|
||||
|
||||
/* The function prototype used for method functions (or caller-provided
|
||||
* callbacks) that transform filenames. They are passed a DSO structure pointer
|
||||
* (or NULL if they are to be used independantly of a DSO object) and a
|
||||
* filename to transform. They should either return NULL (if there is an error
|
||||
* condition) or a newly allocated string containing the transformed form that
|
||||
* the caller will need to free with OPENSSL_free() when done. */
|
||||
typedef char* (*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);
|
||||
/* The function prototype used for method functions (or caller-provided
|
||||
* callbacks) that merge two file specifications. They are passed a
|
||||
* DSO structure pointer (or NULL if they are to be used independantly of
|
||||
* a DSO object) and two file specifications to merge. They should
|
||||
* either return NULL (if there is an error condition) or a newly allocated
|
||||
* string containing the result of merging that the caller will need
|
||||
* to free with OPENSSL_free() when done.
|
||||
* Here, merging means that bits and pieces are taken from each of the
|
||||
* file specifications and added together in whatever fashion that is
|
||||
* sensible for the DSO method in question. The only rule that really
|
||||
* applies is that if the two specification contain pieces of the same
|
||||
* type, the copy from the first string takes priority. One could see
|
||||
* it as the first specification is the one given by the user and the
|
||||
* second being a bunch of defaults to add on if they're missing in the
|
||||
* first. */
|
||||
typedef char* (*DSO_MERGER_FUNC)(DSO *, const char *, const char *);
|
||||
|
||||
typedef struct dso_meth_st
|
||||
{
|
||||
const char *name;
|
||||
/* Loads a shared library, NB: new DSO_METHODs must ensure that a
|
||||
* successful load populates the loaded_filename field, and likewise a
|
||||
* successful unload OPENSSL_frees and NULLs it out. */
|
||||
int (*dso_load)(DSO *dso);
|
||||
/* Unloads a shared library */
|
||||
int (*dso_unload)(DSO *dso);
|
||||
/* Binds a variable */
|
||||
void *(*dso_bind_var)(DSO *dso, const char *symname);
|
||||
/* Binds a function - assumes a return type of DSO_FUNC_TYPE.
|
||||
* This should be cast to the real function prototype by the
|
||||
* caller. Platforms that don't have compatible representations
|
||||
* for different prototypes (this is possible within ANSI C)
|
||||
* are highly unlikely to have shared libraries at all, let
|
||||
* alone a DSO_METHOD implemented for them. */
|
||||
DSO_FUNC_TYPE (*dso_bind_func)(DSO *dso, const char *symname);
|
||||
|
||||
/* I don't think this would actually be used in any circumstances. */
|
||||
#if 0
|
||||
/* Unbinds a variable */
|
||||
int (*dso_unbind_var)(DSO *dso, char *symname, void *symptr);
|
||||
/* Unbinds a function */
|
||||
int (*dso_unbind_func)(DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
|
||||
#endif
|
||||
/* The generic (yuck) "ctrl()" function. NB: Negative return
|
||||
* values (rather than zero) indicate errors. */
|
||||
long (*dso_ctrl)(DSO *dso, int cmd, long larg, void *parg);
|
||||
/* The default DSO_METHOD-specific function for converting filenames to
|
||||
* a canonical native form. */
|
||||
DSO_NAME_CONVERTER_FUNC dso_name_converter;
|
||||
/* The default DSO_METHOD-specific function for converting filenames to
|
||||
* a canonical native form. */
|
||||
DSO_MERGER_FUNC dso_merger;
|
||||
|
||||
/* [De]Initialisation handlers. */
|
||||
int (*init)(DSO *dso);
|
||||
int (*finish)(DSO *dso);
|
||||
} DSO_METHOD;
|
||||
|
||||
/**********************************************************************/
|
||||
/* The low-level handle type used to refer to a loaded shared library */
|
||||
|
||||
struct dso_st
|
||||
{
|
||||
DSO_METHOD *meth;
|
||||
/* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS
|
||||
* doesn't use anything but will need to cache the filename
|
||||
* for use in the dso_bind handler. All in all, let each
|
||||
* method control its own destiny. "Handles" and such go in
|
||||
* a STACK. */
|
||||
STACK *meth_data;
|
||||
int references;
|
||||
int flags;
|
||||
/* For use by applications etc ... use this for your bits'n'pieces,
|
||||
* don't touch meth_data! */
|
||||
CRYPTO_EX_DATA ex_data;
|
||||
/* If this callback function pointer is set to non-NULL, then it will
|
||||
* be used in DSO_load() in place of meth->dso_name_converter. NB: This
|
||||
* should normally set using DSO_set_name_converter(). */
|
||||
DSO_NAME_CONVERTER_FUNC name_converter;
|
||||
/* If this callback function pointer is set to non-NULL, then it will
|
||||
* be used in DSO_load() in place of meth->dso_merger. NB: This
|
||||
* should normally set using DSO_set_merger(). */
|
||||
DSO_MERGER_FUNC merger;
|
||||
/* This is populated with (a copy of) the platform-independant
|
||||
* filename used for this DSO. */
|
||||
char *filename;
|
||||
/* This is populated with (a copy of) the translated filename by which
|
||||
* the DSO was actually loaded. It is NULL iff the DSO is not currently
|
||||
* loaded. NB: This is here because the filename translation process
|
||||
* may involve a callback being invoked more than once not only to
|
||||
* convert to a platform-specific form, but also to try different
|
||||
* filenames in the process of trying to perform a load. As such, this
|
||||
* variable can be used to indicate (a) whether this DSO structure
|
||||
* corresponds to a loaded library or not, and (b) the filename with
|
||||
* which it was actually loaded. */
|
||||
char *loaded_filename;
|
||||
};
|
||||
|
||||
|
||||
DSO * DSO_new(void);
|
||||
DSO * DSO_new_method(DSO_METHOD *method);
|
||||
int DSO_free(DSO *dso);
|
||||
int DSO_flags(DSO *dso);
|
||||
int DSO_up_ref(DSO *dso);
|
||||
long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg);
|
||||
|
||||
/* This function sets the DSO's name_converter callback. If it is non-NULL,
|
||||
* then it will be used instead of the associated DSO_METHOD's function. If
|
||||
* oldcb is non-NULL then it is set to the function pointer value being
|
||||
* replaced. Return value is non-zero for success. */
|
||||
int DSO_set_name_converter(DSO *dso, DSO_NAME_CONVERTER_FUNC cb,
|
||||
DSO_NAME_CONVERTER_FUNC *oldcb);
|
||||
/* These functions can be used to get/set the platform-independant filename
|
||||
* used for a DSO. NB: set will fail if the DSO is already loaded. */
|
||||
const char *DSO_get_filename(DSO *dso);
|
||||
int DSO_set_filename(DSO *dso, const char *filename);
|
||||
/* This function will invoke the DSO's name_converter callback to translate a
|
||||
* filename, or if the callback isn't set it will instead use the DSO_METHOD's
|
||||
* converter. If "filename" is NULL, the "filename" in the DSO itself will be
|
||||
* used. If the DSO_FLAG_NO_NAME_TRANSLATION flag is set, then the filename is
|
||||
* simply duplicated. NB: This function is usually called from within a
|
||||
* DSO_METHOD during the processing of a DSO_load() call, and is exposed so that
|
||||
* caller-created DSO_METHODs can do the same thing. A non-NULL return value
|
||||
* will need to be OPENSSL_free()'d. */
|
||||
char *DSO_convert_filename(DSO *dso, const char *filename);
|
||||
/* This function will invoke the DSO's merger callback to merge two file
|
||||
* specifications, or if the callback isn't set it will instead use the
|
||||
* DSO_METHOD's merger. A non-NULL return value will need to be
|
||||
* OPENSSL_free()'d. */
|
||||
char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2);
|
||||
/* If the DSO is currently loaded, this returns the filename that it was loaded
|
||||
* under, otherwise it returns NULL. So it is also useful as a test as to
|
||||
* whether the DSO is currently loaded. NB: This will not necessarily return
|
||||
* the same value as DSO_convert_filename(dso, dso->filename), because the
|
||||
* DSO_METHOD's load function may have tried a variety of filenames (with
|
||||
* and/or without the aid of the converters) before settling on the one it
|
||||
* actually loaded. */
|
||||
const char *DSO_get_loaded_filename(DSO *dso);
|
||||
|
||||
void DSO_set_default_method(DSO_METHOD *meth);
|
||||
DSO_METHOD *DSO_get_default_method(void);
|
||||
DSO_METHOD *DSO_get_method(DSO *dso);
|
||||
DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth);
|
||||
|
||||
/* The all-singing all-dancing load function, you normally pass NULL
|
||||
* for the first and third parameters. Use DSO_up and DSO_free for
|
||||
* subsequent reference count handling. Any flags passed in will be set
|
||||
* in the constructed DSO after its init() function but before the
|
||||
* load operation. If 'dso' is non-NULL, 'flags' is ignored. */
|
||||
DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags);
|
||||
|
||||
/* This function binds to a variable inside a shared library. */
|
||||
void *DSO_bind_var(DSO *dso, const char *symname);
|
||||
|
||||
/* This function binds to a function inside a shared library. */
|
||||
DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname);
|
||||
|
||||
/* This method is the default, but will beg, borrow, or steal whatever
|
||||
* method should be the default on any particular platform (including
|
||||
* DSO_METH_null() if necessary). */
|
||||
DSO_METHOD *DSO_METHOD_openssl(void);
|
||||
|
||||
/* This method is defined for all platforms - if a platform has no
|
||||
* DSO support then this will be the only method! */
|
||||
DSO_METHOD *DSO_METHOD_null(void);
|
||||
|
||||
/* If DSO_DLFCN is defined, the standard dlfcn.h-style functions
|
||||
* (dlopen, dlclose, dlsym, etc) will be used and incorporated into
|
||||
* this method. If not, this method will return NULL. */
|
||||
DSO_METHOD *DSO_METHOD_dlfcn(void);
|
||||
|
||||
/* If DSO_DL is defined, the standard dl.h-style functions (shl_load,
|
||||
* shl_unload, shl_findsym, etc) will be used and incorporated into
|
||||
* this method. If not, this method will return NULL. */
|
||||
DSO_METHOD *DSO_METHOD_dl(void);
|
||||
|
||||
/* If WIN32 is defined, use DLLs. If not, return NULL. */
|
||||
DSO_METHOD *DSO_METHOD_win32(void);
|
||||
|
||||
/* If VMS is defined, use shared images. If not, return NULL. */
|
||||
DSO_METHOD *DSO_METHOD_vms(void);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_DSO_strings(void);
|
||||
|
||||
/* Error codes for the DSO functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define DSO_F_DLFCN_BIND_FUNC 100
|
||||
#define DSO_F_DLFCN_BIND_VAR 101
|
||||
#define DSO_F_DLFCN_LOAD 102
|
||||
#define DSO_F_DLFCN_MERGER 130
|
||||
#define DSO_F_DLFCN_NAME_CONVERTER 123
|
||||
#define DSO_F_DLFCN_UNLOAD 103
|
||||
#define DSO_F_DL_BIND_FUNC 104
|
||||
#define DSO_F_DL_BIND_VAR 105
|
||||
#define DSO_F_DL_LOAD 106
|
||||
#define DSO_F_DL_MERGER 131
|
||||
#define DSO_F_DL_NAME_CONVERTER 124
|
||||
#define DSO_F_DL_UNLOAD 107
|
||||
#define DSO_F_DSO_BIND_FUNC 108
|
||||
#define DSO_F_DSO_BIND_VAR 109
|
||||
#define DSO_F_DSO_CONVERT_FILENAME 126
|
||||
#define DSO_F_DSO_CTRL 110
|
||||
#define DSO_F_DSO_FREE 111
|
||||
#define DSO_F_DSO_GET_FILENAME 127
|
||||
#define DSO_F_DSO_GET_LOADED_FILENAME 128
|
||||
#define DSO_F_DSO_LOAD 112
|
||||
#define DSO_F_DSO_MERGE 132
|
||||
#define DSO_F_DSO_NEW_METHOD 113
|
||||
#define DSO_F_DSO_SET_FILENAME 129
|
||||
#define DSO_F_DSO_SET_NAME_CONVERTER 122
|
||||
#define DSO_F_DSO_UP_REF 114
|
||||
#define DSO_F_VMS_BIND_SYM 115
|
||||
#define DSO_F_VMS_LOAD 116
|
||||
#define DSO_F_VMS_MERGER 133
|
||||
#define DSO_F_VMS_UNLOAD 117
|
||||
#define DSO_F_WIN32_BIND_FUNC 118
|
||||
#define DSO_F_WIN32_BIND_VAR 119
|
||||
#define DSO_F_WIN32_JOINER 135
|
||||
#define DSO_F_WIN32_LOAD 120
|
||||
#define DSO_F_WIN32_MERGER 134
|
||||
#define DSO_F_WIN32_NAME_CONVERTER 125
|
||||
#define DSO_F_WIN32_SPLITTER 136
|
||||
#define DSO_F_WIN32_UNLOAD 121
|
||||
|
||||
/* Reason codes. */
|
||||
#define DSO_R_CTRL_FAILED 100
|
||||
#define DSO_R_DSO_ALREADY_LOADED 110
|
||||
#define DSO_R_EMPTY_FILE_STRUCTURE 113
|
||||
#define DSO_R_FAILURE 114
|
||||
#define DSO_R_FILENAME_TOO_BIG 101
|
||||
#define DSO_R_FINISH_FAILED 102
|
||||
#define DSO_R_INCORRECT_FILE_SYNTAX 115
|
||||
#define DSO_R_LOAD_FAILED 103
|
||||
#define DSO_R_NAME_TRANSLATION_FAILED 109
|
||||
#define DSO_R_NO_FILENAME 111
|
||||
#define DSO_R_NO_FILE_SPECIFICATION 116
|
||||
#define DSO_R_NULL_HANDLE 104
|
||||
#define DSO_R_SET_FILENAME_FAILED 112
|
||||
#define DSO_R_STACK_ERROR 105
|
||||
#define DSO_R_SYM_FAILURE 106
|
||||
#define DSO_R_UNLOAD_FAILED 107
|
||||
#define DSO_R_UNSUPPORTED 108
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@ -1,256 +0,0 @@
|
||||
/* krb5_asn.h */
|
||||
/* Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project,
|
||||
** using ocsp/{*.h,*asn*.c} as a starting point
|
||||
*/
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_KRB5_ASN_H
|
||||
#define HEADER_KRB5_ASN_H
|
||||
|
||||
/*
|
||||
#include <krb5.h>
|
||||
*/
|
||||
#include <openssl/safestack.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* ASN.1 from Kerberos RFC 1510
|
||||
*/
|
||||
|
||||
/* EncryptedData ::= SEQUENCE {
|
||||
** etype[0] INTEGER, -- EncryptionType
|
||||
** kvno[1] INTEGER OPTIONAL,
|
||||
** cipher[2] OCTET STRING -- ciphertext
|
||||
** }
|
||||
*/
|
||||
typedef struct krb5_encdata_st
|
||||
{
|
||||
ASN1_INTEGER *etype;
|
||||
ASN1_INTEGER *kvno;
|
||||
ASN1_OCTET_STRING *cipher;
|
||||
} KRB5_ENCDATA;
|
||||
|
||||
DECLARE_STACK_OF(KRB5_ENCDATA)
|
||||
|
||||
/* PrincipalName ::= SEQUENCE {
|
||||
** name-type[0] INTEGER,
|
||||
** name-string[1] SEQUENCE OF GeneralString
|
||||
** }
|
||||
*/
|
||||
typedef struct krb5_princname_st
|
||||
{
|
||||
ASN1_INTEGER *nametype;
|
||||
STACK_OF(ASN1_GENERALSTRING) *namestring;
|
||||
} KRB5_PRINCNAME;
|
||||
|
||||
DECLARE_STACK_OF(KRB5_PRINCNAME)
|
||||
|
||||
|
||||
/* Ticket ::= [APPLICATION 1] SEQUENCE {
|
||||
** tkt-vno[0] INTEGER,
|
||||
** realm[1] Realm,
|
||||
** sname[2] PrincipalName,
|
||||
** enc-part[3] EncryptedData
|
||||
** }
|
||||
*/
|
||||
typedef struct krb5_tktbody_st
|
||||
{
|
||||
ASN1_INTEGER *tktvno;
|
||||
ASN1_GENERALSTRING *realm;
|
||||
KRB5_PRINCNAME *sname;
|
||||
KRB5_ENCDATA *encdata;
|
||||
} KRB5_TKTBODY;
|
||||
|
||||
typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET;
|
||||
DECLARE_STACK_OF(KRB5_TKTBODY)
|
||||
|
||||
|
||||
/* AP-REQ ::= [APPLICATION 14] SEQUENCE {
|
||||
** pvno[0] INTEGER,
|
||||
** msg-type[1] INTEGER,
|
||||
** ap-options[2] APOptions,
|
||||
** ticket[3] Ticket,
|
||||
** authenticator[4] EncryptedData
|
||||
** }
|
||||
**
|
||||
** APOptions ::= BIT STRING {
|
||||
** reserved(0), use-session-key(1), mutual-required(2) }
|
||||
*/
|
||||
typedef struct krb5_ap_req_st
|
||||
{
|
||||
ASN1_INTEGER *pvno;
|
||||
ASN1_INTEGER *msgtype;
|
||||
ASN1_BIT_STRING *apoptions;
|
||||
KRB5_TICKET *ticket;
|
||||
KRB5_ENCDATA *authenticator;
|
||||
} KRB5_APREQBODY;
|
||||
|
||||
typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ;
|
||||
DECLARE_STACK_OF(KRB5_APREQBODY)
|
||||
|
||||
|
||||
/* Authenticator Stuff */
|
||||
|
||||
|
||||
/* Checksum ::= SEQUENCE {
|
||||
** cksumtype[0] INTEGER,
|
||||
** checksum[1] OCTET STRING
|
||||
** }
|
||||
*/
|
||||
typedef struct krb5_checksum_st
|
||||
{
|
||||
ASN1_INTEGER *ctype;
|
||||
ASN1_OCTET_STRING *checksum;
|
||||
} KRB5_CHECKSUM;
|
||||
|
||||
DECLARE_STACK_OF(KRB5_CHECKSUM)
|
||||
|
||||
|
||||
/* EncryptionKey ::= SEQUENCE {
|
||||
** keytype[0] INTEGER,
|
||||
** keyvalue[1] OCTET STRING
|
||||
** }
|
||||
*/
|
||||
typedef struct krb5_encryptionkey_st
|
||||
{
|
||||
ASN1_INTEGER *ktype;
|
||||
ASN1_OCTET_STRING *keyvalue;
|
||||
} KRB5_ENCKEY;
|
||||
|
||||
DECLARE_STACK_OF(KRB5_ENCKEY)
|
||||
|
||||
|
||||
/* AuthorizationData ::= SEQUENCE OF SEQUENCE {
|
||||
** ad-type[0] INTEGER,
|
||||
** ad-data[1] OCTET STRING
|
||||
** }
|
||||
*/
|
||||
typedef struct krb5_authorization_st
|
||||
{
|
||||
ASN1_INTEGER *adtype;
|
||||
ASN1_OCTET_STRING *addata;
|
||||
} KRB5_AUTHDATA;
|
||||
|
||||
DECLARE_STACK_OF(KRB5_AUTHDATA)
|
||||
|
||||
|
||||
/* -- Unencrypted authenticator
|
||||
** Authenticator ::= [APPLICATION 2] SEQUENCE {
|
||||
** authenticator-vno[0] INTEGER,
|
||||
** crealm[1] Realm,
|
||||
** cname[2] PrincipalName,
|
||||
** cksum[3] Checksum OPTIONAL,
|
||||
** cusec[4] INTEGER,
|
||||
** ctime[5] KerberosTime,
|
||||
** subkey[6] EncryptionKey OPTIONAL,
|
||||
** seq-number[7] INTEGER OPTIONAL,
|
||||
** authorization-data[8] AuthorizationData OPTIONAL
|
||||
** }
|
||||
*/
|
||||
typedef struct krb5_authenticator_st
|
||||
{
|
||||
ASN1_INTEGER *avno;
|
||||
ASN1_GENERALSTRING *crealm;
|
||||
KRB5_PRINCNAME *cname;
|
||||
KRB5_CHECKSUM *cksum;
|
||||
ASN1_INTEGER *cusec;
|
||||
ASN1_GENERALIZEDTIME *ctime;
|
||||
KRB5_ENCKEY *subkey;
|
||||
ASN1_INTEGER *seqnum;
|
||||
KRB5_AUTHDATA *authorization;
|
||||
} KRB5_AUTHENTBODY;
|
||||
|
||||
typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT;
|
||||
DECLARE_STACK_OF(KRB5_AUTHENTBODY)
|
||||
|
||||
|
||||
/* DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) =
|
||||
** type *name##_new(void);
|
||||
** void name##_free(type *a);
|
||||
** DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) =
|
||||
** DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) =
|
||||
** type *d2i_##name(type **a, const unsigned char **in, long len);
|
||||
** int i2d_##name(type *a, unsigned char **out);
|
||||
** DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it
|
||||
*/
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA)
|
||||
DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME)
|
||||
DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY)
|
||||
DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY)
|
||||
DECLARE_ASN1_FUNCTIONS(KRB5_TICKET)
|
||||
DECLARE_ASN1_FUNCTIONS(KRB5_APREQ)
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM)
|
||||
DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY)
|
||||
DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA)
|
||||
DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY)
|
||||
DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT)
|
||||
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -1,179 +0,0 @@
|
||||
/* ssl/kssl.h -*- mode: C; c-file-style: "eay" -*- */
|
||||
/* Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project 2000.
|
||||
* project 2000.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
** 19990701 VRS Started.
|
||||
*/
|
||||
|
||||
#ifndef KSSL_H
|
||||
#define KSSL_H
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
#ifndef OPENSSL_NO_KRB5
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <krb5.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Depending on which KRB5 implementation used, some types from
|
||||
** the other may be missing. Resolve that here and now
|
||||
*/
|
||||
#ifdef KRB5_HEIMDAL
|
||||
typedef unsigned char krb5_octet;
|
||||
#define FAR
|
||||
#else
|
||||
|
||||
#ifndef FAR
|
||||
#define FAR
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* Uncomment this to debug kssl problems or
|
||||
** to trace usage of the Kerberos session key
|
||||
**
|
||||
** #define KSSL_DEBUG
|
||||
*/
|
||||
|
||||
#ifndef KRB5SVC
|
||||
#define KRB5SVC "host"
|
||||
#endif
|
||||
|
||||
#ifndef KRB5KEYTAB
|
||||
#define KRB5KEYTAB "/etc/krb5.keytab"
|
||||
#endif
|
||||
|
||||
#ifndef KRB5SENDAUTH
|
||||
#define KRB5SENDAUTH 1
|
||||
#endif
|
||||
|
||||
#ifndef KRB5CHECKAUTH
|
||||
#define KRB5CHECKAUTH 1
|
||||
#endif
|
||||
|
||||
#ifndef KSSL_CLOCKSKEW
|
||||
#define KSSL_CLOCKSKEW 300;
|
||||
#endif
|
||||
|
||||
#define KSSL_ERR_MAX 255
|
||||
typedef struct kssl_err_st {
|
||||
int reason;
|
||||
char text[KSSL_ERR_MAX+1];
|
||||
} KSSL_ERR;
|
||||
|
||||
|
||||
/* Context for passing
|
||||
** (1) Kerberos session key to SSL, and
|
||||
** (2) Config data between application and SSL lib
|
||||
*/
|
||||
typedef struct kssl_ctx_st
|
||||
{
|
||||
/* used by: disposition: */
|
||||
char *service_name; /* C,S default ok (kssl) */
|
||||
char *service_host; /* C input, REQUIRED */
|
||||
char *client_princ; /* S output from krb5 ticket */
|
||||
char *keytab_file; /* S NULL (/etc/krb5.keytab) */
|
||||
char *cred_cache; /* C NULL (default) */
|
||||
krb5_enctype enctype;
|
||||
int length;
|
||||
krb5_octet FAR *key;
|
||||
} KSSL_CTX;
|
||||
|
||||
#define KSSL_CLIENT 1
|
||||
#define KSSL_SERVER 2
|
||||
#define KSSL_SERVICE 3
|
||||
#define KSSL_KEYTAB 4
|
||||
|
||||
#define KSSL_CTX_OK 0
|
||||
#define KSSL_CTX_ERR 1
|
||||
#define KSSL_NOMEM 2
|
||||
|
||||
/* Public (for use by applications that use OpenSSL with Kerberos 5 support */
|
||||
krb5_error_code kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text);
|
||||
KSSL_CTX *kssl_ctx_new(void);
|
||||
KSSL_CTX *kssl_ctx_free(KSSL_CTX *kssl_ctx);
|
||||
void kssl_ctx_show(KSSL_CTX *kssl_ctx);
|
||||
krb5_error_code kssl_ctx_setprinc(KSSL_CTX *kssl_ctx, int which,
|
||||
krb5_data *realm, krb5_data *entity, int nentities);
|
||||
krb5_error_code kssl_cget_tkt(KSSL_CTX *kssl_ctx, krb5_data **enc_tktp,
|
||||
krb5_data *authenp, KSSL_ERR *kssl_err);
|
||||
krb5_error_code kssl_sget_tkt(KSSL_CTX *kssl_ctx, krb5_data *indata,
|
||||
krb5_ticket_times *ttimes, KSSL_ERR *kssl_err);
|
||||
krb5_error_code kssl_ctx_setkey(KSSL_CTX *kssl_ctx, krb5_keyblock *session);
|
||||
void kssl_err_set(KSSL_ERR *kssl_err, int reason, char *text);
|
||||
void kssl_krb5_free_data_contents(krb5_context context, krb5_data *data);
|
||||
krb5_error_code kssl_build_principal_2(krb5_context context,
|
||||
krb5_principal *princ, int rlen, const char *realm,
|
||||
int slen, const char *svc, int hlen, const char *host);
|
||||
krb5_error_code kssl_validate_times(krb5_timestamp atime,
|
||||
krb5_ticket_times *ttimes);
|
||||
krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp,
|
||||
krb5_timestamp *atimep, KSSL_ERR *kssl_err);
|
||||
unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* OPENSSL_NO_KRB5 */
|
||||
#endif /* KSSL_H */
|
||||
@ -1,147 +0,0 @@
|
||||
/* crypto/pqueue/pqueue_compat.h */
|
||||
/*
|
||||
* DTLS implementation written by Nagendra Modadugu
|
||||
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opensslconf.h"
|
||||
#include <openssl/bn.h>
|
||||
|
||||
/*
|
||||
* The purpose of this header file is for supporting 64-bit integer
|
||||
* manipulation on 32-bit (and lower) machines. Currently the only
|
||||
* such environment is VMS, Utrix and those with smaller default integer
|
||||
* sizes than 32 bits. For all such environment, we fall back to using
|
||||
* BIGNUM. We may need to fine tune the conditions for systems that
|
||||
* are incorrectly configured.
|
||||
*
|
||||
* The only clients of this code are (1) pqueue for priority, and
|
||||
* (2) DTLS, for sequence number manipulation.
|
||||
*/
|
||||
|
||||
#if (defined(THIRTY_TWO_BIT) && !defined(BN_LLONG)) || defined(SIXTEEN_BIT) || defined(EIGHT_BIT)
|
||||
|
||||
#define PQ_64BIT_IS_INTEGER 0
|
||||
#define PQ_64BIT_IS_BIGNUM 1
|
||||
|
||||
#define PQ_64BIT BIGNUM
|
||||
#define PQ_64BIT_CTX BN_CTX
|
||||
|
||||
#define pq_64bit_init(x) BN_init(x)
|
||||
#define pq_64bit_free(x) BN_free(x)
|
||||
|
||||
#define pq_64bit_ctx_new(ctx) BN_CTX_new()
|
||||
#define pq_64bit_ctx_free(x) BN_CTX_free(x)
|
||||
|
||||
#define pq_64bit_assign(x, y) BN_copy(x, y)
|
||||
#define pq_64bit_assign_word(x, y) BN_set_word(x, y)
|
||||
#define pq_64bit_gt(x, y) BN_ucmp(x, y) >= 1 ? 1 : 0
|
||||
#define pq_64bit_eq(x, y) BN_ucmp(x, y) == 0 ? 1 : 0
|
||||
#define pq_64bit_add_word(x, w) BN_add_word(x, w)
|
||||
#define pq_64bit_sub(r, x, y) BN_sub(r, x, y)
|
||||
#define pq_64bit_sub_word(x, w) BN_sub_word(x, w)
|
||||
#define pq_64bit_mod(r, x, n, ctx) BN_mod(r, x, n, ctx)
|
||||
|
||||
#define pq_64bit_bin2num(bn, bytes, len) BN_bin2bn(bytes, len, bn)
|
||||
#define pq_64bit_num2bin(bn, bytes) BN_bn2bin(bn, bytes)
|
||||
#define pq_64bit_get_word(x) BN_get_word(x)
|
||||
#define pq_64bit_is_bit_set(x, offset) BN_is_bit_set(x, offset)
|
||||
#define pq_64bit_lshift(r, x, shift) BN_lshift(r, x, shift)
|
||||
#define pq_64bit_set_bit(x, num) BN_set_bit(x, num)
|
||||
#define pq_64bit_get_length(x) BN_num_bits((x))
|
||||
|
||||
#else
|
||||
|
||||
#define PQ_64BIT_IS_INTEGER 1
|
||||
#define PQ_64BIT_IS_BIGNUM 0
|
||||
|
||||
#if defined(SIXTY_FOUR_BIT)
|
||||
#define PQ_64BIT BN_ULONG
|
||||
#define PQ_64BIT_PRINT "%lld"
|
||||
#elif defined(SIXTY_FOUR_BIT_LONG)
|
||||
#define PQ_64BIT BN_ULONG
|
||||
#define PQ_64BIT_PRINT "%ld"
|
||||
#elif defined(THIRTY_TWO_BIT)
|
||||
#define PQ_64BIT BN_ULLONG
|
||||
#define PQ_64BIT_PRINT "%lld"
|
||||
#endif
|
||||
|
||||
#define PQ_64BIT_CTX void
|
||||
|
||||
#define pq_64bit_init(x)
|
||||
#define pq_64bit_free(x)
|
||||
#define pq_64bit_ctx_new(ctx) (ctx)
|
||||
#define pq_64bit_ctx_free(x)
|
||||
|
||||
#define pq_64bit_assign(x, y) (*(x) = *(y))
|
||||
#define pq_64bit_assign_word(x, y) (*(x) = y)
|
||||
#define pq_64bit_gt(x, y) (*(x) > *(y))
|
||||
#define pq_64bit_eq(x, y) (*(x) == *(y))
|
||||
#define pq_64bit_add_word(x, w) (*(x) = (*(x) + (w)))
|
||||
#define pq_64bit_sub(r, x, y) (*(r) = (*(x) - *(y)))
|
||||
#define pq_64bit_sub_word(x, w) (*(x) = (*(x) - (w)))
|
||||
#define pq_64bit_mod(r, x, n, ctx)
|
||||
|
||||
#define pq_64bit_bin2num(num, bytes, len) bytes_to_long_long(bytes, num)
|
||||
#define pq_64bit_num2bin(num, bytes) long_long_to_bytes(num, bytes)
|
||||
#define pq_64bit_get_word(x) *(x)
|
||||
#define pq_64bit_lshift(r, x, shift) (*(r) = (*(x) << (shift)))
|
||||
#define pq_64bit_set_bit(x, num) do { \
|
||||
PQ_64BIT mask = 1; \
|
||||
mask = mask << (num); \
|
||||
*(x) |= mask; \
|
||||
} while(0)
|
||||
#endif /* OPENSSL_SYS_VMS */
|
||||
@ -1,95 +0,0 @@
|
||||
/* crypto/pqueue/pqueue.h */
|
||||
/*
|
||||
* DTLS implementation written by Nagendra Modadugu
|
||||
* (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_PQUEUE_H
|
||||
#define HEADER_PQUEUE_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/pq_compat.h>
|
||||
|
||||
typedef struct _pqueue *pqueue;
|
||||
|
||||
typedef struct _pitem
|
||||
{
|
||||
PQ_64BIT priority;
|
||||
void *data;
|
||||
struct _pitem *next;
|
||||
} pitem;
|
||||
|
||||
typedef struct _pitem *piterator;
|
||||
|
||||
pitem *pitem_new(PQ_64BIT priority, void *data);
|
||||
void pitem_free(pitem *item);
|
||||
|
||||
pqueue pqueue_new(void);
|
||||
void pqueue_free(pqueue pq);
|
||||
|
||||
pitem *pqueue_insert(pqueue pq, pitem *item);
|
||||
pitem *pqueue_peek(pqueue pq);
|
||||
pitem *pqueue_pop(pqueue pq);
|
||||
pitem *pqueue_find(pqueue pq, PQ_64BIT priority);
|
||||
pitem *pqueue_iterator(pqueue pq);
|
||||
pitem *pqueue_next(piterator *iter);
|
||||
|
||||
void pqueue_print(pqueue pq);
|
||||
|
||||
#endif /* ! HEADER_PQUEUE_H */
|
||||
@ -1,83 +0,0 @@
|
||||
/* ssl/ssl23.h */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef HEADER_SSL23_H
|
||||
#define HEADER_SSL23_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*client */
|
||||
/* write to server */
|
||||
#define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT)
|
||||
#define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT)
|
||||
/* read from server */
|
||||
#define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT)
|
||||
#define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT)
|
||||
|
||||
/* server */
|
||||
/* read from client */
|
||||
#define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT)
|
||||
#define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -1,554 +0,0 @@
|
||||
/* crypto/store/store.h -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
|
||||
* project 2003.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2003 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_STORE_H
|
||||
#define HEADER_STORE_H
|
||||
|
||||
#include <openssl/ossl_typ.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/x509.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Already defined in ossl_typ.h */
|
||||
/* typedef struct store_st STORE; */
|
||||
/* typedef struct store_method_st STORE_METHOD; */
|
||||
|
||||
|
||||
/* All the following functions return 0, a negative number or NULL on error.
|
||||
When everything is fine, they return a positive value or a non-NULL
|
||||
pointer, all depending on their purpose. */
|
||||
|
||||
/* Creators and destructor. */
|
||||
STORE *STORE_new_method(const STORE_METHOD *method);
|
||||
STORE *STORE_new_engine(ENGINE *engine);
|
||||
void STORE_free(STORE *ui);
|
||||
|
||||
|
||||
/* Give a user interface parametrised control commands. This can be used to
|
||||
send down an integer, a data pointer or a function pointer, as well as
|
||||
be used to get information from a STORE. */
|
||||
int STORE_ctrl(STORE *store, int cmd, long i, void *p, void (*f)(void));
|
||||
|
||||
/* A control to set the directory with keys and certificates. Used by the
|
||||
built-in directory level method. */
|
||||
#define STORE_CTRL_SET_DIRECTORY 0x0001
|
||||
/* A control to set a file to load. Used by the built-in file level method. */
|
||||
#define STORE_CTRL_SET_FILE 0x0002
|
||||
/* A control to set a configuration file to load. Can be used by any method
|
||||
that wishes to load a configuration file. */
|
||||
#define STORE_CTRL_SET_CONF_FILE 0x0003
|
||||
/* A control to set a the section of the loaded configuration file. Can be
|
||||
used by any method that wishes to load a configuration file. */
|
||||
#define STORE_CTRL_SET_CONF_SECTION 0x0004
|
||||
|
||||
|
||||
/* Some methods may use extra data */
|
||||
#define STORE_set_app_data(s,arg) STORE_set_ex_data(s,0,arg)
|
||||
#define STORE_get_app_data(s) STORE_get_ex_data(s,0)
|
||||
int STORE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
|
||||
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
|
||||
int STORE_set_ex_data(STORE *r,int idx,void *arg);
|
||||
void *STORE_get_ex_data(STORE *r, int idx);
|
||||
|
||||
/* Use specific methods instead of the built-in one */
|
||||
const STORE_METHOD *STORE_get_method(STORE *store);
|
||||
const STORE_METHOD *STORE_set_method(STORE *store, const STORE_METHOD *meth);
|
||||
|
||||
/* The standard OpenSSL methods. */
|
||||
/* This is the in-memory method. It does everything except revoking and updating,
|
||||
and is of course volatile. It's used by other methods that have an in-memory
|
||||
cache. */
|
||||
const STORE_METHOD *STORE_Memory(void);
|
||||
#if 0 /* Not yet implemented */
|
||||
/* This is the directory store. It does everything except revoking and updating,
|
||||
and uses STORE_Memory() to cache things in memory. */
|
||||
const STORE_METHOD *STORE_Directory(void);
|
||||
/* This is the file store. It does everything except revoking and updating,
|
||||
and uses STORE_Memory() to cache things in memory. Certificates are added
|
||||
to it with the store operation, and it will only get cached certificates. */
|
||||
const STORE_METHOD *STORE_File(void);
|
||||
#endif
|
||||
|
||||
/* Store functions take a type code for the type of data they should store
|
||||
or fetch */
|
||||
typedef enum STORE_object_types
|
||||
{
|
||||
STORE_OBJECT_TYPE_X509_CERTIFICATE= 0x01, /* X509 * */
|
||||
STORE_OBJECT_TYPE_X509_CRL= 0x02, /* X509_CRL * */
|
||||
STORE_OBJECT_TYPE_PRIVATE_KEY= 0x03, /* EVP_PKEY * */
|
||||
STORE_OBJECT_TYPE_PUBLIC_KEY= 0x04, /* EVP_PKEY * */
|
||||
STORE_OBJECT_TYPE_NUMBER= 0x05, /* BIGNUM * */
|
||||
STORE_OBJECT_TYPE_ARBITRARY= 0x06, /* BUF_MEM * */
|
||||
STORE_OBJECT_TYPE_NUM= 0x06 /* The amount of known
|
||||
object types */
|
||||
} STORE_OBJECT_TYPES;
|
||||
/* List of text strings corresponding to the object types. */
|
||||
extern const char * const STORE_object_type_string[STORE_OBJECT_TYPE_NUM+1];
|
||||
|
||||
/* Some store functions take a parameter list. Those parameters come with
|
||||
one of the following codes. The comments following the codes below indicate
|
||||
what type the value should be a pointer to. */
|
||||
typedef enum STORE_params
|
||||
{
|
||||
STORE_PARAM_EVP_TYPE= 0x01, /* int */
|
||||
STORE_PARAM_BITS= 0x02, /* size_t */
|
||||
STORE_PARAM_KEY_PARAMETERS= 0x03, /* ??? */
|
||||
STORE_PARAM_KEY_NO_PARAMETERS= 0x04, /* N/A */
|
||||
STORE_PARAM_AUTH_PASSPHRASE= 0x05, /* char * */
|
||||
STORE_PARAM_AUTH_KRB5_TICKET= 0x06, /* void * */
|
||||
STORE_PARAM_TYPE_NUM= 0x06 /* The amount of known
|
||||
parameter types */
|
||||
} STORE_PARAM_TYPES;
|
||||
/* Parameter value sizes. -1 means unknown, anything else is the required size. */
|
||||
extern const int STORE_param_sizes[STORE_PARAM_TYPE_NUM+1];
|
||||
|
||||
/* Store functions take attribute lists. Those attributes come with codes.
|
||||
The comments following the codes below indicate what type the value should
|
||||
be a pointer to. */
|
||||
typedef enum STORE_attribs
|
||||
{
|
||||
STORE_ATTR_END= 0x00,
|
||||
STORE_ATTR_FRIENDLYNAME= 0x01, /* C string */
|
||||
STORE_ATTR_KEYID= 0x02, /* 160 bit string (SHA1) */
|
||||
STORE_ATTR_ISSUERKEYID= 0x03, /* 160 bit string (SHA1) */
|
||||
STORE_ATTR_SUBJECTKEYID= 0x04, /* 160 bit string (SHA1) */
|
||||
STORE_ATTR_ISSUERSERIALHASH= 0x05, /* 160 bit string (SHA1) */
|
||||
STORE_ATTR_ISSUER= 0x06, /* X509_NAME * */
|
||||
STORE_ATTR_SERIAL= 0x07, /* BIGNUM * */
|
||||
STORE_ATTR_SUBJECT= 0x08, /* X509_NAME * */
|
||||
STORE_ATTR_CERTHASH= 0x09, /* 160 bit string (SHA1) */
|
||||
STORE_ATTR_EMAIL= 0x0a, /* C string */
|
||||
STORE_ATTR_FILENAME= 0x0b, /* C string */
|
||||
STORE_ATTR_TYPE_NUM= 0x0b, /* The amount of known
|
||||
attribute types */
|
||||
STORE_ATTR_OR= 0xff /* This is a special
|
||||
separator, which
|
||||
expresses the OR
|
||||
operation. */
|
||||
} STORE_ATTR_TYPES;
|
||||
/* Attribute value sizes. -1 means unknown, anything else is the required size. */
|
||||
extern const int STORE_attr_sizes[STORE_ATTR_TYPE_NUM+1];
|
||||
|
||||
typedef enum STORE_certificate_status
|
||||
{
|
||||
STORE_X509_VALID= 0x00,
|
||||
STORE_X509_EXPIRED= 0x01,
|
||||
STORE_X509_SUSPENDED= 0x02,
|
||||
STORE_X509_REVOKED= 0x03
|
||||
} STORE_CERTIFICATE_STATUS;
|
||||
|
||||
/* Engine store functions will return a structure that contains all the necessary
|
||||
* information, including revokation status for certificates. This is really not
|
||||
* needed for application authors, as the ENGINE framework functions will extract
|
||||
* the OpenSSL-specific information when at all possible. However, for engine
|
||||
* authors, it's crucial to know this structure. */
|
||||
typedef struct STORE_OBJECT_st
|
||||
{
|
||||
STORE_OBJECT_TYPES type;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
STORE_CERTIFICATE_STATUS status;
|
||||
X509 *certificate;
|
||||
} x509;
|
||||
X509_CRL *crl;
|
||||
EVP_PKEY *key;
|
||||
BIGNUM *number;
|
||||
BUF_MEM *arbitrary;
|
||||
} data;
|
||||
} STORE_OBJECT;
|
||||
DECLARE_STACK_OF(STORE_OBJECT)
|
||||
STORE_OBJECT *STORE_OBJECT_new(void);
|
||||
void STORE_OBJECT_free(STORE_OBJECT *data);
|
||||
|
||||
|
||||
|
||||
/* The following functions handle the storage. They return 0, a negative number
|
||||
or NULL on error, anything else on success. */
|
||||
X509 *STORE_get_certificate(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_store_certificate(STORE *e, X509 *data, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_modify_certificate(STORE *e, OPENSSL_ITEM search_attributes[],
|
||||
OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[],
|
||||
OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
|
||||
int STORE_revoke_certificate(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_delete_certificate(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
void *STORE_list_certificate_start(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
X509 *STORE_list_certificate_next(STORE *e, void *handle);
|
||||
int STORE_list_certificate_end(STORE *e, void *handle);
|
||||
int STORE_list_certificate_endp(STORE *e, void *handle);
|
||||
EVP_PKEY *STORE_generate_key(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
EVP_PKEY *STORE_get_private_key(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_store_private_key(STORE *e, EVP_PKEY *data,
|
||||
OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
|
||||
int STORE_modify_private_key(STORE *e, OPENSSL_ITEM search_attributes[],
|
||||
OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[],
|
||||
OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
|
||||
int STORE_revoke_private_key(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_delete_private_key(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
void *STORE_list_private_key_start(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
EVP_PKEY *STORE_list_private_key_next(STORE *e, void *handle);
|
||||
int STORE_list_private_key_end(STORE *e, void *handle);
|
||||
int STORE_list_private_key_endp(STORE *e, void *handle);
|
||||
EVP_PKEY *STORE_get_public_key(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_store_public_key(STORE *e, EVP_PKEY *data, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_modify_public_key(STORE *e, OPENSSL_ITEM search_attributes[],
|
||||
OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[],
|
||||
OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
|
||||
int STORE_revoke_public_key(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_delete_public_key(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
void *STORE_list_public_key_start(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
EVP_PKEY *STORE_list_public_key_next(STORE *e, void *handle);
|
||||
int STORE_list_public_key_end(STORE *e, void *handle);
|
||||
int STORE_list_public_key_endp(STORE *e, void *handle);
|
||||
X509_CRL *STORE_generate_crl(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
X509_CRL *STORE_get_crl(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_store_crl(STORE *e, X509_CRL *data, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_modify_crl(STORE *e, OPENSSL_ITEM search_attributes[],
|
||||
OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[],
|
||||
OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
|
||||
int STORE_delete_crl(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
void *STORE_list_crl_start(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
X509_CRL *STORE_list_crl_next(STORE *e, void *handle);
|
||||
int STORE_list_crl_end(STORE *e, void *handle);
|
||||
int STORE_list_crl_endp(STORE *e, void *handle);
|
||||
int STORE_store_number(STORE *e, BIGNUM *data, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_modify_number(STORE *e, OPENSSL_ITEM search_attributes[],
|
||||
OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[],
|
||||
OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
|
||||
BIGNUM *STORE_get_number(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_delete_number(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_store_arbitrary(STORE *e, BUF_MEM *data, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_modify_arbitrary(STORE *e, OPENSSL_ITEM search_attributes[],
|
||||
OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[],
|
||||
OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
|
||||
BUF_MEM *STORE_get_arbitrary(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
int STORE_delete_arbitrary(STORE *e, OPENSSL_ITEM attributes[],
|
||||
OPENSSL_ITEM parameters[]);
|
||||
|
||||
|
||||
/* Create and manipulate methods */
|
||||
STORE_METHOD *STORE_create_method(char *name);
|
||||
void STORE_destroy_method(STORE_METHOD *store_method);
|
||||
|
||||
/* These callback types are use for store handlers */
|
||||
typedef int (*STORE_INITIALISE_FUNC_PTR)(STORE *);
|
||||
typedef void (*STORE_CLEANUP_FUNC_PTR)(STORE *);
|
||||
typedef STORE_OBJECT *(*STORE_GENERATE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
|
||||
typedef STORE_OBJECT *(*STORE_GET_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
|
||||
typedef void *(*STORE_START_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
|
||||
typedef STORE_OBJECT *(*STORE_NEXT_OBJECT_FUNC_PTR)(STORE *, void *handle);
|
||||
typedef int (*STORE_END_OBJECT_FUNC_PTR)(STORE *, void *handle);
|
||||
typedef int (*STORE_HANDLE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
|
||||
typedef int (*STORE_STORE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, STORE_OBJECT *data, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
|
||||
typedef int (*STORE_MODIFY_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM search_attributes[], OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[], OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
|
||||
typedef int (*STORE_GENERIC_FUNC_PTR)(STORE *, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
|
||||
typedef int (*STORE_CTRL_FUNC_PTR)(STORE *, int cmd, long l, void *p, void (*f)(void));
|
||||
|
||||
int STORE_method_set_initialise_function(STORE_METHOD *sm, STORE_INITIALISE_FUNC_PTR init_f);
|
||||
int STORE_method_set_cleanup_function(STORE_METHOD *sm, STORE_CLEANUP_FUNC_PTR clean_f);
|
||||
int STORE_method_set_generate_function(STORE_METHOD *sm, STORE_GENERATE_OBJECT_FUNC_PTR generate_f);
|
||||
int STORE_method_set_get_function(STORE_METHOD *sm, STORE_GET_OBJECT_FUNC_PTR get_f);
|
||||
int STORE_method_set_store_function(STORE_METHOD *sm, STORE_STORE_OBJECT_FUNC_PTR store_f);
|
||||
int STORE_method_set_modify_function(STORE_METHOD *sm, STORE_MODIFY_OBJECT_FUNC_PTR store_f);
|
||||
int STORE_method_set_revoke_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR revoke_f);
|
||||
int STORE_method_set_delete_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR delete_f);
|
||||
int STORE_method_set_list_start_function(STORE_METHOD *sm, STORE_START_OBJECT_FUNC_PTR list_start_f);
|
||||
int STORE_method_set_list_next_function(STORE_METHOD *sm, STORE_NEXT_OBJECT_FUNC_PTR list_next_f);
|
||||
int STORE_method_set_list_end_function(STORE_METHOD *sm, STORE_END_OBJECT_FUNC_PTR list_end_f);
|
||||
int STORE_method_set_update_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR);
|
||||
int STORE_method_set_lock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR);
|
||||
int STORE_method_set_unlock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR);
|
||||
int STORE_method_set_ctrl_function(STORE_METHOD *sm, STORE_CTRL_FUNC_PTR ctrl_f);
|
||||
|
||||
STORE_INITIALISE_FUNC_PTR STORE_method_get_initialise_function(STORE_METHOD *sm);
|
||||
STORE_CLEANUP_FUNC_PTR STORE_method_get_cleanup_function(STORE_METHOD *sm);
|
||||
STORE_GENERATE_OBJECT_FUNC_PTR STORE_method_get_generate_function(STORE_METHOD *sm);
|
||||
STORE_GET_OBJECT_FUNC_PTR STORE_method_get_get_function(STORE_METHOD *sm);
|
||||
STORE_STORE_OBJECT_FUNC_PTR STORE_method_get_store_function(STORE_METHOD *sm);
|
||||
STORE_MODIFY_OBJECT_FUNC_PTR STORE_method_get_modify_function(STORE_METHOD *sm);
|
||||
STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_revoke_function(STORE_METHOD *sm);
|
||||
STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_delete_function(STORE_METHOD *sm);
|
||||
STORE_START_OBJECT_FUNC_PTR STORE_method_get_list_start_function(STORE_METHOD *sm);
|
||||
STORE_NEXT_OBJECT_FUNC_PTR STORE_method_get_list_next_function(STORE_METHOD *sm);
|
||||
STORE_END_OBJECT_FUNC_PTR STORE_method_get_list_end_function(STORE_METHOD *sm);
|
||||
STORE_GENERIC_FUNC_PTR STORE_method_get_update_store_function(STORE_METHOD *sm);
|
||||
STORE_GENERIC_FUNC_PTR STORE_method_get_lock_store_function(STORE_METHOD *sm);
|
||||
STORE_GENERIC_FUNC_PTR STORE_method_get_unlock_store_function(STORE_METHOD *sm);
|
||||
STORE_CTRL_FUNC_PTR STORE_method_get_ctrl_function(STORE_METHOD *sm);
|
||||
|
||||
/* Method helper structures and functions. */
|
||||
|
||||
/* This structure is the result of parsing through the information in a list
|
||||
of OPENSSL_ITEMs. It stores all the necessary information in a structured
|
||||
way.*/
|
||||
typedef struct STORE_attr_info_st STORE_ATTR_INFO;
|
||||
|
||||
/* Parse a list of OPENSSL_ITEMs and return a pointer to a STORE_ATTR_INFO.
|
||||
Note that we do this in the list form, since the list of OPENSSL_ITEMs can
|
||||
come in blocks separated with STORE_ATTR_OR. Note that the value returned
|
||||
by STORE_parse_attrs_next() must be freed with STORE_ATTR_INFO_free(). */
|
||||
void *STORE_parse_attrs_start(OPENSSL_ITEM *attributes);
|
||||
STORE_ATTR_INFO *STORE_parse_attrs_next(void *handle);
|
||||
int STORE_parse_attrs_end(void *handle);
|
||||
int STORE_parse_attrs_endp(void *handle);
|
||||
|
||||
/* Creator and destructor */
|
||||
STORE_ATTR_INFO *STORE_ATTR_INFO_new(void);
|
||||
int STORE_ATTR_INFO_free(STORE_ATTR_INFO *attrs);
|
||||
|
||||
/* Manipulators */
|
||||
char *STORE_ATTR_INFO_get0_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code);
|
||||
unsigned char *STORE_ATTR_INFO_get0_sha1str(STORE_ATTR_INFO *attrs,
|
||||
STORE_ATTR_TYPES code);
|
||||
X509_NAME *STORE_ATTR_INFO_get0_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code);
|
||||
BIGNUM *STORE_ATTR_INFO_get0_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code);
|
||||
int STORE_ATTR_INFO_set_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
|
||||
char *cstr, size_t cstr_size);
|
||||
int STORE_ATTR_INFO_set_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
|
||||
unsigned char *sha1str, size_t sha1str_size);
|
||||
int STORE_ATTR_INFO_set_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
|
||||
X509_NAME *dn);
|
||||
int STORE_ATTR_INFO_set_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
|
||||
BIGNUM *number);
|
||||
int STORE_ATTR_INFO_modify_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
|
||||
char *cstr, size_t cstr_size);
|
||||
int STORE_ATTR_INFO_modify_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
|
||||
unsigned char *sha1str, size_t sha1str_size);
|
||||
int STORE_ATTR_INFO_modify_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
|
||||
X509_NAME *dn);
|
||||
int STORE_ATTR_INFO_modify_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
|
||||
BIGNUM *number);
|
||||
|
||||
/* Compare on basis of a bit pattern formed by the STORE_ATTR_TYPES values
|
||||
in each contained attribute. */
|
||||
int STORE_ATTR_INFO_compare(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b);
|
||||
/* Check if the set of attributes in a is within the range of attributes
|
||||
set in b. */
|
||||
int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b);
|
||||
/* Check if the set of attributes in a are also set in b. */
|
||||
int STORE_ATTR_INFO_in(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b);
|
||||
/* Same as STORE_ATTR_INFO_in(), but also checks the attribute values. */
|
||||
int STORE_ATTR_INFO_in_ex(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b);
|
||||
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_STORE_strings(void);
|
||||
|
||||
/* Error codes for the STORE functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define STORE_F_MEM_DELETE 134
|
||||
#define STORE_F_MEM_GENERATE 135
|
||||
#define STORE_F_MEM_LIST_END 168
|
||||
#define STORE_F_MEM_LIST_NEXT 136
|
||||
#define STORE_F_MEM_LIST_START 137
|
||||
#define STORE_F_MEM_MODIFY 169
|
||||
#define STORE_F_MEM_STORE 138
|
||||
#define STORE_F_STORE_ATTR_INFO_GET0_CSTR 139
|
||||
#define STORE_F_STORE_ATTR_INFO_GET0_DN 140
|
||||
#define STORE_F_STORE_ATTR_INFO_GET0_NUMBER 141
|
||||
#define STORE_F_STORE_ATTR_INFO_GET0_SHA1STR 142
|
||||
#define STORE_F_STORE_ATTR_INFO_MODIFY_CSTR 143
|
||||
#define STORE_F_STORE_ATTR_INFO_MODIFY_DN 144
|
||||
#define STORE_F_STORE_ATTR_INFO_MODIFY_NUMBER 145
|
||||
#define STORE_F_STORE_ATTR_INFO_MODIFY_SHA1STR 146
|
||||
#define STORE_F_STORE_ATTR_INFO_SET_CSTR 147
|
||||
#define STORE_F_STORE_ATTR_INFO_SET_DN 148
|
||||
#define STORE_F_STORE_ATTR_INFO_SET_NUMBER 149
|
||||
#define STORE_F_STORE_ATTR_INFO_SET_SHA1STR 150
|
||||
#define STORE_F_STORE_CERTIFICATE 170
|
||||
#define STORE_F_STORE_CTRL 161
|
||||
#define STORE_F_STORE_DELETE_ARBITRARY 158
|
||||
#define STORE_F_STORE_DELETE_CERTIFICATE 102
|
||||
#define STORE_F_STORE_DELETE_CRL 103
|
||||
#define STORE_F_STORE_DELETE_NUMBER 104
|
||||
#define STORE_F_STORE_DELETE_PRIVATE_KEY 105
|
||||
#define STORE_F_STORE_DELETE_PUBLIC_KEY 106
|
||||
#define STORE_F_STORE_GENERATE_CRL 107
|
||||
#define STORE_F_STORE_GENERATE_KEY 108
|
||||
#define STORE_F_STORE_GET_ARBITRARY 159
|
||||
#define STORE_F_STORE_GET_CERTIFICATE 109
|
||||
#define STORE_F_STORE_GET_CRL 110
|
||||
#define STORE_F_STORE_GET_NUMBER 111
|
||||
#define STORE_F_STORE_GET_PRIVATE_KEY 112
|
||||
#define STORE_F_STORE_GET_PUBLIC_KEY 113
|
||||
#define STORE_F_STORE_LIST_CERTIFICATE_END 114
|
||||
#define STORE_F_STORE_LIST_CERTIFICATE_ENDP 153
|
||||
#define STORE_F_STORE_LIST_CERTIFICATE_NEXT 115
|
||||
#define STORE_F_STORE_LIST_CERTIFICATE_START 116
|
||||
#define STORE_F_STORE_LIST_CRL_END 117
|
||||
#define STORE_F_STORE_LIST_CRL_ENDP 154
|
||||
#define STORE_F_STORE_LIST_CRL_NEXT 118
|
||||
#define STORE_F_STORE_LIST_CRL_START 119
|
||||
#define STORE_F_STORE_LIST_PRIVATE_KEY_END 120
|
||||
#define STORE_F_STORE_LIST_PRIVATE_KEY_ENDP 155
|
||||
#define STORE_F_STORE_LIST_PRIVATE_KEY_NEXT 121
|
||||
#define STORE_F_STORE_LIST_PRIVATE_KEY_START 122
|
||||
#define STORE_F_STORE_LIST_PUBLIC_KEY_END 123
|
||||
#define STORE_F_STORE_LIST_PUBLIC_KEY_ENDP 156
|
||||
#define STORE_F_STORE_LIST_PUBLIC_KEY_NEXT 124
|
||||
#define STORE_F_STORE_LIST_PUBLIC_KEY_START 125
|
||||
#define STORE_F_STORE_MODIFY_ARBITRARY 162
|
||||
#define STORE_F_STORE_MODIFY_CERTIFICATE 163
|
||||
#define STORE_F_STORE_MODIFY_CRL 164
|
||||
#define STORE_F_STORE_MODIFY_NUMBER 165
|
||||
#define STORE_F_STORE_MODIFY_PRIVATE_KEY 166
|
||||
#define STORE_F_STORE_MODIFY_PUBLIC_KEY 167
|
||||
#define STORE_F_STORE_NEW_ENGINE 133
|
||||
#define STORE_F_STORE_NEW_METHOD 132
|
||||
#define STORE_F_STORE_PARSE_ATTRS_END 151
|
||||
#define STORE_F_STORE_PARSE_ATTRS_ENDP 172
|
||||
#define STORE_F_STORE_PARSE_ATTRS_NEXT 152
|
||||
#define STORE_F_STORE_PARSE_ATTRS_START 171
|
||||
#define STORE_F_STORE_REVOKE_CERTIFICATE 129
|
||||
#define STORE_F_STORE_REVOKE_PRIVATE_KEY 130
|
||||
#define STORE_F_STORE_REVOKE_PUBLIC_KEY 131
|
||||
#define STORE_F_STORE_STORE_ARBITRARY 157
|
||||
#define STORE_F_STORE_STORE_CERTIFICATE 100
|
||||
#define STORE_F_STORE_STORE_CRL 101
|
||||
#define STORE_F_STORE_STORE_NUMBER 126
|
||||
#define STORE_F_STORE_STORE_PRIVATE_KEY 127
|
||||
#define STORE_F_STORE_STORE_PUBLIC_KEY 128
|
||||
|
||||
/* Reason codes. */
|
||||
#define STORE_R_ALREADY_HAS_A_VALUE 127
|
||||
#define STORE_R_FAILED_DELETING_ARBITRARY 132
|
||||
#define STORE_R_FAILED_DELETING_CERTIFICATE 100
|
||||
#define STORE_R_FAILED_DELETING_KEY 101
|
||||
#define STORE_R_FAILED_DELETING_NUMBER 102
|
||||
#define STORE_R_FAILED_GENERATING_CRL 103
|
||||
#define STORE_R_FAILED_GENERATING_KEY 104
|
||||
#define STORE_R_FAILED_GETTING_ARBITRARY 133
|
||||
#define STORE_R_FAILED_GETTING_CERTIFICATE 105
|
||||
#define STORE_R_FAILED_GETTING_KEY 106
|
||||
#define STORE_R_FAILED_GETTING_NUMBER 107
|
||||
#define STORE_R_FAILED_LISTING_CERTIFICATES 108
|
||||
#define STORE_R_FAILED_LISTING_KEYS 109
|
||||
#define STORE_R_FAILED_MODIFYING_ARBITRARY 138
|
||||
#define STORE_R_FAILED_MODIFYING_CERTIFICATE 139
|
||||
#define STORE_R_FAILED_MODIFYING_CRL 140
|
||||
#define STORE_R_FAILED_MODIFYING_NUMBER 141
|
||||
#define STORE_R_FAILED_MODIFYING_PRIVATE_KEY 142
|
||||
#define STORE_R_FAILED_MODIFYING_PUBLIC_KEY 143
|
||||
#define STORE_R_FAILED_REVOKING_CERTIFICATE 110
|
||||
#define STORE_R_FAILED_REVOKING_KEY 111
|
||||
#define STORE_R_FAILED_STORING_ARBITRARY 134
|
||||
#define STORE_R_FAILED_STORING_CERTIFICATE 112
|
||||
#define STORE_R_FAILED_STORING_KEY 113
|
||||
#define STORE_R_FAILED_STORING_NUMBER 114
|
||||
#define STORE_R_NOT_IMPLEMENTED 128
|
||||
#define STORE_R_NO_CONTROL_FUNCTION 144
|
||||
#define STORE_R_NO_DELETE_ARBITRARY_FUNCTION 135
|
||||
#define STORE_R_NO_DELETE_NUMBER_FUNCTION 115
|
||||
#define STORE_R_NO_DELETE_OBJECT_FUNCTION 116
|
||||
#define STORE_R_NO_GENERATE_CRL_FUNCTION 117
|
||||
#define STORE_R_NO_GENERATE_OBJECT_FUNCTION 118
|
||||
#define STORE_R_NO_GET_OBJECT_ARBITRARY_FUNCTION 136
|
||||
#define STORE_R_NO_GET_OBJECT_FUNCTION 119
|
||||
#define STORE_R_NO_GET_OBJECT_NUMBER_FUNCTION 120
|
||||
#define STORE_R_NO_LIST_OBJECT_ENDP_FUNCTION 131
|
||||
#define STORE_R_NO_LIST_OBJECT_END_FUNCTION 121
|
||||
#define STORE_R_NO_LIST_OBJECT_NEXT_FUNCTION 122
|
||||
#define STORE_R_NO_LIST_OBJECT_START_FUNCTION 123
|
||||
#define STORE_R_NO_MODIFY_OBJECT_FUNCTION 145
|
||||
#define STORE_R_NO_REVOKE_OBJECT_FUNCTION 124
|
||||
#define STORE_R_NO_STORE 129
|
||||
#define STORE_R_NO_STORE_OBJECT_ARBITRARY_FUNCTION 137
|
||||
#define STORE_R_NO_STORE_OBJECT_FUNCTION 125
|
||||
#define STORE_R_NO_STORE_OBJECT_NUMBER_FUNCTION 126
|
||||
#define STORE_R_NO_VALUE 130
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@ -1,93 +0,0 @@
|
||||
/* crypto/tmdiff.h */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
/* Header for dynamic hash table routines
|
||||
* Author - Eric Young
|
||||
*/
|
||||
/* ... erm yeah, "dynamic hash tables" you say?
|
||||
*
|
||||
* And what would dynamic hash tables have to do with any of this code *now*?
|
||||
* AFAICS, this code is only referenced by crypto/bn/exp.c which is an unused
|
||||
* file that I doubt compiles any more. speed.c is the only thing that could
|
||||
* use this (and it has nothing to do with hash tables), yet it instead has its
|
||||
* own duplication of all this stuff and looks, if anything, more complete. See
|
||||
* the corresponding note in apps/speed.c.
|
||||
* The Bemused - Geoff
|
||||
*/
|
||||
|
||||
#ifndef HEADER_TMDIFF_H
|
||||
#define HEADER_TMDIFF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct ms_tm MS_TM;
|
||||
|
||||
MS_TM *ms_time_new(void );
|
||||
void ms_time_free(MS_TM *a);
|
||||
void ms_time_get(MS_TM *a);
|
||||
double ms_time_diff(MS_TM *start, MS_TM *end);
|
||||
int ms_time_cmp(const MS_TM *ap, const MS_TM *bp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,83 +0,0 @@
|
||||
/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */
|
||||
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
|
||||
* project 2001.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2001 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_UI_COMPAT_H
|
||||
#define HEADER_UI_COMPAT_H
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/ui.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* The following functions were previously part of the DES section,
|
||||
and are provided here for backward compatibility reasons. */
|
||||
|
||||
#define des_read_pw_string(b,l,p,v) \
|
||||
_ossl_old_des_read_pw_string((b),(l),(p),(v))
|
||||
#define des_read_pw(b,bf,s,p,v) \
|
||||
_ossl_old_des_read_pw((b),(bf),(s),(p),(v))
|
||||
|
||||
int _ossl_old_des_read_pw_string(char *buf,int length,const char *prompt,int verify);
|
||||
int _ossl_old_des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Loading…
x
Reference in New Issue
Block a user