aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatarLibravatar daurnimator <quae@daurnimator.com> 2016-11-08 15:34:58 +1100
committerLibravatarLibravatar daurnimator <quae@daurnimator.com> 2016-11-08 16:23:09 +1100
commitfa19e1d6bda00c45189530b15f0034549df5b283 (patch)
treebcbe2b587ac1dbc92594b8808027f1e90de2c5cf /src
parent3eb66b869582bcd791cf89dd552abc4bb9e7c627 (diff)
downloadluaossl-fa19e1d6bda00c45189530b15f0034549df5b283.tar.gz
luaossl-fa19e1d6bda00c45189530b15f0034549df5b283.tar.bz2
luaossl-fa19e1d6bda00c45189530b15f0034549df5b283.zip
openssl.pkey: Export rsa padding options
Diffstat (limited to 'src')
-rw-r--r--src/openssl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 87938e5..c0fc6de 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -4001,10 +4001,21 @@ static void pk_luainit(lua_State *L, _Bool reset) {
lua_pop(L, 2);
} /* pk_luainit() */
+static const auxL_IntegerReg pk_rsa_pad_opts[] = {
+ { "RSA_PKCS1_PADDING", RSA_PKCS1_PADDING }, // PKCS#1 padding
+ { "RSA_SSLV23_PADDING", RSA_SSLV23_PADDING }, // SSLv23 padding
+ { "RSA_NO_PADDING", RSA_NO_PADDING }, // no padding
+ { "RSA_PKCS1_OAEP_PADDING", RSA_PKCS1_OAEP_PADDING }, // OAEP padding (encrypt and decrypt only)
+ { "RSA_X931_PADDING", RSA_X931_PADDING }, // (signature operations only)
+ { "RSA_PKCS1_PSS_PADDING", RSA_PKCS1_PSS_PADDING }, // (sign and verify only)
+ { NULL, 0 },
+};
+
int luaopen__openssl_pkey(lua_State *L) {
initall(L);
auxL_newlib(L, pk_globals, 0);
+ auxL_setintegers(L, pk_rsa_pad_opts);
return 1;
} /* luaopen__openssl_pkey() */