Skip to content

Commit 1bee664

Browse files
committed
Fix list of OIDs for AuthEnveloped
- see #2218
1 parent e9087af commit 1bee664

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

mail/src/main/java/org/bouncycastle/mail/smime/SMIMEEnvelopedUtil.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.bouncycastle.mail.smime;
22

33
import java.util.HashSet;
4-
import java.util.Set;
54

65
import javax.mail.MessagingException;
76
import javax.mail.internet.MimeBodyPart;
@@ -13,13 +12,13 @@
1312

1413
public class SMIMEEnvelopedUtil
1514
{
16-
private static Set<ASN1ObjectIdentifier> authOIDs = new HashSet<ASN1ObjectIdentifier>();
15+
private static final HashSet<ASN1ObjectIdentifier> AUTH_OIDS = new HashSet<ASN1ObjectIdentifier>();
1716

1817
static
1918
{
20-
authOIDs.add(NISTObjectIdentifiers.id_aes128_GCM);
21-
authOIDs.add(NISTObjectIdentifiers.id_aes128_GCM);
22-
authOIDs.add(NISTObjectIdentifiers.id_aes128_GCM);
19+
AUTH_OIDS.add(NISTObjectIdentifiers.id_aes128_GCM);
20+
AUTH_OIDS.add(NISTObjectIdentifiers.id_aes192_GCM);
21+
AUTH_OIDS.add(NISTObjectIdentifiers.id_aes256_GCM);
2322
}
2423

2524
/**
@@ -32,7 +31,7 @@ public class SMIMEEnvelopedUtil
3231
*/
3332
public static RecipientInformationStore getRecipientInfos(MimeBodyPart message) throws MessagingException, CMSException
3433
{
35-
if(message.getContentType().equals(SMIMEAuthEnvelopedGenerator.AUTH_ENVELOPED_DATA_CONTENT_TYPE))
34+
if (message.getContentType().equals(SMIMEAuthEnvelopedGenerator.AUTH_ENVELOPED_DATA_CONTENT_TYPE))
3635
{
3736
return new SMIMEAuthEnveloped(message).getRecipientInfos();
3837
}
@@ -48,7 +47,7 @@ public static RecipientInformationStore getRecipientInfos(MimeBodyPart message)
4847
*/
4948
public static SMIMEEnvelopedGenerator createGenerator(ASN1ObjectIdentifier algorithm)
5049
{
51-
if (authOIDs.contains(algorithm))
50+
if (AUTH_OIDS.contains(algorithm))
5251
{
5352
return new SMIMEAuthEnvelopedGenerator();
5453
}

0 commit comments

Comments
 (0)