Skip to content

Commit 13d08c1

Browse files
authored
Merge pull request CompassSecurity#76 from CompassSecurity/thort/certificatetree
Thort/certificatetree
2 parents fcec0fc + 9361a96 commit 13d08c1

File tree

4 files changed

+33
-32
lines changed

4 files changed

+33
-32
lines changed

BappManifest.bmf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ Uuid: c61cfa893bb14db4b01775554f7b802e
22
ExtensionType: 1
33
Name: SAML Raider
44
RepoName: saml-raider
5-
ScreenVersion: 2.0.1
6-
SerialVersion: 15
5+
ScreenVersion: 2.0.2
6+
SerialVersion: 16
77
MinPlatformVersion: 0
88
ProOnly: False
99
Author: Roland Bischofberger / Emanuel Duss / Tobias Hort-Giess
1010
ShortDescription: Provides a SAML message editor and a certificate management tool to help with testing SAML infrastructures.
11-
EntryPoint: build/libs/saml-raider-2.0.1.jar
11+
EntryPoint: build/libs/saml-raider-2.0.2.jar
1212
BuildCommand: ./gradlew jar
1313
SupportedProducts: Pro, Community

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Don't forget to rate our extension with as many stars you like :smile:.
7979
### Manual Installation
8080

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

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id "java-library"
33
}
44

5-
version = "2.0.1"
5+
version = "2.0.2"
66

77
repositories {
88
mavenCentral()

src/main/java/gui/CertificateTab.java

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
package gui;
22

3-
import burp.BurpExtender;
4-
import javax.swing.tree.TreeSelectionModel;
5-
import model.BurpCertificateBuilder;
63
import application.CertificateTabController;
74
import model.BurpCertificate;
5+
import model.BurpCertificateBuilder;
86
import model.ObjectIdentifier;
97
import net.miginfocom.swing.MigLayout;
108

119
import javax.swing.*;
12-
import javax.swing.event.TreeSelectionEvent;
13-
import javax.swing.event.TreeSelectionListener;
1410
import javax.swing.tree.DefaultMutableTreeNode;
1511
import javax.swing.tree.DefaultTreeModel;
12+
import javax.swing.tree.TreeSelectionModel;
1613
import java.awt.*;
1714
import java.awt.event.ActionEvent;
1815
import java.awt.event.ActionListener;
@@ -150,16 +147,34 @@ public void actionPerformed(ActionEvent e) {
150147
certificateTreeModel = new DefaultTreeModel(new DefaultMutableTreeNode("root"));
151148
certificateTree = new JTree(certificateTreeModel);
152149
certificateTree.setRootVisible(false);
150+
certificateTree.setShowsRootHandles(true);
151+
certificateTree.setCellRenderer((tree, value, selected, expanded, leaf, row, hasFocus) -> {
152+
var label = new JLabel();
153+
label.setText(value.toString());
154+
if (leaf) {
155+
label.setIcon(UIManager.getIcon("Tree.leafIcon"));
156+
} else if (expanded) {
157+
label.setIcon(UIManager.getIcon("Tree.openIcon"));
158+
} else {
159+
label.setIcon(UIManager.getIcon("Tree.closedIcon"));
160+
}
161+
if (selected) {
162+
label.setForeground(UIManager.getColor("Tree.selectionForeground"));
163+
label.setBackground(UIManager.getColor("Tree.selectionBackground"));
164+
} else {
165+
label.setForeground(UIManager.getColor("Tree.textForeground"));
166+
label.setBackground(UIManager.getColor("Tree.textBackground"));
167+
}
168+
return label;
169+
});
153170
certificateTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
154-
certificateTree.addTreeSelectionListener(new TreeSelectionListener() {
155-
public void valueChanged(TreeSelectionEvent e) {
156-
DefaultMutableTreeNode node = (DefaultMutableTreeNode) certificateTree.getLastSelectedPathComponent();
157-
if (node == null || node.getUserObject() instanceof String) {
158-
return;
159-
}
160-
BurpCertificate burpCertificate = (BurpCertificate) node.getUserObject();
161-
certificateTabController.setCertificateDetails(burpCertificate);
171+
certificateTree.addTreeSelectionListener(event -> {
172+
DefaultMutableTreeNode node = (DefaultMutableTreeNode) certificateTree.getLastSelectedPathComponent();
173+
if (node == null || node.getUserObject() instanceof String) {
174+
return;
162175
}
176+
BurpCertificate burpCertificate = (BurpCertificate) node.getUserObject();
177+
certificateTabController.setCertificateDetails(burpCertificate);
163178
});
164179

165180
txtStatus = new JTextPane();
@@ -500,19 +515,6 @@ public void actionPerformed(ActionEvent e) {
500515
this.setLayout(new MigLayout());
501516
this.add(topPanel, "wrap");
502517
this.add(scrollableBottomPanel, "width 100%");
503-
504-
// In the default look and feel the JTree component does not render correctly.
505-
// Icons are missing and tree notes are not correctly indented.
506-
// This workaround should changes the look and feel of the JTree only.
507-
// https://forum.portswigger.net/thread/jtree-not-rendering-correctly-with-burpsuite-s-look-and-feel-2a164857?CategoryId=bug-reports
508-
try {
509-
var lookAndFeel = UIManager.getLookAndFeel();
510-
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
511-
SwingUtilities.updateComponentTreeUI(certificateTree);
512-
UIManager.setLookAndFeel(lookAndFeel);
513-
} catch (Exception exc) {
514-
BurpExtender.api.logging().logToError(exc);
515-
}
516518
}
517519

518520
public void setCertificateTabController(CertificateTabController certificateTabController) {
@@ -763,7 +765,6 @@ public boolean isAutoSubjectKeyIdentifier() {
763765

764766
public void setCertificateRootNode(DefaultMutableTreeNode rootNode) {
765767
this.certificateTreeModel.setRoot(rootNode);
766-
certificateTree.setModel(certificateTreeModel);
767768
}
768769

769770
public void setAllExtensions(List<String> allExtensions) {

0 commit comments

Comments
 (0)