Home
last modified time | relevance | path

Searched refs:inputPacket (Results 1 – 12 of 12) sorted by relevance

/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/ipsec/ike/message/
DIkeHeaderTest.java77 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testDecodeIkeHeader()
78 IkeHeader header = new IkeHeader(inputPacket); in testDecodeIkeHeader()
80 assertEquals(IKE_MSG_LENGTH, inputPacket.length); in testDecodeIkeHeader()
99 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testDecodeIkeHeaderWithInvalidMajorVersion()
101 inputPacket[VERSION_OFFSET] = (byte) 0x30; in testDecodeIkeHeaderWithInvalidMajorVersion()
103 inputPacket[EXCHANGE_TYPE_OFFSET] = (byte) 0x00; in testDecodeIkeHeaderWithInvalidMajorVersion()
107 inputPacket, InvalidMajorVersionException.class); in testDecodeIkeHeaderWithInvalidMajorVersion()
114 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testDecodeIkeHeaderWithInvalidExchangeType()
116 inputPacket[EXCHANGE_TYPE_OFFSET] = (byte) 0x00; in testDecodeIkeHeaderWithInvalidExchangeType()
118 IkeTestUtils.decodeAndVerifyUnprotectedErrorMsg(inputPacket, InvalidSyntaxException.class); in testDecodeIkeHeaderWithInvalidExchangeType()
[all …]
DIkeSaPayloadTest.java275 byte[] inputPacket = TestUtils.hexStringToByteArray(ATTRIBUTE_RAW_PACKET); in testDecodeAttribute()
276 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeAttribute()
298 byte[] inputPacket = TestUtils.hexStringToByteArray(ENCR_TRANSFORM_RAW_PACKET); in testDecodeEncryptionTransform()
299 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeEncryptionTransform()
314 byte[] inputPacket = TestUtils.hexStringToByteArray(ENCR_TRANSFORM_RAW_PACKET); in testDecodeEncryptionTransformWithInvalidKeyLength()
315 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeEncryptionTransformWithInvalidKeyLength()
360 byte[] inputPacket = TestUtils.hexStringToByteArray(PRF_TRANSFORM_RAW_PACKET); in testDecodePrfTransform()
361 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodePrfTransform()
395 byte[] inputPacket = TestUtils.hexStringToByteArray(INTEG_TRANSFORM_RAW_PACKET); in testDecodeIntegrityTransform()
396 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeIntegrityTransform()
[all …]
DIkeCertX509CertPayloadTest.java120 byte[] inputPacket = TestUtils.hexStringToByteArray(CERT_PAYLOAD_BODY_HEX_STRING); in testDecodeX509Certificate()
121 IkeCertPayload certPayload = IkeCertPayload.getIkeCertPayload(false, inputPacket); in testDecodeX509Certificate()
130 byte[] inputPacket = TestUtils.hexStringToByteArray(CERT_PAYLOAD_BODY_HEX_STRING + "ffff"); in testDecodeX509CertificateWithUnexpectedTrailing()
132 IkeCertPayload.getIkeCertPayload(false, inputPacket); in testDecodeX509CertificateWithUnexpectedTrailing()
140 byte[] inputPacket = TestUtils.hexStringToByteArray(CERT_PAYLOAD_BODY_HEX_STRING); in testDecodeGetNoX509Certificate()
141 inputPacket[CERTIFICATE_OFFSET] = 0; in testDecodeGetNoX509Certificate()
143 IkeCertPayload.getIkeCertPayload(false, inputPacket); in testDecodeGetNoX509Certificate()
151 byte[] inputPacket = TestUtils.hexStringToByteArray(CERT_PAYLOAD_BODY_HEX_STRING); in testDecodeInvalidX509Certificate()
154 false, Arrays.copyOfRange(inputPacket, 0, inputPacket.length - 1)); in testDecodeInvalidX509Certificate()
DIkeIdPayloadTest.java108 byte[] inputPacket = in testDecodeIpv4AddrIdPayload()
110 IkeIdPayload payload = new IkeIdPayload(false, inputPacket, false); in testDecodeIpv4AddrIdPayload()
121 byte[] inputPacket = in testDecodeIpv6AddrIdPayload()
123 IkeIdPayload payload = new IkeIdPayload(false, inputPacket, false); in testDecodeIpv6AddrIdPayload()
134 byte[] inputPacket = TestUtils.hexStringToByteArray(FQDN_ID_PAYLOAD_BODY_HEX_STRING); in testDecodeFqdnIdPayload()
136 new IkeIdPayload(false /*critical*/, inputPacket, false /*isInitiator*/); in testDecodeFqdnIdPayload()
139 assertArrayEquals(inputPacket, payload.getEncodedPayloadBody()); in testDecodeFqdnIdPayload()
147 byte[] inputPacket = TestUtils.hexStringToByteArray(RFC822_ADDR_ID_PAYLOAD_BODY_HEX_STRING); in testDecodeRfc822AddrIdPayload()
149 new IkeIdPayload(false /*critical*/, inputPacket, true /*isInitiator*/); in testDecodeRfc822AddrIdPayload()
159 byte[] inputPacket = TestUtils.hexStringToByteArray(KEY_ID_PAYLOAD_BODY_HEX_STRING); in testDecodeKeyIdPayload()
[all …]
DIkeMessageTest.java309 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testDecodeIkeMessage()
310 IkeHeader header = new IkeHeader(inputPacket); in testDecodeIkeMessage()
312 DecodeResult decodeResult = IkeMessage.decode(0, header, inputPacket); in testDecodeIkeMessage()
314 IkeMessage message = verifyDecodeResultOkAndGetMessage(decodeResult, inputPacket); in testDecodeIkeMessage()
325 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testDecodeMessageWithUnsupportedUncriticalPayload()
327 inputPacket[FIRST_PAYLOAD_TYPE_OFFSET] = (byte) 0xff; in testDecodeMessageWithUnsupportedUncriticalPayload()
328 IkeHeader header = new IkeHeader(inputPacket); in testDecodeMessageWithUnsupportedUncriticalPayload()
330 DecodeResult decodeResult = IkeMessage.decode(0, header, inputPacket); in testDecodeMessageWithUnsupportedUncriticalPayload()
332 IkeMessage message = verifyDecodeResultOkAndGetMessage(decodeResult, inputPacket); in testDecodeMessageWithUnsupportedUncriticalPayload()
344 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testThrowUnsupportedCriticalPayloadException()
[all …]
DIkeKePayloadTest.java104 byte[] inputPacket = TestUtils.hexStringToByteArray(KE_PAYLOAD_RAW_PACKET); in testDecodeIkeKePayload()
106 IkeKePayload payload = new IkeKePayload(CRITICAL_BIT, inputPacket); in testDecodeIkeKePayload()
128 byte[] inputPacket = TestUtils.hexStringToByteArray(unrecognizedKePayload); in testDecodeIkeKePayloadWithUnrecognizedDh()
130 IkeKePayload payload = new IkeKePayload(CRITICAL_BIT, inputPacket); in testDecodeIkeKePayloadWithUnrecognizedDh()
141 byte[] inputPacket = TestUtils.hexStringToByteArray(badKeyPayloadPacket); in testDecodeIkeKePayloadWithInvalidKeData()
144 IkeKePayload payload = new IkeKePayload(CRITICAL_BIT, inputPacket); in testDecodeIkeKePayloadWithInvalidKeData()
152 byte[] inputPacket = TestUtils.hexStringToByteArray(KE_PAYLOAD_RAW_PACKET); in testEncodeIkeKePayload()
153 IkeKePayload payload = new IkeKePayload(CRITICAL_BIT, inputPacket); in testEncodeIkeKePayload()
DIkeAuthPayloadTest.java97 byte[] inputPacket = TestUtils.hexStringToByteArray(PSK_AUTH_PAYLOAD_HEX_STRING); in testDecodeIkeAuthPayload()
98 IkeAuthPayload payload = IkeAuthPayload.getIkeAuthPayload(false, inputPacket); in testDecodeIkeAuthPayload()
110 byte[] inputPacket = TestUtils.hexStringToByteArray(PSK_AUTH_PAYLOAD_HEX_STRING); in testDecodeIkeAuthPayloadWithUnsupportedMethod()
111 inputPacket[AUTH_METHOD_POSITION] = 0; in testDecodeIkeAuthPayloadWithUnsupportedMethod()
113 IkeAuthPayload payload = IkeAuthPayload.getIkeAuthPayload(false, inputPacket); in testDecodeIkeAuthPayloadWithUnsupportedMethod()
DIkeNotifyPayloadTest.java98 byte[] inputPacket = in testDecodeNotifyPayloadSpiUnset()
102 IkeNotifyPayload payload = new IkeNotifyPayload(false, inputPacket); in testDecodeNotifyPayloadSpiUnset()
112 byte[] inputPacket = TestUtils.hexStringToByteArray(NOTIFY_REKEY_PAYLOAD_BODY_HEX_STRING); in testDecodeNotifyPayloadSpiSet()
114 IkeNotifyPayload payload = new IkeNotifyPayload(false, inputPacket); in testDecodeNotifyPayloadSpiSet()
227 byte[] inputPacket = in testEncodeNotifyPayload()
229 IkeNotifyPayload payload = new IkeNotifyPayload(false, inputPacket); in testEncodeNotifyPayload()
391 byte[] inputPacket = TestUtils.hexStringToByteArray(NOTIFY_REKEY_PAYLOAD_BODY_HEX_STRING); in testBuildIkeExceptionWithStatusNotify()
392 IkeNotifyPayload payload = new IkeNotifyPayload(false, inputPacket); in testBuildIkeExceptionWithStatusNotify()
DIkeAuthDigitalSignPayloadTest.java128 byte[] inputPacket = in testDecodeGenericDigitalSignPayload()
130 IkeAuthPayload payload = IkeAuthPayload.getIkeAuthPayload(false, inputPacket); in testDecodeGenericDigitalSignPayload()
232 byte[] inputPacket = TestUtils.hexStringToByteArray(authPayloadBodyHex); in checkVerifyInboundSignature()
234 (IkeAuthDigitalSignPayload) IkeAuthPayload.getIkeAuthPayload(false, inputPacket); in checkVerifyInboundSignature()
259 byte[] inputPacket = in testVerifyInboundSignatureFail()
262 (IkeAuthDigitalSignPayload) IkeAuthPayload.getIkeAuthPayload(false, inputPacket); in testVerifyInboundSignatureFail()
DIkeTestUtils.java53 byte[] inputPacket, Class<T> expectedException) throws Exception { in decodeAndVerifyUnprotectedErrorMsg() argument
54 IkeHeader header = new IkeHeader(inputPacket); in decodeAndVerifyUnprotectedErrorMsg()
55 DecodeResult decodeResult = IkeMessage.decode(0, header, inputPacket); in decodeAndVerifyUnprotectedErrorMsg()
DIkeNoncePayloadTest.java39 byte[] inputPacket = TestUtils.hexStringToByteArray(NONCE_DATA_RAW_HEX_STRING); in testEncode()
40 IkeNoncePayload payload = new IkeNoncePayload(false, inputPacket); in testEncode()
/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/message/
DIkeMessage.java159 public static DecodeResult decode(int expectedMsgId, IkeHeader header, byte[] inputPacket) { in decode() argument
160 return sIkeMessageHelper.decode(expectedMsgId, header, inputPacket); in decode()
688 public DecodeResult decode(int expectedMsgId, IkeHeader header, byte[] inputPacket) { in decode() argument
695 header.validateInboundHeader(inputPacket.length); in decode()
699 inputPacket, IkeHeader.IKE_HEADER_LENGTH, inputPacket.length); in decode()
704 new IkeMessage(header, supportedPayloadList), inputPacket); in decode()
737 byte[] inputPacket, in decode() argument
756 inputPacket, in decode()
800 byte[] firstPacket = inputPacket; in decode()
806 validateFragmentHeader(header, inputPacket.length, collectedFragments); in decode()
[all …]