1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
|
Network Working Group J. Linn
Request for Comments: 2743 RSA Laboratories
Obsoletes: 2078 January 2000
Category: Standards Track
Generic Security Service Application Program Interface
Version 2, Update 1
Status of this Memo
This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2000). All Rights Reserved.
Abstract
The Generic Security Service Application Program Interface (GSS-API),
Version 2, as defined in [RFC-2078], provides security services to
callers in a generic fashion, supportable with a range of underlying
mechanisms and technologies and hence allowing source-level
portability of applications to different environments. This
specification defines GSS-API services and primitives at a level
independent of underlying mechanism and programming language
environment, and is to be complemented by other, related
specifications:
documents defining specific parameter bindings for particular
language environments
documents defining token formats, protocols, and procedures to be
implemented in order to realize GSS-API services atop particular
security mechanisms
This memo obsoletes [RFC-2078], making specific, incremental changes
in response to implementation experience and liaison requests. It is
intended, therefore, that this memo or a successor version thereto
will become the basis for subsequent progression of the GSS-API
specification on the standards track.
Linn Standards Track [Page 1]
^L
RFC 2743 GSS-API January 2000
TABLE OF CONTENTS
1: GSS-API Characteristics and Concepts . . . . . . . . . . . . 4
1.1: GSS-API Constructs . . . . . . . . . . . . . . . . . . . . 6
1.1.1: Credentials . . . . . . . . . . . . . . . . . . . . . . 6
1.1.1.1: Credential Constructs and Concepts . . . . . . . . . . 6
1.1.1.2: Credential Management . . . . . . . . . . . . . . . . 7
1.1.1.3: Default Credential Resolution . . . . . . . . . . . . 8
1.1.2: Tokens . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1.3: Security Contexts . . . . . . . . . . . . . . . . . . . 11
1.1.4: Mechanism Types . . . . . . . . . . . . . . . . . . . . 12
1.1.5: Naming . . . . . . . . . . . . . . . . . . . . . . . . 13
1.1.6: Channel Bindings . . . . . . . . . . . . . . . . . . . 16
1.2: GSS-API Features and Issues . . . . . . . . . . . . . . . 17
1.2.1: Status Reporting and Optional Service Support . . . . 17
1.2.1.1: Status Reporting . . . . . . . . . . . . . . . . . . . 17
1.2.1.2: Optional Service Support . . . . . . . . . . . . . . . 19
1.2.2: Per-Message Security Service Availability . . . . . . . 20
1.2.3: Per-Message Replay Detection and Sequencing . . . . . . 21
1.2.4: Quality of Protection . . . . . . . . . . . . . . . . . 24
1.2.5: Anonymity Support . . . . . . . . . . . . . . . . . . . 25
1.2.6: Initialization . . . . . . . . . . . . . . . . . . . . . 25
1.2.7: Per-Message Protection During Context Establishment . . 26
1.2.8: Implementation Robustness . . . . . . . . . . . . . . . 27
1.2.9: Delegation . . . . . . . . . . . . . . . . . . . . . . . 28
1.2.10: Interprocess Context Transfer . . . . . . . . . . . . . 28
2: Interface Descriptions . . . . . . . . . . . . . . . . . . 29
2.1: Credential management calls . . . . . . . . . . . . . . . 31
2.1.1: GSS_Acquire_cred call . . . . . . . . . . . . . . . . . 31
2.1.2: GSS_Release_cred call . . . . . . . . . . . . . . . . . 34
2.1.3: GSS_Inquire_cred call . . . . . . . . . . . . . . . . . 35
2.1.4: GSS_Add_cred call . . . . . . . . . . . . . . . . . . . 37
2.1.5: GSS_Inquire_cred_by_mech call . . . . . . . . . . . . . 40
2.2: Context-level calls . . . . . . . . . . . . . . . . . . . 41
2.2.1: GSS_Init_sec_context call . . . . . . . . . . . . . . . 42
2.2.2: GSS_Accept_sec_context call . . . . . . . . . . . . . . 49
2.2.3: GSS_Delete_sec_context call . . . . . . . . . . . . . . 53
2.2.4: GSS_Process_context_token call . . . . . . . . . . . . 54
2.2.5: GSS_Context_time call . . . . . . . . . . . . . . . . . 55
2.2.6: GSS_Inquire_context call . . . . . . . . . . . . . . . 56
2.2.7: GSS_Wrap_size_limit call . . . . . . . . . . . . . . . 57
2.2.8: GSS_Export_sec_context call . . . . . . . . . . . . . . 59
2.2.9: GSS_Import_sec_context call . . . . . . . . . . . . . . 61
2.3: Per-message calls . . . . . . . . . . . . . . . . . . . . 62
2.3.1: GSS_GetMIC call . . . . . . . . . . . . . . . . . . . . 63
2.3.2: GSS_VerifyMIC call . . . . . . . . . . . . . . . . . . 64
2.3.3: GSS_Wrap call . . . . . . . . . . . . . . . . . . . . . 65
2.3.4: GSS_Unwrap call . . . . . . . . . . . . . . . . . . . . 66
Linn Standards Track [Page 2]
^L
RFC 2743 GSS-API January 2000
2.4: Support calls . . . . . . . . . . . . . . . . . . . . . . 68
2.4.1: GSS_Display_status call . . . . . . . . . . . . . . . . 68
2.4.2: GSS_Indicate_mechs call . . . . . . . . . . . . . . . . 69
2.4.3: GSS_Compare_name call . . . . . . . . . . . . . . . . . 70
2.4.4: GSS_Display_name call . . . . . . . . . . . . . . . . . 71
2.4.5: GSS_Import_name call . . . . . . . . . . . . . . . . . 72
2.4.6: GSS_Release_name call . . . . . . . . . . . . . . . . . 73
2.4.7: GSS_Release_buffer call . . . . . . . . . . . . . . . . 74
2.4.8: GSS_Release_OID_set call . . . . . . . . . . . . . . . 74
2.4.9: GSS_Create_empty_OID_set call . . . . . . . . . . . . . 75
2.4.10: GSS_Add_OID_set_member call . . . . . . . . . . . . . . 76
2.4.11: GSS_Test_OID_set_member call . . . . . . . . . . . . . 76
2.4.12: GSS_Inquire_names_for_mech call . . . . . . . . . . . . 77
2.4.13: GSS_Inquire_mechs_for_name call . . . . . . . . . . . . 77
2.4.14: GSS_Canonicalize_name call . . . . . . . . . . . . . . 78
2.4.15: GSS_Export_name call . . . . . . . . . . . . . . . . . 79
2.4.16: GSS_Duplicate_name call . . . . . . . . . . . . . . . . 80
3: Data Structure Definitions for GSS-V2 Usage . . . . . . . . 81
3.1: Mechanism-Independent Token Format . . . . . . . . . . . . 81
3.2: Mechanism-Independent Exported Name Object Format . . . . 84
4: Name Type Definitions . . . . . . . . . . . . . . . . . . . 85
4.1: Host-Based Service Name Form . . . . . . . . . . . . . . . 85
4.2: User Name Form . . . . . . . . . . . . . . . . . . . . . . 86
4.3: Machine UID Form . . . . . . . . . . . . . . . . . . . . . 87
4.4: String UID Form . . . . . . . . . . . . . . . . . . . . . 87
4.5: Anonymous Nametype . . . . . . . . . . . . . . . . . . . . 87
4.6: GSS_C_NO_OID . . . . . . . . . . . . . . . . . . . . . . . 88
4.7: Exported Name Object . . . . . . . . . . . . . . . . . . . 88
4.8: GSS_C_NO_NAME . . . . . . . . . . . . . . . . . . . . . . 88
5: Mechanism-Specific Example Scenarios . . . . . . . . . . . 88
5.1: Kerberos V5, single-TGT . . . . . . . . . . . . . . . . . 89
5.2: Kerberos V5, double-TGT . . . . . . . . . . . . . . . . . 89
5.3: X.509 Authentication Framework . . . . . . . . . . . . . 90
6: Security Considerations . . . . . . . . . . . . . . . . . . 91
7: Related Activities . . . . . . . . . . . . . . . . . . . . 92
8: Referenced Documents . . . . . . . . . . . . . . . . . . . 93
Appendix A: Mechanism Design Constraints . . . . . . . . . . . 94
Appendix B: Compatibility with GSS-V1 . . . . . . . . . . . . . 94
Appendix C: Changes Relative to RFC-2078 . . . . . . . . . . . 96
Author's Address . . . . . . . . . . . . . . . . . . . . . . .100
Full Copyright Statement . . . . . . . . . . . . . . . . . . .101
Linn Standards Track [Page 3]
^L
RFC 2743 GSS-API January 2000
1: GSS-API Characteristics and Concepts
GSS-API operates in the following paradigm. A typical GSS-API caller
is itself a communications protocol, calling on GSS-API in order to
protect its communications with authentication, integrity, and/or
confidentiality security services. A GSS-API caller accepts tokens
provided to it by its local GSS-API implementation and transfers the
tokens to a peer on a remote system; that peer passes the received
tokens to its local GSS-API implementation for processing. The
security services available through GSS-API in this fashion are
implementable (and have been implemented) over a range of underlying
mechanisms based on secret-key and public-key cryptographic
technologies.
The GSS-API separates the operations of initializing a security
context between peers, achieving peer entity authentication
(GSS_Init_sec_context() and GSS_Accept_sec_context() calls), from the
operations of providing per-message data origin authentication and
data integrity protection (GSS_GetMIC() and GSS_VerifyMIC() calls)
for messages subsequently transferred in conjunction with that
context. (The definition for the peer entity authentication service,
and other definitions used in this document, corresponds to that
provided in [ISO-7498-2].) When establishing a security context, the
GSS-API enables a context initiator to optionally permit its
credentials to be delegated, meaning that the context acceptor may
initiate further security contexts on behalf of the initiating
caller. Per-message GSS_Wrap() and GSS_Unwrap() calls provide the
data origin authentication and data integrity services which
GSS_GetMIC() and GSS_VerifyMIC() offer, and also support selection of
confidentiality services as a caller option. Additional calls provide
supportive functions to the GSS-API's users.
The following paragraphs provide an example illustrating the
dataflows involved in use of the GSS-API by a client and server in a
mechanism-independent fashion, establishing a security context and
transferring a protected message. The example assumes that credential
acquisition has already been completed. The example also assumes
that the underlying authentication technology is capable of
authenticating a client to a server using elements carried within a
single token, and of authenticating the server to the client (mutual
authentication) with a single returned token; this assumption holds
for some presently-documented CAT mechanisms but is not necessarily
true for other cryptographic technologies and associated protocols.
The client calls GSS_Init_sec_context() to establish a security
context to the server identified by targ_name, and elects to set the
mutual_req_flag so that mutual authentication is performed in the
course of context establishment. GSS_Init_sec_context() returns an
Linn Standards Track [Page 4]
^L
RFC 2743 GSS-API January 2000
output_token to be passed to the server, and indicates
GSS_S_CONTINUE_NEEDED status pending completion of the mutual
authentication sequence. Had mutual_req_flag not been set, the
initial call to GSS_Init_sec_context() would have returned
GSS_S_COMPLETE status. The client sends the output_token to the
server.
The server passes the received token as the input_token parameter to
GSS_Accept_sec_context(). GSS_Accept_sec_context indicates
GSS_S_COMPLETE status, provides the client's authenticated identity
in the src_name result, and provides an output_token to be passed to
the client. The server sends the output_token to the client.
The client passes the received token as the input_token parameter to
a successor call to GSS_Init_sec_context(), which processes data
included in the token in order to achieve mutual authentication from
the client's viewpoint. This call to GSS_Init_sec_context() returns
GSS_S_COMPLETE status, indicating successful mutual authentication
and the completion of context establishment for this example.
The client generates a data message and passes it to GSS_Wrap().
GSS_Wrap() performs data origin authentication, data integrity, and
(optionally) confidentiality processing on the message and
encapsulates the result into output_message, indicating
GSS_S_COMPLETE status. The client sends the output_message to the
server.
The server passes the received message to GSS_Unwrap(). GSS_Unwrap()
inverts the encapsulation performed by GSS_Wrap(), deciphers the
message if the optional confidentiality feature was applied, and
validates the data origin authentication and data integrity checking
quantities. GSS_Unwrap() indicates successful validation by returning
GSS_S_COMPLETE status along with the resultant output_message.
For purposes of this example, we assume that the server knows by
out-of-band means that this context will have no further use after
one protected message is transferred from client to server. Given
this premise, the server now calls GSS_Delete_sec_context() to flush
context-level information. Optionally, the server-side application
may provide a token buffer to GSS_Delete_sec_context(), to receive a
context_token to be transferred to the client in order to request
that client-side context-level information be deleted.
If a context_token is transferred, the client passes the
context_token to GSS_Process_context_token(), which returns
GSS_S_COMPLETE status after deleting context-level information at the
client system.
Linn Standards Track [Page 5]
^L
RFC 2743 GSS-API January 2000
The GSS-API design assumes and addresses several basic goals,
including:
Mechanism independence: The GSS-API defines an interface to
cryptographically implemented strong authentication and other
security services at a generic level which is independent of
particular underlying mechanisms. For example, GSS-API-provided
services have been implemented using secret-key technologies
(e.g., Kerberos, per [RFC-1964]) and with public-key approaches
(e.g., SPKM, per [RFC-2025]).
Protocol environment independence: The GSS-API is independent of
the communications protocol suites with which it is employed,
permitting use in a broad range of protocol environments. In
appropriate environments, an intermediate implementation "veneer"
which is oriented to a particular communication protocol may be
interposed between applications which call that protocol and the
GSS-API (e.g., as defined in [RFC-2203] for Open Network Computing
Remote Procedure Call (RPC)), thereby invoking GSS-API facilities
in conjunction with that protocol's communications invocations.
Protocol association independence: The GSS-API's security context
construct is independent of communications protocol association
constructs. This characteristic allows a single GSS-API
implementation to be utilized by a variety of invoking protocol
modules on behalf of those modules' calling applications. GSS-API
services can also be invoked directly by applications, wholly
independent of protocol associations.
Suitability to a range of implementation placements: GSS-API
clients are not constrained to reside within any Trusted Computing
Base (TCB) perimeter defined on a system where the GSS-API is
implemented; security services are specified in a manner suitable
to both intra-TCB and extra-TCB callers.
1.1: GSS-API Constructs
This section describes the basic elements comprising the GSS-API.
1.1.1: Credentials
1.1.1.1: Credential Constructs and Concepts
Credentials provide the prerequisites which permit GSS-API peers to
establish security contexts with each other. A caller may designate
that the credential elements which are to be applied for context
initiation or acceptance be selected by default. Alternately, those
GSS-API callers which need to make explicit selection of particular
Linn Standards Track [Page 6]
^L
RFC 2743 GSS-API January 2000
credentials structures may make references to those credentials
through GSS-API-provided credential handles ("cred_handles"). In all
cases, callers' credential references are indirect, mediated by GSS-
API implementations and not requiring callers to access the selected
credential elements.
A single credential structure may be used to initiate outbound
contexts and to accept inbound contexts. Callers needing to operate
in only one of these modes may designate this fact when credentials
are acquired for use, allowing underlying mechanisms to optimize
their processing and storage requirements. The credential elements
defined by a particular mechanism may contain multiple cryptographic
keys, e.g., to enable authentication and message encryption to be
performed with different algorithms.
A GSS-API credential structure may contain multiple credential
elements, each containing mechanism-specific information for a
particular underlying mechanism (mech_type), but the set of elements
within a given credential structure represent a common entity. A
credential structure's contents will vary depending on the set of
mech_types supported by a particular GSS-API implementation. Each
credential element identifies the data needed by its mechanism in
order to establish contexts on behalf of a particular principal, and
may contain separate credential references for use in context
initiation and context acceptance. Multiple credential elements
within a given credential having overlapping combinations of
mechanism, usage mode, and validity period are not permitted.
Commonly, a single mech_type will be used for all security contexts
established by a particular initiator to a particular target. A major
motivation for supporting credential sets representing multiple
mech_types is to allow initiators on systems which are equipped to
handle multiple types to initiate contexts to targets on other
systems which can accommodate only a subset of the set supported at
the initiator's system.
1.1.1.2: Credential Management
It is the responsibility of underlying system-specific mechanisms and
OS functions below the GSS-API to ensure that the ability to acquire
and use credentials associated with a given identity is constrained
to appropriate processes within a system. This responsibility should
be taken seriously by implementors, as the ability for an entity to
utilize a principal's credentials is equivalent to the entity's
ability to successfully assert that principal's identity.
Linn Standards Track [Page 7]
^L
RFC 2743 GSS-API January 2000
Once a set of GSS-API credentials is established, the transferability
of that credentials set to other processes or analogous constructs
within a system is a local matter, not defined by the GSS-API. An
example local policy would be one in which any credentials received
as a result of login to a given user account, or of delegation of
rights to that account, are accessible by, or transferable to,
processes running under that account.
The credential establishment process (particularly when performed on
behalf of users rather than server processes) is likely to require
access to passwords or other quantities which should be protected
locally and exposed for the shortest time possible. As a result, it
will often be appropriate for preliminary credential establishment to
be performed through local means at user login time, with the
result(s) cached for subsequent reference. These preliminary
credentials would be set aside (in a system-specific fashion) for
subsequent use, either:
to be accessed by an invocation of the GSS-API GSS_Acquire_cred()
call, returning an explicit handle to reference that credential
to comprise default credential elements to be installed, and to be
used when default credential behavior is requested on behalf of a
process
1.1.1.3: Default Credential Resolution
The GSS_Init_sec_context() and GSS_Accept_sec_context() routines
allow the value GSS_C_NO_CREDENTIAL to be specified as their
credential handle parameter. This special credential handle
indicates a desire by the application to act as a default principal.
In support of application portability, support for the default
resolution behavior described below for initiator credentials
(GSS_Init_sec_context() usage) is mandated; support for the default
resolution behavior described below for acceptor credentials
(GSS_Accept_sec_context() usage) is recommended. If default
credential resolution fails, GSS_S_NO_CRED status is to be returned.
GSS_Init_sec_context:
(i) If there is only a single principal capable of initiating
security contexts that the application is authorized to act on
behalf of, then that principal shall be used, otherwise
Linn Standards Track [Page 8]
^L
RFC 2743 GSS-API January 2000
(ii) If the platform maintains a concept of a default network-
identity, and if the application is authorized to act on behalf
of that identity for the purpose of initiating security
contexts, then the principal corresponding to that identity
shall be used, otherwise
(iii) If the platform maintains a concept of a default local
identity, and provides a means to map local identities into
network-identities, and if the application is authorized to act
on behalf of the network-identity image of the default local
identity for the purpose of initiating security contexts, then
the principal corresponding to that identity shall be used,
otherwise
(iv) A user-configurable default identity should be used.
GSS_Accept_sec_context:
(i) If there is only a single authorized principal identity
capable of accepting security contexts, then that principal
shall be used, otherwise
(ii) If the mechanism can determine the identity of the target
principal by examining the context-establishment token, and if
the accepting application is authorized to act as that
principal for the purpose of accepting security contexts, then
that principal identity shall be used, otherwise
(iii) If the mechanism supports context acceptance by any
principal, and mutual authentication was not requested, any
principal that the application is authorized to accept security
contexts under may be used, otherwise
(iv) A user-configurable default identity shall be used.
The purpose of the above rules is to allow security contexts to be
established by both initiator and acceptor using the default behavior
wherever possible. Applications requesting default behavior are
likely to be more portable across mechanisms and platforms than those
that use GSS_Acquire_cred() to request a specific identity.
1.1.2: Tokens
Tokens are data elements transferred between GSS-API callers, and are
divided into two classes. Context-level tokens are exchanged in order
to establish and manage a security context between peers. Per-message
tokens relate to an established context and are exchanged to provide
Linn Standards Track [Page 9]
^L
RFC 2743 GSS-API January 2000
protective security services (i.e., data origin authentication,
integrity, and optional confidentiality) for corresponding data
messages.
The first context-level token obtained from GSS_Init_sec_context() is
required to indicate at its very beginning a globally-interpretable
mechanism identifier, i.e., an Object Identifier (OID) of the
security mechanism. The remaining part of this token as well as the
whole content of all other tokens are specific to the particular
underlying mechanism used to support the GSS-API. Section 3.1 of this
document provides, for designers of GSS-API mechanisms, the
description of the header of the first context-level token which is
then followed by mechanism-specific information.
Tokens' contents are opaque from the viewpoint of GSS-API callers.
They are generated within the GSS-API implementation at an end
system, provided to a GSS-API caller to be transferred to the peer
GSS-API caller at a remote end system, and processed by the GSS-API
implementation at that remote end system.
Context-level tokens may be output by GSS-API calls (and should be
transferred to GSS-API peers) whether or not the calls' status
indicators indicate successful completion. Per-message tokens, in
contrast, are to be returned only upon successful completion of per-
message calls. Zero-length tokens are never returned by GSS routines
for transfer to a peer. Token transfer may take place in an in-band
manner, integrated into the same protocol stream used by the GSS-API
callers for other data transfers, or in an out-of-band manner across
a logically separate channel.
Different GSS-API tokens are used for different purposes (e.g.,
context initiation, context acceptance, protected message data on an
established context), and it is the responsibility of a GSS-API
caller receiving tokens to distinguish their types, associate them
with corresponding security contexts, and pass them to appropriate
GSS-API processing routines. Depending on the caller protocol
environment, this distinction may be accomplished in several ways.
The following examples illustrate means through which tokens' types
may be distinguished:
- implicit tagging based on state information (e.g., all tokens on
a new association are considered to be context establishment
tokens until context establishment is completed, at which point
all tokens are considered to be wrapped data objects for that
context),
Linn Standards Track [Page 10]
^L
RFC 2743 GSS-API January 2000
- explicit tagging at the caller protocol level,
- a hybrid of these approaches.
Commonly, the encapsulated data within a token includes internal
mechanism-specific tagging information, enabling mechanism-level
processing modules to distinguish tokens used within the mechanism
for different purposes. Such internal mechanism-level tagging is
recommended to mechanism designers, and enables mechanisms to
determine whether a caller has passed a particular token for
processing by an inappropriate GSS-API routine.
Development of GSS-API mechanisms based on a particular underlying
cryptographic technique and protocol (i.e., conformant to a specific
GSS-API mechanism definition) does not necessarily imply that GSS-API
callers using that GSS-API mechanism will be able to interoperate
with peers invoking the same technique and protocol outside the GSS-
API paradigm, or with peers implementing a different GSS-API
mechanism based on the same underlying technology. The format of
GSS-API tokens defined in conjunction with a particular mechanism,
and the techniques used to integrate those tokens into callers'
protocols, may not be interoperable with the tokens used by non-GSS-
API callers of the same underlying technique.
1.1.3: Security Contexts
Security contexts are established between peers, using credentials
established locally in conjunction with each peer or received by
peers via delegation. Multiple contexts may exist simultaneously
between a pair of peers, using the same or different sets of
credentials. Coexistence of multiple contexts using different
credentials allows graceful rollover when credentials expire.
Distinction among multiple contexts based on the same credentials
serves applications by distinguishing different message streams in a
security sense.
The GSS-API is independent of underlying protocols and addressing
structure, and depends on its callers to transport GSS-API-provided
data elements. As a result of these factors, it is a caller
responsibility to parse communicated messages, separating GSS-API-
related data elements from caller-provided data. The GSS-API is
independent of connection vs. connectionless orientation of the
underlying communications service.
No correlation between security context and communications protocol
association is dictated. (The optional channel binding facility,
discussed in Section 1.1.6 of this document, represents an
intentional exception to this rule, supporting additional protection
Linn Standards Track [Page 11]
^L
RFC 2743 GSS-API January 2000
features within GSS-API supporting mechanisms.) This separation
allows the GSS-API to be used in a wide range of communications
environments, and also simplifies the calling sequences of the
individual calls. In many cases (depending on underlying security
protocol, associated mechanism, and availability of cached
information), the state information required for context setup can be
sent concurrently with initial signed user data, without interposing
additional message exchanges. Messages may be protected and
transferred in both directions on an established GSS-API security
context concurrently; protection of messages in one direction does
not interfere with protection of messages in the reverse direction.
GSS-API implementations are expected to retain inquirable context
data on a context until the context is released by a caller, even
after the context has expired, although underlying cryptographic data
elements may be deleted after expiration in order to limit their
exposure.
1.1.4: Mechanism Types
In order to successfully establish a security context with a target
peer, it is necessary to identify an appropriate underlying mechanism
type (mech_type) which both initiator and target peers support. The
definition of a mechanism embodies not only the use of a particular
cryptographic technology (or a hybrid or choice among alternative
cryptographic technologies), but also definition of the syntax and
semantics of data element exchanges which that mechanism will employ
in order to support security services.
It is recommended that callers initiating contexts specify the
"default" mech_type value, allowing system-specific functions within
or invoked by the GSS-API implementation to select the appropriate
mech_type, but callers may direct that a particular mech_type be
employed when necessary.
For GSS-API purposes, the phrase "negotiating mechanism" refers to a
mechanism which itself performs negotiation in order to select a
concrete mechanism which is shared between peers and is then used for
context establishment. Only those mechanisms which are defined in
their specifications as negotiating mechanisms are to yield selected
mechanisms with different identifier values than the value which is
input by a GSS-API caller, except for the case of a caller requesting
the "default" mech_type.
The means for identifying a shared mech_type to establish a security
context with a peer will vary in different environments and
circumstances; examples include (but are not limited to):
Linn Standards Track [Page 12]
^L
RFC 2743 GSS-API January 2000
use of a fixed mech_type, defined by configuration, within an
environment
syntactic convention on a target-specific basis, through
examination of a target's name lookup of a target's name in a
naming service or other database in order to identify mech_types
supported by that target
explicit negotiation between GSS-API callers in advance of
security context setup
use of a negotiating mechanism
When transferred between GSS-API peers, mech_type specifiers (per
Section 3 of this document, represented as Object Identifiers (OIDs))
serve to qualify the interpretation of associated tokens. (The
structure and encoding of Object Identifiers is defined in [ISOIEC-
8824] and [ISOIEC-8825].) Use of hierarchically structured OIDs
serves to preclude ambiguous interpretation of mech_type specifiers.
The OID representing the DASS ([RFC-1507]) MechType, for example, is
1.3.12.2.1011.7.5, and that of the Kerberos V5 mechanism ([RFC-
1964]), having been advanced to the level of Proposed Standard, is
1.2.840.113554.1.2.2.
1.1.5: Naming
The GSS-API avoids prescribing naming structures, treating the names
which are transferred across the interface in order to initiate and
accept security contexts as opaque objects. This approach supports
the GSS-API's goal of implementability atop a range of underlying
security mechanisms, recognizing the fact that different mechanisms
process and authenticate names which are presented in different
forms. Generalized services offering translation functions among
arbitrary sets of naming environments are outside the scope of the
GSS-API; availability and use of local conversion functions to
translate among the naming formats supported within a given end
system is anticipated.
Different classes of name representations are used in conjunction
with different GSS-API parameters:
- Internal form (denoted in this document by INTERNAL NAME),
opaque to callers and defined by individual GSS-API
implementations. GSS-API implementations supporting multiple
namespace types must maintain internal tags to disambiguate the
interpretation of particular names. A Mechanism Name (MN) is a
special case of INTERNAL NAME, guaranteed to contain elements
Linn Standards Track [Page 13]
^L
RFC 2743 GSS-API January 2000
corresponding to one and only one mechanism; calls which are
guaranteed to emit MNs or which require MNs as input are so
identified within this specification.
- Contiguous string ("flat") form (denoted in this document by
OCTET STRING); accompanied by OID tags identifying the namespace
to which they correspond. Depending on tag value, flat names may
or may not be printable strings for direct acceptance from and
presentation to users. Tagging of flat names allows GSS-API
callers and underlying GSS-API mechanisms to disambiguate name
types and to determine whether an associated name's type is one
which they are capable of processing, avoiding aliasing problems
which could result from misinterpreting a name of one type as a
name of another type.
- The GSS-API Exported Name Object, a special case of flat name
designated by a reserved OID value, carries a canonicalized form
of a name suitable for binary comparisons.
In addition to providing means for names to be tagged with types,
this specification defines primitives to support a level of naming
environment independence for certain calling applications. To provide
basic services oriented towards the requirements of callers which
need not themselves interpret the internal syntax and semantics of
names, GSS-API calls for name comparison (GSS_Compare_name()),
human-readable display (GSS_Display_name()), input conversion
(GSS_Import_name()), internal name deallocation (GSS_Release_name()),
and internal name duplication (GSS_Duplicate_name()) functions are
defined. (It is anticipated that these proposed GSS-API calls will be
implemented in many end systems based on system-specific name
manipulation primitives already extant within those end systems;
inclusion within the GSS-API is intended to offer GSS-API callers a
portable means to perform specific operations, supportive of
authorization and audit requirements, on authenticated names.)
GSS_Import_name() implementations can, where appropriate, support
more than one printable syntax corresponding to a given namespace
(e.g., alternative printable representations for X.500 Distinguished
Names), allowing flexibility for their callers to select among
alternative representations. GSS_Display_name() implementations
output a printable syntax selected as appropriate to their
operational environments; this selection is a local matter. Callers
desiring portability across alternative printable syntaxes should
refrain from implementing comparisons based on printable name forms
and should instead use the GSS_Compare_name() call to determine
whether or not one internal-format name matches another.
Linn Standards Track [Page 14]
^L
RFC 2743 GSS-API January 2000
When used in large access control lists, the overhead of invoking
GSS_Import_name() and GSS_Compare_name() on each name from the ACL
may be prohibitive. As an alternative way of supporting this case,
GSS-API defines a special form of the contiguous string name which
may be compared directly (e.g., with memcmp()). Contiguous names
suitable for comparison are generated by the GSS_Export_name()
routine, which requires an MN as input. Exported names may be re-
imported by the GSS_Import_name() routine, and the resulting internal
name will also be an MN. The symbolic constant GSS_C_NT_EXPORT_NAME
identifies the "export name" type. Structurally, an exported name
object consists of a header containing an OID identifying the
mechanism that authenticated the name, and a trailer containing the
name itself, where the syntax of the trailer is defined by the
individual mechanism specification. The precise format of an
exported name is defined in Section 3.2 of this specification.
Note that the results obtained by using GSS_Compare_name() will in
general be different from those obtained by invoking
GSS_Canonicalize_name() and GSS_Export_name(), and then comparing the
exported names. The first series of operations determines whether
two (unauthenticated) names identify the same principal; the second
whether a particular mechanism would authenticate them as the same
principal. These two operations will in general give the same
results only for MNs.
The following diagram illustrates the intended dataflow among name-
related GSS-API processing routines.
Linn Standards Track [Page 15]
^L
RFC 2743 GSS-API January 2000
GSS-API library defaults
|
|
V text, for
text --------------> internal_name (IN) -----------> display only
import_name() / display_name()
/
/
/
accept_sec_context() /
| /
| /
| / canonicalize_name()
| /
| /
| /
| /
| /
| |
V V <---------------------
single mechanism import_name() exported name: flat
internal_name (MN) binary "blob" usable
----------------------> for access control
export_name()
1.1.6: Channel Bindings
The GSS-API accommodates the concept of caller-provided channel
binding ("chan_binding") information. Channel bindings are used to
strengthen the quality with which peer entity authentication is
provided during context establishment, by limiting the scope within
which an intercepted context establishment token can be reused by an
attacker. Specifically, they enable GSS-API callers to bind the
establishment of a security context to relevant characteristics
(e.g., addresses, transformed representations of encryption keys) of
the underlying communications channel, of protection mechanisms
applied to that communications channel, and to application-specific
data.
The caller initiating a security context must determine the
appropriate channel binding values to provide as input to the
GSS_Init_sec_context() call, and consistent values must be provided
to GSS_Accept_sec_context() by the context's target, in order for
both peers' GSS-API mechanisms to validate that received tokens
possess correct channel-related characteristics. Use or non-use of
the GSS-API channel binding facility is a caller option. GSS-API
mechanisms can operate in an environment where NULL channel bindings
are presented; mechanism implementors are encouraged, but not
Linn Standards Track [Page 16]
^L
RFC 2743 GSS-API January 2000
required, to make use of caller-provided channel binding data within
their mechanisms. Callers should not assume that underlying
mechanisms provide confidentiality protection for channel binding
information.
When non-NULL channel bindings are provided by callers, certain
mechanisms can offer enhanced security value by interpreting the
bindings' content (rather than simply representing those bindings, or
integrity check values computed on them, within tokens) and will
therefore depend on presentation of specific data in a defined
format. To this end, agreements among mechanism implementors are
defining conventional interpretations for the contents of channel
binding arguments, including address specifiers (with content
dependent on communications protocol environment) for context
initiators and acceptors. (These conventions are being incorporated
in GSS-API mechanism specifications and into the GSS-API C language
bindings specification.) In order for GSS-API callers to be portable
across multiple mechanisms and achieve the full security
functionality which each mechanism can provide, it is strongly
recommended that GSS-API callers provide channel bindings consistent
with these conventions and those of the networking environment in
which they operate.
1.2: GSS-API Features and Issues
This section describes aspects of GSS-API operations, of the security
services which the GSS-API provides, and provides commentary on
design issues.
1.2.1: Status Reporting and Optional Service Support
1.2.1.1: Status Reporting
Each GSS-API call provides two status return values. Major_status
values provide a mechanism-independent indication of call status
(e.g., GSS_S_COMPLETE, GSS_S_FAILURE, GSS_S_CONTINUE_NEEDED),
sufficient to drive normal control flow within the caller in a
generic fashion. Table 1 summarizes the defined major_status return
codes in tabular fashion.
Sequencing-related informatory major_status codes
(GSS_S_DUPLICATE_TOKEN, GSS_S_OLD_TOKEN, GSS_S_UNSEQ_TOKEN, and
GSS_S_GAP_TOKEN) can be indicated in conjunction with either
GSS_S_COMPLETE or GSS_S_FAILURE status for GSS-API per-message calls.
For context establishment calls, these sequencing-related codes will
be indicated only in conjunction with GSS_S_FAILURE status (never in
Linn Standards Track [Page 17]
^L
RFC 2743 GSS-API January 2000
conjunction with GSS_S_COMPLETE or GSS_S_CONTINUE_NEEDED), and,
therefore, always correspond to fatal failures if encountered during
the context establishment phase.
Table 1: GSS-API Major Status Codes
FATAL ERROR CODES
GSS_S_BAD_BINDINGS channel binding mismatch
GSS_S_BAD_MECH unsupported mechanism requested
GSS_S_BAD_NAME invalid name provided
GSS_S_BAD_NAMETYPE name of unsupported type provided
GSS_S_BAD_STATUS invalid input status selector
GSS_S_BAD_SIG token had invalid integrity check
GSS_S_BAD_MIC preferred alias for GSS_S_BAD_SIG
GSS_S_CONTEXT_EXPIRED specified security context expired
GSS_S_CREDENTIALS_EXPIRED expired credentials detected
GSS_S_DEFECTIVE_CREDENTIAL defective credential detected
GSS_S_DEFECTIVE_TOKEN defective token detected
GSS_S_FAILURE failure, unspecified at GSS-API
level
GSS_S_NO_CONTEXT no valid security context specified
GSS_S_NO_CRED no valid credentials provided
GSS_S_BAD_QOP unsupported QOP value
GSS_S_UNAUTHORIZED operation unauthorized
GSS_S_UNAVAILABLE operation unavailable
GSS_S_DUPLICATE_ELEMENT duplicate credential element requested
GSS_S_NAME_NOT_MN name contains multi-mechanism elements
INFORMATORY STATUS CODES
GSS_S_COMPLETE normal completion
GSS_S_CONTINUE_NEEDED continuation call to routine
required
GSS_S_DUPLICATE_TOKEN duplicate per-message token
detected
GSS_S_OLD_TOKEN timed-out per-message token
detected
GSS_S_UNSEQ_TOKEN reordered (early) per-message token
detected
GSS_S_GAP_TOKEN skipped predecessor token(s)
detected
Minor_status provides more detailed status information which may
include status codes specific to the underlying security mechanism.
Minor_status values are not specified in this document.
Linn Standards Track [Page 18]
^L
RFC 2743 GSS-API January 2000
GSS_S_CONTINUE_NEEDED major_status returns, and optional message
outputs, are provided in GSS_Init_sec_context() and
GSS_Accept_sec_context() calls so that different mechanisms'
employment of different numbers of messages within their
authentication sequences need not be reflected in separate code paths
within calling applications. Instead, such cases are accommodated
with sequences of continuation calls to GSS_Init_sec_context() and
GSS_Accept_sec_context(). The same facility is used to encapsulate
mutual authentication within the GSS-API's context initiation calls.
For mech_types which require interactions with third-party servers in
order to establish a security context, GSS-API context establishment
calls may block pending completion of such third-party interactions.
On the other hand, no GSS-API calls pend on serialized interactions
with GSS-API peer entities. As a result, local GSS-API status
returns cannot reflect unpredictable or asynchronous exceptions
occurring at remote peers, and reflection of such status information
is a caller responsibility outside the GSS-API.
1.2.1.2: Optional Service Support
A context initiator may request various optional services at context
establishment time. Each of these services is requested by setting a
flag in the req_flags input parameter to GSS_Init_sec_context().
The optional services currently defined are:
- Delegation - The (usually temporary) transfer of rights from
initiator to acceptor, enabling the acceptor to authenticate
itself as an agent of the initiator.
- Mutual Authentication - In addition to the initiator
authenticating its identity to the context acceptor, the context
acceptor should also authenticate itself to the initiator.
- Replay detection - In addition to providing message integrity
services, GSS_GetMIC() and GSS_Wrap() should include message
numbering information to enable GSS_VerifyMIC() and GSS_Unwrap()
to detect if a message has been duplicated.
- Out-of-sequence detection - In addition to providing message
integrity services, GSS_GetMIC() and GSS_Wrap() should include
message sequencing information to enable GSS_VerifyMIC() and
GSS_Unwrap() to detect if a message has been received out of
sequence.
Linn Standards Track [Page 19]
^L
RFC 2743 GSS-API January 2000
- Anonymous authentication - The establishment of the security
context should not reveal the initiator's identity to the context
acceptor.
- Available per-message confidentiality - requests that per-
message confidentiality services be available on the context.
- Available per-message integrity - requests that per-message
integrity services be available on the context.
Any currently undefined bits within such flag arguments should be
ignored by GSS-API implementations when presented by an application,
and should be set to zero when returned to the application by the
GSS-API implementation.
Some mechanisms may not support all optional services, and some
mechanisms may only support some services in conjunction with others.
Both GSS_Init_sec_context() and GSS_Accept_sec_context() inform the
applications which services will be available from the context when
the establishment phase is complete, via the ret_flags output
parameter. In general, if the security mechanism is capable of
providing a requested service, it should do so, even if additional
services must be enabled in order to provide the requested service.
If the mechanism is incapable of providing a requested service, it
should proceed without the service, leaving the application to abort
the context establishment process if it considers the requested
service to be mandatory.
Some mechanisms may specify that support for some services is
optional, and that implementors of the mechanism need not provide it.
This is most commonly true of the confidentiality service, often
because of legal restrictions on the use of data-encryption, but may
apply to any of the services. Such mechanisms are required to send
at least one token from acceptor to initiator during context
establishment when the initiator indicates a desire to use such a
service, so that the initiating GSS-API can correctly indicate
whether the service is supported by the acceptor's GSS-API.
1.2.2: Per-Message Security Service Availability
When a context is established, two flags are returned to indicate the
set of per-message protection security services which will be
available on the context:
the integ_avail flag indicates whether per-message integrity and
data origin authentication services are available
Linn Standards Track [Page 20]
^L
RFC 2743 GSS-API January 2000
the conf_avail flag indicates whether per-message confidentiality
services are available, and will never be returned TRUE unless the
integ_avail flag is also returned TRUE
GSS-API callers desiring per-message security services should check
the values of these flags at context establishment time, and must be
aware that a returned FALSE value for integ_avail means that
invocation of GSS_GetMIC() or GSS_Wrap() primitives on the associated
context will apply no cryptographic protection to user data messages.
The GSS-API per-message integrity and data origin authentication
services provide assurance to a receiving caller that protection was
applied to a message by the caller's peer on the security context,
corresponding to the entity named at context initiation. The GSS-API
per-message confidentiality service provides assurance to a sending
caller that the message's content is protected from access by
entities other than the context's named peer.
The GSS-API per-message protection service primitives, as the
category name implies, are oriented to operation at the granularity
of protocol data units. They perform cryptographic operations on the
data units, transfer cryptographic control information in tokens,
and, in the case of GSS_Wrap(), encapsulate the protected data unit.
As such, these primitives are not oriented to efficient data
protection for stream-paradigm protocols (e.g., Telnet) if
cryptography must be applied on an octet-by-octet basis.
1.2.3: Per-Message Replay Detection and Sequencing
Certain underlying mech_types offer support for replay detection
and/or sequencing of messages transferred on the contexts they
support. These optionally-selectable protection features are distinct
from replay detection and sequencing features applied to the context
establishment operation itself; the presence or absence of context-
level replay or sequencing features is wholly a function of the
underlying mech_type's capabilities, and is not selected or omitted
as a caller option.
The caller initiating a context provides flags (replay_det_req_flag
and sequence_req_flag) to specify whether the use of per-message
replay detection and sequencing features is desired on the context
being established. The GSS-API implementation at the initiator system
can determine whether these features are supported (and whether they
are optionally selectable) as a function of the selected mechanism,
without need for bilateral negotiation with the target. When enabled,
these features provide recipients with indicators as a result of
GSS-API processing of incoming messages, identifying whether those
messages were detected as duplicates or out-of-sequence. Detection of
Linn Standards Track [Page 21]
^L
RFC 2743 GSS-API January 2000
such events does not prevent a suspect message from being provided to
a recipient; the appropriate course of action on a suspect message is
a matter of caller policy.
The semantics of the replay detection and sequencing services applied
to received messages, as visible across the interface which the GSS-
API provides to its clients, are as follows:
When replay_det_state is TRUE, the possible major_status returns for
well-formed and correctly signed messages are as follows:
1. GSS_S_COMPLETE, without concurrent indication of
GSS_S_DUPLICATE_TOKEN or GSS_S_OLD_TOKEN, indicates that the
message was within the window (of time or sequence space) allowing
replay events to be detected, and that the message was not a
replay of a previously-processed message within that window.
2. GSS_S_DUPLICATE_TOKEN indicates that the cryptographic
checkvalue on the received message was correct, but that the
message was recognized as a duplicate of a previously-processed
message. In addition to identifying duplicated tokens originated
by a context's peer, this status may also be used to identify
reflected copies of locally-generated tokens; it is recommended
that mechanism designers include within their protocols facilities
to detect and report such tokens.
3. GSS_S_OLD_TOKEN indicates that the cryptographic checkvalue on
the received message was correct, but that the message is too old
to be checked for duplication.
When sequence_state is TRUE, the possible major_status returns for
well-formed and correctly signed messages are as follows:
1. GSS_S_COMPLETE, without concurrent indication of
GSS_S_DUPLICATE_TOKEN, GSS_S_OLD_TOKEN, GSS_S_UNSEQ_TOKEN, or
GSS_S_GAP_TOKEN, indicates that the message was within the window
(of time or sequence space) allowing replay events to be detected,
that the message was not a replay of a previously-processed
message within that window, and that no predecessor sequenced
messages are missing relative to the last received message (if
any) processed on the context with a correct cryptographic
checkvalue.
2. GSS_S_DUPLICATE_TOKEN indicates that the integrity check value
on the received message was correct, but that the message was
recognized as a duplicate of a previously-processed message. In
addition to identifying duplicated tokens originated by a
context's peer, this status may also be used to identify reflected
Linn Standards Track [Page 22]
^L
RFC 2743 GSS-API January 2000
copies of locally-generated tokens; it is recommended that
mechanism designers include within their protocols facilities to
detect and report such tokens.
3. GSS_S_OLD_TOKEN indicates that the integrity check value on the
received message was correct, but that the token is too old to be
checked for duplication.
4. GSS_S_UNSEQ_TOKEN indicates that the cryptographic checkvalue
on the received message was correct, but that it is earlier in a
sequenced stream than a message already processed on the context.
[Note: Mechanisms can be architected to provide a stricter form of
sequencing service, delivering particular messages to recipients
only after all predecessor messages in an ordered stream have been
delivered. This type of support is incompatible with the GSS-API
paradigm in which recipients receive all messages, whether in
order or not, and provide them (one at a time, without intra-GSS-
API message buffering) to GSS-API routines for validation. GSS-
API facilities provide supportive functions, aiding clients to
achieve strict message stream integrity in an efficient manner in
conjunction with sequencing provisions in communications
protocols, but the GSS-API does not offer this level of message
stream integrity service by itself.]
5. GSS_S_GAP_TOKEN indicates that the cryptographic checkvalue on
the received message was correct, but that one or more predecessor
sequenced messages have not been successfully processed relative
to the last received message (if any) processed on the context
with a correct cryptographic checkvalue.
As the message stream integrity features (especially sequencing) may
interfere with certain applications' intended communications
paradigms, and since support for such features is likely to be
resource intensive, it is highly recommended that mech_types
supporting these features allow them to be activated selectively on
initiator request when a context is established. A context initiator
and target are provided with corresponding indicators
(replay_det_state and sequence_state), signifying whether these
features are active on a given context.
An example mech_type supporting per-message replay detection could
(when replay_det_state is TRUE) implement the feature as follows: The
underlying mechanism would insert timestamps in data elements output
by GSS_GetMIC() and GSS_Wrap(), and would maintain (within a time-
limited window) a cache (qualified by originator-recipient pair)
identifying received data elements processed by GSS_VerifyMIC() and
GSS_Unwrap(). When this feature is active, exception status returns
(GSS_S_DUPLICATE_TOKEN, GSS_S_OLD_TOKEN) will be provided when
Linn Standards Track [Page 23]
^L
RFC 2743 GSS-API January 2000
GSS_VerifyMIC() or GSS_Unwrap() is presented with a message which is
either a detected duplicate of a prior message or which is too old to
validate against a cache of recently received messages.
1.2.4: Quality of Protection
Some mech_types provide their users with fine granularity control
over the means used to provide per-message protection, allowing
callers to trade off security processing overhead dynamically against
the protection requirements of particular messages. A per-message
quality-of-protection parameter (analogous to quality-of-service, or
QOS) selects among different QOP options supported by that mechanism.
On context establishment for a multi-QOP mech_type, context-level
data provides the prerequisite data for a range of protection
qualities.
It is expected that the majority of callers will not wish to exert
explicit mechanism-specific QOP control and will therefore request
selection of a default QOP. Definitions of, and choices among, non-
default QOP values are mechanism-specific, and no ordered sequences
of QOP values can be assumed equivalent across different mechanisms.
Meaningful use of non-default QOP values demands that callers be
familiar with the QOP definitions of an underlying mechanism or
mechanisms, and is therefore a non-portable construct. The
GSS_S_BAD_QOP major_status value is defined in order to indicate that
a provided QOP value is unsupported for a security context, most
likely because that value is unrecognized by the underlying
mechanism.
In the interests of interoperability, mechanisms which allow optional
support of particular QOP values shall satisfy one of the following
conditions. Either:
(i) All implementations of the mechanism are required to be
capable of processing messages protected using any QOP value,
regardless of whether they can apply protection corresponding to
that QOP, or
(ii) The set of mutually-supported receiver QOP values must be
determined during context establishment, and messages may be
protected by either peer using only QOP values from this
mutually-supported set.
NOTE: (i) is just a special-case of (ii), where implementations are
required to support all QOP values on receipt.
Linn Standards Track [Page 24]
^L
RFC 2743 GSS-API January 2000
1.2.5: Anonymity Support
In certain situations or environments, an application may wish to
authenticate a peer and/or protect communications using GSS-API per-
message services without revealing its own identity. For example,
consider an application which provides read access to a research
database, and which permits queries by arbitrary requestors. A
client of such a service might wish to authenticate the service, to
establish trust in the information received from it, but might not
wish to disclose its identity to the service for privacy reasons.
In ordinary GSS-API usage, a context initiator's identity is made
available to the context acceptor as part of the context
establishment process. To provide for anonymity support, a facility
(input anon_req_flag to GSS_Init_sec_context()) is provided through
which context initiators may request that their identity not be
provided to the context acceptor. Mechanisms are not required to
honor this request, but a caller will be informed (via returned
anon_state indicator from GSS_Init_sec_context()) whether or not the
request is honored. Note that authentication as the anonymous
principal does not necessarily imply that credentials are not
required in order to establish a context.
Section 4.5 of this document defines the Object Identifier value used
to identify an anonymous principal.
Four possible combinations of anon_state and mutual_state are
possible, with the following results:
anon_state == FALSE, mutual_state == FALSE: initiator
authenticated to target.
anon_state == FALSE, mutual_state == TRUE: initiator authenticated
to target, target authenticated to initiator.
anon_state == TRUE, mutual_state == FALSE: initiator authenticated
as anonymous principal to target.
anon_state == TRUE, mutual_state == TRUE: initiator authenticated
as anonymous principal to target, target authenticated to
initiator.
1.2.6: Initialization
No initialization calls (i.e., calls which must be invoked prior to
invocation of other facilities in the interface) are defined in GSS-
API. As an implication of this fact, GSS-API implementations must
themselves be self-initializing.
Linn Standards Track [Page 25]
^L
RFC 2743 GSS-API January 2000
1.2.7: Per-Message Protection During Context Establishment
A facility is defined in GSS-V2 to enable protection and buffering of
data messages for later transfer while a security context's
establishment is in GSS_S_CONTINUE_NEEDED status, to be used in cases
where the caller side already possesses the necessary session key to
enable this processing. Specifically, a new state Boolean, called
prot_ready_state, is added to the set of information returned by
GSS_Init_sec_context(), GSS_Accept_sec_context(), and
GSS_Inquire_context().
For context establishment calls, this state Boolean is valid and
interpretable when the associated major_status is either
GSS_S_CONTINUE_NEEDED, or GSS_S_COMPLETE. Callers of GSS-API (both
initiators and acceptors) can assume that per-message protection (via
GSS_Wrap(), GSS_Unwrap(), GSS_GetMIC() and GSS_VerifyMIC()) is
available and ready for use if either: prot_ready_state == TRUE, or
major_status == GSS_S_COMPLETE, though mutual authentication (if
requested) cannot be guaranteed until GSS_S_COMPLETE is returned.
Callers making use of per-message protection services in advance of
GSS_S_COMPLETE status should be aware of the possibility that a
subsequent context establishment step may fail, and that certain
context data (e.g., mech_type) as returned for subsequent calls may
change.
This approach achieves full, transparent backward compatibility for
GSS-API V1 callers, who need not even know of the existence of
prot_ready_state, and who will get the expected behavior from
GSS_S_COMPLETE, but who will not be able to use per-message
protection before GSS_S_COMPLETE is returned.
It is not a requirement that GSS-V2 mechanisms ever return TRUE
prot_ready_state before completion of context establishment (indeed,
some mechanisms will not evolve usable message protection keys,
especially at the context acceptor, before context establishment is
complete). It is expected but not required that GSS-V2 mechanisms
will return TRUE prot_ready_state upon completion of context
establishment if they support per-message protection at all (however
GSS-V2 applications should not assume that TRUE prot_ready_state will
always be returned together with the GSS_S_COMPLETE major_status,
since GSS-V2 implementations may continue to support GSS-V1 mechanism
code, which will never return TRUE prot_ready_state).
When prot_ready_state is returned TRUE, mechanisms shall also set
those context service indicator flags (deleg_state, mutual_state,
replay_det_state, sequence_state, anon_state, trans_state,
conf_avail, integ_avail) which represent facilities confirmed, at
that time, to be available on the context being established. In
Linn Standards Track [Page 26]
^L
RFC 2743 GSS-API January 2000
situations where prot_ready_state is returned before GSS_S_COMPLETE,
it is possible that additional facilities may be confirmed and
subsequently indicated when GSS_S_COMPLETE is returned.
1.2.8: Implementation Robustness
This section recommends aspects of GSS-API implementation behavior in
the interests of overall robustness.
Invocation of GSS-API calls is to incur no undocumented side effects
visible at the GSS-API level.
If a token is presented for processing on a GSS-API security context
and that token generates a fatal error in processing or is otherwise
determined to be invalid for that context, the context's state should
not be disrupted for purposes of processing subsequent valid tokens.
Certain local conditions at a GSS-API implementation (e.g.,
unavailability of memory) may preclude, temporarily or permanently,
the successful processing of tokens on a GSS-API security context,
typically generating GSS_S_FAILURE major_status returns along with
locally-significant minor_status. For robust operation under such
conditions, the following recommendations are made:
Failing calls should free any memory they allocate, so that
callers may retry without causing further loss of resources.
Failure of an individual call on an established context should not
preclude subsequent calls from succeeding on the same context.
Whenever possible, it should be possible for
GSS_Delete_sec_context() calls to be successfully processed even
if other calls cannot succeed, thereby enabling context-related
resources to be released.
A failure of GSS_GetMIC() or GSS_Wrap() due to an attempt to use an
unsupported QOP will not interfere with context validity, nor shall
such a failure impact the ability of the application to subsequently
invoke GSS_GetMIC() or GSS_Wrap() using a supported QOP. Any state
information concerning sequencing of outgoing messages shall be
unchanged by an unsuccessful call of GSS_GetMIC() or GSS_Wrap().
Linn Standards Track [Page 27]
^L
RFC 2743 GSS-API January 2000
1.2.9: Delegation
The GSS-API allows delegation to be controlled by the initiating
application via a Boolean parameter to GSS_Init_sec_context(), the
routine that establishes a security context. Some mechanisms do not
support delegation, and for such mechanisms attempts by an
application to enable delegation are ignored.
The acceptor of a security context for which the initiator enabled
delegation will receive (via the delegated_cred_handle parameter of
GSS_Accept_sec_context()) a credential handle that contains the
delegated identity, and this credential handle may be used to
initiate subsequent GSS-API security contexts as an agent or delegate
of the initiator. If the original initiator's identity is "A" and
the delegate's identity is "B", then, depending on the underlying
mechanism, the identity embodied by the delegated credential may be
either "A" or "B acting for A".
For many mechanisms that support delegation, a simple Boolean does
not provide enough control. Examples of additional aspects of
delegation control that a mechanism might provide to an application
are duration of delegation, network addresses from which delegation
is valid, and constraints on the tasks that may be performed by a
delegate. Such controls are presently outside the scope of the GSS-
API. GSS-API implementations supporting mechanisms offering
additional controls should provide extension routines that allow
these controls to be exercised (perhaps by modifying the initiator's
GSS-API credential prior to its use in establishing a context).
However, the simple delegation control provided by GSS-API should
always be able to over-ride other mechanism-specific delegation
controls; if the application instructs GSS_Init_sec_context() that
delegation is not desired, then the implementation must not permit
delegation to occur. This is an exception to the general rule that a
mechanism may enable services even if they are not requested;
delegation may only be provided at the explicit request of the
application.
1.2.10: Interprocess Context Transfer
GSS-API V2 provides routines (GSS_Export_sec_context() and
GSS_Import_sec_context()) which allow a security context to be
transferred between processes on a single machine. The most common
use for such a feature is a client-server design where the server is
implemented as a single process that accepts incoming security
contexts, which then launches child processes to deal with the data
on these contexts. In such a design, the child processes must have
access to the security context data structure created within the
Linn Standards Track [Page 28]
^L
RFC 2743 GSS-API January 2000
parent by its call to GSS_Accept_sec_context() so that they can use
per-message protection services and delete the security context when
the communication session ends.
Since the security context data structure is expected to contain
sequencing information, it is impractical in general to share a
context between processes. Thus GSS-API provides a call
(GSS_Export_sec_context()) that the process which currently owns the
context can call to declare that it has no intention to use the
context subsequently, and to create an inter-process token containing
information needed by the adopting process to successfully import the
context. After successful completion of this call, the original
security context is made inaccessible to the calling process by GSS-
API, and any context handles referring to this context are no longer
valid. The originating process transfers the inter-process token to
the adopting process, which passes it to GSS_Import_sec_context(),
and a fresh context handle is created such that it is functionally
identical to the original context.
The inter-process token may contain sensitive data from the original
security context (including cryptographic keys). Applications using
inter-process tokens to transfer security contexts must take
appropriate steps to protect these tokens in transit.
Implementations are not required to support the inter-process
transfer of security contexts. The ability to transfer a security
context is indicated when the context is created, by
GSS_Init_sec_context() or GSS_Accept_sec_context() indicating a TRUE
trans_state return value.
2: Interface Descriptions
This section describes the GSS-API's service interface, dividing the
set of calls offered into four groups. Credential management calls
are related to the acquisition and release of credentials by
principals. Context-level calls are related to the management of
security contexts between principals. Per-message calls are related
to the protection of individual messages on established security
contexts. Support calls provide ancillary functions useful to GSS-API
callers. Table 2 groups and summarizes the calls in tabular fashion.
Table 2: GSS-API Calls
CREDENTIAL MANAGEMENT
GSS_Acquire_cred acquire credentials for use
GSS_Release_cred release credentials after use
GSS_Inquire_cred display information about
credentials
Linn Standards Track [Page 29]
^L
RFC 2743 GSS-API January 2000
GSS_Add_cred construct credentials incrementally
GSS_Inquire_cred_by_mech display per-mechanism credential
information
CONTEXT-LEVEL CALLS
GSS_Init_sec_context initiate outbound security context
GSS_Accept_sec_context accept inbound security context
GSS_Delete_sec_context flush context when no longer needed
GSS_Process_context_token process received control token on
context
GSS_Context_time indicate validity time remaining on
context
GSS_Inquire_context display information about context
GSS_Wrap_size_limit determine GSS_Wrap token size limit
GSS_Export_sec_context transfer context to other process
GSS_Import_sec_context import transferred context
PER-MESSAGE CALLS
GSS_GetMIC apply integrity check, receive as
token separate from message
GSS_VerifyMIC validate integrity check token
along with message
GSS_Wrap sign, optionally encrypt,
encapsulate
GSS_Unwrap decapsulate, decrypt if needed,
validate integrity check
SUPPORT CALLS
GSS_Display_status translate status codes to printable
form
GSS_Indicate_mechs indicate mech_types supported on
local system
GSS_Compare_name compare two names for equality
GSS_Display_name translate name to printable form
GSS_Import_name convert printable name to
normalized form
GSS_Release_name free storage of normalized-form
name
GSS_Release_buffer free storage of general GSS-allocated
object
GSS_Release_OID_set free storage of OID set object
GSS_Create_empty_OID_set create empty OID set
GSS_Add_OID_set_member add member to OID set
GSS_Test_OID_set_member test if OID is member of OID set
GSS_Inquire_names_for_mech indicate name types supported by
Linn Standards Track [Page 30]
^L
RFC 2743 GSS-API January 2000
mechanism
GSS_Inquire_mechs_for_name indicates mechanisms supporting name
type
GSS_Canonicalize_name translate name to per-mechanism form
GSS_Export_name externalize per-mechanism name
GSS_Duplicate_name duplicate name object
2.1: Credential management calls
These GSS-API calls provide functions related to the management of
credentials. Their characterization with regard to whether or not
they may block pending exchanges with other network entities (e.g.,
directories or authentication servers) depends in part on OS-specific
(extra-GSS-API) issues, so is not specified in this document.
The GSS_Acquire_cred() call is defined within the GSS-API in support
of application portability, with a particular orientation towards
support of portable server applications. It is recognized that (for
certain systems and mechanisms) credentials for interactive users may
be managed differently from credentials for server processes; in such
environments, it is the GSS-API implementation's responsibility to
distinguish these cases and the procedures for making this
distinction are a local matter. The GSS_Release_cred() call provides
a means for callers to indicate to the GSS-API that use of a
credentials structure is no longer required. The GSS_Inquire_cred()
call allows callers to determine information about a credentials
structure. The GSS_Add_cred() call enables callers to append
elements to an existing credential structure, allowing iterative
construction of a multi-mechanism credential. The
GSS_Inquire_cred_by_mech() call enables callers to extract per-
mechanism information describing a credentials structure.
2.1.1: GSS_Acquire_cred call
Inputs:
o desired_name INTERNAL NAME, -- NULL requests locally-determined
-- default
o lifetime_req INTEGER, -- in seconds; 0 requests default
o desired_mechs SET OF OBJECT IDENTIFIER, -- NULL requests
-- system-selected default
o cred_usage INTEGER -- 0=INITIATE-AND-ACCEPT, 1=INITIATE-ONLY,
-- 2=ACCEPT-ONLY
Linn Standards Track [Page 31]
^L
RFC 2743 GSS-API January 2000
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o output_cred_handle CREDENTIAL HANDLE, -- if returned non-NULL,
-- caller must release with GSS_Release_cred()
o actual_mechs SET OF OBJECT IDENTIFIER, -- if returned non-NULL,
-- caller must release with GSS_Release_oid_set()
o lifetime_rec INTEGER -- in seconds, or reserved value for
-- INDEFINITE
Return major_status codes:
o GSS_S_COMPLETE indicates that requested credentials were
successfully established, for the duration indicated in lifetime_rec,
suitable for the usage requested in cred_usage, for the set of
mech_types indicated in actual_mechs, and that those credentials can
be referenced for subsequent use with the handle returned in
output_cred_handle.
o GSS_S_BAD_MECH indicates that a mech_type unsupported by the GSS-
API implementation type was requested, causing the credential
establishment operation to fail.
o GSS_S_BAD_NAMETYPE indicates that the provided desired_name is
uninterpretable or of a type unsupported by the applicable underlying
GSS-API mechanism(s), so no credentials could be established for the
accompanying desired_name.
o GSS_S_BAD_NAME indicates that the provided desired_name is
inconsistent in terms of internally-incorporated type specifier
information, so no credentials could be established for the
accompanying desired_name.
o GSS_S_CREDENTIALS_EXPIRED indicates that underlying credential
elements corresponding to the requested desired_name have expired, so
requested credentials could not be established.
o GSS_S_NO_CRED indicates that no credential elements corresponding
to the requested desired_name and usage could be accessed, so
requested credentials could not be established. In particular, this
status should be returned upon temporary user-fixable conditions
Linn Standards Track [Page 32]
^L
RFC 2743 GSS-API January 2000
preventing successful credential establishment and upon lack of
authorization to establish and use credentials associated with the
identity named in the input desired_name argument.
o GSS_S_FAILURE indicates that credential establishment failed for
reasons unspecified at the GSS-API level.
GSS_Acquire_cred() is used to acquire credentials so that a principal
can (as a function of the input cred_usage parameter) initiate and/or
accept security contexts under the identity represented by the
desired_name input argument. On successful completion, the returned
output_cred_handle result provides a handle for subsequent references
to the acquired credentials. Typically, single-user client processes
requesting that default credential behavior be applied for context
establishment purposes will have no need to invoke this call.
A caller may provide the value NULL (GSS_C_NO_NAME) for desired_name,
which will be interpreted as a request for a credential handle that
will invoke default behavior when passed to GSS_Init_sec_context(),
if cred_usage is GSS_C_INITIATE or GSS_C_BOTH, or
GSS_Accept_sec_context(), if cred_usage is GSS_C_ACCEPT or
GSS_C_BOTH. It is possible that multiple pre-established credentials
may exist for the same principal identity (for example, as a result
of multiple user login sessions) when GSS_Acquire_cred() is called;
the means used in such cases to select a specific credential are
local matters. The input lifetime_req argument to GSS_Acquire_cred()
may provide useful information for local GSS-API implementations to
employ in making this disambiguation in a manner which will best
satisfy a caller's intent.
This routine is expected to be used primarily by context acceptors,
since implementations are likely to provide mechanism-specific ways
of obtaining GSS-API initiator credentials from the system login
process. Some implementations may therefore not support the
acquisition of GSS_C_INITIATE or GSS_C_BOTH credentials via
GSS_Acquire_cred() for any name other than GSS_C_NO_NAME, or a name
resulting from applying GSS_Inquire_context() to an active context,
or a name resulting from applying GSS_Inquire_cred() against a
credential handle corresponding to default behavior. It is important
to recognize that the explicit name which is yielded by resolving a
default reference may change over time, e.g., as a result of local
credential element management operations outside GSS-API; once
resolved, however, the value of such an explicit name will remain
constant.
The lifetime_rec result indicates the length of time for which the
acquired credentials will be valid, as an offset from the present. A
mechanism may return a reserved value indicating INDEFINITE if no
Linn Standards Track [Page 33]
^L
RFC 2743 GSS-API January 2000
constraints on credential lifetime are imposed. A caller of
GSS_Acquire_cred() can request a length of time for which acquired
credentials are to be valid (lifetime_req argument), beginning at the
present, or can request credentials with a default validity interval.
(Requests for postdated credentials are not supported within the
GSS-API.) Certain mechanisms and implementations may bind in
credential validity period specifiers at a point preliminary to
invocation of the GSS_Acquire_cred() call (e.g., in conjunction with
user login procedures). As a result, callers requesting non-default
values for lifetime_req must recognize that such requests cannot
always be honored and must be prepared to accommodate the use of
returned credentials with different lifetimes as indicated in
lifetime_rec.
The caller of GSS_Acquire_cred() can explicitly specify a set of
mech_types which are to be accommodated in the returned credentials
(desired_mechs argument), or can request credentials for a system-
defined default set of mech_types. Selection of the system-specified
default set is recommended in the interests of application
portability. The actual_mechs return value may be interrogated by the
caller to determine the set of mechanisms with which the returned
credentials may be used.
2.1.2: GSS_Release_cred call
Input:
o cred_handle CREDENTIAL HANDLE -- if GSS_C_NO_CREDENTIAL
-- is specified, the call will complete successfully, but
-- will have no effect; no credential elements will be
-- released.
Outputs:
o major_status INTEGER,
o minor_status INTEGER
Return major_status codes:
o GSS_S_COMPLETE indicates that the credentials referenced by the
input cred_handle were released for purposes of subsequent access by
the caller. The effect on other processes which may be authorized
shared access to such credentials is a local matter.
Linn Standards Track [Page 34]
^L
RFC 2743 GSS-API January 2000
o GSS_S_NO_CRED indicates that no release operation was performed,
either because the input cred_handle was invalid or because the
caller lacks authorization to access the referenced credentials.
o GSS_S_FAILURE indicates that the release operation failed for
reasons unspecified at the GSS-API level.
Provides a means for a caller to explicitly request that credentials
be released when their use is no longer required. Note that system-
specific credential management functions are also likely to exist,
for example to assure that credentials shared among processes are
properly deleted when all affected processes terminate, even if no
explicit release requests are issued by those processes. Given the
fact that multiple callers are not precluded from gaining authorized
access to the same credentials, invocation of GSS_Release_cred()
cannot be assumed to delete a particular set of credentials on a
system-wide basis.
2.1.3: GSS_Inquire_cred call
Input:
o cred_handle CREDENTIAL HANDLE -- if GSS_C_NO_CREDENTIAL
-- is specified, default initiator credentials are queried
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o cred_name INTERNAL NAME, -- caller must release with
-- GSS_Release_name()
o lifetime_rec INTEGER -- in seconds, or reserved value for
-- INDEFINITE
o cred_usage INTEGER, -- 0=INITIATE-AND-ACCEPT, 1=INITIATE-ONLY,
-- 2=ACCEPT-ONLY
o mech_set SET OF OBJECT IDENTIFIER -- caller must release
-- with GSS_Release_oid_set()
Linn Standards Track [Page 35]
^L
RFC 2743 GSS-API January 2000
Return major_status codes:
o GSS_S_COMPLETE indicates that the credentials referenced by the
input cred_handle argument were valid, and that the output cred_name,
lifetime_rec, and cred_usage values represent, respectively, the
credentials' associated principal name, remaining lifetime, suitable
usage modes, and supported mechanism types.
o GSS_S_NO_CRED indicates that no information could be returned
about the referenced credentials, either because the input
cred_handle was invalid or because the caller lacks authorization to
access the referenced credentials.
o GSS_S_DEFECTIVE_CREDENTIAL indicates that the referenced
credentials are invalid.
o GSS_S_CREDENTIALS_EXPIRED indicates that the referenced
credentials have expired.
o GSS_S_FAILURE indicates that the operation failed for reasons
unspecified at the GSS-API level.
The GSS_Inquire_cred() call is defined primarily for the use of those
callers which request use of default credential behavior rather than
acquiring credentials explicitly with GSS_Acquire_cred(). It enables
callers to determine a credential structure's associated principal
name, remaining validity period, usability for security context
initiation and/or acceptance, and supported mechanisms.
For a multi-mechanism credential, the returned "lifetime" specifier
indicates the shortest lifetime of any of the mechanisms' elements in
the credential (for either context initiation or acceptance
purposes).
GSS_Inquire_cred() should indicate INITIATE-AND-ACCEPT for
"cred_usage" if both of the following conditions hold:
(1) there exists in the credential an element which allows context
initiation using some mechanism
(2) there exists in the credential an element which allows context
acceptance using some mechanism (allowably, but not necessarily,
one of the same mechanism(s) qualifying for (1)).
If condition (1) holds but not condition (2), GSS_Inquire_cred()
should indicate INITIATE-ONLY for "cred_usage". If condition (2)
holds but not condition (1), GSS_Inquire_cred() should indicate
ACCEPT-ONLY for "cred_usage".
Linn Standards Track [Page 36]
^L
RFC 2743 GSS-API January 2000
Callers requiring finer disambiguation among available combinations
of lifetimes, usage modes, and mechanisms should call the
GSS_Inquire_cred_by_mech() routine, passing that routine one of the
mech OIDs returned by GSS_Inquire_cred().
2.1.4: GSS_Add_cred call
Inputs:
o input_cred_handle CREDENTIAL HANDLE -- handle to credential
-- structure created with prior GSS_Acquire_cred() or
-- GSS_Add_cred() call; see text for definition of behavior
-- when GSS_C_NO_CREDENTIAL provided.
o desired_name INTERNAL NAME
o initiator_time_req INTEGER -- in seconds; 0 requests default
o acceptor_time_req INTEGER -- in seconds; 0 requests default
o desired_mech OBJECT IDENTIFIER
o cred_usage INTEGER -- 0=INITIATE-AND-ACCEPT, 1=INITIATE-ONLY,
-- 2=ACCEPT-ONLY
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o output_cred_handle CREDENTIAL HANDLE, -- NULL to request that
-- credential elements be added "in place" to the credential
-- structure identified by input_cred_handle,
-- non-NULL pointer to request that
-- a new credential structure and handle be created.
-- if credential handle returned, caller must release with
-- GSS_Release_cred()
o actual_mechs SET OF OBJECT IDENTIFIER, -- if returned, caller must
-- release with GSS_Release_oid_set()
o initiator_time_rec INTEGER -- in seconds, or reserved value for
-- INDEFINITE
o acceptor_time_rec INTEGER -- in seconds, or reserved value for
-- INDEFINITE
Linn Standards Track [Page 37]
^L
RFC 2743 GSS-API January 2000
o cred_usage INTEGER, -- 0=INITIATE-AND-ACCEPT, 1=INITIATE-ONLY,
-- 2=ACCEPT-ONLY
o mech_set SET OF OBJECT IDENTIFIER -- full set of mechanisms
-- supported by resulting credential.
Return major_status codes:
o GSS_S_COMPLETE indicates that the credentials referenced by the
input_cred_handle argument were valid, and that the resulting
credential from GSS_Add_cred() is valid for the durations indicated
in initiator_time_rec and acceptor_time_rec, suitable for the usage
requested in cred_usage, and for the mechanisms indicated in
actual_mechs.
o GSS_S_DUPLICATE_ELEMENT indicates that the input desired_mech
specified a mechanism for which the referenced credential already
contained a credential element with overlapping cred_usage and
validity time specifiers.
o GSS_S_BAD_MECH indicates that the input desired_mech specified a
mechanism unsupported by the GSS-API implementation, causing the
GSS_Add_cred() operation to fail.
o GSS_S_BAD_NAMETYPE indicates that the provided desired_name is
uninterpretable or of a type unsupported by the applicable underlying
GSS-API mechanism(s), so the GSS_Add_cred() operation could not be
performed for that name.
o GSS_S_BAD_NAME indicates that the provided desired_name is
inconsistent in terms of internally-incorporated type specifier
information, so the GSS_Add_cred() operation could not be performed
for that name.
o GSS_S_NO_CRED indicates that the input_cred_handle referenced
invalid or inaccessible credentials. In particular, this status
should be returned upon temporary user-fixable conditions preventing
successful credential establishment or upon lack of authorization to
establish or use credentials representing the requested identity.
o GSS_S_CREDENTIALS_EXPIRED indicates that referenced credential
elements have expired, so the GSS_Add_cred() operation could not be
performed.
o GSS_S_FAILURE indicates that the operation failed for reasons
unspecified at the GSS-API level.
Linn Standards Track [Page 38]
^L
RFC 2743 GSS-API January 2000
GSS_Add_cred() enables callers to construct credentials iteratively
by adding credential elements in successive operations, corresponding
to different mechanisms. This offers particular value in multi-
mechanism environments, as the major_status and minor_status values
returned on each iteration are individually visible and can therefore
be interpreted unambiguously on a per-mechanism basis. A credential
element is identified by the name of the principal to which it
refers. GSS-API implementations must impose a local access control
policy on callers of this routine to prevent unauthorized callers
from acquiring credential elements to which they are not entitled.
This routine is not intended to provide a "login to the network"
function, as such a function would involve the creation of new
mechanism-specific authentication data, rather than merely acquiring
a GSS-API handle to existing data. Such functions, if required,
should be defined in implementation-specific extension routines.
If credential acquisition is time-consuming for a mechanism, the
mechanism may choose to delay the actual acquisition until the
credential is required (e.g. by GSS_Init_sec_context() or
GSS_Accept_sec_context()). Such mechanism-specific implementation
decisions should be invisible to the calling application; thus a call
of GSS_Inquire_cred() immediately following the call of
GSS_Acquire_cred() must return valid credential data, and may
therefore incur the overhead of a deferred credential acquisition.
If GSS_C_NO_CREDENTIAL is specified as input_cred_handle, a non-NULL
output_cred_handle must be supplied. For the case of
GSS_C_NO_CREDENTIAL as input_cred_handle, GSS_Add_cred() will create
the credential referenced by its output_cred_handle based on default
behavior. That is, the call will have the same effect as if the
caller had previously called GSS_Acquire_cred(), specifying the same
usage and passing GSS_C_NO_NAME as the desired_name parameter
(thereby obtaining an explicit credential handle corresponding to
default behavior), had passed that credential handle to
GSS_Add_cred(), and had finally called GSS_Release_cred() on the
credential handle received from GSS_Acquire_cred().
This routine is expected to be used primarily by context acceptors,
since implementations are likely to provide mechanism-specific ways
of obtaining GSS-API initiator credentials from the system login
process. Some implementations may therefore not support the
acquisition of GSS_C_INITIATE or GSS_C_BOTH credentials via
GSS_Acquire_cred() for any name other than GSS_C_NO_NAME, or a name
resulting from applying GSS_Inquire_context() to an active context,
or a name resulting from applying GSS_Inquire_cred() against a
credential handle corresponding to default behavior. It is important
to recognize that the explicit name which is yielded by resolving a
default reference may change over time, e.g., as a result of local
Linn Standards Track [Page 39]
^L
RFC 2743 GSS-API January 2000
credential element management operations outside GSS-API; once
resolved, however, the value of such an explicit name will remain
constant.
A caller may provide the value NULL (GSS_C_NO_NAME) for desired_name,
which will be interpreted as a request for a credential handle that
will invoke default behavior when passed to GSS_Init_sec_context(),
if cred_usage is GSS_C_INITIATE or GSS_C_BOTH, or
GSS_Accept_sec_context(), if cred_usage is GSS_C_ACCEPT or
GSS_C_BOTH.
The same input desired_name, or default reference, should be used on
all GSS_Acquire_cred() and GSS_Add_cred() calls corresponding to a
particular credential.
2.1.5: GSS_Inquire_cred_by_mech call
Inputs:
o cred_handle CREDENTIAL HANDLE -- if GSS_C_NO_CREDENTIAL
-- specified, default initiator credentials are queried
o mech_type OBJECT IDENTIFIER -- specific mechanism for
-- which credentials are being queried
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o cred_name INTERNAL NAME, -- guaranteed to be MN; caller must
-- release with GSS_Release_name()
o lifetime_rec_initiate INTEGER -- in seconds, or reserved value for
-- INDEFINITE
o lifetime_rec_accept INTEGER -- in seconds, or reserved value for
-- INDEFINITE
o cred_usage INTEGER, -- 0=INITIATE-AND-ACCEPT, 1=INITIATE-ONLY,
-- 2=ACCEPT-ONLY
Return major_status codes:
o GSS_S_COMPLETE indicates that the credentials referenced by the
input cred_handle argument were valid, that the mechanism indicated
by the input mech_type was represented with elements within those
Linn Standards Track [Page 40]
^L
RFC 2743 GSS-API January 2000
credentials, and that the output cred_name, lifetime_rec_initiate,
lifetime_rec_accept, and cred_usage values represent, respectively,
the credentials' associated principal name, remaining lifetimes, and
suitable usage modes.
o GSS_S_NO_CRED indicates that no information could be returned
about the referenced credentials, either because the input
cred_handle was invalid or because the caller lacks authorization to
access the referenced credentials.
o GSS_S_DEFECTIVE_CREDENTIAL indicates that the referenced
credentials are invalid.
o GSS_S_CREDENTIALS_EXPIRED indicates that the referenced
credentials have expired.
o GSS_S_BAD_MECH indicates that the referenced credentials do not
contain elements for the requested mechanism.
o GSS_S_FAILURE indicates that the operation failed for reasons
unspecified at the GSS-API level.
The GSS_Inquire_cred_by_mech() call enables callers in multi-
mechanism environments to acquire specific data about available
combinations of lifetimes, usage modes, and mechanisms within a
credential structure. The lifetime_rec_initiate result indicates the
available lifetime for context initiation purposes; the
lifetime_rec_accept result indicates the available lifetime for
context acceptance purposes.
2.2: Context-level calls
This group of calls is devoted to the establishment and management of
security contexts between peers. A context's initiator calls
GSS_Init_sec_context(), resulting in generation of a token which the
caller passes to the target. At the target, that token is passed to
GSS_Accept_sec_context(). Depending on the underlying mech_type and
specified options, additional token exchanges may be performed in the
course of context establishment; such exchanges are accommodated by
GSS_S_CONTINUE_NEEDED status returns from GSS_Init_sec_context() and
GSS_Accept_sec_context().
Either party to an established context may invoke
GSS_Delete_sec_context() to flush context information when a context
is no longer required. GSS_Process_context_token() is used to process
received tokens carrying context-level control information.
GSS_Context_time() allows a caller to determine the length of time
for which an established context will remain valid.
Linn Standards Track [Page 41]
^L
RFC 2743 GSS-API January 2000
GSS_Inquire_context() returns status information describing context
characteristics. GSS_Wrap_size_limit() allows a caller to determine
the size of a token which will be generated by a GSS_Wrap()
operation. GSS_Export_sec_context() and GSS_Import_sec_context()
enable transfer of active contexts between processes on an end
system.
2.2.1: GSS_Init_sec_context call
Inputs:
o claimant_cred_handle CREDENTIAL HANDLE, -- NULL specifies "use
-- default"
o input_context_handle CONTEXT HANDLE, -- 0
-- (GSS_C_NO_CONTEXT) specifies "none assigned yet"
o targ_name INTERNAL NAME,
o mech_type OBJECT IDENTIFIER, -- NULL parameter specifies "use
-- default"
o deleg_req_flag BOOLEAN,
o mutual_req_flag BOOLEAN,
o replay_det_req_flag BOOLEAN,
o sequence_req_flag BOOLEAN,
o anon_req_flag BOOLEAN,
o conf_req_flag BOOLEAN,
o integ_req_flag BOOLEAN,
o lifetime_req INTEGER, -- 0 specifies default lifetime
o chan_bindings OCTET STRING,
o input_token OCTET STRING -- NULL or token received from target
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
Linn Standards Track [Page 42]
^L
RFC 2743 GSS-API January 2000
o output_context_handle CONTEXT HANDLE, -- once returned non-NULL,
-- caller must release with GSS_Delete_sec_context()
o mech_type OBJECT IDENTIFIER, -- actual mechanism always
-- indicated, never NULL; caller should treat as read-only
-- and should not attempt to release
o output_token OCTET STRING, -- NULL or token to pass to context
-- target; caller must release with GSS_Release_buffer()
o deleg_state BOOLEAN,
o mutual_state BOOLEAN,
o replay_det_state BOOLEAN,
o sequence_state BOOLEAN,
o anon_state BOOLEAN,
o trans_state BOOLEAN,
o prot_ready_state BOOLEAN, -- see Section 1.2.7
o conf_avail BOOLEAN,
o integ_avail BOOLEAN,
o lifetime_rec INTEGER -- in seconds, or reserved value for
-- INDEFINITE
This call may block pending network interactions for those mech_types
in which an authentication server or other network entity must be
consulted on behalf of a context initiator in order to generate an
output_token suitable for presentation to a specified target.
Return major_status codes:
o GSS_S_COMPLETE indicates that context-level information was
successfully initialized, and that the returned output_token will
provide sufficient information for the target to perform per-message
processing on the newly-established context.
o GSS_S_CONTINUE_NEEDED indicates that control information in the
returned output_token must be sent to the target, and that a reply
must be received and passed as the input_token argument
Linn Standards Track [Page 43]
^L
RFC 2743 GSS-API January 2000
to a continuation call to GSS_Init_sec_context(), before per-message
processing can be performed in conjunction with this context (unless
the prot_ready_state value is concurrently returned TRUE).
o GSS_S_DEFECTIVE_TOKEN indicates that consistency checks performed
on the input_token failed, preventing further processing from being
performed based on that token.
o GSS_S_DEFECTIVE_CREDENTIAL indicates that consistency checks
performed on the credential structure referenced by
claimant_cred_handle failed, preventing further processing from being
performed using that credential structure.
o GSS_S_BAD_SIG (GSS_S_BAD_MIC) indicates that the received
input_token contains an incorrect integrity check, so context setup
cannot be accomplished.
o GSS_S_NO_CRED indicates that no context was established, either
because the input cred_handle was invalid, because the referenced
credentials are valid for context acceptor use only, because the
caller lacks authorization to access the referenced credentials, or
because the resolution of default credentials failed.
o GSS_S_CREDENTIALS_EXPIRED indicates that the credentials provided
through the input claimant_cred_handle argument are no longer valid,
so context establishment cannot be completed.
o GSS_S_BAD_BINDINGS indicates that a mismatch between the caller-
provided chan_bindings and those extracted from the input_token was
detected, signifying a security-relevant event and preventing context
establishment. (This result will be returned by
GSS_Init_sec_context() only for contexts where mutual_state is TRUE.)
o GSS_S_OLD_TOKEN indicates that the input_token is too old to be
checked for integrity. This is a fatal error during context
establishment.
o GSS_S_DUPLICATE_TOKEN indicates that the input token has a correct
integrity check, but is a duplicate of a token already processed.
This is a fatal error during context establishment.
o GSS_S_NO_CONTEXT indicates that no valid context was recognized
for the input context_handle provided; this major status will be
returned only for successor calls following GSS_S_CONTINUE_ NEEDED
status returns.
Linn Standards Track [Page 44]
^L
RFC 2743 GSS-API January 2000
o GSS_S_BAD_NAMETYPE indicates that the provided targ_name is of a
type uninterpretable or unsupported by the applicable underlying
GSS-API mechanism(s), so context establishment cannot be completed.
o GSS_S_BAD_NAME indicates that the provided targ_name is
inconsistent in terms of internally-incorporated type specifier
information, so context establishment cannot be accomplished.
o GSS_S_BAD_MECH indicates receipt of a context establishment token
or of a caller request specifying a mechanism unsupported by the
local system or with the caller's active credentials
o GSS_S_FAILURE indicates that context setup could not be
accomplished for reasons unspecified at the GSS-API level, and that
no interface-defined recovery action is available.
This routine is used by a context initiator, and ordinarily emits an
output_token suitable for use by the target within the selected
mech_type's protocol. For the case of a multi-step exchange, this
output_token will be one in a series, each generated by a successive
call. Using information in the credentials structure referenced by
claimant_cred_handle, GSS_Init_sec_context() initializes the data
structures required to establish a security context with target
targ_name.
The targ_name may be any valid INTERNAL NAME; it need not be an MN.
In addition to support for other name types, it is recommended (newly
as of GSS-V2, Update 1) that mechanisms be able to accept
GSS_C_NO_NAME as an input type for targ_name. While recommended,
such support is not required, and it is recognized that not all
mechanisms can construct tokens without explicitly naming the context
target, even when mutual authentication of the target is not
obtained. Callers wishing to make use of this facility and concerned
with portability should be aware that support for GSS_C_NO_NAME as
input targ_name type is unlikely to be provided within mechanism
definitions specified prior to GSS-V2, Update 1.
The claimant_cred_handle must correspond to the same valid
credentials structure on the initial call to GSS_Init_sec_context()
and on any successor calls resulting from GSS_S_CONTINUE_NEEDED
status returns; different protocol sequences modeled by the
GSS_S_CONTINUE_NEEDED facility will require access to credentials at
different points in the context establishment sequence.
The caller-provided input_context_handle argument is to be 0
(GSS_C_NO_CONTEXT), specifying "not yet assigned", on the first
GSS_Init_sec_context() call relating to a given context. If
successful (i.e., if accompanied by major_status GSS_S_COMPLETE or
Linn Standards Track [Page 45]
^L
RFC 2743 GSS-API January 2000
GSS_S_CONTINUE_NEEDED), and only if successful, the initial
GSS_Init_sec_context() call returns a non-zero output_context_handle
for use in future references to this context. Once a non-zero
output_context_handle has been returned, GSS-API callers should call
GSS_Delete_sec_context() to release context-related resources if
errors occur in later phases of context establishment, or when an
established context is no longer required. If GSS_Init_sec_context()
is passed the handle of a context which is already fully established,
GSS_S_FAILURE status is returned.
When continuation attempts to GSS_Init_sec_context() are needed to
perform context establishment, the previously-returned non-zero
handle value is entered into the input_context_handle argument and
will be echoed in the returned output_context_handle argument. On
such continuation attempts (and only on continuation attempts) the
input_token value is used, to provide the token returned from the
context's target.
The chan_bindings argument is used by the caller to provide
information binding the security context to security-related
characteristics (e.g., addresses, cryptographic keys) of the
underlying communications channel. See Section 1.1.6 of this document
for more discussion of this argument's usage.
The input_token argument contains a message received from the target,
and is significant only on a call to GSS_Init_sec_context() which
follows a previous return indicating GSS_S_CONTINUE_NEEDED
major_status.
It is the caller's responsibility to establish a communications path
to the target, and to transmit any returned output_token (independent
of the accompanying returned major_status value) to the target over
that path. The output_token can, however, be transmitted along with
the first application-provided input message to be processed by
GSS_GetMIC() or GSS_Wrap() in conjunction with a successfully-
established context. (Note: when the GSS-V2 prot_ready_state
indicator is returned TRUE, it can be possible to transfer a
protected message before context establishment is complete: see also
Section 1.2.7)
The initiator may request various context-level functions through
input flags: the deleg_req_flag requests delegation of access rights,
the mutual_req_flag requests mutual authentication, the
replay_det_req_flag requests that replay detection features be
applied to messages transferred on the established context, and the
sequence_req_flag requests that sequencing be enforced. (See Section
Linn Standards Track [Page 46]
^L
RFC 2743 GSS-API January 2000
1.2.3 for more information on replay detection and sequencing
features.) The anon_req_flag requests that the initiator's identity
not be transferred within tokens to be sent to the acceptor.
The conf_req_flag and integ_req_flag provide informatory inputs to
the GSS-API implementation as to whether, respectively, per-message
confidentiality and per-message integrity services will be required
on the context. This information is important as an input to
negotiating mechanisms. It is important to recognize, however, that
the inclusion of these flags (which are newly defined for GSS-V2)
introduces a backward incompatibility with callers implemented to
GSS-V1, where the flags were not defined. Since no GSS-V1 callers
would set these flags, even if per-message services are desired,
GSS-V2 mechanism implementations which enable such services
selectively based on the flags' values may fail to provide them to
contexts established for GSS-V1 callers. It may be appropriate under
certain circumstances, therefore, for such mechanism implementations
to infer these service request flags to be set if a caller is known
to be implemented to GSS-V1.
Not all of the optionally-requestable features will be available in
all underlying mech_types. The corresponding return state values
deleg_state, mutual_state, replay_det_state, and sequence_state
indicate, as a function of mech_type processing capabilities and
initiator-provided input flags, the set of features which will be
active on the context. The returned trans_state value indicates
whether the context is transferable to other processes through use of
GSS_Export_sec_context(). These state indicators' values are
undefined unless either the routine's major_status indicates
GSS_S_COMPLETE, or TRUE prot_ready_state is returned along with
GSS_S_CONTINUE_NEEDED major_status; for the latter case, it is
possible that additional features, not confirmed or indicated along
with TRUE prot_ready_state, will be confirmed and indicated when
GSS_S_COMPLETE is subsequently returned.
The returned anon_state and prot_ready_state values are significant
for both GSS_S_COMPLETE and GSS_S_CONTINUE_NEEDED major_status
returns from GSS_Init_sec_context(). When anon_state is returned
TRUE, this indicates that neither the current token nor its
predecessors delivers or has delivered the initiator's identity.
Callers wishing to perform context establishment only if anonymity
support is provided should transfer a returned token from
GSS_Init_sec_context() to the peer only if it is accompanied by a
TRUE anon_state indicator. When prot_ready_state is returned TRUE in
conjunction with GSS_S_CONTINUE_NEEDED major_status, this indicates
that per-message protection operations may be applied on the context:
see Section 1.2.7 for further discussion of this facility.
Linn Standards Track [Page 47]
^L
RFC 2743 GSS-API January 2000
Failure to provide the precise set of features requested by the
caller does not cause context establishment to fail; it is the
caller's prerogative to delete the context if the feature set
provided is unsuitable for the caller's use.
The returned mech_type value indicates the specific mechanism
employed on the context; it will never indicate the value for
"default". A valid mech_type result must be returned along with a
GSS_S_COMPLETE status return; GSS-API implementations may (but are
not required to) also return mech_type along with predecessor calls
indicating GSS_S_CONTINUE_NEEDED status or (if a mechanism is
determinable) in conjunction with fatal error cases. For the case of
mechanisms which themselves perform negotiation, the returned
mech_type result may indicate selection of a mechanism identified by
an OID different than that passed in the input mech_type argument,
and the returned value may change between successive calls returning
GSS_S_CONTINUE_NEEDED and the final call returning GSS_S_COMPLETE.
The conf_avail return value indicates whether the context supports
per-message confidentiality services, and so informs the caller
whether or not a request for encryption through the conf_req_flag
input to GSS_Wrap() can be honored. In similar fashion, the
integ_avail return value indicates whether per-message integrity
services are available (through either GSS_GetMIC() or GSS_Wrap()) on
the established context. These state indicators' values are undefined
unless either the routine's major_status indicates GSS_S_COMPLETE, or
TRUE prot_ready_state is returned along with GSS_S_CONTINUE_NEEDED
major_status.
The lifetime_req input specifies a desired upper bound for the
lifetime of the context to be established, with a value of 0 used to
request a default lifetime. The lifetime_rec return value indicates
the length of time for which the context will be valid, expressed as
an offset from the present; depending on mechanism capabilities,
credential lifetimes, and local policy, it may not correspond to the
value requested in lifetime_req. If no constraints on context
lifetime are imposed, this may be indicated by returning a reserved
value representing INDEFINITE lifetime_req. The value of lifetime_rec
is undefined unless the routine's major_status indicates
GSS_S_COMPLETE.
If the mutual_state is TRUE, this fact will be reflected within the
output_token. A call to GSS_Accept_sec_context() at the target in
conjunction with such a context will return a token, to be processed
by a continuation call to GSS_Init_sec_context(), in order to achieve
mutual authentication.
Linn Standards Track [Page 48]
^L
RFC 2743 GSS-API January 2000
2.2.2: GSS_Accept_sec_context call
Inputs:
o acceptor_cred_handle CREDENTIAL HANDLE, -- NULL specifies
-- "use default"
o input_context_handle CONTEXT HANDLE, -- 0
-- (GSS_C_NO_CONTEXT) specifies "not yet assigned"
o chan_bindings OCTET STRING,
o input_token OCTET STRING
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o src_name INTERNAL NAME, -- guaranteed to be MN
-- once returned, caller must release with GSS_Release_name()
o mech_type OBJECT IDENTIFIER, -- caller should treat as
-- read-only; does not need to be released
o output_context_handle CONTEXT HANDLE, -- once returned
-- non-NULL in context establishment sequence, caller
-- must release with GSS_Delete_sec_context()
o deleg_state BOOLEAN,
o mutual_state BOOLEAN,
o replay_det_state BOOLEAN,
o sequence_state BOOLEAN,
o anon_state BOOLEAN,
o trans_state BOOLEAN,
o prot_ready_state BOOLEAN, -- see Section 1.2.7 for discussion
o conf_avail BOOLEAN,
o integ_avail BOOLEAN,
Linn Standards Track [Page 49]
^L
RFC 2743 GSS-API January 2000
o lifetime_rec INTEGER, -- in seconds, or reserved value for
-- INDEFINITE
o delegated_cred_handle CREDENTIAL HANDLE, -- if returned non-NULL,
-- caller must release with GSS_Release_cred()
o output_token OCTET STRING -- NULL or token to pass to context
-- initiator; if returned non-NULL, caller must release with
-- GSS_Release_buffer()
This call may block pending network interactions for those mech_types
in which a directory service or other network entity must be
consulted on behalf of a context acceptor in order to validate a
received input_token.
Return major_status codes:
o GSS_S_COMPLETE indicates that context-level data structures were
successfully initialized, and that per-message processing can now be
performed in conjunction with this context.
o GSS_S_CONTINUE_NEEDED indicates that control information in the
returned output_token must be sent to the initiator, and that a
response must be received and passed as the input_token argument to a
continuation call to GSS_Accept_sec_context(), before per-message
processing can be performed in conjunction with this context.
o GSS_S_DEFECTIVE_TOKEN indicates that consistency checks performed
on the input_token failed, preventing further processing from being
performed based on that token.
o GSS_S_DEFECTIVE_CREDENTIAL indicates that consistency checks
performed on the credential structure referenced by
acceptor_cred_handle failed, preventing further processing from being
performed using that credential structure.
o GSS_S_BAD_SIG (GSS_S_BAD_MIC) indicates that the received
input_token contains an incorrect integrity check, so context setup
cannot be accomplished.
o GSS_S_DUPLICATE_TOKEN indicates that the integrity check on the
received input_token was correct, but that the input_token was
recognized as a duplicate of an input_token already processed. No new
context is established.
Linn Standards Track [Page 50]
^L
RFC 2743 GSS-API January 2000
o GSS_S_OLD_TOKEN indicates that the integrity check on the received
input_token was correct, but that the input_token is too old to be
checked for duplication against previously-processed input_tokens. No
new context is established.
o GSS_S_NO_CRED indicates that no context was established, either
because the input cred_handle was invalid, because the referenced
credentials are valid for context initiator use only, because the
caller lacks authorization to access the referenced credentials, or
because the procedure for default credential resolution failed.
o GSS_S_CREDENTIALS_EXPIRED indicates that the credentials provided
through the input acceptor_cred_handle argument are no longer valid,
so context establishment cannot be completed.
o GSS_S_BAD_BINDINGS indicates that a mismatch between the caller-
provided chan_bindings and those extracted from the input_token was
detected, signifying a security-relevant event and preventing context
establishment.
o GSS_S_NO_CONTEXT indicates that no valid context was recognized
for the input context_handle provided; this major status will be
returned only for successor calls following GSS_S_CONTINUE_ NEEDED
status returns.
o GSS_S_BAD_MECH indicates receipt of a context establishment token
specifying a mechanism unsupported by the local system or with the
caller's active credentials.
o GSS_S_FAILURE indicates that context setup could not be
accomplished for reasons unspecified at the GSS-API level, and that
no interface-defined recovery action is available.
The GSS_Accept_sec_context() routine is used by a context target.
Using information in the credentials structure referenced by the
input acceptor_cred_handle, it verifies the incoming input_token and
(following the successful completion of a context establishment
sequence) returns the authenticated src_name and the mech_type used.
The returned src_name is guaranteed to be an MN, processed by the
mechanism under which the context was established. The
acceptor_cred_handle must correspond to the same valid credentials
structure on the initial call to GSS_Accept_sec_context() and on any
successor calls resulting from GSS_S_CONTINUE_NEEDED status returns;
different protocol sequences modeled by the GSS_S_CONTINUE_NEEDED
mechanism will require access to credentials at different points in
the context establishment sequence.
Linn Standards Track [Page 51]
^L
RFC 2743 GSS-API January 2000
The caller-provided input_context_handle argument is to be 0
(GSS_C_NO_CONTEXT), specifying "not yet assigned", on the first
GSS_Accept_sec_context() call relating to a given context. If
successful (i.e., if accompanied by major_status GSS_S_COMPLETE or
GSS_S_CONTINUE_NEEDED), and only if successful, the initial
GSS_Accept_sec_context() call returns a non-zero
output_context_handle for use in future references to this context.
Once a non-zero output_context_handle has been returned, GSS-API
callers should call GSS_Delete_sec_context() to release context-
related resources if errors occur in later phases of context
establishment, or when an established context is no longer required.
If GSS_Accept_sec_context() is passed the handle of a context which
is already fully established, GSS_S_FAILURE status is returned.
The chan_bindings argument is used by the caller to provide
information binding the security context to security-related
characteristics (e.g., addresses, cryptographic keys) of the
underlying communications channel. See Section 1.1.6 of this document
for more discussion of this argument's usage.
The returned state results (deleg_state, mutual_state,
replay_det_state, sequence_state, anon_state, trans_state, and
prot_ready_state) reflect the same information as described for
GSS_Init_sec_context(), and their values are significant under the
same return state conditions.
The conf_avail return value indicates whether the context supports
per-message confidentiality services, and so informs the caller
whether or not a request for encryption through the conf_req_flag
input to GSS_Wrap() can be honored. In similar fashion, the
integ_avail return value indicates whether per-message integrity
services are available (through either GSS_GetMIC() or GSS_Wrap())
on the established context. These values are significant under the
same return state conditions as described under
GSS_Init_sec_context().
The lifetime_rec return value is significant only in conjunction with
GSS_S_COMPLETE major_status, and indicates the length of time for
which the context will be valid, expressed as an offset from the
present.
The returned mech_type value indicates the specific mechanism
employed on the context; it will never indicate the value for
"default". A valid mech_type result must be returned whenever
GSS_S_COMPLETE status is indicated; GSS-API implementations may (but
are not required to) also return mech_type along with predecessor
calls indicating GSS_S_CONTINUE_NEEDED status or (if a mechanism is
determinable) in conjunction with fatal error cases. For the case of
Linn Standards Track [Page 52]
^L
RFC 2743 GSS-API January 2000
mechanisms which themselves perform negotiation, the returned
mech_type result may indicate selection of a mechanism identified by
an OID different than that passed in the input mech_type argument,
and the returned value may change between successive calls returning
GSS_S_CONTINUE_NEEDED and the final call returning GSS_S_COMPLETE.
The delegated_cred_handle result is significant only when deleg_state
is TRUE, and provides a means for the target to reference the
delegated credentials. The output_token result, when non-NULL,
provides a context-level token to be returned to the context
initiator to continue a multi-step context establishment sequence. As
noted with GSS_Init_sec_context(), any returned token should be
transferred to the context's peer (in this case, the context
initiator), independent of the value of the accompanying returned
major_status.
Note: A target must be able to distinguish a context-level
input_token, which is passed to GSS_Accept_sec_context(), from the
per-message data elements passed to GSS_VerifyMIC() or GSS_Unwrap().
These data elements may arrive in a single application message, and
GSS_Accept_sec_context() must be performed before per-message
processing can be performed successfully.
2.2.3: GSS_Delete_sec_context call
Input:
o context_handle CONTEXT HANDLE
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o output_context_token OCTET STRING
Return major_status codes:
o GSS_S_COMPLETE indicates that the context was recognized, and that
relevant context-specific information was flushed. If the caller
provides a non-null buffer to receive an output_context_token, and
the mechanism returns a non-NULL token into that buffer, the returned
output_context_token is ready for transfer to the context's peer.
o GSS_S_NO_CONTEXT indicates that no valid context was recognized
for the input context_handle provided, so no deletion was performed.
Linn Standards Track [Page 53]
^L
RFC 2743 GSS-API January 2000
o GSS_S_FAILURE indicates that the context is recognized, but that
the GSS_Delete_sec_context() operation could not be performed for
reasons unspecified at the GSS-API level.
This call can be made by either peer in a security context, to flush
context-specific information. Once a non-zero output_context_handle
has been returned by context establishment calls, GSS-API callers
should call GSS_Delete_sec_context() to release context-related
resources if errors occur in later phases of context establishment,
or when an established context is no longer required. This call may
block pending network interactions for mech_types in which active
notification must be made to a central server when a security context
is to be deleted.
If a non-null output_context_token parameter is provided by the
caller, an output_context_token may be returned to the caller. If an
output_context_token is provided to the caller, it can be passed to
the context's peer to inform the peer's GSS-API implementation that
the peer's corresponding context information can also be flushed.
(Once a context is established, the peers involved are expected to
retain cached credential and context-related information until the
information's expiration time is reached or until a
GSS_Delete_sec_context() call is made.)
The facility for context_token usage to signal context deletion is
retained for compatibility with GSS-API Version 1. For current
usage, it is recommended that both peers to a context invoke
GSS_Delete_sec_context() independently, passing a null
output_context_token buffer to indicate that no context_token is
required. Implementations of GSS_Delete_sec_context() should delete
relevant locally-stored context information.
Attempts to perform per-message processing on a deleted context will
result in error returns.
2.2.4: GSS_Process_context_token call
Inputs:
o context_handle CONTEXT HANDLE,
o input_context_token OCTET STRING
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
Linn Standards Track [Page 54]
^L
RFC 2743 GSS-API January 2000
Return major_status codes:
o GSS_S_COMPLETE indicates that the input_context_token was
successfully processed in conjunction with the context referenced by
context_handle.
o GSS_S_DEFECTIVE_TOKEN indicates that consistency checks performed
on the received context_token failed, preventing further processing
from being performed with that token.
o GSS_S_NO_CONTEXT indicates that no valid context was recognized
for the input context_handle provided.
o GSS_S_FAILURE indicates that the context is recognized, but that
the GSS_Process_context_token() operation could not be performed for
reasons unspecified at the GSS-API level.
This call is used to process context_tokens received from a peer once
a context has been established, with corresponding impact on
context-level state information. One use for this facility is
processing of the context_tokens generated by
GSS_Delete_sec_context(); GSS_Process_context_token() will not block
pending network interactions for that purpose. Another use is to
process tokens indicating remote-peer context establishment failures
after the point where the local GSS-API implementation has already
indicated GSS_S_COMPLETE status.
2.2.5: GSS_Context_time call
Input:
o context_handle CONTEXT HANDLE,
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o lifetime_rec INTEGER -- in seconds, or reserved value for
-- INDEFINITE
Return major_status codes:
o GSS_S_COMPLETE indicates that the referenced context is valid, and
will remain valid for the amount of time indicated in lifetime_rec.
Linn Standards Track [Page 55]
^L
RFC 2743 GSS-API January 2000
o GSS_S_CONTEXT_EXPIRED indicates that data items related to the
referenced context have expired.
o GSS_S_NO_CONTEXT indicates that no valid context was recognized
for the input context_handle provided.
o GSS_S_FAILURE indicates that the requested operation failed for
reasons unspecified at the GSS-API level.
This call is used to determine the amount of time for which a
currently established context will remain valid.
2.2.6: GSS_Inquire_context call
Input:
o context_handle CONTEXT HANDLE,
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o src_name INTERNAL NAME, -- name of context initiator,
-- guaranteed to be MN;
-- caller must release with GSS_Release_name() if returned
o targ_name INTERNAL NAME, -- name of context target,
-- guaranteed to be MN;
-- caller must release with GSS_Release_name() if returned
o lifetime_rec INTEGER -- in seconds, or reserved value for
-- INDEFINITE or EXPIRED
o mech_type OBJECT IDENTIFIER, -- the mechanism supporting this
-- security context; caller should treat as read-only and not
-- attempt to release
o deleg_state BOOLEAN,
o mutual_state BOOLEAN,
o replay_det_state BOOLEAN,
o sequence_state BOOLEAN,
o anon_state BOOLEAN,
Linn Standards Track [Page 56]
^L
RFC 2743 GSS-API January 2000
o trans_state BOOLEAN,
o prot_ready_state BOOLEAN,
o conf_avail BOOLEAN,
o integ_avail BOOLEAN,
o locally_initiated BOOLEAN, -- TRUE if initiator, FALSE if acceptor
o open BOOLEAN, -- TRUE if context fully established, FALSE
-- if partly established (in CONTINUE_NEEDED state)
Return major_status codes:
o GSS_S_COMPLETE indicates that the referenced context is valid and
that deleg_state, mutual_state, replay_det_state, sequence_state,
anon_state, trans_state, prot_ready_state, conf_avail, integ_avail,
locally_initiated, and open return values describe the corresponding
characteristics of the context. If open is TRUE, lifetime_rec is
also returned: if open is TRUE and the context peer's name is known,
src_name and targ_name are valid in addition to the values listed
above. The mech_type value must be returned for contexts where open
is TRUE and may be returned for contexts where open is FALSE.
o GSS_S_NO_CONTEXT indicates that no valid context was recognized
for the input context_handle provided. Return values other than
major_status and minor_status are undefined.
o GSS_S_FAILURE indicates that the requested operation failed for
reasons unspecified at the GSS-API level. Return values other than
major_status and minor_status are undefined.
This call is used to extract information describing characteristics
of a security context. Note that GSS-API implementations are
expected to retain inquirable context data on a context until the
context is released by a caller, even after the context has expired,
although underlying cryptographic data elements may be deleted after
expiration in order to limit their exposure.
2.2.7: GSS_Wrap_size_limit call
Inputs:
o context_handle CONTEXT HANDLE,
o conf_req_flag BOOLEAN,
Linn Standards Track [Page 57]
^L
RFC 2743 GSS-API January 2000
o qop INTEGER,
o output_size INTEGER
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o max_input_size INTEGER
Return major_status codes:
o GSS_S_COMPLETE indicates a successful token size determination:
an input message with a length in octets equal to the returned
max_input_size value will, when passed to GSS_Wrap() for processing
on the context identified by the context_handle parameter with the
confidentiality request state as provided in conf_req_flag and with
the quality of protection specifier provided in the qop parameter,
yield an output token no larger than the value of the provided
output_size parameter.
o GSS_S_CONTEXT_EXPIRED indicates that the provided input
context_handle is recognized, but that the referenced context has
expired. Return values other than major_status and minor_status are
undefined.
o GSS_S_NO_CONTEXT indicates that no valid context was recognized
for the input context_handle provided. Return values other than
major_status and minor_status are undefined.
o GSS_S_BAD_QOP indicates that the provided QOP value is not
recognized or supported for the context.
o GSS_S_FAILURE indicates that the requested operation failed for
reasons unspecified at the GSS-API level. Return values other than
major_status and minor_status are undefined.
This call is used to determine the largest input datum which may be
passed to GSS_Wrap() without yielding an output token larger than a
caller-specified value.
Linn Standards Track [Page 58]
^L
RFC 2743 GSS-API January 2000
2.2.8: GSS_Export_sec_context call
Inputs:
o context_handle CONTEXT HANDLE
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o interprocess_token OCTET STRING -- caller must release
-- with GSS_Release_buffer()
Return major_status codes:
o GSS_S_COMPLETE indicates that the referenced context has been
successfully exported to a representation in the interprocess_token,
and is no longer available for use by the caller.
o GSS_S_UNAVAILABLE indicates that the context export facility is
not available for use on the referenced context. (This status should
occur only for contexts for which the trans_state value is FALSE.)
Return values other than major_status and minor_status are undefined.
o GSS_S_CONTEXT_EXPIRED indicates that the provided input
context_handle is recognized, but that the referenced context has
expired. Return values other than major_status and minor_status are
undefined.
o GSS_S_NO_CONTEXT indicates that no valid context was recognized
for the input context_handle provided. Return values other than
major_status and minor_status are undefined.
o GSS_S_FAILURE indicates that the requested operation failed for
reasons unspecified at the GSS-API level. Return values other than
major_status and minor_status are undefined.
This call generates an interprocess token for transfer to another
process within an end system, in order to transfer control of a
security context to that process. The recipient of the interprocess
token will call GSS_Import_sec_context() to accept the transfer. The
GSS_Export_sec_context() operation is defined for use only with
security contexts which are fully and successfully established (i.e.,
those for which GSS_Init_sec_context() and GSS_Accept_sec_context()
have returned GSS_S_COMPLETE major_status).
Linn Standards Track [Page 59]
^L
RFC 2743 GSS-API January 2000
A successful GSS_Export_sec_context() operation deactivates the
security context for the calling process; for this case, the GSS-API
implementation shall deallocate all process-wide resources associated
with the security context and shall set the context_handle to
GSS_C_NO_CONTEXT. In the event of an error that makes it impossible
to complete export of the security context, the GSS-API
implementation must not return an interprocess token and should
strive to leave the security context referenced by the context_handle
untouched. If this is impossible, it is permissible for the
implementation to delete the security context, provided that it also
sets the context_handle parameter to GSS_C_NO_CONTEXT.
Portable callers must not assume that a given interprocess token can
be imported by GSS_Import_sec_context() more than once, thereby
creating multiple instantiations of a single context. GSS-API
implementations may detect and reject attempted multiple imports, but
are not required to do so.
The internal representation contained within the interprocess token
is an implementation-defined local matter. Interprocess tokens
cannot be assumed to be transferable across different GSS-API
implementations.
It is recommended that GSS-API implementations adopt policies suited
to their operational environments in order to define the set of
processes eligible to import a context, but specific constraints in
this area are local matters. Candidate examples include transfers
between processes operating on behalf of the same user identity, or
processes comprising a common job. However, it may be impossible to
enforce such policies in some implementations.
In support of the above goals, implementations may protect the
transferred context data by using cryptography to protect data within
the interprocess token, or by using interprocess tokens as a means to
reference local interprocess communication facilities (protected by
other means) rather than storing the context data directly within the
tokens.
Transfer of an open context may, for certain mechanisms and
implementations, reveal data about the credential which was used to
establish the context. Callers should, therefore, be cautious about
the trustworthiness of processes to which they transfer contexts.
Although the GSS-API implementation may provide its own set of
protections over the exported context, the caller is responsible for
protecting the interprocess token from disclosure, and for taking
care that the context is transferred to an appropriate destination
process.
Linn Standards Track [Page 60]
^L
RFC 2743 GSS-API January 2000
2.2.9: GSS_Import_sec_context call
Inputs:
o interprocess_token OCTET STRING
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o context_handle CONTEXT HANDLE -- if successfully returned,
-- caller must release with GSS_Delete_sec_context()
Return major_status codes:
o GSS_S_COMPLETE indicates that the context represented by the input
interprocess_token has been successfully transferred to the caller,
and is available for future use via the output context_handle.
o GSS_S_NO_CONTEXT indicates that the context represented by the
input interprocess_token was invalid. Return values other than
major_status and minor_status are undefined.
o GSS_S_DEFECTIVE_TOKEN indicates that the input interprocess_token
was defective. Return values other than major_status and
minor_status are undefined.
o GSS_S_UNAVAILABLE indicates that the context import facility is
not available for use on the referenced context. Return values other
than major_status and minor_status are undefined.
o GSS_S_UNAUTHORIZED indicates that the context represented by the
input interprocess_token is unauthorized for transfer to the caller.
Return values other than major_status and minor_status are undefined.
o GSS_S_FAILURE indicates that the requested operation failed for
reasons unspecified at the GSS-API level. Return values other than
major_status and minor_status are undefined.
This call processes an interprocess token generated by
GSS_Export_sec_context(), making the transferred context available
for use by the caller. After a successful GSS_Import_sec_context()
operation, the imported context is available for use by the importing
process. In particular, the imported context is usable for all per-
message operations and may be deleted or exported by its importer.
The inability to receive delegated credentials through
Linn Standards Track [Page 61]
^L
RFC 2743 GSS-API January 2000
gss_import_sec_context() precludes establishment of new contexts
based on information delegated to the importer's end system within
the context which is being imported, unless those delegated
credentials are obtained through separate routines (e.g., XGSS-API
calls) outside the GSS-V2 definition.
For further discussion of the security and authorization issues
regarding this call, please see the discussion in Section 2.2.8.
2.3: Per-message calls
This group of calls is used to perform per-message protection
processing on an established security context. None of these calls
block pending network interactions. These calls may be invoked by a
context's initiator or by the context's target. The four members of
this group should be considered as two pairs; the output from
GSS_GetMIC() is properly input to GSS_VerifyMIC(), and the output
from GSS_Wrap() is properly input to GSS_Unwrap().
GSS_GetMIC() and GSS_VerifyMIC() support data origin authentication
and data integrity services. When GSS_GetMIC() is invoked on an input
message, it yields a per-message token containing data items which
allow underlying mechanisms to provide the specified security
services. The original message, along with the generated per-message
token, is passed to the remote peer; these two data elements are
processed by GSS_VerifyMIC(), which validates the message in
conjunction with the separate token.
GSS_Wrap() and GSS_Unwrap() support caller-requested confidentiality
in addition to the data origin authentication and data integrity
services offered by GSS_GetMIC() and GSS_VerifyMIC(). GSS_Wrap()
outputs a single data element, encapsulating optionally enciphered
user data as well as associated token data items. The data element
output from GSS_Wrap() is passed to the remote peer and processed by
GSS_Unwrap() at that system. GSS_Unwrap() combines decipherment (as
required) with validation of data items related to authentication and
integrity.
Although zero-length tokens are never returned by GSS calls for
transfer to a context's peer, a zero-length object may be passed by a
caller into GSS_Wrap(), in which case the corresponding peer calling
GSS_Unwrap() on the transferred token will receive a zero-length
object as output from GSS_Unwrap(). Similarly, GSS_GetMIC() can be
called on an empty object, yielding a MIC which GSS_VerifyMIC() will
successfully verify against the active security context in
conjunction with a zero-length object.
Linn Standards Track [Page 62]
^L
RFC 2743 GSS-API January 2000
2.3.1: GSS_GetMIC call
Note: This call is functionally equivalent to the GSS_Sign call as
defined in previous versions of this specification. In the interests
of backward compatibility, it is recommended that implementations
support this function under both names for the present; future
references to this function as GSS_Sign are deprecated.
Inputs:
o context_handle CONTEXT HANDLE,
o qop_req INTEGER, -- 0 specifies default QOP
o message OCTET STRING
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o per_msg_token OCTET STRING -- caller must release
-- with GSS_Release_buffer()
Return major_status codes:
o GSS_S_COMPLETE indicates that an integrity check, suitable for an
established security context, was successfully applied and that the
message and corresponding per_msg_token are ready for transmission.
o GSS_S_CONTEXT_EXPIRED indicates that context-related data items
have expired, so that the requested operation cannot be performed.
o GSS_S_NO_CONTEXT indicates that no context was recognized for the
input context_handle provided.
o GSS_S_BAD_QOP indicates that the provided QOP value is not
recognized or supported for the context.
o GSS_S_FAILURE indicates that the context is recognized, but that
the requested operation could not be performed for reasons
unspecified at the GSS-API level.
Using the security context referenced by context_handle, apply an
integrity check to the input message (along with timestamps and/or
other data included in support of mech_type-specific mechanisms) and
(if GSS_S_COMPLETE status is indicated) return the result in
Linn Standards Track [Page 63]
^L
RFC 2743 GSS-API January 2000
per_msg_token. The qop_req parameter, interpretation of which is
discussed in Section 1.2.4, allows quality-of-protection control. The
caller passes the message and the per_msg_token to the target.
The GSS_GetMIC() function completes before the message and
per_msg_token is sent to the peer; successful application of
GSS_GetMIC() does not guarantee that a corresponding GSS_VerifyMIC()
has been (or can necessarily be) performed successfully when the
message arrives at the destination.
Mechanisms which do not support per-message protection services
should return GSS_S_FAILURE if this routine is called.
2.3.2: GSS_VerifyMIC call
Note: This call is functionally equivalent to the GSS_Verify call as
defined in previous versions of this specification. In the interests
of backward compatibility, it is recommended that implementations
support this function under both names for the present; future
references to this function as GSS_Verify are deprecated.
Inputs:
o context_handle CONTEXT HANDLE,
o message OCTET STRING,
o per_msg_token OCTET STRING
Outputs:
o qop_state INTEGER,
o major_status INTEGER,
o minor_status INTEGER,
Return major_status codes:
o GSS_S_COMPLETE indicates that the message was successfully
verified.
o GSS_S_DEFECTIVE_TOKEN indicates that consistency checks performed
on the received per_msg_token failed, preventing further processing
from being performed with that token.
o GSS_S_BAD_SIG (GSS_S_BAD_MIC) indicates that the received
per_msg_token contains an incorrect integrity check for the message.
Linn Standards Track [Page 64]
^L
RFC 2743 GSS-API January 2000
o GSS_S_DUPLICATE_TOKEN, GSS_S_OLD_TOKEN, GSS_S_UNSEQ_TOKEN, and
GSS_S_GAP_TOKEN values appear in conjunction with the optional per-
message replay detection features described in Section 1.2.3; their
semantics are described in that section.
o GSS_S_CONTEXT_EXPIRED indicates that context-related data items
have expired, so that the requested operation cannot be performed.
o GSS_S_NO_CONTEXT indicates that no context was recognized for the
input context_handle provided.
o GSS_S_FAILURE indicates that the context is recognized, but that
the GSS_VerifyMIC() operation could not be performed for reasons
unspecified at the GSS-API level.
Using the security context referenced by context_handle, verify that
the input per_msg_token contains an appropriate integrity check for
the input message, and apply any active replay detection or
sequencing features. Returns an indication of the quality-of-
protection applied to the processed message in the qop_state result.
Mechanisms which do not support per-message protection services
should return GSS_S_FAILURE if this routine is called.
2.3.3: GSS_Wrap call
Note: This call is functionally equivalent to the GSS_Seal call as
defined in previous versions of this specification. In the interests
of backward compatibility, it is recommended that implementations
support this function under both names for the present; future
references to this function as GSS_Seal are deprecated.
Inputs:
o context_handle CONTEXT HANDLE,
o conf_req_flag BOOLEAN,
o qop_req INTEGER, -- 0 specifies default QOP
o input_message OCTET STRING
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
Linn Standards Track [Page 65]
^L
RFC 2743 GSS-API January 2000
o conf_state BOOLEAN,
o output_message OCTET STRING -- caller must release with
-- GSS_Release_buffer()
Return major_status codes:
o GSS_S_COMPLETE indicates that the input_message was successfully
processed and that the output_message is ready for transmission.
o GSS_S_CONTEXT_EXPIRED indicates that context-related data items
have expired, so that the requested operation cannot be performed.
o GSS_S_NO_CONTEXT indicates that no context was recognized for the
input context_handle provided.
o GSS_S_BAD_QOP indicates that the provided QOP value is not
recognized or supported for the context.
o GSS_S_FAILURE indicates that the context is recognized, but that
the GSS_Wrap() operation could not be performed for reasons
unspecified at the GSS-API level.
Performs the data origin authentication and data integrity functions
of GSS_GetMIC(). If the input conf_req_flag is TRUE, requests that
confidentiality be applied to the input_message. Confidentiality may
not be supported in all mech_types or by all implementations; the
returned conf_state flag indicates whether confidentiality was
provided for the input_message. The qop_req parameter, interpretation
of which is discussed in Section 1.2.4, allows quality-of-protection
control.
When GSS_S_COMPLETE status is returned, the GSS_Wrap() call yields a
single output_message data element containing (optionally enciphered)
user data as well as control information.
Mechanisms which do not support per-message protection services
should return GSS_S_FAILURE if this routine is called.
2.3.4: GSS_Unwrap call
Note: This call is functionally equivalent to the GSS_Unseal call as
defined in previous versions of this specification. In the interests
of backward compatibility, it is recommended that implementations
support this function under both names for the present; future
references to this function as GSS_Unseal are deprecated.
Linn Standards Track [Page 66]
^L
RFC 2743 GSS-API January 2000
Inputs:
o context_handle CONTEXT HANDLE,
o input_message OCTET STRING
Outputs:
o conf_state BOOLEAN,
o qop_state INTEGER,
o major_status INTEGER,
o minor_status INTEGER,
o output_message OCTET STRING -- caller must release with
-- GSS_Release_buffer()
Return major_status codes:
o GSS_S_COMPLETE indicates that the input_message was successfully
processed and that the resulting output_message is available.
o GSS_S_DEFECTIVE_TOKEN indicates that consistency checks performed
on the per_msg_token extracted from the input_message failed,
preventing further processing from being performed.
o GSS_S_BAD_SIG (GSS_S_BAD_MIC) indicates that an incorrect
integrity check was detected for the message.
o GSS_S_DUPLICATE_TOKEN, GSS_S_OLD_TOKEN, GSS_S_UNSEQ_TOKEN, and
GSS_S_GAP_TOKEN values appear in conjunction with the optional per-
message replay detection features described in Section 1.2.3; their
semantics are described in that section.
o GSS_S_CONTEXT_EXPIRED indicates that context-related data items
have expired, so that the requested operation cannot be performed.
o GSS_S_NO_CONTEXT indicates that no context was recognized for the
input context_handle provided.
o GSS_S_FAILURE indicates that the context is recognized, but that
the GSS_Unwrap() operation could not be performed for reasons
unspecified at the GSS-API level.
Linn Standards Track [Page 67]
^L
RFC 2743 GSS-API January 2000
Processes a data element generated (and optionally enciphered) by
GSS_Wrap(), provided as input_message. The returned conf_state value
indicates whether confidentiality was applied to the input_message.
If conf_state is TRUE, GSS_Unwrap() has deciphered the input_message.
Returns an indication of the quality-of-protection applied to the
processed message in the qop_state result. GSS_Unwrap() performs the
data integrity and data origin authentication checking functions of
GSS_VerifyMIC() on the plaintext data. Plaintext data is returned in
output_message.
Mechanisms which do not support per-message protection services
should return GSS_S_FAILURE if this routine is called.
2.4: Support calls
This group of calls provides support functions useful to GSS-API
callers, independent of the state of established contexts. Their
characterization with regard to blocking or non-blocking status in
terms of network interactions is unspecified.
2.4.1: GSS_Display_status call
Inputs:
o status_value INTEGER, -- GSS-API major_status or minor_status
-- return value
o status_type INTEGER, -- 1 if major_status, 2 if minor_status
o mech_type OBJECT IDENTIFIER -- mech_type to be used for
-- minor_status translation
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o status_string_set SET OF OCTET STRING -- required calls for
-- release by caller are specific to language bindings
Return major_status codes:
o GSS_S_COMPLETE indicates that a valid printable status
representation (possibly representing more than one status event
encoded within the status_value) is available in the returned
status_string_set.
Linn Standards Track [Page 68]
^L
RFC 2743 GSS-API January 2000
o GSS_S_BAD_MECH indicates that translation in accordance with an
unsupported mech_type was requested, so translation could not be
performed.
o GSS_S_BAD_STATUS indicates that the input status_value was
invalid, or that the input status_type carried a value other than 1
or 2, so translation could not be performed.
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
Provides a means for callers to translate GSS-API-returned major and
minor status codes into printable string representations. Note: some
language bindings may employ an iterative approach in order to emit
successive status components; this approach is acceptable but not
required for conformance with the current specification.
Although not contemplated in [RFC-2078], it has been observed that
some existing GSS-API implementations return GSS_S_CONTINUE_NEEDED
status when iterating through successive messages returned from
GSS_Display_status(). This behavior is deprecated;
GSS_S_CONTINUE_NEEDED should be returned only by
GSS_Init_sec_context() and GSS_Accept_sec_context(). For maximal
portability, however, it is recommended that defensive callers be
able to accept and ignore GSS_S_CONTINUE_NEEDED status if indicated
by GSS_Display_status() or any other call other than
GSS_Init_sec_context() or GSS_Accept_sec_context().
2.4.2: GSS_Indicate_mechs call
Input:
o (none)
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o mech_set SET OF OBJECT IDENTIFIER -- caller must release
-- with GSS_Release_oid_set()
Return major_status codes:
o GSS_S_COMPLETE indicates that a set of available mechanisms has
been returned in mech_set.
Linn Standards Track [Page 69]
^L
RFC 2743 GSS-API January 2000
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
Allows callers to determine the set of mechanism types available on
the local system. This call is intended for support of specialized
callers who need to request non-default mech_type sets from GSS-API
calls which accept input mechanism type specifiers.
2.4.3: GSS_Compare_name call
Inputs:
o name1 INTERNAL NAME,
o name2 INTERNAL NAME
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o name_equal BOOLEAN
Return major_status codes:
o GSS_S_COMPLETE indicates that name1 and name2 were comparable, and
that the name_equal result indicates whether name1 and name2
represent the same entity.
o GSS_S_BAD_NAMETYPE indicates that the two input names' types are
different and incomparable, so that the comparison operation could
not be completed.
o GSS_S_BAD_NAME indicates that one or both of the input names was
ill-formed in terms of its internal type specifier, so the comparison
operation could not be completed.
o GSS_S_FAILURE indicates that the call's operation could not be
performed for reasons unspecified at the GSS-API level.
Allows callers to compare two internal name representations to
determine whether they refer to the same entity. If either name
presented to GSS_Compare_name() denotes an anonymous principal,
GSS_Compare_name() shall indicate FALSE. It is not required that
either or both inputs name1 and name2 be MNs; for some
Linn Standards Track [Page 70]
^L
RFC 2743 GSS-API January 2000
implementations and cases, GSS_S_BAD_NAMETYPE may be returned,
indicating name incomparability, for the case where neither input
name is an MN.
2.4.4: GSS_Display_name call
Inputs:
o name INTERNAL NAME
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o name_string OCTET STRING, -- caller must release
-- with GSS_Release_buffer()
o name_type OBJECT IDENTIFIER -- caller should treat
-- as read-only; does not need to be released
Return major_status codes:
o GSS_S_COMPLETE indicates that a valid printable name
representation is available in the returned name_string.
o GSS_S_BAD_NAME indicates that the contents of the provided name
were inconsistent with the internally-indicated name type, so no
printable representation could be generated.
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
Allows callers to translate an internal name representation into a
printable form with associated namespace type descriptor. The syntax
of the printable form is a local matter.
If the input name represents an anonymous identity, a reserved value
(GSS_C_NT_ANONYMOUS) shall be returned for name_type.
The GSS_C_NO_OID name type is to be returned only when the
corresponding internal name was created through import with
GSS_C_NO_OID. It is acceptable for mechanisms to normalize names
imported with GSS_C_NO_OID into other supported types and, therefore,
to display them with types other than GSS_C_NO_OID.
Linn Standards Track [Page 71]
^L
RFC 2743 GSS-API January 2000
2.4.5: GSS_Import_name call
Inputs:
o input_name_string OCTET STRING,
o input_name_type OBJECT IDENTIFIER
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o output_name INTERNAL NAME -- caller must release with
-- GSS_Release_name()
Return major_status codes:
o GSS_S_COMPLETE indicates that a valid name representation is
output in output_name and described by the type value in
output_name_type.
o GSS_S_BAD_NAMETYPE indicates that the input_name_type is
unsupported by the applicable underlying GSS-API mechanism(s), so the
import operation could not be completed.
o GSS_S_BAD_NAME indicates that the provided input_name_string is
ill-formed in terms of the input_name_type, so the import operation
could not be completed.
o GSS_S_BAD_MECH indicates that the input presented for import was
an exported name object and that its enclosed mechanism type was not
recognized or was unsupported by the GSS-API implementation.
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
Allows callers to provide a name representation as a contiguous octet
string, designate the type of namespace in conjunction with which it
should be parsed, and convert that representation to an internal form
suitable for input to other GSS-API routines. The syntax of the
input_name_string is defined in conjunction with its associated name
type; depending on the input_name_type, the associated
input_name_string may or may not be a printable string. If the
input_name_type's value is GSS_C_NO_OID, a mechanism-specific default
printable syntax (which shall be specified in the corresponding GSS-
V2 mechanism specification) is assumed for the input_name_string;
Linn Standards Track [Page 72]
^L
RFC 2743 GSS-API January 2000
other input_name_type values as registered by GSS-API implementations
can be used to indicate specific non-default name syntaxes. Note: The
input_name_type argument serves to describe and qualify the
interpretation of the associated input_name_string; it does not
specify the data type of the returned output_name.
If a mechanism claims support for a particular name type, its
GSS_Import_name() operation shall be able to accept all possible
values conformant to the external name syntax as defined for that
name type. These imported values may correspond to:
(1) locally registered entities (for which credentials may be
acquired),
(2) non-local entities (for which local credentials cannot be
acquired, but which may be referenced as targets of initiated
security contexts or initiators of accepted security contexts), or
to
(3) neither of the above.
Determination of whether a particular name belongs to class (1), (2),
or (3) as described above is not guaranteed to be performed by the
GSS_Import_name() function.
The internal name generated by a GSS_Import_name() operation may be a
single-mechanism MN, and is likely to be an MN within a single-
mechanism implementation, but portable callers must not depend on
this property (and must not, therefore, assume that the output from
GSS_Import_name() can be passed directly to GSS_Export_name() without
first being processed through GSS_Canonicalize_name()).
2.4.6: GSS_Release_name call
Inputs:
o name INTERNAL NAME
Outputs:
o major_status INTEGER,
o minor_status INTEGER
Return major_status codes:
o GSS_S_COMPLETE indicates that the storage associated with the
input name was successfully released.
Linn Standards Track [Page 73]
^L
RFC 2743 GSS-API January 2000
o GSS_S_BAD_NAME indicates that the input name argument did not
contain a valid name.
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
Allows callers to release the storage associated with an internal
name representation. This call's specific behavior depends on the
language and programming environment within which a GSS-API
implementation operates, and is therefore detailed within applicable
bindings specifications; in particular, implementation and invocation
of this call may be superfluous (and may be omitted) within bindings
where memory management is automatic.
2.4.7: GSS_Release_buffer call
Inputs:
o buffer OCTET STRING
Outputs:
o major_status INTEGER,
o minor_status INTEGER
Return major_status codes:
o GSS_S_COMPLETE indicates that the storage associated with the
input buffer was successfully released.
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
Allows callers to release the storage associated with an OCTET STRING
buffer allocated by another GSS-API call. This call's specific
behavior depends on the language and programming environment within
which a GSS-API implementation operates, and is therefore detailed
within applicable bindings specifications; in particular,
implementation and invocation of this call may be superfluous (and
may be omitted) within bindings where memory management is automatic.
2.4.8: GSS_Release_OID_set call
Inputs:
o buffer SET OF OBJECT IDENTIFIER
Linn Standards Track [Page 74]
^L
RFC 2743 GSS-API January 2000
Outputs:
o major_status INTEGER,
o minor_status INTEGER
Return major_status codes:
o GSS_S_COMPLETE indicates that the storage associated with the
input object identifier set was successfully released.
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
Allows callers to release the storage associated with an object
identifier set object allocated by another GSS-API call. This call's
specific behavior depends on the language and programming environment
within which a GSS-API implementation operates, and is therefore
detailed within applicable bindings specifications; in particular,
implementation and invocation of this call may be superfluous (and
may be omitted) within bindings where memory management is automatic.
2.4.9: GSS_Create_empty_OID_set call
Inputs:
o (none)
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o oid_set SET OF OBJECT IDENTIFIER -- caller must release
-- with GSS_Release_oid_set()
Return major_status codes:
o GSS_S_COMPLETE indicates successful completion
o GSS_S_FAILURE indicates that the operation failed
Creates an object identifier set containing no object identifiers, to
which members may be subsequently added using the
GSS_Add_OID_set_member() routine. These routines are intended to be
used to construct sets of mechanism object identifiers, for input to
GSS_Acquire_cred().
Linn Standards Track [Page 75]
^L
RFC 2743 GSS-API January 2000
2.4.10: GSS_Add_OID_set_member call
Inputs:
o member_oid OBJECT IDENTIFIER,
o oid_set SET OF OBJECT IDENTIFIER
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
Return major_status codes:
o GSS_S_COMPLETE indicates successful completion
o GSS_S_FAILURE indicates that the operation failed
Adds an Object Identifier to an Object Identifier set. This routine
is intended for use in conjunction with GSS_Create_empty_OID_set()
when constructing a set of mechanism OIDs for input to
GSS_Acquire_cred().
2.4.11: GSS_Test_OID_set_member call
Inputs:
o member OBJECT IDENTIFIER,
o set SET OF OBJECT IDENTIFIER
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o present BOOLEAN
Return major_status codes:
o GSS_S_COMPLETE indicates successful completion
o GSS_S_FAILURE indicates that the operation failed
Linn Standards Track [Page 76]
^L
RFC 2743 GSS-API January 2000
Interrogates an Object Identifier set to determine whether a
specified Object Identifier is a member. This routine is intended to
be used with OID sets returned by GSS_Indicate_mechs(),
GSS_Acquire_cred(), and GSS_Inquire_cred().
2.4.12: GSS_Inquire_names_for_mech call
Input:
o input_mech_type OBJECT IDENTIFIER, -- mechanism type
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o name_type_set SET OF OBJECT IDENTIFIER -- caller must release
-- with GSS_Release_oid_set()
Return major_status codes:
o GSS_S_COMPLETE indicates that the output name_type_set contains a
list of name types which are supported by the locally available
mechanism identified by input_mech_type.
o GSS_S_BAD_MECH indicates that the mechanism identified by
input_mech_type was unsupported within the local implementation,
causing the query to fail.
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
Allows callers to determine the set of name types which are
supportable by a specific locally-available mechanism.
2.4.13: GSS_Inquire_mechs_for_name call
Inputs:
o input_name INTERNAL NAME,
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
Linn Standards Track [Page 77]
^L
RFC 2743 GSS-API January 2000
o mech_types SET OF OBJECT IDENTIFIER -- caller must release
-- with GSS_Release_oid_set()
Return major_status codes:
o GSS_S_COMPLETE indicates that a set of object identifiers,
corresponding to the set of mechanisms suitable for processing the
input_name, is available in mech_types.
o GSS_S_BAD_NAME indicates that the input_name was ill-formed and
could not be processed.
o GSS_S_BAD_NAMETYPE indicates that the input_name parameter
contained an invalid name type or a name type unsupported by the
GSS-API implementation.
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
This routine returns the mechanism set with which the input_name may
be processed.
Each mechanism returned will recognize at least one element within
the name. It is permissible for this routine to be implemented within
a mechanism-independent GSS-API layer, using the type information
contained within the presented name, and based on registration
information provided by individual mechanism implementations. This
means that the returned mech_types result may indicate that a
particular mechanism will understand a particular name when in fact
it would refuse to accept that name as input to
GSS_Canonicalize_name(), GSS_Init_sec_context(), GSS_Acquire_cred(),
or GSS_Add_cred(), due to some property of the particular name rather
than a property of the name type. Thus, this routine should be used
only as a pre-filter for a call to a subsequent mechanism-specific
routine.
2.4.14: GSS_Canonicalize_name call
Inputs:
o input_name INTERNAL NAME,
o mech_type OBJECT IDENTIFIER -- must be explicit mechanism,
-- not "default" specifier or identifier of negotiating mechanism
Outputs:
o major_status INTEGER,
Linn Standards Track [Page 78]
^L
RFC 2743 GSS-API January 2000
o minor_status INTEGER,
o output_name INTERNAL NAME -- caller must release with
-- GSS_Release_name()
Return major_status codes:
o GSS_S_COMPLETE indicates that a mechanism-specific reduction of
the input_name, as processed by the mechanism identified by
mech_type, is available in output_name.
o GSS_S_BAD_MECH indicates that the identified mechanism is
unsupported for this operation; this may correspond either to a
mechanism wholly unsupported by the local GSS-API implementation or
to a negotiating mechanism with which the canonicalization operation
cannot be performed.
o GSS_S_BAD_NAMETYPE indicates that the input name does not contain
an element with suitable type for processing by the identified
mechanism.
o GSS_S_BAD_NAME indicates that the input name contains an element
with suitable type for processing by the identified mechanism, but
that this element could not be processed successfully.
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
This routine reduces a GSS-API internal name input_name, which may in
general contain elements corresponding to multiple mechanisms, to a
mechanism-specific Mechanism Name (MN) output_name by applying the
translations corresponding to the mechanism identified by mech_type.
The contents of input_name are unaffected by the
GSS_Canonicalize_name() operation. References to output_name will
remain valid until output_name is released, independent of whether or
not input_name is subsequently released.
2.4.15: GSS_Export_name call
Inputs:
o input_name INTERNAL NAME, -- required to be MN
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
Linn Standards Track [Page 79]
^L
RFC 2743 GSS-API January 2000
o output_name OCTET STRING -- caller must release
-- with GSS_Release_buffer()
Return major_status codes:
o GSS_S_COMPLETE indicates that a flat representation of the input
name is available in output_name.
o GSS_S_NAME_NOT_MN indicates that the input name contained elements
corresponding to multiple mechanisms, so cannot be exported into a
single-mechanism flat form.
o GSS_S_BAD_NAME indicates that the input name was an MN, but could
not be processed.
o GSS_S_BAD_NAMETYPE indicates that the input name was an MN, but
that its type is unsupported by the GSS-API implementation.
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
This routine creates a flat name representation, suitable for
bytewise comparison or for input to GSS_Import_name() in conjunction
with the reserved GSS-API Exported Name Object OID, from a internal-
form Mechanism Name (MN) as emitted, e.g., by GSS_Canonicalize_name()
or GSS_Accept_sec_context().
The emitted GSS-API Exported Name Object is self-describing; no
associated parameter-level OID need be emitted by this call. This
flat representation consists of a mechanism-independent wrapper
layer, defined in Section 3.2 of this document, enclosing a
mechanism-defined name representation.
In all cases, the flat name output by GSS_Export_name() to correspond
to a particular input MN must be invariant over time within a
particular installation.
The GSS_S_NAME_NOT_MN status code is provided to enable
implementations to reject input names which are not MNs. It is not,
however, required for purposes of conformance to this specification
that all non-MN input names must necessarily be rejected.
2.4.16: GSS_Duplicate_name call
Inputs:
o src_name INTERNAL NAME
Linn Standards Track [Page 80]
^L
RFC 2743 GSS-API January 2000
Outputs:
o major_status INTEGER,
o minor_status INTEGER,
o dest_name INTERNAL NAME -- caller must release
-- with GSS_Release_name()
Return major_status codes:
o GSS_S_COMPLETE indicates that dest_name references an internal
name object containing the same name as passed to src_name.
o GSS_S_BAD_NAME indicates that the input name was invalid.
o GSS_S_FAILURE indicates that the requested operation could not be
performed for reasons unspecified at the GSS-API level.
This routine takes input internal name src_name, and returns another
reference (dest_name) to that name which can be used even if src_name
is later freed. (Note: This may be implemented by copying or through
use of reference counts.)
3: Data Structure Definitions for GSS-V2 Usage
Subsections of this section define, for interoperability and
portability purposes, certain data structures for use with GSS-V2.
3.1: Mechanism-Independent Token Format
This section specifies a mechanism-independent level of encapsulating
representation for the initial token of a GSS-API context
establishment sequence, incorporating an identifier of the mechanism
type to be used on that context and enabling tokens to be interpreted
unambiguously at GSS-API peers. Use of this format is required for
initial context establishment tokens of Internet standards-track
GSS-API mechanisms; use in non-initial tokens is optional.
The encoding format for the token tag is derived from ASN.1 and DER
(per illustrative ASN.1 syntax included later within this
subsection), but its concrete representation is defined directly in
terms of octets rather than at the ASN.1 level in order to facilitate
interoperable implementation without use of general ASN.1 processing
code. The token tag consists of the following elements, in order:
1. 0x60 -- Tag for [APPLICATION 0] SEQUENCE; indicates that
-- constructed form, definite length encoding follows.
Linn Standards Track [Page 81]
^L
RFC 2743 GSS-API January 2000
2. Token length octets, specifying length of subsequent data
(i.e., the summed lengths of elements 3-5 in this list, and of the
mechanism-defined token object following the tag). This element
comprises a variable number of octets:
2a. If the indicated value is less than 128, it shall be
represented in a single octet with bit 8 (high order) set to
"0" and the remaining bits representing the value.
2b. If the indicated value is 128 or more, it shall be
represented in two or more octets, with bit 8 of the first
octet set to "1" and the remaining bits of the first octet
specifying the number of additional octets. The subsequent
octets carry the value, 8 bits per octet, most significant
digit first. The minimum number of octets shall be used to
encode the length (i.e., no octets representing leading zeros
shall be included within the length encoding).
3. 0x06 -- Tag for OBJECT IDENTIFIER
4. Object identifier length -- length (number of octets) of
-- the encoded object identifier contained in element 5,
-- encoded per rules as described in 2a. and 2b. above.
5. Object identifier octets -- variable number of octets,
-- encoded per ASN.1 BER rules:
5a. The first octet contains the sum of two values: (1) the
top-level object identifier component, multiplied by 40
(decimal), and (2) the second-level object identifier
component. This special case is the only point within an
object identifier encoding where a single octet represents
contents of more than one component.
5b. Subsequent octets, if required, encode successively-lower
components in the represented object identifier. A component's
encoding may span multiple octets, encoding 7 bits per octet
(most significant bits first) and with bit 8 set to "1" on all
but the final octet in the component's encoding. The minimum
number of octets shall be used to encode each component (i.e.,
no octets representing leading zeros shall be included within a
component's encoding).
(Note: In many implementations, elements 3-5 may be stored and
referenced as a contiguous string constant.)
Linn Standards Track [Page 82]
^L
RFC 2743 GSS-API January 2000
The token tag is immediately followed by a mechanism-defined token
object. Note that no independent size specifier intervenes following
the object identifier value to indicate the size of the mechanism-
defined token object. While ASN.1 usage within mechanism-defined
tokens is permitted, there is no requirement that the mechanism-
specific innerContextToken, innerMsgToken, and sealedUserData data
elements must employ ASN.1 BER/DER encoding conventions.
The following ASN.1 syntax is included for descriptive purposes only,
to illustrate structural relationships among token and tag objects.
For interoperability purposes, token and tag encoding shall be
performed using the concrete encoding procedures described earlier in
this subsection.
GSS-API DEFINITIONS ::=
BEGIN
MechType ::= OBJECT IDENTIFIER
-- data structure definitions
-- callers must be able to distinguish among
-- InitialContextToken, SubsequentContextToken,
-- PerMsgToken, and SealedMessage data elements
-- based on the usage in which they occur
InitialContextToken ::=
-- option indication (delegation, etc.) indicated within
-- mechanism-specific token
[APPLICATION 0] IMPLICIT SEQUENCE {
thisMech MechType,
innerContextToken ANY DEFINED BY thisMech
-- contents mechanism-specific
-- ASN.1 structure not required
}
SubsequentContextToken ::= innerContextToken ANY
-- interpretation based on predecessor InitialContextToken
-- ASN.1 structure not required
PerMsgToken ::=
-- as emitted by GSS_GetMIC and processed by GSS_VerifyMIC
-- ASN.1 structure not required
innerMsgToken ANY
SealedMessage ::=
-- as emitted by GSS_Wrap and processed by GSS_Unwrap
-- includes internal, mechanism-defined indicator
-- of whether or not encrypted
Linn Standards Track [Page 83]
^L
RFC 2743 GSS-API January 2000
-- ASN.1 structure not required
sealedUserData ANY
END
3.2: Mechanism-Independent Exported Name Object Format
This section specifies a mechanism-independent level of encapsulating
representation for names exported via the GSS_Export_name() call,
including an object identifier representing the exporting mechanism.
The format of names encapsulated via this representation shall be
defined within individual mechanism drafts. The Object Identifier
value to indicate names of this type is defined in Section 4.7 of
this document.
No name type OID is included in this mechanism-independent level of
format definition, since (depending on individual mechanism
specifications) the enclosed name may be implicitly typed or may be
explicitly typed using a means other than OID encoding.
The bytes within MECH_OID_LEN and NAME_LEN elements are represented
most significant byte first (equivalently, in IP network byte order).
Length Name Description
2 TOK_ID Token Identifier
For exported name objects, this
must be hex 04 01.
2 MECH_OID_LEN Length of the Mechanism OID
MECH_OID_LEN MECH_OID Mechanism OID, in DER
4 NAME_LEN Length of name
NAME_LEN NAME Exported name; format defined in
applicable mechanism draft.
A concrete example of the contents of an exported name object,
derived from the Kerberos Version 5 mechanism, is as follows:
04 01 00 0B 06 09 2A 86 48 86 F7 12 01 02 02 hx xx xx xl pp qq ... zz
04 01 mandatory token identifier
00 0B 2-byte length of the immediately following DER-encoded
ASN.1 value of type OID, most significant octet first
Linn Standards Track [Page 84]
^L
RFC 2743 GSS-API January 2000
06 09 2A 86 48 86 F7 12 01 02 02 DER-encoded ASN.1 value
of type OID; Kerberos V5
mechanism OID indicates
Kerberos V5 exported name
in Detail: 06 Identifier octet (6=OID)
09 Length octet(s)
2A 86 48 86 F7 12 01 02 02 Content octet(s)
hx xx xx xl 4-byte length of the immediately following exported
name blob, most significant octet first
pp qq ... zz exported name blob of specified length,
bits and bytes specified in the
(Kerberos 5) GSS-API v2 mechanism spec
4: Name Type Definitions
This section includes definitions for name types and associated
syntaxes which are defined in a mechanism-independent fashion at the
GSS-API level rather than being defined in individual mechanism
specifications.
4.1: Host-Based Service Name Form
This name form shall be represented by the Object Identifier:
{iso(1) member-body(2) United States(840) mit(113554) infosys(1)
"gssapi(2) generic(1) service_name(4)}.
The recommended symbolic name for this type is
"GSS_C_NT_HOSTBASED_SERVICE".
For reasons of compatibility with existing implementations, it is
recommended that this OID be used rather than the alternate value as
included in [RFC-2078]:
{1(iso), 3(org), 6(dod), 1(internet), 5(security), 6(nametypes),
2(gss-host-based-services)}
While it is not recommended that this alternate value be emitted on
output by GSS implementations, it is recommended that it be accepted
on input as equivalent to the recommended value.
Linn Standards Track [Page 85]
^L
RFC 2743 GSS-API January 2000
This name type is used to represent services associated with host
computers. Support for this name form is recommended to mechanism
designers in the interests of portability, but is not mandated by
this specification. This name form is constructed using two elements,
"service" and "hostname", as follows:
service@hostname
When a reference to a name of this type is resolved, the "hostname"
may (as an example implementation strategy) be canonicalized by
attempting a DNS lookup and using the fully-qualified domain name
which is returned, or by using the "hostname" as provided if the DNS
lookup fails. The canonicalization operation also maps the host's
name into lower-case characters.
The "hostname" element may be omitted. If no "@" separator is
included, the entire name is interpreted as the service specifier,
with the "hostname" defaulted to the canonicalized name of the local
host.
Documents specifying means for GSS integration into a particular
protocol should state either:
(a) that a specific IANA-registered name associated with that
protocol shall be used for the "service" element (this admits, if
needed, the possibility that a single name can be registered and
shared among a related set of protocols), or
(b) that the generic name "host" shall be used for the "service"
element, or
(c) that, for that protocol, fallback in specified order (a, then
b) or (b, then a) shall be applied.
IANA registration of specific names per (a) should be handled in
accordance with the "Specification Required" assignment policy,
defined by BCP 26, RFC 2434 as follows: "Values and their meaning
must be documented in an RFC or other available reference, in
sufficient detail so that interoperability between independent
implementations is possible."
4.2: User Name Form
This name form shall be represented by the Object Identifier {iso(1)
member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
generic(1) user_name(1)}. The recommended mechanism-independent
symbolic name for this type is "GSS_C_NT_USER_NAME". (Note: the same
Linn Standards Track [Page 86]
^L
RFC 2743 GSS-API January 2000
name form and OID is defined within the Kerberos V5 GSS-API
mechanism, but the symbolic name recommended there begins with a
"GSS_KRB5_NT_" prefix.)
This name type is used to indicate a named user on a local system.
Its syntax and interpretation may be OS-specific. This name form is
constructed as:
username
4.3: Machine UID Form
This name form shall be represented by the Object Identifier {iso(1)
member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
generic(1) machine_uid_name(2)}. The recommended mechanism-
independent symbolic name for this type is
"GSS_C_NT_MACHINE_UID_NAME". (Note: the same name form and OID is
defined within the Kerberos V5 GSS-API mechanism, but the symbolic
name recommended there begins with a "GSS_KRB5_NT_" prefix.)
This name type is used to indicate a numeric user identifier
corresponding to a user on a local system. Its interpretation is
OS-specific. The gss_buffer_desc representing a name of this type
should contain a locally-significant user ID, represented in host
byte order. The GSS_Import_name() operation resolves this uid into a
username, which is then treated as the User Name Form.
4.4: String UID Form
This name form shall be represented by the Object Identifier {iso(1)
member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
generic(1) string_uid_name(3)}. The recommended symbolic name for
this type is "GSS_C_NT_STRING_UID_NAME". (Note: the same name form
and OID is defined within the Kerberos V5 GSS-API mechanism, but the
symbolic name recommended there begins with a "GSS_KRB5_NT_" prefix.)
This name type is used to indicate a string of digits representing
the numeric user identifier of a user on a local system. Its
interpretation is OS-specific. This name type is similar to the
Machine UID Form, except that the buffer contains a string
representing the user ID.
4.5: Anonymous Nametype
The following Object Identifier value is provided as a means to
identify anonymous names, and can be compared against in order to
determine, in a mechanism-independent fashion, whether a name refers
to an anonymous principal:
Linn Standards Track [Page 87]
^L
RFC 2743 GSS-API January 2000
{1(iso), 3(org), 6(dod), 1(internet), 5(security), 6(nametypes),
3(gss-anonymous-name)}
The recommended symbolic name corresponding to this definition is
GSS_C_NT_ANONYMOUS.
4.6: GSS_C_NO_OID
The recommended symbolic name GSS_C_NO_OID corresponds to a null
input value instead of an actual object identifier. Where specified,
it indicates interpretation of an associated name based on a
mechanism-specific default printable syntax.
4.7: Exported Name Object
Name objects of the Mechanism-Independent Exported Name Object type,
as defined in Section 3.2 of this document, will be identified with
the following Object Identifier:
{1(iso), 3(org), 6(dod), 1(internet), 5(security), 6(nametypes),
4(gss-api-exported-name)}
The recommended symbolic name corresponding to this definition is
GSS_C_NT_EXPORT_NAME.
4.8: GSS_C_NO_NAME
The recommended symbolic name GSS_C_NO_NAME indicates that no name is
being passed within a particular value of a parameter used for the
purpose of transferring names. Note: GSS_C_NO_NAME is not an actual
name type, and is not represented by an OID; its acceptability in
lieu of an actual name is confined to specific calls
(GSS_Acquire_cred(), GSS_Add_cred(), and GSS_Init_sec_context()) with
usages as identified within this specification.
5: Mechanism-Specific Example Scenarios
This section provides illustrative overviews of the use of various
candidate mechanism types to support the GSS-API. These discussions
are intended primarily for readers familiar with specific security
technologies, demonstrating how GSS-API functions can be used and
implemented by candidate underlying mechanisms. They should not be
regarded as constrictive to implementations or as defining the only
means through which GSS-API functions can be realized with a
particular underlying technology, and do not demonstrate all GSS-API
features with each technology.
Linn Standards Track [Page 88]
^L
RFC 2743 GSS-API January 2000
5.1: Kerberos V5, single-TGT
OS-specific login functions yield a TGT to the local realm Kerberos
server; TGT is placed in a credentials structure for the client.
Client calls GSS_Acquire_cred() to acquire a cred_handle in order to
reference the credentials for use in establishing security contexts.
Client calls GSS_Init_sec_context(). If the requested service is
located in a different realm, GSS_Init_sec_context() gets the
necessary TGT/key pairs needed to traverse the path from local to
target realm; these data are placed in the owner's TGT cache. After
any needed remote realm resolution, GSS_Init_sec_context() yields a
service ticket to the requested service with a corresponding session
key; these data are stored in conjunction with the context. GSS-API
code sends KRB_TGS_REQ request(s) and receives KRB_TGS_REP
response(s) (in the successful case) or KRB_ERROR.
Assuming success, GSS_Init_sec_context() builds a Kerberos-formatted
KRB_AP_REQ message, and returns it in output_token. The client sends
the output_token to the service.
The service passes the received token as the input_token argument to
GSS_Accept_sec_context(), which verifies the authenticator, provides
the service with the client's authenticated name, and returns an
output_context_handle.
Both parties now hold the session key associated with the service
ticket, and can use this key in subsequent GSS_GetMIC(),
GSS_VerifyMIC(), GSS_Wrap(), and GSS_Unwrap() operations.
5.2: Kerberos V5, double-TGT
TGT acquisition as above.
Note: To avoid unnecessary frequent invocations of error paths when
implementing the GSS-API atop Kerberos V5, it seems appropriate to
represent "single-TGT K-V5" and "double-TGT K-V5" with separate
mech_types, and this discussion makes that assumption.
Based on the (specified or defaulted) mech_type,
GSS_Init_sec_context() determines that the double-TGT protocol
should be employed for the specified target. GSS_Init_sec_context()
returns GSS_S_CONTINUE_NEEDED major_status, and its returned
output_token contains a request to the service for the service's TGT.
(If a service TGT with suitably long remaining lifetime already
exists in a cache, it may be usable, obviating the need for this
step.) The client passes the output_token to the service. Note: this
scenario illustrates a different use for the GSS_S_CONTINUE_NEEDED
Linn Standards Track [Page 89]
^L
RFC 2743 GSS-API January 2000
status return facility than for support of mutual authentication;
note that both uses can coexist as successive operations within a
single context establishment operation.
The service passes the received token as the input_token argument to
GSS_Accept_sec_context(), which recognizes it as a request for TGT.
(Note that current Kerberos V5 defines no intra-protocol mechanism to
represent such a request.) GSS_Accept_sec_context() returns
GSS_S_CONTINUE_NEEDED major_status and provides the service's TGT in
its output_token. The service sends the output_token to the client.
The client passes the received token as the input_token argument to a
continuation of GSS_Init_sec_context(). GSS_Init_sec_context() caches
the received service TGT and uses it as part of a service ticket
request to the Kerberos authentication server, storing the returned
service ticket and session key in conjunction with the context.
GSS_Init_sec_context() builds a Kerberos-formatted authenticator, and
returns it in output_token along with GSS_S_COMPLETE return
major_status. The client sends the output_token to the service.
Service passes the received token as the input_token argument to a
continuation call to GSS_Accept_sec_context().
GSS_Accept_sec_context() verifies the authenticator, provides the
service with the client's authenticated name, and returns
major_status GSS_S_COMPLETE.
GSS_GetMIC(), GSS_VerifyMIC(), GSS_Wrap(), and GSS_Unwrap() as
above.
5.3: X.509 Authentication Framework
This example illustrates use of the GSS-API in conjunction with
public-key mechanisms, consistent with the X.509 Directory
Authentication Framework.
The GSS_Acquire_cred() call establishes a credentials structure,
making the client's private key accessible for use on behalf of the
client.
The client calls GSS_Init_sec_context(), which interrogates the
Directory to acquire (and validate) a chain of public-key
certificates, thereby collecting the public key of the service. The
certificate validation operation determines that suitable integrity
checks were applied by trusted authorities and that those
certificates have not expired. GSS_Init_sec_context() generates a
secret key for use in per-message protection operations on the
context, and enciphers that secret key under the service's public
key.
Linn Standards Track [Page 90]
^L
RFC 2743 GSS-API January 2000
The enciphered secret key, along with an authenticator quantity
signed with the client's private key, is included in the output_token
from GSS_Init_sec_context(). The output_token also carries a
certification path, consisting of a certificate chain leading from
the service to the client; a variant approach would defer this path
resolution to be performed by the service instead of being asserted
by the client. The client application sends the output_token to the
service.
The service passes the received token as the input_token argument to
GSS_Accept_sec_context(). GSS_Accept_sec_context() validates the
certification path, and as a result determines a certified binding
between the client's distinguished name and the client's public key.
Given that public key, GSS_Accept_sec_context() can process the
input_token's authenticator quantity and verify that the client's
private key was used to sign the input_token. At this point, the
client is authenticated to the service. The service uses its private
key to decipher the enciphered secret key provided to it for per-
message protection operations on the context.
The client calls GSS_GetMIC() or GSS_Wrap() on a data message, which
causes per-message authentication, integrity, and (optional)
confidentiality facilities to be applied to that message. The service
uses the context's shared secret key to perform corresponding
GSS_VerifyMIC() and GSS_Unwrap() calls.
6: Security Considerations
This document specifies a service interface for security facilities
and services; as such, security considerations are considered
throughout the specification. Nonetheless, it is appropriate to
summarize certain specific points relevant to GSS-API implementors
and calling applications. Usage of the GSS-API interface does not in
itself provide security services or assurance; instead, these
attributes are dependent on the underlying mechanism(s) which support
a GSS-API implementation. Callers must be attentive to the requests
made to GSS-API calls and to the status indicators returned by GSS-
API, as these specify the security service characteristics which
GSS-API will provide. When the interprocess context transfer
facility is used, appropriate local controls should be applied to
constrain access to interprocess tokens and to the sensitive data
which they contain.
Linn Standards Track [Page 91]
^L
RFC 2743 GSS-API January 2000
7: Related Activities
In order to implement the GSS-API atop existing, emerging, and future
security mechanisms:
object identifiers must be assigned to candidate GSS-API
mechanisms and the name types which they support
concrete data element formats and processing procedures must be
defined for candidate mechanisms
Calling applications must implement formatting conventions which will
enable them to distinguish GSS-API tokens from other data carried in
their application protocols.
Concrete language bindings are required for the programming
environments in which the GSS-API is to be employed, as [RFC-1509]
defines for the C programming language and GSS-V1. C Language
bindings for GSS-V2 are defined in [RFC-2744].
Linn Standards Track [Page 92]
^L
RFC 2743 GSS-API January 2000
8: Referenced Documents
[ISO-7498-2] International Standard ISO 7498-2-1988(E), Security
Architecture.
[ISOIEC-8824] ISO/IEC 8824, "Specification of Abstract Syntax
Notation One (ASN.1)".
[ISOIEC-8825] ISO/IEC 8825, "Specification of Basic Encoding Rules
for Abstract Syntax Notation One (ASN.1)".)
[RFC-1507]: Kaufman, C., "DASS: Distributed Authentication Security
Service", RFC 1507, September 1993.
[RFC-1508]: Linn, J., "Generic Security Service Application Program
Interface", RFC 1508, September 1993.
[RFC-1509]: Wray, J., "Generic Security Service API: C-bindings",
RFC 1509, September 1993.
[RFC-1964]: Linn, J., "The Kerberos Version 5 GSS-API Mechanism",
RFC 1964, June 1996.
[RFC-2025]: Adams, C., "The Simple Public-Key GSS-API Mechanism
(SPKM)", RFC 2025, October 1996.
[RFC-2078]: Linn, J., "Generic Security Service Application Program
Interface, Version 2", RFC 2078, January 1997.
[RFC-2203]: Eisler, M., Chiu, A. and L. Ling, "RPCSEC_GSS Protocol
Specification", RFC 2203, September 1997.
[RFC-2744]: Wray, J., "Generic Security Service API Version 2 :
C-bindings", RFC 2744, January 2000.
Linn Standards Track [Page 93]
^L
RFC 2743 GSS-API January 2000
APPENDIX A
MECHANISM DESIGN CONSTRAINTS
The following constraints on GSS-API mechanism designs are adopted in
response to observed caller protocol requirements, and adherence
thereto is anticipated in subsequent descriptions of GSS-API
mechanisms to be documented in standards-track Internet
specifications.
It is strongly recommended that mechanisms offering per-message
protection services also offer at least one of the replay detection
and sequencing services, as mechanisms offering neither of the latter
will fail to satisfy recognized requirements of certain candidate
caller protocols.
APPENDIX B
COMPATIBILITY WITH GSS-V1
It is the intent of this document to define an interface and
procedures which preserve compatibility between GSS-V1 [RFC-1508]
callers and GSS-V2 providers. All calls defined in GSS-V1 are
preserved, and it has been a goal that GSS-V1 callers should be able
to operate atop GSS-V2 provider implementations. Certain detailed
changes, summarized in this section, have been made in order to
resolve omissions identified in GSS-V1.
The following GSS-V1 constructs, while supported within GSS-V2, are
deprecated:
Names for per-message processing routines: GSS_Seal() deprecated
in favor of GSS_Wrap(); GSS_Sign() deprecated in favor of
GSS_GetMIC(); GSS_Unseal() deprecated in favor of GSS_Unwrap();
GSS_Verify() deprecated in favor of GSS_VerifyMIC().
GSS_Delete_sec_context() facility for context_token usage,
allowing mechanisms to signal context deletion, is retained for
compatibility with GSS-V1. For current usage, it is recommended
that both peers to a context invoke GSS_Delete_sec_context()
independently, passing a null output_context_token buffer to
indicate that no context_token is required. Implementations of
GSS_Delete_sec_context() should delete relevant locally-stored
context information.
This GSS-V2 specification adds the following calls which are not
present in GSS-V1:
Linn Standards Track [Page 94]
^L
RFC 2743 GSS-API January 2000
Credential management calls: GSS_Add_cred(),
GSS_Inquire_cred_by_mech().
Context-level calls: GSS_Inquire_context(), GSS_Wrap_size_limit(),
GSS_Export_sec_context(), GSS_Import_sec_context().
Per-message calls: No new calls. Existing calls have been
renamed.
Support calls: GSS_Create_empty_OID_set(),
GSS_Add_OID_set_member(), GSS_Test_OID_set_member(),
GSS_Inquire_names_for_mech(), GSS_Inquire_mechs_for_name(),
GSS_Canonicalize_name(), GSS_Export_name(), GSS_Duplicate_name().
This GSS-V2 specification introduces three new facilities applicable
to security contexts, indicated using the following context state
values which are not present in GSS-V1:
anon_state, set TRUE to indicate that a context's initiator is
anonymous from the viewpoint of the target; Section 1.2.5 of this
specification provides a summary description of the GSS-V2
anonymity support facility, support and use of which is optional.
prot_ready_state, set TRUE to indicate that a context may be used
for per-message protection before final completion of context
establishment; Section 1.2.7 of this specification provides a
summary description of the GSS-V2 facility enabling mechanisms to
selectively permit per-message protection during context
establishment, support and use of which is optional.
trans_state, set TRUE to indicate that a context is transferable
to another process using the GSS-V2 GSS_Export_sec_context()
facility.
These state values are represented (at the C bindings level) in
positions within a bit vector which are unused in GSS-V1, and may be
safely ignored by GSS-V1 callers.
New conf_req_flag and integ_req_flag inputs are defined for
GSS_Init_sec_context(), primarily to provide information to
negotiating mechanisms. This introduces a compatibility issue with
GSS-V1 callers, discussed in section 2.2.1 of this specification.
Linn Standards Track [Page 95]
^L
RFC 2743 GSS-API January 2000
Relative to GSS-V1, GSS-V2 provides additional guidance to GSS-API
implementors in the following areas: implementation robustness,
credential management, behavior in multi-mechanism configurations,
naming support, and inclusion of optional sequencing services. The
token tagging facility as defined in GSS-V2, Section 3.1, is now
described directly in terms of octets to facilitate interoperable
implementation without general ASN.1 processing code; the
corresponding ASN.1 syntax, included for descriptive purposes, is
unchanged from that in GSS-V1. For use in conjunction with added
naming support facilities, a new Exported Name Object construct is
added. Additional name types are introduced in Section 4.
This GSS-V2 specification adds the following major_status values
which are not defined in GSS-V1:
GSS_S_BAD_QOP unsupported QOP value
GSS_S_UNAUTHORIZED operation unauthorized
GSS_S_UNAVAILABLE operation unavailable
GSS_S_DUPLICATE_ELEMENT duplicate credential element
requested
GSS_S_NAME_NOT_MN name contains multi-mechanism
elements
GSS_S_GAP_TOKEN skipped predecessor token(s)
detected
Of these added status codes, only two values are defined to be
returnable by calls existing in GSS-V1: GSS_S_BAD_QOP (returnable by
GSS_GetMIC() and GSS_Wrap()), and GSS_S_GAP_TOKEN (returnable by
GSS_VerifyMIC() and GSS_Unwrap()).
Additionally, GSS-V2 descriptions of certain calls present in GSS-V1
have been updated to allow return of additional major_status values
from the set as defined in GSS-V1: GSS_Inquire_cred() has
GSS_S_DEFECTIVE_CREDENTIAL and GSS_S_CREDENTIALS_EXPIRED defined as
returnable, GSS_Init_sec_context() has GSS_S_OLD_TOKEN,
GSS_S_DUPLICATE_TOKEN, and GSS_S_BAD_MECH defined as returnable, and
GSS_Accept_sec_context() has GSS_S_BAD_MECH defined as returnable.
APPENDIX C
CHANGES RELATIVE TO RFC-2078
This document incorporates a number of changes relative to RFC-2078,
made primarily in response to implementation experience, for purposes
of alignment with the GSS-V2 C language bindings document, and to add
informative clarification. This section summarizes technical changes
incorporated.
Linn Standards Track [Page 96]
^L
RFC 2743 GSS-API January 2000
General:
Clarified usage of object release routines, and incorporated
statement that some may be omitted within certain operating
environments.
Removed GSS_Release_OID, GSS_OID_to_str(), and GSS_Str_to_OID()
routines.
Clarified circumstances under which zero-length tokens may validly
exist as inputs and outputs to/from GSS-API calls.
Added GSS_S_BAD_MIC status code as alias for GSS_S_BAD_SIG.
For GSS_Display_status(), deferred to language bindings the choice
of whether to return multiple status values in parallel or via
iteration, and added commentary deprecating return of
GSS_S_CONTINUE_NEEDED.
Adapted and incorporated clarifying material on optional service
support, delegation, and interprocess context transfer from C
bindings document.
Added and updated references to related documents, and to current
status of cited Kerberos mechanism OID.
Added general statement about GSS-API calls having no side effects
visible at the GSS-API level.
Context-related (including per-message protection issues):
Clarified GSS_Delete_sec_context() usage for partially-established
contexts.
Added clarification on GSS_Export_sec_context() and
GSS_Import_sec_context() behavior and context usage following an
export-import sequence.
Added informatory conf_req_flag, integ_req_flag inputs to
GSS_Init_sec_context(). (Note: this facility introduces a
backward incompatibility with GSS-V1 callers, discussed in Section
2.2.1; this implication was recognized and accepted in working
group discussion.)
Stated that GSS_S_FAILURE is to be returned if
GSS_Init_sec_context() or GSS_Accept_sec_context() is passed the
handle of a context which is already fully established.
Linn Standards Track [Page 97]
^L
RFC 2743 GSS-API January 2000
Re GSS_Inquire_sec_context(), stated that src_name and targ_name
are not returned until GSS_S_COMPLETE status is reached; removed
use of GSS_S_CONTEXT_EXPIRED status code (replacing with EXPIRED
lifetime return value); stated requirement to retain inquirable
data until context released by caller; added result value
indicating whether or not context is fully open.
Added discussion of interoperability conditions for mechanisms
permitting optional support of QOPs. Removed reference to
structured QOP elements in GSS_Verify_MIC().
Added discussion of use of GSS_S_DUPLICATE_TOKEN status to
indicate reflected per-message tokens.
Clarified use of informational sequencing codes from per-message
protection calls in conjunction with GSS_S_COMPLETE and
GSS_S_FAILURE major_status returns, adjusting status code
descriptions accordingly.
Added specific statements about impact of GSS_GetMIC() and
GSS_Wrap() failures on context state information, and generalized
existing statements about impact of processing failures on
received per-message tokens.
For GSS_Init_sec_context() and GSS_Accept_sec_context(), permitted
returned mech_type to be valid before GSS_S_COMPLETE, recognizing
that the value may change on successive continuation calls in the
negotiated mechanism case.
Deleted GSS_S_CONTEXT_EXPIRED status from
GSS_Import_sec_context().
Added conf_req_flag input to GSS_Wrap_size_limit().
Stated requirement for mechanisms' support of per-message
protection services to be usable concurrently in both directions
on a context.
Credential-related:
For GSS_Acquire_cred() and GSS_Add_cred(), aligned with C bindings
statement of likely non-support for INITIATE or BOTH credentials
if input name is neither empty nor a name resulting from applying
GSS_Inquire_cred() against the default credential. Further,
stated that an explicit name returned by GSS_Inquire_context()
should also be accepted. Added commentary about potentially
time-variant results of default resolution and attendant
implications. Aligned with C bindings re behavior when
Linn Standards Track [Page 98]
^L
RFC 2743 GSS-API January 2000
GSS_C_NO_NAME provided for desired_name. In GSS_Acquire_cred(),
stated that NULL, rather than empty OID set, should be used for
desired_mechs in order to request default mechanism set.
Added GSS_S_CREDENTIALS_EXPIRED as returnable major_status for
GSS_Acquire_cred(), GSS_Add_cred(), also specifying GSS_S_NO_CRED
as appropriate return for temporary, user-fixable credential
unavailability. GSS_Acquire_cred() and GSS_Add_cred() are also to
return GSS_S_NO_CRED if an authorization failure is encountered
upon credential acquisition.
Removed GSS_S_CREDENTIALS_EXPIRED status return from per-message
protection, GSS_Context_time(), and GSS_Inquire_context() calls.
For GSS_Add_cred(), aligned with C bindings' description of
behavior when addition of elements to the default credential is
requested.
Upgraded recommended default credential resolution algorithm to
status of requirement for initiator credentials.
For GSS_Release_cred(), GSS_Inquire_cred(), and
GSS_Inquire_cred_by_mech(), clarified behavior for input
GSS_C_NO_CREDENTIAL.
Name-related:
Aligned GSS_Inquire_mechs_for_name() description with C bindings.
Removed GSS_S_BAD_NAMETYPE status return from
GSS_Duplicate_name(), GSS_Display_name(); constrained its
applicability for GSS_Compare_name().
Aligned with C bindings statement re GSS_Import_name() behavior
with GSS_C_NO_OID input name type, and stated that GSS-V2
mechanism specifications are to define processing procedures
applicable to their mechanisms. Also clarified GSS_C_NO_OID usage
with GSS_Display_name().
Downgraded reference to name canonicalization via DNS lookup to an
example.
For GSS_Canonicalize_name(), stated that neither negotiated
mechanisms nor the default mechanism are supported input
mech_types for this operation, and specified GSS_S_BAD_MECH status
to be returned in this case. Clarified that the
GSS_Canonicalize_name() operation is non-destructive to its input
name.
Linn Standards Track [Page 99]
^L
RFC 2743 GSS-API January 2000
Clarified semantics of GSS_C_NT_USER_NAME name type.
Added descriptions of additional name types. Also added
discussion of GSS_C_NO_NAME and its constrained usage with
specific GSS calls.
Adapted and incorporated C bindings discussion about name
comparisons with exported name objects.
Added recommendation to mechanism designers for support of host-
based service name type, deferring any requirement statement to
individual mechanism specifications. Added discussion of host-
based service's service name element and proposed approach for
IANA registration policy therefor.
Clarified byte ordering within exported name object. Stated that
GSS_S_BAD_MECH is to be returned if, in the course of attempted
import of an exported name object, the name object's enclosed
mechanism type is unrecognized or unsupported.
Stated that mechanisms may optionally accept GSS_C_NO_NAME as an
input target name to GSS_Init_sec_context(), with comment that
such support is unlikely within mechanisms predating GSS-V2,
Update 1.
AUTHOR'S ADDRESS
John Linn
RSA Laboratories
20 Crosby Drive
Bedford, MA 01730 USA
Phone: +1 781.687.7817
EMail: jlinn@rsasecurity.com
Linn Standards Track [Page 100]
^L
RFC 2743 GSS-API January 2000
Full Copyright Statement
Copyright (C) The Internet Society (2000). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.
Linn Standards Track [Page 101]
^L
|