Print this page
3882 remove xmod & friends

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libsasl/lib/common.c
          +++ new/usr/src/lib/libsasl/lib/common.c
↓ open down ↓ 299 lines elided ↑ open up ↑
 300  300                   const char **output, unsigned *outputlen)
 301  301  {
 302  302  #ifdef _SUN_SDK_
 303  303      int result = SASL_FAIL;
 304  304  #else
 305  305      int result;
 306  306  #endif /* _SUN_SDK_ */
 307  307      unsigned i;
 308  308      size_t total_size = 0;
 309  309  
 310      -    /* EXPORT DELETE START */
 311  310      if (!conn) return SASL_BADPARAM;
 312  311      if (! invec || ! output || ! outputlen || numiov < 1)
 313  312          PARAMERROR(conn);
 314  313  
 315  314      if(!conn->props.maxbufsize) {
 316  315  #ifdef _SUN_SDK_
 317  316          _sasl_log(conn, SASL_LOG_ERR,
 318  317                    "called sasl_encode[v] with application that does not support security layers");
 319  318  #else
 320  319          sasl_seterror(conn, 0,
↓ open down ↓ 20 lines elided ↑ open up ↑
 341  340  #ifdef _SUN_SDK_
 342  341          result = _iovec_to_buf(conn->gctx, invec, numiov, &conn->encode_buf);
 343  342  #else
 344  343          result = _iovec_to_buf(invec, numiov, &conn->encode_buf);
 345  344  #endif /* _SUN_SDK_ */
 346  345          if(result != SASL_OK) INTERROR(conn, result);
 347  346         
 348  347          *output = conn->encode_buf->data;
 349  348          *outputlen = conn->encode_buf->curlen;
 350  349  
 351      -    /* CRYPT DELETE START */
 352  350  #ifdef _INTEGRATED_SOLARIS_
 353  351      } else if (!conn->sun_reg) {
 354  352              INTERROR(conn, SASL_FAIL);
 355  353  #endif /* _INTEGRATED_SOLARIS_ */
 356      -    /* CRYPT DELETE END */
 357  354      } else {
 358  355          result = conn->oparams.encode(conn->context, invec, numiov,
 359  356                                        output, outputlen);
 360  357      }
 361      -    /* EXPORT DELETE END */
 362  358  
 363  359      RETURN(conn, result);
 364  360  }
 365  361   
 366  362  /* output is only valid until next call to sasl_decode */
 367  363  int sasl_decode(sasl_conn_t *conn,
 368  364                  const char *input, unsigned inputlen,
 369  365                  const char **output, unsigned *outputlen)
 370  366  {
 371  367      int result;
 372      -    /* EXPORT DELETE START */
 373  368  #ifdef _SUN_SDK_
 374  369      const _sasl_global_context_t *gctx;
 375  370  #endif /* _SUN_SDK_ */
 376  371  
 377  372      if(!conn) return SASL_BADPARAM;
 378  373      if(!input || !output || !outputlen)
 379  374          PARAMERROR(conn);
 380  375  
 381  376  #ifdef _SUN_SDK_
 382  377      gctx = conn->gctx;
↓ open down ↓ 33 lines elided ↑ open up ↑
 416  411              conn->decode_buf = sasl_ALLOC(conn->props.maxbufsize + 1);
 417  412          if(!conn->decode_buf)   
 418  413              MEMERROR(conn);
 419  414          
 420  415          memcpy(conn->decode_buf, input, inputlen);
 421  416          conn->decode_buf[inputlen] = '\0';
 422  417          *output = conn->decode_buf;
 423  418          *outputlen = inputlen;
 424  419          
 425  420          return SASL_OK;
 426      -    /* CRYPT DELETE START */
 427  421  #ifdef _INTEGRATED_SOLARIS_
 428  422      } else if (!conn->sun_reg) {
 429  423              INTERROR(conn, SASL_FAIL);
 430  424  #endif /* _INTEGRATED_SOLARIS_ */
 431      -    /* CRYPT DELETE END */
 432  425      } else {
 433  426          result = conn->oparams.decode(conn->context, input, inputlen,
 434  427                                        output, outputlen);
 435  428  
 436  429          /* NULL an empty buffer (for misbehaved applications) */
 437  430          if (*outputlen == 0) *output = NULL;
 438  431  
 439  432          RETURN(conn, result);
 440  433      }
 441  434  
 442      -    /* EXPORT DELETE END */
 443  435  #ifdef _SUN_SDK_
 444  436      return SASL_FAIL;
 445  437  #else
 446  438      INTERROR(conn, SASL_FAIL);
 447  439  #endif  /* _SUN_SDK_ */
 448  440  }
 449  441  
 450  442  
 451  443  void
 452  444  sasl_set_alloc(sasl_malloc_t *m,
↓ open down ↓ 287 lines elided ↑ open up ↑
 740  732    int result = SASL_OK;
 741  733    sasl_getopt_t *getopt;
 742  734    void *context;
 743  735    
 744  736    if (! conn) return SASL_BADPARAM;
 745  737    if (! pvalue) PARAMERROR(conn);
 746  738  
 747  739    switch(propnum)
 748  740    {
 749  741    case SASL_SSF:
 750      -    /* EXPORT DELETE START */
 751      -    /* CRYPT DELETE START */
 752  742  #ifdef _INTEGRATED_SOLARIS_
 753  743        if (!conn->sun_reg)
 754  744          conn->oparams.mech_ssf = 0;
 755  745  #endif /* _INTEGRATED_SOLARIS_ */
 756      -    /* CRYPT DELETE END */
 757      -    /* EXPORT DELETE END */
 758  746        *(sasl_ssf_t **)pvalue= &conn->oparams.mech_ssf;
 759  747        break;      
 760  748    case SASL_MAXOUTBUF:
 761  749        *(unsigned **)pvalue = &conn->oparams.maxoutbuf;
 762  750        break;
 763  751    case SASL_GETOPTCTX:
 764  752        result = _sasl_getcallback(conn, SASL_CB_GETOPT, &getopt, &context);
 765  753        if(result != SASL_OK) break;
 766  754        
 767  755        *(void **)pvalue = context;
↓ open down ↓ 529 lines elided ↑ open up ↑
1297 1285          return "no memory available";
1298 1286  #else
1299 1287      _buf_alloc(&conn->errdetail_buf, &conn->errdetail_buf_len, need_len);
1300 1288  #endif /* _SUN_SDK_ */
1301 1289  
1302 1290      snprintf(conn->errdetail_buf, need_len, "%s%s", leader, conn->error_buf);
1303 1291     
1304 1292      return conn->errdetail_buf;
1305 1293  }
1306 1294  
1307      -/* EXPORT DELETE START */
1308      -/* CRYPT DELETE START */
1309 1295  #ifdef _INTEGRATED_SOLARIS_
1310 1296  DEFINE_STATIC_MUTEX(reg_mutex);
1311 1297  typedef struct reg_list {
1312 1298          struct reg_list *next;
1313 1299          void *mech;
1314 1300  } reg_list_t;
1315 1301  
1316 1302  static reg_list_t *reg_list_base = NULL;
1317 1303  
1318 1304  int _is_sun_reg(void *mech)
↓ open down ↓ 27 lines elided ↑ open up ↑
1346 1332  
1347 1333          if (r != NULL) {
1348 1334                  r->mech = arg;
1349 1335                  LOCK_MUTEX(&reg_mutex);
1350 1336                  r->next = reg_list_base;
1351 1337                  reg_list_base = r;
1352 1338                  UNLOCK_MUTEX(&reg_mutex);
1353 1339          }
1354 1340  }
1355 1341  #endif /* _INTEGRATED_SOLARIS_ */
1356      -/* CRYPT DELETE END */
1357      -/* EXPORT DELETE END */
1358 1342  
1359 1343  /* Note that this needs the global callbacks, so if you don't give getcallbacks
1360 1344   * a sasl_conn_t, you're going to need to pass it yourself (or else we couldn't
1361 1345   * have client and server at the same time */
1362 1346  static int _sasl_global_getopt(void *context,
1363 1347                                 const char *plugin_name,
1364 1348                                 const char *option,
1365 1349                                 const char ** result,
1366 1350                                 unsigned *len)
1367 1351  {
1368 1352    const sasl_global_callbacks_t * global_callbacks;
1369 1353    const sasl_callback_t *callback;
1370 1354  #ifdef _SUN_SDK_
1371 1355    _sasl_global_context_t *gctx;
1372 1356  #endif /* _SUN_SDK_ */
1373 1357  
1374 1358    global_callbacks = (const sasl_global_callbacks_t *) context;
1375 1359  
1376 1360  #ifdef _SUN_SDK_
1377      -  /* EXPORT DELETE START */
1378      -  /* CRYPT DELETE START */
1379 1361  #ifdef _INTEGRATED_SOLARIS_
1380 1362    if (strcmp("reg_sun_plug", option) == 0) {
1381 1363          *result = (const char *)_register_plugin;
1382 1364          *len = 0;
1383 1365          return (SASL_OK);
1384 1366    }
1385 1367  #endif /* _INTEGRATED_SOLARIS_ */
1386      -  /* CRYPT DELETE END */
1387      -  /* EXPORT DELETE END */
1388 1368  
1389 1369    if (global_callbacks)
1390 1370      gctx = global_callbacks->gctx;
1391 1371    else
1392 1372      gctx = _sasl_gbl_ctx();
1393 1373  #endif /* _SUN_SDK_ */
1394 1374  
1395 1375    if (global_callbacks && global_callbacks->callbacks) {
1396 1376        for (callback = global_callbacks->callbacks;
1397 1377             callback->id != SASL_CB_LIST_END;
↓ open down ↓ 1291 lines elided ↑ open up ↑
2689 2669  _sasl_getconf(void *context __attribute__((unused)), const char **conf)
2690 2670  {
2691 2671      if (! conf)
2692 2672          return SASL_BADPARAM;
2693 2673  
2694 2674      *conf = SASL_CONFDIR;
2695 2675  
2696 2676      return SASL_OK;
2697 2677  }
2698 2678  
2699      -/* EXPORT DELETE START */
2700      -/* CRYPT DELETE START */
2701 2679  #ifdef _INTEGRATED_SOLARIS_
2702 2680  #pragma fini(sasl_fini)
2703 2681  int 
2704 2682  sasl_fini(void) 
2705 2683  { 
2706 2684      reg_list_t *next;
2707 2685  
2708 2686      while (reg_list_base != NULL) {
2709 2687          next = reg_list_base->next;
2710 2688          free(reg_list_base);
2711 2689          reg_list_base = next;
2712 2690      }
2713 2691      return (0);
2714 2692  } 
2715 2693  #endif /* _INTEGRATED_SOLARIS_ */
2716      -/* CRYPT DELETE END */
2717      -/* EXPORT DELETE END */
2718 2694  
2719 2695  #endif /* _SUN_SDK_ */
2720 2696  
2721 2697  #ifndef WIN32
2722 2698  static int
2723 2699  _sasl_getpath(void *context __attribute__((unused)),
2724 2700                const char **path)
2725 2701  {
2726 2702    if (! path)
2727 2703      return SASL_BADPARAM;
↓ open down ↓ 187 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX