|
| 1 | +/* |
| 2 | + * Copyright (c) 2015-2017, 2019-2020, Pelion and affiliates. |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | +#ifndef MBEDTLS_STUB_H |
| 18 | +#define MBEDTLS_STUB_H |
| 19 | + |
| 20 | +#define MBEDTLS_SSL_EXPORT_KEYS |
| 21 | + |
| 22 | +#include <inttypes.h> |
| 23 | +#include <stdbool.h> |
| 24 | +#include "mbedtls/platform.h" |
| 25 | +#include "mbedtls/ssl.h" |
| 26 | +#include "mbedtls/ctr_drbg.h" |
| 27 | +#include "mbedtls/hmac_drbg.h" |
| 28 | +#include "mbedtls/x509_crt.h" |
| 29 | +#include "mbedtls/sha256.h" |
| 30 | +#include "mbedtls/entropy.h" |
| 31 | +#include "mbedtls/pk.h" |
| 32 | +#include "mbedtls/platform.h" |
| 33 | +#include "mbedtls/md.h" |
| 34 | + |
| 35 | + |
| 36 | +#define HANDSHAKE_FINISHED_VALUE 8888 |
| 37 | +#define HANDSHAKE_FINISHED_VALUE_RETURN_ZERO 8889 |
| 38 | + |
| 39 | +typedef struct { |
| 40 | + int crt_expected_int; |
| 41 | + bool useCounter; |
| 42 | + int counter; |
| 43 | + int retArray[20]; |
| 44 | + int expected_int; |
| 45 | + uint32_t uint32_value; |
| 46 | + bool invalidate_timer; |
| 47 | + void *cookie_obj; |
| 48 | + unsigned char cookie_value[8]; |
| 49 | + size_t cookie_len; |
| 50 | +} mbedtls_stub_def; |
| 51 | + |
| 52 | +extern mbedtls_stub_def mbedtls_stub; |
| 53 | + |
| 54 | +#endif // MBEDTLS_STUB_H |
0 commit comments