-From 43cd2295dcf0f83f2f11539050e3769d3fe79d7c Mon Sep 17 00:00:00 2001
-From: Kevin Kane <kkane@microsoft.com>
-Date: Thu, 18 May 2017 09:12:14 -0700
-Subject: [PATCH] With patches
+From 733d8f0e5ada9a77a4fbc917c9e0fd9366d720e4 Mon Sep 17 00:00:00 2001
+From: Dan Mihai <Daniel.Mihai@microsoft.com>
+Date: Thu, 17 Aug 2017 21:23:23 -0700
+Subject: [PATCH] Avoid MBEDTLS_ERR_ASN1_OUT_OF_DATA error
 
+Missing public key was already detected by checking for an
+MBEDTLS_ERR_ASN1_UNEXPECTED_TAG error code. But, (p == end) also means
+that the public key is missing.
 ---
  include/mbedtls/certs.h                     |   4 +
  include/mbedtls/check_config.h              |   5 +
  include/mbedtls/compat-1.3.h                |   5 +
- include/mbedtls/config.h                    |  43 +++++-
  include/mbedtls/net_sockets.h               |  19 ++-
  include/mbedtls/ssl.h                       |  50 ++++++-
  include/mbedtls/ssl_ciphersuites.h          |   6 +-

 tests/suites/test_suite_x509parse.data      |  16 ++
 tests/suites/test_suite_x509write.data      |  12 ++
 tests/suites/test_suite_x509write.function  | 125 ++++++++++++++++
 41 files changed, 1376 insertions(+), 117 deletions(-)
 create mode 100644 tests/data_files/server1-bothnames.crt
 create mode 100644 tests/data_files/server1-directoryname.crt
 create mode 100644 tests/data_files/server1-dnsname.crt

 library/md.c                                |   3 +-
 library/net_sockets.c                       |  34 ++---
 library/pkcs5.c                             |   5 +-
 library/pkparse.c                           |  53 +++----
 library/rsa.c                               |   5 +-
 library/ssl_ciphersuites.c                  |  18 +++
 library/ssl_cli.c                           | 144 +++++++++++++-----
