Changeset 5064199


Ignore:
Timestamp:
Aug 7, 2014 7:27:53 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
381f4947
Parents:
35bb8c5
Message:

Plugins: SU3 support in form, type checking,
don't require DSA key in SU3

Location:
apps/routerconsole/java/src/net/i2p/router
Files:
4 edited

Legend:

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

    r35bb8c5 r5064199  
    4444        Properties props = PluginStarter.pluginProperties(_context, appName);
    4545        String oldVersion = props.getProperty("version");
    46         String xpi2pURL = props.getProperty("updateURL");
     46        String xpi2pURL = props.getProperty("updateURL.su3");
     47        if (xpi2pURL == null)
     48            xpi2pURL = props.getProperty("updateURL");
    4749        List<URI> updateSources = null;
    4850        if (xpi2pURL != null) {
  • apps/routerconsole/java/src/net/i2p/router/update/PluginUpdateRunner.java

    r35bb8c5 r5064199  
    255255            try {
    256256                su3.verifyAndMigrate(to);
     257                if (su3.getFileType() != SU3File.TYPE_ZIP)
     258                    throw new IOException("bad file type");
     259                if (su3.getContentType() != SU3File.CONTENT_PLUGIN)
     260                    throw new IOException("bad content type");
    257261                sudVersion = su3.getVersionString();
    258262                signingKeyName = su3.getSignerString();
     
    266270            if (props == null)
    267271                return;
    268             String pubkey = props.getProperty("key");
    269272            String signer = props.getProperty("signer");
    270             if (pubkey == null || signer == null || pubkey.length() != 172 || signer.length() <= 0) {
     273            if (signer == null || signer.length() <= 0) {
    271274                f.delete();
    272275                to.delete();
     
    285288                return;
    286289            }
    287             processFinal(to, appDir, url, props, sudVersion, pubkey, signer);
     290            processFinal(to, appDir, url, props, sudVersion, null, signer);
    288291        }
    289292
     
    318321
    319322        /**
     323         *  @param pubkey null OK for su3
    320324         *  @since 0.9.15
    321325         */
     
    378382                String oldKeyName = oldProps.getProperty("signer");
    379383                String oldAppName = oldProps.getProperty("name");
    380                 if ((!pubkey.equals(oldPubkey)) || (!signer.equals(oldKeyName)) || (!appName.equals(oldAppName))) {
     384                if ((pubkey != null && !pubkey.equals(oldPubkey)) || (!signer.equals(oldKeyName)) || (!appName.equals(oldAppName))) {
    381385                    to.delete();
    382386                    statusDone("<b>" + _("Signature of downloaded plugin does not match installed plugin") + "</b>");
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java

    r35bb8c5 r5064199  
    345345    private void updatePlugin(String app) {
    346346        Properties props = PluginStarter.pluginProperties(_context, app);
    347         String url = props.getProperty("updateURL");
     347        String url = props.getProperty("updateURL.su3");
     348        if (url == null)
     349            url = props.getProperty("updateURL");
    348350        if (url == null) {
    349351            addFormError(_("No update URL specified for {0}",app));
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java

    r35bb8c5 r5064199  
    233233                        .append("<a href=\"").append(s).append("\">").append(_("Website")).append("</a><td>&nbsp;");
    234234                }
    235                 String updateURL = stripHTML(appProps, "updateURL");
     235                String updateURL = stripHTML(appProps, "updateURL.su3");
     236                if (updateURL == null)
     237                    updateURL = stripHTML(appProps, "updateURL");
    236238                if (updateURL != null) {
    237239                    desc.append("<tr><td>")
Note: See TracChangeset for help on using the changeset viewer.