Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
a99f06df
提交
a99f06df
authored
7月 08, 2014
作者:
Michael Jerris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sync changes from srtp upstream
上级
ebe4238a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
156 行增加
和
56 行删除
+156
-56
README
libs/srtp/README
+25
-10
Makefile.in
libs/srtp/crypto/Makefile.in
+4
-5
aes_icm.c
libs/srtp/crypto/cipher/aes_icm.c
+6
-2
null_cipher.c
libs/srtp/crypto/cipher/null_cipher.c
+0
-1
null_auth.c
libs/srtp/crypto/hash/null_auth.c
+0
-1
aes_icm.h
libs/srtp/crypto/include/aes_icm.h
+3
-0
ut_sim.c
libs/srtp/crypto/replay/ut_sim.c
+1
-0
ctr_prng.c
libs/srtp/crypto/rng/ctr_prng.c
+1
-3
aes_calc.c
libs/srtp/crypto/test/aes_calc.c
+1
-1
rand_gen_soak.c
libs/srtp/crypto/test/rand_gen_soak.c
+76
-0
libsrtp.pdf
libs/srtp/doc/libsrtp.pdf
+0
-0
ekt.c
libs/srtp/srtp/ekt.c
+0
-1
srtp.c
libs/srtp/srtp/srtp.c
+39
-32
rtpw_test_gcm.sh
libs/srtp/test/rtpw_test_gcm.sh
+0
-0
没有找到文件。
libs/srtp/README
浏览文件 @
a99f06df
...
...
@@ -29,7 +29,7 @@ The configure script accepts the following options:
--enable-openssl use OpenSSL crypto primitives
--gdoi use GDOI key management (disabled at present)
By default, deb
bu
ging is enabled and stdout is used for debugging.
By default, deb
ug
ging is enabled and stdout is used for debugging.
You can use the above configure options to have the debugging output
sent to syslog or the system console. Alternatively, you can define
ERR_REPORTING_FILE in include/conf.h to be any other file that can be
...
...
@@ -87,15 +87,30 @@ or rtpw -l
which the dictionary will be sent, respectively.
options:
-a use message authentication
-e <key size> use encryption (use 128, 192, or 256 for key size)
-g Use AES-GCM mode (must be used with -e)
-k <key> sets the srtp master key
-s act as rtp sender
-r act as rtp receiver
-l list debug modules
-d <debug> turn on debugging for module <debug>
-i specify input/output file
-s (s)rtp sender - causes app to send words
-r (s)rtp receive - causes app to receive words
-k <key> use srtp master key <key>, where the
key is a hexadecimal value (without the
leading "0x")
-e <keysize> encrypt/decrypt (for data confidentiality)
(requires use of -k option as well)
(use 128, 192, or 256 for keysize)
-g use AES-GCM mode (must be used with -e)
-a message authentication
(requires use of -k option as well)
-l list debug modules
-d <debug> turn on debugging for module <debug>
-i specify input/output file
(instead of using dictionary file)
In order to get random 30-byte values for use as key/salt pairs , you
can use the following bash function to format the output of
...
...
libs/srtp/crypto/Makefile.in
浏览文件 @
a99f06df
...
...
@@ -40,15 +40,14 @@ endif
dummy
:
all runtest
# test applications
ifneq
(1,
$(USE_OPENSSL))
AES_CALC
=
test
/aes_calc
$(EXE)
endif
testapp
=
#
test/cipher_driver
$(EXE)
test
/datatypes_driver
$(EXE)
\
#
test/stat_driver
$(EXE)
test
/sha1_driver
$(EXE)
\
#
test/kernel_driver
$(EXE)
$(AES_CALC)
test
/rand_gen
$(EXE)
\
#
test/env
$(EXE)
testapp
=
test
/cipher_driver
$(EXE)
test
/datatypes_driver
$(EXE)
\
test
/stat_driver
$(EXE)
test
/sha1_driver
$(EXE)
\
test
/kernel_driver
$(EXE)
$(AES_CALC)
test
/rand_gen
$(EXE)
\
test
/env
$(EXE)
# data values used to test the aes_calc application for AES-128
k128
=
000102030405060708090a0b0c0d0e0f
...
...
libs/srtp/crypto/cipher/aes_icm.c
浏览文件 @
a99f06df
...
...
@@ -395,7 +395,7 @@ aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
for
(
i
=
0
;
i
<
(
bytes_to_encr
/
sizeof
(
v128_t
));
i
++
)
{
/* fill buffer with new keystream */
aes_icm_advance_ismacryp
(
c
,
(
uint8_t
)
forIsmacryp
);
aes_icm_advance_ismacryp
(
c
,
forIsmacryp
);
/*
* add keystream into the data buffer (this would be a lot faster
...
...
@@ -443,7 +443,7 @@ aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c,
if
((
bytes_to_encr
&
0xf
)
!=
0
)
{
/* fill buffer with new keystream */
aes_icm_advance_ismacryp
(
c
,
(
uint8_t
)
forIsmacryp
);
aes_icm_advance_ismacryp
(
c
,
forIsmacryp
);
for
(
i
=
0
;
i
<
(
bytes_to_encr
&
0xf
);
i
++
)
*
buf
++
^=
c
->
keystream_buffer
.
v8
[
i
];
...
...
@@ -476,6 +476,10 @@ aes_icm_output(aes_icm_ctx_t *c, uint8_t *buffer, int num_octets_to_output) {
return
aes_icm_encrypt
(
c
,
buffer
,
&
len
);
}
uint16_t
aes_icm_bytes_encrypted
(
aes_icm_ctx_t
*
c
)
{
return
htons
(
c
->
counter
.
v16
[
7
]);
}
char
aes_icm_description
[]
=
"aes integer counter mode"
;
...
...
libs/srtp/crypto/cipher/null_cipher.c
浏览文件 @
a99f06df
...
...
@@ -48,7 +48,6 @@
#include "null_cipher.h"
#include "alloc.h"
/* the null_cipher uses the cipher debug module */
extern
debug_module_t
mod_cipher
;
...
...
libs/srtp/crypto/hash/null_auth.c
浏览文件 @
a99f06df
...
...
@@ -48,7 +48,6 @@
#include "null_auth.h"
#include "alloc.h"
/* null_auth uses the auth debug module */
extern
debug_module_t
mod_auth
;
...
...
libs/srtp/crypto/include/aes_icm.h
浏览文件 @
a99f06df
...
...
@@ -53,5 +53,8 @@ aes_icm_alloc_ismacryp(cipher_t **c,
int
key_len
,
int
forIsmacryp
);
uint16_t
aes_icm_bytes_encrypted
(
aes_icm_ctx_t
*
c
);
#endif
/* AES_ICM_H */
libs/srtp/crypto/replay/ut_sim.c
浏览文件 @
a99f06df
...
...
@@ -47,6 +47,7 @@
#include "ut_sim.h"
int
ut_compar
(
const
void
*
a
,
const
void
*
b
)
{
return
rand
()
>
(
RAND_MAX
/
2
)
?
-
1
:
1
;
...
...
libs/srtp/crypto/rng/ctr_prng.c
浏览文件 @
a99f06df
...
...
@@ -83,10 +83,8 @@ ctr_prng_get_octet_string(void *dest, uint32_t len) {
/*
* if we need to re-initialize the prng, do so now
*
* avoid 32-bit overflows by subtracting instead of adding
*/
if
(
ctr_prng
.
octet_count
>
MAX_PRNG_OUT_LEN
-
len
)
{
if
(
(
aes_icm_bytes_encrypted
(
&
ctr_prng
.
state
)
+
len
)
>
0xffff
)
{
status
=
ctr_prng_init
(
ctr_prng
.
rand
);
if
(
status
)
return
status
;
...
...
libs/srtp/crypto/test/aes_calc.c
浏览文件 @
a99f06df
...
...
@@ -36,7 +36,7 @@ main (int argc, char *argv[]) {
uint8_t
key
[
AES_MAX_KEY_LEN
];
aes_expanded_key_t
exp_key
;
int
key_len
,
len
;
int
verbose
;
int
verbose
=
0
;
err_status_t
status
;
if
(
argc
==
3
)
{
...
...
libs/srtp/crypto/test/rand_gen_soak.c
0 → 100644
浏览文件 @
a99f06df
/*
* Soak test the RNG for exhaustion failures
*/
#include <stdio.h>
/* for printf() */
#include <unistd.h>
/* for getopt() */
#include "crypto_kernel.h"
#define BUF_LEN (MAX_PRINT_STRING_LEN/2)
int
main
(
int
argc
,
char
*
argv
[])
{
int
q
;
extern
char
*
optarg
;
int
num_octets
=
0
;
err_status_t
status
;
uint32_t
iterations
=
0
;
int
print_values
=
0
;
if
(
argc
==
1
)
{
exit
(
255
);
}
status
=
crypto_kernel_init
();
if
(
status
)
{
printf
(
"error: crypto_kernel init failed
\n
"
);
exit
(
1
);
}
while
(
1
)
{
q
=
getopt
(
argc
,
argv
,
"pvn:"
);
if
(
q
==
-
1
)
{
break
;
}
switch
(
q
)
{
case
'p'
:
print_values
=
1
;
break
;
case
'n'
:
num_octets
=
atoi
(
optarg
);
if
(
num_octets
<
0
||
num_octets
>
BUF_LEN
)
{
exit
(
255
);
}
break
;
case
'v'
:
num_octets
=
30
;
print_values
=
0
;
break
;
default:
exit
(
255
);
}
}
if
(
num_octets
>
0
)
{
while
(
iterations
<
300000
)
{
uint8_t
buffer
[
BUF_LEN
];
status
=
crypto_get_random
(
buffer
,
num_octets
);
if
(
status
)
{
printf
(
"iteration %d error: failure in random source
\n
"
,
iterations
);
exit
(
255
);
}
else
if
(
print_values
)
{
printf
(
"%s
\n
"
,
octet_string_hex_string
(
buffer
,
num_octets
));
}
iterations
++
;
}
}
status
=
crypto_kernel_shutdown
();
if
(
status
)
{
printf
(
"error: crypto_kernel shutdown failed
\n
"
);
exit
(
1
);
}
return
0
;
}
libs/srtp/doc/libsrtp.pdf
浏览文件 @
a99f06df
No preview for this file type
libs/srtp/srtp/ekt.c
浏览文件 @
a99f06df
...
...
@@ -47,7 +47,6 @@
#include "srtp_priv.h"
#include "ekt.h"
extern
debug_module_t
mod_srtp
;
/*
...
...
libs/srtp/srtp/srtp.c
浏览文件 @
a99f06df
差异被折叠。
点击展开。
libs/srtp/test/rtpw_test_gcm.sh
100644 → 100755
浏览文件 @
a99f06df
File mode changed from 100644 to 100755
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论