summaryrefslogtreecommitdiff
path: root/bufbn.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2018-07-09 21:56:06 +0000
committerDamien Miller <djm@mindrot.org>2018-07-10 16:44:17 +1000
commitcb30cd47041edb03476be1c8ef7bc1f4b69d1555 (patch)
treeb6bd48d3ab741d48bbba182dcce30654286c8627 /bufbn.c
parent235c7c4e3bf046982c2d8242f30aacffa01073d1 (diff)
upstream: remove legacy buffer API emulation layer; ok djm@
OpenBSD-Commit-ID: 2dd5dc17cbc23195be4299fa93be2707a0e08ad9
Diffstat (limited to 'bufbn.c')
-rw-r--r--bufbn.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/bufbn.c b/bufbn.c
deleted file mode 100644
index 98f9466bc..000000000
--- a/bufbn.c
+++ /dev/null
@@ -1,69 +0,0 @@
1/* $OpenBSD: bufbn.c,v 1.13 2017/04/30 23:23:54 djm Exp $ */
2
3/*
4 * Copyright (c) 2012 Damien Miller <djm@mindrot.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19/* Emulation wrappers for legacy OpenSSH buffer API atop sshbuf */
20
21#include "includes.h"
22
23#ifdef WITH_OPENSSL
24
25#include <sys/types.h>
26
27#include "buffer.h"
28#include "log.h"
29#include "ssherr.h"
30
31int
32buffer_put_bignum2_ret(Buffer *buffer, const BIGNUM *value)
33{
34 int ret;
35
36 if ((ret = sshbuf_put_bignum2(buffer, value)) != 0) {
37 error("%s: %s", __func__, ssh_err(ret));
38 return -1;
39 }
40 return 0;
41}
42
43void
44buffer_put_bignum2(Buffer *buffer, const BIGNUM *value)
45{
46 if (buffer_put_bignum2_ret(buffer, value) == -1)
47 fatal("%s: buffer error", __func__);
48}
49
50int
51buffer_get_bignum2_ret(Buffer *buffer, BIGNUM *value)
52{
53 int ret;
54
55 if ((ret = sshbuf_get_bignum2(buffer, value)) != 0) {
56 error("%s: %s", __func__, ssh_err(ret));
57 return -1;
58 }
59 return 0;
60}
61
62void
63buffer_get_bignum2(Buffer *buffer, BIGNUM *value)
64{
65 if (buffer_get_bignum2_ret(buffer, value) == -1)
66 fatal("%s: buffer error", __func__);
67}
68
69#endif /* WITH_OPENSSL */