-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
267d687
commit d8b9ad1
Showing
2 changed files
with
12 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
all: | ||
gcc -o dtls dtls.c -lssl -lcrypto -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include | ||
gcc -o server dtls_server.c dtls.c -lssl -lcrypto -L/usr/local/ccnx/dependencies/build/lib -I/usr/local/ccnx/dependencies/build/include | ||
gcc -o client dtls_client.c dtls.c -lssl -lcrypto -L/usr/local/ccnx/dependencies/build/lib -I/usr/local/ccnx/dependencies/build/include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,25 @@ | ||
#ifndef dtls_h_ | ||
#define dtls_h_ | ||
|
||
#include <stdbool.h> | ||
|
||
#include <openssl/err.h> | ||
#include <openssl/dh.h> | ||
#include <openssl/ssl.h> | ||
#include <openssl/conf.h> | ||
#include <openssl/engine.h> | ||
|
||
typedef struct { | ||
SSL_CTX* ctx; | ||
SSL* ssl; | ||
SSL_CTX *ctx; | ||
SSL *ssl; | ||
BIO *bio; | ||
} DTLSParams; | ||
|
||
typedef void(*info_callback)(); | ||
|
||
void dtls_begin(); | ||
|
||
void dtls_end(); | ||
|
||
void ssl_shutdown(DTLSParams* k); | ||
|
||
void ssl_info_callback(const SSL* ssl, int where, int ret, const char* name); | ||
|
||
int ssl_ctx_init(DTLSParams* k, const char* keyname); | ||
|
||
int ssl_verify_peer(int ok, X509_STORE_CTX* ctx); | ||
|
||
int ssl_init(DTLSParams* k, int isserver, info_callback cb); | ||
void dtls_Begin(); | ||
void dtls_End(); | ||
void dtls_Shutdown(DTLSParams* k); | ||
int dtls_InitContextFromKeystore(DTLSParams* k, const char* keyname); | ||
int dtls_InitServer(DTLSParams* k); | ||
int dtls_InitClient(DTLSParams* k, const char *address); | ||
|
||
#endif // dtls_h_ |