/*1* Copyright (c) 2018 Yubico AB. All rights reserved.2* Use of this source code is governed by a BSD-style3* license that can be found in the LICENSE file.4* SPDX-License-Identifier: BSD-2-Clause5*/67#include "fido.h"89int10fido_buf_read(const unsigned char **buf, size_t *len, void *dst, size_t count)11{12if (count > *len)13return (-1);1415memcpy(dst, *buf, count);16*buf += count;17*len -= count;1819return (0);20}2122int23fido_buf_write(unsigned char **buf, size_t *len, const void *src, size_t count)24{25if (count > *len)26return (-1);2728memcpy(*buf, src, count);29*buf += count;30*len -= count;3132return (0);33}343536