diff --git a/pom.xml b/pom.xml index 05cc891..c8bc07e 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,9 @@ sensorhub pom + sensorhub-support sensorhub-core sensorhub-web - sensorhub-support @@ -26,6 +26,9 @@ 2.0.0.alpha 3.5.2 + 4.1.66.Final + 5.2.7 + 2.4.8 @@ -112,6 +115,7 @@ ${fastjson.version} + diff --git a/pom.xml b/pom.xml index 05cc891..c8bc07e 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,9 @@ sensorhub pom + sensorhub-support sensorhub-core sensorhub-web - sensorhub-support @@ -26,6 +26,9 @@ 2.0.0.alpha 3.5.2 + 4.1.66.Final + 5.2.7 + 2.4.8 @@ -112,6 +115,7 @@ ${fastjson.version} + diff --git a/sensorhub-core/pom.xml b/sensorhub-core/pom.xml index 0dade45..46f3832 100644 --- a/sensorhub-core/pom.xml +++ b/sensorhub-core/pom.xml @@ -5,7 +5,6 @@ com.casic sensorhub - ../pom.xml 0.0.1-SNAPSHOT @@ -15,16 +14,9 @@ sensorhub-core sensorhub-server - - com.casic - sensorhub-support - 0.0.1-SNAPSHOT - - - org.springframework.boot spring-boot-starter 2.4.5 @@ -78,8 +70,8 @@ - sensorhub com.casic + sensorhub-support 0.0.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 05cc891..c8bc07e 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,9 @@ sensorhub pom + sensorhub-support sensorhub-core sensorhub-web - sensorhub-support @@ -26,6 +26,9 @@ 2.0.0.alpha 3.5.2 + 4.1.66.Final + 5.2.7 + 2.4.8 @@ -112,6 +115,7 @@ ${fastjson.version} + diff --git a/sensorhub-core/pom.xml b/sensorhub-core/pom.xml index 0dade45..46f3832 100644 --- a/sensorhub-core/pom.xml +++ b/sensorhub-core/pom.xml @@ -5,7 +5,6 @@ com.casic sensorhub - ../pom.xml 0.0.1-SNAPSHOT @@ -15,16 +14,9 @@ sensorhub-core sensorhub-server - - com.casic - sensorhub-support - 0.0.1-SNAPSHOT - - - org.springframework.boot spring-boot-starter 2.4.5 @@ -78,8 +70,8 @@ - sensorhub com.casic + sensorhub-support 0.0.1-SNAPSHOT diff --git a/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java b/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java index 2ab07b4..e6c77bf 100644 --- a/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java +++ b/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java @@ -28,7 +28,7 @@ for (AbstractPreprocessingCodec abstractPreprocessingCodec : proccessCodecList) { pipeline.addLast(abstractPreprocessingCodec); } -// pipeline.addLast(new MessageDecoder()); +// pipeline.addLast(new MessageDecoder()); // pipeline.addLast(new LengthFieldBasedFrameDecoder(1024*100, 0, 2, 0, 2)); // pipeline.addLast("codec", new SensorhubCodec()); pipeline.addLast(new SensorhubDecoder()); diff --git a/pom.xml b/pom.xml index 05cc891..c8bc07e 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,9 @@ sensorhub pom + sensorhub-support sensorhub-core sensorhub-web - sensorhub-support @@ -26,6 +26,9 @@ 2.0.0.alpha 3.5.2 + 4.1.66.Final + 5.2.7 + 2.4.8 @@ -112,6 +115,7 @@ ${fastjson.version} + diff --git a/sensorhub-core/pom.xml b/sensorhub-core/pom.xml index 0dade45..46f3832 100644 --- a/sensorhub-core/pom.xml +++ b/sensorhub-core/pom.xml @@ -5,7 +5,6 @@ com.casic sensorhub - ../pom.xml 0.0.1-SNAPSHOT @@ -15,16 +14,9 @@ sensorhub-core sensorhub-server - - com.casic - sensorhub-support - 0.0.1-SNAPSHOT - - - org.springframework.boot spring-boot-starter 2.4.5 @@ -78,8 +70,8 @@ - sensorhub com.casic + sensorhub-support 0.0.1-SNAPSHOT diff --git a/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java b/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java index 2ab07b4..e6c77bf 100644 --- a/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java +++ b/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java @@ -28,7 +28,7 @@ for (AbstractPreprocessingCodec abstractPreprocessingCodec : proccessCodecList) { pipeline.addLast(abstractPreprocessingCodec); } -// pipeline.addLast(new MessageDecoder()); +// pipeline.addLast(new MessageDecoder()); // pipeline.addLast(new LengthFieldBasedFrameDecoder(1024*100, 0, 2, 0, 2)); // pipeline.addLast("codec", new SensorhubCodec()); pipeline.addLast(new SensorhubDecoder()); diff --git a/sensorhub-core/src/main/java/com/casic/missiles/parser/safe/impl/Sm4CryptStrategy.java b/sensorhub-core/src/main/java/com/casic/missiles/parser/safe/impl/Sm4CryptStrategy.java index 8bbe2e4..29eac23 100644 --- a/sensorhub-core/src/main/java/com/casic/missiles/parser/safe/impl/Sm4CryptStrategy.java +++ b/sensorhub-core/src/main/java/com/casic/missiles/parser/safe/impl/Sm4CryptStrategy.java @@ -1,11 +1,12 @@ package com.casic.missiles.parser.safe.impl; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.netty.buffer.ByteBufUtil; import org.bouncycastle.crypto.engines.SM4Engine; import org.bouncycastle.crypto.params.KeyParameter; import org.bouncycastle.util.encoders.Hex; -import java.nio.charset.Charset; - /** * SM4算法工具类 */ @@ -125,11 +126,18 @@ (byte)0xB1, (byte)0x86, (byte)0xA3, 0x7A, 0x46, 0x0C, 0x2F, (byte) 0x94, 0x4F, 0x7F, 0x2C, 0x56, 0x14, (byte) 0xF3, (byte)0x89, (byte) 0xC3, 0x3F, 0x20, (byte)0xF9, (byte) 0x87, (byte)0xA1, 0x60, (byte)0xD9, (byte)0xA8, (byte) 0xFD, (byte)0xD7, (byte) 0x9B, 0x4B, 0x26, 0x06, 0x30, 0x44}; String key = "24ad182507479a5da3ad94d9d78ea203"; + ByteBuf in= ByteBufAllocator.DEFAULT.heapBuffer(); + in.writeBytes(ciphertext); byte[] keyByte ={ 0x24,(byte)0xad,0x18,0x25,0x07,0x47,(byte)0x9a,0x5d,(byte)0xa3,(byte)0xad,(byte)0x94,(byte)0xd9,(byte)0xd7,(byte)0x8e,(byte)0xa2,0x03 }; byte[] resCipherData = ecb_encrypt(ciphertext, keyByte); + ByteBuf out= ByteBufAllocator.DEFAULT.heapBuffer(); + out.writeBytes(resCipherData); +// System.out.println(hexBytes); + System.out.println(ciphertext.length);//66 + System.out.println(ByteBufUtil.hexDump(out)); // String resPlainData = EcbDecrypt(resCipherData, key); // System.out.println("原始明文:" + data); System.out.println("解密后明文:" + resCipherData.toString()); diff --git a/pom.xml b/pom.xml index 05cc891..c8bc07e 100644 --- a/pom.xml +++ b/pom.xml @@ -7,9 +7,9 @@ sensorhub pom + sensorhub-support sensorhub-core sensorhub-web - sensorhub-support @@ -26,6 +26,9 @@ 2.0.0.alpha 3.5.2 + 4.1.66.Final + 5.2.7 + 2.4.8 @@ -112,6 +115,7 @@ ${fastjson.version} + diff --git a/sensorhub-core/pom.xml b/sensorhub-core/pom.xml index 0dade45..46f3832 100644 --- a/sensorhub-core/pom.xml +++ b/sensorhub-core/pom.xml @@ -5,7 +5,6 @@ com.casic sensorhub - ../pom.xml 0.0.1-SNAPSHOT @@ -15,16 +14,9 @@ sensorhub-core sensorhub-server - - com.casic - sensorhub-support - 0.0.1-SNAPSHOT - - - org.springframework.boot spring-boot-starter 2.4.5 @@ -78,8 +70,8 @@ - sensorhub com.casic + sensorhub-support 0.0.1-SNAPSHOT diff --git a/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java b/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java index 2ab07b4..e6c77bf 100644 --- a/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java +++ b/sensorhub-core/src/main/java/com/casic/missiles/netty/handler/SensorhubServerChannelInitialHandler.java @@ -28,7 +28,7 @@ for (AbstractPreprocessingCodec abstractPreprocessingCodec : proccessCodecList) { pipeline.addLast(abstractPreprocessingCodec); } -// pipeline.addLast(new MessageDecoder()); +// pipeline.addLast(new MessageDecoder()); // pipeline.addLast(new LengthFieldBasedFrameDecoder(1024*100, 0, 2, 0, 2)); // pipeline.addLast("codec", new SensorhubCodec()); pipeline.addLast(new SensorhubDecoder()); diff --git a/sensorhub-core/src/main/java/com/casic/missiles/parser/safe/impl/Sm4CryptStrategy.java b/sensorhub-core/src/main/java/com/casic/missiles/parser/safe/impl/Sm4CryptStrategy.java index 8bbe2e4..29eac23 100644 --- a/sensorhub-core/src/main/java/com/casic/missiles/parser/safe/impl/Sm4CryptStrategy.java +++ b/sensorhub-core/src/main/java/com/casic/missiles/parser/safe/impl/Sm4CryptStrategy.java @@ -1,11 +1,12 @@ package com.casic.missiles.parser.safe.impl; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.netty.buffer.ByteBufUtil; import org.bouncycastle.crypto.engines.SM4Engine; import org.bouncycastle.crypto.params.KeyParameter; import org.bouncycastle.util.encoders.Hex; -import java.nio.charset.Charset; - /** * SM4算法工具类 */ @@ -125,11 +126,18 @@ (byte)0xB1, (byte)0x86, (byte)0xA3, 0x7A, 0x46, 0x0C, 0x2F, (byte) 0x94, 0x4F, 0x7F, 0x2C, 0x56, 0x14, (byte) 0xF3, (byte)0x89, (byte) 0xC3, 0x3F, 0x20, (byte)0xF9, (byte) 0x87, (byte)0xA1, 0x60, (byte)0xD9, (byte)0xA8, (byte) 0xFD, (byte)0xD7, (byte) 0x9B, 0x4B, 0x26, 0x06, 0x30, 0x44}; String key = "24ad182507479a5da3ad94d9d78ea203"; + ByteBuf in= ByteBufAllocator.DEFAULT.heapBuffer(); + in.writeBytes(ciphertext); byte[] keyByte ={ 0x24,(byte)0xad,0x18,0x25,0x07,0x47,(byte)0x9a,0x5d,(byte)0xa3,(byte)0xad,(byte)0x94,(byte)0xd9,(byte)0xd7,(byte)0x8e,(byte)0xa2,0x03 }; byte[] resCipherData = ecb_encrypt(ciphertext, keyByte); + ByteBuf out= ByteBufAllocator.DEFAULT.heapBuffer(); + out.writeBytes(resCipherData); +// System.out.println(hexBytes); + System.out.println(ciphertext.length);//66 + System.out.println(ByteBufUtil.hexDump(out)); // String resPlainData = EcbDecrypt(resCipherData, key); // System.out.println("原始明文:" + data); System.out.println("解密后明文:" + resCipherData.toString()); diff --git a/sensorhub-support/pom.xml b/sensorhub-support/pom.xml index fec2006..8fa2789 100644 --- a/sensorhub-support/pom.xml +++ b/sensorhub-support/pom.xml @@ -3,21 +3,22 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - sensorhub com.casic + sensorhub 0.0.1-SNAPSHOT 4.0.0 + com.casic sensorhub-support + 0.0.1-SNAPSHOT + sensorhub-support + sensorhub-server 8 8 UTF-8 - 4.1.66.Final - 5.2.7 - 2.4.8 @@ -26,28 +27,21 @@ io.netty netty-all ${netty-all.version} + compile - com.googlecode.aviator aviator ${aviator.version} - + org.springframework.data spring-data-redis ${redis.version} - - - - - - - \ No newline at end of file