tinydtls: remove certificate_list length field for raw public keys
authorHauke Mehrtens <hauke.mehrtens@lantiq.com>
Tue, 15 Sep 2015 16:53:35 +0000 (18:53 +0200)
committerSachin Agrawal <sachin.agrawal@intel.com>
Thu, 17 Sep 2015 23:09:12 +0000 (23:09 +0000)
commit931ae3222a75635e59e9cf5c28e333e754b54498
treeca4324637c47383125738de67659171c1215fc61
parentf593c79f82349e47b9d51b0e5a3284bed6f9f7a9
tinydtls: remove certificate_list length field for raw public keys

This fixes https://jira.iotivity.org/browse/IOT-715
This patch introduces an API incompatible change, old IoTivity clients
using Raw Public key will not be able to communicate with clients
with this change.

backport of tinydtls upstream commit:
From 71d5f5c9247bbdb5ae1f43533f94c13be1153160 Mon Sep 17 00:00:00 2001
From: Olaf Bergmann <bergmann@tzi.org>
Date: Wed, 26 Aug 2015 21:35:26 +0200
Subject: [PATCH] dtls.c: remove certificate_list length field for raw public
 keys

RFC 7250 has changed the format of the Certificate structure from
RFC 5246 to the following:

opaque ASN.1Cert<1..2^24-1>;

struct {
    select(certificate_type) {

        // certificate type defined in RFC 7250
        case RawPublicKey:
           opaque ASN.1_subjectPublicKeyInfo<1..2^24-1>;

        // X.509 certificate defined in RFC 5246
        case X.509:
           ASN.1Cert certificate_list<0..2^24-1>;
    };
} Certificate;

Thus, there must be no additional length field indicating a
certificate list in case the message contains a raw public key.

Change-Id: I3887fe962548e8e9d0c5bbb9f450073b9f95d1cb
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2569
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sachin Agrawal <sachin.agrawal@intel.com>
extlibs/tinydtls/dtls.c