/aosp12/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/ipsec/ike/message/ |
H A D | IkeHeaderTest.java | 77 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() 125 inputPacket[MESSAGE_LENGTH_OFFSET] = (byte) 0x01; in testDecodeIkeHeaderWithInvalidPacketLength() [all …]
|
H A D | IkeSaPayloadTest.java | 267 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeAttribute() 290 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeEncryptionTransform() 306 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeEncryptionTransformWithInvalidKeyLength() 352 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodePrfTransform() 387 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeIntegrityTransform() 403 ByteBuffer inputBuffer = ByteBuffer.wrap(inputPacket); in testDecodeIntegrityTransformWithUnrecognizedAttribute() 489 inputPacket[TRANSFORM_ID_OFFSET] = -1; in testDecodeEsnTransformWithUnsupportedId() 532 inputPacket[TRANSFORM_TYPE_OFFSET] = 6; in testDecodeUnrecognizedTransform() 565 inputPacket[TRANSFORM_ID_OFFSET] = 1; in testDecodeTransformWithUnrecognizedTransformId() 688 new IkeSaPayload(false, true, inputPacket); [all …]
|
H A D | IkeCertX509CertPayloadTest.java | 120 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()
|
H A D | IkeIdPayloadTest.java | 108 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() 139 assertArrayEquals(inputPacket, payload.getEncodedPayloadBody()); in testDecodeFqdnIdPayload() 149 new IkeIdPayload(false /*critical*/, inputPacket, true /*isInitiator*/); in testDecodeRfc822AddrIdPayload() 186 byte[] inputPacket = in testDecodeInvalidDerAsn1DnIdPayload() 188 new IkeIdPayload(false /*critical*/, inputPacket, true /*isInitiator*/); in testDecodeInvalidDerAsn1DnIdPayload() 197 byte[] inputPacket = in testDecodeUnsupportedIdType() 199 inputPacket[ID_TYPE_OFFSET] = 0; in testDecodeUnsupportedIdType() [all …]
|
H A D | IkeMessageTest.java | 307 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() 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() 344 inputPacket[FIRST_PAYLOAD_TYPE_OFFSET] = (byte) 0xff; in testThrowUnsupportedCriticalPayloadException() 349 inputPacket, UnsupportedCriticalPayloadException.class); in testThrowUnsupportedCriticalPayloadException() 368 inputPacket[IkeHeader.IKE_HEADER_LENGTH + LAST_PAYLOAD_LENGTH_OFFSET]++; in testDecodeMessageWithTooLongPayloadLength() 492 IkeHeader header = new IkeHeader(inputPacket); in testAttachEncodedHeader() [all …]
|
H A D | IkeAuthPayloadTest.java | 97 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()
|
H A D | IkeKePayloadTest.java | 104 byte[] inputPacket = TestUtils.hexStringToByteArray(KE_PAYLOAD_RAW_PACKET); in testDecodeIkeKePayload() 106 IkeKePayload payload = new IkeKePayload(CRITICAL_BIT, inputPacket); in testDecodeIkeKePayload() 123 byte[] inputPacket = TestUtils.hexStringToByteArray(badKeyPayloadPacket); in testDecodeIkeKePayloadWithInvalidKeData() 126 IkeKePayload payload = new IkeKePayload(CRITICAL_BIT, inputPacket); in testDecodeIkeKePayloadWithInvalidKeData() 134 byte[] inputPacket = TestUtils.hexStringToByteArray(KE_PAYLOAD_RAW_PACKET); in testEncodeIkeKePayload() 135 IkeKePayload payload = new IkeKePayload(CRITICAL_BIT, inputPacket); in testEncodeIkeKePayload()
|
H A D | IkeAuthDigitalSignPayloadTest.java | 114 byte[] inputPacket = in testDecodeGenericDigitalSignPayload() 116 IkeAuthPayload payload = IkeAuthPayload.getIkeAuthPayload(false, inputPacket); in testDecodeGenericDigitalSignPayload() 186 byte[] inputPacket = in testVerifyInboundSignature() 189 (IkeAuthDigitalSignPayload) IkeAuthPayload.getIkeAuthPayload(false, inputPacket); in testVerifyInboundSignature() 204 byte[] inputPacket = in testVerifyInboundSignatureFail() 207 (IkeAuthDigitalSignPayload) IkeAuthPayload.getIkeAuthPayload(false, inputPacket); in testVerifyInboundSignatureFail()
|
H A D | IkeNotifyPayloadTest.java | 98 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()
|
H A D | IkeTestUtils.java | 53 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()
|
H A D | IkeNoncePayloadTest.java | 39 byte[] inputPacket = TestUtils.hexStringToByteArray(NONCE_DATA_RAW_HEX_STRING); in testEncode() 40 IkeNoncePayload payload = new IkeNoncePayload(false, inputPacket); in testEncode()
|
/aosp12/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/message/ |
H A D | IkeMessage.java | 567 header.validateInboundHeader(inputPacket.length); in decode() 571 inputPacket, IkeHeader.IKE_HEADER_LENGTH, inputPacket.length); in decode() 609 byte[] inputPacket, in decode() argument 628 inputPacket, in decode() 672 byte[] firstPacket = inputPacket; in decode() 684 inputPacket, in decode() 703 header.validateInboundHeader(inputPacket.length); in decode() 718 byte[] inputPacket, in decryptAndAuthenticate() argument 735 inputPacket, in decryptAndAuthenticate() 772 byte[] inputPacket, in processIkeFragment() argument [all …]
|