Ignore:
Timestamp:
Jun 29, 2011, 7:36:41 AM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update vendor to version 3.5.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/libsmb/clispnego.c

    r414 r587  
    55   Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002
    66   Copyright (C) Luke Howard     2003
    7    
     7
    88   This program is free software; you can redistribute it and/or modify
    99   it under the terms of the GNU General Public License as published by
     
    147147
    148148        asn1_check_OID(data,OID_SPNEGO);
     149
     150        /* negTokenInit  [0]  NegTokenInit */
    149151        asn1_start_tag(data,ASN1_CONTEXT(0));
    150152        asn1_start_tag(data,ASN1_SEQUENCE(0));
     153
     154        /* mechTypes [0] MechTypeList  OPTIONAL */
     155
     156        /* Not really optional, we depend on this to decide
     157         * what mechanisms we have to work with. */
    151158
    152159        asn1_start_tag(data,ASN1_CONTEXT(0));
     
    162169
    163170        *principal = NULL;
    164         if (asn1_tag_remaining(data) > 0) {
     171
     172        /*
     173          Win7 + Live Sign-in Assistant attaches a mechToken
     174          ASN1_CONTEXT(2) to the negTokenInit packet
     175          which breaks our negotiation if we just assume
     176          the next tag is ASN1_CONTEXT(3).
     177        */
     178
     179        if (asn1_peek_tag(data, ASN1_CONTEXT(1))) {
     180                uint8 flags;
     181
     182                /* reqFlags [1] ContextFlags  OPTIONAL */
     183                asn1_start_tag(data, ASN1_CONTEXT(1));
     184                asn1_start_tag(data, ASN1_BIT_STRING);
     185                while (asn1_tag_remaining(data) > 0) {
     186                        asn1_read_uint8(data, &flags);
     187                }
     188                asn1_end_tag(data);
     189                asn1_end_tag(data);
     190        }
     191
     192        if (asn1_peek_tag(data, ASN1_CONTEXT(2))) {
     193                /* mechToken [2] OCTET STRING  OPTIONAL */
     194                DATA_BLOB token;
     195                asn1_start_tag(data, ASN1_CONTEXT(2));
     196                asn1_read_OctetString(data, talloc_autofree_context(),
     197                        &token);
     198                asn1_end_tag(data);
     199                /* Throw away the token - not used. */
     200                data_blob_free(&token);
     201        }
     202
     203        if (asn1_peek_tag(data, ASN1_CONTEXT(3))) {
     204                /* mechListMIC [3] OCTET STRING  OPTIONAL */
    165205                asn1_start_tag(data, ASN1_CONTEXT(3));
    166206                asn1_start_tag(data, ASN1_SEQUENCE(0));
    167207                asn1_start_tag(data, ASN1_CONTEXT(0));
    168                 asn1_read_GeneralString(data,talloc_autofree_context(),principal);
     208                asn1_read_GeneralString(data,talloc_autofree_context(),
     209                        principal);
    169210                asn1_end_tag(data);
    170211                asn1_end_tag(data);
Note: See TracChangeset for help on using the changeset viewer.