Changeset d885e00


Ignore:
Timestamp:
Apr 28, 2016 10:17:27 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
fbeca5e
Parents:
52c9bf6
Message:

News: Verify received CRL before saving

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/update/NewsFetcher.java

    r52c9bf6 rd885e00  
    11package net.i2p.router.update;
    22
     3import java.io.ByteArrayInputStream;
    34import java.io.BufferedWriter;
    45import java.io.File;
     
    1112import java.net.URI;
    1213import java.net.URISyntaxException;
     14import java.security.GeneralSecurityException;
    1315import java.text.DateFormat;
    1416import java.util.ArrayList;
     
    2224
    2325import net.i2p.app.ClientAppManager;
     26import net.i2p.crypto.CertUtil;
    2427import net.i2p.crypto.SU3File;
    2528import net.i2p.crypto.TrustedUpdate;
     
    586589            OutputStream out = null;
    587590            try {
     591                byte[] data = DataHelper.getUTF8(e.data);
     592                // test for validity
     593                CertUtil.loadCRL(new ByteArrayInputStream(data));
    588594                out = new SecureFileOutputStream(f);
    589                 out.write(DataHelper.getUTF8(e.data));
     595                out.write(data);
     596            } catch (GeneralSecurityException gse) {
     597                _log.error("Bad CRL", gse);
    590598            } catch (IOException ioe) {
    591599                _log.error("Failed to write CRL", ioe);
  • core/java/src/net/i2p/crypto/CertUtil.java

    r52c9bf6 rd885e00  
    516516     *
    517517     *  @return non-null
    518      *  @since 0.9.25
    519      */
    520     private static X509CRL loadCRL(InputStream in) throws GeneralSecurityException {
     518     *  @since 0.9.25 public since 0.9.26
     519     */
     520    public static X509CRL loadCRL(InputStream in) throws GeneralSecurityException {
    521521        CertificateFactory cf = CertificateFactory.getInstance("X.509");
    522522        return (X509CRL) cf.generateCRL(in);
  • history.txt

    r52c9bf6 rd885e00  
     12016-04-28 zzz
     2 * News: Parse and store CRLs in news feed
     3
    142016-04-28 zzz
    25Prop from i2p.i2p.zzz.gmp6-prop:
  • router/java/src/net/i2p/router/RouterVersion.java

    r52c9bf6 rd885e00  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 6;
     21    public final static long BUILD = 7;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.