~ubuntu-branches/ubuntu/trusty/gnutls26/trusty

« back to all changes in this revision

Viewing changes to src/serv-gaa.c

  • Committer: Package Import Robot
  • Author(s): Andreas Metzler
  • Date: 2011-10-01 15:28:13 UTC
  • mfrom: (12.1.20 sid)
  • Revision ID: package-import@ubuntu.com-20111001152813-yygm1c4cxonfxhzy
* New upstream version.
  + Allow CA importing of 0 certificates to succeed. Closes: #640639
* Add libp11-kit-dev to libgnutls-dev dependencies. (see #643811)
* [20_guiledocstring.diff] guile: Fix docstring extraction with CPP 4.5+.

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
        __gaa_helpsingle(0, "echo", "", "Act as an Echo Server.");
136
136
        __gaa_helpsingle(0, "dhparams", "FILE ", "DH params file to use.");
137
137
        __gaa_helpsingle(0, "x509fmtder", "", "Use DER format for certificates");
138
 
        __gaa_helpsingle(0, "x509cafile", "FILE ", "Certificate file to use.");
 
138
        __gaa_helpsingle(0, "x509cafile", "FILE ", "Certificate file or PKCS #11 URL to use.");
139
139
        __gaa_helpsingle(0, "x509crlfile", "FILE ", "CRL file to use.");
140
140
        __gaa_helpsingle(0, "pgpkeyring", "FILE ", "PGP Key ring file to use.");
141
141
        __gaa_helpsingle(0, "pgpkeyfile", "FILE ", "PGP Key file to use.");
142
142
        __gaa_helpsingle(0, "pgpcertfile", "FILE ", "PGP Public Key (certificate) file to use.");
143
143
        __gaa_helpsingle(0, "pgpsubkey", "HEX|auto ", "PGP subkey to use.");
144
 
        __gaa_helpsingle(0, "x509keyfile", "FILE ", "X.509 key file to use.");
145
 
        __gaa_helpsingle(0, "x509certfile", "FILE ", "X.509 Certificate file to use.");
 
144
        __gaa_helpsingle(0, "x509keyfile", "FILE ", "X.509 key file or PKCS #11 URL to use.");
 
145
        __gaa_helpsingle(0, "x509certfile", "FILE ", "X.509 Certificate file or PKCS #11 URL to use.");
146
146
        __gaa_helpsingle(0, "x509dsakeyfile", "FILE ", "Alternative X.509 key file to use.");
147
147
        __gaa_helpsingle(0, "x509dsacertfile", "FILE ", "Alternative X.509 certificate file to use.");
148
148
        __gaa_helpsingle('r', "require-cert", "", "Require a valid certificate.");
152
152
        __gaa_helpsingle(0, "srppasswd", "FILE ", "SRP password file to use.");
153
153
        __gaa_helpsingle(0, "srppasswdconf", "FILE ", "SRP password conf file to use.");
154
154
        __gaa_helpsingle(0, "opaque-prf-input", "DATA ", "Use Opaque PRF Input DATA.");
155
 
        __gaa_helpsingle(0, "ciphers", "cipher1 cipher2... ", "Ciphers to enable.");
156
 
        __gaa_helpsingle(0, "protocols", "protocol1 protocol2... ", "Protocols to enable.");
157
 
        __gaa_helpsingle(0, "comp", "comp1 comp2... ", "Compression methods to enable.");
158
 
        __gaa_helpsingle(0, "macs", "mac1 mac2... ", "MACs to enable.");
159
 
        __gaa_helpsingle(0, "kx", "kx1 kx2... ", "Key exchange methods to enable.");
160
 
        __gaa_helpsingle(0, "ctypes", "certType1 certType2... ", "Certificate types to enable.");
161
155
        __gaa_helpsingle(0, "priority", "PRIORITY STRING ", "Priorities string.");
162
156
        __gaa_helpsingle('l', "list", "", "Print a list of the supported algorithms  and modes.");
163
157
        __gaa_helpsingle('h', "help", "", "prints this help");
176
170
 
177
171
struct _gaainfo
178
172
{
179
 
#line 115 "serv.gaa"
 
173
#line 91 "serv.gaa"
180
174
        char *priorities;
181
 
#line 112 "serv.gaa"
182
 
        char **ctype;
183
 
#line 111 "serv.gaa"
184
 
        int nctype;
185
 
#line 108 "serv.gaa"
186
 
        char **kx;
187
 
#line 107 "serv.gaa"
188
 
        int nkx;
189
 
#line 104 "serv.gaa"
190
 
        char **macs;
191
 
#line 103 "serv.gaa"
192
 
        int nmacs;
193
 
#line 100 "serv.gaa"
194
 
        char **comp;
195
 
#line 99 "serv.gaa"
196
 
        int ncomp;
197
 
#line 96 "serv.gaa"
198
 
        char **proto;
199
 
#line 95 "serv.gaa"
200
 
        int nproto;
201
 
#line 92 "serv.gaa"
202
 
        char **ciphers;
203
 
#line 91 "serv.gaa"
204
 
        int nciphers;
205
175
#line 88 "serv.gaa"
206
176
        char *opaque_prf_input;
207
177
#line 85 "serv.gaa"
308
278
#define GAA_MULTIPLE_OPTION     3
309
279
 
310
280
#define GAA_REST                0
311
 
#define GAA_NB_OPTION           37
 
281
#define GAA_NB_OPTION           31
312
282
#define GAAOPTID_version        1
313
283
#define GAAOPTID_help   2
314
284
#define GAAOPTID_list   3
315
285
#define GAAOPTID_priority       4
316
 
#define GAAOPTID_ctypes 5
317
 
#define GAAOPTID_kx     6
318
 
#define GAAOPTID_macs   7
319
 
#define GAAOPTID_comp   8
320
 
#define GAAOPTID_protocols      9
321
 
#define GAAOPTID_ciphers        10
322
 
#define GAAOPTID_opaque_prf_input       11
323
 
#define GAAOPTID_srppasswdconf  12
324
 
#define GAAOPTID_srppasswd      13
325
 
#define GAAOPTID_pskhint        14
326
 
#define GAAOPTID_pskpasswd      15
327
 
#define GAAOPTID_disable_client_cert    16
328
 
#define GAAOPTID_require_cert   17
329
 
#define GAAOPTID_x509dsacertfile        18
330
 
#define GAAOPTID_x509dsakeyfile 19
331
 
#define GAAOPTID_x509certfile   20
332
 
#define GAAOPTID_x509keyfile    21
333
 
#define GAAOPTID_pgpsubkey      22
334
 
#define GAAOPTID_pgpcertfile    23
335
 
#define GAAOPTID_pgpkeyfile     24
336
 
#define GAAOPTID_pgpkeyring     25
337
 
#define GAAOPTID_x509crlfile    26
338
 
#define GAAOPTID_x509cafile     27
339
 
#define GAAOPTID_x509fmtder     28
340
 
#define GAAOPTID_dhparams       29
341
 
#define GAAOPTID_echo   30
342
 
#define GAAOPTID_http   31
343
 
#define GAAOPTID_noticket       32
344
 
#define GAAOPTID_nodb   33
345
 
#define GAAOPTID_quiet  34
346
 
#define GAAOPTID_port   35
347
 
#define GAAOPTID_generate       36
348
 
#define GAAOPTID_debug  37
 
286
#define GAAOPTID_opaque_prf_input       5
 
287
#define GAAOPTID_srppasswdconf  6
 
288
#define GAAOPTID_srppasswd      7
 
289
#define GAAOPTID_pskhint        8
 
290
#define GAAOPTID_pskpasswd      9
 
291
#define GAAOPTID_disable_client_cert    10
 
292
#define GAAOPTID_require_cert   11
 
293
#define GAAOPTID_x509dsacertfile        12
 
294
#define GAAOPTID_x509dsakeyfile 13
 
295
#define GAAOPTID_x509certfile   14
 
296
#define GAAOPTID_x509keyfile    15
 
297
#define GAAOPTID_pgpsubkey      16
 
298
#define GAAOPTID_pgpcertfile    17
 
299
#define GAAOPTID_pgpkeyfile     18
 
300
#define GAAOPTID_pgpkeyring     19
 
301
#define GAAOPTID_x509crlfile    20
 
302
#define GAAOPTID_x509cafile     21
 
303
#define GAAOPTID_x509fmtder     22
 
304
#define GAAOPTID_dhparams       23
 
305
#define GAAOPTID_echo   24
 
306
#define GAAOPTID_http   25
 
307
#define GAAOPTID_noticket       26
 
308
#define GAAOPTID_nodb   27
 
309
#define GAAOPTID_quiet  28
 
310
#define GAAOPTID_port   29
 
311
#define GAAOPTID_generate       30
 
312
#define GAAOPTID_debug  31
349
313
 
350
314
#line 168 "gaa.skel"
351
315
 
538
502
        int size1;
539
503
};
540
504
 
541
 
struct GAAOPTION_ctypes 
542
 
{
543
 
        char** arg1;
544
 
        int size1;
545
 
};
546
 
 
547
 
struct GAAOPTION_kx 
548
 
{
549
 
        char** arg1;
550
 
        int size1;
551
 
};
552
 
 
553
 
struct GAAOPTION_macs 
554
 
{
555
 
        char** arg1;
556
 
        int size1;
557
 
};
558
 
 
559
 
struct GAAOPTION_comp 
560
 
{
561
 
        char** arg1;
562
 
        int size1;
563
 
};
564
 
 
565
 
struct GAAOPTION_protocols 
566
 
{
567
 
        char** arg1;
568
 
        int size1;
569
 
};
570
 
 
571
 
struct GAAOPTION_ciphers 
572
 
{
573
 
        char** arg1;
574
 
        int size1;
575
 
};
576
 
 
577
505
struct GAAOPTION_opaque_prf_input 
578
506
{
579
507
        char* arg1;
712
640
        {
713
641
        case GAA_LETTER_OPTION:
714
642
                        GAA_CHECK1STR("", GAAOPTID_priority);
715
 
                        GAA_CHECK1STR("", GAAOPTID_ctypes);
716
 
                        GAA_CHECK1STR("", GAAOPTID_kx);
717
 
                        GAA_CHECK1STR("", GAAOPTID_macs);
718
 
                        GAA_CHECK1STR("", GAAOPTID_comp);
719
 
                        GAA_CHECK1STR("", GAAOPTID_protocols);
720
 
                        GAA_CHECK1STR("", GAAOPTID_ciphers);
721
643
                        GAA_CHECK1STR("", GAAOPTID_opaque_prf_input);
722
644
                        GAA_CHECK1STR("", GAAOPTID_srppasswdconf);
723
645
                        GAA_CHECK1STR("", GAAOPTID_srppasswd);
758
680
                        GAA_CHECKSTR("help", GAAOPTID_help);
759
681
                        GAA_CHECKSTR("list", GAAOPTID_list);
760
682
                        GAA_CHECKSTR("priority", GAAOPTID_priority);
761
 
                        GAA_CHECKSTR("ctypes", GAAOPTID_ctypes);
762
 
                        GAA_CHECKSTR("kx", GAAOPTID_kx);
763
 
                        GAA_CHECKSTR("macs", GAAOPTID_macs);
764
 
                        GAA_CHECKSTR("comp", GAAOPTID_comp);
765
 
                        GAA_CHECKSTR("protocols", GAAOPTID_protocols);
766
 
                        GAA_CHECKSTR("ciphers", GAAOPTID_ciphers);
767
683
                        GAA_CHECKSTR("opaque-prf-input", GAAOPTID_opaque_prf_input);
768
684
                        GAA_CHECKSTR("srppasswdconf", GAAOPTID_srppasswdconf);
769
685
                        GAA_CHECKSTR("srppasswd", GAAOPTID_srppasswd);
804
720
    int OK = 0;
805
721
    int gaa_last_non_option;
806
722
        struct GAAOPTION_priority GAATMP_priority;
807
 
        struct GAAOPTION_ctypes GAATMP_ctypes;
808
 
        struct GAAOPTION_kx GAATMP_kx;
809
 
        struct GAAOPTION_macs GAATMP_macs;
810
 
        struct GAAOPTION_comp GAATMP_comp;
811
 
        struct GAAOPTION_protocols GAATMP_protocols;
812
 
        struct GAAOPTION_ciphers GAATMP_ciphers;
813
723
        struct GAAOPTION_opaque_prf_input GAATMP_opaque_prf_input;
814
724
        struct GAAOPTION_srppasswdconf GAATMP_srppasswdconf;
815
725
        struct GAAOPTION_srppasswd GAATMP_srppasswd;
850
760
    {
851
761
        case GAAOPTID_version:
852
762
        OK = 0;
853
 
#line 121 "serv.gaa"
 
763
#line 97 "serv.gaa"
854
764
{ serv_version(); exit(0); ;};
855
765
 
856
766
                return GAA_OK;
857
767
                break;
858
768
        case GAAOPTID_help:
859
769
        OK = 0;
860
 
#line 119 "serv.gaa"
 
770
#line 95 "serv.gaa"
861
771
{ gaa_help(); exit(0); ;};
862
772
 
863
773
                return GAA_OK;
864
774
                break;
865
775
        case GAAOPTID_list:
866
776
        OK = 0;
867
 
#line 118 "serv.gaa"
 
777
#line 94 "serv.gaa"
868
778
{ print_list(0); exit(0); ;};
869
779
 
870
780
                return GAA_OK;
874
784
                GAA_TESTMOREARGS;
875
785
                GAA_FILL(GAATMP_priority.arg1, gaa_getstr, GAATMP_priority.size1);
876
786
                gaa_index++;
877
 
#line 116 "serv.gaa"
 
787
#line 92 "serv.gaa"
878
788
{ gaaval->priorities = GAATMP_priority.arg1 ;};
879
789
 
880
790
                return GAA_OK;
881
791
                break;
882
 
        case GAAOPTID_ctypes:
883
 
        OK = 0;
884
 
                GAA_LIST_FILL(GAATMP_ctypes.arg1, gaa_getstr, char*, GAATMP_ctypes.size1);
885
 
#line 113 "serv.gaa"
886
 
{ gaaval->ctype = GAATMP_ctypes.arg1; gaaval->nctype = GAATMP_ctypes.size1 ;};
887
 
 
888
 
                return GAA_OK;
889
 
                break;
890
 
        case GAAOPTID_kx:
891
 
        OK = 0;
892
 
                GAA_LIST_FILL(GAATMP_kx.arg1, gaa_getstr, char*, GAATMP_kx.size1);
893
 
#line 109 "serv.gaa"
894
 
{ gaaval->kx = GAATMP_kx.arg1; gaaval->nkx = GAATMP_kx.size1 ;};
895
 
 
896
 
                return GAA_OK;
897
 
                break;
898
 
        case GAAOPTID_macs:
899
 
        OK = 0;
900
 
                GAA_LIST_FILL(GAATMP_macs.arg1, gaa_getstr, char*, GAATMP_macs.size1);
901
 
#line 105 "serv.gaa"
902
 
{ gaaval->macs = GAATMP_macs.arg1; gaaval->nmacs = GAATMP_macs.size1 ;};
903
 
 
904
 
                return GAA_OK;
905
 
                break;
906
 
        case GAAOPTID_comp:
907
 
        OK = 0;
908
 
                GAA_LIST_FILL(GAATMP_comp.arg1, gaa_getstr, char*, GAATMP_comp.size1);
909
 
#line 101 "serv.gaa"
910
 
{ gaaval->comp = GAATMP_comp.arg1; gaaval->ncomp = GAATMP_comp.size1 ;};
911
 
 
912
 
                return GAA_OK;
913
 
                break;
914
 
        case GAAOPTID_protocols:
915
 
        OK = 0;
916
 
                GAA_LIST_FILL(GAATMP_protocols.arg1, gaa_getstr, char*, GAATMP_protocols.size1);
917
 
#line 97 "serv.gaa"
918
 
{ gaaval->proto = GAATMP_protocols.arg1; gaaval->nproto = GAATMP_protocols.size1 ;};
919
 
 
920
 
                return GAA_OK;
921
 
                break;
922
 
        case GAAOPTID_ciphers:
923
 
        OK = 0;
924
 
                GAA_LIST_FILL(GAATMP_ciphers.arg1, gaa_getstr, char*, GAATMP_ciphers.size1);
925
 
#line 93 "serv.gaa"
926
 
{ gaaval->ciphers = GAATMP_ciphers.arg1; gaaval->nciphers = GAATMP_ciphers.size1 ;};
927
 
 
928
 
                return GAA_OK;
929
 
                break;
930
792
        case GAAOPTID_opaque_prf_input:
931
793
        OK = 0;
932
794
                GAA_TESTMOREARGS;
1194
1056
    if(inited == 0)
1195
1057
    {
1196
1058
 
1197
 
#line 125 "serv.gaa"
1198
 
{ gaaval->generate=0; gaaval->port=5556; gaaval->http=0; gaaval->ciphers=NULL;
1199
 
        gaaval->kx=NULL; gaaval->comp=NULL; gaaval->macs=NULL; gaaval->ctype=NULL; gaaval->nciphers=0;
1200
 
        gaaval->nkx=0; gaaval->ncomp=0; gaaval->nmacs=0; gaaval->nctype = 0; gaaval->nodb = 0; gaaval->noticket = 0;
 
1059
#line 101 "serv.gaa"
 
1060
{ gaaval->generate=0; gaaval->port=5556; gaaval->http=0; gaaval->nodb = 0; gaaval->noticket = 0;
1201
1061
        gaaval->x509_cafile = NULL; gaaval->pgp_keyfile=NULL; gaaval->pgp_certfile=NULL;
1202
1062
        gaaval->x509_keyfile=NULL; gaaval->x509_certfile=NULL; gaaval->x509_crlfile = NULL;
1203
1063
        gaaval->x509_dsakeyfile=NULL; gaaval->x509_dsacertfile=NULL; 
1354
1214
 
1355
1215
        len++;
1356
1216
        a = fgetc( file);
1357
 
        if(a==EOF) return 0; //a = ' ';
 
1217
        if(a==EOF) return 0;
1358
1218
    }
1359
1219
 
1360
1220
    len += 1;