~ubuntu-branches/ubuntu/quantal/gnutls28/quantal

« back to all changes in this revision

Viewing changes to doc/cha-internals.texi

  • Committer: Package Import Robot
  • Author(s): Andreas Metzler
  • Date: 2011-12-17 11:41:19 UTC
  • mfrom: (10.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20111217114119-sp3ixi00tjajm52g
Tags: 3.0.9-2
* [20_test-select.diff] Do not run gnulib test-select test anymore. The
  test fails on kfreebsd-i386, the gnutls library does not use select().
* [30_correctly-set-the-odd-bits.patch] Post release fix from GIT head.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
using @funcintref{_gnutls_ext_register} in
118
118
@code{gnutls_extensions.c} typically within @funcintref{_gnutls_ext_init}.
119
119
 
120
 
@subsection Adding a New TLS Extension
 
120
@menu
 
121
* Adding a new TLS extension::
 
122
@end menu
 
123
 
 
124
@node Adding a new TLS extension
 
125
@subsection Adding a new TLS extension
121
126
 
122
127
Adding support for a new TLS extension is done from time to time, and
123
128
the process to do so is not difficult.  Here are the steps you need to
125
130
consider adding support for the hypothetical TLS extension
126
131
@code{foobar}.
127
132
 
128
 
@subsubsection Add @code{configure} option like @code{--enable-foobar} or @code{--disable-foobar}.
 
133
@subsubheading Add @code{configure} option like @code{--enable-foobar} or @code{--disable-foobar}.
129
134
 
130
135
This step is useful when the extension code is large and it might be desirable
131
136
to disable the extension under some circumstances. Otherwise it can be safely
153
158
 
154
159
These lines should go in @code{lib/m4/hooks.m4}.
155
160
 
156
 
@subsubsection Add IANA extension value to @code{extensions_t} in @code{gnutls_int.h}.
 
161
@subsubheading Add IANA extension value to @code{extensions_t} in @code{gnutls_int.h}.
157
162
 
158
163
A good name for the value would be GNUTLS_EXTENSION_FOOBAR.  Check
159
164
with @url{http://www.iana.org/assignments/tls-extensiontype-values}
163
168
when the IANA allocates that number to someone else, or when the
164
169
foobar protocol is allocated another number.
165
170
 
166
 
@subsubsection Add an entry to @code{_gnutls_extensions} in @code{gnutls_extensions.c}.
 
171
@subsubheading Add an entry to @code{_gnutls_extensions} in @code{gnutls_extensions.c}.
167
172
 
168
173
A typical entry would be:
169
174
 
203
208
Note that the conditional @code{ENABLE_FOOBAR} definition should only be 
204
209
used if step 1 with the @code{configure} options has taken place.
205
210
 
206
 
@subsubsection Add new files  that implement the extension.
 
211
@subsubheading Add new files  that implement the extension.
207
212
 
208
213
The functions you are responsible to add are those mentioned in the
209
214
previous step.  They should be added in a file such as @code{ext/@-foobar.c} 
304
309
endif
305
310
@end example
306
311
 
307
 
@subsubsection Add API functions to enable/disable the extension.
 
312
@subsubheading Add API functions to enable/disable the extension.
308
313
 
309
314
It might be desirable to allow users of the extension to
310
315
request use of the extension, or set extension specific data.  
370
375
optimization. For more information please consult the @acronym{GnuTLS}
371
376
source code in @code{lib/accelerated/}.
372
377
 
373
 
@subsubsection Overriding specific algorithms
 
378
@subsubheading Overriding specific algorithms
374
379
When an optimized implementation of a single algorithm is available,
375
380
say a hardware assisted version of @acronym{AES-CBC} then the
376
381
following (internal) functions, from @code{crypto-backend.h}, can 
389
394
Those registration functions will only replace the specified algorithm
390
395
and leave the rest of subsystem intact.
391
396
 
392
 
@subsubsection Overriding the cryptographic library
 
397
@subsubheading Overriding the cryptographic library
393
398
In some systems, that might contain a broad acceleration engine, it 
394
399
might be desirable to override big parts of the cryptographic backend, 
395
400
or even all of them. T following functions are provided for this reason.