Skip to content

Commit 52d77be

Browse files
authored
Merge pull request #23 from deemru/1.x
1.0.3
2 parents 48fd5ef + 344e003 commit 52d77be

File tree

4 files changed

+45
-10
lines changed

4 files changed

+45
-10
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 1.0.3
4+
5+
- Fixed broken logic regression in [`msspi_get_peerchain()`](MSSPI.md#msspi_get_peerchain)
6+
- Safer definition of shared TLS/DTLS version constants
7+
8+
---
9+
310
## 1.0.2
411

512
- Fixed regression in [`msspi_set_mycert()`](MSSPI.md#msspi_set_mycert) where SHA1/KeyID/Subject certificate lookup failed

MSSPI.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,25 @@ Checks if a TLS/DTLS version is supported by the system.
140140
### Protocol Version Constants
141141
142142
```c
143-
#define TLS1_VERSION 0x0301
144-
#define TLS1_1_VERSION 0x0302
145-
#define TLS1_2_VERSION 0x0303
146-
#define TLS1_3_VERSION 0x0304
143+
#ifndef TLS1_VERSION
144+
#define TLS1_VERSION 0x0301
145+
#endif
146+
147+
#ifndef TLS1_1_VERSION
148+
#define TLS1_1_VERSION 0x0302
149+
#endif
150+
151+
#ifndef TLS1_2_VERSION
152+
#define TLS1_2_VERSION 0x0303
153+
#endif
154+
155+
#ifndef TLS1_3_VERSION
156+
#define TLS1_3_VERSION 0x0304
157+
#endif
158+
159+
#ifndef DTLS1_2_VERSION
147160
#define DTLS1_2_VERSION 0xFEFD
161+
#endif
148162
```
149163

150164
---

src/msspi.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2873,7 +2873,8 @@ int msspi_get_peerchain( MSSPI_HANDLE h, const uint8_t ** bufs, size_t * lens, s
28732873

28742874
if( !h->peerchain.size() )
28752875
{
2876-
if( !msspi_verify_internal( h, false, true ) )
2876+
uint32_t just_chain_result = msspi_verify_internal( h, false, true );
2877+
if( just_chain_result != ERROR_SUCCESS )
28772878
return 0; // last error included
28782879
}
28792880

src/msspi.h

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#define MSSPI_VERSION_MAJOR 1
88
#define MSSPI_VERSION_MINOR 0
9-
#define MSSPI_VERSION_PATCH 2
9+
#define MSSPI_VERSION_PATCH 3
1010

1111
#define MSSPI_VERSION \
1212
( ( MSSPI_VERSION_MAJOR << 16 ) | ( MSSPI_VERSION_MINOR << 8 ) | MSSPI_VERSION_PATCH )
@@ -20,12 +20,25 @@ extern "C" {
2020

2121
uint32_t msspi_version( void );
2222

23-
#define TLS1_VERSION 0x0301
24-
#define TLS1_1_VERSION 0x0302
25-
#define TLS1_2_VERSION 0x0303
26-
#define TLS1_3_VERSION 0x0304
23+
#ifndef TLS1_VERSION
24+
#define TLS1_VERSION 0x0301
25+
#endif
26+
27+
#ifndef TLS1_1_VERSION
28+
#define TLS1_1_VERSION 0x0302
29+
#endif
30+
31+
#ifndef TLS1_2_VERSION
32+
#define TLS1_2_VERSION 0x0303
33+
#endif
34+
35+
#ifndef TLS1_3_VERSION
36+
#define TLS1_3_VERSION 0x0304
37+
#endif
2738

39+
#ifndef DTLS1_2_VERSION
2840
#define DTLS1_2_VERSION 0xFEFD
41+
#endif
2942

3043
int msspi_is_version_supported( int version );
3144
int msspi_is_cipher_supported( int cipher, int dtls );

0 commit comments

Comments
 (0)