Changeset 2f7eb56 for apps/ministreaming


Ignore:
Timestamp:
Feb 17, 2014 1:29:41 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
6e0ca92
Parents:
45997fd (diff), 8c98ef73 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

propagate from branch 'i2p.i2p.zzz.ecdsa' (head e83bcdc842f5995d310a4295147f9326a993e010)

to branch 'i2p.i2p' (head 4983f716f8740bc7ddfae5561a562a0d42a815ae)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java

    r45997fd r2f7eb56  
    1515import net.i2p.client.I2PSession;
    1616import net.i2p.client.I2PSessionException;
     17import net.i2p.crypto.SigType;
    1718import net.i2p.util.Log;
    1819
     
    2728    public static final String PROP_MANAGER = "i2p.streaming.manager";
    2829    public static final String DEFAULT_MANAGER = "net.i2p.client.streaming.impl.I2PSocketManagerFull";
    29    
     30
    3031    /**
    3132     * Create a socket manager using a brand new destination connected to the
     
    8081    public static I2PSocketManager createManager(String i2cpHost, int i2cpPort, Properties opts) {
    8182        I2PClient client = I2PClientFactory.createClient();
    82         ByteArrayOutputStream keyStream = new ByteArrayOutputStream(512);
     83        ByteArrayOutputStream keyStream = new ByteArrayOutputStream(1024);
    8384        try {
    84             client.createDestination(keyStream);
     85            client.createDestination(keyStream, getSigType(opts));
    8586            ByteArrayInputStream in = new ByteArrayInputStream(keyStream.toByteArray());
    8687            return createManager(in, i2cpHost, i2cpPort, opts);
     
    169170        if (myPrivateKeyStream == null) {
    170171            I2PClient client = I2PClientFactory.createClient();
    171             ByteArrayOutputStream keyStream = new ByteArrayOutputStream(512);
     172            ByteArrayOutputStream keyStream = new ByteArrayOutputStream(1024);
    172173            try {
    173                 client.createDestination(keyStream);
     174                client.createDestination(keyStream, getSigType(opts));
    174175            } catch (Exception e) {
    175176                throw new I2PSessionException("Error creating keys", e);
     
    258259    }
    259260
     261    /**
     262     *  @param opts may be null
     263     *  @since 0.9.12
     264     */
     265    private static SigType getSigType(Properties opts) {
     266        if (opts != null) {
     267            String st = opts.getProperty(I2PClient.PROP_SIGTYPE);
     268            if (st != null) {
     269                SigType rv = SigType.parseSigType(st);
     270                if (rv != null)
     271                    return rv;
     272                getLog().error("Unsupported sig type " + st);
     273            }
     274        }
     275        return I2PClient.DEFAULT_SIGTYPE;
     276    }
     277
    260278    /** @since 0.9.7 */
    261279    private static Log getLog() {
Note: See TracChangeset for help on using the changeset viewer.