Examples of LimitLengthASN1Reader


Examples of org.ejbca.ui.web.LimitLengthASN1Reader

    }
    // So we passed basic tests, now we can read the bytes, but still keep an eye on the size
    // we can not fully trust the sent content length.
    if (StringUtils.equals(method, "POST")) {
      final ServletInputStream in = request.getInputStream(); // ServletInputStream does not have to be closed, container handles this
      ret = new LimitLengthASN1Reader(in, n).readFirstASN1Object();
      if (n > ret.length) {
        // The client is sending more data than the OCSP request. It might be slightly broken or trying to bog down the server on purpose.
        // In the interest of not breaking existing systems that might have slightly broken clients we just log for a warning for now.
        String msg = intres.getLocalizedMessage("ocsp.additionaldata", ret.length, n);
        m_log.warn(msg);
View Full Code Here

Examples of org.ejbca.ui.web.LimitLengthASN1Reader

   * @return IResponseMessage containing the CMP response message or null if there is no message to send back or some internal error has occurred
   * @throws IOException
   */
  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public IResponseMessage dispatch(Admin admin, byte[] ba) throws IOException {
    DERObject derObject = new LimitLengthASN1Reader(new ByteArrayInputStream(ba), ba.length).readObject();
    return dispatch(admin, derObject);
  }
View Full Code Here

Examples of org.ejbca.ui.web.LimitLengthASN1Reader

      final int responseCode = con.getResponseCode();
      if ( responseCode!=HttpURLConnection.HTTP_OK ) {
        return new CMPSendHTTP( contentType, null, responseCode );
      }
      final InputStream in = con.getInputStream();
      final byte response[] = new LimitLengthASN1Reader(in, con.getContentLength()).readObject().getDEREncoded();
      if ( response==null || response.length<1 ) {
        throw new Exception(intres.getLocalizedMessage("cmp.errornoasn1"));
      }
      isError = false;
      return new CMPSendHTTP( contentType, response, responseCode );
View Full Code Here

Examples of org.ejbca.ui.web.LimitLengthASN1Reader

        throw new ServletException("Servlet not initialized.");
      }
      final ServletInputStream sin = servletReq.getInputStream();
      final DERObject message;
      try {
        message = new LimitLengthASN1Reader(sin, servletReq.getContentLength()).readObject();
      } catch ( IOException e ) {
        servletResp.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
        log.error( intres.getLocalizedMessage("cmp.errornoasn1"), e );
        return;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.