public String getSaslQOP() { return (String) saslClient.getNegotiatedProperty(Sasl.QOP); } }
@Override protected String getNegotiatedProperty(String name) { return (String) client.getNegotiatedProperty(name); }
public Object getNegotiatedProperty(final String propName) { return delegate.getNegotiatedProperty(propName); }
private String getNegotiatedQop() { return (String) saslClient.getNegotiatedProperty(Sasl.QOP); }
public String getSaslQOP() { return (String) saslClient.getNegotiatedProperty(Sasl.QOP); }
private boolean useWrap() { String qop = (String) saslClient.getNegotiatedProperty(Sasl.QOP); return qop != null && !"auth".equalsIgnoreCase(qop); }
private boolean useWrap() { // getNegotiatedProperty throws if client isn't complete String qop = (String) saslClient.getNegotiatedProperty(Sasl.QOP); // SASL wrapping is only used if the connection has a QOP, and // the value is not auth. ex. auth-int & auth-priv return qop != null && !"auth".toLowerCase(Locale.ENGLISH).equals(qop); }
/** * Constructs a SASLInputStream from an InputStream and a SaslClient <br> * Note: if the specified InputStream or SaslClient is null, a * NullPointerException may be thrown later when they are used. * * @param inStream * the InputStream to be processed * @param saslClient * an initialized SaslClient object */ public SaslInputStream(InputStream inStream, SaslClient saslClient) { this.inStream = new DataInputStream(inStream); this.saslServer = null; this.saslClient = saslClient; String qop = (String) saslClient.getNegotiatedProperty(Sasl.QOP); this.useWrap = qop != null && !"auth".equalsIgnoreCase(qop); }
@Override public boolean needsWrapping() { if (client.isComplete()) { String qop = (String) client.getNegotiatedProperty(Sasl.QOP); return (qop != null && (qop.equalsIgnoreCase("auth-int") || qop.equalsIgnoreCase("auth-conf"))); } else { return false; } }
/** * Constructs a SASLOutputStream from an OutputStream and a SaslClient <br> * Note: if the specified OutputStream or SaslClient is null, a * NullPointerException may be thrown later when they are used. * * @param outStream * the OutputStream to be processed * @param saslClient * an initialized SaslClient object */ public SaslOutputStream(OutputStream outStream, SaslClient saslClient) { this.saslServer = null; this.saslClient = saslClient; String qop = (String) saslClient.getNegotiatedProperty(Sasl.QOP); this.useWrap = qop != null && !"auth".equalsIgnoreCase(qop); if (useWrap) { this.outStream = new BufferedOutputStream(outStream, 64*1024); } else { this.outStream = outStream; } }
@VisibleForTesting @InterfaceAudience.Private public Object getNegotiatedProperty(String key) { return (saslClient != null) ? saslClient.getNegotiatedProperty(key) : null; }
public Object getNegotiatedProperty(String propName) { if (client != null) return client.getNegotiatedProperty(propName); else return server.getNegotiatedProperty(propName); }
public void setupSaslHandler(ChannelPipeline p) { String qop = (String) saslClient.getNegotiatedProperty(Sasl.QOP); LOG.trace("SASL client context established. Negotiated QoP {}", qop); if (qop == null || "auth".equalsIgnoreCase(qop)) { return; } // add wrap and unwrap handlers to pipeline. p.addFirst(new SaslWrapHandler(saslClient), new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4), new SaslUnwrapHandler(saslClient)); }
/** * Get SASL wrapped OutputStream if SASL QoP requires wrapping, * otherwise return original stream. Can be called only after * saslConnect() has been called. * * @param out - OutputStream used to make the connection * @return OutputStream that may be using wrapping * @throws IOException */ public OutputStream getOutputStream(OutputStream out) throws IOException { if (useWrap()) { // the client and server negotiate a maximum buffer size that can be // wrapped String maxBuf = (String)saslClient.getNegotiatedProperty(Sasl.RAW_SEND_SIZE); out = new BufferedOutputStream(new WrappedOutputStream(out), Integer.parseInt(maxBuf)); } return out; }
+ saslClient.getNegotiatedProperty(Sasl.QOP));
final String negotiatedQOP = saslClient.getNegotiatedProperty(Sasl.QOP).toString(); final String expectedQOP = connection.isEncryptionEnabled() ? SaslProperties.QualityOfProtection.PRIVACY.getSaslQop() saslClient.getNegotiatedProperty(Sasl.RAW_SEND_SIZE).toString()); if (negotiatedRawSendSize <= 0) { throw new SaslException(String.format("Negotiated rawSendSize: %d is invalid. Please check the configured " +
final Object principalObj = saslClient.getNegotiatedProperty(WildFlySasl.PRINCIPAL); safeDispose(saslClient);
return; final Object qop = saslClient.getNegotiatedProperty(Sasl.QOP); if ("auth-int".equals(qop) || "auth-conf".equals(qop)) { connection.setSaslWrapper(SaslWrapper.create(saslClient)); final Object principalObj = saslClient.getNegotiatedProperty(WildFlySasl.PRINCIPAL);
public Object getNegotiatedProperty(String propName) { if (saslClient != null) return saslClient.getNegotiatedProperty(propName); else return saslServer.getNegotiatedProperty(propName); } }
public void setupSaslHandler(ChannelPipeline p) { String qop = (String) saslClient.getNegotiatedProperty(Sasl.QOP); LOG.trace("SASL client context established. Negotiated QoP {}", qop); if (qop == null || "auth".equalsIgnoreCase(qop)) { return; } // add wrap and unwrap handlers to pipeline. p.addFirst(new SaslWrapHandler(saslClient), new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4, 0, 4), new SaslUnwrapHandler(saslClient)); }