C语言 GNU SASL GSSAPI Example



我似乎在任何地方都找不到如何将GNU的SASL与gssapi机制一起使用的例子。我试过这样启动它(只是猜测它是如何工作的(:

gsasl_init(&ctx);
gsasl_client_start(ctx, "GSSAPI", &session);

但是我从GSASL_client_start得到了一个GSASL_UNKNOWN_MACHANISM错误。有人知道如何使用gsasl吗?有人能给我指一本教程吗?

这显然是由于库没有使用GSSAPI支持构建;查看源代码("libgasl-1.8.1"(,唯一可以返回此信息的地方是:

// src/xstart.c
static int
setup (Gsasl * ctx,
const char *mech,
Gsasl_session * sctx,
size_t n_mechs, Gsasl_mechanism * mechs, int clientp)
{
Gsasl_mechanism *mechptr = NULL;
int res;
mechptr = find_mechanism (mech, n_mechs, mechs);
if (mechptr == NULL)
return GSASL_UNKNOWN_MECHANISM;

因此,这意味着不是库支持它的情况,但它在备份它的计算机上找不到资源(例如kerberos(。

当我试图在自己的系统上编译它时,configure没有启用GSSAPI,因为它找不到重要的东西:

...
checking if DIGEST-MD5 should be used... yes
checking if SCRAM-SHA-1 should be used... yes
checking if SAML20 should be used... yes
checking if OPENID20 should be used... yes
configure: checking for GSS implementation (yes)
configure: auto-detecting GSS/MIT/Heimdal
configure: use --with-gssapi-impl=IMPL to hard code
configure: where IMPL is `gss', `mit', or `heimdal'
checking for libgss... no
configure: WARNING: GNU GSS not found (see http://www.gnu.org/software/gss/)...
configure: WARNING: Auto-detecting MIT/Heimdal is unreliable, disabling GSSAPI
checking if KERBEROS_V5 should be used... no
...

因此,要么缺少某个底层包,要么需要获取一个相关但名称不同的包(包括此支持(,要么需要使用能够实现所需功能的选项自行构建。

最新更新