Changeset 9badfd0 for core/java


Ignore:
Timestamp:
Nov 25, 2018 3:17:27 PM (20 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b93be8b
Parents:
dc8a822
Message:

Utils: Catch ProviderException? in SelfSignedGenerator? (ticket #2344)

File:
1 edited

Legend:

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

    rdc8a822 r9badfd0  
    88import java.math.BigInteger;
    99import java.security.GeneralSecurityException;
     10import java.security.ProviderException;
    1011import java.security.MessageDigest;
    1112import java.security.PrivateKey;
     
    143144        PublicKey jpub = SigUtil.toJavaKey(pub);
    144145        PrivateKey jpriv = SigUtil.toJavaKey(priv);
    145         return generate(jpub, jpriv, priv, type, cname, altNames, ou, o, l, st, c, validDays);
     146        try {
     147            return generate(jpub, jpriv, priv, type, cname, altNames, ou, o, l, st, c, validDays);
     148        } catch (ProviderException pe) {
     149            // PE is unchecked
     150            throw new GeneralSecurityException(pe);
     151        }
    146152    }
    147153
     
    185191        byte[] sigoid = getEncodedOIDSeq(oid);
    186192
     193        // ProviderException thrown here
    187194        byte[] tbs = genTBS(cname, altNames, ou, o, l, st, c, validDays, sigoid, jpub);
    188195        int tbslen = tbs.length;
     
    380387        byte[] subject = issuer;
    381388
     389        // ProviderException thrown here
    382390        byte[] pubbytes = jpub.getEncoded();
    383391        byte[] extbytes = getExtensions(pubbytes, cname, altNames);
Note: See TracChangeset for help on using the changeset viewer.