mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3/s4:auth SPNEGO - adaptions for the removed "const" from OIDs
This is needed in order to suppress warnings.
This commit is contained in:
parent
464b8fa317
commit
13fa6743d8
@ -49,10 +49,12 @@ static bool read_negTokenInit(struct asn1_data *asn1, TALLOC_CTX *mem_ctx,
|
|||||||
token->mechTypes = talloc(NULL, const char *);
|
token->mechTypes = talloc(NULL, const char *);
|
||||||
for (i = 0; !asn1->has_error &&
|
for (i = 0; !asn1->has_error &&
|
||||||
0 < asn1_tag_remaining(asn1); i++) {
|
0 < asn1_tag_remaining(asn1); i++) {
|
||||||
|
char *oid;
|
||||||
token->mechTypes = talloc_realloc(NULL,
|
token->mechTypes = talloc_realloc(NULL,
|
||||||
token->mechTypes,
|
token->mechTypes,
|
||||||
const char *, i+2);
|
const char *, i+2);
|
||||||
asn1_read_OID(asn1, token->mechTypes, token->mechTypes + i);
|
asn1_read_OID(asn1, token->mechTypes, &oid);
|
||||||
|
token->mechTypes[i] = oid;
|
||||||
}
|
}
|
||||||
token->mechTypes[i] = NULL;
|
token->mechTypes[i] = NULL;
|
||||||
|
|
||||||
@ -184,6 +186,7 @@ static bool read_negTokenTarg(struct asn1_data *asn1, TALLOC_CTX *mem_ctx,
|
|||||||
|
|
||||||
while (!asn1->has_error && 0 < asn1_tag_remaining(asn1)) {
|
while (!asn1->has_error && 0 < asn1_tag_remaining(asn1)) {
|
||||||
uint8_t context;
|
uint8_t context;
|
||||||
|
char *oid;
|
||||||
if (!asn1_peek_uint8(asn1, &context)) {
|
if (!asn1_peek_uint8(asn1, &context)) {
|
||||||
asn1->has_error = true;
|
asn1->has_error = true;
|
||||||
break;
|
break;
|
||||||
@ -199,7 +202,8 @@ static bool read_negTokenTarg(struct asn1_data *asn1, TALLOC_CTX *mem_ctx,
|
|||||||
break;
|
break;
|
||||||
case ASN1_CONTEXT(1):
|
case ASN1_CONTEXT(1):
|
||||||
asn1_start_tag(asn1, ASN1_CONTEXT(1));
|
asn1_start_tag(asn1, ASN1_CONTEXT(1));
|
||||||
asn1_read_OID(asn1, mem_ctx, &token->supportedMech);
|
asn1_read_OID(asn1, mem_ctx, &oid);
|
||||||
|
token->supportedMech = oid;
|
||||||
asn1_end_tag(asn1);
|
asn1_end_tag(asn1);
|
||||||
break;
|
break;
|
||||||
case ASN1_CONTEXT(2):
|
case ASN1_CONTEXT(2):
|
||||||
|
@ -125,9 +125,7 @@ bool spnego_parse_negTokenInit(TALLOC_CTX *ctx,
|
|||||||
asn1_start_tag(data,ASN1_CONTEXT(0));
|
asn1_start_tag(data,ASN1_CONTEXT(0));
|
||||||
asn1_start_tag(data,ASN1_SEQUENCE(0));
|
asn1_start_tag(data,ASN1_SEQUENCE(0));
|
||||||
for (i=0; asn1_tag_remaining(data) > 0 && i < ASN1_MAX_OIDS-1; i++) {
|
for (i=0; asn1_tag_remaining(data) > 0 && i < ASN1_MAX_OIDS-1; i++) {
|
||||||
const char *oid_str = NULL;
|
asn1_read_OID(data,ctx, &OIDs[i]);
|
||||||
asn1_read_OID(data,ctx,&oid_str);
|
|
||||||
OIDs[i] = CONST_DISCARD(char *, oid_str);
|
|
||||||
}
|
}
|
||||||
OIDs[i] = NULL;
|
OIDs[i] = NULL;
|
||||||
asn1_end_tag(data);
|
asn1_end_tag(data);
|
||||||
|
Loading…
Reference in New Issue
Block a user