Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
M
mbedtls
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
Wiki
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
esp-mirror
Mbed-TLS
mbedtls
提交
a9507c06
提交
a9507c06
编辑于
14 years ago
作者:
Paul Bakker
浏览文件
操作
下载
补丁
差异文件
- Added crl_app program to allow easy reading and printing of X509 CRLs from file
上级
96743fc5
No related branches found
No related tags found
无相关合并请求
变更
4
隐藏空白变更内容
行内
左右并排
显示
4 个更改的文件
ChangeLog
+2
-0
2 个添加, 0 个删除
ChangeLog
programs/Makefile
+5
-1
5 个添加, 1 个删除
programs/Makefile
programs/x509/CMakeLists.txt
+4
-1
4 个添加, 1 个删除
programs/x509/CMakeLists.txt
programs/x509/crl_app.c
+154
-0
154 个添加, 0 个删除
programs/x509/crl_app.c
有
165 个添加
和
2 个删除
ChangeLog
+
2
−
0
浏览文件 @
a9507c06
...
...
@@ -4,6 +4,8 @@ PolarSSL ChangeLog
Features
* Parsing PEM private keys encrypted with DES and AES
are now supported as well (Fixes ticket #5)
* Added crl_app program to allow easy reading and
printing of X509 CRLs from file
Changes
* Parsing of PEM files moved to separate module (Fixes
...
...
此差异已折叠。
点击以展开。
programs/Makefile
+
5
−
1
浏览文件 @
a9507c06
...
...
@@ -18,7 +18,7 @@ APPS = aes/aescrypt2 aes/crypt_and_hash \
ssl/ssl_server random/gen_random
\
test
/ssl_cert_test
test
/benchmark
\
test
/selftest
test
/ssl_test
\
x509/cert_app
x509/cert_app
x509/crl_app
.SILENT
:
...
...
@@ -116,6 +116,10 @@ x509/cert_app: x509/cert_app.c ../library/libpolarssl.a
echo
" CC x509/cert_app.c"
$(
CC
)
$(
CFLAGS
)
$(
OFLAGS
)
x509/cert_app.c
$(
LDFLAGS
)
-o
$@
x509/crl_app
:
x509/crl_app.c ../library/libpolarssl.a
echo
" CC x509/crl_app.c"
$(
CC
)
$(
CFLAGS
)
$(
OFLAGS
)
x509/crl_app.c
$(
LDFLAGS
)
-o
$@
clean
:
rm
-f
$(
APPS
)
此差异已折叠。
点击以展开。
programs/x509/CMakeLists.txt
+
4
−
1
浏览文件 @
a9507c06
...
...
@@ -9,6 +9,9 @@ endif(USE_PKCS11_HELPER_LIBRARY)
add_executable
(
cert_app cert_app.c
)
target_link_libraries
(
cert_app
${
libs
}
)
INSTALL
(
TARGETS cert_app
add_executable
(
crl_app crl_app.c
)
target_link_libraries
(
crl_app
${
libs
}
)
INSTALL
(
TARGETS cert_app crl_app
DESTINATION
"bin"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
此差异已折叠。
点击以展开。
programs/x509/crl_app.c
0 → 100644
+
154
−
0
浏览文件 @
a9507c06
/*
* CRL reading application
*
* Copyright (C) 2006-2010, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
#include
<string.h>
#include
<stdlib.h>
#include
<stdio.h>
#include
"polarssl/x509.h"
#define DFL_FILENAME "crl.pem"
#define DFL_DEBUG_LEVEL 0
/*
* global options
*/
struct
options
{
char
*
filename
;
/* filename of the certificate file */
int
debug_level
;
/* level of debugging */
}
opt
;
void
my_debug
(
void
*
ctx
,
int
level
,
const
char
*
str
)
{
if
(
level
<
opt
.
debug_level
)
{
fprintf
(
(
FILE
*
)
ctx
,
"%s"
,
str
);
fflush
(
(
FILE
*
)
ctx
);
}
}
#define USAGE \
"\n usage: crl_app param=<>...\n" \
"\n acceptable parameters:\n" \
" filename=%%s default: cert.crt\n" \
" debug_level=%%d default: 0 (disabled)\n" \
"\n"
int
main
(
int
argc
,
char
*
argv
[]
)
{
int
ret
=
0
;
unsigned
char
buf
[
1024
];
x509_crl
crl
;
int
i
,
j
,
n
;
char
*
p
,
*
q
;
/*
* Set to sane values
*/
memset
(
&
crl
,
0
,
sizeof
(
x509_crl
)
);
if
(
argc
==
0
)
{
usage:
printf
(
USAGE
);
goto
exit
;
}
opt
.
filename
=
DFL_FILENAME
;
opt
.
debug_level
=
DFL_DEBUG_LEVEL
;
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
n
=
strlen
(
argv
[
i
]
);
for
(
j
=
0
;
j
<
n
;
j
++
)
{
if
(
argv
[
i
][
j
]
>=
'A'
&&
argv
[
i
][
j
]
<=
'Z'
)
argv
[
i
][
j
]
|=
0x20
;
}
p
=
argv
[
i
];
if
(
(
q
=
strchr
(
p
,
'='
)
)
==
NULL
)
goto
usage
;
*
q
++
=
'\0'
;
if
(
strcmp
(
p
,
"filename"
)
==
0
)
opt
.
filename
=
q
;
else
if
(
strcmp
(
p
,
"debug_level"
)
==
0
)
{
opt
.
debug_level
=
atoi
(
q
);
if
(
opt
.
debug_level
<
0
||
opt
.
debug_level
>
65535
)
goto
usage
;
}
else
goto
usage
;
}
/*
* 1.1. Load the CRL
*/
printf
(
"
\n
. Loading the CRL ..."
);
fflush
(
stdout
);
ret
=
x509parse_crlfile
(
&
crl
,
opt
.
filename
);
if
(
ret
!=
0
)
{
printf
(
" failed
\n
! x509parse_crl returned %d
\n\n
"
,
ret
);
x509_crl_free
(
&
crl
);
goto
exit
;
}
printf
(
" ok
\n
"
);
/*
* 1.2 Print the CRL
*/
printf
(
" . CRL information ...
\n
"
);
ret
=
x509parse_crl_info
(
(
char
*
)
buf
,
sizeof
(
buf
)
-
1
,
" "
,
&
crl
);
if
(
ret
==
-
1
)
{
printf
(
" failed
\n
! x509parse_crl_info returned %d
\n\n
"
,
ret
);
x509_crl_free
(
&
crl
);
goto
exit
;
}
printf
(
"%s
\n
"
,
buf
);
exit:
x509_crl_free
(
&
crl
);
#ifdef WIN32
printf
(
" + Press Enter to exit this program.
\n
"
);
fflush
(
stdout
);
getchar
();
#endif
return
(
ret
);
}
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录