Contiki-NG
Loading...
Searching...
No Matches
edhoc-cred-rfc9529.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024, RISE Research Institutes of Sweden AB
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30/**
31 * \file
32 * RFC 9529 Test Credentials for EDHOC
33 *
34 * This header contains the test credentials from RFC 9529 for
35 * EDHOC protocol testing. These are publicly known credentials
36 * and MUST NOT be used in production systems.
37 *
38 * The credentials support Method 3 (Static Diffie-Hellman) authentication.
39 */
40
41#ifndef EDHOC_CRED_RFC9529_H_
42#define EDHOC_CRED_RFC9529_H_
43
44#include "edhoc-key-storage.h"
45#include <string.h>
46
47/*---------------------------------------------------------------------------*/
48/* RFC 9529 Test Credentials - Method 3 (Static Diffie-Hellman) */
49/*---------------------------------------------------------------------------*/
50
51/**
52 * RFC 9529 Static Diffie-Hellman Client Authentication Key
53 */
55 /* Pointer to next key in linked list */
56 .next = NULL,
57 /* Key Identifier array */
58 .kid = { 0x2b },
59 /* Key Identifier size */
60 .kid_sz = 1,
61 /* Subject identity string */
62 .identity = { "42-50-31-FF-EF-37-32-39" },
63 /* Subject identity size */
64 .identity_sz = strlen("42-50-31-FF-EF-37-32-39"),
65 /* Key type (2 = EC2) */
66 .kty = 2,
67 /* Curve identifier (1 = P-256) */
68 .crv = 1,
69 /* ECC key data */
70 .ecc = {
71 /* Private key bytes */
72 .priv = { 0xfb, 0x13, 0xad, 0xeb, 0x65, 0x18, 0xce, 0xe5, 0xf8, 0x84, 0x17, 0x66, 0x08, 0x41, 0x14, 0x2e,
73 0x83, 0x0a, 0x81, 0xfe, 0x33, 0x43, 0x80, 0xa9, 0x53, 0x40, 0x6a, 0x13, 0x05, 0xe8, 0x70, 0x6b },
74 /* Public key point */
75 .pub = {
76 /* Public key X coordinate */
77 .x = { 0xac, 0x75, 0xe9, 0xec, 0xe3, 0xe5, 0x0b, 0xfc, 0x8e, 0xd6, 0x03, 0x99, 0x88, 0x95, 0x22, 0x40,
78 0x5c, 0x47, 0xbf, 0x16, 0xdf, 0x96, 0x66, 0x0a, 0x41, 0x29, 0x8c, 0xb4, 0x30, 0x7f, 0x7e, 0xb6 },
79 /* Public key Y coordinate */
80 .y = { 0x6e, 0x5d, 0xe6, 0x11, 0x38, 0x8a, 0x4b, 0x8a, 0x82, 0x11, 0x33, 0x4a, 0xc7, 0xd3, 0x7e, 0xcb,
81 0x52, 0xa3, 0x87, 0xd2, 0x57, 0xe6, 0xdb, 0x3c, 0x2a, 0x93, 0xdf, 0x21, 0xff, 0x3a, 0xff, 0xc8 }
82 }
83 }
84};
85
86/**
87 * RFC 9529 Static Diffie-Hellman Server Authentication Key
88 */
90 /* Pointer to next key in linked list */
91 .next = NULL,
92 /* Key Identifier array */
93 .kid = { 0x32 },
94 /* Key Identifier size */
95 .kid_sz = 1,
96 /* Subject identity string */
97 .identity = { "example.edu" },
98 /* Subject identity size */
99 .identity_sz = strlen("example.edu"),
100 /* Key type (2 = EC2) */
101 .kty = 2,
102 /* Curve identifier (1 = P-256) */
103 .crv = 1,
104 /* ECC key data */
105 .ecc = {
106 /* Private key bytes */
107 .priv = { 0x72, 0xcc, 0x47, 0x61, 0xdb, 0xd4, 0xc7, 0x8f, 0x75, 0x89, 0x31, 0xaa, 0x58, 0x9d, 0x34, 0x8d,
108 0x1e, 0xf8, 0x74, 0xa7, 0xe3, 0x03, 0xed, 0xe2, 0xf1, 0x40, 0xdc, 0xf3, 0xe6, 0xaa, 0x4a, 0xac },
109 /* Public key point */
110 .pub = {
111 /* Public key X coordinate */
112 .x = { 0xbb, 0xc3, 0x49, 0x60, 0x52, 0x6e, 0xa4, 0xd3, 0x2e, 0x94, 0x0c, 0xad, 0x2a, 0x23, 0x41, 0x48,
113 0xdd, 0xc2, 0x17, 0x91, 0xa1, 0x2a, 0xfb, 0xcb, 0xac, 0x93, 0x62, 0x20, 0x46, 0xdd, 0x44, 0xf0 },
114 /* Public key Y coordinate */
115 .y = { 0x45, 0x19, 0xe2, 0x57, 0x23, 0x6b, 0x2a, 0x0c, 0xe2, 0x02, 0x3f, 0x09, 0x31, 0xf1, 0xf3, 0x86,
116 0xca, 0x7a, 0xfd, 0xa6, 0x4f, 0xcd, 0xe0, 0x10, 0x8c, 0x22, 0x4c, 0x51, 0xea, 0xbf, 0x60, 0x72 }
117 }
118 }
119};
120
121#endif /* EDHOC_CRED_RFC9529_H_ */
static const cose_key_t auth_rfc9529_static_dh_server
RFC 9529 Static Diffie-Hellman Server Authentication Key.
static const cose_key_t auth_rfc9529_static_dh_client
RFC 9529 Static Diffie-Hellman Client Authentication Key.
EDHOC key storage - Implementation of key storage for managing DH-static authentication key pairs.
struct cose_key cose_key_t
KEY length in bytes.