Home | History | Annotate | Download | only in keystore

Lines Matching defs:in

5  * you may not use this file except in compliance with the License.
10 * Unless required by applicable law or agreed to in writing, software
65 /* KeyStore is a secured storage for key-value pairs. In this implementation,
66 * each file stores one key-value pair. Keys are encoded in file names, and
117 ALOGE("could not open keymaster device in %s (%s)",
219 * Returns the app ID (in the Android multi-user sense) for the current
227 * Returns the user ID (in the Android multi-user sense) for the current
279 * when WiFi can operate in its own namespace.
293 * Returns true if the callingUid is allowed to interact in the targetUid's
310 * the keys in any way (e.g., signing).
316 /* Here is the encoding of keys. This is necessary in order to allow arbitrary
317 * characters in keys. Characters in [0-~] are not encoded. Others are encoded
320 * [0-o]. Therefore in the worst case the length of a key gets doubled. Note
324 const uint8_t* in = reinterpret_cast<const uint8_t*>(keyName.string());
326 for (int i = length; i > 0; --i, ++in) {
327 if (*in < '0' || *in > '~') {
335 const uint8_t* in = reinterpret_cast<const uint8_t*>(keyName.string());
337 for (int i = length; i > 0; --i, ++in, ++out) {
338 if (*in < '0' || *in > '~') {
339 *out = '+' + (*in >> 6);
340 *++out = '0' + (*in & 0x3F);
343 *out = *in;
356 static size_t decode_key_length(const char* in, size_t length) {
359 for (const char* end = in + length; in < end; in++) {
361 if (*in < '0' || *in > '~') {
370 static void decode_key(char* out, const char* in, size_t length) {
371 for (const char* end = in + length; in < end; in++) {
372 if (*in < '0' || *in > '~') {
374 if (in + 1 >= end) {
378 *out = (*in++ - '+') << 6;
379 *out++ |= (*in - '0') & 0x3F;
381 *out++ = *in;
441 /* Here is the file format. There are two parts in blob.value, the secret and
442 * the description. The secret is stored in ciphertext, and its original size
443 * can be found in blob.length. The description is stored after the secret in
444 * plaintext, and its size is specified in blob.info. The total size of the two
473 int32_t length; // in network byte order when encrypted
637 int in = TEMP_FAILURE_RETRY(open(filename, O_RDONLY));
638 if (in < 0) {
641 // fileLength may be less than sizeof(mBlob) since the in
644 size_t fileLength = readFully(in, (uint8_t*) &mBlob, sizeof(mBlob));
645 if (close(in) != 0) {
792 int in = TEMP_FAILURE_RETRY(open(mMasterKeyFile, O_RDONLY));
793 if (in < 0) {
800 size_t length = readFully(in, (uint8_t*) &rawBlob, sizeof(rawBlob));
801 if (close(in) != 0) {
1476 int in = TEMP_FAILURE_RETRY(open(sMetaDataFile, O_RDONLY));
1477 if (in < 0) {
1480 size_t fileLength = readFully(in, (uint8_t*) &mMetaData, sizeof(mMetaData));
1485 close(in);
1522 // Initialize again in case we had a key.
1643 ALOGD("calling get in state: %d", state);
1782 ALOGD("calling lock in state: %d", state);
1836 ALOGW("calling generate in state: %d", state);
1988 ALOGD("calling import in state: %d", state);
2060 ALOGD("calling verify in state: %d", state);
2102 * TODO: The abstraction between things stored in hardware and regular blobs
2185 ALOGD("calling grant in state: %d", state);
2210 ALOGD("calling ungrant in state: %d", state);
2268 ALOGD("calling duplicate in state: %d", state);
2388 // Initialise user keystore with existing master key held in-memory
2512 * We're the only thread in existence, so we're just going to process