diff options
author | Jeremy Allison <jra@samba.org> | 2009-09-17 11:11:23 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-09-17 11:11:23 -0700 |
commit | 389e2fb812097073d710cd7bf19396112936b404 (patch) | |
tree | c0813de9672cdbbceeb1bec790f81e8f8c429c10 /libcli | |
parent | 95311a220e7107ec8b3012d67d5efef57313a274 (diff) | |
parent | f8dae40fc8e40f747a4571a2500bba9f1a790fa5 (diff) | |
download | samba-389e2fb812097073d710cd7bf19396112936b404.tar.gz samba-389e2fb812097073d710cd7bf19396112936b404.tar.bz2 samba-389e2fb812097073d710cd7bf19396112936b404.zip |
Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/auth/spnego.h | 4 | ||||
-rw-r--r-- | libcli/auth/spnego_parse.c | 13 |
2 files changed, 9 insertions, 8 deletions
diff --git a/libcli/auth/spnego.h b/libcli/auth/spnego.h index 08350a44ff..4b60f22d32 100644 --- a/libcli/auth/spnego.h +++ b/libcli/auth/spnego.h @@ -32,7 +32,6 @@ #define SPNEGO_ANON_FLAG 0x10 #define SPNEGO_CONF_FLAG 0x20 #define SPNEGO_INTEG_FLAG 0x40 -#define SPNEGO_REQ_FLAG 0x80 enum spnego_negResult { SPNEGO_ACCEPT_COMPLETED = 0, @@ -43,7 +42,8 @@ enum spnego_negResult { struct spnego_negTokenInit { const char **mechTypes; - int reqFlags; + DATA_BLOB reqFlags; + uint8_t reqFlagsPadding; DATA_BLOB mechToken; DATA_BLOB mechListMIC; char *targetPrincipal; diff --git a/libcli/auth/spnego_parse.c b/libcli/auth/spnego_parse.c index 27e57740dc..3f7047b0e0 100644 --- a/libcli/auth/spnego_parse.c +++ b/libcli/auth/spnego_parse.c @@ -62,8 +62,8 @@ static bool read_negTokenInit(struct asn1_data *asn1, TALLOC_CTX *mem_ctx, /* Read reqFlags */ case ASN1_CONTEXT(1): asn1_start_tag(asn1, ASN1_CONTEXT(1)); - asn1_read_Integer(asn1, &token->reqFlags); - token->reqFlags |= SPNEGO_REQ_FLAG; + asn1_read_BitString(asn1, mem_ctx, &token->reqFlags, + &token->reqFlagsPadding); asn1_end_tag(asn1); break; /* Read mechToken */ @@ -130,11 +130,11 @@ static bool write_negTokenInit(struct asn1_data *asn1, struct spnego_negTokenIni } /* write reqFlags */ - if (token->reqFlags & SPNEGO_REQ_FLAG) { - int flags = token->reqFlags & ~SPNEGO_REQ_FLAG; - + if (token->reqFlags.length > 0) { asn1_push_tag(asn1, ASN1_CONTEXT(1)); - asn1_write_Integer(asn1, flags); + asn1_write_BitString(asn1, token->reqFlags.data, + token->reqFlags.length, + token->reqFlagsPadding); asn1_pop_tag(asn1); } @@ -353,6 +353,7 @@ bool spnego_free_data(struct spnego_data *spnego) if (spnego->negTokenInit.mechTypes) { talloc_free(spnego->negTokenInit.mechTypes); } + data_blob_free(&spnego->negTokenInit.reqFlags); data_blob_free(&spnego->negTokenInit.mechToken); data_blob_free(&spnego->negTokenInit.mechListMIC); talloc_free(spnego->negTokenInit.targetPrincipal); |