Ignore:
Timestamp:
Nov 25, 2016, 8:04:54 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/auth/gensec/spnego.c

    r988 r989  
    5555        DATA_BLOB mech_types;
    5656        size_t num_targs;
     57        bool downgraded;
    5758        bool mic_requested;
    5859        bool needs_mic_sign;
    5960        bool needs_mic_check;
     61        bool may_skip_mic_check;
    6062        bool done_mic_check;
    6163
     
    434436                                         * mic.
    435437                                         */
     438                                        spnego_state->downgraded = true;
    436439                                        spnego_state->mic_requested = true;
    437440                                        break;
     
    10781081                                 gensec_get_name_by_oid(gensec_security, spnego_state->neg_oid),
    10791082                                 gensec_get_name_by_oid(gensec_security, spnego.negTokenTarg.supportedMech)));
    1080 
     1083                        spnego_state->downgraded = true;
    10811084                        spnego_state->no_response_expected = false;
    10821085                        talloc_free(spnego_state->sub_sec_security);
     
    11331136                                spnego_free_data(&spnego);
    11341137                                return NT_STATUS_INVALID_PARAMETER;
     1138                        }
     1139
     1140                        if (spnego.negTokenTarg.mechListMIC.length == 0
     1141                            && spnego_state->may_skip_mic_check) {
     1142                                /*
     1143                                 * In this case we don't require
     1144                                 * a mechListMIC from the server.
     1145                                 *
     1146                                 * This works around bugs in the Azure
     1147                                 * and Apple spnego implementations.
     1148                                 *
     1149                                 * See
     1150                                 * https://bugzilla.samba.org/show_bug.cgi?id=11994
     1151                                 */
     1152                                spnego_state->needs_mic_check = false;
     1153                                nt_status = NT_STATUS_OK;
     1154                                goto client_response;
    11351155                        }
    11361156
     
    11901210                                        new_spnego = false;
    11911211                                }
     1212
    11921213                                break;
    11931214
    11941215                        case SPNEGO_ACCEPT_INCOMPLETE:
     1216                                if (spnego.negTokenTarg.mechListMIC.length > 0) {
     1217                                        new_spnego = true;
     1218                                        break;
     1219                                }
     1220
     1221                                if (spnego_state->downgraded) {
     1222                                        /*
     1223                                         * A downgrade should be protected if
     1224                                         * supported
     1225                                         */
     1226                                        break;
     1227                                }
     1228
     1229                                /*
     1230                                 * The caller may just asked for
     1231                                 * GENSEC_FEATURE_SESSION_KEY, this
     1232                                 * is only reflected in the want_features.
     1233                                 *
     1234                                 * As it will imply
     1235                                 * gensec_have_features(GENSEC_FEATURE_SIGN)
     1236                                 * to return true.
     1237                                 */
     1238                                if (gensec_security->want_features & GENSEC_FEATURE_SIGN) {
     1239                                        break;
     1240                                }
     1241                                if (gensec_security->want_features & GENSEC_FEATURE_SEAL) {
     1242                                        break;
     1243                                }
     1244                                /*
     1245                                 * Here we're sure our preferred mech was
     1246                                 * selected by the server and our caller doesn't
     1247                                 * need GENSEC_FEATURE_SIGN nor
     1248                                 * GENSEC_FEATURE_SEAL support.
     1249                                 *
     1250                                 * In this case we don't require
     1251                                 * a mechListMIC from the server.
     1252                                 *
     1253                                 * This works around bugs in the Azure
     1254                                 * and Apple spnego implementations.
     1255                                 *
     1256                                 * See
     1257                                 * https://bugzilla.samba.org/show_bug.cgi?id=11994
     1258                                 */
     1259                                spnego_state->may_skip_mic_check = true;
     1260                                break;
     1261
    11951262                        case SPNEGO_REQUEST_MIC:
    11961263                                if (spnego.negTokenTarg.mechListMIC.length > 0) {
Note: See TracChangeset for help on using the changeset viewer.