Skip to content

Commit

Permalink
Merge pull request #76 from CompassSecurity/thort/certificatetree
Browse files Browse the repository at this point in the history
Thort/certificatetree
  • Loading branch information
emanuelduss authored Sep 13, 2024
2 parents fcec0fc + 9361a96 commit 13d08c1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 32 deletions.
6 changes: 3 additions & 3 deletions BappManifest.bmf
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ Uuid: c61cfa893bb14db4b01775554f7b802e
ExtensionType: 1
Name: SAML Raider
RepoName: saml-raider
ScreenVersion: 2.0.1
SerialVersion: 15
ScreenVersion: 2.0.2
SerialVersion: 16
MinPlatformVersion: 0
ProOnly: False
Author: Roland Bischofberger / Emanuel Duss / Tobias Hort-Giess
ShortDescription: Provides a SAML message editor and a certificate management tool to help with testing SAML infrastructures.
EntryPoint: build/libs/saml-raider-2.0.1.jar
EntryPoint: build/libs/saml-raider-2.0.2.jar
BuildCommand: ./gradlew jar
SupportedProducts: Pro, Community
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Don't forget to rate our extension with as many stars you like :smile:.
### Manual Installation

First, download the latest SAML Raider version:
[saml-raider-2.0.1.jar](https://github.com/SAMLRaider/SAMLRaider/releases/download/v2.0.1/saml-raider-2.0.1.jar).
[saml-raider-2.0.2.jar](https://github.com/SAMLRaider/SAMLRaider/releases/download/v2.0.2/saml-raider-2.0.2.jar).
Then, start Burp Suite and click in the `Extensions` tab on `Add`. Choose the
SAML Raider JAR file to install it and you are ready to go.

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id "java-library"
}

version = "2.0.1"
version = "2.0.2"

repositories {
mavenCentral()
Expand Down
55 changes: 28 additions & 27 deletions src/main/java/gui/CertificateTab.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
package gui;

import burp.BurpExtender;
import javax.swing.tree.TreeSelectionModel;
import model.BurpCertificateBuilder;
import application.CertificateTabController;
import model.BurpCertificate;
import model.BurpCertificateBuilder;
import model.ObjectIdentifier;
import net.miginfocom.swing.MigLayout;

import javax.swing.*;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeSelectionModel;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
Expand Down Expand Up @@ -150,16 +147,34 @@ public void actionPerformed(ActionEvent e) {
certificateTreeModel = new DefaultTreeModel(new DefaultMutableTreeNode("root"));
certificateTree = new JTree(certificateTreeModel);
certificateTree.setRootVisible(false);
certificateTree.setShowsRootHandles(true);
certificateTree.setCellRenderer((tree, value, selected, expanded, leaf, row, hasFocus) -> {
var label = new JLabel();
label.setText(value.toString());
if (leaf) {
label.setIcon(UIManager.getIcon("Tree.leafIcon"));
} else if (expanded) {
label.setIcon(UIManager.getIcon("Tree.openIcon"));
} else {
label.setIcon(UIManager.getIcon("Tree.closedIcon"));
}
if (selected) {
label.setForeground(UIManager.getColor("Tree.selectionForeground"));
label.setBackground(UIManager.getColor("Tree.selectionBackground"));
} else {
label.setForeground(UIManager.getColor("Tree.textForeground"));
label.setBackground(UIManager.getColor("Tree.textBackground"));
}
return label;
});
certificateTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
certificateTree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) certificateTree.getLastSelectedPathComponent();
if (node == null || node.getUserObject() instanceof String) {
return;
}
BurpCertificate burpCertificate = (BurpCertificate) node.getUserObject();
certificateTabController.setCertificateDetails(burpCertificate);
certificateTree.addTreeSelectionListener(event -> {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) certificateTree.getLastSelectedPathComponent();
if (node == null || node.getUserObject() instanceof String) {
return;
}
BurpCertificate burpCertificate = (BurpCertificate) node.getUserObject();
certificateTabController.setCertificateDetails(burpCertificate);
});

txtStatus = new JTextPane();
Expand Down Expand Up @@ -500,19 +515,6 @@ public void actionPerformed(ActionEvent e) {
this.setLayout(new MigLayout());
this.add(topPanel, "wrap");
this.add(scrollableBottomPanel, "width 100%");

// In the default look and feel the JTree component does not render correctly.
// Icons are missing and tree notes are not correctly indented.
// This workaround should changes the look and feel of the JTree only.
// https://forum.portswigger.net/thread/jtree-not-rendering-correctly-with-burpsuite-s-look-and-feel-2a164857?CategoryId=bug-reports
try {
var lookAndFeel = UIManager.getLookAndFeel();
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
SwingUtilities.updateComponentTreeUI(certificateTree);
UIManager.setLookAndFeel(lookAndFeel);
} catch (Exception exc) {
BurpExtender.api.logging().logToError(exc);
}
}

public void setCertificateTabController(CertificateTabController certificateTabController) {
Expand Down Expand Up @@ -763,7 +765,6 @@ public boolean isAutoSubjectKeyIdentifier() {

public void setCertificateRootNode(DefaultMutableTreeNode rootNode) {
this.certificateTreeModel.setRoot(rootNode);
certificateTree.setModel(certificateTreeModel);
}

public void setAllExtensions(List<String> allExtensions) {
Expand Down

0 comments on commit 13d08c1

Please sign in to comment.