-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwolfssl.patch
47 lines (44 loc) · 1.28 KB
/
wolfssl.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff --git a/src/ssl.c b/src/ssl.c
index f47759df5..3d95f78f4 100644
--- a/src/ssl.c
+++ b/src/ssl.c
@@ -3508,6 +3508,28 @@ int wolfSSL_GetHmacSize(WOLFSSL* ssl)
return BAD_FUNC_ARG;
}
+int wolfSSL_GetPeerSequenceNumber(WOLFSSL* ssl, word64 *seq)
+{
+ if (ssl) {
+ *seq = (((word64)ssl->keys.peer_sequence_number_hi << 32) |
+ ssl->keys.peer_sequence_number_lo);
+ return 0;
+ }
+
+ return BAD_FUNC_ARG;
+}
+
+int wolfSSL_GetSequenceNumber(WOLFSSL* ssl, word64 *seq)
+{
+ if (ssl) {
+ *seq = (((word64)ssl->keys.sequence_number_hi << 32) |
+ ssl->keys.sequence_number_lo);
+ return 0;
+ }
+
+ return BAD_FUNC_ARG;
+}
+
#endif /* ATOMIC_USER */
#ifndef NO_CERTS
diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h
index bd97ac23e..b683cb04e 100644
--- a/wolfssl/ssl.h
+++ b/wolfssl/ssl.h
@@ -2435,6 +2435,9 @@ WOLFSSL_API int wolfSSL_GetCipherType(WOLFSSL*);
WOLFSSL_API int wolfSSL_SetTlsHmacInner(WOLFSSL*, unsigned char*,
word32, int, int);
+WOLFSSL_API int wolfSSL_GetPeerSequenceNumber(WOLFSSL*, word64*);
+WOLFSSL_API int wolfSSL_GetSequenceNumber(WOLFSSL*, word64*);
+
/* Atomic User Needs */
enum {
WOLFSSL_SERVER_END = 0,