Code Monkey home page Code Monkey logo

msl's Introduction

Build Status

Message Security Layer

MSL Logo

Message Security Layer (MSL) is an extensible and flexible secure messaging framework that can be used to transport data between two or more communicating entities. Data may also be associated with specific users, and treated as confidential or non-replayable if so desired.

Documentation

The MSL Framework provides a complete description of the framework and its implementation requirements. The Configuration Guide presents some common client and server MSL configurations. The framework documentation and configuration guide were reviewed by an external security firm. No issues were identified.

The set of public interfaces and classes an application must implement and use is documented in the Public Javadoc. Documentation on all of the code, including internal classes and private methods, can be found in the full Javadoc.

For questions and support please contact Wesley Miaw directly. Bugs and feature requests should be filed in the Issue Tracker.

Third-Party Libraries

The Java MSL code base requires the org.json and Bouncy Castle libraries. The unit tests require JUnit 4 and Hamcrest. The integration tests require TestNG.

The JavaScript MSL code base includes some third-party libraries within the lib/ directory, most notably the Clarinet parser and jsrsasign.

The C++ MSL code base requires OpenSSL and includes some third-party libraries within the lib/ directory: Chromium Numerics, RapidJSON, RSA Converter, and UTF-8 with CPP in a Portable Way. The unit tests also include some third-party libraries within the tests lib/ directory: Google Mock and Google Test.

All third-party libraries are subject to their respective license agreements.

Getting Started

To build an application that uses MSL for communication, you must read through and understand the MSL Framework. This is necessary because unlike other security protocols and libraries, you must make choices about how to secure your communication and authenticate your entities and users. The Configuration Guide can help you make those decisions.

The application interface to the MSL stack is MslControl. The application configuration for a single MSL network is an instance of MslContext. Your application may participate in multiple MSL networks and therefore have multiple instances of MslContext but only one MslControl should be used. Message-specific configuration, such as the user or security properties of that message, are specified in individual instances of MessageContext.

Java

IntelliJ IDEA users should import the Java MSL code as a Gradle project.

Eclipse users should use the Gradle IDE (available in the Eclipse Marketplace) and Web Tools Platform (included with the Eclipse IDE for Java EE developers) to import the Java MSL code as a Gradle project.

An example server is provided under examples/simple/src/main/java/server/. The Eclipse Gradle plugin will import this project as a web project that can be deployed onto a Tomcat server. IntelliJ users must manually configure a run configuration to deploy the project artifact into /msl-example-server. The example server is a J2EE servlet that will respond to requests from the example JavaScript client. The example server MSL configuration is specific to this server and should not be used to configure your application, but it can be used as the basis for doing so.

Integration tests are provided under integ-tests/src/main/java/. These tests can be run using the integ-tests Gradle target test. The Eclipse Gradle plugin will import this project as a web project that can be deployed onto a Tomcat server. IntelliJ users must manually configure a run configuration to deploy the project artifact into /msl-test-server.

A command line client and server is provided under examples/mslcli/src/main/java/. The command line client can be configured to work with any MSL server. The command line server is an example MSL server that must be run from the command line. See examples/mslcli/readme.txt for more details.

You may need to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files to use cryptographic keys above a certain size.

JavaScript

The JavaScript MSL code base assumes a JavaScript execution environment that supports the latest Web Crypto API specification. If you are using a web browser you may need to enable experimental features or feature flags to enable Web Crypto.

  • Chrome Browser 37+
    For earlier versions: chrome://flags/#enable-experimental-web-platform-features
    On Linux libnss 3.16.2+ must be separately installed.
  • Edge
  • Firefox 34+
    For earlier versions: about:config dom.webcrypto.enabled
  • Internet Explorer 11+
  • Safari 8+

Your browser may not support all Web Crypto API algorithms, key sizes, and features. If you encounter a problem with a Web Crypto operation please check the release notes for your browser version to determine if it supports what you are trying to do.

To include the JavaScript MSL stack in your JavaScript application you must include all of the MSL JavaScript source files required by your MSL configuration. An example list of the required source files can be found in src/test/javascript/msltests.html.

An example client is provided under src/examples/simple/src/main/javascript/client/. The example client is a web page that will send requests to the example Java server. The example client MSL configuration is specific to this client and should not be used to configure your application, but it can be used as the basis for doing so.

C++

The C++ MSL code base requires C++11 and CMake.

The code base has been built and tested under the following environments:

  • Xcode 8 and Homebrew (gcc6, openssl) for Mac OS.
    Compiler flags: -std=c++0x -DGTEST_DONT_DEFINE_FAIL=1 -DRAPIDJSON_HAS_STDSTRING=1.
  • Xcode 8 for iOS.
    Compiler flags: -std=gnu++11 -DGTEST_DONT_DEFINE_FAIL=1 -DRAPIDJSON_HAS_STDSTRING=1.

LICENSE

Copyright 2014 Netflix, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

msl's People

Contributors

ajmorgan avatar aliddeke avatar dawsbot avatar dreynaud avatar hakanson avatar kevinswiber avatar padolph avatar ppissanetzky avatar rmeshenberg avatar rpalcolea avatar rspieldenner avatar semmypurewal avatar sukhmal avatar sunnysingh85 avatar wmiaw avatar yarrick avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msl's Issues

Auto cleanup MslControl state tied to external data

There are a few internal state objects in MslControl that are created and keyed off external data (e.g. MslContext, MasterToken). If the calling application destroys those objects, the internal state objects need to be destroyed too.

Greedily or atomically process service tokens in SimpleMslStore.addServiceTokens()

The current implementation of SimpleMslStore.addServiceTokens() will throw an exception the first time it encounters a service token that is master token- or user ID token-bound and it does not have a matching master token or user ID token.

It may instead be better to delay throwing the exception until all service tokens have been processed. Or to instead not add any service tokens until we are sure all of them can be added.

Investigate new key request data signaling mechanism

Best practice is to use new key request data after each successful key exchange occurs. Currently the only good indicator of this within the MSL stack is to have the MslStore implementation trigger creation of new key request data upon receipt of a new master token. But that is sort of a strange approach since the MslStore is not in charge of and not directly related to key request data or the key exchange operation.

Come up with some new way of better signaling that new key request data should be used for any future messages.

The MessageContext must remain the interface that answers whether or not key request data is included in a message to allow applications to explicitly exclude key request data from a message as desired, and for maximum flexibility also retain ownership for providing the actual key request data. Therefore the new signal must affect any existing MessageContext instances in addition to ones created after the signal is triggered.

MslControl.request() URL parameter cannot be subclassed

One of the MslControl.request() functions accepts a URL parameter. However Java has defined this class as final preventing implementers from overriding it, and thus the only way to provide a different implementation is by registering URL handlers which is inconvenient and relatively complicated.

This parameter could be replaced by a different URL interface similar to what was done in the JavaScript implementation.

Safe to remove TokenFactory.isNewestMasterToken()?

The TokenFactory.isNewestMasterToken() function was originally added to address the need to move a client onto the newest master token sequence number to support the creation of non-replayable messages when a client is currently on an older master token sequence number, when the non-replayable feature was based off the master token sequence number.

Since moving to the non-replayable ID, that functionality is no longer necessary. Instead, the only purpose this function serves today is to immediately force a master token renewal if we believe the client should be using a newer one. This results in an immediate check for a cloned entity.

Removal of this function would remove the immediate check for a cloned entity, pushing that check out until the master token renewal window is entered or the master token is expired. This is arguably bad. Alternatively provide more documentation around the purpose of this function (function Doxygen and/or Wiki).

Exceptions used to create ErrorHeader needs to be accessible

MslControl converts exceptions (via MessageBuilder.createErrorResponse) into a ErrorHeader and passes that to MessageDebugContext. Those exceptions have very valuable information for logging and diagnostics purposes. I would like the exception to be passed class that outside implementations control, like how MessageDebugContext is provided to MSL and can log headers. It could even be a new call on MessageDebugContext (which could be added a Java 8 default method on the interface), e.g. MessageDebugContext.exceptionFound(Exception). Or as a second parameter to sendHeader, but that's awkward if there is header is a MessageHeader. Maybe MessageDebugContext, should be refactored to have a sentMessageHeader(MessageHeader) and a sentErrorHeader(ErrorHeader, Throwable). This would make it easier for implementors too, since we wouldn't have to do an instance of on the Header and do the delegation ourself.

Add configurable crypto operation maximum data size

Allow MSL configurations to specify a maximum size for data processed by a crypto operation, to ensure compatibility with all participating entities. Perhaps this belongs in MessageCapabilities. Application data can be split across MSL payload chunks to satisfy this limit, but errors would need to be thrown for data in tokens and headers.

The default size should be set to 100KiB.

Support other key formats in JavaScript PrivateKey and PublicKey

PrivateKey currently only supports import of Base64-encoded or raw PKCS#8 private keys. PublicKey currently only supports import of Base64-encoded or raw SPKI public keys. They should also support other key formats, like JWK.

Once this is done, the logic in EccCryptoContextSuite.js can be fixed up to use those classes instead of calling Web Crypto functions directly, which is less manageable.

msl-cli: create more verbose mode to output the underlying transport data

With -v true, it prints something like:

{"headerdata":"X","signature":"Y","entityauthdata":{"scheme":"PSK","authdata":{"identity":"I"}}}{"headerdata":"X","signature":"Y","entityauthdata":{"scheme":"PSK","authdata":{"identity":"I"}}}{"payload":"P","signature":"S"}{"payload":"P","signature":"S"}
Error: Server returned HTTP response code: 400 for URL: http://xyz/uri

But the full HTTP request actually looks like this:

POST /scriptManager?hash=None&hasChronosSync=true&action=RUN&v=1.1&debug=true HTTP/1.1
User-Agent: Java/1.8.0_60
Host: 127.0.0.1:7001
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-type: application/x-www-form-urlencoded
Content-Length: 1458

{"headerdata":"X","signature":"Y","entityauthdata":{"scheme":"PSK","authdata":{"identity":"I"}}}{"payload":"P","signature":"S"}

Missing:

  • HTTP verb and version
  • HTTP headers for the request
  • HTTP headers for the response
  • HTTP payload of the response

Move Wiki to Markdown in the repository

By having the documentation in the repository directly, it can be updated/committed/submitted at the same the feature/change is made. Github allows editing files in the repository directly, which means we keep the ability to update the docs via the website, just like in the wiki.

It also opens the possibility to somehow syncing the docs with the code some day.

Explicitly support one-directional perfect forward secrecy (PFS)

Add explicit support for application-controlled one-directional perfect forward secrecy when it matters not if it the request data is protected using PFS but the response data needs to be protected using PFS. This may be useful when the request data is relatively useless but the response data does require protection.

One-directional support for PFS allows you to avoid a the extra network round trip needed to establish session keys negotiated using a PFS key exchange scheme.

Consider extending algorithms and cipher specs in MslConstants

Similar to how the authentication and keyx schemes can be extended by the MSL configuration layer, doing the same for the compression and crypto enums currently held in MslConstants will probably also be useful.

MslUtils would need to allow compression algorithms to be installed as well (maybe similar to Base64). Perhaps a compression class should be created explicitly to support compression implementations instead of continuing to mix it into MslUtils.

Use static and global environment setup/teardown in C++ unit tests

Google Test supports static and global environment setup/teardown which will allow expensive initialization like the MockMslContext and other constants to be initialized one during unit tests instead of on every single test like it is currently implemented. This should help speed up execution of and reduce resource consumption of the tests.

See https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md for more details.

Fix design of C++ Date type

C++ defines and uses the Date type differently than Java + JavaScript, such that the instance can never be null but must instead be queried for validity. This unfortunately does not match with the documentation or implementation of the MslControl .setRemoteTime() and .getRemoteTime() functions.

For safety, recast the Date type to be a shared_ptr and thus nullable and capable of matching the design and logic of the Java and JavaScript code. Ensure the documentation and implementation is fixed to match.

Currently, this is resulting in a bug when MslControl asks MslContext for the remote time and then passes it onto the token renewable/expired query functions.

The same approach of using concrete instances that must be queried for validity applies to some other types as well. Similar problems may also be lurking for those types.

MSL Token toString() may leak sensitive data

The toString() methods on master token, user ID token, and service token classes may leak sensitive data by including the otherwise encrypted data if the local entity was able to decrypt it. This data should not be included to avoid accidents where a token's string representation is included in a log message.

Base64Secure ArrayIndexOutOfBoundsException

Base64Secure could throw another exception when a character is not a base64 character, which would indicate that the input data is corrupt.

Caused by: java.lang.ArrayIndexOutOfBoundsException: 65533 at com.netflix.msl.util.Base64Secure.decode(Base64Secure.java:138) at com.netflix.msl.util.Base64.decode(Base64.java:103) at com.netflix.msl.tokens.MasterToken.<init>(MasterToken.java:307) at com.netflix.msl.msg.Header.parseHeader(Header.java:123) at com.netflix.msl.msg.MessageInputStream.<init>(MessageInputStream.java:221) at com.netflix.msl.msg.NetflixMessageInputStream.<init>(NetflixMessageInputStream.java:82) at com.netflix.msl.msg.NetflixMessageStreamFactory.createInputStream(NetflixMessageStreamFactory.java:94) at com.netflix.msl.msg.MslControl.receive(MslControl.java:1645) at com.netflix.msl.msg.MslControl.access$400(MslControl.java:188) at com.netflix.msl.msg.MslControl$ReceiveService.call(MslControl.java:2214) ... 62 more

Provide data to configuration singletons

There is a desire to provide some sort of non-global / constant data to the execution of what are otherwise singletons off MslContext: authentication factories, keyx factories, token factory, MSL store, etc.

Passing some sort of random Object throughout the entire MSL code base into every possible configuration implementation function seems both incredibly messy, wrong, and error prone in the same sense as globals. Additionally there's no guarantee the Object data would be thread-safe, neither of which is currently a requirement on the MslContext, MessageContext, and other interfaces. Sticking something on MessageContext would fundamentally change MessageContext which can currently be treated as a stateless data resource.

This request requires further thought before deciding it is a good idea and if so then how to best approach it.

Support additional message encodings

The current MSL specification and code specifies the use of JSON for encoding sections of MSL messages, and defines a MSL message as concatenations of JSON objects.

JSON is particularly heavyweight for communication due to its use of text for non-text values, and the need to Base64-encode any binary data which immediately increases data size by 33%.

Change the MSL code so the actual encoding portions can be abstracted out, and also add support for a binary encoding that is still as flexible, extensible, and backwards/forwards-compatible as JSON.

Create pure interfaces for injectable classes

Some of the injectable classes are currently defined as abstract or inheritable base classes. This is mostly to provide a fully functional implementation that can be extended or have methods overridden for customization purposes. However from a design standpoint it may be better to define them as pure interfaces with the current base class becoming a concrete example.

Base64.isValidBase64 cannot process chunked input

The regex use doesn't take into account newlines, as is common in certificates, e.g.

TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZW
xpdCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGluY2lkaWR1bnQgdXQgbGFib3JlIGV0IGRvb
G9yZSBtYWduYSBhbGlxdWEuIFV0IGVuaW0gYWQgbWluaW0gdmVuaWFtLCBxdWlzIG5
vc3RydWQgZXhlcmNpdGF0aW9uIHVsbGFtY28gbGFib3JpcyBuaXNpIHV0IGFsaXF1aXAg
ZXggZWEgY29tbW9kbyBjb25zZXF1YXQuIER1aXMgYXV0ZSBpcnVyZSBkb2xvciBpbiByZ
XByZWhlbmRlcml0IGluIHZvbHVwdGF0ZSB2ZWxpdCBlc3NlIGNpbGx1bSBkb2xvcmUgZX
UgZnVnaWF0IG51bGxhIHBhcmlhdHVyLiBFeGNlcHRldXIgc2ludCBvY2NhZWNhdCBjdXBp
ZGF0YXQgbm9uIHByb2lkZW50LCBzdW50IGluIGN1bHBhIHF1aSBvZmZpY2lhIGRlc2Vyd
W50IG1vbGxpdCBhbmltIGlkIGVzdCBsYWJvcnVtLg==

In the case of Jaxb, the underlying implementation can support newlines just fine. Instead of introducing an uncompiled Regex to ever call, just let the underlying implementation take care of validating. I think the isValidBase64 call should be removed from the decode method.

Replace insecure time-variable comparison with a secure time-constant one

The whole library is using insecure time-variable comparison to compare secrets. This makes it vulnerable to timing attacks.

Example

return Arrays.equals(hmac, envelope.getSignature());

Include a safe comparision function in your library and use it everywhere. An example of such function

public static boolean safeEquals(byte[] a, byte[] b) {
   if (a.length != b.length) {
      return false;
   }

   int result = 0;
   for (int i = 0; i < a.length; i++) {
      result |= a[i] ^ b[i]
   }
   return result == 0;
}

Credit to Coda Hale for the function

Create Remote Entity Connection Abstraction

MslControl currently accepts InputStream, OutputStream, or the MSL Url types for communication with the remote entity. Maybe this should be abstracted through some sort of remote entity connection interface, because it may be necessary to "close" and "open" connections for each MSL message or request/response pair.

This may be problematic for 3-message transactions, and due to expectation that a MslChannel is established and can be used for full-duplex communication. It may be that introducing this abstraction would be a bad idea because it breaks the expectation that an underlying protocol should be full-duplex and that overlay protocols like MSL should be agnostic. HTTP is the odd one out in that respect.

Some exceptions masked by second exception

When handling an exception, some functions may throw another exception. These second exceptions should be discarded in favor of the original exception. There appears to be a few locations where this behavior is not honored (e.g. RequestService.call() when catching IOException or RuntimeException and closing the streams).

Remove user ID token (if any) upon USERDATA_REAUTH in MslControl.cleanupContext()

Since USERDATA_REAUTH may be returned in some cases when a user ID token is being used (when the responder wishes to force a user to provide new user authentication data) the MslControl.cleanupContext() function should remove the user ID token associated with the user if one exists.

Double-check the Wiki documentation to make sure this change in behavior is documented.

MslControl.deleteMasterToken() may be called without already holding the read lock

There is a call chain in MslControl.java that may result in attempting to release a master token read lock when it has already been released. RequestService.execute() and RespondService.peerToPeerExecute() will call cleanupContext() upon receipt of error messages. This will in turn call deleteMasterToken() if the the error is ENTITY_REAUTH. However deleteMasterToken() assumes that if the master token lock exists, then the caller currently holds the read lock; this happens to be true if being called from cleanupCryptoContext().

Possible solutions:

  • Move the call to cleanupContext() inside of sendReceive(), before the master token lock is released. This would be consistent with the calls to cleanupCryptoContext(). There do not appear to be any potential side effects that would discourage using this solution.
  • Change cleanupContext() so when it tries to delete a master token it knows the read lock has already been released. This adds a little more complexity and duplicates part of an existing function so this solution doesn't look as good.

EccCryptoContext.js uses raw key handles

EccCryptoContext.js documentation states it accepts PrivateKey and PublicKey types, consistent with other ICryptoContext implementations. However the code is written to operate on raw key handles, and EccCryptoContextSuite.js passes in raw key handles.

For an example of the correct behavior, see the RsaCryptoContext.js ctor which pulls out the raw keys from the input parameters.

Consider support for BigInteger MSL message IDs

At very large scale, the 2^53 number space for MSL message IDs may be too small to sufficiently prevent replayed responses. Consider supporting BigInteger values of arbitrary length (although the implementation should specify a maximum size) or of specified but much larger bit size.

Add logging interface and log callbacks

Define a logging interface and add log callbacks to the core code to provide insight into MSL logic.

Some requirements:

  • Function entry/exit.
  • Decision making.
  • Error severities.
  • Logging areas.

SLF4J (Simple Logging Facade for Java) was suggested but requires inclusion of a specific library/JAR (slf4j-api.jar) which can cause problems. It may serve as a useful design example.

There is a performance concern with always calling the log functions, and building their arguments, even if the log message will be discarded. An outer if statement is one way to address this.

Support alternative master token crypto algorithms

The master token and session crypto context is currently hard-coded to assume AES/CBC/PKCS5Padding and HmacSHA256 algorithms. It should be possible to override these default choices in case different algorithms should be used.

MslControl.acquireRenewalLock() does not handle timeout on the blocking queue

MslControl.acquireRenewalLock() waits to receive a master token from the currently renewing request. However if the call to ctxRenewingQueue.poll() times out then the return value is null and the the operation must abort and time out. Currently the code continues assuming the master token was returned, and this will throw a null pointer exception.

Simple example deploys to incorrect location

When using Gradle with the Gretty plugin to deploy the example simple server, the application is deployed under /msl-example instead of under /msl-example-server as defined by the gradle.build variable war.baseName.

The example files are defined to point at /msl-example-server so this creates a problem when people run with the default settings.

Schemes should be able to add Service Tokens

If Key Exchange or Entity Auth learn something about an entity, they should be able to contribute entity bound service tokens.

User Auth Schemes should also be able to contribute user-bound tokens.

KeyX/EntityAuth being able to contribute User bound tokens, though not the other way, ie. User Auth Scheme shouldn't be able to provide Entity bound service tokens. This would also be for deficient implementations that only store user-bound tokens.

Add MasterToken-protected Entity Authentication Scheme

Many of the current entity authentication schemes require an entity identification value to be passed in the clear, as this is the only way for a receiver to identify the cryptographic keys or algorithms necessary for performing authentication. However this is a privacy concern.

Add support master token-based wrapping of entity authentication schemes. This would allow an initial key exchange and issuance of ephemeral session keys to occur without any strong entity identity (i.e. a randomly generated identity) to be used to protect the actual entity authentication data.

Recipient value may leak entity identities

The Master Token Protected entity authentication scheme was created to allow an entity to establish temporary session keys to secure the delivery of the real entity authentication data.

However, the recipient field will leak the remote entity's identity when creating a response and encryption is not available.

The recipient field was not originally specified. They were proposed as a way to prevent messages generated by one trusted services server from being replayed against another trusted services server, under the thinking that communication should only occur between the client and servers in a trusted services network, and never between servers themselves. At the time I argued against this change because I didn't think that would matter, as from the MSL perspective nothing bad could happen (server messages will not contain key request data, and never use the explicit non-replayable feature and instead relying on the message ID) and the application running on top of MSL would still need to process application data properly regardless—there is nothing stopping a rogue client from sending a message with application data matching a server's application data.

The recipient field could be removed, or only included when the header will be encrypted.

MslControl considers SocketTimeoutException an application-initiated interruption

MslControl.cancelled() considers InterruptedIOException as an application-initiated, or at least application-aware, exception. However SocketTImeoutException is a subclass of InterruptedIOException and will be thrown due to socket timeout instead of due to cancellation or thread interruption. Make sure it is properly delivered as a timeout to the caller instead of being hidden as a cancellation.

Check if there are other exceptions that fall in under this category. Primarily IOExceptions that will be thrown by the InputStream and OutputStreams.

Consider removal of MslContext as data key from MslControl

MslControl currently uses MslContext as a data key for a few things, as well as uses MslContext to hold the remote entity clock. This is a potential problem since it's not clear to the MSL configuration that MslContext needs to serve a role as a data key. MslStore might be slightly better, since it is obvious that contains mutable state data.

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.