Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
58aa573a
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
58aa573a
编写于
6月 01, 2006
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add engine table for EVP_PKEY_METHOD. Doesn't do much yet.
上级
0ed110b9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
158 addition
and
4 deletion
+158
-4
CHANGES
CHANGES
+4
-0
crypto/engine/Makefile
crypto/engine/Makefile
+2
-2
crypto/engine/eng_int.h
crypto/engine/eng_int.h
+2
-1
crypto/engine/engine.h
crypto/engine/engine.h
+7
-1
crypto/engine/tb_pkmeth.c
crypto/engine/tb_pkmeth.c
+143
-0
未找到文件。
CHANGES
浏览文件 @
58aa573a
...
...
@@ -4,6 +4,10 @@
Changes between 0.9.8b and 0.9.9 [xx XXX xxxx]
*) Initial engine support for EVP_PKEY_METHOD. New functions to permit
an engine to register a method.
[Steve Henson]
*) New functions EVP_Digest{Sign,Verify)*. These are enchance versions of
EVP_{Sign,Verify}* which allow an application to customise the signature
process.
...
...
crypto/engine/Makefile
浏览文件 @
58aa573a
...
...
@@ -20,12 +20,12 @@ LIB=$(TOP)/libcrypto.a
LIBSRC
=
eng_err.c eng_lib.c eng_list.c eng_init.c eng_ctrl.c
\
eng_table.c eng_pkey.c eng_fat.c eng_all.c
\
tb_rsa.c tb_dsa.c tb_ecdsa.c tb_dh.c tb_ecdh.c tb_rand.c tb_store.c
\
tb_cipher.c tb_digest.c
\
tb_cipher.c tb_digest.c
tb_pkmeth.c
\
eng_openssl.c eng_cnf.c eng_dyn.c eng_cryptodev.c eng_padlock.c
LIBOBJ
=
eng_err.o eng_lib.o eng_list.o eng_init.o eng_ctrl.o
\
eng_table.o eng_pkey.o eng_fat.o eng_all.o
\
tb_rsa.o tb_dsa.o tb_ecdsa.o tb_dh.o tb_ecdh.o tb_rand.o tb_store.o
\
tb_cipher.o tb_digest.o
\
tb_cipher.o tb_digest.o
tb_pkmeth.o
\
eng_openssl.o eng_cnf.o eng_dyn.o eng_cryptodev.o eng_padlock.o
SRC
=
$(LIBSRC)
...
...
crypto/engine/eng_int.h
浏览文件 @
58aa573a
...
...
@@ -160,7 +160,8 @@ struct engine_st
ENGINE_CIPHERS_PTR
ciphers
;
/* Digest handling is via this callback */
ENGINE_DIGESTS_PTR
digests
;
/* Public key handling via this callback */
ENGINE_PKEY_METHS_PTR
pkey_meths
;
ENGINE_GEN_INT_FUNC_PTR
destroy
;
...
...
crypto/engine/engine.h
浏览文件 @
58aa573a
...
...
@@ -292,7 +292,7 @@ typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
* parameter is non-NULL it is set to the size of the returned array. */
typedef
int
(
*
ENGINE_CIPHERS_PTR
)(
ENGINE
*
,
const
EVP_CIPHER
**
,
const
int
**
,
int
);
typedef
int
(
*
ENGINE_DIGESTS_PTR
)(
ENGINE
*
,
const
EVP_MD
**
,
const
int
**
,
int
);
typedef
int
(
*
ENGINE_PKEY_METHS_PTR
)(
ENGINE
*
,
const
EVP_PKEY_METHOD
**
,
const
int
**
,
int
);
/* STRUCTURE functions ... all of these functions deal with pointers to ENGINE
* structures where the pointers have a "structural reference". This means that
* their reference is to allowed access to the structure but it does not imply
...
...
@@ -384,6 +384,10 @@ int ENGINE_register_digests(ENGINE *e);
void
ENGINE_unregister_digests
(
ENGINE
*
e
);
void
ENGINE_register_all_digests
(
void
);
int
ENGINE_register_pkey_meths
(
ENGINE
*
e
);
void
ENGINE_unregister_pkey_meths
(
ENGINE
*
e
);
void
ENGINE_register_all_pkey_meths
(
void
);
/* These functions register all support from the above categories. Note, use of
* these functions can result in static linkage of code your application may not
* need. If you only need a subset of functionality, consider using more
...
...
@@ -496,8 +500,10 @@ ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
ENGINE_LOAD_KEY_PTR
ENGINE_get_load_pubkey_function
(
const
ENGINE
*
e
);
ENGINE_CIPHERS_PTR
ENGINE_get_ciphers
(
const
ENGINE
*
e
);
ENGINE_DIGESTS_PTR
ENGINE_get_digests
(
const
ENGINE
*
e
);
ENGINE_PKEY_METHS_PTR
ENGINE_get_pkey_meths
(
const
ENGINE
*
e
);
const
EVP_CIPHER
*
ENGINE_get_cipher
(
ENGINE
*
e
,
int
nid
);
const
EVP_MD
*
ENGINE_get_digest
(
ENGINE
*
e
,
int
nid
);
const
EVP_PKEY_METHOD
*
ENGINE_get_pkey_meth
(
ENGINE
*
e
,
int
nid
);
const
ENGINE_CMD_DEFN
*
ENGINE_get_cmd_defns
(
const
ENGINE
*
e
);
int
ENGINE_get_flags
(
const
ENGINE
*
e
);
...
...
crypto/engine/tb_pkmeth.c
0 → 100644
浏览文件 @
58aa573a
/* ====================================================================
* Copyright (c) 2006 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).
*
*/
#include "eng_int.h"
/* If this symbol is defined then ENGINE_get_pkey_meth_engine(), the function
* that is used by EVP to hook in pkey_meth code and cache defaults (etc), will
* display brief debugging summaries to stderr with the 'nid'. */
/* #define ENGINE_PKEY_METH_DEBUG */
static
ENGINE_TABLE
*
pkey_meth_table
=
NULL
;
void
ENGINE_unregister_pkey_meths
(
ENGINE
*
e
)
{
engine_table_unregister
(
&
pkey_meth_table
,
e
);
}
static
void
engine_unregister_all_pkey_meths
(
void
)
{
engine_table_cleanup
(
&
pkey_meth_table
);
}
int
ENGINE_register_pkey_meths
(
ENGINE
*
e
)
{
if
(
e
->
pkey_meths
)
{
const
int
*
nids
;
int
num_nids
=
e
->
pkey_meths
(
e
,
NULL
,
&
nids
,
0
);
if
(
num_nids
>
0
)
return
engine_table_register
(
&
pkey_meth_table
,
engine_unregister_all_pkey_meths
,
e
,
nids
,
num_nids
,
0
);
}
return
1
;
}
void
ENGINE_register_all_pkey_meths
()
{
ENGINE
*
e
;
for
(
e
=
ENGINE_get_first
()
;
e
;
e
=
ENGINE_get_next
(
e
))
ENGINE_register_pkey_meths
(
e
);
}
int
ENGINE_set_default_pkey_meths
(
ENGINE
*
e
)
{
if
(
e
->
pkey_meths
)
{
const
int
*
nids
;
int
num_nids
=
e
->
pkey_meths
(
e
,
NULL
,
&
nids
,
0
);
if
(
num_nids
>
0
)
return
engine_table_register
(
&
pkey_meth_table
,
engine_unregister_all_pkey_meths
,
e
,
nids
,
num_nids
,
1
);
}
return
1
;
}
/* Exposed API function to get a functional reference from the implementation
* table (ie. try to get a functional reference from the tabled structural
* references) for a given pkey_meth 'nid' */
ENGINE
*
ENGINE_get_pkey_meth_engine
(
int
nid
)
{
return
engine_table_select
(
&
pkey_meth_table
,
nid
);
}
/* Obtains a pkey_meth implementation from an ENGINE functional reference */
const
EVP_PKEY_METHOD
*
ENGINE_get_pkey_meth
(
ENGINE
*
e
,
int
nid
)
{
const
EVP_PKEY_METHOD
*
ret
;
ENGINE_PKEY_METHS_PTR
fn
=
ENGINE_get_pkey_meths
(
e
);
if
(
!
fn
||
!
fn
(
e
,
&
ret
,
NULL
,
nid
))
{
ENGINEerr
(
ENGINE_F_ENGINE_GET_CIPHER
,
ENGINE_R_UNIMPLEMENTED_CIPHER
);
return
NULL
;
}
return
ret
;
}
/* Gets the pkey_meth callback from an ENGINE structure */
ENGINE_PKEY_METHS_PTR
ENGINE_get_pkey_meths
(
const
ENGINE
*
e
)
{
return
e
->
pkey_meths
;
}
/* Sets the pkey_meth callback in an ENGINE structure */
int
ENGINE_set_pkey_meths
(
ENGINE
*
e
,
ENGINE_PKEY_METHS_PTR
f
)
{
e
->
pkey_meths
=
f
;
return
1
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录