]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - unix/uxgss.c
Change how we handle the Ssh_gss_buf type. Previously, we defined it
[PuTTY.git] / unix / uxgss.c
index 1a6668e9d6eaa62d5d0ac0a8e10c14c4a03c9678..0a9464de87ea0242532945502d99125e8d3646e4 100644 (file)
@@ -6,9 +6,9 @@
 
 #ifndef NO_GSSAPI
 
-static gss_OID_desc gss_mech_krb5_desc =
+static gss_OID_desc putty_gss_mech_krb5_desc =
     { 9, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02" };
-static gss_OID const gss_mech_krb5 = &gss_mech_krb5_desc;
+static gss_OID const putty_gss_mech_krb5 = &putty_gss_mech_krb5_desc;
 
 typedef struct uxSsh_gss_ctx {
     OM_uint32 maj_stat;
@@ -27,8 +27,8 @@ int ssh_gss_init(void)
 Ssh_gss_stat ssh_gss_indicate_mech(Ssh_gss_buf *mech)
 {
     /* Copy constant into mech */
-    mech->len  = gss_mech_krb5->length;
-    mech->data = gss_mech_krb5->elements;
+    mech->length  = putty_gss_mech_krb5->length;
+    mech->value = putty_gss_mech_krb5->elements;
 
     return SSH_GSS_OK;
 }
@@ -79,11 +79,11 @@ Ssh_gss_stat ssh_gss_init_sec_context(Ssh_gss_ctx *ctx,
                                           GSS_C_NO_CREDENTIAL,
                                           &uxctx->ctx,
                                           (gss_name_t) srv_name,
-                                          (gss_OID) gss_mech_krb5,
+                                          (gss_OID) putty_gss_mech_krb5,
                                           GSS_C_MUTUAL_FLAG |
                                           GSS_C_INTEG_FLAG | to_deleg,
                                           0,
-                                          NULL,   /* no channel bindings */
+                                          GSS_C_NO_CHANNEL_BINDINGS,
                                           (gss_buffer_desc *)recv_tok,
                                           NULL,   /* ignore mech type */
                                           (gss_buffer_desc *)send_tok,
@@ -108,13 +108,13 @@ Ssh_gss_stat ssh_gss_display_status(Ssh_gss_ctx ctx, Ssh_gss_buf *buf)
 
     /* get first mesg from GSS */
     ccc=0;
-    lmax=gss_display_status(&lmin,uxctx->maj_stat,GSS_C_GSS_CODE,(gss_OID) gss_mech_krb5,&ccc,&msg_maj);
+    lmax=gss_display_status(&lmin,uxctx->maj_stat,GSS_C_GSS_CODE,(gss_OID) putty_gss_mech_krb5,&ccc,&msg_maj);
 
     if (lmax != GSS_S_COMPLETE) return SSH_GSS_FAILURE;
 
     /* get first mesg from Kerberos */
     ccc=0;
-    lmax=gss_display_status(&lmin,uxctx->min_stat,GSS_C_MECH_CODE,(gss_OID) gss_mech_krb5,&ccc,&msg_min);
+    lmax=gss_display_status(&lmin,uxctx->min_stat,GSS_C_MECH_CODE,(gss_OID) putty_gss_mech_krb5,&ccc,&msg_min);
 
     if (lmax != GSS_S_COMPLETE) {
        gss_release_buffer(&lmin, &msg_maj);
@@ -122,14 +122,14 @@ Ssh_gss_stat ssh_gss_display_status(Ssh_gss_ctx ctx, Ssh_gss_buf *buf)
     }
 
     /* copy data into buffer */
-    buf->len = msg_maj.length + msg_min.length + 1;
-    buf->data = snewn(buf->len + 1, char);
+    buf->length = msg_maj.length + msg_min.length + 1;
+    buf->value = snewn(buf->length + 1, char);
   
     /* copy mem */
-    memcpy(buf->data, msg_maj.value, msg_maj.length);
-    buf->data[msg_maj.length] = ' ';
-    memcpy(buf->data + msg_maj.length + 1, msg_min.value, msg_min.length);
-    buf->data[buf->len] = 0;
+    memcpy((char *)buf->value, msg_maj.value, msg_maj.length);
+    ((char *)buf->value)[msg_maj.length] = ' ';
+    memcpy((char *)buf->value + msg_maj.length + 1, msg_min.value, msg_min.length);
+    ((char *)buf->value)[buf->length] = 0;
     /* free mem & exit */
     gss_release_buffer(&lmin, &msg_maj);
     gss_release_buffer(&lmin, &msg_min);