Skip to content

Commit a839d86

Browse files
committed
Add errorCode() API
1 parent 8ad6c48 commit a839d86

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

.development

Whitespace-only changes.

keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ getTime KEYWORD2
1717
onGetTime KEYWORD2
1818

1919
setEccSlot KEYWORD2
20+
errorCode KEYWORD2
2021

2122
########################################
2223
# Constants (LITERAL1)

src/BearSSLClient.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ void BearSSLClient::setEccSlot(int ecc508KeySlot, const char cert[])
238238
}
239239
}
240240

241+
int BearSSLClient::errorCode()
242+
{
243+
return br_ssl_engine_last_error(&_sc.eng);
244+
}
245+
241246
int BearSSLClient::connectSSL(const char* host)
242247
{
243248
// initialize client context with all algorithms and hardcoded trust anchors

src/BearSSLClient.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class BearSSLClient : public Client {
5959
void setEccSlot(int ecc508KeySlot, const byte cert[], int certLength);
6060
void setEccSlot(int ecc508KeySlot, const char cert[]);
6161

62+
int errorCode();
63+
6264
private:
6365
int connectSSL(const char* host);
6466
static int clientRead(void *ctx, unsigned char *buf, size_t len);

0 commit comments

Comments
 (0)