core: "null server certificate" cleanup in certificate.c

"null server certificate" is not an error. It is usually seen when the
certificate already has been sent and the server doesn't send it twice just
because of licensing. Degrading to debug message.

Do the check early to avoid leaking a stream.

Also remove unused static strings.
This commit is contained in:
Mads Kiilerich 2012-02-28 21:31:09 +01:00
parent a7b4a67c75
commit 9c8f5d63eb

@ -27,9 +27,6 @@
#include <freerdp/utils/file.h>
static const char certificate_store_dir[] = "certs";
static const char certificate_known_hosts_file[] = "known_hosts";
#include "certificate.h"
/**
@ -448,15 +445,16 @@ boolean certificate_read_server_certificate(rdpCertificate* certificate, uint8*
STREAM* s;
uint32 dwVersion;
s = stream_new(0);
stream_attach(s, server_cert, length);
printf("length %d\n", length);
if (length < 1)
{
printf("null server certificate\n");
DEBUG_CERTIFICATE("null server certificate\n");
return false;
}
s = stream_new(0);
stream_attach(s, server_cert, length);
stream_read_uint32(s, dwVersion); /* dwVersion (4 bytes) */
switch (dwVersion & CERT_CHAIN_VERSION_MASK)