Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
de9fcfe3
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
9
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看板
提交
de9fcfe3
编写于
6月 02, 2006
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Initial public key ASN1 method engine support. Not integrated yet.
上级
7e5b0681
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
178 addition
and
2 deletion
+178
-2
CHANGES
CHANGES
+2
-0
crypto/engine/Makefile
crypto/engine/Makefile
+2
-2
crypto/engine/eng_err.c
crypto/engine/eng_err.c
+1
-0
crypto/engine/eng_int.h
crypto/engine/eng_int.h
+2
-0
crypto/engine/engine.h
crypto/engine/engine.h
+5
-0
crypto/engine/tb_asnmth.c
crypto/engine/tb_asnmth.c
+166
-0
未找到文件。
CHANGES
浏览文件 @
de9fcfe3
...
...
@@ -4,6 +4,8 @@
Changes between 0.9.8b and 0.9.9 [xx XXX xxxx]
*) Initial engine support for EVP_PKEY_ASN1_METHOD.
*) Initial engine support for EVP_PKEY_METHOD. New functions to permit
an engine to register a method. Add ENGINE lookups for methods and
functional reference processing.
...
...
crypto/engine/Makefile
浏览文件 @
de9fcfe3
...
...
@@ -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_pkmeth.c
\
tb_cipher.c tb_digest.c tb_pkmeth.c
tb_asnmth.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_pkmeth.o
\
tb_cipher.o tb_digest.o tb_pkmeth.o
tb_asnmth.o
\
eng_openssl.o eng_cnf.o eng_dyn.o eng_cryptodev.o eng_padlock.o
SRC
=
$(LIBSRC)
...
...
crypto/engine/eng_err.c
浏览文件 @
de9fcfe3
...
...
@@ -86,6 +86,7 @@ static ERR_STRING_DATA ENGINE_str_functs[]=
{
ERR_FUNC
(
ENGINE_F_ENGINE_GET_DEFAULT_TYPE
),
"ENGINE_GET_DEFAULT_TYPE"
},
{
ERR_FUNC
(
ENGINE_F_ENGINE_GET_DIGEST
),
"ENGINE_get_digest"
},
{
ERR_FUNC
(
ENGINE_F_ENGINE_GET_NEXT
),
"ENGINE_get_next"
},
{
ERR_FUNC
(
ENGINE_F_ENGINE_GET_PKEY_ASN1_METH
),
"ENGINE_get_pkey_asn1_meth"
},
{
ERR_FUNC
(
ENGINE_F_ENGINE_GET_PKEY_METH
),
"ENGINE_get_pkey_meth"
},
{
ERR_FUNC
(
ENGINE_F_ENGINE_GET_PREV
),
"ENGINE_get_prev"
},
{
ERR_FUNC
(
ENGINE_F_ENGINE_INIT
),
"ENGINE_init"
},
...
...
crypto/engine/eng_int.h
浏览文件 @
de9fcfe3
...
...
@@ -166,6 +166,8 @@ struct engine_st
ENGINE_DIGESTS_PTR
digests
;
/* Public key handling via this callback */
ENGINE_PKEY_METHS_PTR
pkey_meths
;
/* ASN1 public key handling via this callback */
ENGINE_PKEY_ASN1_METHS_PTR
pkey_asn1_meths
;
ENGINE_GEN_INT_FUNC_PTR
destroy
;
...
...
crypto/engine/engine.h
浏览文件 @
de9fcfe3
...
...
@@ -294,6 +294,7 @@ typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
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
*
,
EVP_PKEY_METHOD
**
,
const
int
**
,
int
);
typedef
int
(
*
ENGINE_PKEY_ASN1_METHS_PTR
)(
ENGINE
*
,
EVP_PKEY_ASN1_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
...
...
@@ -467,6 +468,7 @@ int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
int
ENGINE_set_ciphers
(
ENGINE
*
e
,
ENGINE_CIPHERS_PTR
f
);
int
ENGINE_set_digests
(
ENGINE
*
e
,
ENGINE_DIGESTS_PTR
f
);
int
ENGINE_set_pkey_meths
(
ENGINE
*
e
,
ENGINE_PKEY_METHS_PTR
f
);
int
ENGINE_set_pkey_asn1_meths
(
ENGINE
*
e
,
ENGINE_PKEY_ASN1_METHS_PTR
f
);
int
ENGINE_set_flags
(
ENGINE
*
e
,
int
flags
);
int
ENGINE_set_cmd_defns
(
ENGINE
*
e
,
const
ENGINE_CMD_DEFN
*
defns
);
/* These functions allow control over any per-structure ENGINE data. */
...
...
@@ -503,9 +505,11 @@ 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
);
ENGINE_PKEY_ASN1_METHS_PTR
ENGINE_get_pkey_asn1_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
EVP_PKEY_ASN1_METHOD
*
ENGINE_get_pkey_asn1_meth
(
ENGINE
*
e
,
int
nid
);
const
ENGINE_CMD_DEFN
*
ENGINE_get_cmd_defns
(
const
ENGINE
*
e
);
int
ENGINE_get_flags
(
const
ENGINE
*
e
);
...
...
@@ -727,6 +731,7 @@ void ERR_load_ENGINE_strings(void);
#define ENGINE_F_ENGINE_GET_DEFAULT_TYPE 177
#define ENGINE_F_ENGINE_GET_DIGEST 186
#define ENGINE_F_ENGINE_GET_NEXT 115
#define ENGINE_F_ENGINE_GET_PKEY_ASN1_METH 193
#define ENGINE_F_ENGINE_GET_PKEY_METH 192
#define ENGINE_F_ENGINE_GET_PREV 116
#define ENGINE_F_ENGINE_INIT 119
...
...
crypto/engine/tb_asnmth.c
0 → 100644
浏览文件 @
de9fcfe3
/* ====================================================================
* 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_asn1_meth_engine(), the function
* that is used by EVP to hook in pkey_asn1_meth code and cache defaults (etc), will
* display brief debugging summaries to stderr with the 'nid'. */
/* #define ENGINE_PKEY_ASN1_METH_DEBUG */
static
ENGINE_TABLE
*
pkey_asn1_meth_table
=
NULL
;
void
ENGINE_unregister_pkey_asn1_meths
(
ENGINE
*
e
)
{
engine_table_unregister
(
&
pkey_asn1_meth_table
,
e
);
}
static
void
engine_unregister_all_pkey_asn1_meths
(
void
)
{
engine_table_cleanup
(
&
pkey_asn1_meth_table
);
}
int
ENGINE_register_pkey_asn1_meths
(
ENGINE
*
e
)
{
if
(
e
->
pkey_asn1_meths
)
{
const
int
*
nids
;
int
num_nids
=
e
->
pkey_asn1_meths
(
e
,
NULL
,
&
nids
,
0
);
if
(
num_nids
>
0
)
return
engine_table_register
(
&
pkey_asn1_meth_table
,
engine_unregister_all_pkey_asn1_meths
,
e
,
nids
,
num_nids
,
0
);
}
return
1
;
}
void
ENGINE_register_all_pkey_asn1_meths
()
{
ENGINE
*
e
;
for
(
e
=
ENGINE_get_first
()
;
e
;
e
=
ENGINE_get_next
(
e
))
ENGINE_register_pkey_asn1_meths
(
e
);
}
int
ENGINE_set_default_pkey_asn1_meths
(
ENGINE
*
e
)
{
if
(
e
->
pkey_asn1_meths
)
{
const
int
*
nids
;
int
num_nids
=
e
->
pkey_asn1_meths
(
e
,
NULL
,
&
nids
,
0
);
if
(
num_nids
>
0
)
return
engine_table_register
(
&
pkey_asn1_meth_table
,
engine_unregister_all_pkey_asn1_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_asn1_meth 'nid' */
ENGINE
*
ENGINE_get_pkey_asn1_meth_engine
(
int
nid
)
{
return
engine_table_select
(
&
pkey_asn1_meth_table
,
nid
);
}
/* Obtains a pkey_asn1_meth implementation from an ENGINE functional reference */
const
EVP_PKEY_ASN1_METHOD
*
ENGINE_get_pkey_asn1_meth
(
ENGINE
*
e
,
int
nid
)
{
EVP_PKEY_ASN1_METHOD
*
ret
;
ENGINE_PKEY_ASN1_METHS_PTR
fn
=
ENGINE_get_pkey_asn1_meths
(
e
);
if
(
!
fn
||
!
fn
(
e
,
&
ret
,
NULL
,
nid
))
{
ENGINEerr
(
ENGINE_F_ENGINE_GET_PKEY_ASN1_METH
,
ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD
);
return
NULL
;
}
return
ret
;
}
/* Gets the pkey_asn1_meth callback from an ENGINE structure */
ENGINE_PKEY_ASN1_METHS_PTR
ENGINE_get_pkey_asn1_meths
(
const
ENGINE
*
e
)
{
return
e
->
pkey_asn1_meths
;
}
/* Sets the pkey_asn1_meth callback in an ENGINE structure */
int
ENGINE_set_pkey_asn1_meths
(
ENGINE
*
e
,
ENGINE_PKEY_ASN1_METHS_PTR
f
)
{
e
->
pkey_asn1_meths
=
f
;
return
1
;
}
/* Internal function to free up EVP_PKEY_ASN1_METHOD structures before an
* ENGINE is destroyed
*/
void
engine_pkey_asn1_meths_free
(
ENGINE
*
e
)
{
int
i
;
EVP_PKEY_ASN1_METHOD
*
pkm
;
if
(
e
->
pkey_asn1_meths
)
{
const
int
*
pknids
;
int
npknids
;
npknids
=
e
->
pkey_asn1_meths
(
e
,
NULL
,
&
pknids
,
0
);
for
(
i
=
0
;
i
<
npknids
;
i
++
)
{
if
(
e
->
pkey_asn1_meths
(
e
,
&
pkm
,
NULL
,
pknids
[
i
]))
{
EVP_PKEY_asn1_free
(
pkm
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录