summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rsa/rsa_meth.c
diff options
context:
space:
mode:
authordjm <>2018-09-12 06:35:38 +0000
committerdjm <>2018-09-12 06:35:38 +0000
commit8862867fd25d4b58970fbba6b27ed2a36347500d (patch)
treeaaeca881a5b92a89a54597eeb5aacdbd9d58fe30 /src/lib/libcrypto/rsa/rsa_meth.c
parent55621332fb7374cfcfccae0561ed84e62513e575 (diff)
downloadopenbsd-8862867fd25d4b58970fbba6b27ed2a36347500d.tar.gz
openbsd-8862867fd25d4b58970fbba6b27ed2a36347500d.tar.bz2
openbsd-8862867fd25d4b58970fbba6b27ed2a36347500d.zip
Add some accessor functions:
RSA_meth_get_finish() RSA_meth_set1_name() EVP_CIPHER_CTX_(get|set)_iv() feedback and ok jsing@ tb@
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_meth.c')
-rw-r--r--src/lib/libcrypto/rsa/rsa_meth.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_meth.c b/src/lib/libcrypto/rsa/rsa_meth.c
index 0e52799a38..ae613cc65c 100644
--- a/src/lib/libcrypto/rsa/rsa_meth.c
+++ b/src/lib/libcrypto/rsa/rsa_meth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_meth.c,v 1.1 2018/03/17 15:12:56 tb Exp $ */ 1/* $OpenBSD: rsa_meth.c,v 1.2 2018/09/12 06:35:38 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2018 Theo Buehler <tb@openbsd.org>
4 * 4 *
@@ -63,6 +63,24 @@ RSA_meth_dup(const RSA_METHOD *meth)
63} 63}
64 64
65int 65int
66RSA_meth_set1_name(RSA_METHOD *meth, const char *name)
67{
68 char *copy;
69
70 if ((copy = strdup(name)) == NULL)
71 return 0;
72 free((char *)meth->name);
73 meth->name = copy;
74 return 1;
75}
76
77int
78(*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa)
79{
80 return meth->finish;
81}
82
83int
66RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc)(int flen, 84RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc)(int flen,
67 const unsigned char *from, unsigned char *to, RSA *rsa, int padding)) 85 const unsigned char *from, unsigned char *to, RSA *rsa, int padding))
68{ 86{