Browse Source

- Small fix for converting bytes to string
- added some protocol implementation infos

Wulf Pfeiffer 10 years ago
parent
commit
4ba86d1781

+ 8 - 2
src/de/tudarmstadt/informatik/hostage/commons/HelperUtils.java

@@ -73,8 +73,14 @@ public final class HelperUtils {
 	 * @return converted String
 	 */
 	public static String byteToStr(byte[] bytes) {
-		char[] chars = new char[bytes.length];
-		for (int i = 0, j = 0; i < bytes.length && j < chars.length; i++) {
+		int size = 0;
+		for(byte b : bytes) {
+			 if(isLetter((char) b)) {
+				 size++;
+			 }
+		}
+		char[] chars = new char[size];
+		for (int i = 0, j = 0; i < bytes.length && j < size; i++) {
 			if (isLetter((char) bytes[i])) {
 				chars[j] = (char) bytes[i];
 				j++;

+ 3 - 1
src/de/tudarmstadt/informatik/hostage/protocol/HTTPS.java

@@ -8,7 +8,9 @@ import javax.net.ssl.SSLContext;
 import de.tudarmstadt.informatik.hostage.HoneyService;
 
 /**
- * HTTPS protocol. Extends HTTP.
+ * HTTPS protocol. Extends HTTP. Implementation of RFC document 2818. It can handle the
+ * following requests: GET, HEAD, TRACE, POST, DELETE. For all other requests
+ * '400 Bad Request' will be replied.
  * 
  * @author Wulf Pfeiffer
  */

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/protocol/MySQL.java

@@ -10,7 +10,7 @@ import de.tudarmstadt.informatik.hostage.wrapper.Packet;
 
 /**
  * MySQL protocol.
- * 
+ * Implementation of https://dev.mysql.com/doc/internals/en/client-server-protocol.html.
  * @author Wulf Pfeiffer
  */
 public class MySQL implements Protocol {