Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
2e430277
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,发现更多精彩内容 >>
提交
2e430277
编写于
3月 15, 2015
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make ASN1_OBJECT opaque
Reviewed-by:
N
Matt Caswell
<
matt@openssl.org
>
上级
7b68c30d
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
56 addition
and
20 deletion
+56
-20
crypto/asn1/a_object.c
crypto/asn1/a_object.c
+1
-0
crypto/asn1/asn1.h
crypto/asn1/asn1.h
+0
-16
crypto/asn1/asn_moid.c
crypto/asn1/asn_moid.c
+1
-0
crypto/asn1/tasn_enc.c
crypto/asn1/tasn_enc.c
+1
-0
crypto/evp/evp_lib.c
crypto/evp/evp_lib.c
+1
-1
crypto/include/internal/asn1_int.h
crypto/include/internal/asn1_int.h
+16
-0
crypto/objects/obj_dat.c
crypto/objects/obj_dat.c
+15
-0
crypto/objects/obj_lib.c
crypto/objects/obj_lib.c
+1
-0
crypto/objects/objects.h
crypto/objects/objects.h
+3
-0
crypto/rsa/rsa_sign.c
crypto/rsa/rsa_sign.c
+1
-1
doc/crypto/OBJ_nid2obj.pod
doc/crypto/OBJ_nid2obj.pod
+14
-0
engines/e_4758cca.c
engines/e_4758cca.c
+2
-2
未找到文件。
crypto/asn1/a_object.c
浏览文件 @
2e430277
...
...
@@ -63,6 +63,7 @@
#include <openssl/asn1.h>
#include <openssl/objects.h>
#include <openssl/bn.h>
#include "internal/asn1_int.h"
int
i2d_ASN1_OBJECT
(
ASN1_OBJECT
*
a
,
unsigned
char
**
pp
)
{
...
...
crypto/asn1/asn1.h
浏览文件 @
2e430277
...
...
@@ -194,22 +194,6 @@ typedef struct asn1_const_ctx_st {
int
line
;
/* used in error processing */
}
ASN1_const_CTX
;
/*
* These are used internally in the ASN1_OBJECT to keep track of whether the
* names and data need to be free()ed
*/
# define ASN1_OBJECT_FLAG_DYNAMIC 0x01
/* internal use */
# define ASN1_OBJECT_FLAG_CRITICAL 0x02
/* critical x509v3 object id */
# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04
/* internal use */
# define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08
/* internal use */
struct
asn1_object_st
{
const
char
*
sn
,
*
ln
;
int
nid
;
int
length
;
const
unsigned
char
*
data
;
/* data remains const after init */
int
flags
;
/* Should we free this one */
};
# define ASN1_STRING_FLAG_BITS_LEFT 0x08
/* Set if 0x07 has bits left value */
/*
* This indicates that the ASN1_STRING is not a real value but just a place
...
...
crypto/asn1/asn_moid.c
浏览文件 @
2e430277
...
...
@@ -64,6 +64,7 @@
#include <openssl/conf.h>
#include <openssl/dso.h>
#include <openssl/x509.h>
#include "internal/asn1_int.h"
/* Simple ASN1 OID module: add all objects in a given section */
...
...
crypto/asn1/tasn_enc.c
浏览文件 @
2e430277
...
...
@@ -63,6 +63,7 @@
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/objects.h>
#include "internal/asn1_int.h"
static
int
asn1_i2d_ex_primitive
(
ASN1_VALUE
**
pval
,
unsigned
char
**
out
,
const
ASN1_ITEM
*
it
,
int
tag
,
int
aclass
);
...
...
crypto/evp/evp_lib.c
浏览文件 @
2e430277
...
...
@@ -176,7 +176,7 @@ int EVP_CIPHER_type(const EVP_CIPHER *ctx)
default:
/* Check it has an OID and it is valid */
otmp
=
OBJ_nid2obj
(
nid
);
if
(
!
otmp
||
!
otmp
->
data
)
if
(
OBJ_get0_data
(
otmp
)
==
NULL
)
nid
=
NID_undef
;
ASN1_OBJECT_free
(
otmp
);
return
nid
;
...
...
crypto/include/internal/asn1_int.h
浏览文件 @
2e430277
...
...
@@ -103,3 +103,19 @@ struct evp_pkey_asn1_method_st {
X509_ALGOR
*
alg1
,
X509_ALGOR
*
alg2
,
ASN1_BIT_STRING
*
sig
);
}
/* EVP_PKEY_ASN1_METHOD */
;
/*
* These are used internally in the ASN1_OBJECT to keep track of whether the
* names and data need to be free()ed
*/
# define ASN1_OBJECT_FLAG_DYNAMIC 0x01
/* internal use */
# define ASN1_OBJECT_FLAG_CRITICAL 0x02
/* critical x509v3 object id */
# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04
/* internal use */
# define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08
/* internal use */
struct
asn1_object_st
{
const
char
*
sn
,
*
ln
;
int
nid
;
int
length
;
const
unsigned
char
*
data
;
/* data remains const after init */
int
flags
;
/* Should we free this one */
};
crypto/objects/obj_dat.c
浏览文件 @
2e430277
...
...
@@ -64,6 +64,7 @@
#include <openssl/asn1.h>
#include <openssl/objects.h>
#include <openssl/bn.h>
#include "internal/asn1_int.h"
/* obj_dat.h is generated from objects.h by obj_dat.pl */
#include "obj_dat.h"
...
...
@@ -781,3 +782,17 @@ int OBJ_create(const char *oid, const char *sn, const char *ln)
OPENSSL_free
(
buf
);
return
(
ok
);
}
size_t
OBJ_length
(
const
ASN1_OBJECT
*
obj
)
{
if
(
obj
==
NULL
)
return
0
;
return
obj
->
length
;
}
const
unsigned
char
*
OBJ_get0_data
(
const
ASN1_OBJECT
*
obj
)
{
if
(
obj
==
NULL
)
return
NULL
;
return
obj
->
data
;
}
crypto/objects/obj_lib.c
浏览文件 @
2e430277
...
...
@@ -61,6 +61,7 @@
#include <openssl/lhash.h>
#include <openssl/objects.h>
#include <openssl/buffer.h>
#include "internal/asn1_int.h"
ASN1_OBJECT
*
OBJ_dup
(
const
ASN1_OBJECT
*
o
)
{
...
...
crypto/objects/objects.h
浏览文件 @
2e430277
...
...
@@ -1107,6 +1107,9 @@ int OBJ_create(const char *oid, const char *sn, const char *ln);
void
OBJ_cleanup
(
void
);
int
OBJ_create_objects
(
BIO
*
in
);
size_t
OBJ_length
(
const
ASN1_OBJECT
*
obj
);
const
unsigned
char
*
OBJ_get0_data
(
const
ASN1_OBJECT
*
obj
);
int
OBJ_find_sigid_algs
(
int
signid
,
int
*
pdig_nid
,
int
*
ppkey_nid
);
int
OBJ_find_sigid_by_algs
(
int
*
psignid
,
int
dig_nid
,
int
pkey_nid
);
int
OBJ_add_sigid
(
int
signid
,
int
dig_id
,
int
pkey_id
);
...
...
crypto/rsa/rsa_sign.c
浏览文件 @
2e430277
...
...
@@ -95,7 +95,7 @@ int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
RSAerr
(
RSA_F_RSA_SIGN
,
RSA_R_UNKNOWN_ALGORITHM_TYPE
);
return
(
0
);
}
if
(
sig
.
algor
->
algorithm
->
length
==
0
)
{
if
(
OBJ_length
(
sig
.
algor
->
algorithm
)
==
0
)
{
RSAerr
(
RSA_F_RSA_SIGN
,
RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD
);
return
(
0
);
...
...
doc/crypto/OBJ_nid2obj.pod
浏览文件 @
2e430277
...
...
@@ -29,6 +29,9 @@ functions
int OBJ_create(const char *oid,const char *sn,const char *ln);
void OBJ_cleanup(void);
size_t OBJ_length(const ASN1_OBJECT *obj);
const unsigned char *OBJ_get0_data(const ASN1_OBJECT *obj);
=head1 DESCRIPTION
The ASN1 object utility functions process ASN1_OBJECT structures which are
...
...
@@ -70,6 +73,11 @@ OBJ_cleanup() cleans up OpenSSLs internal object table: this should
be called before an application exits if any new objects were added
using OBJ_create().
OBJ_length() returns the size of the content octets of B<obj>.
OBJ_get0_data() returns a pointer to the content octets of B<obj>.
The returned pointer is an internal pointer which B<must not> be freed.
=head1 NOTES
Objects in OpenSSL can have a short name, a long name and a numerical
...
...
@@ -96,6 +104,12 @@ Objects do not need to be in the internal tables to be processed,
the functions OBJ_txt2obj() and OBJ_obj2txt() can process the numerical
form of an OID.
Some objects are used to reprsent algorithms which do not have a
corresponding ASN.1 OBJECT IDENTIFIER encoding (for example no OID currently
exists for a particular algorithm). As a result they B<cannot> be encoded or
decoded as part of ASN.1 structures. Applications can determine if there
is a corresponding OBJECT IDENTIFIER by checking OBJ_length() is not zero.
=head1 EXAMPLES
Create an object for B<commonName>:
...
...
engines/e_4758cca.c
浏览文件 @
2e430277
...
...
@@ -641,7 +641,7 @@ static int cca_rsa_verify(int type, const unsigned char *m,
return
0
;
}
if
(
!
algorithm
.
algorithm
->
length
)
{
if
(
!
OBJ_length
(
algorithm
.
algorithm
)
)
{
CCA4758err
(
CCA4758_F_CCA_RSA_VERIFY
,
CCA4758_R_ASN1_OID_UNKNOWN_FOR_MD
);
return
0
;
...
...
@@ -754,7 +754,7 @@ static int cca_rsa_sign(int type, const unsigned char *m, unsigned int m_len,
return
0
;
}
if
(
!
algorithm
.
algorithm
->
length
)
{
if
(
!
OBJ_length
(
algorithm
.
algorithm
)
)
{
CCA4758err
(
CCA4758_F_CCA_RSA_SIGN
,
CCA4758_R_ASN1_OID_UNKNOWN_FOR_MD
);
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录