[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS gsasl/lib/gssapi
From: |
gsasl-commit |
Subject: |
CVS gsasl/lib/gssapi |
Date: |
Thu, 14 Oct 2004 23:28:56 +0200 |
Update of /home/cvs/gsasl/lib/gssapi
In directory dopio:/tmp/cvs-serv4400
Modified Files:
server.c
Log Message:
Avoid old-style service callback.
--- /home/cvs/gsasl/lib/gssapi/server.c 2004/10/14 20:42:24 1.6
+++ /home/cvs/gsasl/lib/gssapi/server.c 2004/10/14 21:28:56 1.7
@@ -63,44 +63,29 @@
_gsasl_gssapi_server_start (Gsasl_session * sctx, void **mech_data)
{
_Gsasl_gssapi_server_state *state;
- Gsasl_server_callback_service cb_service;
- Gsasl *ctx;
OM_uint32 maj_stat, min_stat;
gss_name_t server;
gss_buffer_desc bufdesc;
- size_t servicelen = 0;
- size_t hostnamelen = 0;
+ const char *service;
+ const char *hostname;
int res;
- ctx = gsasl_server_ctx_get (sctx);
- if (ctx == NULL)
- return GSASL_CANNOT_GET_CTX;
+ service = gsasl_property_get (sctx, GSASL_SERVICE);
+ if (!service)
+ return GSASL_NO_SERVICE;
- cb_service = gsasl_server_callback_service_get (ctx);
- if (cb_service == NULL)
- return GSASL_NEED_SERVER_SERVICE_CALLBACK;
+ hostname = gsasl_property_get (sctx, GSASL_HOSTNAME);
+ if (!hostname)
+ return GSASL_NO_HOSTNAME;
- if (gsasl_server_callback_gssapi_get (ctx) == NULL)
- return GSASL_NEED_SERVER_GSSAPI_CALLBACK;
+ /* FIXME: Use asprintf. */
- res = cb_service (sctx, NULL, &servicelen, NULL, &hostnamelen);
- if (res != GSASL_OK)
- return res;
-
- bufdesc.length = servicelen + strlen ("@") + hostnamelen + 1;
+ bufdesc.length = strlen (service) + strlen ("@") + strlen (hostname) + 1;
bufdesc.value = malloc (bufdesc.length);
if (bufdesc.value == NULL)
return GSASL_MALLOC_ERROR;
- res = cb_service (sctx, bufdesc.value, &servicelen,
- (char *) bufdesc.value + 1 + servicelen, &hostnamelen);
- if (res != GSASL_OK)
- {
- free (bufdesc.value);
- return res;
- }
- ((char *) bufdesc.value)[servicelen] = '@';
- ((char *) bufdesc.value)[bufdesc.length - 1] = '\0';
+ sprintf (bufdesc.value, "address@hidden", service, hostname);
state = (_Gsasl_gssapi_server_state *) malloc (sizeof (*state));
if (state == NULL)
- CVS gsasl/lib/gssapi, gsasl-commit, 2004/10/13
- CVS gsasl/lib/gssapi, gsasl-commit, 2004/10/14
- CVS gsasl/lib/gssapi, gsasl-commit, 2004/10/14
- CVS gsasl/lib/gssapi, gsasl-commit, 2004/10/14
- CVS gsasl/lib/gssapi, gsasl-commit, 2004/10/14
- CVS gsasl/lib/gssapi,
gsasl-commit <=
- CVS gsasl/lib/gssapi, gsasl-commit, 2004/10/14
- CVS gsasl/lib/gssapi, gsasl-commit, 2004/10/14
- CVS gsasl/lib/gssapi, gsasl-commit, 2004/10/31
- CVS gsasl/lib/gssapi, gsasl-commit, 2004/10/31
- CVS gsasl/lib/gssapi, gsasl-commit, 2004/10/31