Coder Social home page Coder Social logo

jitsi-srtp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jitsi-srtp's Issues

No support for building native libraries on other platforms

Trying to piece together how to get jitsi server-side running on FreeBSD, and keep finding native pre-compiled binaries in various of the repositories - this being one of them. Is there a reason these things need native code? If yes, it would be preferable if the build process was at least platform-agnostic. The assumption that everything is Linux isn't entirely true :)

Creation of the Aes PKCS11 provider fails on JDK 11+

Submitted for consideration is a fix for Aes.SunPKCS11CipherFactory for JDK 11+.

    /**
     * Implements {@link CipherFactory} using Sun PKCS#11.
     *
     * @author Lyubomir Marinov
     */
    public static class SunPKCS11CipherFactory extends CipherFactory {
        /**
         * The {@link Provider} instance (to be) employed for an (optimized) AES
         * implementation.
         */
        private static Provider provider;

        /**
         * The indicator which determines whether {@link #provider} is to be
         * used. If {@code true}, an attempt will be made to initialize a {@link
         * Provider} instance. If the attempt fails, {@code false} will be
         * assigned in order to not repeatedly attempt the initialization which
         * is known to have failed.
         */
        private static boolean useProvider = true;

        /**
         * Gets the {@code java.security.Provider} instance (to be) employed
         * for an (optimized) AES implementation.
         *
         * @return the {@code java.security.Provider} instance (to be) employed
         * for an (optimized) AES implementation
         */
        public static Provider getProvider() throws Exception {
            Provider provider = SunPKCS11CipherFactory.provider;
            if (provider == null && useProvider) {
                try {
                    // The SunPKCS11 Config name should be unique in order
                    // to avoid repeated initialization exceptions.
                    String name = null;
                    Package pkg = Aes.class.getPackage();
                    if (pkg != null) {
                        name = pkg.getName();
                    }
                    if (name == null || name.length() == 0) {
                        name = "org.jitsi.srtp";
                    }
                    String config = "--name=" + name + "\\n" + "nssDbMode=noDb\\n" + "attributes=compatibility";
                    Provider prototype = Security.getProvider("SunPKCS11");
                    Class<?> sunPkcs11ProviderClass = Class.forName("sun.security.pkcs11.SunPKCS11");
                    Method configureMethod = sunPkcs11ProviderClass.getMethod("configure", String.class);                      
                    provider = (Provider) configureMethod.invoke(prototype, config);
                } finally {
                    if (provider == null) {
                        useProvider = false;
                    } else {
                        SunPKCS11CipherFactory.provider = provider;
                    }
                }
            }
            return provider;
        }

        /**
         * Initializes a new instance of this class.
         *
         * @throws Exception if anything goes wrong while initializing a new
         *                   instance
         */
        public SunPKCS11CipherFactory() throws Exception {
            super(getProvider());
            logger.info("Created SunPKCS11 provider");
        }

    }

Replace usage of deprecated finalize method

The method finalize on java.lang.Object has been deprecated in java 9.

It is used here in the codebase:
https://github.com/jitsi/jitsi-srtp/blob/master/src/main/java/org/jitsi/srtp/crypto/OpenSslHmac.java#L164-L184

We should think about replacing the method. Oracle recommends
https://docs.oracle.com/javase/9/docs/api/java/lang/ref/Cleaner.html
and
https://docs.oracle.com/javase/8/docs/api/java/lang/ref/PhantomReference.html
as a replacement.

Note that Cleaner is only available from java 9+, so I guess we can't use that as long as jitsi is supposed to work with java 8 but it would still be good to have a plan ๐Ÿ˜ƒ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.