Changeset d6a53cc for apps


Ignore:
Timestamp:
Mar 9, 2019 11:47:03 AM (15 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
5d389c8
Parents:
409207e0
Message:

Data: Consolidate offline key check
i2ptunnel: Prevent registration auth if key offline

Location:
apps
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/jsp/register.jsp

    r409207e0 rd6a53cc  
    128128           if (spk == null) {
    129129               %><tr><td class="infohelp"><%=intl._t("Destination signing key is not available. Start the tunnel.")%></td></tr><%
     130           } else if (spk.isOffline()) {
     131               %><tr><td class="infohelp"><%=intl._t("Destination signing key is offline. Use CLI tools on the offline machine.")%></td></tr><%
    130132           } else {
    131133               valid = true;
  • apps/sam/java/src/net/i2p/sam/SAMUtils.java

    r409207e0 rd6a53cc  
    118118            SigningPrivateKey spk = new SigningPrivateKey(dtype);
    119119            spk.readBytes(destKeyStream);
    120             if (isOffline(spk)) {
     120            if (spk.isOffline()) {
    121121                // offlineExpiration
    122122                DataHelper.readLong(destKeyStream, 4);
     
    140140        return destKeyStream.available() == 0;
    141141    }
    142 
    143     /**
    144      *  @since 0.9.39
    145      */
    146     private static boolean isOffline(SigningPrivateKey spk) {
    147         byte[] data = spk.getData();
    148         for (int i = 0; i < data.length; i++) {
    149             if (data[i] != 0)
    150                 return false;
    151         }
    152         return true;
    153     }
    154 
    155142
    156143    /**
Note: See TracChangeset for help on using the changeset viewer.