Print this page
3882 remove xmod & friends

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/rpc/sec_gss/rpcsec_gss_misc.c
          +++ new/usr/src/uts/common/rpc/sec_gss/rpcsec_gss_misc.c
↓ open down ↓ 137 lines elided ↑ open up ↑
 138  138          gss_ctx_id_t            context;
 139  139          uint_t                  seq_num;
 140  140          XDR                     *out_xdrs;
 141  141          bool_t                  (*xdr_func)();
 142  142          caddr_t                 xdr_ptr;
 143  143  {
 144  144          OM_uint32               major, minor;
 145  145          gss_buffer_desc         in_buf, out_buf;
 146  146          XDR                     temp_xdrs;
 147  147          char                    *temp_data;
 148      -/* EXPORT DELETE START */
 149  148          bool_t                  conf_state;
 150      -/* EXPORT DELETE END */
 151  149          bool_t                  ret = FALSE;
 152  150          int                     size;
 153  151  
 154  152          /*
 155  153           * Create a temporary XDR/buffer to hold the data to be wrapped.
 156  154           * We need an extra bit for the sequence number serialized first.
 157  155           */
 158  156          size = xdr_sizeof(xdr_func, xdr_ptr) + BYTES_PER_XDR_UNIT;
 159  157          temp_data = kmem_alloc(size, KM_SLEEP);
 160  158          out_buf.length = 0;
↓ open down ↓ 17 lines elided ↑ open up ↑
 178  176           * out_buf will have wrapped data (in_buf will no longer be
 179  177           * needed).  If integrity is used, out_buf will have checksum
 180  178           * which will follow the data in in_buf.
 181  179           */
 182  180          in_buf.length = xdr_getpos(&temp_xdrs);
 183  181          in_buf.value = (char *)temp_xdrs.x_base;
 184  182  
 185  183          switch (service) {
 186  184          case rpc_gss_svc_privacy:
 187  185  
 188      -/* EXPORT DELETE START */
 189  186                  if ((major = kgss_seal(&minor, context, TRUE, qop, &in_buf,
 190  187                                  &conf_state, &out_buf)) != GSS_S_COMPLETE) {
 191  188                          RPCGSS_LOG1(1, "rpc_gss_wrap: kgss_seal failed."
 192  189                                  "major = %x, minor = %x", major, minor);
 193  190                          goto fail;
 194  191                  }
 195  192                  in_buf.length = 0;      /* in_buf not needed */
 196  193                  if (!conf_state)
 197      -/* EXPORT DELETE END */
 198  194                          goto fail;
 199      -/* EXPORT DELETE START */
 200  195                  break;
 201      -/* EXPORT DELETE END */
 202  196          case rpc_gss_svc_integrity:
 203  197                  if ((major = kgss_sign(&minor, context, qop, &in_buf,
 204  198                                  &out_buf)) != GSS_S_COMPLETE) {
 205  199                          RPCGSS_LOG1(1, "rpc_gss_wrap: kgss_sign failed."
 206  200                                  "major = %x, minor = %x", major, minor);
 207  201                          goto fail;
 208  202                  }
 209  203                  break;
 210  204          default:
 211  205                  goto fail;
↓ open down ↓ 45 lines elided ↑ open up ↑
 257  251           * Pull out wrapped data.  For privacy service, this is the
 258  252           * encrypted data.  For integrity service, this is the data
 259  253           * followed by a checksum.
 260  254           */
 261  255          if (!__xdr_gss_buf(in_xdrs, &in_buf)) {
 262  256                  return (FALSE);
 263  257          }
 264  258  
 265  259          if (service == rpc_gss_svc_privacy) {
 266  260                  major = GSS_S_FAILURE;
 267      -/* EXPORT DELETE START */
 268  261                  major = kgss_unseal(&minor, context, &in_buf, &out_buf, &conf,
 269  262                                          &qop);
 270      -/* EXPORT DELETE END */
 271  263                  kmem_free(in_buf.value, in_buf.length);
 272  264                  if (major != GSS_S_COMPLETE) {
 273  265                          RPCGSS_LOG1(1, "rpc_gss_unwrap: kgss_unseal failed."
 274  266                                  "major = %x, minor = %x", major, minor);
 275  267                          return (FALSE);
 276  268                  }
 277  269                  /*
 278  270                   * Keep the returned token (unencrypted data) in in_buf.
 279  271                   */
 280  272                  in_buf.length = out_buf.length;
↓ open down ↓ 63 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX