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/
DIkeSaPayloadTest.java266 byte[] inputPacket = TestUtils.hexStringToByteArray(ATTRIBUTE_RAW_PACKET); in testDecodeAttribute()
267 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeAttribute()
289 byte[] inputPacket = TestUtils.hexStringToByteArray(ENCR_TRANSFORM_RAW_PACKET); in testDecodeEncryptionTransform()
290 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeEncryptionTransform()
305 byte[] inputPacket = TestUtils.hexStringToByteArray(ENCR_TRANSFORM_RAW_PACKET); in testDecodeEncryptionTransformWithInvalidKeyLength()
306 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeEncryptionTransformWithInvalidKeyLength()
351 byte[] inputPacket = TestUtils.hexStringToByteArray(PRF_TRANSFORM_RAW_PACKET); in testDecodePrfTransform()
352 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodePrfTransform()
386 byte[] inputPacket = TestUtils.hexStringToByteArray(INTEG_TRANSFORM_RAW_PACKET); in testDecodeIntegrityTransform()
387 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeIntegrityTransform()
[all …]
DIkeHeaderTest.java76 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testDecodeIkeHeader()
77 IkeHeader header = new IkeHeader(inputPacket); in testDecodeIkeHeader()
79 assertEquals(IKE_MSG_LENGTH, inputPacket.length); in testDecodeIkeHeader()
98 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testDecodeIkeHeaderWithInvalidMajorVersion()
100 inputPacket[VERSION_OFFSET] = (byte) 0x30; in testDecodeIkeHeaderWithInvalidMajorVersion()
102 inputPacket[EXCHANGE_TYPE_OFFSET] = (byte) 0x00; in testDecodeIkeHeaderWithInvalidMajorVersion()
106 inputPacket, InvalidMajorVersionException.class); in testDecodeIkeHeaderWithInvalidMajorVersion()
113 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testDecodeIkeHeaderWithInvalidExchangeType()
115 inputPacket[EXCHANGE_TYPE_OFFSET] = (byte) 0x00; in testDecodeIkeHeaderWithInvalidExchangeType()
117 IkeTestUtils.decodeAndVerifyUnprotectedErrorMsg(inputPacket, InvalidSyntaxException.class); in testDecodeIkeHeaderWithInvalidExchangeType()
[all …]
DIkeIdPayloadTest.java106 byte[] inputPacket = in testDecodeIpv4AddrIdPayload()
108 IkeIdPayload payload = new IkeIdPayload(false, inputPacket, false); in testDecodeIpv4AddrIdPayload()
119 byte[] inputPacket = in testDecodeIpv6AddrIdPayload()
121 IkeIdPayload payload = new IkeIdPayload(false, inputPacket, false); in testDecodeIpv6AddrIdPayload()
132 byte[] inputPacket = TestUtils.hexStringToByteArray(FQDN_ID_PAYLOAD_BODY_HEX_STRING); in testDecodeFqdnIdPayload()
134 new IkeIdPayload(false /*critical*/, inputPacket, false /*isInitiator*/); in testDecodeFqdnIdPayload()
137 assertArrayEquals(inputPacket, payload.getEncodedPayloadBody()); in testDecodeFqdnIdPayload()
145 byte[] inputPacket = TestUtils.hexStringToByteArray(RFC822_ADDR_ID_PAYLOAD_BODY_HEX_STRING); in testDecodeRfc822AddrIdPayload()
147 new IkeIdPayload(false /*critical*/, inputPacket, true /*isInitiator*/); in testDecodeRfc822AddrIdPayload()
157 byte[] inputPacket = TestUtils.hexStringToByteArray(KEY_ID_PAYLOAD_BODY_HEX_STRING); in testDecodeKeyIdPayload()
[all …]
DIkeCertX509CertPayloadTest.java119 byte[] inputPacket = TestUtils.hexStringToByteArray(CERT_PAYLOAD_BODY_HEX_STRING); in testDecodeX509Certificate()
120 IkeCertPayload certPayload = IkeCertPayload.getIkeCertPayload(false, inputPacket); in testDecodeX509Certificate()
129 byte[] inputPacket = TestUtils.hexStringToByteArray(CERT_PAYLOAD_BODY_HEX_STRING + "ffff"); in testDecodeX509CertificateWithUnexpectedTrailing()
131 IkeCertPayload.getIkeCertPayload(false, inputPacket); in testDecodeX509CertificateWithUnexpectedTrailing()
139 byte[] inputPacket = TestUtils.hexStringToByteArray(CERT_PAYLOAD_BODY_HEX_STRING); in testDecodeGetNoX509Certificate()
140 inputPacket[CERTIFICATE_OFFSET] = 0; in testDecodeGetNoX509Certificate()
142 IkeCertPayload.getIkeCertPayload(false, inputPacket); in testDecodeGetNoX509Certificate()
150 byte[] inputPacket = TestUtils.hexStringToByteArray(CERT_PAYLOAD_BODY_HEX_STRING); in testDecodeInvalidX509Certificate()
153 false, Arrays.copyOfRange(inputPacket, 0, inputPacket.length - 1)); in testDecodeInvalidX509Certificate()
DIkeMessageTest.java307 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testDecodeIkeMessage()
308 IkeHeader header = new IkeHeader(inputPacket); in testDecodeIkeMessage()
310 DecodeResult decodeResult = IkeMessage.decode(0, header, inputPacket); in testDecodeIkeMessage()
312 IkeMessage message = verifyDecodeResultOkAndGetMessage(decodeResult, inputPacket); in testDecodeIkeMessage()
323 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testDecodeMessageWithUnsupportedUncriticalPayload()
325 inputPacket[FIRST_PAYLOAD_TYPE_OFFSET] = (byte) 0xff; in testDecodeMessageWithUnsupportedUncriticalPayload()
326 IkeHeader header = new IkeHeader(inputPacket); in testDecodeMessageWithUnsupportedUncriticalPayload()
328 DecodeResult decodeResult = IkeMessage.decode(0, header, inputPacket); in testDecodeMessageWithUnsupportedUncriticalPayload()
330 IkeMessage message = verifyDecodeResultOkAndGetMessage(decodeResult, inputPacket); in testDecodeMessageWithUnsupportedUncriticalPayload()
342 byte[] inputPacket = TestUtils.hexStringToByteArray(IKE_SA_INIT_RAW_PACKET); in testThrowUnsupportedCriticalPayloadException()
[all …]
DIkeNotifyPayloadTest.java63 byte[] inputPacket = in testDecodeNotifyPayloadSpiUnset()
67 IkeNotifyPayload payload = new IkeNotifyPayload(false, inputPacket); in testDecodeNotifyPayloadSpiUnset()
77 byte[] inputPacket = TestUtils.hexStringToByteArray(NOTIFY_REKEY_PAYLOAD_BODY_HEX_STRING); in testDecodeNotifyPayloadSpiSet()
79 IkeNotifyPayload payload = new IkeNotifyPayload(false, inputPacket); in testDecodeNotifyPayloadSpiSet()
146 byte[] inputPacket = in testEncodeNotifyPayload()
148 IkeNotifyPayload payload = new IkeNotifyPayload(false, inputPacket); in testEncodeNotifyPayload()
210 byte[] inputPacket = TestUtils.hexStringToByteArray(NOTIFY_REKEY_PAYLOAD_BODY_HEX_STRING); in testBuildIkeExceptionWithStatusNotify()
211 IkeNotifyPayload payload = new IkeNotifyPayload(false, inputPacket); in testBuildIkeExceptionWithStatusNotify()
DIkeAuthDigitalSignPayloadTest.java97 byte[] inputPacket = in testDecodeGenericDigitalSignPayload()
99 IkeAuthPayload payload = IkeAuthPayload.getIkeAuthPayload(false, inputPacket); in testDecodeGenericDigitalSignPayload()
132 byte[] inputPacket = in testVerifyInboundSignature()
135 (IkeAuthDigitalSignPayload) IkeAuthPayload.getIkeAuthPayload(false, inputPacket); in testVerifyInboundSignature()
150 byte[] inputPacket = in testVerifyInboundSignatureFail()
153 (IkeAuthDigitalSignPayload) IkeAuthPayload.getIkeAuthPayload(false, inputPacket); in testVerifyInboundSignatureFail()
DIkeKePayloadTest.java117 byte[] inputPacket = TestUtils.hexStringToByteArray(KE_PAYLOAD_RAW_PACKET); in testDecodeIkeKePayload()
119 IkeKePayload payload = new IkeKePayload(CRITICAL_BIT, inputPacket); in testDecodeIkeKePayload()
136 byte[] inputPacket = TestUtils.hexStringToByteArray(badKeyPayloadPacket); in testDecodeIkeKePayloadWithInvalidKeData()
139 IkeKePayload payload = new IkeKePayload(CRITICAL_BIT, inputPacket); in testDecodeIkeKePayloadWithInvalidKeData()
147 byte[] inputPacket = TestUtils.hexStringToByteArray(KE_PAYLOAD_RAW_PACKET); in testEncodeIkeKePayload()
148 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()
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.java114 public static DecodeResult decode(int expectedMsgId, IkeHeader header, byte[] inputPacket) { in decode() argument
115 return sIkeMessageHelper.decode(expectedMsgId, header, inputPacket); in decode()
545 public DecodeResult decode(int expectedMsgId, IkeHeader header, byte[] inputPacket) { in decode() argument
552 header.validateInboundHeader(inputPacket.length); in decode()
556 inputPacket, IkeHeader.IKE_HEADER_LENGTH, inputPacket.length); in decode()
561 new IkeMessage(header, supportedPayloadList), inputPacket); in decode()
594 byte[] inputPacket, in decode() argument
613 inputPacket, in decode()
657 byte[] firstPacket = inputPacket; in decode()
663 validateFragmentHeader(header, inputPacket.length, collectedFragments); in decode()
[all …]