-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support new feature: add export symbol prefix #256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.已经在头文件中声明的符号,就不用在新加的头文件中重复声明了。
2.增加的头文件如果只用于符号搜所的话,而不会用于include,那就没必要搞成.h文件,是不是可以改成.txt文件?类似于util下missingssl.txt,然后只要把函数名放到里面即可,不需要完整的函数声明。符号搜所时从这个文件中找就好了,这样.c文件不用修改,.h文件也不用增加
crypto/local.h
Outdated
# endif | ||
uint32_t _armv7_tick(void); | ||
|
||
void OPENSSL_cpuid_setup(void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include/internal/cryptlib.h已经声明了OPENSSL_cpuid_setup()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include/internal/cryptlib.h已经声明了OPENSSL_cpuid_setup()
已删
ssl/s3_enc.c
Outdated
@@ -37,7 +37,7 @@ static int ssl3_generate_key_block(SSL *s, unsigned char *km, int num) | |||
EVP_MD_CTX_set_flags(m5, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); | |||
for (i = 0; (int)i < num; i += MD5_DIGEST_LENGTH) { | |||
k++; | |||
if (k > sizeof(buf)) { | |||
if (k >= sizeof(buf)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k等于sizeof(buf)有啥问题?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k等于sizeof(buf)有啥问题?
是之前我本地编译器报错临时修改的,忘记恢复了。我删掉
util/mk_symbol_prefix.pl
Outdated
"os_toebcdic" => 1, | ||
"ebcdic2ascii" => 1, | ||
"ascii2ebcdic" => 1, | ||
"HWSM4_set_encrypt_key" => 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥HWSM4_相关的函数要ignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥HWSM4_相关的函数要ignore?
已适配和删除
@@ -30,7 +30,7 @@ int MD5_Init(MD5_CTX *c) | |||
return 1; | |||
} | |||
|
|||
#ifndef md5_block_data_order | |||
#ifndef ASM_md5_block_data_order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成如果未定义ASM_md5_block_data_order则定义md5_block_data_order,跟原意不一样了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -30,7 +30,7 @@ int MD4_Init(MD4_CTX *c) | |||
return 1; | |||
} | |||
|
|||
#ifndef md4_block_data_order | |||
#ifndef ASM_md4_block_data_order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成如果未定义ASM_md4_block_data_order则定义md4_block_data_order,跟原意不一样了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成如果未定义ASM_md4_block_data_order则定义md4_block_data_order,跟原意不一样了
整个仓库除了 symbol_prefix.h 外没有 #define md4_block_data_order 的地方,所以也没有定义 ASM_md4_block_data_order,原意不变,因为 symbol_prefix.h 已经定义了宏 md4_block_data_order,如果不修改则这段代码不会被展开。
目前加这个还只是适配历史遗留的在.c 文件中声明的函数和全局变量,以后新增的函数和全局变量会尽量在自己的头文件中声明,也会自动被 perl 脚本解析,.h 文件本来就是用来放声明的地方,即使被 include 也可以(只是目前为了减少 diff,没有把声明的地方删除后 include 该文件),单独搞一个类似 missingssl.txt 的文件反而比较重。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对齐问题
If the parameter --symbol-prefix=BABA_ is configured, the prefix BABA_ will be added to the exported symbols of dynamic libraries (libssl.so, libcrypto.so) and static libraries (libssl.a, libcrypto.a), and then the corresponding macros are used to conversion (in file: include/openssl/symbol_prefix.h) to keep the interface compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If the parameter --symbol-prefix=BABA_ is configured, the prefix BABA_ will be
added to the exported symbols of dynamic libraries (libssl.so, libcrypto.so)
and static libraries (libssl.a, libcrypto.a), and then the corresponding macros
are used to conversion (in file: include/openssl/symbol_prefix.h) to keep the
interface compatible.
Checklist