Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
openssl
提交
24484759
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,发现更多精彩内容 >>
提交
24484759
编写于
9月 01, 2005
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Extend callback function to support print customization.
上级
5abe32d8
变更
15
显示空白变更内容
内联
并排
Showing
15 changed file
with
58 addition
and
36 deletion
+58
-36
crypto/asn1/asn1t.h
crypto/asn1/asn1t.h
+12
-2
crypto/asn1/nsseq.c
crypto/asn1/nsseq.c
+3
-2
crypto/asn1/p8_pkey.c
crypto/asn1/p8_pkey.c
+3
-2
crypto/asn1/tasn_dec.c
crypto/asn1/tasn_dec.c
+4
-4
crypto/asn1/tasn_enc.c
crypto/asn1/tasn_enc.c
+4
-4
crypto/asn1/tasn_fre.c
crypto/asn1/tasn_fre.c
+5
-5
crypto/asn1/tasn_new.c
crypto/asn1/tasn_new.c
+4
-4
crypto/asn1/x_crl.c
crypto/asn1/x_crl.c
+2
-1
crypto/asn1/x_pubkey.c
crypto/asn1/x_pubkey.c
+2
-1
crypto/asn1/x_req.c
crypto/asn1/x_req.c
+2
-1
crypto/asn1/x_x509.c
crypto/asn1/x_x509.c
+2
-1
crypto/dh/dh_asn1.c
crypto/dh/dh_asn1.c
+3
-2
crypto/dsa/dsa_asn1.c
crypto/dsa/dsa_asn1.c
+5
-3
crypto/pkcs7/pk7_asn1.c
crypto/pkcs7/pk7_asn1.c
+4
-2
crypto/rsa/rsa_asn1.c
crypto/rsa/rsa_asn1.c
+3
-2
未找到文件。
crypto/asn1/asn1t.h
浏览文件 @
24484759
...
...
@@ -3,7 +3,7 @@
* project 2000.
*/
/* ====================================================================
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
* Copyright (c) 2000
-2005
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
...
...
@@ -695,7 +695,8 @@ typedef struct ASN1_PRIMITIVE_FUNCS_st {
* then an external type is more appropriate.
*/
typedef
int
ASN1_aux_cb
(
int
operation
,
ASN1_VALUE
**
in
,
const
ASN1_ITEM
*
it
);
typedef
int
ASN1_aux_cb
(
int
operation
,
ASN1_VALUE
**
in
,
const
ASN1_ITEM
*
it
,
void
*
exarg
);
typedef
struct
ASN1_AUX_st
{
void
*
app_data
;
...
...
@@ -706,6 +707,13 @@ typedef struct ASN1_AUX_st {
int
enc_offset
;
/* Offset of ASN1_ENCODING structure */
}
ASN1_AUX
;
/* For print related callbacks exarg points to this structure */
typedef
struct
ASN1_PRINT_ARG_st
{
BIO
*
out
;
int
indent
;
ASN1_PCTX
*
pctx
;
}
ASN1_PRINT_ARG
;
/* Flags in ASN1_AUX */
/* Use a reference count */
...
...
@@ -725,6 +733,8 @@ typedef struct ASN1_AUX_st {
#define ASN1_OP_D2I_POST 5
#define ASN1_OP_I2D_PRE 6
#define ASN1_OP_I2D_POST 7
#define ASN1_OP_PRINT_PRE 8
#define ASN1_OP_PRINT_POST 9
/* Macro to implement a primitive type */
#define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
...
...
crypto/asn1/nsseq.c
浏览文件 @
24484759
...
...
@@ -3,7 +3,7 @@
* project 1999.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999
-2005
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
...
...
@@ -62,7 +62,8 @@
#include <openssl/x509.h>
#include <openssl/objects.h>
static
int
nsseq_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
nsseq_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
if
(
operation
==
ASN1_OP_NEW_POST
)
{
NETSCAPE_CERT_SEQUENCE
*
nsseq
;
...
...
crypto/asn1/p8_pkey.c
浏览文件 @
24484759
...
...
@@ -3,7 +3,7 @@
* project 1999.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999
-2005
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
...
...
@@ -62,7 +62,8 @@
#include <openssl/x509.h>
/* Minor tweak to operation: zero private key data */
static
int
pkey_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
pkey_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
/* Since the structure must still be valid use ASN1_OP_FREE_PRE */
if
(
operation
==
ASN1_OP_FREE_PRE
)
{
...
...
crypto/asn1/tasn_dec.c
浏览文件 @
24484759
...
...
@@ -300,7 +300,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
case
ASN1_ITYPE_CHOICE
:
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_D2I_PRE
,
pval
,
it
))
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_D2I_PRE
,
pval
,
it
,
NULL
))
goto
auxerr
;
/* Allocate structure */
...
...
@@ -350,7 +350,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
asn1_set_choice_selector
(
pval
,
i
,
it
);
*
in
=
p
;
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_D2I_POST
,
pval
,
it
))
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_D2I_POST
,
pval
,
it
,
NULL
))
goto
auxerr
;
return
1
;
...
...
@@ -397,7 +397,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
goto
err
;
}
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_D2I_PRE
,
pval
,
it
))
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_D2I_PRE
,
pval
,
it
,
NULL
))
goto
auxerr
;
/* Get each field entry */
...
...
@@ -499,7 +499,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
if
(
!
asn1_enc_save
(
pval
,
*
in
,
p
-
*
in
,
it
))
goto
auxerr
;
*
in
=
p
;
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_D2I_POST
,
pval
,
it
))
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_D2I_POST
,
pval
,
it
,
NULL
))
goto
auxerr
;
return
1
;
...
...
crypto/asn1/tasn_enc.c
浏览文件 @
24484759
...
...
@@ -157,7 +157,7 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
return
asn1_i2d_ex_primitive
(
pval
,
out
,
it
,
-
1
,
aclass
);
case
ASN1_ITYPE_CHOICE
:
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_I2D_PRE
,
pval
,
it
))
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_I2D_PRE
,
pval
,
it
,
NULL
))
return
0
;
i
=
asn1_get_choice_selector
(
pval
,
it
);
if
((
i
>=
0
)
&&
(
i
<
it
->
tcount
))
...
...
@@ -170,7 +170,7 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
-
1
,
aclass
);
}
/* Fixme: error condition if selector out of range */
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_I2D_POST
,
pval
,
it
))
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_I2D_POST
,
pval
,
it
,
NULL
))
return
0
;
break
;
...
...
@@ -215,7 +215,7 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
aclass
=
(
aclass
&
~
ASN1_TFLG_TAG_CLASS
)
|
V_ASN1_UNIVERSAL
;
}
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_I2D_PRE
,
pval
,
it
))
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_I2D_PRE
,
pval
,
it
,
NULL
))
return
0
;
/* First work out sequence content length */
for
(
i
=
0
,
tt
=
it
->
templates
;
i
<
it
->
tcount
;
tt
++
,
i
++
)
...
...
@@ -249,7 +249,7 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
}
if
(
ndef
==
2
)
ASN1_put_eoc
(
out
);
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_I2D_POST
,
pval
,
it
))
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_I2D_POST
,
pval
,
it
,
NULL
))
return
0
;
return
seqlen
;
...
...
crypto/asn1/tasn_fre.c
浏览文件 @
24484759
...
...
@@ -110,13 +110,13 @@ static void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int c
case
ASN1_ITYPE_CHOICE
:
if
(
asn1_cb
)
{
i
=
asn1_cb
(
ASN1_OP_FREE_PRE
,
pval
,
it
);
i
=
asn1_cb
(
ASN1_OP_FREE_PRE
,
pval
,
it
,
NULL
);
if
(
i
==
2
)
return
;
}
i
=
asn1_get_choice_selector
(
pval
,
it
);
if
(
asn1_cb
)
asn1_cb
(
ASN1_OP_FREE_PRE
,
pval
,
it
);
asn1_cb
(
ASN1_OP_FREE_PRE
,
pval
,
it
,
NULL
);
if
((
i
>=
0
)
&&
(
i
<
it
->
tcount
))
{
ASN1_VALUE
**
pchval
;
...
...
@@ -125,7 +125,7 @@ static void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int c
ASN1_template_free
(
pchval
,
tt
);
}
if
(
asn1_cb
)
asn1_cb
(
ASN1_OP_FREE_POST
,
pval
,
it
);
asn1_cb
(
ASN1_OP_FREE_POST
,
pval
,
it
,
NULL
);
if
(
!
combine
)
{
OPENSSL_free
(
*
pval
);
...
...
@@ -151,7 +151,7 @@ static void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int c
return
;
if
(
asn1_cb
)
{
i
=
asn1_cb
(
ASN1_OP_FREE_PRE
,
pval
,
it
);
i
=
asn1_cb
(
ASN1_OP_FREE_PRE
,
pval
,
it
,
NULL
);
if
(
i
==
2
)
return
;
}
...
...
@@ -172,7 +172,7 @@ static void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int c
ASN1_template_free
(
pseqval
,
seqtt
);
}
if
(
asn1_cb
)
asn1_cb
(
ASN1_OP_FREE_POST
,
pval
,
it
);
asn1_cb
(
ASN1_OP_FREE_POST
,
pval
,
it
,
NULL
);
if
(
!
combine
)
{
OPENSSL_free
(
*
pval
);
...
...
crypto/asn1/tasn_new.c
浏览文件 @
24484759
...
...
@@ -146,7 +146,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
case
ASN1_ITYPE_CHOICE
:
if
(
asn1_cb
)
{
i
=
asn1_cb
(
ASN1_OP_NEW_PRE
,
pval
,
it
);
i
=
asn1_cb
(
ASN1_OP_NEW_PRE
,
pval
,
it
,
NULL
);
if
(
!
i
)
goto
auxerr
;
if
(
i
==
2
)
...
...
@@ -166,7 +166,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
memset
(
*
pval
,
0
,
it
->
size
);
}
asn1_set_choice_selector
(
pval
,
-
1
,
it
);
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_NEW_POST
,
pval
,
it
))
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_NEW_POST
,
pval
,
it
,
NULL
))
goto
auxerr
;
break
;
...
...
@@ -174,7 +174,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
case
ASN1_ITYPE_SEQUENCE
:
if
(
asn1_cb
)
{
i
=
asn1_cb
(
ASN1_OP_NEW_PRE
,
pval
,
it
);
i
=
asn1_cb
(
ASN1_OP_NEW_PRE
,
pval
,
it
,
NULL
);
if
(
!
i
)
goto
auxerr
;
if
(
i
==
2
)
...
...
@@ -201,7 +201,7 @@ static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
if
(
!
ASN1_template_new
(
pseqval
,
tt
))
goto
memerr
;
}
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_NEW_POST
,
pval
,
it
))
if
(
asn1_cb
&&
!
asn1_cb
(
ASN1_OP_NEW_POST
,
pval
,
it
,
NULL
))
goto
auxerr
;
break
;
}
...
...
crypto/asn1/x_crl.c
浏览文件 @
24484759
...
...
@@ -74,7 +74,8 @@ ASN1_SEQUENCE(X509_REVOKED) = {
* Since we cache the original encoding the signature wont be affected by
* reordering of the revoked field.
*/
static
int
crl_inf_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
crl_inf_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
X509_CRL_INFO
*
a
=
(
X509_CRL_INFO
*
)
*
pval
;
...
...
crypto/asn1/x_pubkey.c
浏览文件 @
24484759
...
...
@@ -68,7 +68,8 @@
#endif
/* Minor tweak to operation: free up EVP_PKEY */
static
int
pubkey_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
pubkey_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
if
(
operation
==
ASN1_OP_FREE_POST
)
{
...
...
crypto/asn1/x_req.c
浏览文件 @
24484759
...
...
@@ -79,7 +79,8 @@
*
*/
static
int
rinf_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
rinf_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
X509_REQ_INFO
*
rinf
=
(
X509_REQ_INFO
*
)
*
pval
;
...
...
crypto/asn1/x_x509.c
浏览文件 @
24484759
...
...
@@ -81,7 +81,8 @@ IMPLEMENT_ASN1_FUNCTIONS(X509_CINF)
extern
void
policy_cache_free
(
X509_POLICY_CACHE
*
cache
);
static
int
x509_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
x509_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
X509
*
ret
=
(
X509
*
)
*
pval
;
...
...
crypto/dh/dh_asn1.c
浏览文件 @
24484759
...
...
@@ -3,7 +3,7 @@
* project 2000.
*/
/* ====================================================================
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
* Copyright (c) 2000
-2005
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
...
...
@@ -64,7 +64,8 @@
#include <openssl/asn1t.h>
/* Override the default free and new methods */
static
int
dh_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
dh_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
if
(
operation
==
ASN1_OP_NEW_PRE
)
{
*
pval
=
(
ASN1_VALUE
*
)
DH_new
();
...
...
crypto/dsa/dsa_asn1.c
浏览文件 @
24484759
...
...
@@ -3,7 +3,7 @@
* project 2000.
*/
/* ====================================================================
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
* Copyright (c) 2000
-2005
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
...
...
@@ -63,7 +63,8 @@
#include <openssl/asn1t.h>
/* Override the default new methods */
static
int
sig_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
sig_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
if
(
operation
==
ASN1_OP_NEW_PRE
)
{
DSA_SIG
*
sig
;
...
...
@@ -86,7 +87,8 @@ ASN1_SEQUENCE_cb(DSA_SIG, sig_cb) = {
IMPLEMENT_ASN1_FUNCTIONS_const
(
DSA_SIG
)
/* Override the default free and new methods */
static
int
dsa_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
dsa_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
if
(
operation
==
ASN1_OP_NEW_PRE
)
{
*
pval
=
(
ASN1_VALUE
*
)
DSA_new
();
...
...
crypto/pkcs7/pk7_asn1.c
浏览文件 @
24484759
...
...
@@ -98,7 +98,8 @@ ASN1_NDEF_SEQUENCE(PKCS7_SIGNED) = {
IMPLEMENT_ASN1_FUNCTIONS
(
PKCS7_SIGNED
)
/* Minor tweak to operation: free up EVP_PKEY */
static
int
si_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
si_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
if
(
operation
==
ASN1_OP_FREE_POST
)
{
PKCS7_SIGNER_INFO
*
si
=
(
PKCS7_SIGNER_INFO
*
)
*
pval
;
...
...
@@ -140,7 +141,8 @@ ASN1_NDEF_SEQUENCE(PKCS7_ENVELOPE) = {
IMPLEMENT_ASN1_FUNCTIONS
(
PKCS7_ENVELOPE
)
/* Minor tweak to operation: free up X509 */
static
int
ri_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
ri_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
if
(
operation
==
ASN1_OP_FREE_POST
)
{
PKCS7_RECIP_INFO
*
ri
=
(
PKCS7_RECIP_INFO
*
)
*
pval
;
...
...
crypto/rsa/rsa_asn1.c
浏览文件 @
24484759
...
...
@@ -3,7 +3,7 @@
* project 2000.
*/
/* ====================================================================
* Copyright (c) 2000 The OpenSSL Project. All rights reserved.
* Copyright (c) 2000
-2005
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
...
...
@@ -63,7 +63,8 @@
#include <openssl/asn1t.h>
/* Override the default free and new methods */
static
int
rsa_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
)
static
int
rsa_cb
(
int
operation
,
ASN1_VALUE
**
pval
,
const
ASN1_ITEM
*
it
,
void
*
exarg
)
{
if
(
operation
==
ASN1_OP_NEW_PRE
)
{
*
pval
=
(
ASN1_VALUE
*
)
RSA_new
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录