如何正确使用gss_import_name? [英] how to use gss_import_name correctly?

查看:236
本文介绍了如何正确使用gss_import_name?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用GSS_C_NT_HOSTBASED_SERVICE在客户端使用gss_import_name来获取诸如service/server-host @ realm之类的主体.

I am using gss_import_name on the client side using GSS_C_NT_HOSTBASED_SERVICE to get a principal like service/server-host@realm.

我这样打,

gss_import_name(状态为"SERVICE", GSS_C_HOSTBASED_SERVICE,输出名称);

gss_import_name(status, "SERVICE", GSS_C_HOSTBASED_SERVICE, output_name);

但是我得到的主体是service/local-machine @ realm.从手册页中,我了解到它在内部使用krb5_sname_to_principal获取主机名,如果为NULL,则使用本地主机名.现在我的问题是如何将正确的主机名(服务器主机)传递给gss-api以创建主体?

But i get the principal like, service/local-machine@realm. From the man page I have learned it internally uses krb5_sname_to_principal to get the hostname, if NULL it takes the localhost name. Now my question is how do pass the correct host name (server-host) to gss-api to create the principal?

推荐答案

我忽略了它.以"service/server-host @ realm"的形式获取委托人 我应该打电话给

I overlooked into it. To get the principal in the form 'service/server-host@realm' I should call

gss_import_name(状态, "service @ server-host", GSS_C_HOSTBASED_SERVICE,输出名称);

gss_import_name(status, "service@server-host", GSS_C_HOSTBASED_SERVICE, output_name);

代替

gss_import_name(状态,服务", GSS_C_HOSTBASED_SERVICE,输出名称);

gss_import_name(status, "service", GSS_C_HOSTBASED_SERVICE, output_name);

如果缺少主机名,则假定它是本地主机名.

If the host name is missing then it assumes to be the local host name.

这篇关于如何正确使用gss_import_name?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆