diff options
Diffstat (limited to 'src/lib/libcrypto/rsa')
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa.h | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa_meth.c | 20 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/lib/libcrypto/rsa/rsa.h b/src/lib/libcrypto/rsa/rsa.h index 23929aafb9..d2df1a92d3 100644 --- a/src/lib/libcrypto/rsa/rsa.h +++ b/src/lib/libcrypto/rsa/rsa.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rsa.h,v 1.38 2018/03/17 15:12:56 tb Exp $ */ | 1 | /* $OpenBSD: rsa.h,v 1.39 2018/09/12 06:35:38 djm 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 | * |
| @@ -433,10 +433,12 @@ RSA *RSAPrivateKey_dup(RSA *rsa); | |||
| 433 | RSA_METHOD *RSA_meth_new(const char *name, int flags); | 433 | RSA_METHOD *RSA_meth_new(const char *name, int flags); |
| 434 | void RSA_meth_free(RSA_METHOD *meth); | 434 | void RSA_meth_free(RSA_METHOD *meth); |
| 435 | RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); | 435 | RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); |
| 436 | int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); | ||
| 436 | int RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc)(int flen, | 437 | int RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc)(int flen, |
| 437 | const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); | 438 | const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); |
| 438 | int RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec)(int flen, | 439 | int RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec)(int flen, |
| 439 | const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); | 440 | const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); |
| 441 | int (*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa); | ||
| 440 | int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish)(RSA *rsa)); | 442 | int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish)(RSA *rsa)); |
| 441 | 443 | ||
| 442 | /* BEGIN ERROR CODES */ | 444 | /* BEGIN ERROR CODES */ |
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 | ||
| 65 | int | 65 | int |
| 66 | RSA_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 | |||
| 77 | int | ||
| 78 | (*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa) | ||
| 79 | { | ||
| 80 | return meth->finish; | ||
| 81 | } | ||
| 82 | |||
| 83 | int | ||
| 66 | RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc)(int flen, | 84 | RSA_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 | { |
