Latest update.

This commit is contained in:
2019-09-21 00:43:47 +09:00
parent 2e57f602ae
commit 62515c7d8d
1131 changed files with 47556 additions and 24957 deletions
+1 -2
View File
@@ -42,8 +42,7 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
push(@INC,"${dir}","${dir}../../crypto/perlasm");
require "x86asm.pl";
$output=pop;
open STDOUT,">$output";
$output=pop and open STDOUT,">$output";
&asm_init($ARGV[0]);
+6 -4
View File
@@ -19,9 +19,10 @@
# Assembler helpers for Padlock engine. See even e_padlock-x86.pl for
# details.
$flavour = shift;
$output = shift;
if ($flavour =~ /\./) { $output = $flavour; undef $flavour; }
# $output is the last argument if it looks like a file (it has an extension)
# $flavour is the first argument if it doesn't look like a file
$output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
$flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
$win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
@@ -30,7 +31,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
( $xlate="${dir}../../crypto/perlasm/x86_64-xlate.pl" and -f $xlate) or
die "can't locate x86_64-xlate.pl";
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\"";
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
$code=".text\n";
+2 -3
View File
@@ -86,7 +86,6 @@ IF[{- !$disabled{"engine"} -}]
GENERATE[ossltest.ld]=../util/engines.num
ENDIF
ENDIF
GENERATE[e_padlock-x86.s]=asm/e_padlock-x86.pl \
$(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS) $(PROCESSOR)
GENERATE[e_padlock-x86_64.s]=asm/e_padlock-x86_64.pl $(PERLASM_SCHEME)
GENERATE[e_padlock-x86.s]=asm/e_padlock-x86.pl
GENERATE[e_padlock-x86_64.s]=asm/e_padlock-x86_64.pl
ENDIF
+20 -10
View File
@@ -63,9 +63,6 @@ void engine_load_afalg_int(void)
# define ALG_OP_TYPE unsigned int
# define ALG_OP_LEN (sizeof(ALG_OP_TYPE))
#define ALG_MAX_SALG_NAME 64
#define ALG_MAX_SALG_TYPE 14
# ifdef OPENSSL_NO_DYNAMIC_ENGINE
void engine_load_afalg_int(void);
# endif
@@ -128,7 +125,23 @@ static ossl_inline int io_getevents(aio_context_t ctx, long min, long max,
struct io_event *events,
struct timespec *timeout)
{
#if defined(__NR_io_getevents)
return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
#elif defined(__NR_io_pgetevents_time64)
/* Let's only support the 64 suffix syscalls for 64-bit time_t.
* This simplifies the code for us as we don't need to use a 64-bit
* version of timespec with a 32-bit time_t and handle converting
* between 64-bit and 32-bit times and check for overflows.
*/
if (sizeof(timeout->tv_sec) == 8)
return syscall(__NR_io_pgetevents_time64, ctx, min, max, events, timeout, NULL);
else {
errno = ENOSYS;
return -1;
}
#else
# error "We require either the io_getevents syscall or __NR_io_pgetevents_time64."
#endif
}
static void afalg_waitfd_cleanup(ASYNC_WAIT_CTX *ctx, const void *key,
@@ -371,10 +384,8 @@ static int afalg_create_sk(afalg_ctx *actx, const char *ciphertype,
memset(&sa, 0, sizeof(sa));
sa.salg_family = AF_ALG;
strncpy((char *) sa.salg_type, ciphertype, ALG_MAX_SALG_TYPE);
sa.salg_type[ALG_MAX_SALG_TYPE-1] = '\0';
strncpy((char *) sa.salg_name, ciphername, ALG_MAX_SALG_NAME);
sa.salg_name[ALG_MAX_SALG_NAME-1] = '\0';
OPENSSL_strlcpy((char *) sa.salg_type, ciphertype, sizeof(sa.salg_type));
OPENSSL_strlcpy((char *) sa.salg_name, ciphername, sizeof(sa.salg_name));
actx->bfd = socket(AF_ALG, SOCK_SEQPACKET, 0);
if (actx->bfd == -1) {
@@ -503,7 +514,7 @@ static int afalg_cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
int ciphertype;
int ret;
afalg_ctx *actx;
char ciphername[ALG_MAX_SALG_NAME];
const char *ciphername;
if (ctx == NULL || key == NULL) {
ALG_WARN("%s(%d): Null Parameter\n", __FILE__, __LINE__);
@@ -526,14 +537,13 @@ static int afalg_cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
case NID_aes_128_cbc:
case NID_aes_192_cbc:
case NID_aes_256_cbc:
strncpy(ciphername, "cbc(aes)", ALG_MAX_SALG_NAME);
ciphername = "cbc(aes)";
break;
default:
ALG_WARN("%s(%d): Unsupported Cipher type %d\n", __FILE__, __LINE__,
ciphertype);
return 0;
}
ciphername[ALG_MAX_SALG_NAME-1]='\0';
if (ALG_AES_IV_LEN != EVP_CIPHER_CTX_iv_length(ctx)) {
ALG_WARN("%s(%d): Unsupported IV length :%d\n", __FILE__, __LINE__,
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
+3 -15
View File
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -13,17 +13,6 @@
#ifndef OPENSSL_NO_ERR
static ERR_STRING_DATA AFALG_str_functs[] = {
{ERR_PACK(0, AFALG_F_AFALG_CHK_PLATFORM, 0), "afalg_chk_platform"},
{ERR_PACK(0, AFALG_F_AFALG_CREATE_SK, 0), "afalg_create_sk"},
{ERR_PACK(0, AFALG_F_AFALG_INIT_AIO, 0), "afalg_init_aio"},
{ERR_PACK(0, AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION, 0),
"afalg_setup_async_event_notification"},
{ERR_PACK(0, AFALG_F_AFALG_SET_KEY, 0), "afalg_set_key"},
{ERR_PACK(0, AFALG_F_BIND_AFALG, 0), "bind_afalg"},
{0, NULL}
};
static ERR_STRING_DATA AFALG_str_reasons[] = {
{ERR_PACK(0, 0, AFALG_R_EVENTFD_FAILED), "eventfd failed"},
{ERR_PACK(0, 0, AFALG_R_FAILED_TO_GET_PLATFORM_INFO),
@@ -56,7 +45,6 @@ static int ERR_load_AFALG_strings(void)
if (!error_loaded) {
#ifndef OPENSSL_NO_ERR
ERR_load_strings(lib_code, AFALG_str_functs);
ERR_load_strings(lib_code, AFALG_str_reasons);
#endif
error_loaded = 1;
@@ -68,7 +56,6 @@ static void ERR_unload_AFALG_strings(void)
{
if (error_loaded) {
#ifndef OPENSSL_NO_ERR
ERR_unload_strings(lib_code, AFALG_str_functs);
ERR_unload_strings(lib_code, AFALG_str_reasons);
#endif
error_loaded = 0;
@@ -79,5 +66,6 @@ static void ERR_AFALG_error(int function, int reason, char *file, int line)
{
if (lib_code == 0)
lib_code = ERR_get_next_error_library();
ERR_PUT_error(lib_code, function, reason, file, line);
ERR_raise(lib_code, reason);
ERR_set_debug(file, line, NULL);
}
+14 -8
View File
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -11,18 +11,24 @@
#ifndef HEADER_AFALGERR_H
# define HEADER_AFALGERR_H
# define AFALGerr(f, r) ERR_AFALG_error((f), (r), OPENSSL_FILE, OPENSSL_LINE)
# include <openssl/opensslconf.h>
# include <openssl/symhacks.h>
# define AFALGerr(f, r) ERR_AFALG_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
/*
* AFALG function codes.
*/
# define AFALG_F_AFALG_CHK_PLATFORM 100
# define AFALG_F_AFALG_CREATE_SK 101
# define AFALG_F_AFALG_INIT_AIO 102
# define AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION 103
# define AFALG_F_AFALG_SET_KEY 104
# define AFALG_F_BIND_AFALG 105
# if !OPENSSL_API_3
# define AFALG_F_AFALG_CHK_PLATFORM 0
# define AFALG_F_AFALG_CREATE_SK 0
# define AFALG_F_AFALG_INIT_AIO 0
# define AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION 0
# define AFALG_F_AFALG_SET_KEY 0
# define AFALG_F_BIND_AFALG 0
# endif
/*
* AFALG reason codes.
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
+3 -28
View File
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -13,30 +13,6 @@
#ifndef OPENSSL_NO_ERR
static ERR_STRING_DATA CAPI_str_functs[] = {
{ERR_PACK(0, CAPI_F_CAPI_CERT_GET_FNAME, 0), "capi_cert_get_fname"},
{ERR_PACK(0, CAPI_F_CAPI_CTRL, 0), "capi_ctrl"},
{ERR_PACK(0, CAPI_F_CAPI_CTX_NEW, 0), "capi_ctx_new"},
{ERR_PACK(0, CAPI_F_CAPI_CTX_SET_PROVNAME, 0), "capi_ctx_set_provname"},
{ERR_PACK(0, CAPI_F_CAPI_DSA_DO_SIGN, 0), "capi_dsa_do_sign"},
{ERR_PACK(0, CAPI_F_CAPI_GET_KEY, 0), "capi_get_key"},
{ERR_PACK(0, CAPI_F_CAPI_GET_PKEY, 0), "capi_get_pkey"},
{ERR_PACK(0, CAPI_F_CAPI_GET_PROVNAME, 0), "capi_get_provname"},
{ERR_PACK(0, CAPI_F_CAPI_GET_PROV_INFO, 0), "capi_get_prov_info"},
{ERR_PACK(0, CAPI_F_CAPI_INIT, 0), "capi_init"},
{ERR_PACK(0, CAPI_F_CAPI_LIST_CONTAINERS, 0), "capi_list_containers"},
{ERR_PACK(0, CAPI_F_CAPI_LOAD_PRIVKEY, 0), "capi_load_privkey"},
{ERR_PACK(0, CAPI_F_CAPI_OPEN_STORE, 0), "capi_open_store"},
{ERR_PACK(0, CAPI_F_CAPI_RSA_PRIV_DEC, 0), "capi_rsa_priv_dec"},
{ERR_PACK(0, CAPI_F_CAPI_RSA_PRIV_ENC, 0), "capi_rsa_priv_enc"},
{ERR_PACK(0, CAPI_F_CAPI_RSA_SIGN, 0), "capi_rsa_sign"},
{ERR_PACK(0, CAPI_F_CAPI_VTRACE, 0), "capi_vtrace"},
{ERR_PACK(0, CAPI_F_CERT_SELECT_DIALOG, 0), "cert_select_dialog"},
{ERR_PACK(0, CAPI_F_CLIENT_CERT_SELECT, 0), ""},
{ERR_PACK(0, CAPI_F_WIDE_TO_ASC, 0), "wide_to_asc"},
{0, NULL}
};
static ERR_STRING_DATA CAPI_str_reasons[] = {
{ERR_PACK(0, 0, CAPI_R_CANT_CREATE_HASH_OBJECT), "cant create hash object"},
{ERR_PACK(0, 0, CAPI_R_CANT_FIND_CAPI_CONTEXT), "cant find capi context"},
@@ -92,7 +68,6 @@ static int ERR_load_CAPI_strings(void)
if (!error_loaded) {
#ifndef OPENSSL_NO_ERR
ERR_load_strings(lib_code, CAPI_str_functs);
ERR_load_strings(lib_code, CAPI_str_reasons);
#endif
error_loaded = 1;
@@ -104,7 +79,6 @@ static void ERR_unload_CAPI_strings(void)
{
if (error_loaded) {
#ifndef OPENSSL_NO_ERR
ERR_unload_strings(lib_code, CAPI_str_functs);
ERR_unload_strings(lib_code, CAPI_str_reasons);
#endif
error_loaded = 0;
@@ -115,5 +89,6 @@ static void ERR_CAPI_error(int function, int reason, char *file, int line)
{
if (lib_code == 0)
lib_code = ERR_get_next_error_library();
ERR_PUT_error(lib_code, function, reason, file, line);
ERR_raise(lib_code, reason);
ERR_set_debug(file, line, NULL);
}
+28 -22
View File
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -11,32 +11,38 @@
#ifndef HEADER_CAPIERR_H
# define HEADER_CAPIERR_H
# define CAPIerr(f, r) ERR_CAPI_error((f), (r), OPENSSL_FILE, OPENSSL_LINE)
# include <openssl/opensslconf.h>
# include <openssl/symhacks.h>
# define CAPIerr(f, r) ERR_CAPI_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
/*
* CAPI function codes.
*/
# define CAPI_F_CAPI_CERT_GET_FNAME 99
# define CAPI_F_CAPI_CTRL 100
# define CAPI_F_CAPI_CTX_NEW 101
# define CAPI_F_CAPI_CTX_SET_PROVNAME 102
# define CAPI_F_CAPI_DSA_DO_SIGN 114
# define CAPI_F_CAPI_GET_KEY 103
# define CAPI_F_CAPI_GET_PKEY 115
# define CAPI_F_CAPI_GET_PROVNAME 104
# define CAPI_F_CAPI_GET_PROV_INFO 105
# define CAPI_F_CAPI_INIT 106
# define CAPI_F_CAPI_LIST_CONTAINERS 107
# define CAPI_F_CAPI_LOAD_PRIVKEY 108
# define CAPI_F_CAPI_OPEN_STORE 109
# define CAPI_F_CAPI_RSA_PRIV_DEC 110
# define CAPI_F_CAPI_RSA_PRIV_ENC 111
# define CAPI_F_CAPI_RSA_SIGN 112
# define CAPI_F_CAPI_VTRACE 118
# define CAPI_F_CERT_SELECT_DIALOG 117
# define CAPI_F_CLIENT_CERT_SELECT 116
# define CAPI_F_WIDE_TO_ASC 113
# if !OPENSSL_API_3
# define CAPI_F_CAPI_CERT_GET_FNAME 0
# define CAPI_F_CAPI_CTRL 0
# define CAPI_F_CAPI_CTX_NEW 0
# define CAPI_F_CAPI_CTX_SET_PROVNAME 0
# define CAPI_F_CAPI_DSA_DO_SIGN 0
# define CAPI_F_CAPI_GET_KEY 0
# define CAPI_F_CAPI_GET_PKEY 0
# define CAPI_F_CAPI_GET_PROVNAME 0
# define CAPI_F_CAPI_GET_PROV_INFO 0
# define CAPI_F_CAPI_INIT 0
# define CAPI_F_CAPI_LIST_CONTAINERS 0
# define CAPI_F_CAPI_LOAD_PRIVKEY 0
# define CAPI_F_CAPI_OPEN_STORE 0
# define CAPI_F_CAPI_RSA_PRIV_DEC 0
# define CAPI_F_CAPI_RSA_PRIV_ENC 0
# define CAPI_F_CAPI_RSA_SIGN 0
# define CAPI_F_CAPI_VTRACE 0
# define CAPI_F_CERT_SELECT_DIALOG 0
# define CAPI_F_CLIENT_CERT_SELECT 0
# define CAPI_F_WIDE_TO_ASC 0
# endif
/*
* CAPI reason codes.
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
+3 -20
View File
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -13,22 +13,6 @@
#ifndef OPENSSL_NO_ERR
static ERR_STRING_DATA DASYNC_str_functs[] = {
{ERR_PACK(0, DASYNC_F_BIND_DASYNC, 0), "bind_dasync"},
{ERR_PACK(0, DASYNC_F_CIPHER_AES_128_CBC_CODE, 0), ""},
{ERR_PACK(0, DASYNC_F_DASYNC_AES128_CBC_HMAC_SHA1_INIT_KEY, 0), ""},
{ERR_PACK(0, DASYNC_F_DASYNC_AES128_INIT_KEY, 0), ""},
{ERR_PACK(0, DASYNC_F_DASYNC_BN_MOD_EXP, 0), ""},
{ERR_PACK(0, DASYNC_F_DASYNC_CIPHER_INIT_KEY_HELPER, 0),
"dasync_cipher_init_key_helper"},
{ERR_PACK(0, DASYNC_F_DASYNC_MOD_EXP, 0), ""},
{ERR_PACK(0, DASYNC_F_DASYNC_PRIVATE_DECRYPT, 0), ""},
{ERR_PACK(0, DASYNC_F_DASYNC_PRIVATE_ENCRYPT, 0), ""},
{ERR_PACK(0, DASYNC_F_DASYNC_PUBLIC_DECRYPT, 0), ""},
{ERR_PACK(0, DASYNC_F_DASYNC_PUBLIC_ENCRYPT, 0), ""},
{0, NULL}
};
static ERR_STRING_DATA DASYNC_str_reasons[] = {
{ERR_PACK(0, 0, DASYNC_R_INIT_FAILED), "init failed"},
{0, NULL}
@@ -46,7 +30,6 @@ static int ERR_load_DASYNC_strings(void)
if (!error_loaded) {
#ifndef OPENSSL_NO_ERR
ERR_load_strings(lib_code, DASYNC_str_functs);
ERR_load_strings(lib_code, DASYNC_str_reasons);
#endif
error_loaded = 1;
@@ -58,7 +41,6 @@ static void ERR_unload_DASYNC_strings(void)
{
if (error_loaded) {
#ifndef OPENSSL_NO_ERR
ERR_unload_strings(lib_code, DASYNC_str_functs);
ERR_unload_strings(lib_code, DASYNC_str_reasons);
#endif
error_loaded = 0;
@@ -69,5 +51,6 @@ static void ERR_DASYNC_error(int function, int reason, char *file, int line)
{
if (lib_code == 0)
lib_code = ERR_get_next_error_library();
ERR_PUT_error(lib_code, function, reason, file, line);
ERR_raise(lib_code, reason);
ERR_set_debug(file, line, NULL);
}
+19 -13
View File
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -11,23 +11,29 @@
#ifndef HEADER_DASYNCERR_H
# define HEADER_DASYNCERR_H
# define DASYNCerr(f, r) ERR_DASYNC_error((f), (r), OPENSSL_FILE, OPENSSL_LINE)
# include <openssl/opensslconf.h>
# include <openssl/symhacks.h>
# define DASYNCerr(f, r) ERR_DASYNC_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
/*
* DASYNC function codes.
*/
# define DASYNC_F_BIND_DASYNC 107
# define DASYNC_F_CIPHER_AES_128_CBC_CODE 100
# define DASYNC_F_DASYNC_AES128_CBC_HMAC_SHA1_INIT_KEY 109
# define DASYNC_F_DASYNC_AES128_INIT_KEY 108
# define DASYNC_F_DASYNC_BN_MOD_EXP 101
# define DASYNC_F_DASYNC_CIPHER_INIT_KEY_HELPER 110
# define DASYNC_F_DASYNC_MOD_EXP 102
# define DASYNC_F_DASYNC_PRIVATE_DECRYPT 103
# define DASYNC_F_DASYNC_PRIVATE_ENCRYPT 104
# define DASYNC_F_DASYNC_PUBLIC_DECRYPT 105
# define DASYNC_F_DASYNC_PUBLIC_ENCRYPT 106
# if !OPENSSL_API_3
# define DASYNC_F_BIND_DASYNC 0
# define DASYNC_F_CIPHER_AES_128_CBC_CODE 0
# define DASYNC_F_DASYNC_AES128_CBC_HMAC_SHA1_INIT_KEY 0
# define DASYNC_F_DASYNC_AES128_INIT_KEY 0
# define DASYNC_F_DASYNC_BN_MOD_EXP 0
# define DASYNC_F_DASYNC_CIPHER_INIT_KEY_HELPER 0
# define DASYNC_F_DASYNC_MOD_EXP 0
# define DASYNC_F_DASYNC_PRIVATE_DECRYPT 0
# define DASYNC_F_DASYNC_PRIVATE_ENCRYPT 0
# define DASYNC_F_DASYNC_PUBLIC_DECRYPT 0
# define DASYNC_F_DASYNC_PUBLIC_ENCRYPT 0
# endif
/*
* DASYNC reason codes.
+8 -8
View File
@@ -72,7 +72,7 @@ void engine_load_devcrypto_int(void);
static int clean_devcrypto_session(struct session_op *sess) {
if (ioctl(cfd, CIOCFSESSION, &sess->ses) < 0) {
SYSerr(SYS_F_IOCTL, errno);
ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
return 0;
}
memset(sess, 0, sizeof(struct session_op));
@@ -208,7 +208,7 @@ static int cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
cipher_ctx->mode = cipher_d->flags & EVP_CIPH_MODE;
cipher_ctx->blocksize = cipher_d->blocksize;
if (ioctl(cfd, CIOCGSESSION, &cipher_ctx->sess) < 0) {
SYSerr(SYS_F_IOCTL, errno);
ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
return 0;
}
@@ -260,7 +260,7 @@ static int cipher_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
#endif
if (ioctl(cfd, CIOCCRYPT, &cryp) < 0) {
SYSerr(SYS_F_IOCTL, errno);
ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
return 0;
}
@@ -704,7 +704,7 @@ static int digest_init(EVP_MD_CTX *ctx)
memset(&digest_ctx->sess, 0, sizeof(digest_ctx->sess));
digest_ctx->sess.mac = digest_d->devcryptoid;
if (ioctl(cfd, CIOCGSESSION, &digest_ctx->sess) < 0) {
SYSerr(SYS_F_IOCTL, errno);
ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
return 0;
}
return 1;
@@ -743,7 +743,7 @@ static int digest_update(EVP_MD_CTX *ctx, const void *data, size_t count)
return 1;
}
SYSerr(SYS_F_IOCTL, errno);
ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
return 0;
}
@@ -758,7 +758,7 @@ static int digest_final(EVP_MD_CTX *ctx, unsigned char *md)
if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT)) {
memcpy(md, digest_ctx->digest_res, EVP_MD_CTX_size(ctx));
} else if (digest_op(digest_ctx, NULL, 0, md, COP_FLAG_FINAL) < 0) {
SYSerr(SYS_F_IOCTL, errno);
ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
return 0;
}
@@ -777,14 +777,14 @@ static int digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
return 1;
if (!digest_init(to)) {
SYSerr(SYS_F_IOCTL, errno);
ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
return 0;
}
cphash.src_ses = digest_from->sess.ses;
cphash.dst_ses = digest_to->sess.ses;
if (ioctl(cfd, CIOCCPHASH, &cphash) < 0) {
SYSerr(SYS_F_IOCTL, errno);
ERR_raise_data(ERR_LIB_SYS, errno, "calling ioctl()");
return 0;
}
return 1;
+1 -1
View File
@@ -1,4 +1,4 @@
# Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved.
# Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
+3 -10
View File
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -13,12 +13,6 @@
#ifndef OPENSSL_NO_ERR
static ERR_STRING_DATA OSSLTEST_str_functs[] = {
{ERR_PACK(0, OSSLTEST_F_BIND_OSSLTEST, 0), "bind_ossltest"},
{ERR_PACK(0, OSSLTEST_F_OSSLTEST_AES128_INIT_KEY, 0), ""},
{0, NULL}
};
static ERR_STRING_DATA OSSLTEST_str_reasons[] = {
{ERR_PACK(0, 0, OSSLTEST_R_INIT_FAILED), "init failed"},
{0, NULL}
@@ -36,7 +30,6 @@ static int ERR_load_OSSLTEST_strings(void)
if (!error_loaded) {
#ifndef OPENSSL_NO_ERR
ERR_load_strings(lib_code, OSSLTEST_str_functs);
ERR_load_strings(lib_code, OSSLTEST_str_reasons);
#endif
error_loaded = 1;
@@ -48,7 +41,6 @@ static void ERR_unload_OSSLTEST_strings(void)
{
if (error_loaded) {
#ifndef OPENSSL_NO_ERR
ERR_unload_strings(lib_code, OSSLTEST_str_functs);
ERR_unload_strings(lib_code, OSSLTEST_str_reasons);
#endif
error_loaded = 0;
@@ -59,5 +51,6 @@ static void ERR_OSSLTEST_error(int function, int reason, char *file, int line)
{
if (lib_code == 0)
lib_code = ERR_get_next_error_library();
ERR_PUT_error(lib_code, function, reason, file, line);
ERR_raise(lib_code, reason);
ERR_set_debug(file, line, NULL);
}
+10 -4
View File
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -11,14 +11,20 @@
#ifndef HEADER_OSSLTESTERR_H
# define HEADER_OSSLTESTERR_H
# define OSSLTESTerr(f, r) ERR_OSSLTEST_error((f), (r), OPENSSL_FILE, OPENSSL_LINE)
# include <openssl/opensslconf.h>
# include <openssl/symhacks.h>
# define OSSLTESTerr(f, r) ERR_OSSLTEST_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
/*
* OSSLTEST function codes.
*/
# define OSSLTEST_F_BIND_OSSLTEST 100
# define OSSLTEST_F_OSSLTEST_AES128_INIT_KEY 101
# if !OPENSSL_API_3
# define OSSLTEST_F_BIND_OSSLTEST 0
# define OSSLTEST_F_OSSLTEST_AES128_INIT_KEY 0
# endif
/*
* OSSLTEST reason codes.