Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
5be02271
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看板
提交
5be02271
编写于
7月 04, 2001
作者:
B
Ben Laurie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update nCipher header with more liberal licence.
上级
43f9391b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
78 addition
and
68 deletion
+78
-68
crypto/engine/vendor_defns/hwcryptohook.h
crypto/engine/vendor_defns/hwcryptohook.h
+78
-68
未找到文件。
crypto/engine/vendor_defns/hwcryptohook.h
浏览文件 @
5be02271
...
...
@@ -8,13 +8,19 @@
* synchronous-within-each-thread, facility.
*
*
* This file is Copyright 1998-
1999
nCipher Corporation Limited.
* This file is Copyright 1998-
2000
nCipher Corporation Limited.
*
* This file is provided for your information and assistance. You are
* permitted to copy it verbatim, to use it to create compatible
* software, and for review and comment. However, you may not
* distribute changed versions or other derivative works. All other
* rights are reserved.
* Redistribution and use in source and binary forms, with opr 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
*
* IN NO EVENT SHALL NCIPHER CORPORATION LIMITED (`NCIPHER') AND/OR
* ANY OTHER AUTHORS OR DISTRIBUTORS OF THIS FILE BE LIABLE for any
...
...
@@ -52,14 +58,14 @@
*
*
* The actual dynamically loadable plugin, and the library files for
* static linking, which are also provided in
this distribution
, are
* static linking, which are also provided in
some distributions
, are
* not covered by the licence described above. You should have
* received a separate licence with terms and conditions for these
* library files; if you received the library files without a licence,
* please contact nCipher.
*
*
* $Id: hwcryptohook.h,v 1.
2 2000/10/26 21:06:30 levitte
Exp $
* $Id: hwcryptohook.h,v 1.
3 2001/07/04 12:26:39 ben
Exp $
*/
#ifndef HWCRYPTOHOOK_H
...
...
@@ -111,12 +117,11 @@ typedef struct {
* integer-valued ones). It will, if an ErrMsgBuf is passed, also put
* an error message there.
*
* size is the size of the buffer. When the buffer is filled, it will
* always be null-terminated. If you pass 0 buf buf you must pass 0
* for size, and nothing will be recorded (just as if you passed 0 for
* the struct pointer). Size will not be modified when an error is
* recorded. The buffer is always null-terminated even if there is an
* overrun.
* size is the size of the buffer, and will not be modified. If you
* pass 0 for size you must pass 0 for buf, and nothing will be
* recorded (just as if you passed 0 for the struct pointer).
* Messages written to the buffer will always be null-terminated, even
* when truncated to fit within size bytes.
*
* The contents of the buffer are not defined if there is no error.
*/
...
...
@@ -126,10 +131,14 @@ typedef struct HWCryptoHook_MPIStruct {
size_t
size
;
}
HWCryptoHook_MPI
;
/* When one of these is returned, a pointer is passed to the function.
* At call, size is the space available. Afterwards it is updated.
* buf (the pointer) is not updated. size is in bytes and may be
* zero, but must be a multiple of the limb size. Zero limbs at the
* MS end are not permitted.
* At call, size is the space available. Afterwards it is updated to
* be set to the actual length (which may be more than the space available,
* if there was not enough room and the result was truncated).
* buf (the pointer) is not updated.
*
* size is in bytes and may be zero at call or return, but must be a
* multiple of the limb size. Zero limbs at the MS end are not
* permitted.
*/
#define HWCryptoHook_InitFlags_FallbackModExp 0x0002UL
...
...
@@ -222,9 +231,9 @@ typedef struct {
*/
int
(
*
getpassphrase
)(
const
char
*
prompt_info
,
int
*
len_io
,
char
*
buf
,
HWCryptoHook_PassphraseContext
*
ppctx
,
HWCryptoHook_CallerContext
*
cactx
);
int
*
len_io
,
char
*
buf
,
HWCryptoHook_PassphraseContext
*
ppctx
,
HWCryptoHook_CallerContext
*
cactx
);
/* Passphrases and the prompt_info, if they contain high-bit-set
* characters, are UTF-8. The prompt_info may be a null pointer if
* no prompt information is available (it should not be an empty
...
...
@@ -239,9 +248,9 @@ typedef struct {
*/
int
(
*
getphystoken
)(
const
char
*
prompt_info
,
const
char
*
wrong_info
,
HWCryptoHook_PassphraseContext
*
ppctx
,
HWCryptoHook_CallerContext
*
cactx
);
const
char
*
wrong_info
,
HWCryptoHook_PassphraseContext
*
ppctx
,
HWCryptoHook_CallerContext
*
cactx
);
/* Requests that the human user physically insert a different
* smartcard, DataKey, etc. The plugin should check whether the
* currently inserted token(s) are appropriate, and if they are it
...
...
@@ -311,9 +320,9 @@ typedef struct {
typedef
HWCryptoHook_ContextHandle
HWCryptoHook_Init_t
(
const
HWCryptoHook_InitInfo
*
initinfo
,
size_t
initinfosize
,
HWCryptoHook_ErrMsgBuf
*
errors
,
HWCryptoHook_CallerContext
*
cactx
);
size_t
initinfosize
,
const
HWCryptoHook_ErrMsgBuf
*
errors
,
HWCryptoHook_CallerContext
*
cactx
);
extern
HWCryptoHook_Init_t
HWCryptoHook_Init
;
/* Caller should set initinfosize to the size of the HWCryptoHook struct,
...
...
@@ -339,7 +348,7 @@ extern HWCryptoHook_Init_t HWCryptoHook_Init;
/* The RSAImmed* functions (and key managed RSA) only work with
* modules which have an RSA patent licence - currently that means KM
* units; the ModExp* ones work with all modules, so you need a patent
* licence in the software in the US.
* licence in the software in the US.
They are otherwise identical.
*/
typedef
...
...
@@ -349,50 +358,50 @@ extern HWCryptoHook_Finish_t HWCryptoHook_Finish;
typedef
int
HWCryptoHook_RandomBytes_t
(
HWCryptoHook_ContextHandle
hwctx
,
unsigned
char
*
buf
,
size_t
len
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
unsigned
char
*
buf
,
size_t
len
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
extern
HWCryptoHook_RandomBytes_t
HWCryptoHook_RandomBytes
;
typedef
int
HWCryptoHook_ModExp_t
(
HWCryptoHook_ContextHandle
hwctx
,
HWCryptoHook_MPI
a
,
HWCryptoHook_MPI
p
,
HWCryptoHook_MPI
n
,
HWCryptoHook_MPI
*
r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
HWCryptoHook_MPI
a
,
HWCryptoHook_MPI
p
,
HWCryptoHook_MPI
n
,
HWCryptoHook_MPI
*
r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
extern
HWCryptoHook_ModExp_t
HWCryptoHook_ModExp
;
typedef
int
HWCryptoHook_RSAImmedPub_t
(
HWCryptoHook_ContextHandle
hwctx
,
HWCryptoHook_MPI
m
,
HWCryptoHook_MPI
e
,
HWCryptoHook_MPI
n
,
HWCryptoHook_MPI
*
r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
HWCryptoHook_MPI
m
,
HWCryptoHook_MPI
e
,
HWCryptoHook_MPI
n
,
HWCryptoHook_MPI
*
r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
extern
HWCryptoHook_RSAImmedPub_t
HWCryptoHook_RSAImmedPub
;
typedef
int
HWCryptoHook_ModExpCRT_t
(
HWCryptoHook_ContextHandle
hwctx
,
HWCryptoHook_MPI
a
,
HWCryptoHook_MPI
p
,
HWCryptoHook_MPI
q
,
HWCryptoHook_MPI
dmp1
,
HWCryptoHook_MPI
dmq1
,
HWCryptoHook_MPI
iqmp
,
HWCryptoHook_MPI
*
r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
HWCryptoHook_MPI
a
,
HWCryptoHook_MPI
p
,
HWCryptoHook_MPI
q
,
HWCryptoHook_MPI
dmp1
,
HWCryptoHook_MPI
dmq1
,
HWCryptoHook_MPI
iqmp
,
HWCryptoHook_MPI
*
r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
extern
HWCryptoHook_ModExpCRT_t
HWCryptoHook_ModExpCRT
;
typedef
int
HWCryptoHook_RSAImmedPriv_t
(
HWCryptoHook_ContextHandle
hwctx
,
HWCryptoHook_MPI
m
,
HWCryptoHook_MPI
p
,
HWCryptoHook_MPI
q
,
HWCryptoHook_MPI
dmp1
,
HWCryptoHook_MPI
dmq1
,
HWCryptoHook_MPI
iqmp
,
HWCryptoHook_MPI
*
r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
HWCryptoHook_MPI
m
,
HWCryptoHook_MPI
p
,
HWCryptoHook_MPI
q
,
HWCryptoHook_MPI
dmp1
,
HWCryptoHook_MPI
dmq1
,
HWCryptoHook_MPI
iqmp
,
HWCryptoHook_MPI
*
r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
extern
HWCryptoHook_RSAImmedPriv_t
HWCryptoHook_RSAImmedPriv
;
/* The RSAImmed* and ModExp* functions may return E_FAILED or
...
...
@@ -412,10 +421,10 @@ extern HWCryptoHook_RSAImmedPriv_t HWCryptoHook_RSAImmedPriv;
typedef
int
HWCryptoHook_RSALoadKey_t
(
HWCryptoHook_ContextHandle
hwctx
,
const
char
*
key_ident
,
HWCryptoHook_RSAKeyHandle
*
keyhandle_r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
,
HWCryptoHook_PassphraseContext
*
ppctx
);
const
char
*
key_ident
,
HWCryptoHook_RSAKeyHandle
*
keyhandle_r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
,
HWCryptoHook_PassphraseContext
*
ppctx
);
extern
HWCryptoHook_RSALoadKey_t
HWCryptoHook_RSALoadKey
;
/* The key_ident is a null-terminated string configured by the
* user via the application's usual configuration mechanisms.
...
...
@@ -430,15 +439,15 @@ extern HWCryptoHook_RSALoadKey_t HWCryptoHook_RSALoadKey;
* and the provider must cope (returning an error if the string is not
* valid).
*
* If the key does not exist,
it is _not_ an error - in that case,
* If the key does not exist,
no error is recorded and 0 is returned;
* keyhandle_r will be set to 0 instead of to a key handle.
*/
typedef
int
HWCryptoHook_RSAGetPublicKey_t
(
HWCryptoHook_RSAKeyHandle
k
,
HWCryptoHook_MPI
*
n
,
HWCryptoHook_MPI
*
e
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
HWCryptoHook_MPI
*
n
,
HWCryptoHook_MPI
*
e
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
extern
HWCryptoHook_RSAGetPublicKey_t
HWCryptoHook_RSAGetPublicKey
;
/* The crypto plugin will not store certificates.
*
...
...
@@ -462,15 +471,16 @@ extern HWCryptoHook_RSAGetPublicKey_t HWCryptoHook_RSAGetPublicKey;
typedef
int
HWCryptoHook_RSAUnloadKey_t
(
HWCryptoHook_RSAKeyHandle
k
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
const
HWCryptoHook_ErrMsgBuf
*
errors
);
extern
HWCryptoHook_RSAUnloadKey_t
HWCryptoHook_RSAUnloadKey
;
/* Might fail due to locking problems, or other serious internal problems. */
typedef
int
HWCryptoHook_RSA_t
(
HWCryptoHook_MPI
m
,
HWCryptoHook_RSAKeyHandle
k
,
HWCryptoHook_MPI
*
r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
HWCryptoHook_RSAKeyHandle
k
,
HWCryptoHook_MPI
*
r
,
const
HWCryptoHook_ErrMsgBuf
*
errors
);
extern
HWCryptoHook_RSA_t
HWCryptoHook_RSA
;
/* RSA private key operation (sign or decrypt) - raw, unpadded. */
#endif
/*HWCRYPTOHOOK_H*/
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录