Skip to content

Commit 6b43403

Browse files
Merge pull request #7 from CompassSecurity/master
Release v2.0.2
2 parents 82edf6f + 13d08c1 commit 6b43403

File tree

8 files changed

+39
-39
lines changed

8 files changed

+39
-39
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.0
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.0.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.0.jar](https://github.com/SAMLRaider/SAMLRaider/releases/download/v2.0.0/saml-raider-2.0.0.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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id "java-library"
33
}
44

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

77
repositories {
88
mavenCentral()
@@ -46,4 +46,4 @@ jar {
4646

4747
test {
4848
useJUnitPlatform()
49-
}
49+
}

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
com-google-guava = "33.2.1-jre"
33
com-miglayout = "3.7.4"
44
com-sun-xml-security-xml-security-impl = "1.0"
5-
net-portswigger-burp-extensions-montoya-api = "2023.12.1"
5+
net-portswigger-burp-extensions-montoya-api = "2024.7"
66
org-apache-santuario-xmlsec = "2.1.7"
77
org-bouncycastle-bcpkix-jdk15on = "1.52"
88
org-junit-jupiter = "5.10.2"

src/main/java/application/SamlTabController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,13 @@ public void setRequestResponse(HttpRequestResponse requestResponse) {
277277
}
278278

279279
private void setInformationDisplay() {
280+
samlGUI.getTextEditorInformation().setContents(ByteArray.byteArray(""));
280281
SamlPanelInfo infoPanel = samlGUI.getInfoPanel();
281282
infoPanel.clearAll();
282283

283284
try {
284285
Document document = xmlHelpers.getXMLDocumentOfSAMLMessage(samlMessage);
286+
textEditorInformation.setContents(ByteArray.byteArray(xmlHelpers.getStringOfDocument(xmlHelpers.getXMLDocumentOfSAMLMessage(samlMessage), 2, true).getBytes()));
285287
NodeList assertions = xmlHelpers.getAssertions(document);
286288
if (assertions.getLength() > 0) {
287289
Node assertion = assertions.item(0);
@@ -292,7 +294,6 @@ private void setInformationDisplay() {
292294
infoPanel.setSubjectConfNotAfter(xmlHelpers.getSubjectConfNotAfter(assertion));
293295
infoPanel.setSignatureAlgorithm(xmlHelpers.getSignatureAlgorithm(assertion));
294296
infoPanel.setDigestAlgorithm(xmlHelpers.getDigestAlgorithm(assertion));
295-
textEditorInformation.setContents(ByteArray.byteArray(xmlHelpers.getStringOfDocument(xmlHelpers.getXMLDocumentOfSAMLMessage(samlMessage), 2, true).getBytes()));
296297
} else {
297298
assertions = xmlHelpers.getEncryptedAssertions(document);
298299
Node assertion = assertions.item(0);

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) {

src/main/java/gui/SamlMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ private void initializeUI() {
4444
panelActionBottom.setLayout(new BorderLayout(0, 0));
4545
textEditorAction = BurpExtender.api.userInterface().createRawEditor();
4646
textEditorAction.setContents(ByteArray.byteArray("<SAMLRaiderFailureInInitialization></SAMLRaiderFailureInInitialization>"));
47+
textEditorAction.setEditable(false);
4748
panelActionBottom.add(textEditorAction.uiComponent(), BorderLayout.CENTER);
4849

4950
JSplitPane splitPaneInformation = new JSplitPane();
@@ -62,7 +63,6 @@ private void initializeUI() {
6263
panelInformationBottom.setLayout(new BorderLayout(0, 0));
6364
textEditorInformation = BurpExtender.api.userInterface().createRawEditor();
6465
textEditorInformation.setContents(ByteArray.byteArray(""));
65-
textEditorAction.setEditable(false);
6666
panelInformationBottom.add(textEditorInformation.uiComponent(), BorderLayout.CENTER);
6767

6868
JTabbedPane tabbedPane = new JTabbedPane();

src/test/java/application/ImportReadExportCertificateTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,10 @@ public void signatureValueIsCorrect() throws IOException, ParseException, Certif
196196
@Test
197197
public void exportedCertificateHashIsCorrect(@TempDir Path tempDir) throws IOException, KeyStoreException, NoSuchAlgorithmException, CertificateException {
198198
String outputFile = tempDir.resolve("exported.pem").toString();
199-
199+
this.certificateTabController.exportCertificate(this.certificate, outputFile);
200200
String outputExpected = "-----BEGIN CERTIFICATE-----MIIGJjCCBQ6gAwIBAgIUTWsBgOGCuRA3PeIxfJJ1lHAuiTUwDQYJKoZIhvcNAQEFBQAwazELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHzAdBgNVBAsTFnd3dy5xdW92YWRpc2dsb2JhbC5jb20xIDAeBgNVBAMTF1F1b1ZhZGlzIEdsb2JhbCBTU0wgSUNBMB4XDTEyMDgxNTEwNTY0OVoXDTE1MDgxNTEwNTY0OVowgYExCzAJBgNVBAYTAkNIMRMwEQYDVQQIEwpTdC4gR2FsbGVuMRMwEQYDVQQHEwpSYXBwZXJzd2lsMR4wHAYDVQQKExVIb2Noc2NodWxlIFJhcHBlcnN3aWwxEzARBgNVBAsTCklULVN5c3RlbXMxEzARB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YWwuY29tL3JlcG9zaXRvcnkwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBQyTaFP6vCumbbumwcshAgRUIvifjA7BgNVHR8ENDAyMDCgLqAshipodHRwOi8vY3JsLnF1b3ZhZGlzZ2xvYmFsLmNvbS9xdnNzbGljYS5jcmwwHQYDVR0OBBYEFHjRxyuQCYIPx1gmApOod9ESOMCrMA0GCSqGSIb3DQEBBQUAA4IBAQB07i+XiQxFzCH8BCy7Ri2bR9bnZ4LWXfHScAoxip8s0r396J2DuGSxC1umprjDFOJALDq5cAh/C7h3/EiNGH0xyRk+tHsTv6zRsPuajR1H4oSGTpsQ2tRXUPU22QP+sbdEdV/Wc66j6o0k4vTJltp4Rhk7ger0xZZKPsRYbOag3cO12H8xFGBVvtsqpSb0dQsApDGEo4tldwEb3DDoZb9Xb4fIMFrYKbOGuL0UG3Nb3urnNDeM6199F1n/tiEcXtzMiQR0fJ32IvGtCMthyfH5Qhz1lLTv1B3vHsb1ggI1ggh//jNgmZOLVsx1hw2KEtlcIKZ9I03MsuwQiLHejIy+-----END CERTIFICATE-----";
201-
202201
byte[] outputData = Files.readAllBytes(Paths.get(outputFile));
203202
String outputString = CertificateHelper.byteArrayToString(outputData).replaceAll("\r", "").replace("\n", "");
204-
205203
assertEquals(outputExpected, outputString);
206204
}
207205

0 commit comments

Comments
 (0)