blob: 61d4f3f494f1f9f17a62fce545cbf22702822595 [file] [log] [blame]
David Brown902d6172017-05-05 09:37:41 -06001/*
2 * Copyright (c) 2017 Linaro Limited
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <bootutil/caps.h>
18
19uint32_t bootutil_get_caps(void)
20{
21 uint32_t res = 0;
22
Fabio Utzig3488eef2017-06-12 10:25:43 -030023#if defined(MCUBOOT_SIGN_RSA)
David Brown902d6172017-05-05 09:37:41 -060024 res |= BOOTUTIL_CAP_RSA2048;
25#endif
Fabio Utzig3488eef2017-06-12 10:25:43 -030026#if defined(MCUBOOT_SIGN_EC)
David Brown902d6172017-05-05 09:37:41 -060027 res |= BOOTUTIL_CAP_ECDSA_P224;
28#endif
Fabio Utzig3488eef2017-06-12 10:25:43 -030029#if defined(MCUBOOT_SIGN_EC256)
David Brown902d6172017-05-05 09:37:41 -060030 res |= BOOTUTIL_CAP_ECDSA_P256;
31#endif
Fabio Utzig3488eef2017-06-12 10:25:43 -030032#if defined(MCUBOOT_OVERWRITE_ONLY)
David Brown902d6172017-05-05 09:37:41 -060033 res |= BOOTUTIL_CAP_OVERWRITE_UPGRADE;
34#else
35 res |= BOOTUTIL_CAP_SWAP_UPGRADE;
36#endif
37
38 return res;
39}