Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
69cbf468
O
openssl
项目概览
btwise
/
openssl
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
69cbf468
编写于
6月 06, 1999
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rewrite PBE handling read to support PKCS#5 v2.0 and update the function
list for Win32.
上级
095ce353
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
100 addition
and
64 deletion
+100
-64
CHANGES
CHANGES
+11
-0
crypto/evp/evp.h
crypto/evp/evp.h
+10
-4
crypto/evp/evp_err.c
crypto/evp/evp_err.c
+1
-1
crypto/evp/evp_pbe.c
crypto/evp/evp_pbe.c
+3
-37
crypto/evp/p5_crpt.c
crypto/evp/p5_crpt.c
+20
-2
crypto/pkcs12/p12_crpt.c
crypto/pkcs12/p12_crpt.c
+21
-2
crypto/pkcs12/p12_decr.c
crypto/pkcs12/p12_decr.c
+2
-1
crypto/pkcs12/pkcs12.h
crypto/pkcs12/pkcs12.h
+14
-6
crypto/x509/x509.h
crypto/x509/x509.h
+0
-11
util/libeay.num
util/libeay.num
+18
-0
未找到文件。
CHANGES
浏览文件 @
69cbf468
...
@@ -5,6 +5,17 @@
...
@@ -5,6 +5,17 @@
Changes between 0.9.3a and 0.9.4
Changes between 0.9.3a and 0.9.4
*) Rewrite the way password based encryption (PBE) is handled. It used to
assume that the ASN1 AlgorithmIdentifier parameter was a PBEParameter
structure. This was true for the PKCS#5 v1.5 and PKCS#12 PBE algorithms
but doesn't apply to PKCS#5 v2.0 where it can be something else. Now
the 'parameter' field of the AlgorithmIdentifier is passed to the
underlying key generation function so it must do its own ASN1 parsing.
This has also changed the EVP_PBE_CipherInit() function which now has a
'parameter' argument instead of literal salt and iteration count values
and the function EVP_PBE_ALGOR_CipherInit() has been deleted.
[Steve Henson]
*) Support for PKCS#5 v1.5 compatible password based encryption algorithms
*) Support for PKCS#5 v1.5 compatible password based encryption algorithms
and PKCS#8 functionality. New 'pkcs8' application linked to openssl.
and PKCS#8 functionality. New 'pkcs8' application linked to openssl.
Needed to change the PEM_STRING_EVP_PKEY value which was just "PRIVATE
Needed to change the PEM_STRING_EVP_PKEY value which was just "PRIVATE
...
...
crypto/evp/evp.h
浏览文件 @
69cbf468
...
@@ -396,7 +396,7 @@ typedef struct evp_Encode_Ctx_st
...
@@ -396,7 +396,7 @@ typedef struct evp_Encode_Ctx_st
/* Password based encryption function */
/* Password based encryption function */
typedef
int
(
EVP_PBE_KEYGEN
)(
const
char
*
pass
,
int
passlen
,
typedef
int
(
EVP_PBE_KEYGEN
)(
const
char
*
pass
,
int
passlen
,
unsigned
char
*
salt
,
int
saltlen
,
int
iter
,
EVP_CIPHER
*
cipher
,
ASN1_TYPE
*
param
,
EVP_CIPHER
*
cipher
,
EVP_MD
*
md
,
unsigned
char
*
key
,
unsigned
char
*
iv
);
EVP_MD
*
md
,
unsigned
char
*
key
,
unsigned
char
*
iv
);
#define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\
#define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\
...
@@ -635,12 +635,18 @@ int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type);
...
@@ -635,12 +635,18 @@ int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c,ASN1_TYPE *type);
int
EVP_CIPHER_get_asn1_iv
(
EVP_CIPHER_CTX
*
c
,
ASN1_TYPE
*
type
);
int
EVP_CIPHER_get_asn1_iv
(
EVP_CIPHER_CTX
*
c
,
ASN1_TYPE
*
type
);
/* PKCS5 password based encryption */
/* PKCS5 password based encryption */
int
PKCS5_PBE_keyivgen
(
const
char
*
pass
,
int
passlen
,
unsigned
char
*
salt
,
int
PKCS5_PBE_keyivgen
(
const
char
*
pass
,
int
passlen
,
ASN1_TYPE
*
param
,
int
saltlen
,
int
iter
,
EVP_CIPHER
*
cipher
,
EVP_MD
*
md
,
EVP_CIPHER
*
cipher
,
EVP_MD
*
md
,
unsigned
char
*
key
,
unsigned
char
*
iv
);
unsigned
char
*
key
,
unsigned
char
*
iv
);
void
PKCS5_PBE_add
(
void
);
void
PKCS5_PBE_add
(
void
);
int
EVP_PBE_CipherInit
(
ASN1_OBJECT
*
pbe_obj
,
const
char
*
pass
,
int
passlen
,
ASN1_TYPE
*
param
,
EVP_CIPHER_CTX
*
ctx
,
int
en_de
);
int
EVP_PBE_alg_add
(
int
nid
,
EVP_CIPHER
*
cipher
,
EVP_MD
*
md
,
EVP_PBE_KEYGEN
*
keygen
);
void
EVP_PBE_cleanup
(
void
);
/* BEGIN ERROR CODES */
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
* made after this point may be overwritten when the script is next run.
...
@@ -653,9 +659,9 @@ void PKCS5_PBE_add(void);
...
@@ -653,9 +659,9 @@ void PKCS5_PBE_add(void);
#define EVP_F_EVP_DECRYPTFINAL 101
#define EVP_F_EVP_DECRYPTFINAL 101
#define EVP_F_EVP_MD_CTX_COPY 110
#define EVP_F_EVP_MD_CTX_COPY 110
#define EVP_F_EVP_OPENINIT 102
#define EVP_F_EVP_OPENINIT 102
#define EVP_F_EVP_PBE_ALGOR_CIPHERINIT 114
#define EVP_F_EVP_PBE_ALG_ADD 115
#define EVP_F_EVP_PBE_ALG_ADD 115
#define EVP_F_EVP_PBE_CIPHERINIT 116
#define EVP_F_EVP_PBE_CIPHERINIT 116
#define EVP_F_EVP_PKCS5_PBE_KEYIVGEN 117
#define EVP_F_EVP_PKCS82PKEY 111
#define EVP_F_EVP_PKCS82PKEY 111
#define EVP_F_EVP_PKCS8_SET_BROKEN 112
#define EVP_F_EVP_PKCS8_SET_BROKEN 112
#define EVP_F_EVP_PKEY2PKCS8 113
#define EVP_F_EVP_PKEY2PKCS8 113
...
...
crypto/evp/evp_err.c
浏览文件 @
69cbf468
...
@@ -69,9 +69,9 @@ static ERR_STRING_DATA EVP_str_functs[]=
...
@@ -69,9 +69,9 @@ static ERR_STRING_DATA EVP_str_functs[]=
{
ERR_PACK
(
0
,
EVP_F_EVP_DECRYPTFINAL
,
0
),
"EVP_DecryptFinal"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_DECRYPTFINAL
,
0
),
"EVP_DecryptFinal"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_MD_CTX_COPY
,
0
),
"EVP_MD_CTX_copy"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_MD_CTX_COPY
,
0
),
"EVP_MD_CTX_copy"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_OPENINIT
,
0
),
"EVP_OpenInit"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_OPENINIT
,
0
),
"EVP_OpenInit"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PBE_ALGOR_CIPHERINIT
,
0
),
"EVP_PBE_ALGOR_CipherInit"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PBE_ALG_ADD
,
0
),
"EVP_PBE_alg_add"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PBE_ALG_ADD
,
0
),
"EVP_PBE_alg_add"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PBE_CIPHERINIT
,
0
),
"EVP_PBE_CipherInit"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PBE_CIPHERINIT
,
0
),
"EVP_PBE_CipherInit"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PKCS5_PBE_KEYIVGEN
,
0
),
"EVP_PKCS5_PBE_KEYIVGEN"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PKCS82PKEY
,
0
),
"EVP_PKCS82PKEY"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PKCS82PKEY
,
0
),
"EVP_PKCS82PKEY"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PKCS8_SET_BROKEN
,
0
),
"EVP_PKCS8_SET_BROKEN"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PKCS8_SET_BROKEN
,
0
),
"EVP_PKCS8_SET_BROKEN"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PKEY2PKCS8
,
0
),
"EVP_PKEY2PKCS8"
},
{
ERR_PACK
(
0
,
EVP_F_EVP_PKEY2PKCS8
,
0
),
"EVP_PKEY2PKCS8"
},
...
...
crypto/evp/evp_pbe.c
浏览文件 @
69cbf468
...
@@ -75,8 +75,7 @@ EVP_PBE_KEYGEN *keygen;
...
@@ -75,8 +75,7 @@ EVP_PBE_KEYGEN *keygen;
}
EVP_PBE_CTL
;
}
EVP_PBE_CTL
;
int
EVP_PBE_CipherInit
(
ASN1_OBJECT
*
pbe_obj
,
const
char
*
pass
,
int
passlen
,
int
EVP_PBE_CipherInit
(
ASN1_OBJECT
*
pbe_obj
,
const
char
*
pass
,
int
passlen
,
unsigned
char
*
salt
,
int
saltlen
,
int
iter
,
EVP_CIPHER_CTX
*
ctx
,
ASN1_TYPE
*
param
,
EVP_CIPHER_CTX
*
ctx
,
int
en_de
)
int
en_de
)
{
{
EVP_PBE_CTL
*
pbetmp
,
pbelu
;
EVP_PBE_CTL
*
pbetmp
,
pbelu
;
...
@@ -96,8 +95,8 @@ int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
...
@@ -96,8 +95,8 @@ int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
}
}
if
(
passlen
==
-
1
)
passlen
=
strlen
(
pass
);
if
(
passlen
==
-
1
)
passlen
=
strlen
(
pass
);
pbetmp
=
(
EVP_PBE_CTL
*
)
sk_value
(
pbe_algs
,
i
);
pbetmp
=
(
EVP_PBE_CTL
*
)
sk_value
(
pbe_algs
,
i
);
i
=
(
*
pbetmp
->
keygen
)(
pass
,
passlen
,
salt
,
saltlen
,
it
er
,
i
=
(
*
pbetmp
->
keygen
)(
pass
,
passlen
,
param
,
pbetmp
->
ciph
er
,
pbetmp
->
cipher
,
pbetmp
->
md
,
key
,
iv
);
pbetmp
->
md
,
key
,
iv
);
if
(
!
i
)
{
if
(
!
i
)
{
EVPerr
(
EVP_F_EVP_PBE_CIPHERINIT
,
EVP_R_KEYGEN_FAILURE
);
EVPerr
(
EVP_F_EVP_PBE_CIPHERINIT
,
EVP_R_KEYGEN_FAILURE
);
return
0
;
return
0
;
...
@@ -106,39 +105,6 @@ int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
...
@@ -106,39 +105,6 @@ int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
return
1
;
return
1
;
}
}
/* Setup a PBE algorithm but take most parameters from AlgorithmIdentifier */
int
EVP_PBE_ALGOR_CipherInit
(
X509_ALGOR
*
algor
,
const
char
*
pass
,
int
passlen
,
EVP_CIPHER_CTX
*
ctx
,
int
en_de
)
{
PBEPARAM
*
pbe
;
int
saltlen
,
iter
;
unsigned
char
*
salt
,
*
pbuf
;
/* Extract useful info from algor */
pbuf
=
algor
->
parameter
->
value
.
sequence
->
data
;
if
(
!
(
pbe
=
d2i_PBEPARAM
(
NULL
,
&
pbuf
,
algor
->
parameter
->
value
.
sequence
->
length
)))
{
EVPerr
(
EVP_F_EVP_PBE_ALGOR_CIPHERINIT
,
EVP_R_DECODE_ERROR
);
return
0
;
}
if
(
!
pbe
->
iter
)
iter
=
1
;
else
iter
=
ASN1_INTEGER_get
(
pbe
->
iter
);
salt
=
pbe
->
salt
->
data
;
saltlen
=
pbe
->
salt
->
length
;
if
(
!
(
EVP_PBE_CipherInit
(
algor
->
algorithm
,
pass
,
passlen
,
salt
,
saltlen
,
iter
,
ctx
,
en_de
)))
{
EVPerr
(
EVP_F_EVP_PBE_ALGOR_CIPHERINIT
,
EVP_R_EVP_PBE_CIPHERINIT_ERROR
);
PBEPARAM_free
(
pbe
);
return
0
;
}
PBEPARAM_free
(
pbe
);
return
1
;
}
static
int
pbe_cmp
(
EVP_PBE_CTL
**
pbe1
,
EVP_PBE_CTL
**
pbe2
)
static
int
pbe_cmp
(
EVP_PBE_CTL
**
pbe1
,
EVP_PBE_CTL
**
pbe2
)
{
{
return
((
*
pbe1
)
->
pbe_nid
-
(
*
pbe2
)
->
pbe_nid
);
return
((
*
pbe1
)
->
pbe_nid
-
(
*
pbe2
)
->
pbe_nid
);
...
...
crypto/evp/p5_crpt.c
浏览文件 @
69cbf468
...
@@ -85,16 +85,34 @@ EVP_PBE_alg_add(NID_pbeWithSHA1AndRC2_CBC, EVP_rc2_64_cbc(), EVP_sha1(),
...
@@ -85,16 +85,34 @@ EVP_PBE_alg_add(NID_pbeWithSHA1AndRC2_CBC, EVP_rc2_64_cbc(), EVP_sha1(),
#endif
#endif
}
}
int
PKCS5_PBE_keyivgen
(
const
char
*
pass
,
int
passlen
,
unsigned
char
*
salt
,
int
PKCS5_PBE_keyivgen
(
const
char
*
pass
,
int
passlen
,
ASN1_TYPE
*
param
,
int
saltlen
,
int
iter
,
EVP_CIPHER
*
cipher
,
EVP_MD
*
md
,
EVP_CIPHER
*
cipher
,
EVP_MD
*
md
,
unsigned
char
*
key
,
unsigned
char
*
iv
)
unsigned
char
*
key
,
unsigned
char
*
iv
)
{
{
EVP_MD_CTX
ctx
;
EVP_MD_CTX
ctx
;
unsigned
char
md_tmp
[
EVP_MAX_MD_SIZE
];
unsigned
char
md_tmp
[
EVP_MAX_MD_SIZE
];
int
i
;
int
i
;
PBEPARAM
*
pbe
;
int
saltlen
,
iter
;
unsigned
char
*
salt
,
*
pbuf
;
/* Extract useful info from parameter */
pbuf
=
param
->
value
.
sequence
->
data
;
if
(
!
(
pbe
=
d2i_PBEPARAM
(
NULL
,
&
pbuf
,
param
->
value
.
sequence
->
length
)))
{
EVPerr
(
EVP_F_EVP_PKCS5_PBE_KEYIVGEN
,
EVP_R_DECODE_ERROR
);
return
0
;
}
if
(
!
pbe
->
iter
)
iter
=
1
;
else
iter
=
ASN1_INTEGER_get
(
pbe
->
iter
);
salt
=
pbe
->
salt
->
data
;
saltlen
=
pbe
->
salt
->
length
;
EVP_DigestInit
(
&
ctx
,
md
);
EVP_DigestInit
(
&
ctx
,
md
);
EVP_DigestUpdate
(
&
ctx
,
pass
,
passlen
);
EVP_DigestUpdate
(
&
ctx
,
pass
,
passlen
);
EVP_DigestUpdate
(
&
ctx
,
salt
,
saltlen
);
EVP_DigestUpdate
(
&
ctx
,
salt
,
saltlen
);
PBEPARAM_free
(
pbe
);
EVP_DigestFinal
(
&
ctx
,
md_tmp
,
NULL
);
EVP_DigestFinal
(
&
ctx
,
md_tmp
,
NULL
);
for
(
i
=
1
;
i
<
iter
;
i
++
)
{
for
(
i
=
1
;
i
<
iter
;
i
++
)
{
EVP_DigestInit
(
&
ctx
,
md
);
EVP_DigestInit
(
&
ctx
,
md
);
...
...
crypto/pkcs12/p12_crpt.c
浏览文件 @
69cbf468
...
@@ -82,19 +82,38 @@ EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(),
...
@@ -82,19 +82,38 @@ EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(),
#endif
#endif
}
}
int
PKCS12_PBE_keyivgen
(
const
char
*
pass
,
int
passlen
,
unsigned
char
*
salt
,
int
PKCS12_PBE_keyivgen
(
const
char
*
pass
,
int
passlen
,
ASN1_TYPE
*
param
,
int
saltlen
,
int
iter
,
EVP_CIPHER
*
cipher
,
EVP_MD
*
md
,
EVP_CIPHER
*
cipher
,
EVP_MD
*
md
,
unsigned
char
*
key
,
unsigned
char
*
iv
)
unsigned
char
*
key
,
unsigned
char
*
iv
)
{
{
PBEPARAM
*
pbe
;
int
saltlen
,
iter
;
unsigned
char
*
salt
,
*
pbuf
;
/* Extract useful info from parameter */
pbuf
=
param
->
value
.
sequence
->
data
;
if
(
!
(
pbe
=
d2i_PBEPARAM
(
NULL
,
&
pbuf
,
param
->
value
.
sequence
->
length
)))
{
EVPerr
(
PKCS12_F_PKCS12_PBE_KEYIVGEN
,
EVP_R_DECODE_ERROR
);
return
0
;
}
if
(
!
pbe
->
iter
)
iter
=
1
;
else
iter
=
ASN1_INTEGER_get
(
pbe
->
iter
);
salt
=
pbe
->
salt
->
data
;
saltlen
=
pbe
->
salt
->
length
;
if
(
!
PKCS12_key_gen
(
pass
,
passlen
,
salt
,
saltlen
,
PKCS12_KEY_ID
,
if
(
!
PKCS12_key_gen
(
pass
,
passlen
,
salt
,
saltlen
,
PKCS12_KEY_ID
,
iter
,
EVP_CIPHER_key_length
(
cipher
),
key
,
md
))
{
iter
,
EVP_CIPHER_key_length
(
cipher
),
key
,
md
))
{
PKCS12err
(
PKCS12_F_PKCS12_PBE_KEYIVGEN
,
PKCS12_R_KEY_GEN_ERROR
);
PKCS12err
(
PKCS12_F_PKCS12_PBE_KEYIVGEN
,
PKCS12_R_KEY_GEN_ERROR
);
PBEPARAM_free
(
pbe
);
return
0
;
return
0
;
}
}
if
(
!
PKCS12_key_gen
(
pass
,
passlen
,
salt
,
saltlen
,
PKCS12_IV_ID
,
if
(
!
PKCS12_key_gen
(
pass
,
passlen
,
salt
,
saltlen
,
PKCS12_IV_ID
,
iter
,
EVP_CIPHER_iv_length
(
cipher
),
iv
,
md
))
{
iter
,
EVP_CIPHER_iv_length
(
cipher
),
iv
,
md
))
{
PKCS12err
(
PKCS12_F_PKCS12_PBE_KEYIVGEN
,
PKCS12_R_IV_GEN_ERROR
);
PKCS12err
(
PKCS12_F_PKCS12_PBE_KEYIVGEN
,
PKCS12_R_IV_GEN_ERROR
);
PBEPARAM_free
(
pbe
);
return
0
;
return
0
;
}
}
PBEPARAM_free
(
pbe
);
return
1
;
return
1
;
}
}
crypto/pkcs12/p12_decr.c
浏览文件 @
69cbf468
...
@@ -82,7 +82,8 @@ unsigned char * PKCS12_pbe_crypt (X509_ALGOR *algor, const char *pass,
...
@@ -82,7 +82,8 @@ unsigned char * PKCS12_pbe_crypt (X509_ALGOR *algor, const char *pass,
}
}
/* Decrypt data */
/* Decrypt data */
if
(
!
EVP_PBE_ALGOR_CipherInit
(
algor
,
pass
,
passlen
,
&
ctx
,
en_de
))
{
if
(
!
EVP_PBE_CipherInit
(
algor
->
algorithm
,
pass
,
passlen
,
algor
->
parameter
,
&
ctx
,
en_de
))
{
PKCS12err
(
PKCS12_F_PKCS12_PBE_CRYPT
,
PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR
);
PKCS12err
(
PKCS12_F_PKCS12_PBE_CRYPT
,
PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR
);
return
NULL
;
return
NULL
;
}
}
...
...
crypto/pkcs12/pkcs12.h
浏览文件 @
69cbf468
...
@@ -230,13 +230,17 @@ int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
...
@@ -230,13 +230,17 @@ int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
int
saltlen
,
int
id
,
int
iter
,
int
n
,
int
saltlen
,
int
id
,
int
iter
,
int
n
,
unsigned
char
*
out
,
const
EVP_MD
*
md_type
);
unsigned
char
*
out
,
const
EVP_MD
*
md_type
);
int
PKCS12_key_gen_uni
(
unsigned
char
*
pass
,
int
passlen
,
unsigned
char
*
salt
,
int
saltlen
,
int
id
,
int
iter
,
int
n
,
unsigned
char
*
out
,
const
EVP_MD
*
md_type
);
int
PKCS12_key_gen_uni
(
unsigned
char
*
pass
,
int
passlen
,
unsigned
char
*
salt
,
int
saltlen
,
int
id
,
int
iter
,
int
n
,
unsigned
char
*
out
,
const
EVP_MD
*
md_type
);
int
PKCS12_PBE_keyivgen
(
const
char
*
pass
,
int
passlen
,
unsigned
char
*
salt
,
int
saltlen
,
int
iter
,
EVP_CIPHER
*
cipher
,
EVP_MD
*
md_type
,
unsigned
char
*
key
,
unsigned
char
*
iv
);
int
PKCS12_PBE_keyivgen
(
const
char
*
pass
,
int
passlen
,
ASN1_TYPE
*
param
,
int
PKCS12_gen_mac
(
PKCS12
*
p12
,
const
char
*
pass
,
int
passlen
,
unsigned
char
*
mac
,
unsigned
int
*
maclen
);
EVP_CIPHER
*
cipher
,
EVP_MD
*
md_type
,
unsigned
char
*
key
,
unsigned
char
*
iv
);
int
PKCS12_gen_mac
(
PKCS12
*
p12
,
const
char
*
pass
,
int
passlen
,
unsigned
char
*
mac
,
unsigned
int
*
maclen
);
int
PKCS12_verify_mac
(
PKCS12
*
p12
,
const
char
*
pass
,
int
passlen
);
int
PKCS12_verify_mac
(
PKCS12
*
p12
,
const
char
*
pass
,
int
passlen
);
int
PKCS12_set_mac
(
PKCS12
*
p12
,
const
char
*
pass
,
int
passlen
,
int
PKCS12_set_mac
(
PKCS12
*
p12
,
const
char
*
pass
,
int
passlen
,
unsigned
char
*
salt
,
int
saltlen
,
int
iter
,
unsigned
char
*
salt
,
int
saltlen
,
int
iter
,
EVP_MD
*
md_type
);
EVP_MD
*
md_type
);
int
PKCS12_setup_mac
(
PKCS12
*
p12
,
int
iter
,
unsigned
char
*
salt
,
int
saltlen
,
EVP_MD
*
md_type
);
int
PKCS12_setup_mac
(
PKCS12
*
p12
,
int
iter
,
unsigned
char
*
salt
,
int
saltlen
,
EVP_MD
*
md_type
);
unsigned
char
*
asc2uni
(
const
char
*
asc
,
unsigned
char
**
uni
,
int
*
unilen
);
unsigned
char
*
asc2uni
(
const
char
*
asc
,
unsigned
char
**
uni
,
int
*
unilen
);
char
*
uni2asc
(
unsigned
char
*
uni
,
int
unilen
);
char
*
uni2asc
(
unsigned
char
*
uni
,
int
unilen
);
int
i2d_PKCS12_BAGS
(
PKCS12_BAGS
*
a
,
unsigned
char
**
pp
);
int
i2d_PKCS12_BAGS
(
PKCS12_BAGS
*
a
,
unsigned
char
**
pp
);
...
@@ -249,17 +253,21 @@ PKCS12 *PKCS12_new(void);
...
@@ -249,17 +253,21 @@ PKCS12 *PKCS12_new(void);
void
PKCS12_free
(
PKCS12
*
a
);
void
PKCS12_free
(
PKCS12
*
a
);
int
i2d_PKCS12_MAC_DATA
(
PKCS12_MAC_DATA
*
a
,
unsigned
char
**
pp
);
int
i2d_PKCS12_MAC_DATA
(
PKCS12_MAC_DATA
*
a
,
unsigned
char
**
pp
);
PKCS12_MAC_DATA
*
PKCS12_MAC_DATA_new
(
void
);
PKCS12_MAC_DATA
*
PKCS12_MAC_DATA_new
(
void
);
PKCS12_MAC_DATA
*
d2i_PKCS12_MAC_DATA
(
PKCS12_MAC_DATA
**
a
,
unsigned
char
**
pp
,
long
length
);
PKCS12_MAC_DATA
*
d2i_PKCS12_MAC_DATA
(
PKCS12_MAC_DATA
**
a
,
unsigned
char
**
pp
,
long
length
);
void
PKCS12_MAC_DATA_free
(
PKCS12_MAC_DATA
*
a
);
void
PKCS12_MAC_DATA_free
(
PKCS12_MAC_DATA
*
a
);
int
i2d_PKCS12_SAFEBAG
(
PKCS12_SAFEBAG
*
a
,
unsigned
char
**
pp
);
int
i2d_PKCS12_SAFEBAG
(
PKCS12_SAFEBAG
*
a
,
unsigned
char
**
pp
);
PKCS12_SAFEBAG
*
PKCS12_SAFEBAG_new
(
void
);
PKCS12_SAFEBAG
*
PKCS12_SAFEBAG_new
(
void
);
PKCS12_SAFEBAG
*
d2i_PKCS12_SAFEBAG
(
PKCS12_SAFEBAG
**
a
,
unsigned
char
**
pp
,
long
length
);
PKCS12_SAFEBAG
*
d2i_PKCS12_SAFEBAG
(
PKCS12_SAFEBAG
**
a
,
unsigned
char
**
pp
,
long
length
);
void
PKCS12_SAFEBAG_free
(
PKCS12_SAFEBAG
*
a
);
void
PKCS12_SAFEBAG_free
(
PKCS12_SAFEBAG
*
a
);
void
ERR_load_PKCS12_strings
(
void
);
void
ERR_load_PKCS12_strings
(
void
);
void
PKCS12_PBE_add
(
void
);
void
PKCS12_PBE_add
(
void
);
int
PKCS12_parse
(
PKCS12
*
p12
,
const
char
*
pass
,
EVP_PKEY
**
pkey
,
X509
**
cert
,
int
PKCS12_parse
(
PKCS12
*
p12
,
const
char
*
pass
,
EVP_PKEY
**
pkey
,
X509
**
cert
,
STACK
**
ca
);
STACK
**
ca
);
PKCS12
*
PKCS12_create
(
char
*
pass
,
char
*
name
,
EVP_PKEY
*
pkey
,
X509
*
cert
,
STACK
*
ca
,
int
nid_key
,
int
nid_cert
,
int
iter
,
int
mac_iter
,
int
keytype
);
PKCS12
*
PKCS12_create
(
char
*
pass
,
char
*
name
,
EVP_PKEY
*
pkey
,
X509
*
cert
,
STACK
*
ca
,
int
nid_key
,
int
nid_cert
,
int
iter
,
int
mac_iter
,
int
keytype
);
int
i2d_PKCS12_bio
(
BIO
*
bp
,
PKCS12
*
p12
);
int
i2d_PKCS12_bio
(
BIO
*
bp
,
PKCS12
*
p12
);
int
i2d_PKCS12_fp
(
FILE
*
fp
,
PKCS12
*
p12
);
int
i2d_PKCS12_fp
(
FILE
*
fp
,
PKCS12
*
p12
);
PKCS12
*
d2i_PKCS12_bio
(
BIO
*
bp
,
PKCS12
**
p12
);
PKCS12
*
d2i_PKCS12_bio
(
BIO
*
bp
,
PKCS12
**
p12
);
...
...
crypto/x509/x509.h
浏览文件 @
69cbf468
...
@@ -929,17 +929,6 @@ EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8);
...
@@ -929,17 +929,6 @@ EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8);
PKCS8_PRIV_KEY_INFO
*
EVP_PKEY2PKCS8
(
EVP_PKEY
*
pkey
);
PKCS8_PRIV_KEY_INFO
*
EVP_PKEY2PKCS8
(
EVP_PKEY
*
pkey
);
PKCS8_PRIV_KEY_INFO
*
PKCS8_set_broken
(
PKCS8_PRIV_KEY_INFO
*
p8
,
int
broken
);
PKCS8_PRIV_KEY_INFO
*
PKCS8_set_broken
(
PKCS8_PRIV_KEY_INFO
*
p8
,
int
broken
);
/* Password based encryption routines */
int
EVP_PBE_CipherInit
(
ASN1_OBJECT
*
pbe_obj
,
const
char
*
pass
,
int
passlen
,
unsigned
char
*
salt
,
int
saltlen
,
int
iter
,
EVP_CIPHER_CTX
*
ctx
,
int
en_de
);
int
EVP_PBE_ALGOR_CipherInit
(
X509_ALGOR
*
algor
,
const
char
*
pass
,
int
passlen
,
EVP_CIPHER_CTX
*
ctx
,
int
en_de
);
int
EVP_PBE_alg_add
(
int
nid
,
EVP_CIPHER
*
cipher
,
EVP_MD
*
md
,
EVP_PBE_KEYGEN
*
keygen
);
void
EVP_PBE_cleanup
(
void
);
/* BEGIN ERROR CODES */
/* BEGIN ERROR CODES */
/* The following lines are auto generated by the script mkerr.pl. Any changes
/* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
* made after this point may be overwritten when the script is next run.
...
...
util/libeay.num
浏览文件 @
69cbf468
...
@@ -1747,3 +1747,21 @@ sk_X509_LOOKUP_delete_ptr 1771
...
@@ -1747,3 +1747,21 @@ sk_X509_LOOKUP_delete_ptr 1771
sk_X509_LOOKUP_set 1772
sk_X509_LOOKUP_set 1772
sk_PKCS7_RECIP_INFO_find 1773
sk_PKCS7_RECIP_INFO_find 1773
sk_PKCS7_RECIP_INFO_delete 1774
sk_PKCS7_RECIP_INFO_delete 1774
PKCS5_PBE_add 1775
PEM_write_bio_PKCS8 1776
i2d_PKCS8_fp 1777
PEM_read_bio_PKCS8_PRIV_KEY_INFO 1778
d2i_PKCS8_bio 1779
d2i_PKCS8_PRIV_KEY_INFO_fp 1780
PEM_write_bio_PKCS8_PRIV_KEY_INFO 1781
PEM_read_PKCS8 1782
d2i_PKCS8_PRIV_KEY_INFO_bio 1783
d2i_PKCS8_fp 1784
PEM_write_PKCS8 1785
PEM_read_PKCS8_PRIV_KEY_INFO 1786
PEM_read_bio_PKCS8 1787
PEM_write_PKCS8_PRIV_KEY_INFO 1788
PKCS5_PBE_keyivgen 1789
i2d_PKCS8_bio 1790
i2d_PKCS8_PRIV_KEY_INFO_fp 1791
i2d_PKCS8_PRIV_KEY_INFO_bio 1792
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录