Skip to content

Commit a4d1274

Browse files
Bug#17201924 and Bug#18178997 : YASSL:MISSING CLOSEDIR()
IN SSL_CTX_LOAD_VERIFY_ LOCATIONS() and OFF-BY-ONE PROBLEM IN VOID CERTDECODER:: GETDATE(DATETYPE DT) IN ASN.CPP Description : Fixes corner cases in yassl code. Refer to bug page for details.
1 parent 9ffebd7 commit a4d1274

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

extra/yassl/src/ssl.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -790,7 +790,10 @@ int SSL_CTX_load_verify_locations(SSL_CTX* ctx, const char* file,
790790
strncpy(name, path, MAX_PATH - 1 - HALF_PATH);
791791
strncat(name, "/", 1);
792792
strncat(name, entry->d_name, HALF_PATH);
793-
if (stat(name, &buf) < 0) return SSL_BAD_STAT;
793+
if (stat(name, &buf) < 0) {
794+
closedir(dir);
795+
return SSL_BAD_STAT;
796+
}
794797

795798
if (S_ISREG(buf.st_mode))
796799
ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA);

extra/yassl/taocrypt/include/asn.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -294,9 +294,9 @@ class CertDecoder : public BER_Decoder {
294294
byte* signature_;
295295
char issuer_[ASN_NAME_MAX]; // Names
296296
char subject_[ASN_NAME_MAX]; // Names
297-
char beforeDate_[MAX_DATE_SZ]; // valid before date
298-
char afterDate_[MAX_DATE_SZ]; // valid after date
299-
bool verify_; // Default to yes, but could be off
297+
char beforeDate_[MAX_DATE_SZ+1]; // valid before date, +null term
298+
char afterDate_[MAX_DATE_SZ+1]; // valid after date, +null term
299+
bool verify_; // Default to yes, but could be off
300300

301301
void ReadHeader();
302302
void Decode(SignerList*, CertType);

0 commit comments

Comments
 (0)