Skip to content

Commit 3a6bb8e

Browse files
committed
browser: Added SNMPv3 AES encryption (issue #24)
1 parent 4b44898 commit 3a6bb8e

4 files changed

Lines changed: 26 additions & 9 deletions

File tree

src/doc/release/version.xml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99

1010
<list>
1111
<item>
12-
<title>Fixed NPE if imported MIB not found</title>
13-
<text>The <code>MibImport</code> class unfortunately threw a
14-
<code>NullPointerException</code> when an imported MIB wasn't found.
15-
Thanks to Yonghao Yu for fixing and reporting this.
16-
<ref issue="23" /></text>
12+
<title>Added AES encryption to MibbleBrowser</title>
13+
<text>The MibbleBrowser application now supports AES encryption of
14+
messages. Thanks to Richard Thompson for suggesting this.
15+
<ref issue="24" /></text>
1716
</item>
1817

1918
<item>
@@ -22,6 +21,14 @@
2221
6.1 to enable AES privacy. This library is only used by the example
2322
MibbleBrowser application and isn't required for MIB parsing.</text>
2423
</item>
24+
25+
<item>
26+
<title>Fixed NPE when imported MIB not found</title>
27+
<text>The <code>MibImport</code> class unfortunately threw a
28+
<code>NullPointerException</code> when an imported MIB wasn't found.
29+
Thanks to Yonghao Yu for fixing and reporting this.
30+
<ref issue="23" /></text>
31+
</item>
2532
</list>
2633

2734

src/java/net/percederberg/mibble/browser/SnmpManager.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ public static SnmpManager createSNMPv3(String host,
164164
}
165165
if (auth != null && privacy != null) {
166166
type = privacy.getType();
167-
if (!type.equals(SnmpPrivacy.CBC_DES_TYPE)) {
167+
if (type.equals(SnmpPrivacy.DES_TYPE)) {
168+
pool.setPrivacyProtocol(SnmpContextv3Face.DES_ENCRYPT);
169+
} else if (type.equals(SnmpPrivacy.AES_TYPE)) {
170+
pool.setPrivacyProtocol(SnmpContextv3Face.AES_ENCRYPT);
171+
} else {
168172
throw new SnmpException("Unsupported privacy " +
169173
"protocol: " + type);
170174
}

src/java/net/percederberg/mibble/browser/SnmpPanel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ private void initialize() {
273273
authTypeCombo.addItem(SnmpAuthentication.MD5_TYPE);
274274
authTypeCombo.addItem(SnmpAuthentication.SHA1_TYPE);
275275
privacyTypeCombo.addItem("None");
276-
privacyTypeCombo.addItem(SnmpPrivacy.CBC_DES_TYPE);
276+
privacyTypeCombo.addItem(SnmpPrivacy.DES_TYPE);
277+
privacyTypeCombo.addItem(SnmpPrivacy.AES_TYPE);
277278

278279
// Associate labels
279280
hostLabel.setLabelFor(hostField);

src/java/net/percederberg/mibble/browser/SnmpPrivacy.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@
1818
public class SnmpPrivacy {
1919

2020
/**
21-
* The CBC-DES privacy type.
21+
* The DES privacy type.
2222
*/
23-
public static final String CBC_DES_TYPE = "CBC-DES";
23+
public static final String DES_TYPE = "3-DES (CBC-DES)";
24+
25+
/**
26+
* The AES privacy type.
27+
*/
28+
public static final String AES_TYPE = "AES (CFB128-AES-128)";
2429

2530
/**
2631
* The privacy type.

0 commit comments

Comments
 (0)