This commit is contained in:
qubit 2011-08-29 03:24:53 +05:30
parent 8bc7e301d1
commit 51b24c3628
4 changed files with 11 additions and 9 deletions

View File

@ -15,7 +15,8 @@ struct rdp_certdata
{
char* thumbprint;
char* hostname;
}
};
struct rdp_certstore
{
FILE* fp;
@ -29,13 +30,13 @@ struct rdp_certstore
void certstore_create(rdpCertstore* certstore);
void certstore_open(rdpCertstore* certstore);
void certstore_load(rdpCertstore* certstore);
void certstore_close(rdpcertstore* certstore);
void certstore_close(rdpCertstore* certstore);
char* get_local_certloc();
rdpCertdata* certdata_new(char* host_name,char* fingerprint);
void certdata_free(rdpCertdata* certdata);
void certstore_init(rdpCertstore* certstore);
rdpCertstore* certstore_new(rdpCertdata* certdata);
void certstore_free(rdpCertsore* certstore);
int match_certdata(rdpCertdata* certdata);
void certstore_free(rdpCertstore* certstore);
int match_certdata(rdpCertstore* certstore);
void print_certdata(rdpCertstore* certstore);
#endif /* __CERTSTORE_UTILS_H */

View File

@ -41,7 +41,6 @@
#define EXPONENT_MAX_SIZE 4
#define MODULUS_MAX_SIZE 64
#define CA_LOCAL_PATH ".freerdp/cacert"
#include <freerdp/freerdp.h>
#include <freerdp/utils/blob.h>
@ -90,6 +89,7 @@ void crypto_cert_printinfo(X509* xcert);
void crypto_cert_free(CryptoCert cert);
boolean x509_verify_cert(CryptoCert cert);
boolean crypto_cert_verify(CryptoCert server_cert, CryptoCert cacert);
rdpCertdata* crypto_get_certdata(X509 *xcert,char* hostname);
boolean crypto_cert_get_public_key(CryptoCert cert, rdpBlob* public_key);
void crypto_rsa_encrypt(uint8* input, int length, uint32 key_length, uint8* modulus, uint8* exponent, uint8* output);

View File

@ -254,14 +254,14 @@ int tls_verify_certificate(CryptoCert cert,char* hostname)
ret=x509_verify_cert(cert);
if(!ret)
{
Certdata* certdata;
rdpCertdata* certdata;
certdata=crypto_get_certdata(cert->px509,hostname);
Certstore* certstore=certstore_new(certdata);
rdpCertstore* certstore=certstore_new(certdata);
if(match_certdata(certstore)==0)
goto end;
if(certstore->match==1)
{
crypto_cert_printinfo(cert->x509);
crypto_cert_printinfo(cert->px509);
char answer;
while(1)
{
@ -286,8 +286,8 @@ int tls_verify_certificate(CryptoCert cert,char* hostname)
}
end:
certstore_free(certstore);
return 0;
}
return 0;
}
void tls_print_cert_error()

View File

@ -34,6 +34,7 @@ set(FREERDP_UTILS_SRCS
profiler.c
rail.c
registry.c
certstore.c
semaphore.c
sleep.c
stopwatch.c