Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
c85a1578
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c85a1578
编写于
11月 15, 2001
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use the generated error code files.
上级
0c5d16e4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
91 deletion
+5
-91
demos/engines/rsaref/rsaref.c
demos/engines/rsaref/rsaref.c
+5
-91
未找到文件。
demos/engines/rsaref/rsaref.c
浏览文件 @
c85a1578
...
...
@@ -10,6 +10,9 @@
#include <openssl/bn.h>
#include <openssl/engine.h>
#define RSAREF_LIB_NAME "rsaref engine"
#include "rsaref_err.c"
/* Constants used when creating the ENGINE */
static
const
char
*
engine_rsaref_id
=
"rsaref"
;
static
const
char
*
engine_rsaref_name
=
"RSAref engine support"
;
...
...
@@ -54,95 +57,6 @@ static RSA_METHOD rsaref_rsa =
NULL
};
#ifndef OPENSSL_NO_ERR
/* Error function codes for use in rsaref operation */
#define RSAREF_F_BNREF_MOD_EXP 100
#define RSAREF_F_RSAREF_BN2BIN 101
#define RSAREF_F_RSA_BN2BIN 102
#define RSAREF_F_RSA_PRIVATE_DECRYPT 103
#define RSAREF_F_RSA_PRIVATE_ENCRYPT 104
#define RSAREF_F_RSA_PUBLIC_DECRYPT 105
#define RSAREF_F_RSA_PUBLIC_ENCRYPT 106
#define RSAREF_F_RSAREF_MOD_EXP 108
#define RSAREF_F_RSAREF_PRIVATE_DECRYPT 109
#define RSAREF_F_RSAREF_PRIVATE_ENCRYPT 110
#define RSAREF_F_RSAREF_PUBLIC_DECRYPT 111
#define RSAREF_F_RSAREF_PUBLIC_ENCRYPT 112
/* Error reason codes */
#define RSAREF_R_CONTENT_ENCODING 0x0400
#define RSAREF_R_DATA 0x0401
#define RSAREF_R_DIGEST_ALGORITHM 0x0402
#define RSAREF_R_ENCODING 0x0403
#define RSAREF_R_ENCRYPTION_ALGORITHM 0x040d
#define RSAREF_R_KEY 0x0404
#define RSAREF_R_KEY_ENCODING 0x0405
#define RSAREF_R_LEN 0x0406
#define RSAREF_R_MODULUS_LEN 0x0407
#define RSAREF_R_NEED_RANDOM 0x0408
#define RSAREF_R_PRIVATE_KEY 0x0409
#define RSAREF_R_PUBLIC_KEY 0x040a
#define RSAREF_R_SIGNATURE 0x040b
#define RSAREF_R_SIGNATURE_ENCODING 0x040c
static
ERR_STRING_DATA
rsaref_str_functs
[]
=
{
/* This first element is changed to match the dynamic 'lib' number */
{
ERR_PACK
(
0
,
0
,
0
),
"rsaref engine code"
},
{
ERR_PACK
(
0
,
RSAREF_F_BNREF_MOD_EXP
,
0
),
"BN_REF_MOD_EXP"
},
{
ERR_PACK
(
0
,
RSAREF_F_RSAREF_BN2BIN
,
0
),
"RSAREF_BN2BIN"
},
{
ERR_PACK
(
0
,
RSAREF_F_RSA_BN2BIN
,
0
),
"RSA_BN2BIN"
},
{
ERR_PACK
(
0
,
RSAREF_F_RSA_PRIVATE_DECRYPT
,
0
),
"RSA_private_decrypt"
},
{
ERR_PACK
(
0
,
RSAREF_F_RSA_PRIVATE_ENCRYPT
,
0
),
"RSA_private_encrypt"
},
{
ERR_PACK
(
0
,
RSAREF_F_RSA_PUBLIC_DECRYPT
,
0
),
"RSA_public_decrypt"
},
{
ERR_PACK
(
0
,
RSAREF_F_RSA_PUBLIC_ENCRYPT
,
0
),
"RSA_public_encrypt"
},
{
ERR_PACK
(
0
,
RSAREF_F_RSAREF_MOD_EXP
,
0
),
"RSA_REF_MOD_EXP"
},
{
ERR_PACK
(
0
,
RSAREF_F_RSAREF_PRIVATE_DECRYPT
,
0
),
"RSA_REF_PRIVATE_DECRYPT"
},
{
ERR_PACK
(
0
,
RSAREF_F_RSAREF_PRIVATE_ENCRYPT
,
0
),
"RSA_REF_PRIVATE_ENCRYPT"
},
{
ERR_PACK
(
0
,
RSAREF_F_RSAREF_PUBLIC_DECRYPT
,
0
),
"RSA_REF_PUBLIC_DECRYPT"
},
{
ERR_PACK
(
0
,
RSAREF_F_RSAREF_PUBLIC_ENCRYPT
,
0
),
"RSA_REF_PUBLIC_ENCRYPT"
},
{
RSAREF_R_CONTENT_ENCODING
,
"content encoding"
},
{
RSAREF_R_DATA
,
"data"
},
{
RSAREF_R_DIGEST_ALGORITHM
,
"digest algorithm"
},
{
RSAREF_R_ENCODING
,
"encoding"
},
{
RSAREF_R_ENCRYPTION_ALGORITHM
,
"encryption algorithm"
},
{
RSAREF_R_KEY
,
"key"
},
{
RSAREF_R_KEY_ENCODING
,
"key encoding"
},
{
RSAREF_R_LEN
,
"len"
},
{
RSAREF_R_MODULUS_LEN
,
"modulus len"
},
{
RSAREF_R_NEED_RANDOM
,
"need random"
},
{
RSAREF_R_PRIVATE_KEY
,
"private key"
},
{
RSAREF_R_PUBLIC_KEY
,
"public key"
},
{
RSAREF_R_SIGNATURE
,
"signature"
},
{
RSAREF_R_SIGNATURE_ENCODING
,
"signature encoding"
},
{
0
,
NULL
}
};
/* The library number we obtain dynamically from the ERR code */
static
int
rsaref_err_lib
=
-
1
;
#define RSAREFerr(f,r) ERR_PUT_error(rsaref_err_lib,(f),(r),__FILE__,__LINE__)
static
void
rsaref_load_error_strings
(
void
)
{
if
(
rsaref_err_lib
<
0
)
{
if
((
rsaref_err_lib
=
ERR_get_next_error_library
())
<=
0
)
return
;
rsaref_str_functs
[
0
].
error
=
ERR_PACK
(
rsaref_err_lib
,
0
,
0
);
ERR_load_strings
(
rsaref_err_lib
,
rsaref_str_functs
);
}
}
static
void
rsaref_unload_error_strings
(
void
)
{
if
(
rsaref_err_lib
>=
0
)
{
ERR_unload_strings
(
rsaref_err_lib
,
rsaref_str_functs
);
rsaref_err_lib
=
-
1
;
}
}
#else
#define RSAREFerr(f,r)
/* NOP */
static
void
rsaref_load_error_strings
(
void
)
{
}
/* NOP */
static
void
rsaref_unload_error_strings
(
void
)
{
}
/* NOP */
#endif
/* Now, to our own code */
static
int
bind_rsaref
(
ENGINE
*
e
)
...
...
@@ -159,7 +73,7 @@ static int bind_rsaref(ENGINE *e)
return
0
;
/* Ensure the rsaref error handling is set up */
rsaref_load_error
_strings
();
ERR_load_RSAREF
_strings
();
return
1
;
}
...
...
@@ -214,7 +128,7 @@ static int rsaref_finish(ENGINE *e)
/* Destructor (complements the "ENGINE_ncipher()" constructor) */
static
int
rsaref_destroy
(
ENGINE
*
e
)
{
rsaref_unload_error
_strings
();
ERR_unload_RSAREF
_strings
();
return
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录