[GNU SASL GSSAPI示例

问题描述 投票:-2回答:1

我似乎在任何地方都找不到如何通过gssapi机制使用GNU的SASL的示例。我已经尝试过像这样启动它(只是猜测它是如何工作的):

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

但是我从gsasl_client_start收到了GSASL_UNKNOWN_MECHANISM错误。有人知道如何使用gsasl吗?有人可以指出我的教程吗?

c sasl gssapi
1个回答
0
投票

这显然是由于该库未使用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
...

所以缺少某些基础软件包,您需要获取一个相关但名称不同的软件包(包括此支持),或者需要使用启用所需功能的选项自己构建它。

© www.soinside.com 2019 - 2024. All rights reserved.