gss: intern OID before adding to OID set
gss_add_oid_set_member() should according to RFC2744 add a copy of the OID to the set; the current implementation just stored a pointer (which may not be stable). As we have _gss_intern_oid(), call that before adding.
This commit is contained in:

committed by
Nicolas Williams

parent
9f3d9e1a0a
commit
2ec9e17042
@@ -34,9 +34,7 @@
|
|||||||
#include "mech_locl.h"
|
#include "mech_locl.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a oid to the oid set, function does not make a copy of the oid,
|
* Add a oid to the oid set.
|
||||||
* so the pointer to member_oid needs to be stable for the whole time
|
|
||||||
* oid_set is used.
|
|
||||||
*
|
*
|
||||||
* If there is a duplicate member of the oid, the new member is not
|
* If there is a duplicate member of the oid, the new member is not
|
||||||
* added to to the set.
|
* added to to the set.
|
||||||
@@ -56,7 +54,7 @@ gss_add_oid_set_member (OM_uint32 * minor_status,
|
|||||||
const gss_OID member_oid,
|
const gss_OID member_oid,
|
||||||
gss_OID_set * oid_set)
|
gss_OID_set * oid_set)
|
||||||
{
|
{
|
||||||
gss_OID tmp;
|
gss_OID tmp, interned_oid;
|
||||||
size_t n;
|
size_t n;
|
||||||
OM_uint32 res;
|
OM_uint32 res;
|
||||||
int present;
|
int present;
|
||||||
@@ -77,8 +75,13 @@ gss_add_oid_set_member (OM_uint32 * minor_status,
|
|||||||
return GSS_S_FAILURE;
|
return GSS_S_FAILURE;
|
||||||
}
|
}
|
||||||
(*oid_set)->elements = tmp;
|
(*oid_set)->elements = tmp;
|
||||||
|
|
||||||
|
res = _gss_intern_oid(minor_status, member_oid, &interned_oid);
|
||||||
|
if (res != GSS_S_COMPLETE)
|
||||||
|
return res;
|
||||||
|
|
||||||
(*oid_set)->count = n;
|
(*oid_set)->count = n;
|
||||||
(*oid_set)->elements[n-1] = *member_oid;
|
(*oid_set)->elements[n-1] = *interned_oid;
|
||||||
*minor_status = 0;
|
*minor_status = 0;
|
||||||
return GSS_S_COMPLETE;
|
return GSS_S_COMPLETE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user