diff options
author | 2019-06-05 15:41:33 +0000 | |
---|---|---|
committer | 2019-06-05 15:41:33 +0000 | |
commit | bd3f6f9a6aa46af4fac556c8ddd93ba6fe57ee47 (patch) | |
tree | dcb2ed7250f798aa2d166179d3d76d14f47c21eb | |
parent | Remove workaround and return EINVAL when userland sends routing messages (diff) | |
download | wireguard-openbsd-bd3f6f9a6aa46af4fac556c8ddd93ba6fe57ee47.tar.xz wireguard-openbsd-bd3f6f9a6aa46af4fac556c8ddd93ba6fe57ee47.zip |
provide getters and setters for the RSA_METHOD interface
ok tb@, jsing@, sthen@
-rw-r--r-- | distrib/sets/lists/base/mi | 8 | ||||
-rw-r--r-- | lib/libcrypto/Symbols.list | 23 | ||||
-rw-r--r-- | lib/libcrypto/rsa/rsa.h | 49 | ||||
-rw-r--r-- | lib/libcrypto/rsa/rsa_meth.c | 173 | ||||
-rw-r--r-- | lib/libcrypto/shlib_version | 2 | ||||
-rw-r--r-- | lib/libssl/shlib_version | 2 | ||||
-rw-r--r-- | lib/libtls/shlib_version | 2 |
7 files changed, 250 insertions, 9 deletions
diff --git a/distrib/sets/lists/base/mi b/distrib/sets/lists/base/mi index e31ff53b1bf..8c6335c169d 100644 --- a/distrib/sets/lists/base/mi +++ b/distrib/sets/lists/base/mi @@ -623,7 +623,7 @@ ./usr/include ./usr/lib ./usr/lib/libc.so.95.1 -./usr/lib/libcrypto.so.45.4 +./usr/lib/libcrypto.so.45.5 ./usr/lib/libcurses.so.14.0 ./usr/lib/libedit.so.5.2 ./usr/lib/libelf.so.2.0 @@ -650,10 +650,10 @@ ./usr/lib/librpcsvc.so.2.0 ./usr/lib/libskey.so.6.0 ./usr/lib/libsndio.so.7.0 -./usr/lib/libssl.so.47.5 +./usr/lib/libssl.so.47.6 ./usr/lib/libtermcap.so.14.0 ./usr/lib/libtermlib.so.14.0 -./usr/lib/libtls.so.19.6 +./usr/lib/libtls.so.19.7 ./usr/lib/libusbhid.so.7.0 ./usr/lib/libutil.so.13.1 ./usr/lib/libz.so.5.0 @@ -2822,7 +2822,7 @@ ./usr/share/relink/usr ./usr/share/relink/usr/lib ./usr/share/relink/usr/lib/libc.so.95.1.a -./usr/share/relink/usr/lib/libcrypto.so.45.4.a +./usr/share/relink/usr/lib/libcrypto.so.45.5.a ./usr/share/relink/usr/libexec ./usr/share/relink/usr/libexec/ld.so.a ./usr/share/snmp diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index 9a8eacc8e3b..e56bb9ca5ca 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -2313,12 +2313,35 @@ RSA_get_ex_new_index RSA_get_method RSA_meth_dup RSA_meth_free +RSA_meth_get0_app_data +RSA_meth_get0_name +RSA_meth_get_bn_mod_exp RSA_meth_get_finish +RSA_meth_get_flags +RSA_meth_get_init +RSA_meth_get_keygen +RSA_meth_get_mod_exp +RSA_meth_get_priv_dec +RSA_meth_get_priv_enc +RSA_meth_get_pub_dec +RSA_meth_get_pub_enc +RSA_meth_get_sign +RSA_meth_get_verify RSA_meth_new +RSA_meth_set0_app_data RSA_meth_set1_name +RSA_meth_set_bn_mod_exp RSA_meth_set_finish +RSA_meth_set_flags +RSA_meth_set_init +RSA_meth_set_keygen +RSA_meth_set_mod_exp RSA_meth_set_priv_dec RSA_meth_set_priv_enc +RSA_meth_set_pub_dec +RSA_meth_set_pub_enc +RSA_meth_set_sign +RSA_meth_set_verify RSA_new RSA_new_method RSA_padding_add_PKCS1_OAEP diff --git a/lib/libcrypto/rsa/rsa.h b/lib/libcrypto/rsa/rsa.h index d2df1a92d38..2aa472f5015 100644 --- a/lib/libcrypto/rsa/rsa.h +++ b/lib/libcrypto/rsa/rsa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa.h,v 1.39 2018/09/12 06:35:38 djm Exp $ */ +/* $OpenBSD: rsa.h,v 1.40 2019/06/05 15:41:33 gilles Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -440,6 +440,53 @@ int RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec)(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); int (*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa); int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish)(RSA *rsa)); +int RSA_meth_set_pub_enc(RSA_METHOD *meth, int (*pub_enc)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); +int RSA_meth_set_pub_dec(RSA_METHOD *meth, int (*pub_dec)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); +int RSA_meth_set_mod_exp(RSA_METHOD *meth, int (*mod_exp)(BIGNUM *r0, + const BIGNUM *i, RSA *rsa, BN_CTX *ctx)); +int RSA_meth_set_bn_mod_exp(RSA_METHOD *meth, int (*bn_mod_exp)(BIGNUM *r, + const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *m_ctx)); +int RSA_meth_set_init(RSA_METHOD *meth, int (*init)(RSA *rsa)); +int RSA_meth_set_keygen(RSA_METHOD *meth, int (*keygen)(RSA *rsa, int bits, + BIGNUM *e, BN_GENCB *cb)); +int RSA_meth_set_flags(RSA_METHOD *meth, int flags); +int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data); +const char *RSA_meth_get0_name(const RSA_METHOD *); +int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding); +int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding); +int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding); +int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding); +int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth))(BIGNUM *r0, const BIGNUM *i, + RSA *rsa, BN_CTX *ctx); +int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth))(BIGNUM *r, + const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *m_ctx); +int (*RSA_meth_get_init(const RSA_METHOD *meth))(RSA *rsa); +int (*RSA_meth_get_keygen(const RSA_METHOD *meth))(RSA *rsa, int bits, BIGNUM *e, + BN_GENCB *cb); +int RSA_meth_get_flags(const RSA_METHOD *meth); +void *RSA_meth_get0_app_data(const RSA_METHOD *meth); +int (*RSA_meth_get_sign(const RSA_METHOD *meth))(int type, + const unsigned char *m, unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, + const RSA *rsa); +int RSA_meth_set_sign(RSA_METHOD *rsa, int (*sign)(int type, + const unsigned char *m, unsigned int m_length, unsigned char *sigret, + unsigned int *siglen, const RSA *rsa)); +int (*RSA_meth_get_verify(const RSA_METHOD *meth))(int dtype, + const unsigned char *m, unsigned int m_length, const unsigned char *sigbuf, + unsigned int siglen, const RSA *rsa); +int RSA_meth_set_verify(RSA_METHOD *rsa, int (*verify)(int dtype, + const unsigned char *m, unsigned int m_length, const unsigned char *sigbuf, + unsigned int siglen, const RSA *rsa)); + /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes diff --git a/lib/libcrypto/rsa/rsa_meth.c b/lib/libcrypto/rsa/rsa_meth.c index ae613cc65c5..095368b0cf1 100644 --- a/lib/libcrypto/rsa/rsa_meth.c +++ b/lib/libcrypto/rsa/rsa_meth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_meth.c,v 1.2 2018/09/12 06:35:38 djm Exp $ */ +/* $OpenBSD: rsa_meth.c,v 1.3 2019/06/05 15:41:33 gilles Exp $ */ /* * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> * @@ -102,3 +102,174 @@ RSA_meth_set_finish(RSA_METHOD *meth, int (*finish)(RSA *rsa)) meth->finish = finish; return 1; } + +int +RSA_meth_set_pub_enc(RSA_METHOD *meth, int (*pub_enc)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)) +{ + meth->rsa_pub_enc = pub_enc; + return 1; +} + +int +RSA_meth_set_pub_dec(RSA_METHOD *meth, int (*pub_dec)(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding)) +{ + meth->rsa_pub_dec = pub_dec; + return 1; +} + +int +RSA_meth_set_mod_exp(RSA_METHOD *meth, int (*mod_exp)(BIGNUM *r0, + const BIGNUM *i, RSA *rsa, BN_CTX *ctx)) +{ + meth->rsa_mod_exp = mod_exp; + return 1; +} + +int +RSA_meth_set_bn_mod_exp(RSA_METHOD *meth, int (*bn_mod_exp)(BIGNUM *r, + const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *m_ctx)) +{ + meth->bn_mod_exp = bn_mod_exp; + return 1; +} + +int +RSA_meth_set_init(RSA_METHOD *meth, int (*init)(RSA *rsa)) +{ + meth->init = init; + return 1; +} + +int +RSA_meth_set_keygen(RSA_METHOD *meth, int (*keygen)(RSA *rsa, int bits, + BIGNUM *e, BN_GENCB *cb)) +{ + meth->rsa_keygen = keygen; + return 1; +} + +int +RSA_meth_set_flags(RSA_METHOD *meth, int flags) +{ + meth->flags = flags; + return 1; +} + +int +RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data) +{ + meth->app_data = app_data; + return 1; +} + +const char * +RSA_meth_get0_name(const RSA_METHOD *meth) +{ + return meth->name; +} + +int +(*RSA_meth_get_pub_enc(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding) +{ + return meth->rsa_pub_enc; +} + +int +(*RSA_meth_get_pub_dec(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding) +{ + return meth->rsa_pub_dec; +} + +int +(*RSA_meth_get_priv_enc(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding) +{ + return meth->rsa_priv_enc; +} + +int +(*RSA_meth_get_priv_dec(const RSA_METHOD *meth))(int flen, + const unsigned char *from, unsigned char *to, RSA *rsa, int padding) +{ + return meth->rsa_priv_dec; +} + +int +(*RSA_meth_get_mod_exp(const RSA_METHOD *meth))(BIGNUM *r0, const BIGNUM *i, + RSA *rsa, BN_CTX *ctx) +{ + return meth->rsa_mod_exp; +} + +int +(*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth))(BIGNUM *r, + const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *m_ctx) +{ + return meth->bn_mod_exp; +} + +int +(*RSA_meth_get_init(const RSA_METHOD *meth))(RSA *rsa) +{ + return meth->init; +} + +int +(*RSA_meth_get_keygen(const RSA_METHOD *meth))(RSA *rsa, int bits, BIGNUM *e, + BN_GENCB *cb) +{ + return meth->rsa_keygen; +} + +int +RSA_meth_get_flags(const RSA_METHOD *meth) +{ + return meth->flags; +} + +void * +RSA_meth_get0_app_data(const RSA_METHOD *meth) +{ + return meth->app_data; +} + +int +(*RSA_meth_get_sign(const RSA_METHOD *meth))(int type, + const unsigned char *m, unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, + const RSA *rsa) +{ + return meth->rsa_sign; +} + +int +RSA_meth_set_sign(RSA_METHOD *meth, int (*sign)(int type, + const unsigned char *m, unsigned int m_length, unsigned char *sigret, + unsigned int *siglen, const RSA *rsa)) +{ + meth->rsa_sign = sign; + return 1; +} + +int +(*RSA_meth_get_verify(const RSA_METHOD *meth))(int dtype, + const unsigned char *m, unsigned int m_length, const unsigned char *sigbuf, + unsigned int siglen, const RSA *rsa) +{ + return meth->rsa_verify; +} + +int +RSA_meth_set_verify(RSA_METHOD *meth, int (*verify)(int dtype, + const unsigned char *m, unsigned int m_length, const unsigned char *sigbuf, + unsigned int siglen, const RSA *rsa)) +{ + meth->rsa_verify = verify; + return 1; +} diff --git a/lib/libcrypto/shlib_version b/lib/libcrypto/shlib_version index 7fd5c8dff5e..fba3a63c148 100644 --- a/lib/libcrypto/shlib_version +++ b/lib/libcrypto/shlib_version @@ -1,3 +1,3 @@ # Don't forget to give libssl and libtls the same type of bump! major=45 -minor=4 +minor=5 diff --git a/lib/libssl/shlib_version b/lib/libssl/shlib_version index e62616fcc73..ca411978514 100644 --- a/lib/libssl/shlib_version +++ b/lib/libssl/shlib_version @@ -1,3 +1,3 @@ # Don't forget to give libtls the same type of bump! major=47 -minor=5 +minor=6 diff --git a/lib/libtls/shlib_version b/lib/libtls/shlib_version index 162fae370d0..14c02159bb5 100644 --- a/lib/libtls/shlib_version +++ b/lib/libtls/shlib_version @@ -1,2 +1,2 @@ major=19 -minor=6 +minor=7 |