| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_ | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_ |
| 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_ | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 */ | 50 */ |
| 51 | 51 |
| 52 struct NaClValidationCache { | 52 struct NaClValidationCache { |
| 53 void *handle; | 53 void *handle; |
| 54 void *(*CreateQuery)(void *handle); | 54 void *(*CreateQuery)(void *handle); |
| 55 void (*AddData)(void *query, const unsigned char *data, size_t length); | 55 void (*AddData)(void *query, const unsigned char *data, size_t length); |
| 56 int (*QueryKnownToValidate)(void *query); | 56 int (*QueryKnownToValidate)(void *query); |
| 57 void (*SetKnownToValidate)(void *query); | 57 void (*SetKnownToValidate)(void *query); |
| 58 void (*DestroyQuery)(void *query); | 58 void (*DestroyQuery)(void *query); |
| 59 int (*CachingIsInexpensive)(const struct NaClValidationMetadata *metadata); | 59 int (*CachingIsInexpensive)(const struct NaClValidationMetadata *metadata); |
| 60 int (*ResolveFileNonce)(void *handle, uint64_t nonce, int32_t *fd, |
| 61 char **file_path, uint32_t *file_path_length); |
| 60 }; | 62 }; |
| 61 | 63 |
| 62 extern int CachingIsInexpensive(struct NaClValidationCache *cache, | 64 extern int CachingIsInexpensive(struct NaClValidationCache *cache, |
| 63 const struct NaClValidationMetadata *metadata); | 65 const struct NaClValidationMetadata *metadata); |
| 64 | 66 |
| 65 /* Helper function for identifying the code being validated. */ | 67 /* Helper function for identifying the code being validated. */ |
| 66 extern void AddCodeIdentity(uint8_t *data, | 68 extern void AddCodeIdentity(uint8_t *data, |
| 67 size_t size, | 69 size_t size, |
| 68 const struct NaClValidationMetadata *metadata, | 70 const struct NaClValidationMetadata *metadata, |
| 69 struct NaClValidationCache *cache, | 71 struct NaClValidationCache *cache, |
| 70 void *query); | 72 void *query); |
| 71 | 73 |
| 72 EXTERN_C_END | 74 EXTERN_C_END |
| 73 | 75 |
| 74 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_ */ | 76 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_VALIDATION_CACHE_H_ */ |
| OLD | NEW |