Print this page
3882 remove xmod & friends

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libsasl/lib/client.c
          +++ new/usr/src/lib/libsasl/lib/client.c
↓ open down ↓ 190 lines elided ↑ open up ↑
 191  191      return (_sasl_client_add_plugin(_sasl_gbl_ctx(), plugname, entry_point));
 192  192  }
 193  193  
 194  194  int _sasl_client_add_plugin(void *ctx,
 195  195                              const char *plugname,
 196  196                              sasl_client_plug_init_t *entry_point)
 197  197  {
 198  198    cmech_list_t *cmechlist;
 199  199  #ifdef _INTEGRATED_SOLARIS_
 200  200    _sasl_global_context_t *gctx = ctx == NULL ? _sasl_gbl_ctx() : ctx;
 201      -  /* EXPORT DELETE START */
 202      -  /* CRYPT DELETE START */
 203  201    int sun_reg;
 204      -  /* CRYPT DELETE END */
 205      -  /* EXPORT DELETE END */
 206  202  #endif /* _INTEGRATED_SOLARIS_ */
 207  203    int i;
 208  204    cmechanism_t *m;
 209  205  #endif /* _SUN_SDK_ */
 210  206    int plugcount;
 211  207    sasl_client_plug_t *pluglist;
 212  208    cmechanism_t *mech;
 213  209    int result;
 214  210    int version;
 215  211    int lupe;
↓ open down ↓ 16 lines elided ↑ open up ↑
 232  228  
 233  229    result = LOCK_MUTEX(&client_plug_mutex);
 234  230    if (result != SASL_OK)
 235  231          return result;
 236  232  
 237  233  #endif /* _SUN_SDK_ */
 238  234  
 239  235    result = entry_point(cmechlist->utils, SASL_CLIENT_PLUG_VERSION, &version,
 240  236                         &pluglist, &plugcount);
 241  237  
 242      -  /* EXPORT DELETE START */
 243      -  /* CRYPT DELETE START */
 244  238  #ifdef _INTEGRATED_SOLARIS_
 245  239    sun_reg = _is_sun_reg(pluglist);
 246  240  #endif /* _INTEGRATED_SOLARIS_ */
 247      -  /* CRYPT DELETE END */
 248      -  /* EXPORT DELETE END */
 249  241    if (result != SASL_OK)
 250  242    {
 251  243  #ifdef _SUN_SDK_
 252  244      UNLOCK_MUTEX(&client_plug_mutex);
 253  245      __sasl_log(gctx, gctx->client_global_callbacks.callbacks, SASL_LOG_WARN,
 254  246                "entry_point failed in sasl_client_add_plugin for %s",
 255  247                plugname);
 256  248  #else
 257  249      _sasl_log(NULL, SASL_LOG_WARN,
 258  250                "entry_point failed in sasl_client_add_plugin for %s",
↓ open down ↓ 43 lines elided ↑ open up ↑
 302  294  #endif /* _SUN_SDK_ */
 303  295  
 304  296        mech->plug=pluglist++;
 305  297        if(_sasl_strdup(plugname, &mech->plugname, NULL) != SASL_OK) {
 306  298  #ifdef _SUN_SDK_
 307  299          UNLOCK_MUTEX(&client_plug_mutex);
 308  300  #endif /* _SUN_SDK_ */
 309  301          sasl_FREE(mech);
 310  302          return SASL_NOMEM;
 311  303        }
 312      -      /* EXPORT DELETE START */
 313      -      /* CRYPT DELETE START */
 314  304  #ifdef _INTEGRATED_SOLARIS_
 315  305        mech->sun_reg = sun_reg;
 316  306  #endif /* _INTEGRATED_SOLARIS_ */
 317      -     /* CRYPT DELETE END */
 318      -     /* EXPORT DELETE END */
 319  307        mech->version = version;
 320  308        mech->next = cmechlist->mech_list;
 321  309        cmechlist->mech_list = mech;
 322  310        cmechlist->mech_length++;
 323  311      }
 324  312  #ifdef _SUN_SDK_
 325  313      UNLOCK_MUTEX(&client_plug_mutex);
 326  314  #endif /* _SUN_SDK_ */
 327  315  
 328  316    return SASL_OK;
↓ open down ↓ 507 lines elided ↑ open up ↑
 836  824                  continue; /* no */
 837  825  
 838  826              /* Do we have the prompts for it? */
 839  827              if (!have_prompts(conn, m->plug))
 840  828                  break;
 841  829  
 842  830              /* Is it strong enough? */
 843  831              if (minssf > m->plug->max_ssf)
 844  832                  break;
 845  833  
 846      -            /* EXPORT DELETE START */
 847      -            /* CRYPT DELETE START */
 848  834  #ifdef _INTEGRATED_SOLARIS_
 849  835              /* If not SUN supplied mech, it has no strength */
 850  836              if (minssf > 0 && !m->sun_reg)
 851  837                  break;
 852  838  #endif /* _INTEGRATED_SOLARIS_ */
 853      -            /* CRYPT DELETE END */
 854      -            /* EXPORT DELETE END */
 855  839  
 856  840              /* Does it meet our security properties? */
 857  841              myflags = conn->props.security_flags;
 858  842              
 859  843              /* if there's an external layer this is no longer plaintext */
 860  844              if ((conn->props.min_ssf <= conn->external.ssf) && 
 861  845                  (conn->external.ssf > 1)) {
 862  846                  myflags &= ~SASL_SEC_NOPLAINTEXT;
 863  847              }
 864  848  
↓ open down ↓ 7 lines elided ↑ open up ↑
 872  856                  break;
 873  857              }
 874  858  
 875  859              /* Can it meet our features? */
 876  860              if ((conn->flags & SASL_NEED_PROXY) &&
 877  861                  !(m->plug->features & SASL_FEAT_ALLOWS_PROXY)) {
 878  862                  break;
 879  863              }
 880  864              
 881  865  #ifdef PREFER_MECH
 882      -            /* EXPORT DELETE START */
 883      -            /* CRYPT DELETE START */
 884  866  #ifdef _INTEGRATED_SOLARIS_
 885  867              if (strcasecmp(m->plug->mech_name, PREFER_MECH) &&
 886  868                  bestm && (m->sun_reg && m->plug->max_ssf <= bestssf) ||
 887  869                  (m->plug->max_ssf == 0)) {
 888  870  #else
 889      -            /* CRYPT DELETE END */
 890      -            /* EXPORT DELETE END */
 891  871              if (strcasecmp(m->plug->mech_name, PREFER_MECH) &&
 892  872                  bestm && m->plug->max_ssf <= bestssf) {
 893      -
 894      -                /* EXPORT DELETE START */
 895      -                /* CRYPT DELETE START */
 896  873  #endif /* _INTEGRATED_SOLARIS_ */
 897      -                /* CRYPT DELETE END */
 898      -                /* EXPORT DELETE END */
 899  874  
 900  875                  /* this mechanism isn't our favorite, and it's no better
 901  876                     than what we already have! */
 902  877                  break;
 903  878              }
 904  879  #else
 905      -            /* EXPORT DELETE START */
 906      -            /* CRYPT DELETE START */
 907  880  #ifdef _INTEGRATED_SOLARIS_
 908  881              if (bestm && m->sun_reg && m->plug->max_ssf <= bestssf) {
 909  882  #else
 910      -            /* CRYPT DELETE END */
 911      -            /* EXPORT DELETE END */
 912  883  
 913  884              if (bestm && m->plug->max_ssf <= bestssf) {
 914      -            /* EXPORT DELETE START */
 915      -            /* CRYPT DELETE START */
 916  885  #endif /* _INTEGRATED_SOLARIS_ */
 917      -            /* CRYPT DELETE END */
 918      -            /* EXPORT DELETE END */
 919  886  
 920  887                  /* this mechanism is no better than what we already have! */
 921  888                  break;
 922  889              }
 923  890  #endif
 924  891  
 925  892              /* compare security flags, only take new mechanism if it has
 926  893               * all the security flags of the previous one.
 927  894               *
 928  895               * From the mechanisms we ship with, this yields the order:
↓ open down ↓ 13 lines elided ↑ open up ↑
 942  909  
 943  910              if (bestm &&
 944  911                  ((m->plug->security_flags ^ bestm->plug->security_flags) &
 945  912                   bestm->plug->security_flags)) {
 946  913                  break;
 947  914              }
 948  915  
 949  916              if (mech) {
 950  917                  *mech = m->plug->mech_name;
 951  918              }
 952      -            /* EXPORT DELETE START */
 953      -            /* CRYPT DELETE START */
 954  919  #ifdef _INTEGRATED_SOLARIS_
 955  920              bestssf = m->sun_reg ? m->plug->max_ssf : 0;
 956  921  #else
 957      -            /* CRYPT DELETE END */
 958      -            /* EXPORT DELETE END */
 959  922              bestssf = m->plug->max_ssf;
 960      -            /* EXPORT DELETE START */
 961      -            /* CRYPT DELETE START */
 962  923  #endif /* _INTEGRATED_SOLARIS_ */
 963      -            /* CRYPT DELETE END */
 964      -            /* EXPORT DELETE END */
 965  924              bestm = m;
 966  925              break;
 967  926          }
 968  927      }
 969  928  
 970  929      if (bestm == NULL) {
 971  930  #ifdef _INTEGRATED_SOLARIS_
 972  931          sasl_seterror(conn, 0, gettext("No worthy mechs found"));
 973  932  #else
 974  933          sasl_seterror(conn, 0, "No worthy mechs found");
↓ open down ↓ 7 lines elided ↑ open up ↑
 982  941      c_conn->cparams->servicelen = strlen(conn->service);
 983  942      
 984  943      c_conn->cparams->serverFQDN = conn->serverFQDN; 
 985  944      c_conn->cparams->slen = strlen(conn->serverFQDN);
 986  945  
 987  946      c_conn->cparams->clientFQDN = c_conn->clientFQDN; 
 988  947      c_conn->cparams->clen = strlen(c_conn->clientFQDN);
 989  948  
 990  949      c_conn->cparams->external_ssf = conn->external.ssf;
 991  950      c_conn->cparams->props = conn->props;
 992      -    /* EXPORT DELETE START */
 993      -    /* CRYPT DELETE START */
 994  951  #ifdef _INTEGRATED_SOLARIS_
 995  952      if (!bestm->sun_reg) {
 996  953          c_conn->cparams->props.min_ssf = 0;
 997  954          c_conn->cparams->props.max_ssf = 0;
 998  955      }
 999  956      c_conn->base.sun_reg = bestm->sun_reg;
1000  957  #endif /* _INTEGRATED_SOLARIS_ */
1001      -    /* CRYPT DELETE END */
1002      -    /* EXPORT DELETE END */
1003  958      c_conn->mech = bestm;
1004  959  
1005  960      /* init that plugin */
1006  961  #ifdef _SUN_SDK_
1007  962      result = c_conn->mech->plug->mech_new(c_conn->mech->glob_context,
1008  963  #else
1009  964      result = c_conn->mech->plug->mech_new(c_conn->mech->plug->glob_context,
1010  965  #endif /* _SUN_SDK_ */
1011  966                                            c_conn->cparams,
1012  967                                            &(conn->context));
↓ open down ↓ 201 lines elided ↑ open up ↑
1214 1169      flag = 0;
1215 1170      for (m = cmechlist->mech_list; m != NULL; m = m->next) {
1216 1171              /* do we have the prompts for it? */
1217 1172              if (!have_prompts(conn, m->plug))
1218 1173                  continue;
1219 1174  
1220 1175              /* is it strong enough? */
1221 1176              if (minssf > m->plug->max_ssf)
1222 1177                  continue;
1223 1178  
1224      -            /* EXPORT DELETE START */
1225      -            /* CRYPT DELETE START */
1226 1179  #ifdef _INTEGRATED_SOLARIS_
1227 1180              /* If not SUN supplied mech, it has no strength */
1228 1181              if (minssf > 0 && !m->sun_reg)
1229 1182                  continue;
1230 1183  #endif /* _INTEGRATED_SOLARIS_ */
1231      -            /* CRYPT DELETE END */
1232      -            /* EXPORT DELETE END */
1233 1184  
1234 1185              /* does it meet our security properties? */
1235 1186              if (((conn->props.security_flags ^ m->plug->security_flags)
1236 1187                   & conn->props.security_flags) != 0) {
1237 1188                  continue;
1238 1189              }
1239 1190  
1240 1191              /* Can we meet it's features? */
1241 1192              if ((m->plug->features & SASL_FEAT_NEEDSERVERFQDN)
1242 1193                  && !conn->serverFQDN) {
↓ open down ↓ 81 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX