This file is indexed.

/usr/share/ada/adainclude/pcscada/pcsc-thin-reader.ads is in libpcscada4-dev 0.7.3-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
--
--  Copyright (c) 2008-2010,
--  Reto Buerki <reet@codelabs.ch>
--
--  This file is part of PCSC/Ada.
--
--  PCSC/Ada is free software; you can redistribute it and/or modify
--  it under the terms of the GNU Lesser General Public License as published
--  by the Free Software Foundation; either version 2.1 of the License, or
--  (at your option) any later version.
--
--  PCSC/Ada is distributed in the hope that it will be useful,
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--  GNU Lesser General Public License for more details.
--
--  You should have received a copy of the GNU Lesser General Public License
--  along with PCSC/Ada; if not, write to the Free Software
--  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
--  MA  02110-1301  USA
--
--  <PURPOSE>
--    This package keeps a list of attributes which can be requested directly
--    from the IFD handler. Use the @Init_Attribute_Set@ and @Get_Attribute@
--    functions to do so. It also provides the constants and types needed for
--    feature handling and PIN verification operations.
--  </PURPOSE>
--

with PCSC.Thin;
pragma Elaborate_All (PCSC.Thin);

package PCSC.Thin.Reader is

   SCARD_ATTR_VENDOR_NAME            : constant := 16#0001_0100#;
   --  Vendor name

   SCARD_ATTR_VENDOR_IFD_TYPE        : constant := 16#0001_0101#;
   --  Vendor-supplied interface device type (model designation of reader)

   SCARD_ATTR_VENDOR_IFD_VERSION     : constant := 16#0001_0102#;
   --  Vendor-supplied interface device version (DWORD in the form 0xMMmmbbbb
   --  where MM = major version, mm = minor version, and bbbb = build number).

   SCARD_ATTR_VENDOR_IFD_SERIAL_NO   : constant := 16#0001_0103#;
   --  Vendor-supplied interface device serial number

   SCARD_ATTR_CHANNEL_ID             : constant := 16#0002_0110#;
   --  DWORD encoded as 0xDDDDCCCC, where DDDD = data channel type and CCCC =
   --  channel number.

   SCARD_ATTR_DEFAULT_CLK            : constant := 16#0003_0121#;
   --  Default clock rate, in kHz

   SCARD_ATTR_MAX_CLK                : constant := 16#0003_0122#;
   --  Maximum clock rate, in kHz

   SCARD_ATTR_DEFAULT_DATA_RATE      : constant := 16#0003_0123#;
   --  Default data rate, in bps

   SCARD_ATTR_MAX_DATA_RATE          : constant := 16#0003_0124#;
   --  Maximum data rate, in bps

   SCARD_ATTR_MAX_IFSD               : constant := 16#0003_0125#;
   --  Maximum bytes for information file size device

   SCARD_ATTR_POWER_MGMT_SUPPORT     : constant := 16#0004_0131#;
   --  Zero if device does not support power down while smart card is inserted.
   --  Nonzero otherwise.

   SCARD_ATTR_CHARACTERISTICS        : constant := 16#0006_0150#;
   --  DWORD indicating which mechanical characteristics are supported. If
   --  zero, no special characteristics are supported. Note that multiple bits
   --  can be set.

   SCARD_ATTR_CURRENT_PROTOCOL_TYPE  : constant := 16#0008_0201#;
   --  Current protocol type in use

   SCARD_ATTR_CURRENT_CLK            : constant := 16#0008_0202#;
   --  Current clock rate, in kHz

   SCARD_ATTR_CURRENT_F              : constant := 16#0008_0203#;
   --  Clock conversion factor

   SCARD_ATTR_CURRENT_D              : constant := 16#0008_0204#;
   --  Bit rate conversion factor

   SCARD_ATTR_CURRENT_N              : constant := 16#0008_0205#;
   --  Current guard time

   SCARD_ATTR_CURRENT_W              : constant := 16#0008_0206#;
   --  Current work waiting time

   SCARD_ATTR_CURRENT_IFSC           : constant := 16#0008_0207#;
   --  Current byte size for information field size card

   SCARD_ATTR_CURRENT_IFSD           : constant := 16#0008_0208#;
   --  Current byte size for information field size device

   SCARD_ATTR_CURRENT_BWT            : constant := 16#0008_0209#;
   --  Current block waiting time

   SCARD_ATTR_CURRENT_CWT            : constant := 16#0008_020A#;
   --  Current character waiting time

   SCARD_ATTR_CURRENT_EBC_ENCODING   : constant := 16#0008_020B#;
   --  Current error block control encoding

   SCARD_ATTR_EXTENDED_BWT           : constant := 16#0008_020C#;
   --  Extended block waiting time

   SCARD_ATTR_ICC_PRESENCE           : constant := 16#0009_0300#;
   --  Single byte indicating smart card presence

   SCARD_ATTR_ICC_INTERFACE_STATUS   : constant := 16#0009_0301#;
   --  Single byte. Zero if smart card electrical contact is not active;
   --  nonzero if contact is active.

   SCARD_ATTR_CURRENT_IO_STATE       : constant := 16#0009_0302#;

   SCARD_ATTR_ATR_STRING             : constant := 16#0009_0303#;
   --  Answer to reset (ATR) string

   SCARD_ATTR_ICC_TYPE_PER_ATR       : constant := 16#0009_0304#;
   --  Single byte indicating smart card type

   SCARD_ATTR_ESC_RESET              : constant := 16#0007_A000#;

   SCARD_ATTR_ESC_CANCEL             : constant := 16#0007_A003#;

   SCARD_ATTR_ESC_AUTHREQUEST        : constant := 16#0007_A005#;

   SCARD_ATTR_MAXINPUT               : constant := 16#0007_A007#;

   SCARD_ATTR_DEVICE_UNIT            : constant := 16#7FFF_0001#;
   --  Instance of this vendor's reader attached to the computer. The first
   --  instance will be device unit 0, the next will be unit 1 (if it is the
   --  same brand of reader) and so on. Two different brands of readers will
   --  both have zero for this value.

   SCARD_ATTR_DEVICE_IN_USE          : constant := 16#7FFF_0002#;
   --  Reserved for future use

   SCARD_ATTR_DEVICE_FRIENDLY_NAME_A : constant := 16#7FFF_0003#;

   SCARD_ATTR_DEVICE_SYSTEM_NAME_A   : constant := 16#7FFF_0004#;

   SCARD_ATTR_DEVICE_FRIENDLY_NAME_W : constant := 16#7FFF_0005#;

   SCARD_ATTR_DEVICE_SYSTEM_NAME_W   : constant := 16#7FFF_0006#;

   SCARD_ATTR_SUPRESS_T1_IFS_REQUEST : constant := 16#7FFF_0007#;

   CM_IOCTL_GET_FEATURE_REQUEST      : constant DWORD := SCARD_CTL_CODE (3400);
   --  Control code used to get features from card / reader.

   FEATURE_VERIFY_PIN_START          : constant := 16#01#;
   --  OMNIKEY Proposal
   FEATURE_VERIFY_PIN_FINISH         : constant := 16#02#;
   --  OMNIKEY Proposal
   FEATURE_MODIFY_PIN_START          : constant := 16#03#;
   --  OMNIKEY Proposal
   FEATURE_MODIFY_PIN_FINISH         : constant := 16#04#;
   --  OMNIKEY Proposal
   FEATURE_GET_KEY_PRESSED           : constant := 16#05#;
   --  OMNIKEY Proposal
   FEATURE_VERIFY_PIN_DIRECT         : constant := 16#06#;
   --  USB CCID PIN Verify
   FEATURE_MODIFY_PIN_DIRECT         : constant := 16#07#;
   --  USB CCID PIN Modify
   FEATURE_MCT_READERDIRECT          : constant := 16#08#;
   --  KOBIL Proposal
   FEATURE_MCT_UNIVERSAL             : constant := 16#09#;
   --  KOBIL Proposal
   FEATURE_IFD_PIN_PROP              : constant := 16#0A#;
   --  Gemplus Proposal
   FEATURE_ABORT                     : constant := 16#0B#;
   --  SCM Proposal

   type PCSC_TLV_STRUCTURE is record
      tag    : Interfaces.Unsigned_8;
      length : Interfaces.Unsigned_8;
      value  : Interfaces.Unsigned_32;
      --  This value is always in BIG ENDIAN format as documented in PCSC v2
      --  part 10 ch 2.2 page 2.
   end record;
   --  PCSC Type-length-value data structure

   for PCSC_TLV_STRUCTURE use record
      tag    at 0 range 0  .. 7;
      length at 0 range 8  .. 15;
      value  at 0 range 16 .. 47;
   end record;
   --  Representation clause for PCSC_TLV_STRUCTURE type

   for PCSC_TLV_STRUCTURE'Size use 48;
   --  The PCSC_TLV_STRUCTURE must be exactly 6 bytes long

   type PIN_VERIFY_STRUCTURE is record
      bTimerOut                 : aliased Byte;
      --  Timeout is seconds (00 means use default timeout)
      bTimerOut2                : Byte;
      --  Timeout in seconds after first key stroke
      bmFormatString            : Byte;
      --  Formatting options
      bmPINBlockString          : Byte;
      --  Bits 7-4 bit size of PIN length in APDU, bits 3-0 PIN block size in
      --  bytes after justification and formatting
      bmPINLengthFormat         : Byte;
      --  Bits 7-5 RFU, bit 4 set if system units are bytes, clear if system
      --  units are bits, bits 3-0 PIN length position in system units
      wPINMaxExtraDigit         : Interfaces.Unsigned_16;
      --  0xXXYY where XX is minimum PIN size in digits, and YY is maximum PIN
      --  size in digits
      bEntryValidationCondition : Byte;
      --  Conditions under which PIN entry should be considered complete
      bNumberMessage            : Byte;
      --  Number of messages to display for PIN verification
      wLangId                   : Interfaces.Unsigned_16;
      --  Language for messages
      bMsgIndex                 : Byte := 0;
      --  Message index (should be 00)
      bTeoPrologue              : Byte_Array (1 .. 3)
        := (others => 0);
      --  T=1 block prologue field to use (filled with 00)
      ulDataLength              : Interfaces.Unsigned_32;
      --  Length of Data to be sent to the ICC
      abData                    : Byte_Array (1 .. MAX_BUFFER_SIZE)
        := (others => 0);
      --  Data to send to the ICC
   end record;

   for PIN_VERIFY_STRUCTURE use record
      bTimerOut                 at 0  range 0 .. 7;
      bTimerOut2                at 1  range 0 .. 7;
      bmFormatString            at 2  range 0 .. 7;
      bmPINBlockString          at 3  range 0 .. 7;
      bmPINLengthFormat         at 4  range 0 .. 7;
      wPINMaxExtraDigit         at 5  range 0 .. 15;
      bEntryValidationCondition at 7  range 0 .. 7;
      bNumberMessage            at 8  range 0 .. 7;
      wLangId                   at 9  range 0 .. 15;
      bMsgIndex                 at 11 range 0 .. 7;
      bTeoPrologue              at 12 range 0 .. 23;
      ulDataLength              at 15 range 0 .. 31;
      abData                    at 19 range 0 .. (MAX_BUFFER_SIZE * 8) - 1;
   end record;
   --  Representation clause for PIN_VERIFY_STRUCTURE type

end PCSC.Thin.Reader;