aboutsummaryrefslogtreecommitdiff
path: root/third_party/libuweave/src/macaroon_context.h
blob: c230eb7b5ff074e4d11483b38f77b7e2e654bd74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2015 The Weave Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef LIBUWEAVE_SRC_MACAROON_CONTEXT_
#define LIBUWEAVE_SRC_MACAROON_CONTEXT_

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

#include "src/macaroon_caveat.h"

typedef struct {
  uint32_t current_time;  // In number of seconds since Jan 1st 2000 00:00:00
  const uint8_t* ble_session_id;  // Only for BLE
  size_t ble_session_id_len;
} UwMacaroonContext;

bool uw_macaroon_context_create_(uint32_t current_time,
                                 const uint8_t* ble_session_id,
                                 size_t ble_session_id_len,
                                 UwMacaroonContext* new_context);

#endif  // LIBUWEAVE_SRC_MACAROON_CONTEXT_