Changeset 144147d for core


Ignore:
Timestamp:
Mar 15, 2018 3:58:40 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e139710
Parents:
cfd84bd
Message:

Certs: Sort alt names in generated certs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/crypto/SelfSignedGenerator.java

    rcfd84bd r144147d  
    2424import java.util.Set;
    2525import java.util.TimeZone;
     26import java.util.TreeSet;
    2627
    2728import javax.crypto.interfaces.DHPublicKey;
     
    618619
    619620        int wrap41len = 0;
    620         if (altNames == null)
    621             altNames = new HashSet<String>(4);
    622         else
     621        // SEQUENCE doesn't have to be sorted, but let's do it for consistency,
     622        // so it's platform-independent and the same after renewal
     623        if (altNames == null) {
     624            altNames = new TreeSet<String>();
     625        } else {
     626            altNames = new TreeSet<String>(altNames);
    623627            altNames.remove("0:0:0:0:0:0:0:1");  // We don't want dup of "::1"
     628        }
    624629        altNames.add(cname);
    625630        final boolean isCA = !cname.contains("@") && !cname.endsWith(".family.i2p.net");
Note: See TracChangeset for help on using the changeset viewer.