Ejemplo n.º 1
0
  public void onHTTPCupertinoEncryptionKeyRequest(
      HTTPStreamerSessionCupertino httpCupertinoStreamingSession,
      IHTTPRequest req,
      IHTTPResponse resp) {

    boolean isGood = true;
    String ipAddress = httpCupertinoStreamingSession.getIpAddress();
    String queryStr = req.getQueryString();
    String referrer = httpCupertinoStreamingSession.getReferrer();
    String cookieStr = httpCupertinoStreamingSession.getCookieStr();
    String userAgent = httpCupertinoStreamingSession.getUserAgent();
    String sessionId = httpCupertinoStreamingSession.getSessionId();
    IApplicationInstance appInstance = httpCupertinoStreamingSession.getAppInstance();
    String streamName = httpCupertinoStreamingSession.getStreamName();

    getLogger()
        .info(
            "ModuleEncryptionHandlerCupertinoStreaming.onHTTPCupertinoEncryptionKeyRequest["
                + appInstance.getContextStr()
                + "/"
                + httpCupertinoStreamingSession.getStreamName()
                + "]: accept:"
                + isGood);
    if (!isGood) {
      httpCupertinoStreamingSession.rejectSession();
    }
  }
Ejemplo n.º 2
0
  public void onHTTPCupertinoEncryptionKeyCreateVOD(
      HTTPStreamerSessionCupertino httpCupertinoStreamingSession, byte[] encKey) {
    String ipAddress = httpCupertinoStreamingSession.getIpAddress();
    String queryStr = httpCupertinoStreamingSession.getQueryStr();
    String referrer = httpCupertinoStreamingSession.getReferrer();
    String cookieStr = httpCupertinoStreamingSession.getCookieStr();
    String userAgent = httpCupertinoStreamingSession.getUserAgent();

    IApplicationInstance appInstance = httpCupertinoStreamingSession.getAppInstance();
    String streamName = httpCupertinoStreamingSession.getStreamName();
    String sessionId = httpCupertinoStreamingSession.getSessionId();

    String mySharedSecret =
        appInstance.getProperties().getPropertyStr("cupertinoEncryptionSharedSecret", "");

    String hashStr =
        mySharedSecret
            + ":"
            + (httpCupertinoStreamingSession.isHTTPOrigin() ? "" : sessionId + ":")
            + appInstance.getApplication().getName()
            + ":"
            + appInstance.getName()
            + ":"
            + httpCupertinoStreamingSession.getStreamName();

    byte[] tmpBytes = MD5DigestUtils.generateHashBytes(hashStr);
    if (tmpBytes != null) System.arraycopy(tmpBytes, 0, encKey, 0, encKey.length);
    getLogger()
        .info(
            "ModuleEncryptionHandlerCupertinoStreaming.onHTTPCupertinoEncryptionKeyCreateVOD["
                + appInstance.getContextStr()
                + "/"
                + httpCupertinoStreamingSession.getStreamName()
                + "]: *"
                + BufferUtils.encodeHexString(encKey).substring(28));
  }