@param trans
@param sess
@throws CIFSException
183038
private void validateNegotiation ( SmbTransportImpl trans, SmbSessionImpl sess ) throws CIFSException {
        if ( !trans.isSMB2() || sess.getCredentials().isAnonymous() || sess.getCredentials().isGuest()
                || !sess.getConfig().isRequireSecureNegotiate() ) {
            log.debug("Secure negotiation does not apply");
            return;
        }

        Smb2NegotiateResponse nego = (Smb2NegotiateResponse) trans.getNegotiateResponse();
        if ( nego.getSelectedDialect().atLeast(DialectVersion.SMB311) ) {
            // have preauth integrity instead
            log.debug("Secure negotiation does not apply, is SMB3.1");
            return;
        }
        Smb2NegotiateRequest negoReq = new Smb2NegotiateRequest(sess.getConfig(), trans.getRequestSecurityMode(nego));

        log.debug("Sending VALIDATE_NEGOTIATE_INFO");
        Smb2IoctlRequest req = new Smb2IoctlRequest(sess.getConfig(), Smb2IoctlRequest.FSCTL_VALIDATE_NEGOTIATE_INFO);
        req.setFlags(Smb2IoctlRequest.SMB2_O_IOCTL_IS_FSCTL);
        req.setInputData(
            new ValidateNegotiateInfoRequest(
                negoReq.getCapabilities(),
                negoReq.getClientGuid(),
                (short) negoReq.getSecurityMode(),
                negoReq.getDialects()));

        Smb2IoctlResponse resp;
        try {
            resp = send(req, RequestParam.NO_RETRY);
        }
        catch ( SMBSignatureValidationException e ) {
            throw new SMBProtocolDowngradeException("Signature error during negotiate validation", e);
        }
        catch ( SmbException e ) {
            if ( log.isDebugEnabled() ) {
                log.debug(String.format("VALIDATE_NEGOTIATE_INFO response code 0x%x", e.getNtStatus()));
            }
            log.trace("VALIDATE_NEGOTIATE_INFO returned error", e);
            if ( ( req.getResponse().isReceived() && req.getResponse().isVerifyFailed() ) || e.getNtStatus() == NtStatus.NT_STATUS_ACCESS_DENIED ) {
                // this is the signature error
                throw new SMBProtocolDowngradeException("Signature error during negotiate validation", e);
            }

            // other errors are treated as success
            return;
        }
        ValidateNegotiateInfoResponse out = resp.getOutputData(ValidateNegotiateInfoResponse.class);

        if ( nego.getSecurityMode() != out.getSecurityMode() || nego.getCapabilities() != out.getCapabilities()
                || nego.getDialectRevision() != out.getDialect() || !Arrays.equals(nego.getServerGuid(), out.getServerGuid()) ) {
            log.debug("Secure negotiation failure");
            throw new CIFSException("Mismatched attributes validating negotiate info");
        }

        log.debug("Secure negotiation OK");
    }
370389
public final void mESC_SEQ() throws RecognitionException {
        try {
            // com/dyuproject/protostuff/parser/ProtoLexer.g:280:5: ( '\\\\' ( 'a' | 'v' | 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | '\\\\' ( 'x' | 'X' ) HEX_DIGIT HEX_DIGIT | UNICODE_ESC | OCTAL_ESC )
            int alt18=4;
            switch ( input.LA(1) ) {
            case '\\':
                {
                switch ( input.LA(2) ) {
                case '\"':
                case '\'':
                case '\\':
                case 'a':
                case 'b':
                case 'f':
                case 'n':
                case 'r':
                case 't':
                case 'v':
                    {
                    alt18=1;
                    }
                    break;
                case 'X':
                case 'x':
                    {
                    alt18=2;
                    }
                    break;
                case 'u':
                    {
                    alt18=3;
                    }
                    break;
                case '0':
                case '1':
                case '2':
                case '3':
                case '4':
                case '5':
                case '6':
                case '7':
                    {
                    alt18=4;
                    }
                    break;
                default:
                    NoViableAltException nvae =
                        new NoViableAltException("", 18, 1, input);

                    throw nvae;
                }

                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 18, 0, input);

                throw nvae;
            }

            switch (alt18) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoLexer.g:280:9: '\\\\' ( 'a' | 'v' | 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' )
                    {
                    match('\\'); 
                    if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||(input.LA(1)>='a' && input.LA(1)<='b')||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t'||input.LA(1)=='v' ) {
                        input.consume();

                    }
                    else {
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        recover(mse);
                        throw mse;}


                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoLexer.g:281:9: '\\\\' ( 'x' | 'X' ) HEX_DIGIT HEX_DIGIT
                    {
                    match('\\'); 
                    if ( input.LA(1)=='X'||input.LA(1)=='x' ) {
                        input.consume();

                    }
                    else {
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        recover(mse);
                        throw mse;}

                    mHEX_DIGIT(); 
                    mHEX_DIGIT(); 

                    }
                    break;
                case 3 :
                    // com/dyuproject/protostuff/parser/ProtoLexer.g:282:9: UNICODE_ESC
                    {
                    mUNICODE_ESC(); 

                    }
                    break;
                case 4 :
                    // com/dyuproject/protostuff/parser/ProtoLexer.g:283:9: OCTAL_ESC
                    {
                    mOCTAL_ESC(); 

                    }
                    break;

            }
        }
        finally {
        }
    }
899476
@Override
  public boolean moveToTrashAsUser(Path path, final String user) throws IOException {
    return getUserTrash(user).moveToTrash(path);
  }
1131353
@Override
    @GwtIncompatible("incompatible method")
    public int translate(final CharSequence input, final int index, final Writer out) throws IOException {
        for (final CharSequenceTranslator translator : translators) {
            final int consumed = translator.translate(input, index, out);
            if(consumed != 0) {
                return consumed;
            }
        }
        return 0;
    }
59111
public synchronized void putSITransaction(SITransaction transaction)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "putSITransaction", transaction);
      Transaction commsTx = (Transaction)transaction;

      int flags = -1;

      if (transaction == null)
      {
         // No transaction - add "no transaction" flags to buffer.
        putInt(0x00000000);
      }
      else
      {
         // First we must search for any optimized transactions as they hold much more information
         // than the old-style ones.
         OptimizedTransaction optTx = null;

         // First see if the transaction is a global one. This could be both optimized or
         // unoptimized but the result is buried within it
         if (transaction instanceof SuspendableXAResource)
         {
            SIXAResource suspendableXARes = ((SuspendableXAResource) transaction).getCurrentXAResource();
            if (suspendableXARes instanceof OptimizedTransaction)
            {
               // The current XA Resource is indeed optimized
               optTx = (OptimizedTransaction) suspendableXARes;
            }
         }
         // Otherwise the actual transaction itself may be an optimized one - this is in the case
         // of an optimized local transaction.
         else if (transaction instanceof OptimizedTransaction)
         {
            optTx = (OptimizedTransaction) transaction;
         }

         // If we are optimized...
         if (optTx != null)
         {
            // Optimized transaction
            flags = CommsConstants.OPTIMIZED_TX_FLAGS_TRANSACTED_BIT;

            boolean local = optTx instanceof SIUncoordinatedTransaction;
            boolean addXid = false;
            boolean endPreviousUow = false;
            if (local)
            {
               flags |= CommsConstants.OPTIMIZED_TX_FLAGS_LOCAL_BIT;
            }
            if (!optTx.isServerTransactionCreated())
            {
               flags |= CommsConstants.OPTIMIZED_TX_FLAGS_CREATE_BIT;
               if (local && optTx.areSubordinatesAllowed())
                  flags |= CommsConstants.OPTIMIZED_TX_FLAGS_SUBORDINATES_ALLOWED;
               optTx.setServerTransactionCreated();
               addXid = !local;
            }
            if (addXid && (optTx.isEndRequired()))
            {
               flags |= CommsConstants.OPTIMIZED_TX_END_PREVIOUS_BIT;
               endPreviousUow = true;
            }
            putInt(flags);
            putInt(optTx.getCreatingConversationId());
            putInt(commsTx.getTransactionId());
            if (addXid)
            {
               if (endPreviousUow)
               {
                  putInt(optTx.getEndFlags());
                  optTx.setEndNotRequired();
               }
               putXid(new XidProxy(optTx.getXidForCurrentUow()));
            }
         }
         else
         {
            // This is an un-optimized transaction - simply append transaction ID.
            putInt(commsTx.getTransactionId());
         }
      }

      if (TraceComponent.isAnyTracingEnabled()) {
        int commsId = -1;
        if (commsTx != null)  commsId = commsTx.getTransactionId();
        CommsLightTrace.traceTransaction(tc, "PutTxnTrace", commsTx, commsId, flags);
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "putSITransaction");
   }
887553
@Override
  public int transferTo(ByteBuf buf) throws IOException {
    Preconditions.checkState(!mClosed);
    if (mUnderFileSystemInputStream == null) {
      return -1;
    }
    if (mBlockMeta.getBlockSize() <= mInStreamPos) {
      return -1;
    }
   // Make a copy of the state to keep track of what we have read in this transferTo call.
    ByteBuf bufCopy = null;
    if (mBlockWriter != null) {
      bufCopy = buf.duplicate();
      bufCopy.readerIndex(bufCopy.writerIndex());
    }
    int bytesToRead =
        (int) Math.min(buf.writableBytes(), mBlockMeta.getBlockSize() - mInStreamPos);
    int bytesRead = buf.writeBytes(mUnderFileSystemInputStream, bytesToRead);
    if (bytesRead <= 0) {
      return bytesRead;
    }

    mInStreamPos += bytesRead;

    if (mBlockWriter != null && bufCopy != null) {
      try {
        bufCopy.writerIndex(buf.writerIndex());
        while (bufCopy.readableBytes() > 0) {
          mLocalBlockStore.requestSpace(mBlockMeta.getSessionId(), mBlockMeta.getBlockId(),
              mInStreamPos - mBlockWriter.getPosition());
          mBlockWriter.append(bufCopy);
        }
      } catch (Exception e) {
        LOG.warn("Failed to cache data read from UFS (on transferTo()): {}", e.getMessage());
        cancelBlockWriter();
      }
    }

    return bytesRead;
  }
1155547
public final void pextrq(Register dst, XMMRegister src, Immediate imm8)
  {
    emitX86(INST_PEXTRQ, dst, src, imm8);
  }
1028865
def set_trans(self, trans_vec):
        """"""

        # Column major,  translation components in column 3.
        self.data[3][0] = trans_vec[0]
        self.data[3][1] = trans_vec[1]
        self.data[3][2] = trans_vec[2]
841864
function encodeAttachmentMITTransfer(buffer, offset, symbol, address) {
    offset = buffer.writeUInt8(Constants.MIT.STATUS.TRANSFER, offset);
    offset += encodeString(buffer, symbol, offset);
    offset += encodeString(buffer, address, offset);
    return offset;
}
1374702
private void moveBufferTo(byte[] dest) {
    int size = endIndex - index;
    System.arraycopy(buffer, index, dest, 0, size);
    index = 0;
    endIndex = size;
  }
548846
public void parse(WsByteBuffer transmissionData)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "parse", transmissionData);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, transmissionData, "transmissionBuffer");

      needMoreData = false;
      boolean encounteredError = false;

      while(!needMoreData && !encounteredError)
      {
         switch(state)
         {
            case(STATE_PARSING_PRIMARY_HEADER):
               parsePrimaryHeader(transmissionData);
               break;
            case(STATE_PARSING_CONVERSATION_HEADER):
               parseConversationHeader(transmissionData);
               break;
            case(STATE_PARSING_SEGMENT_START_HEADER):
               parseSegmentStartHeader(transmissionData);
               break;
            case(STATE_PARSING_PRIMARY_ONLY_PAYLOAD):
               parsePrimaryOnlyPayload(transmissionData);
               break;
            case(STATE_PARSE_CONVERSATION_PAYLOAD):
               parseConversationPayload(transmissionData);
               break;
            case(STATE_PARSE_SEGMENT_START_PAYLOAD):
               parseSegmentStartPayload(transmissionData);
               break;
            case(STATE_PARSE_SEGMENT_MIDDLE_PAYLOAD):
               parseSegmentMiddlePayload(transmissionData);
               break;
            case(STATE_PARSE_SEGMENT_END_PAYLOAD):
               parseSegmentEndPayload(transmissionData);
               break;
            case(STATE_ERROR):
               encounteredError = true;
               break;
            default:
               if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "got into default branch of parse() method case statement");
               throwable = new SIErrorException("Should not have entered default branch of parse() method case statement");
               FFDCFilter.processException(throwable, "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser", JFapChannelConstants.INBOUNDXMITPARSER_PARSE_01);
               state = STATE_ERROR;
               break;
         }
      }

      if (encounteredError)
      {
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "encountered error parsing");
         if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, throwable);
         connection.invalidate(false, throwable, "parse error while parsing transmission");  // D224570
      }
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "parse");
   }
909311
public function trans($toTranslate, $params = [], $forceLang = '')
    {
        $toTranslate = strtolower($toTranslate);
        $this->_getParams($toTranslate, $params);
        $toTranslate = trim($toTranslate);
        // If there isn't a dot we'll append one just to avoid the "undefined offset 1" warning
        if (false === strpos('.', $toTranslate)) {
            $toTranslate .= '.';
        }

        list($fileName, $key) = $this->parseFileKey($toTranslate);
        $langArray = $this->langFile($fileName, $forceLang);

        $value = isset($langArray[$key]) ? $langArray[$key] : $key;
        if (is_numeric(strpos($value, ':'))
            && !empty($params)
            && is_array($params)
        ) {
            $value = $this->_setParams($value, $params);
        }

        return $value;
    }
1324552
private function diffMissing(array $toTranslations, array $fromTranslations, $locale)
    {
        $diff = array_diff_key($toTranslations, $fromTranslations);

        if (count($diff) === 0)
            return;

        foreach ($diff as $transKey => $transValue) {
            $this->addMissing($locale, $transKey);
        }
    }
22453
public static void transfer(Pipe pipe, Input input, Output output,
            int number, boolean repeated, IdStrategy strategy) throws IOException
    {
        if (0 == (IdStrategy.ENUMS_BY_NAME & strategy.flags))
            output.writeEnum(number, input.readEnum(), repeated);
        else
            input.transferByteRangeTo(output, true, number, repeated);
    }
1228171
private EConvResult transConv(byte[] in, Ptr inPtr, int inStop, byte[] out, Ptr outPtr, int outStop, int flags, Ptr resultPositionPtr) {
        // null check

        if (elements[0].lastResult == EConvResult.AfterOutput) elements[0].lastResult = EConvResult.SourceBufferEmpty;

        for (int i = numTranscoders - 1; 0 <= i; i--) {
            switch (elements[i].lastResult) {
            case InvalidByteSequence:
            case IncompleteInput:
            case UndefinedConversion:
            case AfterOutput:
            case Finished:
                return transConvNeedReport(in, inPtr, inStop, out, outPtr, outStop, flags, resultPositionPtr, i + 1, i);
            case DestinationBufferFull:
            case SourceBufferEmpty:
                break;
            default:
                throw new InternalException("unexpected transcode last result");
            }
        }

        /* /^[sd]+$/ is confirmed. but actually /^s*d*$/. */

        if (elements[numTranscoders - 1].lastResult == EConvResult.DestinationBufferFull && (flags & AFTER_OUTPUT) != 0) {
            EConvResult res = transConv(NULL_STRING, Ptr.NULL, 0, out, outPtr, outStop, (flags & ~AFTER_OUTPUT) | PARTIAL_INPUT, resultPositionPtr);
            return res.isSourceBufferEmpty() ? EConvResult.AfterOutput : res;
        }

        return transConvNeedReport(in, inPtr, inStop, out, outPtr, outStop, flags, resultPositionPtr, 0, -1);
    }
1330413
public void exchangeStop()
      throws SISessionUnavailableException, SISessionDroppedException,
             SIConnectionUnavailableException, SIConnectionDroppedException,
             SIResourceException, SIConnectionLostException,
             SIErrorException
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "exchangeStop");

      if (sessionId == 0)
      {
         // If the session Id = 0, then no one called setSessionId(). As such we are unable to flow
         // to the server as we do not know which session to instruct the server to use.
         SIErrorException e = new SIErrorException(
            nls.getFormattedMessage("SESSION_ID_HAS_NOT_BEEN_SET_SICO1043", null, null)
         );

         FFDCFilter.processException(e, CLASS_NAME + ".exchangeStop",
                                     CommsConstants.CONVERSATIONHELPERIMPL_04, this);

         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, e.getMessage(), e);

         throw e;
      }

      CommsByteBuffer request = getCommsByteBuffer();
      // Connection object id
      request.putShort(connectionObjectId);
      // Consumer session id
      request.putShort(sessionId);

      // Pass on call to server
      final CommsByteBuffer reply = jfapExchange(request,
                                                 JFapChannelConstants.SEG_STOP_SESS,
                                                 JFapChannelConstants.PRIORITY_MEDIUM,
                                                 true);

      // Confirm appropriate data returned
      try
      {
         short err = reply.getCommandCompletionCode(JFapChannelConstants.SEG_STOP_SESS_R);
         if (err != CommsConstants.SI_NO_EXCEPTION)
         {
            checkFor_SISessionUnavailableException(reply, err);
            checkFor_SISessionDroppedException(reply, err);
            checkFor_SIConnectionUnavailableException(reply, err);
            checkFor_SIConnectionDroppedException(reply, err);
            checkFor_SIConnectionLostException(reply, err);
            checkFor_SIResourceException(reply, err);
            checkFor_SIErrorException(reply, err);
            defaultChecker(reply, err);
         }
      }
      finally
      {
         if (reply != null) reply.release();
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "exchangeStop");
   }
305350
@Override
	public Result<CertInfo> toCert(AuthzTrans trans, Result<CertResp> in, String[] trustChain) throws IOException {
		if(in.isOK()) {
			CertResp cin = in.value;
			CertInfo cout = newInstance(API.CERT);
			cout.setPrivatekey(cin.privateString());
			String value;
			if((value=cin.challenge())!=null) {
				cout.setChallenge(value);
			}
			cout.getCerts().add(cin.asCertString());
			if(trustChain!=null) {
				for(String c : trustChain) {
					cout.getCerts().add(c);
				}
			}
			if(cin.notes()!=null) {
				boolean first = true;
				StringBuilder sb = new StringBuilder();
				for(String n : cin.notes()) {
					if(first) {
						first = false;
					} else {
						sb.append('\n');
					}
					sb.append(n);
				}
				cout.setNotes(sb.toString());
			}
			return Result.ok(cout);
		} else {
			return Result.err(in);
		}
	}