Skip to content

Commit e1388b3

Browse files
committed
New initial commit
0 parents  commit e1388b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+13922
-0
lines changed

Diff for: .gitignore

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
core
2+
*~
3+
*.[oa]
4+
*.gz
5+
*.cap
6+
*.pcap
7+
Makefile
8+
autom4te.cache/
9+
config.h
10+
config.log
11+
config.status
12+
configure
13+
doc/Doxyfile
14+
doc/doxygen.out
15+
doc/html/
16+
libtinydtls.a
17+
tests/ccm-test
18+
tests/dtls-client
19+
tests/dtls-server
20+
tests/prf-test
21+
tinydtls-0.6.0
22+
./tinydtls-0.6.0/
23+
TAGS
24+
*.patch
25+
.gitignore
26+
ecc/testecc
27+
ecc/testfield
28+
*.d
29+
*.hex
30+
*.elf
31+
*.map
32+
obj_*
33+
tinydtls.h
34+
dtls_config.h
35+
*.apple2enh
36+
*.atarixl
37+
*.avr-atmega128rfa1
38+
*.avr-raven
39+
*.avr-ravenlcd
40+
*.avr-ravenusb
41+
*.avr-rcb
42+
*.avr-zigbit
43+
*.c128
44+
*.c64
45+
*.cc2530dk
46+
*.cc2538dk
47+
*.cooja
48+
*.econotag
49+
*.eval-adf7xxxmb4z
50+
*.exp5438
51+
*.iris
52+
*.mbxxx
53+
*.micaz
54+
*.minimal-net
55+
*.native
56+
*.seedeye
57+
*.sensinode
58+
*.sky
59+
*.stm32test
60+
*.win32
61+
*.wismote
62+
*.z1
63+
*.z1sp
64+
.project

Diff for: ABOUT.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# About This Content
2+
3+
2015-12-18
4+
5+
# License
6+
7+
The Eclipse Foundation makes available all content in this plug-in
8+
("Content"). Unless otherwise indicated below, the Content is provided
9+
to you under the terms and conditions of the Eclipse Public License
10+
Version 1.0 ("EPL") and Eclipse Distribution License Version 1.0
11+
(“EDL”). A copy of the EPL is available at
12+
http://www.eclipse.org/legal/epl-v10.html and a copy of the EDL is
13+
available at http://www.eclipse.org/org/documents/edl-v10.php. For
14+
purposes of the EPL, "Program" will mean the Content.
15+
16+
If you did not receive this Content directly from the Eclipse
17+
Foundation, the Content is being redistributed by another party
18+
("Redistributor") and different terms and conditions may apply to your
19+
use of any object code in the Content. Check the Redistributor’s
20+
license that was provided with the Content. If no such license exists,
21+
contact the Redistributor. Unless otherwise indicated below, the terms
22+
and conditions of the EPL and EDL still apply to any source code in
23+
the Content and such source code may be obtained at
24+
http://www.eclipse.org.
25+
26+
# Third Party Content
27+
28+
The Content includes items that have been sourced from third parties
29+
as set out below. If you did not receive this Content directly from
30+
the Eclipse Foundation, the following is provided for informational
31+
purposes only, and you should look to the Redistributor’s license for
32+
terms and conditions of use.
33+
34+
## Uthash 1.9.9
35+
36+
[Uthash](https://troydhanson.github.io/uthash/) is an implementation
37+
of hash tables and linked lists for C structures by Troy D. Hanson.
38+
Uthash is licensed under the BSD revised license, see
39+
https://troydhanson.github.io/uthash/license.html,
40+
41+
## rijndael 3.0
42+
43+
The library uses an implementation of the Rijndael algorithm (AES)
44+
from [OpenBSD](http://www.openbsd.org/) by Vincent Rijmen, Antoon
45+
Bosselaers, and Paulo Barreto. The authors have placed the code in the
46+
public domain under the license included in the file rijndael.h (see
47+
http://www.openbsd.org/cgi-bin/cvsweb).
48+
49+
## SHA-256 1.0
50+
51+
The SHA-256 implementation from Aaron D. Gifford is available at
52+
http://www.aarongifford.com/computers/sha2-1.0.1.tgz under a
53+
3-clause BSD license.
54+
55+
## ECC 1.0
56+
57+
The implementation of the ECC curve secp256r1 was originally developed
58+
by Chris K Cockrum and has been put under MIT license for inclusion
59+
with tinydtls. The original source is made available in
60+
https://cockrum.net/Implementation_of_ECC_on_an_8-bit_microcontroller.pdf

Diff for: LICENSE

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016 Olaf Bergmann (TZI) and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* and Eclipse Distribution License v. 1.0 which accompanies this distribution.
6+
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7+
* and the Eclipse Distribution License is available at
8+
* http://www.eclipse.org/org/documents/edl-v10.php.
9+
* Contributors:
10+
* Olaf Bergmann - initial API and implementation
11+
* Hauke Mehrtens - memory optimization, ECC integration
12+
*******************************************************************************/

Diff for: Makefile.in

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Makefile for tinydtls
2+
#
3+
#
4+
# Copyright (c) 2011, 2012, 2013, 2014, 2015 Olaf Bergmann (TZI) and others.
5+
# All rights reserved. This program and the accompanying materials
6+
# are made available under the terms of the Eclipse Public License v1.0
7+
# and Eclipse Distribution License v. 1.0 which accompanies this distribution.
8+
#
9+
# The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
10+
# and the Eclipse Distribution License is available at
11+
# http://www.eclipse.org/org/documents/edl-v10.php.
12+
#
13+
# Contributors:
14+
# Olaf Bergmann - initial API and implementation
15+
#
16+
17+
# the library's version
18+
VERSION:=@PACKAGE_VERSION@
19+
20+
# tools
21+
@SET_MAKE@
22+
SHELL = /bin/sh
23+
MKDIR = mkdir
24+
ETAGS = @ETAGS@
25+
26+
prefix = @prefix@
27+
exec_prefix = @exec_prefix@
28+
abs_builddir = @abs_builddir@
29+
top_builddir = @top_builddir@
30+
libdir = @libdir@
31+
includedir = @includedir@/@PACKAGE_NAME@
32+
package = @PACKAGE_TARNAME@-@PACKAGE_VERSION@
33+
34+
install := cp
35+
36+
# files and flags
37+
SOURCES:= dtls.c crypto.c ccm.c hmac.c netq.c peer.c dtls_time.c session.c debug.c
38+
SUB_OBJECTS:=aes/rijndael.o @OPT_OBJS@
39+
OBJECTS:= $(patsubst %.c, %.o, $(SOURCES)) $(SUB_OBJECTS)
40+
HEADERS:=dtls.h hmac.h debug.h dtls_config.h uthash.h numeric.h crypto.h global.h ccm.h \
41+
netq.h alert.h utlist.h prng.h peer.h state.h dtls_time.h session.h \
42+
tinydtls.h
43+
CFLAGS:=-Wall -pedantic -std=c99 @CFLAGS@
44+
CPPFLAGS:=@CPPFLAGS@ -DDTLS_CHECK_CONTENTTYPE
45+
SUBDIRS:=tests doc platform-specific sha2 aes ecc
46+
DISTSUBDIRS:=$(SUBDIRS)
47+
DISTDIR=$(top_builddir)/$(package)
48+
FILES:=Makefile.in configure configure.in dtls_config.h.in tinydtls.h.in \
49+
Makefile.tinydtls $(SOURCES) $(HEADERS)
50+
LIB:=libtinydtls.a
51+
LDFLAGS:=@LIBS@
52+
ARFLAGS:=cru
53+
doc:=doc
54+
55+
.PHONY: all dirs clean install dist distclean .gitignore doc TAGS
56+
57+
ifneq ("@WITH_CONTIKI@", "1")
58+
.SUFFIXES:
59+
.SUFFIXES: .c .o
60+
61+
all: $(LIB) dirs
62+
63+
check:
64+
echo DISTDIR: $(DISTDIR)
65+
echo top_builddir: $(top_builddir)
66+
$(MAKE) -C tests check
67+
68+
dirs: $(SUBDIRS)
69+
for dir in $^; do \
70+
$(MAKE) -C $$dir ; \
71+
done
72+
73+
$(SUB_OBJECTS)::
74+
$(MAKE) -C $(@D) $(@F)
75+
76+
$(LIB): $(OBJECTS)
77+
$(AR) $(ARFLAGS) $@ $^
78+
ranlib $@
79+
80+
clean:
81+
@rm -f $(PROGRAM) main.o $(LIB) $(OBJECTS)
82+
for dir in $(SUBDIRS); do \
83+
$(MAKE) -C $$dir clean ; \
84+
done
85+
endif # WITH_CONTIKI
86+
87+
doc:
88+
$(MAKE) -C doc
89+
90+
distclean: clean
91+
@rm -rf $(DISTDIR)
92+
@rm -f *~ $(DISTDIR).tar.gz
93+
94+
dist: $(FILES) $(DISTSUBDIRS)
95+
test -d $(DISTDIR) || mkdir $(DISTDIR)
96+
cp $(FILES) $(DISTDIR)
97+
for dir in $(DISTSUBDIRS); do \
98+
$(MAKE) -C $$dir dist; \
99+
done
100+
tar czf $(package).tar.gz $(DISTDIR)
101+
102+
install: $(LIB) $(HEADERS) $(SUBDIRS)
103+
test -d $(libdir) || mkdir -p $(libdir)
104+
test -d $(includedir) || mkdir -p $(includedir)
105+
$(install) $(LIB) $(libdir)/
106+
$(install) $(HEADERS) $(includedir)/
107+
for dir in $(SUBDIRS); do \
108+
$(MAKE) -C $$dir install="$(install)" includedir=$(includedir) install; \
109+
done
110+
111+
TAGS:
112+
$(ETAGS) -o $@.new $(SOURCES)
113+
$(ETAGS) -a -o $@.new $(HEADERS)
114+
mv $@.new $@
115+
116+
# files that should be ignored by git
117+
GITIGNOREDS:= core \*~ \*.[oa] \*.gz \*.cap \*.pcap Makefile \
118+
autom4te.cache/ config.h config.log config.status configure \
119+
doc/Doxyfile doc/doxygen.out doc/html/ $(LIB) tests/ccm-test \
120+
tests/dtls-client tests/dtls-server tests/prf-test $(package) \
121+
$(DISTDIR)/ TAGS \*.patch .gitignore ecc/testecc ecc/testfield \
122+
\*.d \*.hex \*.elf \*.map obj_\* tinydtls.h dtls_config.h \
123+
$(addprefix \*., $(notdir $(wildcard ../../platform/*))) \
124+
.project
125+
126+
.gitignore:
127+
echo $(GITIGNOREDS) | sed 's/ /\n/g' > $@
128+

Diff for: Makefile.tinydtls

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This is a -*- Makefile -*-
2+
3+
ifeq ($(TARGET), redbee-econotag)
4+
CFLAGS += -DSHA2_USE_INTTYPES_H=1 -DLITTLE_ENDIAN=3412 -DBYTE_ORDER=LITTLE_ENDIAN
5+
endif
6+
7+
ifeq ($(TARGET), wismote)
8+
CFLAGS += -DSHA2_USE_INTTYPES_H=1 -DLITTLE_ENDIAN=3412 -DBYTE_ORDER=LITTLE_ENDIAN
9+
endif
10+
11+
ifeq ($(TARGET), exp5438)
12+
CFLAGS += -DSHA2_USE_INTTYPES_H=1 -DLITTLE_ENDIAN=3412 -DBYTE_ORDER=LITTLE_ENDIAN
13+
endif
14+
15+
ifeq ($(TARGET), native)
16+
CFLAGS += -DSHA2_USE_INTTYPES_H=1
17+
endif
18+
19+
ifeq ($(TARGET), minimal-net)
20+
CFLAGS += -DSHA2_USE_INTTYPES_H=1
21+
endif
22+
23+
CFLAGS += -DDTLSv12 -DWITH_SHA256
24+
tinydtls_src = dtls.c crypto.c hmac.c rijndael.c sha2.c ccm.c netq.c ecc.c dtls_time.c peer.c session.c
25+
26+
# This adds support for TLS_PSK_WITH_AES_128_CCM_8
27+
CFLAGS += -DDTLS_PSK
28+
29+
# This adds support for TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
30+
CFLAGS += -DDTLS_ECC
31+
tinydtls_src += ecc.c
32+
33+
# This activates debugging support
34+
# CFLAGS += -DNDEBUG
35+
tinydtls_src += debug.c
36+

Diff for: README

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
CONTENTS
2+
3+
This library contains functions and structures that can help
4+
constructing a single-threaded UDP server with DTLS support in
5+
C99. The following components are available:
6+
7+
* dtls
8+
Basic support for DTLS with pre-shared key mode.
9+
10+
* tests
11+
The subdirectory tests contains test programs that show how each
12+
component is used.
13+
14+
BUILDING
15+
16+
When using the code from the git repository at sourceforge, invoke
17+
'autoreconf' to re-create the configure script. To build for Contiki,
18+
place tinydtls into Contiki's apps directory and call
19+
./configure --with-contiki.
20+
21+
After configuration, invoke make to build the library and associated
22+
test programs. To add tinydtls as Contiki application, drop it into
23+
the apps directory and add the following line to your Makefile:
24+
25+
APPS += tinydtls/aes tinydtls/sha2 tinydtls/ecc tinydtls
26+

Diff for: aes/Makefile.in

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Makefile for tinydtls
2+
#
3+
# Copyright (c) 2011, 2012, 2013, 2014, 2015 Olaf Bergmann (TZI) and others.
4+
# All rights reserved. This program and the accompanying materials
5+
# are made available under the terms of the Eclipse Public License v1.0
6+
# and Eclipse Distribution License v. 1.0 which accompanies this distribution.
7+
#
8+
# The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
9+
# and the Eclipse Distribution License is available at
10+
# http://www.eclipse.org/org/documents/edl-v10.php.
11+
#
12+
# Contributors:
13+
# Olaf Bergmann - initial API and implementation
14+
#
15+
16+
# the library's version
17+
VERSION:=@PACKAGE_VERSION@
18+
19+
# tools
20+
@SET_MAKE@
21+
SHELL = /bin/sh
22+
MKDIR = mkdir
23+
24+
abs_builddir = @abs_builddir@
25+
top_builddir = @top_builddir@
26+
top_srcdir:= @top_srcdir@
27+
28+
SOURCES:= rijndael.c
29+
HEADERS:= rijndael.h
30+
OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
31+
CPPFLAGS=@CPPFLAGS@
32+
CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@
33+
LDLIBS=@LIBS@
34+
FILES:=Makefile.in $(SOURCES) $(HEADERS)
35+
DISTDIR=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
36+
37+
.PHONY: all dirs clean install dist distclean .gitignore doc
38+
39+
.SUFFIXES:
40+
.SUFFIXES: .c .o
41+
42+
all:
43+
44+
check:
45+
echo DISTDIR: $(DISTDIR)
46+
echo top_builddir: $(top_builddir)
47+
48+
clean:
49+
@rm -f $(PROGRAMS) main.o $(LIB) $(OBJECTS)
50+
for dir in $(SUBDIRS); do \
51+
$(MAKE) -C $$dir clean ; \
52+
done
53+
54+
distclean: clean
55+
@rm -rf $(DISTDIR)
56+
@rm -f *~ $(DISTDIR).tar.gz
57+
58+
dist: $(FILES)
59+
test -d $(DISTDIR)/aes || mkdir $(DISTDIR)/aes
60+
cp -p $(FILES) $(DISTDIR)/aes
61+
62+
install: $(HEADERS)
63+
test -d $(includedir)/aes || mkdir -p $(includedir)/aes
64+
$(install) $(HEADERS) $(includedir)/aes
65+
66+
.gitignore:
67+
echo "core\n*~\n*.[oa]\n*.gz\n*.cap\n$(PROGRAM)\n$(DISTDIR)\n.gitignore" >$@

0 commit comments

Comments
 (0)