diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/openssl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c index 85c7503..8ff21ce 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
| @@ -3225,12 +3225,15 @@ static int pk_decrypt(lua_State *L) { | |||
| 3225 | 3225 | ||
| 3226 | lua_pushlstring(L, buf->data, outlen); | 3226 | lua_pushlstring(L, buf->data, outlen); |
| 3227 | 3227 | ||
| 3228 | BIO_reset(*bio); | ||
| 3229 | |||
| 3228 | return 1; | 3230 | return 1; |
| 3229 | sslerr: | 3231 | sslerr: |
| 3230 | if (ctx) { | 3232 | if (ctx) { |
| 3231 | EVP_PKEY_CTX_free(ctx); | 3233 | EVP_PKEY_CTX_free(ctx); |
| 3232 | ctx = NULL; | 3234 | ctx = NULL; |
| 3233 | } | 3235 | } |
| 3236 | BIO_reset(*bio); | ||
| 3234 | 3237 | ||
| 3235 | return auxL_error(L, auxL_EOPENSSL, "pkey:decrypt"); | 3238 | return auxL_error(L, auxL_EOPENSSL, "pkey:decrypt"); |
| 3236 | } /* pk_decrypt() */ | 3239 | } /* pk_decrypt() */ |
| @@ -3280,12 +3283,15 @@ static int pk_encrypt(lua_State *L) { | |||
| 3280 | 3283 | ||
| 3281 | lua_pushlstring(L, buf->data, outlen); | 3284 | lua_pushlstring(L, buf->data, outlen); |
| 3282 | 3285 | ||
| 3286 | BIO_reset(*bio); | ||
| 3287 | |||
| 3283 | return 1; | 3288 | return 1; |
| 3284 | sslerr: | 3289 | sslerr: |
| 3285 | if (ctx) { | 3290 | if (ctx) { |
| 3286 | EVP_PKEY_CTX_free(ctx); | 3291 | EVP_PKEY_CTX_free(ctx); |
| 3287 | ctx = NULL; | 3292 | ctx = NULL; |
| 3288 | } | 3293 | } |
| 3294 | BIO_reset(*bio); | ||
| 3289 | 3295 | ||
| 3290 | return auxL_error(L, auxL_EOPENSSL, "pkey:encrypt"); | 3296 | return auxL_error(L, auxL_EOPENSSL, "pkey:encrypt"); |
| 3291 | } /* pk_encrypt() */ | 3297 | } /* pk_encrypt() */ |
