Program: 52309
Project: 52309
Buggy source:
/** 
 * Takes an encrypted string representing a password provided by the CAS ClearPass service and decrypts it using the private key configured for this extension.  Returns null if it is unable to decrypt the password.
 * @param encryptedPassword A string with the encrypted password provided by the CAS service.
 * @return The decrypted password, or null if it is unable to decrypt the password.
 * @throws GuacamoleException If unable to get Guacamole configuration data
 */
private final String decryptPassword(String encryptedPassword) throws GuacamoleException {
  if (encryptedPassword == null || encryptedPassword.isEmpty())   return null;
  try {
    File keyFile=new File(new LocalEnvironment().getGuacamoleHome(),confService.getClearpassKey().toString());
    InputStream keyInput=new BufferedInputStream(new FileInputStream(keyFile));
    final byte[] keyBytes=new byte[(int)keyFile.length()];
    keyInput.read(keyBytes);
    keyInput.close();
    KeyFactory keyFactory=KeyFactory.getInstance("String_Node_Str");
    KeySpec keySpec=new PKCS8EncodedKeySpec(keyBytes);
    final PrivateKey privateKey=keyFactory.generatePrivate(keySpec);
    final Cipher cipher=Cipher.getInstance(privateKey.getAlgorithm());
    final byte[] pass64=DatatypeConverter.parseBase64Binary(encryptedPassword);
    cipher.init(Cipher.DECRYPT_MODE,privateKey);
    final byte[] cipherData=cipher.doFinal(pass64);
    return new String(cipherData);
  }
 catch (  FileNotFoundException e) {
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",e.getMessage());
    return null;
  }
catch (  IOException e) {
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",e.getMessage());
    return null;
  }
catch (  NoSuchAlgorithmException e) {
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",e.getMessage());
    return null;
  }
catch (  InvalidKeyException e) {
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",e.getMessage());
    return null;
  }
catch (  Throwable t) {
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",t.getMessage());
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Takes an encrypted string representing a password provided by the CAS ClearPass service and decrypts it using the private key configured for this extension.  Returns null if it is unable to decrypt the password.
 * @param encryptedPassword A string with the encrypted password provided by the CAS service.
 * @return The decrypted password, or null if it is unable to decrypt the password.
 * @throws GuacamoleException If unable to get Guacamole configuration data
 */
private final String decryptPassword(String encryptedPassword) throws GuacamoleException {
  if (encryptedPassword == null || encryptedPassword.isEmpty())   return null;
  try {
    File keyFile=new File(environment.getGuacamoleHome(),confService.getClearpassKey().toString());
    InputStream keyInput=new BufferedInputStream(new FileInputStream(keyFile));
    final byte[] keyBytes=new byte[(int)keyFile.length()];
    keyInput.read(keyBytes);
    keyInput.close();
    KeyFactory keyFactory=KeyFactory.getInstance("String_Node_Str");
    KeySpec keySpec=new PKCS8EncodedKeySpec(keyBytes);
    final PrivateKey privateKey=keyFactory.generatePrivate(keySpec);
    final Cipher cipher=Cipher.getInstance(privateKey.getAlgorithm());
    final byte[] pass64=DatatypeConverter.parseBase64Binary(encryptedPassword);
    cipher.init(Cipher.DECRYPT_MODE,privateKey);
    final byte[] cipherData=cipher.doFinal(pass64);
    return new String(cipherData);
  }
 catch (  FileNotFoundException e) {
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",e.getMessage());
    return null;
  }
catch (  IOException e) {
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",e.getMessage());
    return null;
  }
catch (  NoSuchAlgorithmException e) {
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",e.getMessage());
    return null;
  }
catch (  InvalidKeyException e) {
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",e.getMessage());
    return null;
  }
catch (  Throwable t) {
    logger.error("String_Node_Str");
    logger.debug("String_Node_Str",t.getMessage());
    return null;
  }
}