Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
4f7a2ab8
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,发现更多精彩内容 >>
提交
4f7a2ab8
编写于
5月 11, 2011
作者:
D
Dr. Stephen Henson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make kerberos work with OPENSSL_NO_SSL_INTERN
上级
b0188c4f
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
45 addition
and
12 deletion
+45
-12
apps/s_client.c
apps/s_client.c
+6
-2
apps/s_server.c
apps/s_server.c
+19
-10
ssl/kssl.c
ssl/kssl.c
+16
-0
ssl/kssl.h
ssl/kssl.h
+4
-0
未找到文件。
apps/s_client.c
浏览文件 @
4f7a2ab8
...
@@ -539,6 +539,9 @@ int MAIN(int argc, char **argv)
...
@@ -539,6 +539,9 @@ int MAIN(int argc, char **argv)
{
{
unsigned
int
off
=
0
,
clr
=
0
;
unsigned
int
off
=
0
,
clr
=
0
;
SSL
*
con
=
NULL
;
SSL
*
con
=
NULL
;
#ifndef OPENSSL_NO_KRB5
KSSL_CTX
*
kctx
;
#endif
int
s
,
k
,
width
,
state
=
0
;
int
s
,
k
,
width
,
state
=
0
;
char
*
cbuf
=
NULL
,
*
sbuf
=
NULL
,
*
mbuf
=
NULL
;
char
*
cbuf
=
NULL
,
*
sbuf
=
NULL
,
*
mbuf
=
NULL
;
int
cbuf_len
,
cbuf_off
;
int
cbuf_len
,
cbuf_off
;
...
@@ -1212,9 +1215,10 @@ bad:
...
@@ -1212,9 +1215,10 @@ bad:
}
}
#endif
#endif
#ifndef OPENSSL_NO_KRB5
#ifndef OPENSSL_NO_KRB5
if
(
con
&&
(
con
->
kssl_
ctx
=
kssl_ctx_new
())
!=
NULL
)
if
(
con
&&
(
k
ctx
=
kssl_ctx_new
())
!=
NULL
)
{
{
kssl_ctx_setstring
(
con
->
kssl_ctx
,
KSSL_SERVER
,
host
);
SSL_set0_kssl_ctx
(
con
,
kctx
);
kssl_ctx_setstring
(
kctx
,
KSSL_SERVER
,
host
);
}
}
#endif
/* OPENSSL_NO_KRB5 */
#endif
/* OPENSSL_NO_KRB5 */
/* SSL_set_cipher_list(con,"RC4-MD5"); */
/* SSL_set_cipher_list(con,"RC4-MD5"); */
...
...
apps/s_server.c
浏览文件 @
4f7a2ab8
...
@@ -1943,6 +1943,9 @@ static int sv_body(char *hostname, int s, unsigned char *context)
...
@@ -1943,6 +1943,9 @@ static int sv_body(char *hostname, int s, unsigned char *context)
unsigned
long
l
;
unsigned
long
l
;
SSL
*
con
=
NULL
;
SSL
*
con
=
NULL
;
BIO
*
sbio
;
BIO
*
sbio
;
#ifndef OPENSSL_NO_KRB5
KSSL_CTX
*
kctx
;
#endif
struct
timeval
timeout
;
struct
timeval
timeout
;
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5)
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5)
struct
timeval
tv
;
struct
timeval
tv
;
...
@@ -1983,12 +1986,11 @@ static int sv_body(char *hostname, int s, unsigned char *context)
...
@@ -1983,12 +1986,11 @@ static int sv_body(char *hostname, int s, unsigned char *context)
}
}
#endif
#endif
#ifndef OPENSSL_NO_KRB5
#ifndef OPENSSL_NO_KRB5
if
((
con
->
kssl_
ctx
=
kssl_ctx_new
())
!=
NULL
)
if
((
k
ctx
=
kssl_ctx_new
())
!=
NULL
)
{
{
kssl_ctx_setstring
(
con
->
kssl_ctx
,
KSSL_SERVICE
,
SSL_set0_kssl_ctx
(
con
,
kctx
);
KRB5SVC
);
kssl_ctx_setstring
(
kctx
,
KSSL_SERVICE
,
KRB5SVC
);
kssl_ctx_setstring
(
con
->
kssl_ctx
,
KSSL_KEYTAB
,
kssl_ctx_setstring
(
kctx
,
KSSL_KEYTAB
,
KRB5KEYTAB
);
KRB5KEYTAB
);
}
}
#endif
/* OPENSSL_NO_KRB5 */
#endif
/* OPENSSL_NO_KRB5 */
if
(
context
)
if
(
context
)
...
@@ -2341,6 +2343,9 @@ static int init_ssl_connection(SSL *con)
...
@@ -2341,6 +2343,9 @@ static int init_ssl_connection(SSL *con)
const
unsigned
char
*
next_proto_neg
;
const
unsigned
char
*
next_proto_neg
;
unsigned
next_proto_neg_len
;
unsigned
next_proto_neg_len
;
#endif
#endif
#ifndef OPENSSL_NO_KRB5
char
*
client_princ
;
#endif
if
((
i
=
SSL_accept
(
con
))
<=
0
)
if
((
i
=
SSL_accept
(
con
))
<=
0
)
{
{
...
@@ -2394,10 +2399,11 @@ static int init_ssl_connection(SSL *con)
...
@@ -2394,10 +2399,11 @@ static int init_ssl_connection(SSL *con)
TLS1_FLAGS_TLS_PADDING_BUG
)
TLS1_FLAGS_TLS_PADDING_BUG
)
BIO_printf
(
bio_s_out
,
"Peer has incorrect TLSv1 block padding
\n
"
);
BIO_printf
(
bio_s_out
,
"Peer has incorrect TLSv1 block padding
\n
"
);
#ifndef OPENSSL_NO_KRB5
#ifndef OPENSSL_NO_KRB5
if
(
con
->
kssl_ctx
->
client_princ
!=
NULL
)
client_princ
=
kssl_ctx_get0_client_princ
(
SSL_get0_kssl_ctx
(
con
));
if
(
client_princ
!=
NULL
)
{
{
BIO_printf
(
bio_s_out
,
"Kerberos peer principal is %s
\n
"
,
BIO_printf
(
bio_s_out
,
"Kerberos peer principal is %s
\n
"
,
con
->
kssl_ctx
->
client_princ
);
client_princ
);
}
}
#endif
/* OPENSSL_NO_KRB5 */
#endif
/* OPENSSL_NO_KRB5 */
BIO_printf
(
bio_s_out
,
"Secure Renegotiation IS%s supported
\n
"
,
BIO_printf
(
bio_s_out
,
"Secure Renegotiation IS%s supported
\n
"
,
...
@@ -2449,6 +2455,9 @@ static int www_body(char *hostname, int s, unsigned char *context)
...
@@ -2449,6 +2455,9 @@ static int www_body(char *hostname, int s, unsigned char *context)
SSL
*
con
;
SSL
*
con
;
const
SSL_CIPHER
*
c
;
const
SSL_CIPHER
*
c
;
BIO
*
io
,
*
ssl_bio
,
*
sbio
;
BIO
*
io
,
*
ssl_bio
,
*
sbio
;
#ifndef OPENSSL_NO_KRB5
KSSL_CTX
*
kctx
;
#endif
buf
=
OPENSSL_malloc
(
bufsize
);
buf
=
OPENSSL_malloc
(
bufsize
);
if
(
buf
==
NULL
)
return
(
0
);
if
(
buf
==
NULL
)
return
(
0
);
...
@@ -2480,10 +2489,10 @@ static int www_body(char *hostname, int s, unsigned char *context)
...
@@ -2480,10 +2489,10 @@ static int www_body(char *hostname, int s, unsigned char *context)
}
}
#endif
#endif
#ifndef OPENSSL_NO_KRB5
#ifndef OPENSSL_NO_KRB5
if
((
con
->
kssl_
ctx
=
kssl_ctx_new
())
!=
NULL
)
if
((
k
ctx
=
kssl_ctx_new
())
!=
NULL
)
{
{
kssl_ctx_setstring
(
con
->
kssl_
ctx
,
KSSL_SERVICE
,
KRB5SVC
);
kssl_ctx_setstring
(
k
ctx
,
KSSL_SERVICE
,
KRB5SVC
);
kssl_ctx_setstring
(
con
->
kssl_
ctx
,
KSSL_KEYTAB
,
KRB5KEYTAB
);
kssl_ctx_setstring
(
k
ctx
,
KSSL_KEYTAB
,
KRB5KEYTAB
);
}
}
#endif
/* OPENSSL_NO_KRB5 */
#endif
/* OPENSSL_NO_KRB5 */
if
(
context
)
SSL_set_session_id_context
(
con
,
context
,
if
(
context
)
SSL_set_session_id_context
(
con
,
context
,
...
...
ssl/kssl.c
浏览文件 @
4f7a2ab8
...
@@ -2191,6 +2191,22 @@ krb5_error_code kssl_build_principal_2(
...
@@ -2191,6 +2191,22 @@ krb5_error_code kssl_build_principal_2(
return
ENOMEM
;
return
ENOMEM
;
}
}
void
SSL_set0_kssl_ctx
(
SSL
*
s
,
KSSL_CTX
*
kctx
)
{
s
->
kssl_ctx
=
kctx
;
}
KSSL_CTX
*
SSL_get0_kssl_ctx
(
SSL
*
s
)
{
return
s
->
kssl_ctx
;
}
char
*
kssl_ctx_get0_client_princ
(
KSSL_CTX
*
kctx
)
{
if
(
kctx
)
return
kctx
->
client_princ
;
return
NULL
;
}
#else
/* !OPENSSL_NO_KRB5 */
#else
/* !OPENSSL_NO_KRB5 */
...
...
ssl/kssl.h
浏览文件 @
4f7a2ab8
...
@@ -172,6 +172,10 @@ krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp,
...
@@ -172,6 +172,10 @@ krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp,
krb5_timestamp
*
atimep
,
KSSL_ERR
*
kssl_err
);
krb5_timestamp
*
atimep
,
KSSL_ERR
*
kssl_err
);
unsigned
char
*
kssl_skip_confound
(
krb5_enctype
enctype
,
unsigned
char
*
authn
);
unsigned
char
*
kssl_skip_confound
(
krb5_enctype
enctype
,
unsigned
char
*
authn
);
void
SSL_set0_kssl_ctx
(
SSL
*
s
,
KSSL_CTX
*
kctx
);
KSSL_CTX
*
SSL_get0_kssl_ctx
(
SSL
*
s
);
char
*
kssl_ctx_get0_client_princ
(
KSSL_CTX
*
kctx
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录