/cts/hostsidetests/net/app/src/com/android/cts/net/hostside/ |
D | PacketReflector.java | 67 private static void swapBytes(byte[] buf, int pos1, int pos2, int len) { in swapBytes() argument 69 byte b = buf[pos1 + i]; in swapBytes() 70 buf[pos1 + i] = buf[pos2 + i]; in swapBytes() 71 buf[pos2 + i] = b; in swapBytes() 75 private static void swapAddresses(byte[] buf, int version) { in swapAddresses() argument 89 swapBytes(buf, addrPos, addrPos + addrLen, addrLen); in swapAddresses() 94 private void processTcpPacket(byte[] buf, int version, int len, int hdrLen) { in processTcpPacket() argument 100 swapAddresses(buf, version); in processTcpPacket() 103 writePacket(buf, len); in processTcpPacket() 108 private void processUdpPacket(byte[] buf, int version, int len, int hdrLen) { in processUdpPacket() argument [all …]
|
/cts/tests/tests/net/jni/ |
D | NativeDnsJni.c | 50 char buf[256]; in Java_android_net_cts_DnsTest_testNativeDns() local 53 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns() 55 LOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns() 58 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns() 60 LOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns() 83 char buf[256]; in Java_android_net_cts_DnsTest_testNativeDns() local 86 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns() 87 LOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns() 91 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns() 92 LOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns() [all …]
|
D | NativeMultinetworkJni.cpp | 76 int makeQuery(const char* name, int qtype, uint8_t* buf, size_t buflen) { in makeQuery() argument 77 return res_mkquery(ns_o_query, name, ns_c_in, qtype, NULL, 0, NULL, buf, buflen); in makeQuery() 80 int getAsyncResponse(JNIEnv* env, int fd, int timeoutMs, int* rcode, uint8_t* buf, size_t bufLen) { in getAsyncResponse() argument 85 int n = android_res_nresult(fd, rcode, buf, bufLen); in getAsyncResponse() 96 int extractIpAddressAnswers(uint8_t* buf, size_t bufLen, int family) { in extractIpAddressAnswers() argument 98 if (ns_initparse((const uint8_t*) buf, bufLen, &handle) < 0) { in extractIpAddressAnswers() 125 uint8_t buf[MAXPACKET] = {}; in expectAnswersValid() local 126 int res = getAsyncResponse(env, fd, TIMEOUT_MS, &rcode, buf, MAXPACKET); in expectAnswersValid() 134 return extractIpAddressAnswers(buf, res, family); in expectAnswersValid() 141 uint8_t buf[MAXPACKET] = {}; in expectAnswersNotValid() local [all …]
|
/cts/tests/location/location_gnss/src/android/location/cts/gnss/asn1/base/ |
D | Asn1Object.java | 92 ByteBuffer buf = ByteBuffer.allocate(getBerLength()); in encodeBer() local 93 encodeBer(buf); in encodeBer() 94 return buf.array(); in encodeBer() 97 void encodeBer(ByteBuffer buf) { in encodeBer() argument 105 tag.writeTagAndLength(buf, true, innerValueLen); in encodeBer() 109 tag.writeTagAndLength(buf, isConstructed(), valueLen); in encodeBer() 110 encodeBerValue(buf); in encodeBer() 120 abstract void encodeBerValue(ByteBuffer buf); in encodeBerValue() argument 133 void decodeBer(ByteBuffer buf) { in decodeBer() argument 134 Asn1Tag tag = Asn1Tag.readTag(buf); in decodeBer() [all …]
|
D | Asn1Choice.java | 44 public void writeTagAndLength(ByteBuffer buf, boolean constructed, int valueLength) { 134 public void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument 145 select.getTag().writeTagAndLength(buf, value.isConstructed(), value.getBerValueLength()); in encodeBerValue() 146 value.encodeBerValue(buf); in encodeBerValue() 148 select.getTag().writeTagAndLength(buf, true, value.getBerLength()); in encodeBerValue() 149 value.encodeBer(buf); in encodeBerValue() 152 value.encodeBer(buf); in encodeBerValue() 157 public void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument 158 Asn1Tag tag = Asn1Tag.peekTag(buf); in decodeBerValue() 165 Asn1Tag.readTag(buf); // Read the tag off. in decodeBerValue() [all …]
|
D | Asn1Tag.java | 97 public void writeTagAndLength(ByteBuffer buf, boolean constructed, int valueLength) { in writeTagAndLength() argument 98 this.writeTag(buf, constructed); in writeTagAndLength() 99 writeLength(buf, valueLength); in writeTagAndLength() 102 private void writeTag(ByteBuffer buf, boolean constructed) { in writeTag() argument 107 buf.put((byte) (getValue() | CONSTRUCTED_BIT)); in writeTag() 109 buf.put((byte) getValue()); in writeTag() 113 static Asn1Tag readTag(ByteBuffer buf) { in readTag() argument 114 return Asn1Tag.fromValue(buf.get() & 0xFF); in readTag() 120 static Asn1Tag peekTag(ByteBuffer buf) { in peekTag() argument 121 return Asn1Tag.fromValue(buf.get(buf.position()) & 0xFF); in peekTag() [all …]
|
D | Asn1Sequence.java | 73 public void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument 79 obj.encodeBer(buf); in encodeBerValue() 82 componentTag.writeTagAndLength(buf, obj.isConstructed(), obj.getBerValueLength()); in encodeBerValue() 83 obj.encodeBerValue(buf); in encodeBerValue() 85 componentTag.writeTagAndLength(buf, true, obj.getBerLength()); in encodeBerValue() 86 obj.encodeBer(buf); in encodeBerValue() 98 public void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument 101 while (buf.hasRemaining()) { in decodeBerValue() 102 int bufStartPos = buf.position(); in decodeBerValue() 103 int bufEndPos = buf.limit(); in decodeBerValue() [all …]
|
D | Asn1SequenceOf.java | 76 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument 78 component.encodeBer(buf); in encodeBerValue() 82 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument 83 while (buf.hasRemaining()) { in decodeBerValue() 84 Asn1Tag tag = Asn1Tag.readTag(buf); in decodeBerValue() 85 int valueLength = Asn1Tag.readLength(buf); in decodeBerValue() 91 checkTag(value.getDefaultTag(), Asn1Tag.readTag(buf)); in decodeBerValue() 92 valueLength = Asn1Tag.readLength(buf); in decodeBerValue() 97 ByteBuffer subBuf = ByteBuffer.wrap(buf.array(), buf.position(), valueLength); in decodeBerValue() 102 buf.position(buf.position() + valueLength); in decodeBerValue()
|
D | Asn1Boolean.java | 46 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument 47 buf.put(value ? (byte) 0xFF : (byte) 0x00); in encodeBerValue() 50 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument 51 if (buf.remaining() != 1) { in decodeBerValue() 52 throw new IllegalArgumentException("Invalid remaining bytes: " + buf.remaining()); in decodeBerValue() 54 value = (buf.get() != 0); in decodeBerValue()
|
D | Asn1Null.java | 44 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument 47 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument 48 if (buf.remaining() != 0) { in decodeBerValue() 49 throw new IllegalArgumentException("Invalid remaining bytes: " + buf.remaining()); in decodeBerValue()
|
/cts/hostsidetests/statsd/src/android/cts/statsd/atom/ |
D | BufferDebug.java | 43 public static String debugString(byte[] buf, int max) { in debugString() argument 44 if (buf == null) { in debugString() 47 if (buf.length == 0) { in debugString() 52 if (len <= 0 || len > buf.length) { in debugString() 53 max = len = buf.length; in debugString() 56 if (isPrintable(buf, len)) { in debugString() 57 return "\"" + new String(buf, 0, len, StandardCharsets.UTF_8) + "\"\n"; in debugString() 59 return toHex(buf, len, max); in debugString() 63 private static String toHex(byte[] buf, int len, int max) { in toHex() argument 69 writeRow(str, buf, row * WIDTH, WIDTH, max); in toHex() [all …]
|
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2018-9527/ |
D | poc.cpp | 46 static void makeBitReader(const void *data, size_t size, ogg_buffer *buf, in makeBitReader() argument 48 buf->data = (uint8_t *) data; in makeBitReader() 49 buf->size = size; in makeBitReader() 50 buf->refcount = REF_COUNT; in makeBitReader() 52 ref->buffer = buf; in makeBitReader() 58 ogg_buffer buf; in main() local 62 memset(&buf, 0, sizeof(ogg_buffer)); in main() 66 makeBitReader(packInfoData, sizeof(packInfoData), &buf, &ref, &bits); in main() 73 memset(&buf, 0, sizeof(ogg_buffer)); in main() 77 makeBitReader(unpackBookData, sizeof(unpackBookData), &buf, &ref, in main() [all …]
|
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2017-0814/ |
D | poc.cpp | 323 static void makeBitReader(const void *data, size_t size, ogg_buffer *buf, in makeBitReader() argument 325 buf->data = (uint8_t *)data; in makeBitReader() 326 buf->size = size; in makeBitReader() 327 buf->refcount = REF_COUNT; in makeBitReader() 329 ref->buffer = buf; in makeBitReader() 335 ogg_buffer buf; in main() local 339 memset(&buf, 0, sizeof(ogg_buffer)); in main() 343 makeBitReader(packInfoData, sizeof(packInfoData), &buf, &ref, &bits); in main() 350 memset(&buf, 0, sizeof(ogg_buffer)); in main() 354 makeBitReader(unpackBookData, sizeof(unpackBookData), &buf, &ref, &bits); in main() [all …]
|
/cts/tests/tests/content/src/android/content/res/cts/ |
D | AssetFileDescriptor_AutoCloseInputStreamTest.java | 90 byte[] buf = new byte[FILE_LENGTH]; in testReadBufferLen() 91 assertEquals(3, mInput.read(buf, 0, 3)); in testReadBufferLen() 92 assertEquals(3, mInput.read(buf, 3, 3)); in testReadBufferLen() 93 assertEquals(3, mInput.read(buf, 6, 4)); in testReadBufferLen() 94 MoreAsserts.assertEquals(FILE_DATA, buf); in testReadBufferLen() 95 assertEquals(FILE_END, mInput.read(buf, 0, 4)); in testReadBufferLen() 100 byte[] buf = new byte[6]; in testReadBuffer() 101 assertEquals(6, mInput.read(buf)); in testReadBuffer() 102 assertEquals(FILE_DATA[0], buf[0]); in testReadBuffer() 103 assertEquals(3, mInput.read(buf)); in testReadBuffer() [all …]
|
/cts/tests/tests/media/libmediandkjni/ |
D | md5_utils.cpp | 28 byteSwap(UWORD32 *buf, unsigned words) { in byteSwap() argument 37 p = (md5byte *)buf; in byteSwap() 40 *buf++ = (UWORD32)((unsigned)p[3] << 8 | p[2]) << 16 | in byteSwap() 52 ctx->buf[0] = 0x67452301; in MD5Init() 53 ctx->buf[1] = 0xefcdab89; in MD5Init() 54 ctx->buf[2] = 0x98badcfe; in MD5Init() 55 ctx->buf[3] = 0x10325476; in MD5Init() 66 MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len) { in MD5Update() argument 79 memcpy((md5byte *)ctx->in + 64 - t, buf, len); in MD5Update() 84 memcpy((md5byte *)ctx->in + 64 - t, buf, t); in MD5Update() [all …]
|
D | md5_utils.h | 35 UWORD32 buf[4]; member 41 void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len); 43 void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]);
|
/cts/tests/tests/secure_element/sample_applet/src/com/android/cts/omapi/test/ |
D | CtsAndroidOmapiTestApplet.java | 102 byte[] buf = apdu.getBuffer(); in process() 105 byte p1 = buf[ISO7816.OFFSET_P1]; in process() 106 byte p2 = buf[ISO7816.OFFSET_P2]; in process() 109 lc = buf[ISO7816.OFFSET_LC]; in process() 110 if (buf[(short)(lc + ISO7816.OFFSET_CDATA - 1)] == 0x31) { in process() 118 Util.arrayCopy(respBuf, (short)0, buf, (short)0, (short)respBuf.length); in process() 119 apdu.sendBytesLong(buf, respBuffOffset, sendLen); in process() 123 switch (buf[ISO7816.OFFSET_INS]) { in process() 134 Util.arrayCopy(respBuf, (short)0, buf, (short)0, (short)respBuf.length); in process() 135 apdu.sendBytesLong(buf, respBuffOffset, sendLen); in process() [all …]
|
/cts/tests/tests/net/native/dns/ |
D | NativeDnsAsyncTest.cpp | 37 int getAsyncResponse(int fd, int timeoutMs, int* rcode, uint8_t* buf, size_t bufLen) { in getAsyncResponse() argument 46 int n = android_res_nresult(fd, rcode, buf, bufLen); in getAsyncResponse() 57 std::vector<std::string> extractIpAddressAnswers(uint8_t* buf, size_t bufLen, int ipType) { in extractIpAddressAnswers() argument 59 if (ns_initparse((const uint8_t*) buf, bufLen, &handle) < 0) { in extractIpAddressAnswers() 80 uint8_t buf[MAXPACKET] = {}; in expectAnswersValid() local 81 int res = getAsyncResponse(fd, TIMEOUT_MS, &rcode, buf, MAXPACKET); in expectAnswersValid() 86 auto answers = extractIpAddressAnswers(buf, res, ipType); in expectAnswersValid() 97 uint8_t buf[MAXPACKET] = {}; in expectAnswersNotValid() local 98 int res = getAsyncResponse(fd, TIMEOUT_MS, &rcode, buf, MAXPACKET); in expectAnswersNotValid() 166 uint8_t buf[MAXPACKET] = {}; in TEST() local [all …]
|
/cts/tests/tests/security/jni/ |
D | android_security_cts_EncryptionTest.cpp | 49 uint8_t *buf; in android_security_cts_EncryptionTest_aesIsFast() local 64 buf = new (std::nothrow) uint8_t[TEST_BUFSIZE + in android_security_cts_EncryptionTest_aesIsFast() 67 if (!buf) { in android_security_cts_EncryptionTest_aesIsFast() 73 memset(buf, 0xF0, TEST_BUFSIZE); in android_security_cts_EncryptionTest_aesIsFast() 79 EVP_DecryptUpdate(&ctx, buf, &len, buf, TEST_BUFSIZE); in android_security_cts_EncryptionTest_aesIsFast() 84 delete[] buf; in android_security_cts_EncryptionTest_aesIsFast()
|
/cts/apps/VpnApp/src/com/android/cts/vpnfirewall/ |
D | PingReflector.java | 63 private void processPacket(byte[] buf, int version, int len, int hdrLen) throws IOException { in processPacket() argument 67 DataInputStream stream = new DataInputStream(new ByteArrayInputStream(buf)); in processPacket() 90 private void writePacket(byte[] buf) { in writePacket() argument 92 Os.write(mFd, buf, 0, buf.length); in writePacket() 98 private int readPacket(byte[] buf) { in readPacket() argument 100 return Os.read(mFd, buf, 0, buf.length); in readPacket()
|
/cts/common/device-side/util-axt/src/com/android/compatibility/common/util/ |
D | BroadcastUtils.java | 40 StringBuilder buf = new StringBuilder(); in toBundleString() local 42 buf.append("extras: "); in toBundleString() 44 buf.append("(" + s + " = " + bundle.get(s) + "), "); in toBundleString() 47 return buf.toString(); in toBundleString()
|
/cts/tests/tests/keystore/src/android/keystore/cts/ |
D | HexEncoding.java | 56 public static String encode(ByteBuffer buf) { in encode() argument 57 return encode(buf.array(), buf.arrayOffset() + buf.position(), buf.remaining()); in encode()
|
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2017-13273/ |
D | poc.c | 39 char buf[256]; in thread_entry() local 41 memset(buf, 0x0, 256); in thread_entry() 52 len = sprintf(buf, "d %lu", (unsigned long)0); in thread_entry() 55 len = sprintf(buf, "t %d", sock_fd); in thread_entry() 59 ret = write(ctrl_fd, buf, len); in thread_entry()
|
/cts/hostsidetests/cpptools/test-apps/ConnectorNativeProgram/ |
D | connector.cpp | 57 char buf[kBufferSize]; in main() local 58 memset(buf, 0, kBufferSize); in main() 59 ssize_t result = TEMP_FAILURE_RETRY(read(fd, buf, kBufferSize - 1)); in main() 61 printf("%s\n", buf); in main()
|
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2017-0670/ |
D | poc.c | 44 char buf[MAX_STRLEN]; in getMemoryUsage() local 46 memset(buf, 0, MAX_STRLEN); in getMemoryUsage() 53 while (fgets(buf, MAX_STRLEN, fpMem) != NULL) { in getMemoryUsage() 56 int numOfItemsRead = sscanf(buf, "%lx-%lx", &mem1, &mem2); in getMemoryUsage()
|