|
| 1 | +/* |
| 2 | + * SPDX-License-Identifier: Apache-2.0 |
| 3 | + * |
| 4 | + * Copyright (c) 2016-2019 Linaro LTD |
| 5 | + * Copyright (c) 2016-2019 JUUL Labs |
| 6 | + * Copyright (c) 2019-2023 Arm Limited |
| 7 | + * Copyright (c) 2023 Nordic Semiconductor ASA |
| 8 | + * |
| 9 | + * Original license: |
| 10 | + * |
| 11 | + * Licensed to the Apache Software Foundation (ASF) under one |
| 12 | + * or more contributor license agreements. See the NOTICE file |
| 13 | + * distributed with this work for additional information |
| 14 | + * regarding copyright ownership. The ASF licenses this file |
| 15 | + * to you under the Apache License, Version 2.0 (the |
| 16 | + * "License"); you may not use this file except in compliance |
| 17 | + * with the License. You may obtain a copy of the License at |
| 18 | + * |
| 19 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 20 | + * |
| 21 | + * Unless required by applicable law or agreed to in writing, |
| 22 | + * software distributed under the License is distributed on an |
| 23 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 24 | + * KIND, either express or implied. See the License for the |
| 25 | + * specific language governing permissions and limitations |
| 26 | + * under the License. |
| 27 | + */ |
| 28 | + |
| 29 | +#ifndef H_IMAGE_API_PRIV_ |
| 30 | +#define H_IMAGE_API_PRIV_ |
| 31 | + |
| 32 | +#include <inttypes.h> |
| 33 | +#include <stdbool.h> |
| 34 | +#include <bootutil/image.h> |
| 35 | +#include <bootutil/fault_injection_hardening.h> |
| 36 | + |
| 37 | +#ifdef __cplusplus |
| 38 | +extern "C" { |
| 39 | +#endif |
| 40 | + |
| 41 | +struct enc_key_data; |
| 42 | +fih_ret bootutil_img_validate(struct enc_key_data *enc_state, int image_index, |
| 43 | + struct image_header *hdr, |
| 44 | + const struct flash_area *fap, |
| 45 | + uint8_t *tmp_buf, uint32_t tmp_buf_sz, |
| 46 | + uint8_t *seed, int seed_len, uint8_t *out_hash); |
| 47 | + |
| 48 | +int bootutil_tlv_iter_begin(struct image_tlv_iter *it, |
| 49 | + const struct image_header *hdr, |
| 50 | + const struct flash_area *fap, uint16_t type, |
| 51 | + bool prot); |
| 52 | +int bootutil_tlv_iter_next(struct image_tlv_iter *it, uint32_t *off, |
| 53 | + uint16_t *len, uint16_t *type); |
| 54 | + |
| 55 | +int32_t bootutil_get_img_security_cnt(struct image_header *hdr, |
| 56 | + const struct flash_area *fap, |
| 57 | + uint32_t *security_cnt); |
| 58 | + |
| 59 | +#ifdef __cplusplus |
| 60 | +} |
| 61 | +#endif |
| 62 | + |
| 63 | +#endif |
0 commit comments