diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-03-05 22:51:04 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-03-05 23:00:53 +0100 |
commit | 6afa51a52324f8d9bcb7271008a8b3b1d7adf7e3 (patch) | |
tree | 11807969ab22be7acafda8da25856d5c5831b716 | |
parent | 37791cbe4ed9bafbe6190d3b3429a664a90f8e82 (diff) | |
download | gnutls-6afa51a52324f8d9bcb7271008a8b3b1d7adf7e3.tar.gz |
Some updates on supplemental data handling.
-rw-r--r-- | doc/cha-bib.texi | 5 | ||||
-rw-r--r-- | doc/cha-internals.texi | 23 | ||||
-rw-r--r-- | doc/latex/gnutls.bib | 9 |
3 files changed, 28 insertions, 9 deletions
diff --git a/doc/cha-bib.texi b/doc/cha-bib.texi index 965eeaf358..7f975e59c6 100644 --- a/doc/cha-bib.texi +++ b/doc/cha-bib.texi @@ -31,6 +31,11 @@ Tim Dierks and Christopher Allen, "The TLS Protocol Version 1.0", January 1999, Available from @url{http://www.ietf.org/rfc/rfc2246.txt}. +@item @anchor{RFC4680}[RFC4680] +S. Santesson, "TLS Handshake Message for Supplemental Data", +September 2006, Available from +@url{http://www.ietf.org/rfc/rfc4680.txt}. + @item @anchor{RFC4514}[RFC4514] Kurt D. Zeilenga, "Lightweight Directory Access Protocol (LDAP): String Representation of Distinguished Names", June 2006, Available from diff --git a/doc/cha-internals.texi b/doc/cha-internals.texi index 2bdb6292bb..69ac8fa13d 100644 --- a/doc/cha-internals.texi +++ b/doc/cha-internals.texi @@ -203,7 +203,7 @@ will be called to deinitialize the extension's private parameters, if any. Note that the conditional @code{ENABLE_FOOBAR} definition should only be used if step 1 with the @code{configure} options has taken place. -@subsubheading Add new files that implement the extension. +@subsubheading Add new files that implement the extension. The functions you are responsible to add are those mentioned in the previous step. They should be added in a file such as @code{ext/@-foobar.c} @@ -324,8 +324,8 @@ API was introduced in. @subheading Adding a new Supplemental Data Handshake Message TLS handshake extensions allow to send so called supplemental data -handshake messages. This short section explains how to implement a -supplemental data handshake message for a given TLS extension. +handshake messages @xcite{RFC4680}. This short section explains how to +implement a supplemental data handshake message for a given TLS extension. First of all, modify your extension @code{foobar} in the way, the that flags @@ -360,25 +360,30 @@ and @funcintref{_foobar_supp_send_params} to @code{_foobar.h} and @example int -_foobar_supp_recv_params(gnutls_session_t session,const opaque *data,size_t _data_size) +_foobar_supp_recv_params(gnutls_session_t session, const opaque *data, size_t _data_size) @{ - uint8_t len = (int) _data_size; + uint8_t len = _data_size; unsigned char *msg; - msg = (unsigned char *)malloc(len*sizeof(unsigned char)); - memcpy(msg,data,len); + msg = gnutls_malloc(len); + if (msg == NULL) return GNUTLS_E_MEMORY_ERROR; + + memcpy(msg, data, len); msg[len]='\0'; + /* do something with msg */ + gnutls_free(msg); + return len; @} int -_foobar_supp_send_params(gnutls_session_t session,gnutls_buffer_st *buf) +_foobar_supp_send_params(gnutls_session_t session, gnutls_buffer_st *buf) @{ unsigned char *msg = "hello world"; int len = strlen(msg); - _gnutls_buffer_append_data_prefix(buf,8,msg,(uint8_t) len); + _gnutls_buffer_append_data_prefix(buf, 8, msg, len); return len; @} diff --git a/doc/latex/gnutls.bib b/doc/latex/gnutls.bib index 68c7e1fbdd..685075e98e 100644 --- a/doc/latex/gnutls.bib +++ b/doc/latex/gnutls.bib @@ -16,6 +16,15 @@ url = "http://www.ietf.org/rfc/rfc2246" } +@Misc{ RFC4680, + author = "S. Santesson", + title = "{TLS Handshake Message for Supplemental Data}", + month = "September", + year = "2006", + note = "Available from \url{http://www.ietf.org/rfc/rfc4680}", + url = "http://www.ietf.org/rfc/rfc4680" +} + @Misc{ RFC4514, author = "Kurt D. Zeilenga", title = "{Lightweight Directory Access Protocol (LDAP): String Representation of Distinguished Names}", |