summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lib.c')
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index af837eed01..14817629aa 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_lib.c,v 1.48 2021/09/08 12:19:17 tb Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.49 2021/12/04 15:48:23 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1056,6 +1056,24 @@ BN_GENCB_free(BN_GENCB *cb)
1056 free(cb); 1056 free(cb);
1057} 1057}
1058 1058
1059/* Populate a BN_GENCB structure with an "old"-style callback */
1060void
1061BN_GENCB_set_old(BN_GENCB *gencb, void (*cb)(int, int, void *), void *cb_arg)
1062{
1063 gencb->ver = 1;
1064 gencb->cb.cb_1 = cb;
1065 gencb->arg = cb_arg;
1066}
1067
1068/* Populate a BN_GENCB structure with a "new"-style callback */
1069void
1070BN_GENCB_set(BN_GENCB *gencb, int (*cb)(int, int, BN_GENCB *), void *cb_arg)
1071{
1072 gencb->ver = 2;
1073 gencb->cb.cb_2 = cb;
1074 gencb->arg = cb_arg;
1075}
1076
1059void * 1077void *
1060BN_GENCB_get_arg(BN_GENCB *cb) 1078BN_GENCB_get_arg(BN_GENCB *cb)
1061{ 1079{