Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
e76f935e
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看板
提交
e76f935e
编写于
12月 22, 1999
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support for ASN1 NULL type.
上级
15df5802
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
142 addition
and
3 deletion
+142
-3
CHANGES
CHANGES
+7
-0
crypto/asn1/Makefile.ssl
crypto/asn1/Makefile.ssl
+2
-2
crypto/asn1/a_null.c
crypto/asn1/a_null.c
+119
-0
crypto/asn1/asn1.h
crypto/asn1/asn1.h
+10
-0
crypto/asn1/asn1_err.c
crypto/asn1/asn1_err.c
+3
-0
crypto/asn1/asn1_mac.h
crypto/asn1/asn1_mac.h
+1
-1
未找到文件。
CHANGES
浏览文件 @
e76f935e
...
@@ -4,6 +4,13 @@
...
@@ -4,6 +4,13 @@
Changes between 0.9.4 and 0.9.5 [xx XXX 1999]
Changes between 0.9.4 and 0.9.5 [xx XXX 1999]
*) Support for ASN1 "NULL" type. This could be handled before by using
ASN1_TYPE but there wasn't any function that would try to read a NULL
and produce an error if it couldn't. For compatability we also have
ASN1_NULL_new() and ASN1_NULL_free() functions but these are faked and
don't allocate anything because they don't need to.
[Steve Henson]
*) Initial support for MacOS is now provided. Examine INSTALL.MacOS
*) Initial support for MacOS is now provided. Examine INSTALL.MacOS
for details.
for details.
[Andy Polyakov, Roy Woods <roy@centicsystems.ca>]
[Andy Polyakov, Roy Woods <roy@centicsystems.ca>]
...
...
crypto/asn1/Makefile.ssl
浏览文件 @
e76f935e
...
@@ -23,7 +23,7 @@ APPS=
...
@@ -23,7 +23,7 @@ APPS=
LIB
=
$(TOP)
/libcrypto.a
LIB
=
$(TOP)
/libcrypto.a
LIBSRC
=
a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c
\
LIBSRC
=
a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c
\
a_print.c a_type.c a_set.c a_dup.c a_d2i_fp.c a_i2d_fp.c a_bmp.c
\
a_
null.c a_
print.c a_type.c a_set.c a_dup.c a_d2i_fp.c a_i2d_fp.c a_bmp.c
\
a_enum.c a_vis.c a_utf8.c a_sign.c a_digest.c a_verify.c a_mbstr.c
\
a_enum.c a_vis.c a_utf8.c a_sign.c a_digest.c a_verify.c a_mbstr.c
\
x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c
\
x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c
\
x_name.c x_cinf.c x_x509.c x_x509a.c x_crl.c x_info.c x_spki.c nsseq.c
\
x_name.c x_cinf.c x_x509.c x_x509a.c x_crl.c x_info.c x_spki.c nsseq.c
\
...
@@ -38,7 +38,7 @@ LIBSRC= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \
...
@@ -38,7 +38,7 @@ LIBSRC= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \
asn1_par.c asn1_lib.c asn1_err.c a_meth.c a_bytes.c a_strnid.c
\
asn1_par.c asn1_lib.c asn1_err.c a_meth.c a_bytes.c a_strnid.c
\
evp_asn1.c asn_pack.c p5_pbe.c p5_pbev2.c p8_pkey.c
evp_asn1.c asn_pack.c p5_pbe.c p5_pbev2.c p8_pkey.c
LIBOBJ
=
a_object.o a_bitstr.o a_utctm.o a_gentm.o a_time.o a_int.o a_octet.o
\
LIBOBJ
=
a_object.o a_bitstr.o a_utctm.o a_gentm.o a_time.o a_int.o a_octet.o
\
a_print.o a_type.o a_set.o a_dup.o a_d2i_fp.o a_i2d_fp.o a_bmp.o
\
a_
null.o a_
print.o a_type.o a_set.o a_dup.o a_d2i_fp.o a_i2d_fp.o a_bmp.o
\
a_enum.o a_vis.o a_utf8.o a_sign.o a_digest.o a_verify.o a_mbstr.o
\
a_enum.o a_vis.o a_utf8.o a_sign.o a_digest.o a_verify.o a_mbstr.o
\
x_algor.o x_val.o x_pubkey.o x_sig.o x_req.o x_attrib.o
\
x_algor.o x_val.o x_pubkey.o x_sig.o x_req.o x_attrib.o
\
x_name.o x_cinf.o x_x509.o x_x509a.o x_crl.o x_info.o x_spki.o nsseq.o
\
x_name.o x_cinf.o x_x509.o x_x509a.o x_crl.o x_info.o x_spki.o nsseq.o
\
...
...
crypto/asn1/a_null.c
0 → 100644
浏览文件 @
e76f935e
/* a_null.c */
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
* project 1999.
*/
/* ====================================================================
* Copyright (c) 1999 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
* are met:
*
* 1. Redistributions of source code must retain the above 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.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/asn1.h>
/* ASN1 functions for NULL type. For compatability with other ASN1 code
* it returns a pointer to an "ASN1_NULL" structure. The new/free functions
* don't need to do any allocating because nothing is stored in a NULL.
*/
int
i2d_ASN1_NULL
(
ASN1_NULL
*
a
,
unsigned
char
**
pp
)
{
if
(
!
a
)
return
0
;
if
(
pp
)
ASN1_put_object
(
pp
,
0
,
0
,
V_ASN1_NULL
,
V_ASN1_UNIVERSAL
);
return
2
;
}
ASN1_NULL
*
d2i_ASN1_NULL
(
ASN1_NULL
**
a
,
unsigned
char
**
pp
,
long
length
)
{
ASN1_NULL
*
ret
=
NULL
;
unsigned
char
*
p
;
long
len
;
int
inf
,
tag
,
xclass
;
int
i
=
0
;
p
=
*
pp
;
inf
=
ASN1_get_object
(
&
p
,
&
len
,
&
tag
,
&
xclass
,
length
);
if
(
inf
&
0x80
)
{
i
=
ASN1_R_BAD_OBJECT_HEADER
;
goto
err
;
}
if
(
tag
!=
V_ASN1_NULL
)
{
i
=
ASN1_R_EXPECTING_A_NULL
;
goto
err
;
}
if
(
len
!=
0
)
{
i
=
ASN1_R_NULL_IS_WRONG_LENGTH
;
goto
err
;
}
ret
=
(
ASN1_NULL
*
)
1
;
if
(
a
!=
NULL
)
(
*
a
)
=
ret
;
*
pp
=
p
;
return
(
ret
);
err:
ASN1err
(
ASN1_F_D2I_ASN1_NULL
,
i
);
return
(
ret
);
}
ASN1_NULL
*
ASN1_NULL_new
(
void
)
{
return
(
ASN1_NULL
*
)
1
;
}
void
ASN1_NULL_free
(
ASN1_NULL
*
a
)
{
return
;
}
crypto/asn1/asn1.h
浏览文件 @
e76f935e
...
@@ -268,6 +268,8 @@ typedef struct asn1_string_st ASN1_VISIBLESTRING;
...
@@ -268,6 +268,8 @@ typedef struct asn1_string_st ASN1_VISIBLESTRING;
typedef
struct
asn1_string_st
ASN1_UTF8STRING
;
typedef
struct
asn1_string_st
ASN1_UTF8STRING
;
#endif
#endif
typedef
int
ASN1_NULL
;
typedef
struct
asn1_type_st
typedef
struct
asn1_type_st
{
{
int
type
;
int
type
;
...
@@ -599,6 +601,11 @@ int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a,unsigned char **pp);
...
@@ -599,6 +601,11 @@ int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a,unsigned char **pp);
ASN1_UTF8STRING
*
d2i_ASN1_UTF8STRING
(
ASN1_UTF8STRING
**
a
,
ASN1_UTF8STRING
*
d2i_ASN1_UTF8STRING
(
ASN1_UTF8STRING
**
a
,
unsigned
char
**
pp
,
long
length
);
unsigned
char
**
pp
,
long
length
);
ASN1_NULL
*
ASN1_NULL_new
(
void
);
void
ASN1_NULL_free
(
ASN1_NULL
*
a
);
int
i2d_ASN1_NULL
(
ASN1_NULL
*
a
,
unsigned
char
**
pp
);
ASN1_NULL
*
d2i_ASN1_NULL
(
ASN1_NULL
**
a
,
unsigned
char
**
pp
,
long
length
);
ASN1_BMPSTRING
*
ASN1_BMPSTRING_new
(
void
);
ASN1_BMPSTRING
*
ASN1_BMPSTRING_new
(
void
);
void
ASN1_BMPSTRING_free
(
ASN1_BMPSTRING
*
a
);
void
ASN1_BMPSTRING_free
(
ASN1_BMPSTRING
*
a
);
int
i2d_ASN1_BMPSTRING
(
ASN1_BMPSTRING
*
a
,
unsigned
char
**
pp
);
int
i2d_ASN1_BMPSTRING
(
ASN1_BMPSTRING
*
a
,
unsigned
char
**
pp
);
...
@@ -832,6 +839,7 @@ void ASN1_STRING_TABLE_cleanup(void);
...
@@ -832,6 +839,7 @@ void ASN1_STRING_TABLE_cleanup(void);
#define ASN1_F_D2I_ASN1_GENERALIZEDTIME 223
#define ASN1_F_D2I_ASN1_GENERALIZEDTIME 223
#define ASN1_F_D2I_ASN1_HEADER 127
#define ASN1_F_D2I_ASN1_HEADER 127
#define ASN1_F_D2I_ASN1_INTEGER 128
#define ASN1_F_D2I_ASN1_INTEGER 128
#define ASN1_F_D2I_ASN1_NULL 292
#define ASN1_F_D2I_ASN1_OBJECT 129
#define ASN1_F_D2I_ASN1_OBJECT 129
#define ASN1_F_D2I_ASN1_OCTET_STRING 130
#define ASN1_F_D2I_ASN1_OCTET_STRING 130
#define ASN1_F_D2I_ASN1_PRINT_TYPE 131
#define ASN1_F_D2I_ASN1_PRINT_TYPE 131
...
@@ -1002,6 +1010,7 @@ void ASN1_STRING_TABLE_cleanup(void);
...
@@ -1002,6 +1010,7 @@ void ASN1_STRING_TABLE_cleanup(void);
#define ASN1_R_EXPECTING_A_BIT_STRING 116
#define ASN1_R_EXPECTING_A_BIT_STRING 116
#define ASN1_R_EXPECTING_A_BOOLEAN 117
#define ASN1_R_EXPECTING_A_BOOLEAN 117
#define ASN1_R_EXPECTING_A_GENERALIZEDTIME 151
#define ASN1_R_EXPECTING_A_GENERALIZEDTIME 151
#define ASN1_R_EXPECTING_A_NULL 164
#define ASN1_R_EXPECTING_A_TIME 152
#define ASN1_R_EXPECTING_A_TIME 152
#define ASN1_R_EXPECTING_A_UTCTIME 118
#define ASN1_R_EXPECTING_A_UTCTIME 118
#define ASN1_R_FIRST_NUM_TOO_LARGE 119
#define ASN1_R_FIRST_NUM_TOO_LARGE 119
...
@@ -1019,6 +1028,7 @@ void ASN1_STRING_TABLE_cleanup(void);
...
@@ -1019,6 +1028,7 @@ void ASN1_STRING_TABLE_cleanup(void);
#define ASN1_R_MISSING_SECOND_NUMBER 126
#define ASN1_R_MISSING_SECOND_NUMBER 126
#define ASN1_R_NON_HEX_CHARACTERS 127
#define ASN1_R_NON_HEX_CHARACTERS 127
#define ASN1_R_NOT_ENOUGH_DATA 128
#define ASN1_R_NOT_ENOUGH_DATA 128
#define ASN1_R_NULL_IS_WRONG_LENGTH 165
#define ASN1_R_ODD_NUMBER_OF_CHARS 129
#define ASN1_R_ODD_NUMBER_OF_CHARS 129
#define ASN1_R_PARSING 130
#define ASN1_R_PARSING 130
#define ASN1_R_PRIVATE_KEY_HEADER_MISSING 131
#define ASN1_R_PRIVATE_KEY_HEADER_MISSING 131
...
...
crypto/asn1/asn1_err.c
浏览文件 @
e76f935e
...
@@ -112,6 +112,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
...
@@ -112,6 +112,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_GENERALIZEDTIME
,
0
),
"d2i_ASN1_GENERALIZEDTIME"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_GENERALIZEDTIME
,
0
),
"d2i_ASN1_GENERALIZEDTIME"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_HEADER
,
0
),
"d2i_ASN1_HEADER"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_HEADER
,
0
),
"d2i_ASN1_HEADER"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_INTEGER
,
0
),
"d2i_ASN1_INTEGER"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_INTEGER
,
0
),
"d2i_ASN1_INTEGER"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_NULL
,
0
),
"d2i_ASN1_NULL"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_OBJECT
,
0
),
"d2i_ASN1_OBJECT"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_OBJECT
,
0
),
"d2i_ASN1_OBJECT"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_OCTET_STRING
,
0
),
"d2i_ASN1_OCTET_STRING"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_OCTET_STRING
,
0
),
"d2i_ASN1_OCTET_STRING"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_PRINT_TYPE
,
0
),
"D2I_ASN1_PRINT_TYPE"
},
{
ERR_PACK
(
0
,
ASN1_F_D2I_ASN1_PRINT_TYPE
,
0
),
"D2I_ASN1_PRINT_TYPE"
},
...
@@ -285,6 +286,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
...
@@ -285,6 +286,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
{
ASN1_R_EXPECTING_A_BIT_STRING
,
"expecting a bit string"
},
{
ASN1_R_EXPECTING_A_BIT_STRING
,
"expecting a bit string"
},
{
ASN1_R_EXPECTING_A_BOOLEAN
,
"expecting a boolean"
},
{
ASN1_R_EXPECTING_A_BOOLEAN
,
"expecting a boolean"
},
{
ASN1_R_EXPECTING_A_GENERALIZEDTIME
,
"expecting a generalizedtime"
},
{
ASN1_R_EXPECTING_A_GENERALIZEDTIME
,
"expecting a generalizedtime"
},
{
ASN1_R_EXPECTING_A_NULL
,
"expecting a null"
},
{
ASN1_R_EXPECTING_A_TIME
,
"expecting a time"
},
{
ASN1_R_EXPECTING_A_TIME
,
"expecting a time"
},
{
ASN1_R_EXPECTING_A_UTCTIME
,
"expecting a utctime"
},
{
ASN1_R_EXPECTING_A_UTCTIME
,
"expecting a utctime"
},
{
ASN1_R_FIRST_NUM_TOO_LARGE
,
"first num too large"
},
{
ASN1_R_FIRST_NUM_TOO_LARGE
,
"first num too large"
},
...
@@ -302,6 +304,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
...
@@ -302,6 +304,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]=
{
ASN1_R_MISSING_SECOND_NUMBER
,
"missing second number"
},
{
ASN1_R_MISSING_SECOND_NUMBER
,
"missing second number"
},
{
ASN1_R_NON_HEX_CHARACTERS
,
"non hex characters"
},
{
ASN1_R_NON_HEX_CHARACTERS
,
"non hex characters"
},
{
ASN1_R_NOT_ENOUGH_DATA
,
"not enough data"
},
{
ASN1_R_NOT_ENOUGH_DATA
,
"not enough data"
},
{
ASN1_R_NULL_IS_WRONG_LENGTH
,
"null is wrong length"
},
{
ASN1_R_ODD_NUMBER_OF_CHARS
,
"odd number of chars"
},
{
ASN1_R_ODD_NUMBER_OF_CHARS
,
"odd number of chars"
},
{
ASN1_R_PARSING
,
"parsing"
},
{
ASN1_R_PARSING
,
"parsing"
},
{
ASN1_R_PRIVATE_KEY_HEADER_MISSING
,
"private key header missing"
},
{
ASN1_R_PRIVATE_KEY_HEADER_MISSING
,
"private key header missing"
},
...
...
crypto/asn1/asn1_mac.h
浏览文件 @
e76f935e
...
@@ -111,7 +111,7 @@ err:\
...
@@ -111,7 +111,7 @@ err:\
c.slen = length;
c.slen = length;
/* End reading ASN1 with no check on length */
/* End reading ASN1 with no check on length */
#define M_ASN1_D2I_Finish_nolen() \
#define M_ASN1_D2I_Finish_nolen(
a, func, e
) \
*pp=c.p; \
*pp=c.p; \
if (a != NULL) (*a)=ret; \
if (a != NULL) (*a)=ret; \
return(ret); \
return(ret); \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录