private void checkStrengthSupport(byte[] ciphersInChallenge) throws IOException {
  if (ciphersInChallenge == null) {
    throw new SaslException("DIGEST-MD5: server did not specify " + "cipher to use for 'auth-conf'");
  }
  String cipherOptions=new String(ciphersInChallenge,encoding);
  StringTokenizer parser=new StringTokenizer(cipherOptions,", \t\n");
  int tokenCount=parser.countTokens();
  String token=null;
  byte[] serverCiphers={UNSET,UNSET,UNSET,UNSET,UNSET};
  String[] serverCipherStrs=new String[serverCiphers.length];
  for (int i=0; i < tokenCount; i++) {
    token=parser.nextToken();
    for (int j=0; j < CIPHER_TOKENS.length; j++) {
      if (token.equals(CIPHER_TOKENS[j])) {
        serverCiphers[j]|=CIPHER_MASKS[j];
        serverCipherStrs[j]=token;
        logger.log(Level.FINE,"DIGEST62:Server supports {0}",token);
      }
    }
  }
  byte[] clntCiphers=getPlatformCiphers();
  byte inter=0;
  for (int i=0; i < serverCiphers.length; i++) {
    serverCiphers[i]&=clntCiphers[i];
    inter|=serverCiphers[i];
  }
  if (inter == UNSET) {
    throw new SaslException("DIGEST-MD5: Client supports none of these cipher suites: " + cipherOptions);
  }
  negotiatedCipher=findCipherAndStrength(serverCiphers,serverCipherStrs);
  if (negotiatedCipher == null) {
    throw new SaslException("DIGEST-MD5: Unable to negotiate " + "a strength level for 'auth-conf'");
  }
  logger.log(Level.FINE,"DIGEST63:Cipher suite: {0}",negotiatedCipher);
}

private void checkStrengthSupport ( byte [ ] ciphersInChallenge ) throws IOException { if ( ciphersInChallenge == null ) { throw new SaslException ( "DIGEST-MD5: server did not specify " + "cipher to use for 'auth-conf'" ) ; } String cipherOptions = new String ( ciphersInChallenge , encoding ) ; StringTokenizer parser = new StringTokenizer ( cipherOptions , ", \t\n" ) ; int tokenCount = parser . countTokens ( ) ; String token = null ; byte [ ] serverCiphers = { UNSET , UNSET , UNSET , UNSET , UNSET } ; String [ ] serverCipherStrs = new String [ serverCiphers . length ] ; for ( int i = 0 ; i < tokenCount ; i ++ ) { token = parser . nextToken ( ) ; for ( int j = 0 ; j < CIPHER_TOKENS . length ; j ++ ) { if ( token . equals ( CIPHER_TOKENS [ j ] ) ) { serverCiphers [ j ] |= CIPHER_MASKS [ j ] ; serverCipherStrs [ j ] = token ; logger . log ( Level . FINE , "DIGEST62:Server supports {0}" , token ) ; } } } byte [ ] clntCiphers = getPlatformCiphers ( ) ; byte inter = 0 ; for ( int i = 0 ; i < serverCiphers . length ; i ++ ) { serverCiphers [ i ] &= clntCiphers [ i ] ; inter |= serverCiphers [ i ] ; } if ( inter == UNSET ) { throw new SaslException ( "DIGEST-MD5: Client supports none of these cipher suites: " + cipherOptions ) ; } negotiatedCipher = findCipherAndStrength ( serverCiphers , serverCipherStrs ) ; if ( negotiatedCipher == null ) { throw new SaslException ( "DIGEST-MD5: Unable to negotiate " + "a strength level for 'auth-conf'" ) ; } logger . log ( Level . FINE , "DIGEST63:Cipher suite: {0}" , negotiatedCipher ) ; }
processes the ' cipher ' digest - challenge directive . this allows the mechanism to check for client - side support against the list of supported ciphers send by the server . if no match is found , the mechanism aborts .
