]> andersk Git - gssapi-openssh.git/blobdiff - openssh/gss-genr.c
new version: NCSA_GSSAPI_20080403
[gssapi-openssh.git] / openssh / gss-genr.c
index 8af17ca16ad8d7cb9d3faa75266888ecbced88cf..92cd09ad08a45c0d7e38336b4ae8346d186e259e 100644 (file)
@@ -1,7 +1,7 @@
-/* $OpenBSD: gss-genr.c,v 1.17 2006/08/29 12:02:30 dtucker Exp $ */
+/* $OpenBSD: gss-genr.c,v 1.19 2007/06/12 11:56:15 dtucker Exp $ */
 
 /*
- * Copyright (c) 2001-2006 Simon Wilkinson. All rights reserved.
+ * Copyright (c) 2001-2007 Simon Wilkinson. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -105,7 +105,7 @@ ssh_gssapi_kex_mechs(gss_OID_set gss_supported, ssh_gssapi_check_fn *check,
                xfree(gss_enc2oid);
        }
 
-       gss_enc2oid = xmalloc(sizeof(ssh_gss_kex_mapping)*
+       gss_enc2oid = xmalloc(sizeof(ssh_gss_kex_mapping) *
            (gss_supported->count + 1));
 
        buffer_init(&buf);
@@ -114,6 +114,7 @@ ssh_gssapi_kex_mechs(gss_OID_set gss_supported, ssh_gssapi_check_fn *check,
        for (i = 0; i < gss_supported->count; i++) {
                if (gss_supported->elements[i].length < 128 &&
                    (*check)(NULL, &(gss_supported->elements[i]), data)) {
+
                        deroid[0] = SSH_GSS_OIDTYPE;
                        deroid[1] = gss_supported->elements[i].length;
 
@@ -391,9 +392,6 @@ ssh_gssapi_import_name(Gssctxt *ctx, const char *host)
 OM_uint32
 ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_t buffer, gss_buffer_t hash)
 {
-       if (ctx == NULL) 
-               return -1;
-
        if ((ctx->major = gss_get_mic(&ctx->minor, ctx->context,
            GSS_C_QOP_DEFAULT, buffer, hash)))
                ssh_gssapi_error(ctx);
@@ -402,16 +400,17 @@ ssh_gssapi_sign(Gssctxt *ctx, gss_buffer_t buffer, gss_buffer_t hash)
 }
 
 /* Priviledged when used by server */
+/* Moved here from gss-serv.c because called by kexgss_client(). */
 OM_uint32
 ssh_gssapi_checkmic(Gssctxt *ctx, gss_buffer_t gssbuf, gss_buffer_t gssmic)
 {
-       if (ctx == NULL)
-               return -1;
+       if (ctx == NULL)
+               return -1;
 
-       ctx->major = gss_verify_mic(&ctx->minor, ctx->context,
-           gssbuf, gssmic, NULL);
+       ctx->major = gss_verify_mic(&ctx->minor, ctx->context,
+           gssbuf, gssmic, NULL);
 
-       return (ctx->major);
+       return (ctx->major);
 }
 
 void
This page took 0.035799 seconds and 4 git commands to generate.