Browse Source

Initial import

tags/r14.0.0
Timothy Pearson 7 years ago
commit
dbc765a8f2
12 changed files with 3413 additions and 0 deletions
  1. 504
    0
      COPYING
  2. 16
    0
      README
  3. 590
    0
      configure
  4. 80
    0
      openssl.qcm
  5. 5
    0
      prepare
  6. 1483
    0
      qca-tls.cpp
  7. 32
    0
      qca-tls.h
  8. 26
    0
      qca-tls.pro
  9. 9
    0
      qca-tls.qc
  10. 468
    0
      qca.h
  11. 191
    0
      qcaprovider.h
  12. 9
    0
      qcextra

+ 504
- 0
COPYING View File

@@ -0,0 +1,504 @@
1
+		  GNU LESSER GENERAL PUBLIC LICENSE
2
+		       Version 2.1, February 1999
3
+
4
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+[This is the first released version of the Lesser GPL.  It also counts
10
+ as the successor of the GNU Library Public License, version 2, hence
11
+ the version number 2.1.]
12
+
13
+			    Preamble
14
+
15
+  The licenses for most software are designed to take away your
16
+freedom to share and change it.  By contrast, the GNU General Public
17
+Licenses are intended to guarantee your freedom to share and change
18
+free software--to make sure the software is free for all its users.
19
+
20
+  This license, the Lesser General Public License, applies to some
21
+specially designated software packages--typically libraries--of the
22
+Free Software Foundation and other authors who decide to use it.  You
23
+can use it too, but we suggest you first think carefully about whether
24
+this license or the ordinary General Public License is the better
25
+strategy to use in any particular case, based on the explanations below.
26
+
27
+  When we speak of free software, we are referring to freedom of use,
28
+not price.  Our General Public Licenses are designed to make sure that
29
+you have the freedom to distribute copies of free software (and charge
30
+for this service if you wish); that you receive source code or can get
31
+it if you want it; that you can change the software and use pieces of
32
+it in new free programs; and that you are informed that you can do
33
+these things.
34
+
35
+  To protect your rights, we need to make restrictions that forbid
36
+distributors to deny you these rights or to ask you to surrender these
37
+rights.  These restrictions translate to certain responsibilities for
38
+you if you distribute copies of the library or if you modify it.
39
+
40
+  For example, if you distribute copies of the library, whether gratis
41
+or for a fee, you must give the recipients all the rights that we gave
42
+you.  You must make sure that they, too, receive or can get the source
43
+code.  If you link other code with the library, you must provide
44
+complete object files to the recipients, so that they can relink them
45
+with the library after making changes to the library and recompiling
46
+it.  And you must show them these terms so they know their rights.
47
+
48
+  We protect your rights with a two-step method: (1) we copyright the
49
+library, and (2) we offer you this license, which gives you legal
50
+permission to copy, distribute and/or modify the library.
51
+
52
+  To protect each distributor, we want to make it very clear that
53
+there is no warranty for the free library.  Also, if the library is
54
+modified by someone else and passed on, the recipients should know
55
+that what they have is not the original version, so that the original
56
+author's reputation will not be affected by problems that might be
57
+introduced by others.
58
+
59
+  Finally, software patents pose a constant threat to the existence of
60
+any free program.  We wish to make sure that a company cannot
61
+effectively restrict the users of a free program by obtaining a
62
+restrictive license from a patent holder.  Therefore, we insist that
63
+any patent license obtained for a version of the library must be
64
+consistent with the full freedom of use specified in this license.
65
+
66
+  Most GNU software, including some libraries, is covered by the
67
+ordinary GNU General Public License.  This license, the GNU Lesser
68
+General Public License, applies to certain designated libraries, and
69
+is quite different from the ordinary General Public License.  We use
70
+this license for certain libraries in order to permit linking those
71
+libraries into non-free programs.
72
+
73
+  When a program is linked with a library, whether statically or using
74
+a shared library, the combination of the two is legally speaking a
75
+combined work, a derivative of the original library.  The ordinary
76
+General Public License therefore permits such linking only if the
77
+entire combination fits its criteria of freedom.  The Lesser General
78
+Public License permits more lax criteria for linking other code with
79
+the library.
80
+
81
+  We call this license the "Lesser" General Public License because it
82
+does Less to protect the user's freedom than the ordinary General
83
+Public License.  It also provides other free software developers Less
84
+of an advantage over competing non-free programs.  These disadvantages
85
+are the reason we use the ordinary General Public License for many
86
+libraries.  However, the Lesser license provides advantages in certain
87
+special circumstances.
88
+
89
+  For example, on rare occasions, there may be a special need to
90
+encourage the widest possible use of a certain library, so that it becomes
91
+a de-facto standard.  To achieve this, non-free programs must be
92
+allowed to use the library.  A more frequent case is that a free
93
+library does the same job as widely used non-free libraries.  In this
94
+case, there is little to gain by limiting the free library to free
95
+software only, so we use the Lesser General Public License.
96
+
97
+  In other cases, permission to use a particular library in non-free
98
+programs enables a greater number of people to use a large body of
99
+free software.  For example, permission to use the GNU C Library in
100
+non-free programs enables many more people to use the whole GNU
101
+operating system, as well as its variant, the GNU/Linux operating
102
+system.
103
+
104
+  Although the Lesser General Public License is Less protective of the
105
+users' freedom, it does ensure that the user of a program that is
106
+linked with the Library has the freedom and the wherewithal to run
107
+that program using a modified version of the Library.
108
+
109
+  The precise terms and conditions for copying, distribution and
110
+modification follow.  Pay close attention to the difference between a
111
+"work based on the library" and a "work that uses the library".  The
112
+former contains code derived from the library, whereas the latter must
113
+be combined with the library in order to run.
114
+
115
+		  GNU LESSER GENERAL PUBLIC LICENSE
116
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117
+
118
+  0. This License Agreement applies to any software library or other
119
+program which contains a notice placed by the copyright holder or
120
+other authorized party saying it may be distributed under the terms of
121
+this Lesser General Public License (also called "this License").
122
+Each licensee is addressed as "you".
123
+
124
+  A "library" means a collection of software functions and/or data
125
+prepared so as to be conveniently linked with application programs
126
+(which use some of those functions and data) to form executables.
127
+
128
+  The "Library", below, refers to any such software library or work
129
+which has been distributed under these terms.  A "work based on the
130
+Library" means either the Library or any derivative work under
131
+copyright law: that is to say, a work containing the Library or a
132
+portion of it, either verbatim or with modifications and/or translated
133
+straightforwardly into another language.  (Hereinafter, translation is
134
+included without limitation in the term "modification".)
135
+
136
+  "Source code" for a work means the preferred form of the work for
137
+making modifications to it.  For a library, complete source code means
138
+all the source code for all modules it contains, plus any associated
139
+interface definition files, plus the scripts used to control compilation
140
+and installation of the library.
141
+
142
+  Activities other than copying, distribution and modification are not
143
+covered by this License; they are outside its scope.  The act of
144
+running a program using the Library is not restricted, and output from
145
+such a program is covered only if its contents constitute a work based
146
+on the Library (independent of the use of the Library in a tool for
147
+writing it).  Whether that is true depends on what the Library does
148
+and what the program that uses the Library does.
149
+  
150
+  1. You may copy and distribute verbatim copies of the Library's
151
+complete source code as you receive it, in any medium, provided that
152
+you conspicuously and appropriately publish on each copy an
153
+appropriate copyright notice and disclaimer of warranty; keep intact
154
+all the notices that refer to this License and to the absence of any
155
+warranty; and distribute a copy of this License along with the
156
+Library.
157
+
158
+  You may charge a fee for the physical act of transferring a copy,
159
+and you may at your option offer warranty protection in exchange for a
160
+fee.
161
+
162
+  2. You may modify your copy or copies of the Library or any portion
163
+of it, thus forming a work based on the Library, and copy and
164
+distribute such modifications or work under the terms of Section 1
165
+above, provided that you also meet all of these conditions:
166
+
167
+    a) The modified work must itself be a software library.
168
+
169
+    b) You must cause the files modified to carry prominent notices
170
+    stating that you changed the files and the date of any change.
171
+
172
+    c) You must cause the whole of the work to be licensed at no
173
+    charge to all third parties under the terms of this License.
174
+
175
+    d) If a facility in the modified Library refers to a function or a
176
+    table of data to be supplied by an application program that uses
177
+    the facility, other than as an argument passed when the facility
178
+    is invoked, then you must make a good faith effort to ensure that,
179
+    in the event an application does not supply such function or
180
+    table, the facility still operates, and performs whatever part of
181
+    its purpose remains meaningful.
182
+
183
+    (For example, a function in a library to compute square roots has
184
+    a purpose that is entirely well-defined independent of the
185
+    application.  Therefore, Subsection 2d requires that any
186
+    application-supplied function or table used by this function must
187
+    be optional: if the application does not supply it, the square
188
+    root function must still compute square roots.)
189
+
190
+These requirements apply to the modified work as a whole.  If
191
+identifiable sections of that work are not derived from the Library,
192
+and can be reasonably considered independent and separate works in
193
+themselves, then this License, and its terms, do not apply to those
194
+sections when you distribute them as separate works.  But when you
195
+distribute the same sections as part of a whole which is a work based
196
+on the Library, the distribution of the whole must be on the terms of
197
+this License, whose permissions for other licensees extend to the
198
+entire whole, and thus to each and every part regardless of who wrote
199
+it.
200
+
201
+Thus, it is not the intent of this section to claim rights or contest
202
+your rights to work written entirely by you; rather, the intent is to
203
+exercise the right to control the distribution of derivative or
204
+collective works based on the Library.
205
+
206
+In addition, mere aggregation of another work not based on the Library
207
+with the Library (or with a work based on the Library) on a volume of
208
+a storage or distribution medium does not bring the other work under
209
+the scope of this License.
210
+
211
+  3. You may opt to apply the terms of the ordinary GNU General Public
212
+License instead of this License to a given copy of the Library.  To do
213
+this, you must alter all the notices that refer to this License, so
214
+that they refer to the ordinary GNU General Public License, version 2,
215
+instead of to this License.  (If a newer version than version 2 of the
216
+ordinary GNU General Public License has appeared, then you can specify
217
+that version instead if you wish.)  Do not make any other change in
218
+these notices.
219
+
220
+  Once this change is made in a given copy, it is irreversible for
221
+that copy, so the ordinary GNU General Public License applies to all
222
+subsequent copies and derivative works made from that copy.
223
+
224
+  This option is useful when you wish to copy part of the code of
225
+the Library into a program that is not a library.
226
+
227
+  4. You may copy and distribute the Library (or a portion or
228
+derivative of it, under Section 2) in object code or executable form
229
+under the terms of Sections 1 and 2 above provided that you accompany
230
+it with the complete corresponding machine-readable source code, which
231
+must be distributed under the terms of Sections 1 and 2 above on a
232
+medium customarily used for software interchange.
233
+
234
+  If distribution of object code is made by offering access to copy
235
+from a designated place, then offering equivalent access to copy the
236
+source code from the same place satisfies the requirement to
237
+distribute the source code, even though third parties are not
238
+compelled to copy the source along with the object code.
239
+
240
+  5. A program that contains no derivative of any portion of the
241
+Library, but is designed to work with the Library by being compiled or
242
+linked with it, is called a "work that uses the Library".  Such a
243
+work, in isolation, is not a derivative work of the Library, and
244
+therefore falls outside the scope of this License.
245
+
246
+  However, linking a "work that uses the Library" with the Library
247
+creates an executable that is a derivative of the Library (because it
248
+contains portions of the Library), rather than a "work that uses the
249
+library".  The executable is therefore covered by this License.
250
+Section 6 states terms for distribution of such executables.
251
+
252
+  When a "work that uses the Library" uses material from a header file
253
+that is part of the Library, the object code for the work may be a
254
+derivative work of the Library even though the source code is not.
255
+Whether this is true is especially significant if the work can be
256
+linked without the Library, or if the work is itself a library.  The
257
+threshold for this to be true is not precisely defined by law.
258
+
259
+  If such an object file uses only numerical parameters, data
260
+structure layouts and accessors, and small macros and small inline
261
+functions (ten lines or less in length), then the use of the object
262
+file is unrestricted, regardless of whether it is legally a derivative
263
+work.  (Executables containing this object code plus portions of the
264
+Library will still fall under Section 6.)
265
+
266
+  Otherwise, if the work is a derivative of the Library, you may
267
+distribute the object code for the work under the terms of Section 6.
268
+Any executables containing that work also fall under Section 6,
269
+whether or not they are linked directly with the Library itself.
270
+
271
+  6. As an exception to the Sections above, you may also combine or
272
+link a "work that uses the Library" with the Library to produce a
273
+work containing portions of the Library, and distribute that work
274
+under terms of your choice, provided that the terms permit
275
+modification of the work for the customer's own use and reverse
276
+engineering for debugging such modifications.
277
+
278
+  You must give prominent notice with each copy of the work that the
279
+Library is used in it and that the Library and its use are covered by
280
+this License.  You must supply a copy of this License.  If the work
281
+during execution displays copyright notices, you must include the
282
+copyright notice for the Library among them, as well as a reference
283
+directing the user to the copy of this License.  Also, you must do one
284
+of these things:
285
+
286
+    a) Accompany the work with the complete corresponding
287
+    machine-readable source code for the Library including whatever
288
+    changes were used in the work (which must be distributed under
289
+    Sections 1 and 2 above); and, if the work is an executable linked
290
+    with the Library, with the complete machine-readable "work that
291
+    uses the Library", as object code and/or source code, so that the
292
+    user can modify the Library and then relink to produce a modified
293
+    executable containing the modified Library.  (It is understood
294
+    that the user who changes the contents of definitions files in the
295
+    Library will not necessarily be able to recompile the application
296
+    to use the modified definitions.)
297
+
298
+    b) Use a suitable shared library mechanism for linking with the
299
+    Library.  A suitable mechanism is one that (1) uses at run time a
300
+    copy of the library already present on the user's computer system,
301
+    rather than copying library functions into the executable, and (2)
302
+    will operate properly with a modified version of the library, if
303
+    the user installs one, as long as the modified version is
304
+    interface-compatible with the version that the work was made with.
305
+
306
+    c) Accompany the work with a written offer, valid for at
307
+    least three years, to give the same user the materials
308
+    specified in Subsection 6a, above, for a charge no more
309
+    than the cost of performing this distribution.
310
+
311
+    d) If distribution of the work is made by offering access to copy
312
+    from a designated place, offer equivalent access to copy the above
313
+    specified materials from the same place.
314
+
315
+    e) Verify that the user has already received a copy of these
316
+    materials or that you have already sent this user a copy.
317
+
318
+  For an executable, the required form of the "work that uses the
319
+Library" must include any data and utility programs needed for
320
+reproducing the executable from it.  However, as a special exception,
321
+the materials to be distributed need not include anything that is
322
+normally distributed (in either source or binary form) with the major
323
+components (compiler, kernel, and so on) of the operating system on
324
+which the executable runs, unless that component itself accompanies
325
+the executable.
326
+
327
+  It may happen that this requirement contradicts the license
328
+restrictions of other proprietary libraries that do not normally
329
+accompany the operating system.  Such a contradiction means you cannot
330
+use both them and the Library together in an executable that you
331
+distribute.
332
+
333
+  7. You may place library facilities that are a work based on the
334
+Library side-by-side in a single library together with other library
335
+facilities not covered by this License, and distribute such a combined
336
+library, provided that the separate distribution of the work based on
337
+the Library and of the other library facilities is otherwise
338
+permitted, and provided that you do these two things:
339
+
340
+    a) Accompany the combined library with a copy of the same work
341
+    based on the Library, uncombined with any other library
342
+    facilities.  This must be distributed under the terms of the
343
+    Sections above.
344
+
345
+    b) Give prominent notice with the combined library of the fact
346
+    that part of it is a work based on the Library, and explaining
347
+    where to find the accompanying uncombined form of the same work.
348
+
349
+  8. You may not copy, modify, sublicense, link with, or distribute
350
+the Library except as expressly provided under this License.  Any
351
+attempt otherwise to copy, modify, sublicense, link with, or
352
+distribute the Library is void, and will automatically terminate your
353
+rights under this License.  However, parties who have received copies,
354
+or rights, from you under this License will not have their licenses
355
+terminated so long as such parties remain in full compliance.
356
+
357
+  9. You are not required to accept this License, since you have not
358
+signed it.  However, nothing else grants you permission to modify or
359
+distribute the Library or its derivative works.  These actions are
360
+prohibited by law if you do not accept this License.  Therefore, by
361
+modifying or distributing the Library (or any work based on the
362
+Library), you indicate your acceptance of this License to do so, and
363
+all its terms and conditions for copying, distributing or modifying
364
+the Library or works based on it.
365
+
366
+  10. Each time you redistribute the Library (or any work based on the
367
+Library), the recipient automatically receives a license from the
368
+original licensor to copy, distribute, link with or modify the Library
369
+subject to these terms and conditions.  You may not impose any further
370
+restrictions on the recipients' exercise of the rights granted herein.
371
+You are not responsible for enforcing compliance by third parties with
372
+this License.
373
+
374
+  11. If, as a consequence of a court judgment or allegation of patent
375
+infringement or for any other reason (not limited to patent issues),
376
+conditions are imposed on you (whether by court order, agreement or
377
+otherwise) that contradict the conditions of this License, they do not
378
+excuse you from the conditions of this License.  If you cannot
379
+distribute so as to satisfy simultaneously your obligations under this
380
+License and any other pertinent obligations, then as a consequence you
381
+may not distribute the Library at all.  For example, if a patent
382
+license would not permit royalty-free redistribution of the Library by
383
+all those who receive copies directly or indirectly through you, then
384
+the only way you could satisfy both it and this License would be to
385
+refrain entirely from distribution of the Library.
386
+
387
+If any portion of this section is held invalid or unenforceable under any
388
+particular circumstance, the balance of the section is intended to apply,
389
+and the section as a whole is intended to apply in other circumstances.
390
+
391
+It is not the purpose of this section to induce you to infringe any
392
+patents or other property right claims or to contest validity of any
393
+such claims; this section has the sole purpose of protecting the
394
+integrity of the free software distribution system which is
395
+implemented by public license practices.  Many people have made
396
+generous contributions to the wide range of software distributed
397
+through that system in reliance on consistent application of that
398
+system; it is up to the author/donor to decide if he or she is willing
399
+to distribute software through any other system and a licensee cannot
400
+impose that choice.
401
+
402
+This section is intended to make thoroughly clear what is believed to
403
+be a consequence of the rest of this License.
404
+
405
+  12. If the distribution and/or use of the Library is restricted in
406
+certain countries either by patents or by copyrighted interfaces, the
407
+original copyright holder who places the Library under this License may add
408
+an explicit geographical distribution limitation excluding those countries,
409
+so that distribution is permitted only in or among countries not thus
410
+excluded.  In such case, this License incorporates the limitation as if
411
+written in the body of this License.
412
+
413
+  13. The Free Software Foundation may publish revised and/or new
414
+versions of the Lesser General Public License from time to time.
415
+Such new versions will be similar in spirit to the present version,
416
+but may differ in detail to address new problems or concerns.
417
+
418
+Each version is given a distinguishing version number.  If the Library
419
+specifies a version number of this License which applies to it and
420
+"any later version", you have the option of following the terms and
421
+conditions either of that version or of any later version published by
422
+the Free Software Foundation.  If the Library does not specify a
423
+license version number, you may choose any version ever published by
424
+the Free Software Foundation.
425
+
426
+  14. If you wish to incorporate parts of the Library into other free
427
+programs whose distribution conditions are incompatible with these,
428
+write to the author to ask for permission.  For software which is
429
+copyrighted by the Free Software Foundation, write to the Free
430
+Software Foundation; we sometimes make exceptions for this.  Our
431
+decision will be guided by the two goals of preserving the free status
432
+of all derivatives of our free software and of promoting the sharing
433
+and reuse of software generally.
434
+
435
+			    NO WARRANTY
436
+
437
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446
+
447
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456
+DAMAGES.
457
+
458
+		     END OF TERMS AND CONDITIONS
459
+
460
+           How to Apply These Terms to Your New Libraries
461
+
462
+  If you develop a new library, and you want it to be of the greatest
463
+possible use to the public, we recommend making it free software that
464
+everyone can redistribute and change.  You can do so by permitting
465
+redistribution under these terms (or, alternatively, under the terms of the
466
+ordinary General Public License).
467
+
468
+  To apply these terms, attach the following notices to the library.  It is
469
+safest to attach them to the start of each source file to most effectively
470
+convey the exclusion of warranty; and each file should have at least the
471
+"copyright" line and a pointer to where the full notice is found.
472
+
473
+    <one line to give the library's name and a brief idea of what it does.>
474
+    Copyright (C) <year>  <name of author>
475
+
476
+    This library is free software; you can redistribute it and/or
477
+    modify it under the terms of the GNU Lesser General Public
478
+    License as published by the Free Software Foundation; either
479
+    version 2.1 of the License, or (at your option) any later version.
480
+
481
+    This library is distributed in the hope that it will be useful,
482
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
483
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
484
+    Lesser General Public License for more details.
485
+
486
+    You should have received a copy of the GNU Lesser General Public
487
+    License along with this library; if not, write to the Free Software
488
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
489
+
490
+Also add information on how to contact you by electronic and paper mail.
491
+
492
+You should also get your employer (if you work as a programmer) or your
493
+school, if any, to sign a "copyright disclaimer" for the library, if
494
+necessary.  Here is a sample; alter the names:
495
+
496
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
497
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498
+
499
+  <signature of Ty Coon>, 1 April 1990
500
+  Ty Coon, President of Vice
501
+
502
+That's all there is to it!
503
+
504
+

+ 16
- 0
README View File

@@ -0,0 +1,16 @@
1
+TQCA TLS Plugin v1.0
2
+-------------------
3
+Author: Justin Karneges <justin@affinix.com>
4
+Date:   September 15th, 2003
5
+
6
+This is a plugin to provide SSL/TLS capability to programs that
7
+utilize the TQt Cryptographic Architecture (TQCA).
8
+
9
+Requirements:
10
+  OpenSSL Library (http://www.openssl.org/)
11
+
12
+Installation procedure:
13
+  ./configure
14
+  make
15
+  su -c "make install"
16
+

+ 590
- 0
configure View File

@@ -0,0 +1,590 @@
1
+#!/bin/sh
2
+
3
+show_usage() {
4
+cat <<EOT
5
+Usage: ./configure [OPTION]...
6
+
7
+This script creates necessary configuration files to build/install.
8
+
9
+Main options:
10
+  --qtdir=[path]    Directory where Qt is installed.
11
+  --help            This help text.
12
+
13
+Dependency options:
14
+  --with-openssl-inc=[path]    Path to OpenSSL include files
15
+  --with-openssl-lib=[path]    Path to OpenSSL library files
16
+
17
+EOT
18
+}
19
+
20
+while [ $# -gt 0 ]; do
21
+	case "$1" in
22
+		--qtdir=*)
23
+			QTDIR=`expr "${1}" : "--qtdir=\(.*\)"`
24
+			shift
25
+			;;
26
+
27
+		--with-openssl-inc=*)
28
+			QC_WITH_OPENSSL_INC=`expr "${1}" : "--with-openssl-inc=\(.*\)"`
29
+			shift
30
+			;;
31
+
32
+		--with-openssl-lib=*)
33
+			QC_WITH_OPENSSL_LIB=`expr "${1}" : "--with-openssl-lib=\(.*\)"`
34
+			shift
35
+			;;
36
+
37
+		--debug)
38
+			QC_DEBUG="Y"
39
+			shift
40
+			;;
41
+		--help) show_usage; exit ;;
42
+		*) show_usage; exit ;;
43
+	esac
44
+done
45
+
46
+
47
+echo "Configuring qca-tls ..."
48
+
49
+if [ "$QC_DEBUG" = "Y" ]; then
50
+echo
51
+echo QTDIR=$QTDIR
52
+echo QC_WITH_OPENSSL_INC=$QC_WITH_OPENSSL_INC
53
+echo QC_WITH_OPENSSL_LIB=$QC_WITH_OPENSSL_LIB
54
+echo
55
+fi
56
+
57
+printf "Verifying TQt 3.x Multithreaded (MT) build environment ... "
58
+
59
+if [ -z "$QTDIR" ]; then
60
+	if [ "$QC_DEBUG" = "Y" ]; then
61
+		echo \$QTDIR not set... trying to find Qt manually
62
+	fi
63
+	for p in /usr/lib/tqt /usr/share/tqt /usr/share/tqt3 /usr/local/lib/tqt /usr/local/share/tqt /usr/lib/tqt3 /usr/local/lib/tqt3 /usr/lib/qt /usr/share/qt /usr/share/qt3 /usr/local/lib/qt /usr/local/share/qt /usr/lib/qt3 /usr/local/lib/qt3 /usr/X11R6/share/qt /usr/qt/3 ; do
64
+		if [ -d "$p/mkspecs" ]; then
65
+			QTDIR=$p
66
+			break;
67
+		fi;
68
+	done
69
+	if [ -z "$QTDIR" ]; then
70
+		echo fail
71
+		echo
72
+		echo Unable to find Qt 'mkspecs'. Please set QTDIR
73
+		echo manually. Perhaps you need to install Qt 3
74
+		echo development utilities. You may download them either
75
+		echo from the vendor of your operating system or from
76
+		echo www.trolltech.com
77
+		echo
78
+		exit 1;
79
+	fi
80
+fi
81
+
82
+if [ ! -x "$QTDIR/bin/qmake" ]; then
83
+	if [ "$QC_DEBUG" = "Y" ]; then
84
+		echo Warning: qmake not in \$QTDIR/bin/qmake
85
+		echo trying to find it in \$PATH
86
+	fi
87
+	qm=`type -p qmake`
88
+	if [ -x "$qm" ]; then
89
+		if [ "$QC_DEBUG" = "Y" ]; then
90
+			echo qmake found in $qm
91
+		fi
92
+	else
93
+		echo fail
94
+		echo
95
+		echo Sorry, you seem to have a very unusual setup,
96
+		echo or I missdetected \$QTDIR=$QTDIR
97
+		echo
98
+		echo Please set \$QTDIR manually and make sure that
99
+		echo \$QTDIR/bin/qmake exists.
100
+		echo
101
+		exit 1;
102
+	fi
103
+else
104
+	qm=$QTDIR/bin/qmake
105
+fi
106
+
107
+gen_files() {
108
+cat >$1/modules.cpp <<EOT
109
+/*
110
+-----BEGIN QCMOD-----
111
+name: OpenSSL
112
+arg: with-openssl-inc=[path],Path to OpenSSL include files
113
+arg: with-openssl-lib=[path],Path to OpenSSL library files
114
+-----END QCMOD-----
115
+*/
116
+class qc_openssl : public ConfObj
117
+{
118
+public:
119
+	qc_openssl(Conf *c) : ConfObj(c) {}
120
+	TQString name() const { return "OpenSSL"; }
121
+	TQString shortname() const { return "openssl"; }
122
+	bool exec()
123
+	{
124
+		TQString inc, lib;
125
+		TQString s;
126
+		bool kb = false;
127
+		TQString kbdir = "/usr/kerberos/include";
128
+
129
+		// Redhat 9?
130
+		if(TQFileInfo(kbdir).exists())
131
+			kb = true;
132
+
133
+		s = conf->getenv("QC_WITH_OPENSSL_INC");
134
+		if(!s.isEmpty()) {
135
+			if(!conf->checkHeader(s, "openssl/ssl.h"))
136
+				return false;
137
+			inc = s;
138
+		}
139
+		else {
140
+			if(!conf->findHeader("openssl/ssl.h", TQStringList(), &s))
141
+				return false;
142
+			inc = s;
143
+		}
144
+
145
+		s = conf->getenv("QC_WITH_OPENSSL_LIB");
146
+		if(!s.isEmpty()) {
147
+			if(!conf->checkLibrary(s, "ssl"))
148
+				return false;
149
+			lib = s;
150
+		}
151
+		else {
152
+			if(!conf->findLibrary("ssl", &s))
153
+				return false;
154
+			lib = s;
155
+		}
156
+
157
+		// is it at least openssl 0.9.7?
158
+		TQString str =
159
+			"#include<openssl/opensslv.h>\n"
160
+			"int main()\n"
161
+			"{\n"
162
+			"  unsigned long x = OPENSSL_VERSION_NUMBER;\n"
163
+			"  if(x >= 0x00907000) return 0; else return 1;\n"
164
+			"}\n";
165
+		TQString ext;
166
+		if(!inc.isEmpty())
167
+			ext += TQString("-I") + inc + ' ';
168
+		if(kb)
169
+			ext += TQString("-I") + kbdir + ' ';
170
+		if(!lib.isEmpty())
171
+			ext += TQString("-L") + lib + " -lssl -lcrypto ";
172
+		int ret;
173
+		if(!conf->doCompileAndLink(str, ext, &ret))
174
+			return false;
175
+		if(ret == 0)
176
+			conf->addDefine("OSSL_097");
177
+
178
+		if(!inc.isEmpty())
179
+			conf->addIncludePath(inc);
180
+		if(kb)
181
+			conf->addIncludePath(kbdir);
182
+		if(!lib.isEmpty())
183
+			conf->addLib(TQString("-L") + s);
184
+		conf->addLib("-lssl -lcrypto");
185
+
186
+		// Make sure tqtinterface can be found
187
+		conf->addIncludePath("/usr/include/tqt");
188
+
189
+		return true;
190
+	}
191
+};
192
+
193
+EOT
194
+cat >$1/modules_new.cpp <<EOT
195
+    o = new qc_openssl(conf);
196
+    o->required = true;
197
+    o->disabled = false;
198
+
199
+EOT
200
+cat >$1/conf.cpp <<EOT
201
+#include<stdio.h>
202
+#include<stdlib.h>
203
+#include<qstring.h>
204
+#include<qdict.h>
205
+#include<qptrlist.h>
206
+#include<qfileinfo.h>
207
+#include<qfile.h>
208
+#include<qdir.h>
209
+#include<qstringlist.h>
210
+
211
+class Conf;
212
+
213
+class ConfObj
214
+{
215
+public:
216
+	ConfObj(Conf *c);
217
+	virtual ~ConfObj();
218
+
219
+	virtual TQString name() const=0;
220
+	virtual TQString shortname() const=0;
221
+	virtual bool exec()=0;
222
+
223
+	Conf *conf;
224
+	bool required;
225
+	bool disabled;
226
+};
227
+
228
+typedef TQPtrList<ConfObj> ConfObjList;
229
+typedef TQPtrListIterator<ConfObj> ConfObjListIt;
230
+
231
+class Conf
232
+{
233
+public:
234
+	Conf() : vars(17)
235
+	{
236
+		list.setAutoDelete(true);
237
+		vars.setAutoDelete(true);
238
+
239
+		vars.insert("QMAKE_INCDIR_X11", new TQString(X11_INC));
240
+		vars.insert("QMAKE_LIBDIR_X11", new TQString(X11_LIBDIR));
241
+		vars.insert("QMAKE_LIBS_X11",   new TQString(X11_LIB));
242
+		vars.insert("QMAKE_CC",         new TQString(CC));
243
+	}
244
+
245
+	~Conf()
246
+	{
247
+	}
248
+
249
+	void added(ConfObj *o)
250
+	{
251
+		list.append(o);
252
+	}
253
+
254
+	TQString getenv(const TQString &var)
255
+	{
256
+		char *p = ::getenv(var.latin1());
257
+		if(!p)
258
+			return TQString::null;
259
+		return TQString(p);
260
+	}
261
+
262
+	bool exec()
263
+	{
264
+		ConfObjListIt it(list);
265
+		for(ConfObj *o; (o = it.current()); ++it) {
266
+			// if this was a disabled-by-default option, check if it was enabled
267
+			if(o->disabled) {
268
+				TQString v = TQString("QC_ENABLE_") + o->shortname();
269
+				if(getenv(v) != "Y")
270
+					continue;
271
+			}
272
+			// and the opposite?
273
+			else {
274
+				TQString v = TQString("QC_DISABLE_") + o->shortname();
275
+				if(getenv(v) == "Y")
276
+					continue;
277
+			}
278
+
279
+			printf("Checking for %s ...", o->name().latin1());
280
+			fflush(stdout);
281
+			bool ok = o->exec();
282
+			if(ok)
283
+				printf(" yes\n");
284
+			else
285
+				printf(" no\n");
286
+			if(!ok && o->required) {
287
+				printf("\nError: need %s!\n", o->name().latin1());
288
+				return false;
289
+			}
290
+		}
291
+		return true;
292
+	}
293
+
294
+	const TQString & qvar(const TQString &s)
295
+	{
296
+		TQString *p = vars.find(s);
297
+		if(p)
298
+			return *p;
299
+		else
300
+			return blank;
301
+	}
302
+
303
+	TQString expandIncludes(const TQString &inc)
304
+	{
305
+		return TQString("-I") + inc;
306
+	}
307
+
308
+	TQString expandLibs(const TQString &lib)
309
+	{
310
+		return TQString("-L") + lib;
311
+	}
312
+
313
+	int doCommand(const TQString &s)
314
+	{
315
+		//printf("[%s]\n", s.latin1());
316
+		int r = system((s + " 1>/dev/null 2>/dev/null").latin1());
317
+		//printf("returned: %d\n", r);
318
+		return r;
319
+	}
320
+
321
+	bool doCompileAndLink(const TQString &filedata, const TQString &flags, int *retcode=0)
322
+	{
323
+		TQDir dir(".");
324
+		TQString fname = "atest.c";
325
+		TQString out = "atest";
326
+		TQFile f(fname);
327
+		TQCString cs = filedata.latin1();
328
+		if(!f.open(IO_WriteOnly | IO_Truncate))
329
+			return false;
330
+		f.writeBlock(cs.data(), cs.length());
331
+		f.close();
332
+
333
+		TQString str = qvar("QMAKE_CC") + ' ' + fname + " -o " + out + ' ' + flags;
334
+		int r = doCommand(str);
335
+		if(r == 0 && retcode)
336
+			*retcode = doCommand(TQString("./") + out);
337
+		dir.remove(fname);
338
+		dir.remove(out);
339
+		if(r != 0)
340
+			return false;
341
+		return true;
342
+	}
343
+
344
+	bool checkHeader(const TQString &path, const TQString &h)
345
+	{
346
+		TQFileInfo fi(path + '/' + h);
347
+		if(fi.exists())
348
+			return true;
349
+		return false;
350
+	}
351
+
352
+	bool findHeader(const TQString &h, const TQStringList &ext, TQString *inc)
353
+	{
354
+		if(checkHeader("/usr/include", h)) {
355
+			*inc = "";
356
+			return true;
357
+		}
358
+		TQStringList dirs;
359
+		dirs += "/usr/local/include";
360
+		dirs += ext;
361
+		for(TQStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) {
362
+			if(checkHeader(*it, h)) {
363
+				*inc = *it;
364
+				return true;
365
+			}
366
+		}
367
+		return false;
368
+	}
369
+
370
+	bool checkLibrary(const TQString &path, const TQString &name)
371
+	{
372
+		TQString str =
373
+			"int main()\n"
374
+			"{\n"
375
+			"    return 0;\n"
376
+			"}\n";
377
+
378
+		TQString extra;
379
+		if(!path.isEmpty())
380
+			extra += TQString("-L") + path + ' ';
381
+		extra += TQString("-l") + name;
382
+		if(!doCompileAndLink(str, extra))
383
+			return false;
384
+		return true;
385
+	}
386
+
387
+	bool findLibrary(const TQString &name, TQString *lib)
388
+	{
389
+		if(checkLibrary("", name)) {
390
+			*lib = "";
391
+			return true;
392
+		}
393
+		if(checkLibrary("/usr/local/lib", name)) {
394
+			*lib = "/usr/local/lib";
395
+			return true;
396
+		}
397
+		return false;
398
+	}
399
+
400
+	void addDefine(const TQString &str)
401
+	{
402
+		if(DEFINES.isEmpty())
403
+			DEFINES = str;
404
+		else
405
+			DEFINES += TQString(" ") + str;
406
+	}
407
+
408
+	void addLib(const TQString &str)
409
+	{
410
+		if(LIBS.isEmpty())
411
+			LIBS = str;
412
+		else
413
+			LIBS += TQString(" ") + str;
414
+	}
415
+
416
+	void addIncludePath(const TQString &str)
417
+	{
418
+		if(INCLUDEPATH.isEmpty())
419
+			INCLUDEPATH = str;
420
+		else
421
+			INCLUDEPATH += TQString(" ") + str;
422
+	}
423
+
424
+	void addExtra(const TQString &str)
425
+	{
426
+		extra += str + '\n';
427
+	}
428
+
429
+	TQString DEFINES;
430
+	TQString INCLUDEPATH;
431
+	TQString LIBS;
432
+	TQString extra;
433
+
434
+private:
435
+	ConfObjList list;
436
+	TQDict<TQString> vars;
437
+	TQString blank;
438
+};
439
+
440
+ConfObj::ConfObj(Conf *c)
441
+{
442
+	conf = c;
443
+	conf->added(this);
444
+	required = false;
445
+	disabled = false;
446
+}
447
+
448
+ConfObj::~ConfObj()
449
+{
450
+}
451
+
452
+#include"modules.cpp"
453
+
454
+//----------------------------------------------------------------------------
455
+// main
456
+//----------------------------------------------------------------------------
457
+int main()
458
+{
459
+	Conf *conf = new Conf;
460
+	ConfObj *o;
461
+	o = 0;
462
+#include"modules_new.cpp"
463
+
464
+	printf("ok\n");
465
+	bool success = false;
466
+	if(conf->exec()) {
467
+		TQFile f("conf.pri");
468
+		if(!f.open(IO_WriteOnly | IO_Truncate)) {
469
+			printf("Error writing %s\n", f.name().latin1());
470
+			return 1;
471
+		}
472
+
473
+		TQString str;
474
+		str += "# qconf\n";
475
+		str += "QT_PATH_PLUGINS = " + TQString(qInstallPathPlugins()) + '\n';
476
+		if(!conf->DEFINES.isEmpty())
477
+			str += "DEFINES += " + conf->DEFINES + '\n';
478
+		if(!conf->INCLUDEPATH.isEmpty())
479
+			str += "INCLUDEPATH += " + conf->INCLUDEPATH + '\n';
480
+		if(!conf->LIBS.isEmpty())
481
+			str += "LIBS += " + conf->LIBS + '\n';
482
+		if(!conf->extra.isEmpty())
483
+			str += conf->extra;
484
+		str += '\n';
485
+
486
+		char *p = getenv("BINDIR");
487
+		if(p) {
488
+			str += TQString("target.path = ") + p + '\n';
489
+			str += "INSTALLS += target\n";
490
+		}
491
+
492
+		TQCString cs = str.latin1();
493
+		f.writeBlock(cs.data(), cs.length());
494
+		f.close();
495
+		success = true;
496
+	}
497
+	delete conf;
498
+
499
+	if(success)
500
+		return 0;
501
+	else
502
+		return 1;
503
+}
504
+
505
+EOT
506
+cat >$1/conf.pro <<EOT
507
+TEMPLATE = app
508
+CONFIG += qt x11 thread console
509
+TARGET = conf
510
+
511
+DEFINES += X11_INC='"\$\$QMAKE_INCDIR_X11"'
512
+DEFINES += X11_LIBDIR='"\$\$QMAKE_LIBDIR_X11"'
513
+DEFINES += X11_LIB='"\$\$QMAKE_LIBS_X11"'
514
+DEFINES += CC='"\$\$QMAKE_CC"'
515
+
516
+SOURCES += conf.cpp
517
+
518
+EOT
519
+}
520
+
521
+export QTDIR
522
+export QC_WITH_OPENSSL_INC
523
+export QC_WITH_OPENSSL_LIB
524
+rm -rf .qconftemp
525
+(
526
+	mkdir .qconftemp
527
+	gen_files .qconftemp
528
+	cd .qconftemp
529
+	$qm conf.pro >/dev/null
530
+	QTDIR=$QTDIR make clean >/dev/null 2>&1
531
+	QTDIR=$QTDIR make >../conf.log 2>&1
532
+)
533
+
534
+if [ "$?" != "0" ]; then
535
+	rm -rf .qconftemp
536
+	echo fail
537
+	echo
538
+	echo "There was an error compiling 'conf'.  Be sure you have a proper"
539
+	echo "TQt 3.x Multithreaded (MT) build environment set up."
540
+	if [ ! -f "$QTDIR/lib/libtqt-mt.so.3" ]; then
541
+		echo
542
+		echo "One possible reason is that you don't have"
543
+		echo "libtqt-mt.so.3 installed in $QTDIR/lib/."
544
+	fi
545
+	echo
546
+	exit 1;
547
+fi
548
+
549
+.qconftemp/conf
550
+ret="$?"
551
+if [ "$ret" = "1" ]; then
552
+	rm -rf .qconftemp
553
+	echo
554
+	exit 1;
555
+else
556
+	if [ "$ret" != "0" ]; then
557
+		rm -rf .qconftemp
558
+		echo fail
559
+		echo
560
+		echo Unexpected error launching 'conf'
561
+		echo
562
+		exit 1;
563
+	fi
564
+fi
565
+rm -rf .qconftemp
566
+
567
+if [ -x "./qcextra" ]; then
568
+	./qcextra
569
+fi
570
+# run qmake
571
+if expr match "$DEB_BUILD_OPTIONS" ".*nostrip"; then
572
+	$qm QMAKE_STRIP=true qca-tls.pro
573
+else
574
+	$qm qca-tls.pro
575
+fi
576
+if [ "$?" != "0" ]; then
577
+	echo
578
+	exit 1;
579
+fi
580
+cat >Makefile.tmp <<EOT
581
+export QTDIR = $QTDIR
582
+EOT
583
+cat Makefile >> Makefile.tmp
584
+rm -f Makefile
585
+cp -f Makefile.tmp Makefile
586
+rm -f Makefile.tmp
587
+
588
+echo
589
+echo Good, your configure finished.  Now run \'make\'.
590
+echo

+ 80
- 0
openssl.qcm View File

@@ -0,0 +1,80 @@
1
+/*
2
+-----BEGIN QCMOD-----
3
+name: OpenSSL
4
+arg: with-openssl-inc=[path],Path to OpenSSL include files
5
+arg: with-openssl-lib=[path],Path to OpenSSL library files
6
+-----END QCMOD-----
7
+*/
8
+class qc_openssl : public ConfObj
9
+{
10
+public:
11
+	qc_openssl(Conf *c) : ConfObj(c) {}
12
+	QString name() const { return "OpenSSL"; }
13
+	QString shortname() const { return "openssl"; }
14
+	bool exec()
15
+	{
16
+		QString inc, lib;
17
+		QString s;
18
+		bool kb = false;
19
+		QString kbdir = "/usr/kerberos/include";
20
+
21
+		// Redhat 9?
22
+		if(QFileInfo(kbdir).exists())
23
+			kb = true;
24
+
25
+		s = conf->getenv("QC_WITH_OPENSSL_INC");
26
+		if(!s.isEmpty()) {
27
+			if(!conf->checkHeader(s, "openssl/ssl.h"))
28
+				return false;
29
+			inc = s;
30
+		}
31
+		else {
32
+			if(!conf->findHeader("openssl/ssl.h", QStringList(), &s))
33
+				return false;
34
+			inc = s;
35
+		}
36
+
37
+		s = conf->getenv("QC_WITH_OPENSSL_LIB");
38
+		if(!s.isEmpty()) {
39
+			if(!conf->checkLibrary(s, "ssl"))
40
+				return false;
41
+			lib = s;
42
+		}
43
+		else {
44
+			if(!conf->findLibrary("ssl", &s))
45
+				return false;
46
+			lib = s;
47
+		}
48
+
49
+		// is it at least openssl 0.9.7?
50
+		QString str =
51
+			"#include<openssl/opensslv.h>\n"
52
+			"int main()\n"
53
+			"{\n"
54
+			"  unsigned long x = OPENSSL_VERSION_NUMBER;\n"
55
+			"  if(x >= 0x00907000) return 0; else return 1;\n"
56
+			"}\n";
57
+		QString ext;
58
+		if(!inc.isEmpty())
59
+			ext += QString("-I") + inc + ' ';
60
+		if(kb)
61
+			ext += QString("-I") + kbdir + ' ';
62
+		if(!lib.isEmpty())
63
+			ext += QString("-L") + lib + " -lssl -lcrypto ";
64
+		int ret;
65
+		if(!conf->doCompileAndLink(str, ext, &ret))
66
+			return false;
67
+		if(ret == 0)
68
+			conf->addDefine("OSSL_097");
69
+
70
+		if(!inc.isEmpty())
71
+			conf->addIncludePath(inc);
72
+		if(kb)
73
+			conf->addIncludePath(kbdir);
74
+		if(!lib.isEmpty())
75
+			conf->addLib(QString("-L") + s);
76
+		conf->addLib("-lssl -lcrypto");
77
+
78
+		return true;
79
+	}
80
+};

+ 5
- 0
prepare View File

@@ -0,0 +1,5 @@
1
+#!/bin/sh
2
+
3
+cp ../../src/qca.h .
4
+cp ../../src/qcaprovider.h .
5
+

+ 1483
- 0
qca-tls.cpp
File diff suppressed because it is too large
View File


+ 32
- 0
qca-tls.h View File

@@ -0,0 +1,32 @@
1
+/*
2
+ * qca-tls.h - TLS plugin for TQCA
3
+ * Copyright (C) 2003  Justin Karneges
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
+ *
19
+ */
20
+
21
+#ifndef TQCA_TLS_H
22
+#define TQCA_TLS_H
23
+
24
+#include"qcaprovider.h"
25
+
26
+#ifdef TQCA_PLUGIN
27
+TQCA_PLUGIN_EXPORT TQCAProvider *createProvider();
28
+#else
29
+TQCAProvider *createProviderTLS();
30
+#endif
31
+
32
+#endif

+ 26
- 0
qca-tls.pro View File

@@ -0,0 +1,26 @@
1
+# qca-tls qmake profile
2
+
3
+TEMPLATE = lib
4
+CONFIG  += qt thread release plugin
5
+TARGET   = qca-tls
6
+
7
+!exists(qcaprovider.h) {
8
+  Q_PREFIX = ../../src
9
+  INCLUDEPATH += $$Q_PREFIX
10
+}
11
+HEADERS += ($$Q_PREFIX)qcaprovider.h
12
+
13
+HEADERS = qca-tls.h
14
+SOURCES = qca-tls.cpp
15
+
16
+DEFINES += QCA_PLUGIN
17
+win32:{
18
+	DEFINES += QCA_PLUGIN_DLL OSSL_097
19
+	INCLUDEPATH += c:\local\include
20
+	LIBS += c:\local\lib\libeay32.lib c:\local\lib\ssleay32.lib
21
+}
22
+
23
+include(conf.pri)
24
+include(extra.pri)
25
+
26
+QMAKE_PROJECT_DEPTH=0

+ 9
- 0
qca-tls.qc View File

@@ -0,0 +1,9 @@
1
+<qconf>
2
+ <name>qca-tls</name>
3
+ <profile>qca-tls.pro</profile>
4
+ <noprefix/>
5
+ <dep type='openssl'>
6
+  <required/>
7
+ </dep>
8
+ <moddir>.</moddir>
9
+</qconf>

+ 468
- 0
qca.h View File

@@ -0,0 +1,468 @@
1
+/*
2
+ * qca.h - TQt Cryptographic Architecture
3
+ * Copyright (C) 2003  Justin Karneges
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
+ *
19
+ */
20
+
21
+#ifndef TQCA_H
22
+#define TQCA_H
23
+
24
+#include<tqstring.h>
25
+#include<tqcstring.h>
26
+#include<tqdatetime.h>
27
+#include<tqmap.h>
28
+#include<tqptrlist.h>
29
+#include<tqobject.h>
30
+
31
+#ifdef Q_OS_WIN32
32
+#  ifndef TQCA_STATIC
33
+#    ifdef TQCA_MAKEDLL
34
+#      define TQCA_EXPORT __declspec(dllexport)
35
+#    else
36
+#      define TQCA_EXPORT __declspec(dllimport)
37
+#    endif
38
+#  endif
39
+#endif
40
+#ifndef TQCA_EXPORT
41
+#define TQCA_EXPORT
42
+#endif
43
+
44
+#ifdef Q_OS_WIN32
45
+#  ifdef TQCA_PLUGIN_DLL
46
+#    define TQCA_PLUGIN_EXPORT extern "C" __declspec(dllexport)
47
+#  else
48
+#    define TQCA_PLUGIN_EXPORT extern "C" __declspec(dllimport)
49
+#  endif
50
+#endif
51
+#ifndef TQCA_PLUGIN_EXPORT
52
+#define TQCA_PLUGIN_EXPORT extern "C"
53
+#endif
54
+
55
+class TQHostAddress;
56
+class TQStringList;
57
+
58
+class TQCAProvider;
59
+class TQCA_HashContext;
60
+class TQCA_CipherContext;
61
+class TQCA_CertContext;
62
+
63
+namespace TQCA
64
+{
65
+	enum {
66
+		CAP_SHA1      = 0x0001,
67
+		CAP_SHA256    = 0x0002,
68
+		CAP_MD5       = 0x0004,
69
+		CAP_BlowFish  = 0x0008,
70
+		CAP_TripleDES = 0x0010,
71
+		CAP_AES128    = 0x0020,
72
+		CAP_AES256    = 0x0040,
73
+		CAP_RSA       = 0x0080,
74
+		CAP_X509      = 0x0100,
75
+		CAP_TLS       = 0x0200,
76
+		CAP_SASL      = 0x0400
77
+	};
78
+
79
+	enum {
80
+		CBC = 0x0001,
81
+		CFB = 0x0002
82
+	};
83
+
84
+	enum {
85
+		Encrypt = 0x0001,
86
+		Decrypt = 0x0002
87
+	};
88
+
89
+	TQCA_EXPORT void init();
90
+	TQCA_EXPORT bool isSupported(int capabilities);
91
+	TQCA_EXPORT void insertProvider(TQCAProvider *);
92
+	TQCA_EXPORT void unloadAllPlugins();
93
+
94
+	TQCA_EXPORT TQString arrayToHex(const TQByteArray &);
95
+	TQCA_EXPORT TQByteArray hexToArray(const TQString &);
96
+
97
+	class TQCA_EXPORT Hash
98
+	{
99
+	public:
100
+		Hash(const Hash &);
101
+		Hash & operator=(const Hash &);
102
+		~Hash();
103
+
104
+		void clear();
105
+		void update(const TQByteArray &a);
106
+		TQByteArray final();
107
+
108
+	protected:
109
+		Hash(TQCA_HashContext *);
110
+
111
+	private:
112
+		class Private;
113
+		Private *d;
114
+	};
115
+
116
+	template <class T>
117
+	class TQCA_EXPORT HashStatic
118
+	{
119
+	public:
120
+		HashStatic<T>() {}
121
+
122
+		static TQByteArray hash(const TQByteArray &a)
123
+		{
124
+			T obj;
125
+			obj.update(a);
126
+			return obj.final();
127
+		}
128
+
129
+		static TQByteArray hash(const TQCString &cs)
130
+		{
131
+			TQByteArray a(cs.length());
132
+			memcpy(a.data(), cs.data(), a.size());
133
+			return hash(a);
134
+		}
135
+
136
+		static TQString hashToString(const TQByteArray &a)
137
+		{
138
+			return arrayToHex(hash(a));
139
+		}
140
+
141
+		static TQString hashToString(const TQCString &cs)
142
+		{
143
+			return arrayToHex(hash(cs));
144
+		}
145
+	};
146
+
147
+	class TQCA_EXPORT Cipher
148
+	{
149
+	public:
150
+		Cipher(const Cipher &);
151
+		Cipher & operator=(const Cipher &);
152
+		~Cipher();
153
+
154
+		TQByteArray dyn_generateKey(int size=-1) const;
155
+		TQByteArray dyn_generateIV() const;
156
+		void reset(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad=true);
157
+		bool update(const TQByteArray &a);
158
+		TQByteArray final(bool *ok=0);
159
+
160
+	protected:
161
+		Cipher(TQCA_CipherContext *, int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad);
162
+
163
+	private:
164
+		class Private;
165
+		Private *d;
166
+	};
167
+
168
+	template <class T>
169
+	class TQCA_EXPORT CipherStatic
170
+	{
171
+	public:
172
+		CipherStatic<T>() {}
173
+
174
+		static TQByteArray generateKey(int size=-1)
175
+		{
176
+			T obj;
177
+			return obj.dyn_generateKey(size);
178
+		}
179
+
180
+		static TQByteArray generateIV()
181
+		{
182
+			T obj;
183
+			return obj.dyn_generateIV();
184
+		}
185
+	};
186
+
187
+	class TQCA_EXPORT SHA1 : public Hash, public HashStatic<SHA1>
188
+	{
189
+	public:
190
+		SHA1();
191
+	};
192
+
193
+	class TQCA_EXPORT SHA256 : public Hash, public HashStatic<SHA256>
194
+	{
195
+	public:
196
+		SHA256();
197
+	};
198
+
199
+	class TQCA_EXPORT MD5 : public Hash, public HashStatic<MD5>
200
+	{
201
+	public:
202
+		MD5();
203
+	};
204
+
205
+	class TQCA_EXPORT BlowFish : public Cipher, public CipherStatic<BlowFish>
206
+	{
207
+	public:
208
+		BlowFish(int dir=Encrypt, int mode=CBC, const TQByteArray &key=TQByteArray(), const TQByteArray &iv=TQByteArray(), bool pad=true);
209
+	};
210
+
211
+	class TQCA_EXPORT TripleDES : public Cipher, public CipherStatic<TripleDES>
212
+	{
213
+	public:
214
+		TripleDES(int dir=Encrypt, int mode=CBC, const TQByteArray &key=TQByteArray(), const TQByteArray &iv=TQByteArray(), bool pad=true);
215
+	};
216
+
217
+	class TQCA_EXPORT AES128 : public Cipher, public CipherStatic<AES128>
218
+	{
219
+	public:
220
+		AES128(int dir=Encrypt, int mode=CBC, const TQByteArray &key=TQByteArray(), const TQByteArray &iv=TQByteArray(), bool pad=true);
221
+	};
222
+
223
+	class TQCA_EXPORT AES256 : public Cipher, public CipherStatic<AES256>
224
+	{
225
+	public:
226
+		AES256(int dir=Encrypt, int mode=CBC, const TQByteArray &key=TQByteArray(), const TQByteArray &iv=TQByteArray(), bool pad=true);
227
+	};
228
+
229
+	class RSA;
230
+	class TQCA_EXPORT RSAKey
231
+	{
232
+	public:
233
+		RSAKey();
234
+		RSAKey(const RSAKey &from);
235
+		RSAKey & operator=(const RSAKey &from);
236
+		~RSAKey();
237
+
238
+		bool isNull() const;
239
+		bool havePublic() const;
240
+		bool havePrivate() const;
241
+
242
+		TQByteArray toDER(bool publicOnly=false) const;
243
+		bool fromDER(const TQByteArray &a);
244
+
245
+		TQString toPEM(bool publicOnly=false) const;
246
+		bool fromPEM(const TQString &);
247
+
248
+		// only call if you know what you are doing
249
+		bool fromNative(void *);
250
+
251
+	private:
252
+		class Private;
253
+		Private *d;
254
+
255
+		friend class RSA;
256
+		friend class TLS;
257
+		bool encrypt(const TQByteArray &a, TQByteArray *out, bool oaep) const;
258
+		bool decrypt(const TQByteArray &a, TQByteArray *out, bool oaep) const;
259
+		bool generate(unsigned int bits);
260
+	};
261
+
262
+	class TQCA_EXPORT RSA
263
+	{
264
+	public:
265
+		RSA();
266
+		~RSA();
267
+
268
+		RSAKey key() const;
269
+		void setKey(const RSAKey &);
270
+
271
+		bool encrypt(const TQByteArray &a, TQByteArray *out, bool oaep=false) const;
272
+		bool decrypt(const TQByteArray &a, TQByteArray *out, bool oaep=false) const;
273
+
274
+		static RSAKey generateKey(unsigned int bits);
275
+
276
+	private:
277
+		RSAKey v_key;
278
+	};
279
+
280
+	typedef TQMap<TQString, TQString> CertProperties;
281
+	class TQCA_EXPORT Cert
282
+	{
283
+	public:
284
+		Cert();
285
+		Cert(const Cert &);
286
+		Cert & operator=(const Cert &);
287
+		~Cert();
288
+
289
+		bool isNull() const;
290
+
291
+		TQString commonName() const;
292
+		TQString serialNumber() const;
293
+		TQString subjectString() const;
294
+		TQString issuerString() const;
295
+		CertProperties subject() const;
296
+		CertProperties issuer() const;
297
+		TQDateTime notBefore() const;
298
+		TQDateTime notAfter() const;
299
+
300
+		TQByteArray toDER() const;
301
+		bool fromDER(const TQByteArray &a);
302
+
303
+		TQString toPEM() const;
304
+		bool fromPEM(const TQString &);
305
+
306
+	private:
307
+		class Private;
308
+		Private *d;
309
+
310
+		friend class TLS;
311
+		void fromContext(TQCA_CertContext *);
312
+	};
313
+
314
+	class TQCA_EXPORT TLS : public TQObject
315
+	{
316
+		Q_OBJECT
317
+  TQ_OBJECT
318
+	public:
319
+		enum Validity {
320
+			NoCert,
321
+			Valid,
322
+			HostMismatch,
323
+			Rejected,
324
+			Untrusted,
325
+			SignatureFailed,
326
+			InvalidCA,
327
+			InvalidPurpose,
328
+			SelfSigned,
329
+			Revoked,
330
+			PathLengthExceeded,
331
+			Expired,
332
+			Unknown
333
+		};
334
+		enum Error { ErrHandshake, ErrCrypt };
335
+
336
+		TLS(TQObject *parent=0);
337
+		~TLS();
338
+
339
+		void setCertificate(const Cert &cert, const RSAKey &key);
340
+		void setCertificateStore(const TQPtrList<Cert> &store);  // note: store must persist
341
+
342
+		void reset();
343
+		bool startClient(const TQString &host="");
344
+		bool startServer();
345
+		void close();
346
+		bool isHandshaken() const;
347
+
348
+		// plain (application side)
349
+		void write(const TQByteArray &a);
350
+		TQByteArray read();
351
+
352
+		// encoded (socket side)
353
+		void writeIncoming(const TQByteArray &a);
354
+		TQByteArray readOutgoing();
355
+		TQByteArray readUnprocessed();
356
+
357
+		// cert related
358
+		const Cert & peerCertificate() const;
359
+		int certificateValidityResult() const;
360
+
361
+	signals:
362
+		void handshaken();
363
+		void readyRead();
364
+		void readyReadOutgoing(int plainBytes);
365
+		void closed();
366
+		void error(int);
367
+
368
+	private slots:
369
+		void update();
370
+
371
+	private:
372
+		class Private;
373
+		Private *d;
374
+	};
375
+
376
+	class TQCA_EXPORT SASL : public TQObject
377
+	{
378
+		Q_OBJECT
379
+  TQ_OBJECT
380
+	public:
381
+		enum Error { ErrAuth, ErrCrypt };
382
+		enum ErrorCond {
383
+			NoMech,
384
+			BadProto,
385
+			BadServ,
386
+			BadAuth,
387
+			NoAuthzid,
388
+			TooWeak,
389
+			NeedEncrypt,
390
+			Expired,
391
+			Disabled,
392
+			NoUser,
393
+			RemoteUnavail
394
+		};
395
+		SASL(TQObject *parent=0);
396
+		~SASL();
397
+
398
+		static void setAppName(const TQString &name);
399
+
400
+		void reset();
401
+		int errorCondition() const;
402
+
403
+		// options
404
+		void setAllowPlain(bool);
405
+		void setAllowAnonymous(bool);
406
+		void setAllowActiveVulnerable(bool);
407
+		void setAllowDictionaryVulnerable(bool);
408
+		void setRequireForwardSecrecy(bool);
409
+		void setRequirePassCredentials(bool);
410
+		void setRequireMutualAuth(bool);
411
+
412
+		void setMinimumSSF(int);
413
+		void setMaximumSSF(int);
414
+		void setExternalAuthID(const TQString &authid);
415
+		void setExternalSSF(int);
416
+
417
+		void setLocalAddr(const TQHostAddress &addr, TQ_UINT16 port);
418
+		void setRemoteAddr(const TQHostAddress &addr, TQ_UINT16 port);
419
+
420
+		// initialize
421
+		bool startClient(const TQString &service, const TQString &host, const TQStringList &mechlist, bool allowClientSendFirst=true);
422
+		bool startServer(const TQString &service, const TQString &host, const TQString &realm, TQStringList *mechlist);
423
+
424
+		// authentication
425
+		void putStep(const TQByteArray &stepData);
426
+		void putServerFirstStep(const TQString &mech);
427
+		void putServerFirstStep(const TQString &mech, const TQByteArray &clientInit);
428
+		void setUsername(const TQString &user);
429
+		void setAuthzid(const TQString &auth);
430
+		void setPassword(const TQString &pass);
431
+		void setRealm(const TQString &realm);
432
+		void continueAfterParams();
433
+		void continueAfterAuthCheck();
434
+
435
+		// security layer
436
+		int ssf() const;
437
+		void write(const TQByteArray &a);
438
+		TQByteArray read();
439
+		void writeIncoming(const TQByteArray &a);
440
+		TQByteArray readOutgoing();
441
+
442
+	signals:
443
+		// for authentication
444
+		void clientFirstStep(const TQString &mech, const TQByteArray *clientInit);
445
+		void nextStep(const TQByteArray &stepData);
446
+		void needParams(bool user, bool authzid, bool pass, bool realm);
447
+		void authCheck(const TQString &user, const TQString &authzid);
448
+		void authenticated();
449
+
450
+		// for security layer
451
+		void readyRead();
452
+		void readyReadOutgoing(int plainBytes);
453
+
454
+		// error
455
+		void error(int);
456
+
457
+	private slots:
458
+		void tryAgain();
459
+
460
+	private:
461
+		class Private;
462
+		Private *d;
463
+
464
+		void handleServerFirstStep(int r);
465
+	};
466
+};
467
+
468
+#endif

+ 191
- 0
qcaprovider.h View File

@@ -0,0 +1,191 @@
1
+/*
2
+ * qcaprovider.h - TQCA Plugin API
3
+ * Copyright (C) 2003  Justin Karneges
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
+ *
19
+ */
20
+
21
+#ifndef TQCAPROVIDER_H
22
+#define TQCAPROVIDER_H
23
+
24
+#include<tqglobal.h>
25
+#include<tqstring.h>
26
+#include<tqdatetime.h>
27
+#include<tqobject.h>
28
+#include<tqhostaddress.h>
29
+#include"qca.h"
30
+
31
+#define TQCA_PLUGIN_VERSION 1
32
+
33
+class TQCAProvider
34
+{
35
+public:
36
+	TQCAProvider() {}
37
+	virtual ~TQCAProvider() {}
38
+
39
+	virtual void init()=0;
40
+	virtual int qcaVersion() const=0;
41
+	virtual int capabilities() const=0;
42
+	virtual void *context(int cap)=0;
43
+};
44
+
45
+class TQCA_HashContext
46
+{
47
+public:
48
+	virtual ~TQCA_HashContext() {}
49
+
50
+	virtual TQCA_HashContext *clone()=0;
51
+	virtual void reset()=0;
52
+	virtual void update(const char *in, unsigned int len)=0;
53
+	virtual void final(TQByteArray *out)=0;
54
+};
55
+
56
+class TQCA_CipherContext
57
+{
58
+public:
59
+	virtual ~TQCA_CipherContext() {}
60
+
61
+	virtual TQCA_CipherContext *clone()=0;
62
+	virtual int keySize()=0;
63
+	virtual int blockSize()=0;
64
+	virtual bool generateKey(char *out, int keysize=-1)=0;
65
+	virtual bool generateIV(char *out)=0;
66
+
67
+	virtual bool setup(int dir, int mode, const char *key, int keysize, const char *iv, bool pad)=0;
68
+	virtual bool update(const char *in, unsigned int len)=0;
69
+	virtual bool final(TQByteArray *out)=0;
70
+};
71
+
72
+class TQCA_RSAKeyContext
73
+{
74
+public:
75
+	virtual ~TQCA_RSAKeyContext() {}
76
+
77
+	virtual TQCA_RSAKeyContext *clone() const=0;
78
+	virtual bool isNull() const=0;
79
+	virtual bool havePublic() const=0;
80
+	virtual bool havePrivate() const=0;
81
+	virtual bool createFromDER(const char *in, unsigned int len)=0;
82
+	virtual bool createFromPEM(const char *in, unsigned int len)=0;
83
+	virtual bool createFromNative(void *in)=0;
84
+	virtual bool generate(unsigned int bits)=0;
85
+	virtual bool toDER(TQByteArray *out, bool publicOnly)=0;
86
+	virtual bool toPEM(TQByteArray *out, bool publicOnly)=0;
87
+
88
+	virtual bool encrypt(const TQByteArray &in, TQByteArray *out, bool oaep)=0;
89
+	virtual bool decrypt(const TQByteArray &in, TQByteArray *out, bool oaep)=0;
90
+};
91
+
92
+struct TQCA_CertProperty
93
+{
94
+	TQString var;
95
+	TQString val;
96
+};
97
+
98
+class TQCA_CertContext
99
+{
100
+public:
101
+	virtual ~TQCA_CertContext() {}
102
+
103
+	virtual TQCA_CertContext *clone() const=0;
104
+	virtual bool isNull() const=0;
105
+	virtual bool createFromDER(const char *in, unsigned int len)=0;
106
+	virtual bool createFromPEM(const char *in, unsigned int len)=0;
107
+	virtual bool toDER(TQByteArray *out)=0;
108
+	virtual bool toPEM(TQByteArray *out)=0;
109
+
110
+	virtual TQString serialNumber() const=0;
111
+	virtual TQString subjectString() const=0;
112
+	virtual TQString issuerString() const=0;
113
+	virtual TQValueList<TQCA_CertProperty> subject() const=0;
114
+	virtual TQValueList<TQCA_CertProperty> issuer() const=0;
115
+	virtual TQDateTime notBefore() const=0;
116
+	virtual TQDateTime notAfter() const=0;
117
+	virtual bool matchesAddress(const TQString &realHost) const=0;
118
+};
119
+
120
+class TQCA_TLSContext
121
+{
122
+public:
123
+	enum Result { Success, Error, Continue };
124
+	virtual ~TQCA_TLSContext() {}
125
+
126
+	virtual void reset()=0;
127
+	virtual bool startClient(const TQPtrList<TQCA_CertContext> &store, const TQCA_CertContext &cert, const TQCA_RSAKeyContext &key)=0;
128
+	virtual bool startServer(const TQPtrList<TQCA_CertContext> &store, const TQCA_CertContext &cert, const TQCA_RSAKeyContext &key)=0;
129
+
130
+	virtual int handshake(const TQByteArray &in, TQByteArray *out)=0;
131
+	virtual int shutdown(const TQByteArray &in, TQByteArray *out)=0;
132
+	virtual bool encode(const TQByteArray &plain, TQByteArray *to_net, int *encoded)=0;
133
+	virtual bool decode(const TQByteArray &from_net, TQByteArray *plain, TQByteArray *to_net)=0;
134
+	virtual bool eof() const=0;
135
+	virtual TQByteArray unprocessed()=0;
136
+
137
+	virtual TQCA_CertContext *peerCertificate() const=0;
138
+	virtual int validityResult() const=0;
139
+};
140
+
141
+struct TQCA_SASLHostPort
142
+{
143
+	TQHostAddress addr;
144
+	TQ_UINT16 port;
145
+};
146
+
147
+struct TQCA_SASLNeedParams
148
+{
149
+	bool user, authzid, pass, realm;
150
+};
151
+
152
+class TQCA_SASLContext
153
+{
154
+public:
155
+	enum Result { Success, Error, NeedParams, AuthCheck, Continue };
156
+	virtual ~TQCA_SASLContext() {}
157
+
158
+	// common
159
+	virtual void reset()=0;
160
+	virtual void setCoreProps(const TQString &service, const TQString &host, TQCA_SASLHostPort *local, TQCA_SASLHostPort *remote)=0;
161
+	virtual void setSecurityProps(bool noPlain, bool noActive, bool noDict, bool noAnon, bool reqForward, bool reqCreds, bool reqMutual, int ssfMin, int ssfMax, const TQString &_ext_authid, int _ext_ssf)=0;
162
+	virtual int security() const=0;
163
+	virtual int errorCond() const=0;
164
+
165
+	// init / first step
166
+	virtual bool clientStart(const TQStringList &mechlist)=0;
167
+	virtual int clientFirstStep(bool allowClientSendFirst)=0;
168
+	virtual bool serverStart(const TQString &realm, TQStringList *mechlist, const TQString &name)=0;
169
+	virtual int serverFirstStep(const TQString &mech, const TQByteArray *in)=0;
170
+
171
+	// get / set params
172
+	virtual TQCA_SASLNeedParams clientParamsNeeded() const=0;
173
+	virtual void setClientParams(const TQString *user, const TQString *authzid, const TQString *pass, const TQString *realm)=0;
174
+	virtual TQString username() const=0;
175
+	virtual TQString authzid() const=0;
176
+
177
+	// continue steps
178
+	virtual int nextStep(const TQByteArray &in)=0;
179
+	virtual int tryAgain()=0;
180
+
181
+	// results
182
+	virtual TQString mech() const=0;
183
+	virtual const TQByteArray *clientInit() const=0;
184
+	virtual TQByteArray result() const=0;
185
+
186
+	// security layer
187
+	virtual bool encode(const TQByteArray &in, TQByteArray *out)=0;
188
+	virtual bool decode(const TQByteArray &in, TQByteArray *out)=0;
189
+};
190
+
191
+#endif

+ 9
- 0
qcextra View File

@@ -0,0 +1,9 @@
1
+#!/bin/sh
2
+
3
+cat >extra.pri <<EOT
4
+target.path=\$\$QT_PATH_PLUGINS/crypto
5
+INSTALLS += target
6
+
7
+INSTALL_ROOT = $PREFIX
8
+
9
+EOT

Loading…
Cancel
Save