comment out dumping code
[mech_eap.orig] / util_oid.c
index 45c37d8..096c9f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, JANET(UK)
+ * Copyright (c) 2011, JANET(UK)
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  *
  */
 
+/*
+ * OID utility routines.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
@@ -63,7 +67,6 @@ duplicateOid(OM_uint32 *minor,
 {
     gss_OID p;
 
-    *minor = 0;
     *newOid = GSS_C_NO_OID;
 
     p = (gss_OID)GSSEAP_MALLOC(sizeof(*p));
@@ -75,12 +78,14 @@ duplicateOid(OM_uint32 *minor,
     p->elements = GSSEAP_MALLOC(p->length);
     if (p->elements == NULL) {
         GSSEAP_FREE(p);
+        *minor = ENOMEM;
         return GSS_S_FAILURE;
     }
 
     memcpy(p->elements, oid->elements, p->length);
     *newOid = p;
 
+    *minor = 0;
     return GSS_S_COMPLETE;
 }
 
@@ -98,8 +103,9 @@ composeOid(OM_uint32 *minor,
 
     if (oid == GSS_C_NO_OID) {
         *minor = EINVAL;
-        return GSS_S_FAILURE;
+        return GSS_S_CALL_INACCESSIBLE_READ | GSS_S_FAILURE;
     }
+
     if (oid->length < prefix_len) {
         *minor = GSSEAP_WRONG_SIZE;
         return GSS_S_FAILURE;
@@ -116,7 +122,7 @@ composeOid(OM_uint32 *minor,
     suffix = osuffix;
 
     if (oid->length < prefix_len + nbytes) {
-        *minor = ERANGE;
+        *minor = GSSEAP_WRONG_SIZE;
         return GSS_S_FAILURE;
     }