diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2022-11-29 19:55:35 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2022-11-29 19:55:35 -0500 |
commit | 46060099915c98b629cbe01adc37ec2dfa07ac50 (patch) | |
tree | 79cbd5c232ab1009da92e84b5899f6ddd2efa316 /src | |
parent | 31971b85c256158c731149c4ae9cd40dc086f908 (diff) | |
download | lite-xl-plugin-manager-46060099915c98b629cbe01adc37ec2dfa07ac50.tar.gz lite-xl-plugin-manager-46060099915c98b629cbe01adc37ec2dfa07ac50.zip |
Fixed certificate conversion.
Diffstat (limited to 'src')
-rw-r--r-- | src/lpm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -414,8 +414,8 @@ static int lpm_certs(lua_State* L) { CryptBinaryToString(pCertContext->pbCertEncoded, pCertContext->cbCertEncoded, CRYPT_STRING_BASE64HEADER, NULL, &size); char* buffer = malloc(size); CryptBinaryToString(pCertContext->pbCertEncoded, pCertContext->cbCertEncoded, CRYPT_STRING_BASE64HEADER, buffer, &size); - free(buffer); fwrite(buffer, sizeof(char), size, file); + free(buffer); } } fclose(file); @@ -426,7 +426,7 @@ static int lpm_certs(lua_State* L) { } git_libgit2_opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, path, NULL); if ((status = mbedtls_x509_crt_parse_file(&x509_certificate, path)) != 0) - return luaL_error(L, "mbedtls_x509_crt_parse_file failed to parse CA certificate (-0x%X)\n", -status); + return luaL_error(L, "mbedtls_x509_crt_parse_file failed to parse CA certificate %s: %d", path, -status); mbedtls_ssl_conf_ca_chain(&ssl_config, &x509_certificate, NULL); } return 0; |