p11-kit-0.20.2/0000775000175000017500000000000012265245672007777 500000000000000p11-kit-0.20.2/po/0000775000175000017500000000000012265245674010417 500000000000000p11-kit-0.20.2/po/wa.gmo0000664000175000017500000000101312265245674011445 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Walloon (http://www.transifex.com/projects/p/freedesktop/language/wa/) Language: wa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); p11-kit-0.20.2/po/wa.po0000664000175000017500000001560112265245673011310 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Walloon (http://www.transifex.com/projects/p/freedesktop/" "language/wa/)\n" "Language: wa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/zh_CN.po0000664000175000017500000001553712265245673011712 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese (China) \n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/hr.po0000664000175000017500000002324012265245673011310 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Tomislav Krznar , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-10-04 20:37+0000\n" "Last-Translator: Tomislav Krznar \n" "Language-Team: Croatian \n" "Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Operacija je otkazana" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Nema dovoljno memorije" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "Identifikator navedenog utora nije ispravan" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Interna greška" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Operacija nije uspjela" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Neispravni argumenti" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "Modul ne može stvoriti potrebne dretve" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "Modul ne može pravilno zaključati podatke" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Polje ima dozvole samo za čitanje" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Polje je osjetljivo i ne može se prikazati" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Polje ne postoji ili nije ispravno" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Neispravna vrijednost za polje" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Podaci nisu prepoznati ili nisu ispravni" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Podaci su predugački" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Došlo je do pogreške na uređaju" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Nema dovoljno memorije na uređaju" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Uređaj je uklonjen" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "Kriptirani podaci nisu prepoznati ili nisu ispravni" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Kriptirani podaci su predugački" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Ova operacija nije podržana" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Nema ključa ili nije ispravan" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "Ključ je pogrešne veličine" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "Ključ je pogrešne vrste" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Ključ nije potreban" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "Ključ se razlikuje od prethodnog" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Potreban je ključ" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Ne mogu uključiti ključ u kontrolnu sumu" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Ova operacija se ne može izvršiti s ovim ključem" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "Sadržaj ključa se ne može prelomiti u više redaka" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Ne mogu izvesti ključ" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "Mehanizam kriptiranja nije prepoznat ili nije ispravan" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Mehanizam kriptiranja ima neispravan argument" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Nedostaje objekt ili nije ispravan" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Već se izvršava druga operacija" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Ne izvršava se niti jedna operacija" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Lozinka ili PIN su pogrešni" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Lozinka ili PIN nisu ispravni" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Lozinka ili PIN nemaju ispravnu duljinu" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Lozinki ili PIN-u je istekao rok trajanja" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Lozinka ili PIN su zaključani" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "Sjednica je zatvorena" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Previše sjednica je aktivno" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "Sjednica nije ispravna" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "Sjednica je samo za čitanje" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Postoji otvorena sjednica" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Postoji sjednica samo za čitanje" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Postoji administratorska sjednica" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "Potpis je neispravan ili oštećen" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "Potpis nije prepoznat ili je oštećen" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Nedostaju neka nužna polja" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Neka polja imaju neispravne vrijednosti" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Uređaj nije prisutan ili je iskopčan" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Uređaj je neispravan ili neprepoznat" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Uređaj ima zaštitu pisanja" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Ne mogu uvesti zbog neispravnog ključa" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Ne mogu uvesti zbog ključa pogrešne veličine" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Ne mogu uvesti zbog ključa pogrešne vrste" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Već ste prijavljeni" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Nijedan korisnik nije prijavljen" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "Korisnička lozinka ili PIN nisu postavljeni" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "Vrsta korisnika nije ispravna" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Drugi korisnik je već prijavljen" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Prijavljeno je previše korisnika različitih vrsta" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Ne mogu uvesti neispravan ključ" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Ne mogu uvesti ključ pogrešne veličine" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Ne mogu izvesti neispravan ključ" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Ne mogu izvesti ključ pogrešne veličine" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Ne mogu izvesti ključ pogrešne vrste" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Ne mogu inicijalizirati generator slučajnih brojeva" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Nema dostupnih generatora slučajnih brojeva" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Mehanizam kriptiranja ima neispravan parametar" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Nema dovoljno prostora za spremanje rezultata" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "Spremljeno stanje nije ispravno" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Informacije su osjetljive i ne mogu se prikazati" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Stanje se ne može spremiti" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "Modul nije inicijaliziran" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Modul je već inicijaliziran" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Ne mogu zaključati podatke" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Podaci se ne mogu zaključati" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "Korisnik je odbio zahtjev za potpisivanje" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Nepoznata greška" p11-kit-0.20.2/po/eu.gmo0000664000175000017500000000101312265245673011446 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Basque (http://www.transifex.com/projects/p/freedesktop/language/eu/) Language: eu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/th.po0000664000175000017500000001557012265245673011321 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Thai (http://www.transifex.com/projects/p/freedesktop/" "language/th/)\n" "Language: th\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/he.gmo0000664000175000017500000000101312265245673011431 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Hebrew (http://www.transifex.com/projects/p/freedesktop/language/he/) Language: he MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/lt.gmo0000664000175000017500000000111612265245674011461 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Lithuanian (http://www.transifex.com/projects/p/freedesktop/language/lt/) Language: lt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2); p11-kit-0.20.2/po/el.gmo0000664000175000017500000000101212265245673011434 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Greek (http://www.transifex.com/projects/p/freedesktop/language/el/) Language: el MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/gl.gmo0000664000175000017500000001761512265245673011456 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\"*$M!r&)-9.=h#9/64Ak?)!)9 c$7 %,:;g%1985?n!)37H0+7&$<a,{0%!D,f2!%9Q"n#$3.F_&z/(!6<6s<<!^pD KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-04-14 18:34+0000 Last-Translator: Fran Diéguez Language-Team: Galician Language: gl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Precísase unha chaveExiste unha sesión de só lecturaExiste unha sesión de administradorProduciuse un erro no dispositivoExiste unha sesión abertaXa se esta executando outra operaciónXa hai outro usuario coa sesión iniciadaNon é posíbel a chave porque non é válidaNon é posíbel a chave porque ten un tamaño incorrecto Non é posíbel exportar a chave porque é do tipo incorrectoNon é posíbel exportar esta chaveNon é posíbel importar unha chave de tamaño incorrectoNon é posíble importar unha chave non válidaNon é posíbel importar porque a chave non é válidaNon é posíbel importar a chave xa que ten un tamaño incorrectoNon é posíbel importar porque a chave ten un tipo non válidoNon é posíbel incluir a chave no digestNon é posíbel bloquear os datosCertos campos teñen valores non válidosFaltan algúns campos requiridosNon hai memoria dispoñíbel dabondoA memoria dispoñíbel no dispositivo non é suficienteErro internoArgumentos non válidosValor non válido para o campoNon se precisa chaveNon se está levando a cabo outra operaciónNon hai ningún xerador de números aleatorios dispoñíbelNon hai usuarios coa sesión iniciadaNon hai espazo dabondo para almacenar o resultadoO mecanismo de criptografía ten un argumento non válidoO mecanismo criptográfico ten un parámetro non válidoO mecanismo de criptografía non é válida ou non se recoñeceNon é posíbel bloquear os datosO dato non é válido ou non se recoñeceO dato é demasiado longoO dispositivo non é válido ou non está conectadoO dispositivo non está presente ou non está conectadoO dispositivo está protexido contra a escrituraO dispositivo foi extraído ou desconectadoOs datos cifrados non son válidos ou non se recoñecenOs datos cifrados son demasiado longosO campo non é válido ou non existeO campo é de só lecturaO campo é sensíbel e non pode ser reveladoA información é sensíbel e non pode revelarseA chave non pode envolverseA chave cambiouFalta a chave ou non é válidaA chave é dun tipo incorrectoA chave ten un tamaño incorrectoO módulo non pode crear os fíos necesariosO módulo non pode bloquear os datos correctamenteO módulo xa foi inicializadoO módulo non foi inicializadoO obxecto falta ou non é válidoOperacción falladaCancelouse a operaciónO contrasinal ou PIN expirouO contrasinal ou PIN é incorrectoO contrasinal ou PIn non é válidoO contrasinal ou PIN está bloqueadoO contrasinal ou PIN ten unha lonxitude non válidaO estado gardado non é válidoA sesión está pechadaA sesión non é válidaA sesión é e só lecturaA sinatura é mala ou está corrompidaA sinatura non se recoñece ou está corrompidaO ID de slot especificado non é válidoNon é posíbel gardar o estadoO usuario ten un tipo non válidoO contrasinal ou PIN do usuario non está estabelecidoEsta operación non pode levarse a cabo con esta chaveEsta operación non se admiteDemasiadas sesións activasHai varios usuarios de tipos diferentes coa sesión iniciadaNon é posíbel inicializar o xerador de números aleatoriosErro descoñecidoXa ten unha sesión iniciadap11-kit-0.20.2/po/vi.gmo0000664000175000017500000000101012265245674011451 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Vietnamese (http://www.transifex.com/projects/p/freedesktop/language/vi/) Language: vi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; p11-kit-0.20.2/po/vi.po0000664000175000017500000001557612265245673011332 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Vietnamese (http://www.transifex.com/projects/p/freedesktop/" "language/vi/)\n" "Language: vi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/pt_BR.po0000664000175000017500000002405012265245673011705 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Rafael Ferreira , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-04-01 03:48+0000\n" "Last-Translator: Rafael Ferreira \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" "freedesktop/language/pt_BR/)\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "A operação foi cancelada" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Memória insuficiente disponível" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "O ID do slot especificado não é válido" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Erro interno" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "A operação falhou" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Argumentos inválidos" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "O módulo não pode criar threads necessárias" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "O módulo não pode travar os dados da forma apropriada" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "O campo é somente leitura" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "O campo é sensitivo e não pode ser revelado" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "O campo é inválido ou não existe" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Valor inválido para o campo" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Os dados não são válidos ou irreconhecíveis" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Os dados são muito longos" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Um erro ocorreu no dispositivo" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Memória insuficiente disponível no dispositivo" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "O dispositivo foi removido ou desconectado" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "Os dados criptografados não são válidos ou são irreconhecíveis" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Os dados criptografados são muito longos" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "A operação não é suportada" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "A chave está faltando ou é inválido" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "A chave possui tamanho incorreto" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "A chave possui tipo incorreto" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Nenhuma chave é necessária" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "A chave é diferente da anterior" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Uma chave é necessária" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Falha na inclusão da chave no digest" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Essa operação não pode ser executada com esta chave" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "A chave não pode ser ajustada" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Não pode exportar essa chave" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "O mecanismo de criptografia é inválido ou irreconhecível" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "O mecanismo de criptografia tem um argumento inválido" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "O objeto está faltando ou inválido" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Outra operação já está em execução" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Nenhuma operação está em execução" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "A senha ou PIN é incorreta" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "A senha ou PIN é inválida" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "A senha ou PIN possui um comprimeto inválido" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "A senha ou PIN expirou" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "A senha ou PIN está travada" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "A sessão está fechada" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Sessões demais estão ativas" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "A sessão é inválida" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "A sessão é somente leitura" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Uma sessão aberta existe" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Uma sessão somente leitura existe" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Uma sessão de administração existe" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "A assinatura está ruim ou corrompida" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "A assinatura está irreconhecível ou corrompida" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Certos campos necessários estão faltando" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Certos campos possuem valores inválidos" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "O dispositivo não está presente ou está desconectado" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "O dispositivo é inválido ou irreconhecível" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "O dispositivo está protegido contra gravação" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Não é possível importar porque a chave é inválida" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Não é possível importar porque a chave possui tamanho incorreto" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Não é possível importar porque a chave é do tipo incorreto" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Você já está conectado" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Nenhum usuário está conectado" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "A senha do usuário ou PIN não foi definida" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "O usuário é de um tipo inválido" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Outro usuário já está conectado" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Usuários demais de diferentes tipos estão conectados" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Não é possível importar uma chave inválida" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Não é possível importar uma chave do tamanho incorreto" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Não é possível exportar porque a chave é inválida" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Não é possível exportar porque a chave é do tamanho errado" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Não é possível exportar porque a chave é do tipo errado" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Não conseguiu inicializar o gerador de número aleatório" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Nenhum gerador de número aleatório disponível" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "O mecanismo de criptografia possui um parâmetro inválido" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Não há espaço suficiente para armazenar o resultado" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "O estado salvado é inválido" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "A informação é sensível e não pode ser revelada" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "O estado não pode ser salvado" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "O módulo não foi inicializado" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "O módulo já foi inicializado" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Não é possível travar os dados" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Os dados não podem ser travados" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "A requisição de assinatura foi rejeitado pelo usuário" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Erro desconhecido" p11-kit-0.20.2/po/sq.gmo0000664000175000017500000000101512265245674011463 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Albanian (http://www.transifex.com/projects/p/freedesktop/language/sq/) Language: sq MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/es.po0000664000175000017500000002414612265245672011313 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Adolfo Jayme Barrientos , 2012. # Daniel Mustieles , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-08-27 16:15+0000\n" "Last-Translator: Daniel Mustieles \n" "Language-Team: Spanish (http://www.transifex.com/projects/p/freedesktop/" "language/es/)\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Se canceló la operación" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "No hay suficiente memoria disponible" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "El ID de la ranura especificada no es válido" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Error interno" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Falló la operación" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Argumentos no válidos" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "El módulo no puede crear los hilos necesarios" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "El módulo no puede bloquear los datos correctamente" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "El campo es de solo lectura" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "El campo es sensible y no se puede revelar" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "El campo no es válido o no existe" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Valor no válido para el campo" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Los datos no son válidos o no se reconocen" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Los datos son demasiado largos" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Ha ocurrido un error en el dispositivo" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "No hay memoria suficiente disponible en el dispositivo" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Se quitó o desconectó el dispositivo" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "Los datos cifrados no son válidos o no se reconocen" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Los datos cifrados son demasiado largos" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Esta operación no está soportada" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Falta la clave o no es válida" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "El tamaño de la clave es incorrecto" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "El tipo de la clave es incorrecto" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "No se necesita ninguna clave" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "La clave no es igual que antes" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Se necesita una clave" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "No se puede incluir la clave en el resumen" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "No se puede hacer esta operación con esta clave" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "No se puede encapsular la clave" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "No se puede exportar esta clave" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "El mecanismo de cifrado no es válido o no se ha reconocido" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "El mecanismo de cifrado tiene un argumento no válido" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Falta el objeto o no es válido" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Ya hay otra operación en curso" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "No hay ninguna operación en curso" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "La contraseña o el PIN son incorrectos" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "La contraseña o el PIN no son válidos" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "La contraseña o PIN tiene una longitud no válida" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "La contraseña o el PIN han expirado" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "La contraseña o el PIN están bloqueados" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "La sesión está cerrada" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Hay demasiadas sesiones activas" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "La sesión no es válida" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "La sesión es de solo lectura" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Existe una sesión abierta" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Existe una sesión de solo lectura" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Existe una sesión de administrador" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "La firma tiene errores o está dañada" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "La firma no se reconoce o está dañada" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Faltan ciertos campos requeridos" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Ciertos campos tienen valores no válidos" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "El dispositivo no está presente o está desconectado" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "El dispositivo no es válido o es irreconocible" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "El dispositivo está protegido contra escritura" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "No se puede importar porque la clave no es válida" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "No se puede importar porque la clave tiene un tamaño incorrecto" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "No se puede importar porque la clave es de un tipo incorrecto" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Ya ha iniciado sesión" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Ningún usuario ha iniciado sesión" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "La contraseña o el PIN del usuario no se han establecido" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "El usuario es de un tipo no válido" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Ya ha iniciado sesión otro usuario" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Han iniciado sesión demasiados usuarios de varios tipos" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "No se puede importar una clave no válida" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "No se puede importar una clave del tamaño incorrecto" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "No se puede exportar poque la clave no es válida" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "No se puede exportar porque la clave tiene un tamaño incorrecto" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "No se puede exportar porque la clave es del tipo incorrecto" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "No se puede inicializar el generador de números aleatorios" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "No hay ningún generador de números aleatorios disponible" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "El mecanismo de cifrado tiene un parámetro no válido" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "No hay espacio suficiente para guardar el resultado" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "El estado guardado no es válido" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "La información es sensible y no se puede revelar" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "No se puede guardar el estado" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "No se ha inicializado el módulo" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Ya se ha inicializado el módulo" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "No se pueden bloquear los datos" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "No se pueden bloquear los datos" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "El usuario rechazó la solicitud de firma" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Error desconocido" p11-kit-0.20.2/po/fa.gmo0000664000175000017500000000100512265245673011424 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Persian (http://www.transifex.com/projects/p/freedesktop/language/fa/) Language: fa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; p11-kit-0.20.2/po/pa.po0000664000175000017500000003044712265245673011306 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # A S Alam , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-08-07 02:16+0000\n" "Last-Translator: A S Alam \n" "Language-Team: Panjabi (Punjabi) (http://www.transifex.com/projects/p/" "freedesktop/language/pa/)\n" "Language: pa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "ਕਾਰਵਾਈ ਰੱਦ ਕੀਤੀ ਗਈ" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਉਪਲੱਬਧ ਨਹੀਂ" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "ਦਿੱਤੀ ਸਲਾਟ ID ਉਪਲੱਬਧ ਨਹੀਂ" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "ਅੰਦਰੂਨੀ ਗਲਤੀ" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "ਕਾਰਵਾਈ ਫੇਲ੍ਹ ਹੋਈ" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "ਗਲਤ ਆਰਗੂਮੈਂਟ" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "ਮੋਡੀਊਲ ਲੋੜੀਦੇ ਥਰਿੱਡ ਨਹੀਂ ਬਣਾ ਸਕਦਾ ਹੈ" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "ਮੋਡੀਊਲ ਲਾਕ ਡਾਟਾ ਠੀਕ ਤਰ੍ਹਾਂ ਨਹੀਂ ਕਰ ਸਕਦਾ ਹੈ" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "ਖੇਤਰ ਕੇਵਲ ਪੜ੍ਹਨ ਲਈ ਹੈ" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "ਖੇਤਰ ਗਲਤ ਹੈ ਜਾਂ ਮੌਜੂਦ ਨਹੀਂ ਹੈ" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "ਖੇਤਰ ਲਈ ਗਲਤ ਮੁੱਲ" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "ਡਾਟਾ ਗਲਤ ਹੈ ਜਾਂ ਪਛਾਣਿਆ ਨਹੀਂ ਜਾ ਸਕਦਾ" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "ਡਾਟਾ ਬਹੁਤ ਲੰਮਾ ਹੈ" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "ਜੰਤਰ ਉੱਤੇ ਗਲਤੀ ਆਈ ਹੈ" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "ਜੰਤਰ ਉੱਤੇ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈ" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "ਜੰਤਰ ਹਟਾਇਆ ਗਿਆ ਜਾਂ ਪਲੱਗ ਕੱਢਿਆ" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "ਇੰਕ੍ਰਿਪਟ ਕੀਤਾ ਡਾਟਾ ਠੀਕ ਨਹੀਂ ਜਾਂ ਪਛਾਣ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "ਇੰਕ੍ਰਿਪਟ ਕੀਤਾ ਡਾਟਾ ਬਹੁਤ ਲੰਮਾ ਹੈ" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "ਇਹ ਕਾਰਵਾਈ ਸਹਾਇਕ ਨਹੀਂ ਹੈ" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "ਕੁੰਜੀ ਮੌਜੂਦ ਨਹੀਂ ਜਾਂ ਗਲਤ ਹੈ" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "ਕੁੰਜੀ ਦਾ ਆਕਾਰ ਗਲਤ ਹੈ" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "ਕੁੰਜੀ ਦੀ ਕਿਸਮ ਗਲਤ ਹੈ" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "ਕਿਸੇ ਕੁੰਜੀ ਦੀ ਲੋੜ ਨਹੀਂ ਹੈ" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "ਕੁੰਜੀ ਪਹਿਲਾਂ ਤੋਂ ਵੱਖਰੀ ਹੈ" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "ਕੁੰਜੀ ਦੀ ਲੋੜ ਹੈ" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "ਇਹ ਕਾਰਵਾਈ ਇਸ ਕੁੰਜੀ ਨਾਲ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ ਹੈ" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "ਇਹ ਕੁੰਜੀ ਐਕਸਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "ਕ੍ਰਿਪਟੂ ਢੰਗ ਗਲਤ ਜਾਂ ਬੇਪਛਾਣ ਹੈ" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "ਕ੍ਰਿਪਟੂ ਢੰਗ ਵਿੱਚ ਗਲਤ ਆਰਗੂਮੈਂਟ ਹੈ" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "ਆਬਜੈਕਟ ਗੁੰਮ ਹੈ ਜਾਂ ਗਲਤ ਹੈ" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "ਹੋਰ ਕਾਰਵਾਈ ਪਹਿਲਾਂ ਹੀ ਜਾਰੀ ਹੈ" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "ਕੋਈ ਕਾਰਵਾਈ ਜਾਰੀ ਨਹੀਂ ਹੈ" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "ਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਗਲਤ ਹੈ" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "ਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਅਵੈਧ ਹੈ" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "ਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਦੀ ਲੰਬਾਈ ਗਲਤ ਹੈ" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "ਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਦੀ ਮਿਆਦ ਪੁੱਗ ਚੁੱਕੀ ਹੈ" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "ਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਲਾਕ ਹੈ" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "ਸ਼ੈਸ਼ਨ ਬੰਦ ਹੈ" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "ਬਹੁਤ ਸਾਰੇ ਸ਼ੈਸ਼ਨ ਐਕਟਿਵ ਹਨ" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "ਸ਼ੈਸ਼ਨ ਗਲਤ ਹੈ" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "ਸ਼ੈਸ਼ਨ ਕੇਵਲ ਪੜ੍ਹਨ ਲਈ ਹ" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "ਖੁੱਲ੍ਹਾ ਸ਼ੈਸ਼ਨ ਮੌਜੂਦ ਹੈ" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "ਕੇਵਲ ਪੜ੍ਹਨ ਵਾਲਾ ਸ਼ੈਸ਼ਨ ਮੌਜੂਦ ਹੈ" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "ਪਰਸ਼ਾਸ਼ਕੀ ਸ਼ੈਸ਼ਨ ਮੌਜੂਦ ਹੈ" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "ਦਸਤਖਤ ਖ਼ਰਾਬ ਜਾਂ ਨਿਕਾਰਾ ਹਨ" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "ਦਸਤਖਤ ਬੇਪਛਾਣ ਜਾਂ ਨਿਕਾਰਾ ਹਨ" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "ਕੁਝ ਲੋੜੀਦੇ ਖੇਤਰ ਗੁੰਮ ਹਨ" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "ਕੁਝ ਖੇਤਰਾਂ ਵਿੱਚ ਗਲਤ ਮੁੱਲ ਹਨ" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "ਜੰਤਰ ਮੌਜੂਦ ਨਹੀਂ ਜਾਂ ਪਲੱਗ ਕੱਢਿਆ ਹੋਇਆ ਹੈ" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "ਜੰਤਰ ਗਲਤ ਜਾਂ ਬੇਪਛਾਣ ਹੈ" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "ਜੰਤਰ ਲਿਖਣ ਤੋਂ ਸੁਰੱਖਿਅਤ ਹੈ" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "ਇੰਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਗਲਤ ਹੈ" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "ਇੰਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਦਾ ਆਕਾਰ ਗਲਤ ਹੈ" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "ਇੰਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਦੀ ਕਿਸਮ ਗਲਤ ਹੈ" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "ਤੁਸੀਂ ਪਹਿਲਾਂ ਹੀ ਲਾਗਇਨ ਹੋ" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "ਕੋਈ ਯੂਜ਼ਰ ਲਾਗਇਨ ਨਹੀਂ ਹੈ" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "ਯੂਜ਼ਰ ਦਾ ਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਸੈੱਟ ਨਹੀਂ ਹੈ" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "ਯੂਜ਼ਰ ਦੀ ਕਿਸਮ ਗਲਤ ਹੈ" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "ਹੋਰ ਯੂਜ਼ਰ ਪਹਿਲਾਂ ਹੀ ਲਾਗਇਨ ਹੈ" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "ਗਲਤ ਕੁੰਜੀ ਇੰਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "ਗਲਤ ਆਕਾਰ ਦੀ ਕੁੰਜੀ ਇੰਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "ਐਕਸਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਗਲਤ ਹੈ" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "ਐਕਸਪੋਰਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਦਾ ਆਕਾਰ ਗਲਤ ਹੈ" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "ਐਕਸਪੋਰਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਦੀ ਗਲਤ ਕਿਸਮ ਹੈ" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "ਰੈਂਡਮ ਨੰਬਰ ਜਰਨੇਟਰ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਅਸਮਰੱਥ" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "ਕੋਈ ਰੈਂਡਮ ਨੰਬਰ ਜਰਨੇਟਰ ਉਪਲੱਬਧ ਨਹੀਂ" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "ਨਤੀਜਾ ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਥਾਂ ਨਹੀਂ ਹੈ" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "ਸੰਭਾਲੀ ਹਾਲਤ ਗਲਤ ਹੈ" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "ਹਾਲਤ ਸੰਭਾਲੀ ਨਹੀਂ ਜਾ ਸਕਦੀ" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "ਮੋਡੀਊਲ ਸ਼ੁਰੂ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "ਮੋਡੀਊਲ ਪਹਿਲਾਂ ਹੀ ਸ਼ੁਰੂ ਕੀਤਾ ਜਾ ਚੁੱਕਾ ਹੈ" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "ਡਾਟਾ ਲਾਕ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "ਡਾਟਾ ਲਾਕ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "ਅਣਜਾਣ ਗਲਤੀ" p11-kit-0.20.2/po/sr@latin.gmo0000664000175000017500000000115212265245674012616 00000000000000$,809Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Serbian (Latin) (http://www.transifex.com/projects/p/freedesktop/language/sr@latin/) Language: sr@latin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); p11-kit-0.20.2/po/ca@valencia.gmo0000664000175000017500000000105212265245673013226 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Catalan (Valencian) (http://www.transifex.com/projects/p/freedesktop/language/ca@valencia/) Language: ca@valencia MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/eo.po0000664000175000017500000001644312265245672011310 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-04-01 19:14+0000\n" "Last-Translator: kristjan \n" "Language-Team: Esperanto (http://www.transifex.com/projects/p/freedesktop/" "language/eo/)\n" "Language: eo\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "La operacio estas nuligita" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Ne sufiĉe da memoro estas disponebla" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Interna eraro" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "La operacio malsukcesis" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Nevalidaj argumentoj" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "La kampo estas nevalida aŭ ne ekzistas" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Nevalida valoro por kampo" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "La datumo estas tro longa" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Eraro okazis je aparato" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Ŝlosilo estas bezonata" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "La seanco estas nevalida" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Neniu uzanto estas ensalutita" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Alia uzanto jam estas ensalutita" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Nekonata eraro" p11-kit-0.20.2/po/pl.po0000664000175000017500000002415112265245673011314 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Piotr Drąg , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-03-10 20:27+0000\n" "Last-Translator: Piotr Drąg \n" "Language-Team: Polish (http://www.transifex.com/projects/p/freedesktop/" "language/pl/)\n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Anulowano działanie" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Brak wystarczającej ilości pamięci" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "Podany identyfikator gniazda jest nieprawidłowy" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Wewnętrzny błąd" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Działanie się nie powiodło" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Nieprawidłowe parametry" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "Moduł nie może utworzyć wymaganych wątków" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "Moduł nie może poprawnie zablokować danych" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Pole jest tylko do odczytu" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Pole jest prywatne i nie może zostać ujawnione" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Pole jest nieprawidłowe lub nie istnieje" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Nieprawidłowa wartość dla pola" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Dane są nieprawidłowe lub nierozpoznane" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Dane są za długie" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Wystąpił błąd na urządzeniu" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Dostępna jest niewystarczająca ilość pamięci na urządzeniu" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Urządzenie zostało usunięte lub rozłączone" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "Zaszyfrowane dane są nieprawidłowe lub nierozpoznane" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Zaszyfrowane dane są za długie" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "To działanie nie jest obsługiwane" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Brak klucza lub jest nieprawidłowy" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "Klucz ma błędny rozmiar" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "Klucz jest błędnego typu" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Klucz nie jest wymagany" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "Klucz jest inny niż poprzednio" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Wymagany jest klucz" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Nie można dołączyć klucza w wyciągu" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "To działanie nie może zostać wykonane za pomocą tego klucza" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "Nie można opakować klucza" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Nie można wyeksportować tego klucza" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "Mechanizm kryptograficzny jest nieprawidłowy lub nierozpoznany" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Mechanizm kryptograficzny posiada nieprawidłowy parametr" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Brak obiektu lub jest nieprawidłowy" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Inne działanie jest teraz wykonywane" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Żadne działanie nie jest wykonywane" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Hasło lub kod PIN jest niepoprawny" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Hasło lub kod PIN jest nieprawidłowy" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Hasło lub kod PIN ma nieprawidłową długość" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Hasło lub kod PIN wygasł" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Hasło lub kod PIN jest zablokowany" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "Sesja jest zamknięta" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Za dużo sesji jest aktywnych" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "Sesja jest nieprawidłowa" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "Sesja jest tylko do odczytu" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Istnieje otwarta sesja" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Istnieje sesja tylko do odczytu" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Istnieje sesja administratora" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "Podpis jest błędny lub uszkodzony" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "Podpis jest nierozpoznany lub uszkodzony" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Brak pewnych wymaganych pól" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Pewne pola zawierają nieprawidłowe wartości" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Urządzenie nie jest obecne lub jest odłączone" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Urządzenie jest nieprawidłowe lub nierozpoznane" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Urządzenie jest chronione przed zapisem" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Nie można zaimportować, ponieważ klucz jest nieprawidłowy" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Nie można zaimportować, ponieważ klucz ma błędny rozmiar" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Nie można zaimportować, ponieważ klucz jest błędnego typu" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Użytkownik jest już zalogowany" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Żaden użytkownik nie jest zalogowany" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "Hasło lub kod PIN użytkownika nie jest ustawiony" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "Użytkownik jest nieprawidłowego typu" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Inny użytkownik jest już zalogowany" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Za dużo użytkowników różnych typów jest zalogowanych" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Nie można zaimportować nieprawidłowego klucza" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Nie można zaimportować klucza o błędnym rozmiarze" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Nie można wyeksportować, ponieważ klucz jest nieprawidłowy" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Nie można wyeksportować, ponieważ klucz ma błędny rozmiar" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Nie można wyeksportować, ponieważ klucz jest błędnego typu" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Nie można zainicjować generatora liczb losowych" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Brak dostępnych generatorów liczb losowych" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Mechanizm kryptograficzny posiada nieprawidłowy parametr" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Brak wystarczającej ilości miejsca, by przechować wynik" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "Zapisany stan jest nieprawidłowy" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Informacja jest prywatna i nie może zostać ujawniona" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Nie można zapisać stanu" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "Moduł nie został zainicjowany" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Moduł został już zainicjowany" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Nie można zablokować danych" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Nie można zablokować danych" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "Żądanie podpisu zostało odrzucone przez użytkownika" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Nieznany błąd" p11-kit-0.20.2/po/nl.po0000664000175000017500000002402312265245673011310 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Richard E. van der Luit , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-04-18 16:10+0000\n" "Last-Translator: Richard E. van der Luit \n" "Language-Team: Dutch (http://www.transifex.com/projects/p/freedesktop/" "language/nl/)\n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "De bewerking werd afgebroken" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Onvoldoende geheugen beschikbaar" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "De opgegeven slot ID is niet geldig" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Interne fout" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "De bewerking mislukte" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Ongeldige argumenten" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "De module kan de noodzakelijke threads niet aanmaken" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "De module kan de data niet naar behoren vergrendelen" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Het veld is alleen-lezen" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Het veld is vertrouwelijk en kan niet worden onthuld" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Het veld is ongeldig of bestaat niet" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Ongeldige waarde voor veld" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "De data is niet geldig of wordt niet herkend" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "De data is te lang" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Er trad een fout op bij het apparaat" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Onvoldoende geheugen op het apparaat beschikbaar" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Het apparaat werd verwijderd of afgekoppeld" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "De versleutelde data is niet geldig of wordt niet herkend" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "De versleutelde data is te lang" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Deze bewerking wordt niet ondersteund" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "De sleutel ontbreekt of is ongeldig" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "De sleutel heeft een verkeerde grootte" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "De sleutel is van het verkeerde type" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Er is geen sleutel nodig" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "De sleutel is anders dan voorheen" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Er is een sleutel nodig" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Kan geen sleutel in de digest opnemen" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Deze bewerking kan niet met deze sleutel uitgevoerd worden" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "Sleutelwrapping niet gelukt" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Kan deze sleutel niet exporteren" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "Het crypto mechanisme is ongeldig of wordt niet herkend" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Het crypto mechanisme heeft een ongeldig argument" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Het object mist of is ongeldig" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Er wordt al een andere bewerking uitgevoerd" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Er wordt momenteel geen bewerking uitgevoerd" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Het wachtwoord of PIN in incorrect" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Het wachtwoord of PIN is ongeldig" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Het wachtwoord of PIN heeft een ongeldige lengte" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Het wachtwoord of PIN is verlopen" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Het wachtwoord of PIN is vergrendeld" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "De sessie is afgesloten" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Er zijn te veel sessies actief" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "De sessie is ongeldig" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "De sessie is alleen-lezen" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Er is een open sessie" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Er is een alleen-lezen sessie" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Er is een beheerder sessie" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "De handtekening is fout of gecorrumpeerd" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "De handtekening wordt niet herkend of is gecorrumpeerd" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Sommige verplichte velden ontbreken" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Bepaalde velden hebben ongeldige waarden" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Het apparaat is niet aanwezig of afgekoppeld " #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Het apparaat is ongeldig of onherkenbaar" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Het apparaat is beveiligd tegen schrijven" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Kan niet importeren omdat de sleutel ongeldig is" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Kan niet importeren omdat de sleutel de verkeerde lengte heeft" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Kan niet importeren omdat de sleutel van het verkeerde type is" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "U bent reeds ingelogd" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Er is geen gebruiker ingelogd" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "Het wachtwoord of PIN van gebruiker is niet ingesteld" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "De gebruiker is van het verkeerde gebruikerstype" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Er is reeds een andere gebruiker ingelogd" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Er zijn te veel gebruikers van verschillende types ingelogd" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Kan geen ongeldige sleutel importeren" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Kan geen sleutel importeren van de verkeerde grootte" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Kan niet exporteren omdat de sleutel ongeldig is" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Kan niet exporteren omdat de sleutel de verkeerde grootte heeft" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Kan niet exporteren omdat de sleutel van het verkeerde type is" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Niet in staat de random-number-generator te initialiseren" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Geen random-number-generator beschikbaar" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Het crypto mechanisme heeft een ongeldige parameter" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Niet genoeg ruimte om het resultaat op te slaan" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "De opgeslagen status is ongeldig " #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "De informatie is vertrouwelijk en kan niet worden onthuld" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "De status kan niet opgeslagen worden" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "De module is niet geïnitialiseerd" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "De module is reeds geïnitialiseerd" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Kan data niet vergrendelen" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "De data kan niet vergrendeld worden" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "De handtekeningaanvraag werd door gebruiker afgewezen" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Onbekende fout" p11-kit-0.20.2/po/eo.gmo0000664000175000017500000000301712265245673011446 00000000000000 hiy!(&=dy  % %:Tr'    A key is neededAn error occurred on the deviceAnother user is already logged inInsufficient memory availableInternal errorInvalid argumentsInvalid value for fieldNo user has logged inThe data is too longThe field is invalid or does not existThe operation failedThe operation was cancelledThe session is invalidUnknown errorProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-04-01 19:14+0000 Last-Translator: kristjan Language-Team: Esperanto (http://www.transifex.com/projects/p/freedesktop/language/eo/) Language: eo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Ŝlosilo estas bezonataEraro okazis je aparatoAlia uzanto jam estas ensalutitaNe sufiĉe da memoro estas disponeblaInterna eraroNevalidaj argumentojNevalida valoro por kampoNeniu uzanto estas ensalutitaLa datumo estas tro longaLa kampo estas nevalida aŭ ne ekzistasLa operacio malsukcesisLa operacio estas nuligitaLa seanco estas nevalidaNekonata erarop11-kit-0.20.2/po/es_CL.po0000664000175000017500000001562012265245672011666 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Spanish (Chile) (http://www.transifex.com/projects/p/" "freedesktop/language/es_CL/)\n" "Language: es_CL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/p11-kit.pot0000664000175000017500000001550512265243753012253 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: p11-kit 0.20.2\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/ia.gmo0000664000175000017500000000102012265245674011425 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Interlingua (http://www.transifex.com/projects/p/freedesktop/language/ia/) Language: ia MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/de.po0000664000175000017500000002471412265245672011275 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Mario Blättermann , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2013-02-13 17:07+0000\n" "Last-Translator: Stef Walter \n" "Language-Team: German (http://www.transifex.com/projects/p/freedesktop/" "language/de/)\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Die Aktion wurde abgebrochen." #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Nicht genügend Speicher verfügbar" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "Die angegebene Slot-Kennziffer ist ungültig." #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Interner Fehler" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Die Aktion ist fehlgeschlagen." #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Ungültige Argumente" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "Das Modul kann nicht die benötigten Threads erzeugen." #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "Das Modul kann die Daten nicht ordnungsgemäß sperren." #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Das Feld hat nur Lesezugriff." #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Das Feld ist sensibel und kann nicht offengelegt werden." #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Das Feld ist ungültig oder es existiert nicht." #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Ungültiger Wert für Feld" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Die Daten sind ungültig oder konnten nicht erkannt werden." #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Die Daten sind zu lang." #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Auf dem Gerät trat ein Fehler auf." #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Auf dem Gerät ist nicht genügend Speicher verfügbar." #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Das Gerät wurde entfernt oder abgezogen." #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" "Die verschlüsselten Daten sind nicht gültig oder konnten nicht erkannt " "werden." #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Die verschlüsselten Daten sind zu lang." #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Diese Aktion wird nicht unterstützt." #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Der Schlüssel fehlt oder ist ungültig." #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "Der Schlüssel hat die falsche Größe." #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "Der Schlüssel ist vom falschen Typ." #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Es wird kein Schlüssel benötigt." #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "Der Schlüssel ist anders als vorher." #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Es wird ein Schlüssel benötigt." #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Der Schlüssel kann nicht in den Digest integriert werden." #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Diese Aktion kann nicht mit diesem Schlüssel durchgeführt werden." #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "Der Schlüssel kann nicht eingepackt werden." #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Dieser Schlüssel kann nicht exportiert werden." #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" "Der kryptografische Mechanismus ist ungültig oder konnte nicht erkannt " "werden." #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Der kryptografische Mechanismus hat ein ungültiges Argument." #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Das Objekt fehlt oder ist ungültig." #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Es findet bereits eine andere Aktion statt." #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Es findet keine Aktion statt." #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Das Passwort oder die PIN ist nicht korrekt." #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Das Passwort oder die PIN ist ungültig." #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Das Passwort oder die PIN hat eine ungültige Länge." #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Das Passwort oder die PIN ist abgelaufen." #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Das Passwort oder die PIN ist gesperrt." #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "Die Sitzung ist beendet." #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Es sind zu viele Sitzungen aktiv." #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "Die Sitzung ist ungültig." #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "Die Sitzung hat nur Lesezugriff." #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Es existiert eine offene Sitzung." #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Es existiert eine Sitzung mit reinem Lesezugriff." #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Es existiert eine Administratorsitzung." #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "Die Signatur ist falsch oder beschädigt." #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "Die Signatur wurde nicht erkannt oder ist beschädigt." #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Einige benötigte Felder fehlen." #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Einige Felder haben ungültige Werte." #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Das Gerät ist nicht vorhanden oder abgezogen." #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Das Gerät ist ungültig oder unbekannt." #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Das Gerät ist schreibgeschützt." #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Kann nicht importiert werden, da der Schlüssel ungültig ist" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Kann nicht importiert werden, da der Schlüssel die falsche Größe hat" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Kann nicht importiert werden, da der Schlüssel vom falschen Typ ist" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Sie sind bereits angemeldet." #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Kein Benutzer hat sich angemeldet." #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "Passwort oder PIN des Benutzers ist nicht gesetzt" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "Der Benutzer ist vom falschen Typ." #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Ein anderer Benutzer ist bereits angemeldet." #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Zu viele Benutzer unterschiedlicher Typen sind angemeldet." #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Ein ungültiger Schlüssel kann nicht importiert werden." #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Ein Schlüssel mit falscher Größe kann nicht importiert werden." #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Kann nicht exportiert werden, da der Schlüssel ungültig ist" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Kann nicht exportiert werden, da der Schlüssel die falsche Größe hat" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Kann nicht exportiert werden, da der Schlüssel vom falschen Typ ist" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Der Zufallszahlengenerator kann nicht initialisiert werden." #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Kein Zufallszahlengenerator verfügbar" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Der kryptografische Mechanismus hat einen ungültigen Parameter." #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Nicht genug Platz, um das Ergebnis zu speichern" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "Der gespeicherte Status ist ungültig." #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Die Information ist sensibel und kann nicht offengelegt werden." #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Der Status kann nicht gespeichert werden." #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "Das Modul wurde nicht initialisiert." #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Das Modul wurde bereits initialisiert." #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Daten können nicht gesperrt werden" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Die Daten können nicht gesperrt werden." #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "Die Signaturanfrage wurde vom Benutzer zurückgewiesen." #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Unbekannter Fehler" p11-kit-0.20.2/po/ta.gmo0000664000175000017500000000101212265245674011441 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Tamil (http://www.transifex.com/projects/p/freedesktop/language/ta/) Language: ta MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/insert-header.sin0000644000175000017500000000124012265207774013576 00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } p11-kit-0.20.2/po/Makevars0000664000175000017500000000337612162233754012034 00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Collabora Ltd. # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = p11-kit-0.20.2/po/nb.po0000664000175000017500000001561412265245673011304 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Norwegian Bokmål (http://www.transifex.com/projects/p/" "freedesktop/language/nb/)\n" "Language: nb\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/gu.gmo0000664000175000017500000000101512265245673011452 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Gujarati (http://www.transifex.com/projects/p/freedesktop/language/gu/) Language: gu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/sk.gmo0000664000175000017500000000104612265245674011461 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Slovak (http://www.transifex.com/projects/p/freedesktop/language/sk/) Language: sk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; p11-kit-0.20.2/po/tr.po0000664000175000017500000001647212265245673011335 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Necdet Yücel , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-05-14 06:26+0000\n" "Last-Translator: Necdet Yücel \n" "Language-Team: Turkish (http://www.transifex.com/projects/p/freedesktop/" "language/tr/)\n" "Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "İşlem iptal edildi" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Yeterli hafıza yok" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "İç hata" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "İşlem başarısız oldu" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Bu alan salt-okunur" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Veri çok uzun" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Anahtar gerekli değil" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Anahtar gerekli" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Parola veya PIN hatalı" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Parola veya PIN geçersiz" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Parola veya PIN geçersiz uzunlukta" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Parola veya PIN'in süresi geçmiş" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Parola veya PIN kilitli" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "Oturum kapatıldı" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Çok fazla aktif oturum var" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "Oturum geçersiz" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "Oturum salt-okunur" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "İmza kötü veya hatalı" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/ja.gmo0000664000175000017500000002136312265245674011442 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\66L*60*9A9{EB0><o06B?W3$9'*3RK*00[3?0B1?t$H"<>E{3HZ>-3!KNi!*06!U?w?63.<b!58,L;y5$$ 5 *T 6 ? . %!$D!Ji!<!*!*"HG"*""$"D KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-03-06 14:22+0000 Last-Translator: Tomoyuki KATO Language-Team: Japanese (http://www.transifex.com/projects/p/freedesktop/language/ja/) Language: ja MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; キーが必要です読み込み専用のセッションが存在します管理者セッションが存在しますデバイスにおいてエラーが発生しました開いているセッションが存在します他の操作がすでに起きています他のユーザーがすでにログインしていますキーが無効なためエクスポートできませんキーが誤った大きさのためエクスポートできませんキーが誤った形式のためエクスポートできませんこのキーをエクスポートできません不正な大きさのキーをインポートできません無効なキーをインポートできませんキーが無効なためインポートできませんキーの大きさが不正なためインポートできませんキーの形式が不正なためインポートできませんダイジェストにキーを含められませんデータをロックできません特定の必須項目が無効な値を持っています特定の必須項目がありません利用可能なメモリーが不足していますデバイスにおいて利用可能なメモリーが不足しています内部エラー無効な引数項目に対する無効な値キーは必要ありません発生している操作がありません利用可能な乱数生成器がありませんログインしているユーザーはいません結果を保存するために十分な領域がありません暗号化機能が無効な引数を持ちます暗号化機能が無効なパラメーターを持っています暗号化機能が無効です、または認識されませんデータがロックできませんデータが有効ではありません、または認識されませんデータが長すぎますデバイスが無効です、まあは認識されませんデバイスが存在しません、または取り外されましたデバイスが書き込み保護されていますデバイスが削除されました、または取り外されました暗号化されたデータが有効ではありません、または認識されません暗号化されたデータが長すぎます項目が無効です、または存在しません項目が読み込み専用です項目は大文字小文字を区別します、明らかにできません情報は大文字小文字を区別しますが、明らかにできませんキーをラップできませんキーが以前のものと異なりますキーがありません、または無効ですキーが誤った形式ですキーが誤った大きさですモジュールが必要なスレッドを作成できませんモジュールがデータを適切にロックできませんモジュールがすでに初期化されていますモジュールが初期化されませんでしたオブジェクトがありません、または無効です操作が失敗しました操作が取り消されましたパスワードまたは PIN が失効していますパスワードまたは PIN が正しくありませんパスワードまたは PIN が無効ですパスワードまたは PIN がロックされていますパスワードまたは PIN が不正な長さです保存された状態が無効ですセッションが終了しましたセッションが無効ですセッションが読み込み専用です署名が不正です、または破損しています署名が認識できません、または破損しています指定されたスロット ID が無効です状態が保存できませんユーザーが無効な種類ですユーザーのパスワードまたは PIN が設定されていませんこの操作はこのキーを用いて実行できませんこの操作はサポートされません有効なセッションが多すぎます異なる種類の多すぎるユーザーがログインしています乱数生成器を初期化できません未知のエラーすでにログインしていますp11-kit-0.20.2/po/ms.gmo0000664000175000017500000000100312265245674011454 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Malay (http://www.transifex.com/projects/p/freedesktop/language/ms/) Language: ms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; p11-kit-0.20.2/po/ar.gmo0000664000175000017500000000113612265245673011445 00000000000000$,8$9Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Arabic (http://www.transifex.com/projects/p/freedesktop/language/ar/) Language: ar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5; p11-kit-0.20.2/po/cs.gmo0000664000175000017500000000102212265245673011442 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Czech Language: cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; p11-kit-0.20.2/po/LINGUAS0000664000175000017500000000044512226763526011365 00000000000000# Set of available languages. ar as az bg bn_IN ca ca@valencia cs cy da de el en@boldquot en_GB en@quot eo es es_CL eu fa fi fo fr ga gl gu he hi hr hu ia id it it_IT ja ka kk kn ko lt lv ml mr ms nb nl nn or pa pl pt pt_BR ro ru sk sl sq sr sr@latin sv ta te th tr uk vi wa zh_CN zh_HK zh_TW p11-kit-0.20.2/po/eu.po0000664000175000017500000001560112265245672011311 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Basque (http://www.transifex.com/projects/p/freedesktop/" "language/eu/)\n" "Language: eu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/sv.gmo0000664000175000017500000000101412265245674011467 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Swedish (http://www.transifex.com/projects/p/freedesktop/language/sv/) Language: sv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/it.gmo0000664000175000017500000001772012265245674011466 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\,(D'm*$,52BhA#8+J5vBA*1\)x#3(=\u/%->;TC".&3@.t',6!/(Qz0:##%Ii$,3%$4$Y~$" #/Dt&$ ).Xu18#669mD KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2013-01-30 21:13+0000 Last-Translator: milo Language-Team: Italian (http://www.transifex.com/projects/p/freedesktop/language/it/) Language: it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); È richiesta una chiaveEsiste già una sessione in sola-letturaEsiste già una sessione amministratoreSi è verificato un errore sul dispositivoEsiste già una sessione apertaUn'altra operazione è già in corsoUn altro utente ha già effettuato l'accessoImpossibile esportare poiché la chiave non è validaImpossibile esportare poiché la chiave è della dimensione errataImpossibile esportare poiché la tipologia della chiave è errataImpossibile esportare questa chiaveImpossibile importare una chiave della dimensione errataImpossibile importare una chiave non validaImpossibile importare poiché la chiave non è validaImpossibile importare poiché la chiave è della dimensione errataImpossibile importare poiché la tipologia della chiave è errataImpossibile includere la chiave nel digestImpossibile bloccare i datiAlcuni campi presentano valori non validiMancano alcuni campi richiestiMemoria disponibile non sufficienteMemoria disponibile sul dispositivo non sufficienteErrore internoArgomenti non validiValore non valido per il campoNessuna chiave richiestaNessuna operazione in corsoNessun generatore di numeri casuali disponibileNessun utente ha effettuato l'accessoSpazio insufficiente per salvare il risultatoIl meccanismo di crittografia presenta un argomento non validoIl meccanismo di cifratura presenta un parametro non validoIl meccanismo di crittografia è non valido oppure non riconosciutoI dati non possono essere bloccatiI dati sono non validi oppure non riconosciutiI dati sono troppo lunghiIl dispositivo non è valido o non è riconoscibileIl dispositivo non è presente o è scollegatoIl dispositivo è protetto in scritturaIl dispositivo è stato rimosso o scollegatoI dati cifrati sono non validi oppure non riconosciutiI dati cifrati sono troppo lunghiIl campo non è valido oppure non esisteIl campo è a sola letturaIl campo è sensibile e non può essere mostratoLe informazioni sono private e non possono essere mostrateLa chiave non può essere terminataLa chiave è diversa rispetto primaLa chiave manca o non è validaIl tipo della chiave è erratoLa dimensione della chiave è errataIl modulo non può creare i thread richiestiIl modulo non può bloccare i dati in modo correttoIl modulo è già stato inizializzatoIl modulo non è stato inizializzatoManca l'oggetto oppure non è validoL'operazione non è riuscitaL'operazione è stata annullataLa password o il PIN è scadutoLa password o il PIN non è correttoLa password o il PIN non è validoLa password o il PIN è bloccatoLa password o il PIN è di lunghezza non validaLo stato salvato non è validoLa sessione è chiusaLa sessione non è validaLa sessione è in sola-letturaLa firma non è corretta o danneggiataLa firma è rovinata o non leggibileL'ID dello slot specificato non è validoImpossibile salvare lo statoL'utente è di tipo erratoLa password o il PIN dell'utente non è impostatoImpossibile eseguire questa operazione con questa chiaveQuesta operazione non è supportataTroppe sessioni attiveTroppi utenti di diversi tipi hanno eseguito l'accessoImpossibile inizializzare il generatore di numeri casualiErrore sconosciutoAccesso già eseguitop11-kit-0.20.2/po/ka.gmo0000664000175000017500000001041112265245674011433 00000000000000 +.=Ogx%/&C-Z  4 Pq" '.=.iln"E =h S ? \: ] A v7 ] O ;\ Y' O G GLaGA389l++>P=Q(     A key is neededAn error occurred on the deviceCannot export this keyInsufficient memory availableInternal errorInvalid argumentsInvalid value for fieldNo key is neededThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN is incorrectThe password or PIN is invalidThe session is closedThe session is invalidThe session is read-onlyThe specified slot ID is not validThis operation is not supportedUnknown errorProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-08-21 18:45+0000 Last-Translator: George Machitidze Language-Team: Georgian (http://www.transifex.com/projects/p/freedesktop/language/ka/) Language: ka MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; საჭიროა გასაღებიშეცდომა მოწყობილობაშიამ გასაღების დაექსპორტება შეუძლებელიახელმისაწვდომი მეხსიერება არასაკმარისიაშიდა შეცდომაარგუმენტები არასწორიაცვლადის მნიშვნელობა არასწორიაგასაღები არ არის საჭირომონაცემების დაბლოკვა შეუძლებელიამონაცემები არასწორია ან ამოუცნობიმონაცემები ძალიან დიდიადაშიფრული მონაცემები არასწორია ან ამოუცნოიდაშიფრული მონაცემები ძალიან დიდიაველი არასწორია ან არ არსებობსველი მხოლოდ კითხვადიაველი მგრძნობიარეა და მისი გამოტანა არ არის დაშვებულიგასაღები ძველისგან განსხვავდებაგასაღები არ არის ან არასწორიაგასაღები არასწორი ტიპისააგასაღები არასწორი ზომისააობიექტი არ არის ან არასწორიაოპერაცია ვერ განხორციელდაოპერაცია შეწყვეტილ იქნაპაროლი ან PIN მცდარიაპაროლი ან PIN არასწორიასესია დაკეტილიასესია არასწორიასესია მხოლოდ კითხვადიამითითებული სლოტის ID არასწორიაოპერაცია არ არის მხარდაჭერილიუცნობი შეცდომაp11-kit-0.20.2/po/zh_TW.gmo0000664000175000017500000000102412265245674012073 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/freedesktop/language/zh_TW/) Language: zh_TW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; p11-kit-0.20.2/po/ga.gmo0000664000175000017500000000106012265245673011426 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Irish (http://www.transifex.com/projects/p/freedesktop/language/ga/) Language: ga MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4); p11-kit-0.20.2/po/pt.gmo0000664000175000017500000000101712265245674011465 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Portuguese (http://www.transifex.com/projects/p/freedesktop/language/pt/) Language: pt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/da.po0000664000175000017500000002331312265245672011263 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Joe Hansen , 2013 msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2013-12-24 13:36+0000\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish (http://www.transifex.com/projects/p/freedesktop/" "language/da/)\n" "Language: da\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Handlingen blev afbrudt" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Der er ikke nok hukommelse" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "Det angivne slot-id er ikke gyldigt" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Intern fejl" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Handlingen mislykkedes" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Ugyldige parametre" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "Modulet kan ikke oprette krævede tråde" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "Modulet kan ikke låse data korrekt" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Feltet er skrivebeskyttet" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Feltet er sensitivt kan ikke afsløres" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Feltet er ugyldigt eller findes ikke" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Ugyldigt værdi for felt" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Dataene er ikke gyldige eller blev ikke genkendt" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Dataene er for lange" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Der opstod en fejl på enheden" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Utilstrækkelig tilgængelig hukommelse på enheden" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Enheden blev fjernet eller frakoblet" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "De krypterede data er ikke gyldige eller blev ikke genkendt" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "De krypterede data er for lange" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Denne handling er ikke understøttet" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Nøglen mangler eller er ugyldig" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "Nøglen har forkert størrelse" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "Nøglen har forkert type" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Ingen nøgle er krævet" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "Nøglen er anderledes end tidligere" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "En nøgle er krævet" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Kan ikke inkludere nøglen i sammendraget" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Denne handling kan ikke udføres med denne nøgle" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "Nøglen kan ikke omsluttes" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Kan ikke eksportere denne nøgle" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "Kryptomekanismen er ugyldig eller blev ikke genkendt" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Kryptomekanismen har en ugyldig parameter" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Objektet mangler eller er ugyldigt" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "En anden handling foregår allerede" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Der udføres ingen handling" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Adgangskoden eller PIN er ikke korrekt" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Adgangskoden eller PIN er ugyldig" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Adgangskoden eller PIN har forkert længde" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Adgangskoden eller PIN er udløbet" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Adgangskoden eller PIN er låst" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "Sessionen er låst" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "For mange sessioner er aktive" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "Sessionen er ugyldig" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "Sessionen er skrivebeskyttet" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Der findes en åben session" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Der findes en skrivebeskyttet session" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Der findes en administratorsession" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "Underskriften er ugyldig eller ødelagt" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "Underskriften kunne ikke genkendes eller er ødelagt" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Bestemte krævede felter mangler" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Bestemte felter har ugyldige værdier" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Enheden er ikke til stede eller frakoblet" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Enheden er ugyldig eller kan ikke genkendes" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Enheden er skrivebeskyttet" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Kan ikke importere da nøglen er ugyldig" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Kan ikke importere da nøglen har forkert størrelse" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Kan ikke importere da nøglen har forkert type" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Du er allerede logget ind" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Ingen bruger har logget ind" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "Brugerens adgangskode eller PIN er ikke angivet" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "Brugeren er af ugyldig type" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "En anden bruger er allerede logget ind" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "For mange brugere af forskellige typer er logget ind" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Kan ikke importere en ugyldig nøgle" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Kan ikke importere en nøgle med forkert størrelse" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Kan ikke eksportere da nøglen er ugyldig" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Kan ikke eksportere da nøglen har forkert størrelse" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Kan ikke eksportere da nøglen har forkert type" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Kan ikke initialisere oprettelsesprogrammet for vilkårlige tal" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Intet oprettelsesprogram for vilkårlige tal er tilgængeligt" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Kryptomekanismen har en ugyldig parameter" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Ikke nok plads til at lagre resultatet" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "Den lagrede tilstand er ugyldig" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Informationen er sensitiv og kan ikke afsløres" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Tilstanden kan ikke gemmes" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "Modulet er ikke blevet initialiseret" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Modulet er allerede blevet initialiseret" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Kan ikke låse data" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Dataene kan ikke låses" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "Forespørgslen blev afvist af brugeren" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Ukendt fejl" p11-kit-0.20.2/po/ro.po0000664000175000017500000001565712265245673011334 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Romanian (http://www.transifex.com/projects/p/freedesktop/" "language/ro/)\n" "Language: ro\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" "2:1));\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/uk.gmo0000664000175000017500000002516412265245674011472 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B \gPW3*.^-Iapg}CVeO_Pn{N3V\u2<!B'd./ GXd1dZ3Vd.h]5G{cE^% = d ['!2!V!T ")b"/"b"`#9#:#\#+R$"~$E$3$5%5Q%I%7% &!#&2E&?x&l&Q%'-w'Y'Q'JQ(>(O(k+)z)*A2*D KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-03-08 08:34+0000 Last-Translator: Yuri Chornoivan Language-Team: Ukrainian Language: uk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); Потрібен ключВиявлено сеанс роботи у режимі лише читанняВиявлено сеанс роботи від імені адміністратораНа пристрої сталася помилкаВиявлено відкритий сеансВже виконується інша діяДо системи вже увійшов інший користувачНе вдалося експортувати, оскільки ключ є некоректнимНе вдалося експортувати, оскільки ключ має помилковий розмірНе вдалося експортувати, оскільки ключ належить до помилкового типуЕкспортування цього ключа неможливеІмпортування ключів з помилковими розмірами неможливеІмпортування некоректних ключів неможливеНе вдалося імпортувати, оскільки ключ є некоректнимНе вдалося імпортувати, оскільки ключ має помилковий розмірНе вдалося імпортувати, оскільки ключ належить до помилкового типуНе можна включати ключ до контрольної сумиНе вдалося заблокувати даніУ деяких з полів містяться некоректні значенняДеякі з полів, які мало бути заповнено, є порожнімиНедостатній об’єм пам’ятіНа пристрої недостатньо пам’ятіВнутрішня помилкаНекоректні параметриНекоректне значення поляКлюч не потрібенНе виконується жодної діїНе виявлено жодного доступного засобу створення псевдовипадкових чиселДо системи не увійшов жоден користувачНедостатньо простору для зберігання результатуМеханізмові шифрування передано некоректний аргументМеханізмові шифрування передано некоректний параметрНекоректний або непридатний механізм шифруванняНе вдалося заблокувати даніДані є некоректними або непридатними до розпізнаванняДані є занадто об’ємнимиПристрій є некоректним або непридатним до розпізнаванняПристрою не виявлено або пристрій було від’єднаноПристрій захищено від записуПристрій було вилучено або від’єднаноЗашифровані дані є некоректними або непридатними до розпізнаванняЗашифровані дані є занадто об’ємнимиВказано некоректну назву поля, такого поля не існуєПоле є придатним лише для читанняДані поля є конфіденційними, їх не можна розголошуватиДані є конфіденційними, їх не можна розголошуватиКлюч не може бути загорнутоЗначення ключа відрізняється від попередньогоНе вказано ключа або вказано некоректний ключТип ключа є помилковимРозмір ключа є помилковимМодулеві не вдалося створити потрібні потоки обробкиМодулеві не вдалося заблокувати дані належним чиномМодуль вже було ініціалізованоМодуль ще не було інціалізованоНе вказано об’єкт або вказано некоректний об’єктНе вдалося виконати діюДію було скасованоСтрок дії пароля або PIN-коду вичерпаноПомилковий пароль або PIN-кодНекоректний пароль або PIN-кодПароль або PIN-код заблокованоДовжина пароля або PIN-коду є некоректноюЗбережений стан є некоректнимСеанс закритоНекоректний сеансСеанс у режимі лише читанняПомилковий або пошкоджений підписПідпис непридатний до розпізнавання або підпис пошкодженоВказаний ідентифікатор слоту не є коректнимНе вдалося зберегти станЗапис користувача належить до некоректного типуНе встановлено пароль або PIN-код користувачаЦю дію над цим ключем виконати неможливоПідтримки цієї дії не передбаченоУ активному режимі працює забагато сеансівДо системи увійшло надто багато користувачів різних типівНе вдалося ініціалізувати засіб створення псевдовипадкових чиселНевідома помилкаВи вже увійшли до облікового записуp11-kit-0.20.2/po/zh_CN.gmo0000664000175000017500000000075412265245674012052 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Chinese (China) Language: zh_CN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; p11-kit-0.20.2/po/bn_IN.gmo0000664000175000017500000000103212265245673012023 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Bengali (India) (http://www.transifex.com/projects/p/freedesktop/language/bn_IN/) Language: bn_IN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/id.po0000664000175000017500000002253212265245673011276 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Andika Triwidada , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-04-11 07:54+0000\n" "Last-Translator: Andika Triwidada \n" "Language-Team: Indonesian (http://www.transifex.com/projects/p/freedesktop/" "language/id/)\n" "Language: id\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Operasi dibatalkan" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Tak tersedia cukup memori" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "ID slot yang dinyatakan tak valid" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Galat internal" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Operasi gagal" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Argumen tak valid" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "Modul tak bisa membuat thread yang diperlukan" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "Modul tak bisa mengunci data secara benar" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Ruas hanya-baca" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Ruas sensitif dan tak bisa diungkapkan" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Ruas tak valid atau tak ada" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Nilai tak valid bagi ruas" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Data tak valid atau tak dikenali" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Data terlalu panjang" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Terjadi galat pada perangkat" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Tak tersedia cukup memori pada perangkat" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Perangkat dihapus atau dicabut" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "Data terenkripsi tak valid atau tak dikenali" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Data terenkripsi terlalu panjang" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Operasi ini tak didukung" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Kunci hilang atau tak valid" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "Ukuran kunci salah" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "Jenis kunci salah" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Tak perlu kunci" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "Kunci berbeda dengan sebelumnya" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Perlu suatu kunci" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Tak bisa menyertakan kunci dalam digest" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Operasi ini tak bisa dilakukan dengan kunci ini" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "Kunci tak bisa dibungkus" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Tak bisa mengekspor kunci ini" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "Mekanisme kripto tak valid atau tak dikenali" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Mekanisme kripto memiliki argumen yang tak valid" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Objek hilang atau tak valid" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Operasi lain tengah berjalan" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Tak ada operasi yang sedang berjalan" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Sandi atau PIN salah" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Sandi atau PIN tak valid" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Panjang sandi atau PIN tak valid" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Sandi atau PIN kadaluarsa" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Sandi atau PIN terkunci" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "Sesi ditutup" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Terlalu banyak sesi yang aktif" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "Sesi tak valid" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "Sesi hanya-baca" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Ada sesi terbuka" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Ada sesi hanya-baca" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Ada sesi administrator" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "Tanda tangan buruk atau rusak" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "Tanda tangan tak dikenali atau rusak" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Ruas tertentu yang diperlukan hilang" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Ruas tertentu memiliki nilai yang tak valid" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Perangkat tak ada atau dicabut" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Perangkat tak valid atau tak dikenali" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Perangkat terlindung tulis" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Tak bisa mengimpor karena kunci tak valid" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Tak bisa mengimpor karena ukuran kunci salah" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Tak bisa mengimpor karena jenis kunci salah" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Anda sudah log masuk" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Tak ada pengguna yang log masuk" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "Sandi atau PIN pengguna belum diisi" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "Jenis pengguna tak valid" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Pengguna lain telah log masuk" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Terlalu banyak pengguna dengan jenis berbeda sedang log masuk" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Tak bisa mengimpor kunci yang tak valid" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Tak bisa mengimpor kunci salah ukuran" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Tak bisa mengekspor karena kunci tak valid" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Tak bisa mengekspor karena kunci salah ukuran" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Tak bisa mengekspor karena kunci salah jenis" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Tak bisa menginisialisasi pembangkit bilangan acak" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Tak tersedia pembangkit bilangan acak" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Mekanisme kripto memiliki parameter yang tak valid" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Tak cukup ruang untuk menyimpan hasil" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "Keadaan tersimpan tak valid" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Informasi sensitif dan tak dapat diungkapkan" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Keadaan tak dapat disimpan" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "Modul belum diinisialisasi" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Modul telah diinisialisasi" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Tak bisa mengunci data" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Data tak bisa dikunci" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "Permintaan tanda tangan ditolak oleh pengguna" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Galat tak dikenal" p11-kit-0.20.2/po/mr.gmo0000664000175000017500000000101412265245674011455 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Marathi (http://www.transifex.com/projects/p/freedesktop/language/mr/) Language: mr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/tr.gmo0000664000175000017500000000341112265245674011467 00000000000000L$;Pl +,C!\~s # .F`#x    A key is neededInsufficient memory availableInternal errorNo key is neededThe data is too longThe field is read-onlyThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedToo many sessions are activeProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-05-14 06:26+0000 Last-Translator: Necdet Yücel Language-Team: Turkish (http://www.transifex.com/projects/p/freedesktop/language/tr/) Language: tr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; Anahtar gerekliYeterli hafıza yokİç hataAnahtar gerekli değilVeri çok uzunBu alan salt-okunurİşlem başarısız olduİşlem iptal edildiParola veya PIN'in süresi geçmişParola veya PIN hatalıParola veya PIN geçersizParola veya PIN kilitliParola veya PIN geçersiz uzunluktaOturum kapatıldıOturum geçersizOturum salt-okunurİmza kötü veya hatalıÇok fazla aktif oturum varp11-kit-0.20.2/po/sr.gmo0000664000175000017500000002311212265245674011466 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B,\685,N9{:KX<R3J=gIVPF<2L=T4M'53]"AL;CLRTct6Q aOA4=Id3= (^KO0#6T<)/F" Li ' $ B! F! g!0!0!6!4!"CV"5"$"&",#.I#Dx#<#2#5-$Kc$O$+$(+%[T%V%&"'&D KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2013-02-07 20:07+0000 Last-Translator: MirosNik Language-Team: Serbian (http://www.transifex.com/projects/p/freedesktop/language/sr/) Language: sr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); Потребан је кључПостоји сесија само за читањеПостоји сесија администратораДошло је до грешке на уређајуПостоји отворена сесијаДруга радња је ступила на снагуДруги корисник је већ пријављенНе могу да извезем јер је кључ неисправанНе могу да извезем јер је кључ погрешне величинеНе могу да извезем јер је кључ погрешне врстеНе могу да извезем овај кључНе могу да увезем кључ погрешне величинеНе могу да увезем неисправан кључНе могу да увезем јер је кључ неисправанНе могу да увезем јер је кључ погрешне величинеНе могу да увезем јер је кључ погрешне врстеНе могу да укључим кључ у одабируНе могу да закључам податкеОдређена поља имају неисправне вредностиНедостају одређена потребна пољаНедовољно доступне меморијеНема довољно доступне меморије на уређајуУнутрашња грешкаНеисправни аргументиНеисправна вредност за пољеНије потребан кључНиједна радња није ступила на снагуНије доступан стваралац насумичног бројаНиједан корисник није пријављенНедовољно места за складиштење резултатаМеханизам шифровања има неисправан аргументМеханизам шифровања има неисправан параметарМеханизам шифровања је неисправан или непрепознатљивПодаци не могу бити закључаниПодаци нису исправни или су непрепознатљивиПодаци су предугиУређај је неисправан или је непрепознатљивУређај није присутан или је откаченУређај је заштићен од писањаУређај је уклоњен или је искљученШифровани подаци нису исправни или су непрепознатљивиШифровани подаци су предугиПоље је неисправно или не постојиПоље је само за читањеПоље је осетљиво и не може бити откривеноПодаци су осетљиви и не могу бити откривениКључ не може бити прекинутКључ је другачији него ранијеКључ недостаје или је неисправанКључ је погрешне врстеКључ је погрешне величинеМодул не може да направи потребне нитиМодул не може исправно да закључа податкеМодул је већ покренутМодул није покренутПредмет недостаје или је неисправанРадња није успелаРадња је отказанаИстекла је лозинка или ПИННије тачна лозинка или ПИННије исправна лозинка или ПИНЗакључана је лозинка или ПИНЛозинка или ПИН су неисправне дужинеСачувано стање је неисправноСесија је затворенаСесија је неисправнаСесија је само за читањеПотпис је лош или оштећенПотпис је непрепознатљив или оштећенИБ наведеног уреза није исправанСтање не може бити сачуваноКорисник је неисправне врстеНије подешена корисничка лозинка или ПИНОва радња не може бити обављена овим кључемОва радња није подржанаПревише радних сесијаПријављено је превише корисника различитих врстаНе могу да покренем ствараоца насумичног бројаНепозната грешкаВећ сте пријављениp11-kit-0.20.2/po/lt.po0000664000175000017500000001570712265245673011327 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Lithuanian (http://www.transifex.com/projects/p/freedesktop/" "language/lt/)\n" "Language: lt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" "%100<10 || n%100>=20) ? 1 : 2);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/az.gmo0000664000175000017500000000101112265245673011445 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Azerbaijani (http://www.transifex.com/projects/p/freedesktop/language/az/) Language: az MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; p11-kit-0.20.2/po/ja.po0000664000175000017500000002555012265245673011277 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Tomoyuki KATO , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-03-06 14:22+0000\n" "Last-Translator: Tomoyuki KATO \n" "Language-Team: Japanese (http://www.transifex.com/projects/p/freedesktop/" "language/ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "操作が取り消されました" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "利用可能なメモリーが不足しています" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "指定されたスロット ID が無効です" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "内部エラー" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "操作が失敗しました" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "無効な引数" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "モジュールが必要なスレッドを作成できません" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "モジュールがデータを適切にロックできません" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "項目が読み込み専用です" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "項目は大文字小文字を区別します、明らかにできません" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "項目が無効です、または存在しません" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "項目に対する無効な値" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "データが有効ではありません、または認識されません" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "データが長すぎます" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "デバイスにおいてエラーが発生しました" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "デバイスにおいて利用可能なメモリーが不足しています" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "デバイスが削除されました、または取り外されました" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "暗号化されたデータが有効ではありません、または認識されません" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "暗号化されたデータが長すぎます" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "この操作はサポートされません" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "キーがありません、または無効です" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "キーが誤った大きさです" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "キーが誤った形式です" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "キーは必要ありません" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "キーが以前のものと異なります" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "キーが必要です" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "ダイジェストにキーを含められません" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "この操作はこのキーを用いて実行できません" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "キーをラップできません" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "このキーをエクスポートできません" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "暗号化機能が無効です、または認識されません" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "暗号化機能が無効な引数を持ちます" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "オブジェクトがありません、または無効です" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "他の操作がすでに起きています" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "発生している操作がありません" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "パスワードまたは PIN が正しくありません" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "パスワードまたは PIN が無効です" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "パスワードまたは PIN が不正な長さです" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "パスワードまたは PIN が失効しています" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "パスワードまたは PIN がロックされています" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "セッションが終了しました" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "有効なセッションが多すぎます" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "セッションが無効です" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "セッションが読み込み専用です" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "開いているセッションが存在します" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "読み込み専用のセッションが存在します" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "管理者セッションが存在します" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "署名が不正です、または破損しています" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "署名が認識できません、または破損しています" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "特定の必須項目がありません" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "特定の必須項目が無効な値を持っています" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "デバイスが存在しません、または取り外されました" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "デバイスが無効です、まあは認識されません" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "デバイスが書き込み保護されています" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "キーが無効なためインポートできません" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "キーの大きさが不正なためインポートできません" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "キーの形式が不正なためインポートできません" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "すでにログインしています" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "ログインしているユーザーはいません" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "ユーザーのパスワードまたは PIN が設定されていません" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "ユーザーが無効な種類です" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "他のユーザーがすでにログインしています" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "異なる種類の多すぎるユーザーがログインしています" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "無効なキーをインポートできません" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "不正な大きさのキーをインポートできません" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "キーが無効なためエクスポートできません" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "キーが誤った大きさのためエクスポートできません" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "キーが誤った形式のためエクスポートできません" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "乱数生成器を初期化できません" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "利用可能な乱数生成器がありません" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "暗号化機能が無効なパラメーターを持っています" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "結果を保存するために十分な領域がありません" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "保存された状態が無効です" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "情報は大文字小文字を区別しますが、明らかにできません" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "状態が保存できません" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "モジュールが初期化されませんでした" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "モジュールがすでに初期化されています" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "データをロックできません" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "データがロックできません" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "署名要求がユーザーにより拒否されました" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "未知のエラー" p11-kit-0.20.2/po/ca.gmo0000664000175000017500000000101412265245673011421 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Catalan (http://www.transifex.com/projects/p/freedesktop/language/ca/) Language: ca MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/cs.po0000664000175000017500000001560512265245672011311 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Czech \n" "Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/it.po0000664000175000017500000002414712265245673011322 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Luca Ferretti , 2012. # Milo Casagrande , 2013. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2013-01-30 21:13+0000\n" "Last-Translator: milo \n" "Language-Team: Italian (http://www.transifex.com/projects/p/freedesktop/" "language/it/)\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "L'operazione è stata annullata" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Memoria disponibile non sufficiente" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "L'ID dello slot specificato non è valido" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Errore interno" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "L'operazione non è riuscita" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Argomenti non validi" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "Il modulo non può creare i thread richiesti" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "Il modulo non può bloccare i dati in modo corretto" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Il campo è a sola lettura" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Il campo è sensibile e non può essere mostrato" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Il campo non è valido oppure non esiste" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Valore non valido per il campo" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "I dati sono non validi oppure non riconosciuti" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "I dati sono troppo lunghi" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Si è verificato un errore sul dispositivo" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Memoria disponibile sul dispositivo non sufficiente" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Il dispositivo è stato rimosso o scollegato" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "I dati cifrati sono non validi oppure non riconosciuti" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "I dati cifrati sono troppo lunghi" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Questa operazione non è supportata" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "La chiave manca o non è valida" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "La dimensione della chiave è errata" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "Il tipo della chiave è errato" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Nessuna chiave richiesta" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "La chiave è diversa rispetto prima" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "È richiesta una chiave" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Impossibile includere la chiave nel digest" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Impossibile eseguire questa operazione con questa chiave" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "La chiave non può essere terminata" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Impossibile esportare questa chiave" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "Il meccanismo di crittografia è non valido oppure non riconosciuto" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Il meccanismo di crittografia presenta un argomento non valido" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Manca l'oggetto oppure non è valido" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Un'altra operazione è già in corso" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Nessuna operazione in corso" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "La password o il PIN non è corretto" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "La password o il PIN non è valido" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "La password o il PIN è di lunghezza non valida" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "La password o il PIN è scaduto" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "La password o il PIN è bloccato" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "La sessione è chiusa" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Troppe sessioni attive" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "La sessione non è valida" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "La sessione è in sola-lettura" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Esiste già una sessione aperta" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Esiste già una sessione in sola-lettura" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Esiste già una sessione amministratore" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "La firma non è corretta o danneggiata" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "La firma è rovinata o non leggibile" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Mancano alcuni campi richiesti" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Alcuni campi presentano valori non validi" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Il dispositivo non è presente o è scollegato" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Il dispositivo non è valido o non è riconoscibile" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Il dispositivo è protetto in scrittura" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Impossibile importare poiché la chiave non è valida" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Impossibile importare poiché la chiave è della dimensione errata" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Impossibile importare poiché la tipologia della chiave è errata" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Accesso già eseguito" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Nessun utente ha effettuato l'accesso" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "La password o il PIN dell'utente non è impostato" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "L'utente è di tipo errato" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Un altro utente ha già effettuato l'accesso" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Troppi utenti di diversi tipi hanno eseguito l'accesso" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Impossibile importare una chiave non valida" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Impossibile importare una chiave della dimensione errata" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Impossibile esportare poiché la chiave non è valida" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Impossibile esportare poiché la chiave è della dimensione errata" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Impossibile esportare poiché la tipologia della chiave è errata" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Impossibile inizializzare il generatore di numeri casuali" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Nessun generatore di numeri casuali disponibile" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Il meccanismo di cifratura presenta un parametro non valido" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Spazio insufficiente per salvare il risultato" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "Lo stato salvato non è valido" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Le informazioni sono private e non possono essere mostrate" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Impossibile salvare lo stato" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "Il modulo non è stato inizializzato" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Il modulo è già stato inizializzato" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Impossibile bloccare i dati" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "I dati non possono essere bloccati" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "La richiesta di firma è stata rifiutata dall'utente" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Errore sconosciuto" p11-kit-0.20.2/po/es_CL.gmo0000664000175000017500000000103212265245673012023 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Spanish (Chile) (http://www.transifex.com/projects/p/freedesktop/language/es_CL/) Language: es_CL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/zh_TW.po0000664000175000017500000001561212265245673011736 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/" "freedesktop/language/zh_TW/)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/uk.po0000664000175000017500000003143112265245673011317 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Yuri Chornoivan , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-03-08 08:34+0000\n" "Last-Translator: Yuri Chornoivan \n" "Language-Team: Ukrainian \n" "Language: uk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Дію було скасовано" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Недостатній об’єм пам’яті" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "Вказаний ідентифікатор слоту не є коректним" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Внутрішня помилка" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Не вдалося виконати дію" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Некоректні параметри" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "Модулеві не вдалося створити потрібні потоки обробки" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "Модулеві не вдалося заблокувати дані належним чином" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Поле є придатним лише для читання" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Дані поля є конфіденційними, їх не можна розголошувати" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Вказано некоректну назву поля, такого поля не існує" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Некоректне значення поля" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Дані є некоректними або непридатними до розпізнавання" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Дані є занадто об’ємними" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "На пристрої сталася помилка" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "На пристрої недостатньо пам’яті" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Пристрій було вилучено або від’єднано" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "Зашифровані дані є некоректними або непридатними до розпізнавання" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Зашифровані дані є занадто об’ємними" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Підтримки цієї дії не передбачено" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Не вказано ключа або вказано некоректний ключ" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "Розмір ключа є помилковим" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "Тип ключа є помилковим" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Ключ не потрібен" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "Значення ключа відрізняється від попереднього" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Потрібен ключ" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Не можна включати ключ до контрольної суми" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Цю дію над цим ключем виконати неможливо" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "Ключ не може бути загорнуто" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Експортування цього ключа неможливе" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "Некоректний або непридатний механізм шифрування" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Механізмові шифрування передано некоректний аргумент" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Не вказано об’єкт або вказано некоректний об’єкт" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Вже виконується інша дія" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Не виконується жодної дії" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Помилковий пароль або PIN-код" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Некоректний пароль або PIN-код" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Довжина пароля або PIN-коду є некоректною" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Строк дії пароля або PIN-коду вичерпано" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Пароль або PIN-код заблоковано" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "Сеанс закрито" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "У активному режимі працює забагато сеансів" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "Некоректний сеанс" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "Сеанс у режимі лише читання" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Виявлено відкритий сеанс" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Виявлено сеанс роботи у режимі лише читання" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Виявлено сеанс роботи від імені адміністратора" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "Помилковий або пошкоджений підпис" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "Підпис непридатний до розпізнавання або підпис пошкоджено" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Деякі з полів, які мало бути заповнено, є порожніми" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "У деяких з полів містяться некоректні значення" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Пристрою не виявлено або пристрій було від’єднано" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Пристрій є некоректним або непридатним до розпізнавання" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Пристрій захищено від запису" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Не вдалося імпортувати, оскільки ключ є некоректним" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Не вдалося імпортувати, оскільки ключ має помилковий розмір" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Не вдалося імпортувати, оскільки ключ належить до помилкового типу" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Ви вже увійшли до облікового запису" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "До системи не увійшов жоден користувач" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "Не встановлено пароль або PIN-код користувача" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "Запис користувача належить до некоректного типу" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "До системи вже увійшов інший користувач" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "До системи увійшло надто багато користувачів різних типів" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Імпортування некоректних ключів неможливе" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Імпортування ключів з помилковими розмірами неможливе" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Не вдалося експортувати, оскільки ключ є некоректним" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Не вдалося експортувати, оскільки ключ має помилковий розмір" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Не вдалося експортувати, оскільки ключ належить до помилкового типу" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Не вдалося ініціалізувати засіб створення псевдовипадкових чисел" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Не виявлено жодного доступного засобу створення псевдовипадкових чисел" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Механізмові шифрування передано некоректний параметр" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Недостатньо простору для зберігання результату" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "Збережений стан є некоректним" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Дані є конфіденційними, їх не можна розголошувати" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Не вдалося зберегти стан" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "Модуль ще не було інціалізовано" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Модуль вже було ініціалізовано" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Не вдалося заблокувати дані" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Не вдалося заблокувати дані" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "Користувач відмовив у задоволенні запиту щодо підписування" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Невідома помилка" p11-kit-0.20.2/po/ru.po0000664000175000017500000001571712265245673011337 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Russian (http://www.transifex.com/projects/p/freedesktop/" "language/ru/)\n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/sr@latin.po0000664000175000017500000001574312265245673012464 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Serbian (Latin) (http://www.transifex.com/projects/p/" "freedesktop/language/sr@latin/)\n" "Language: sr@latin\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/ca@valencia.po0000664000175000017500000001564012265245672013071 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Catalan (Valencian) (http://www.transifex.com/projects/p/" "freedesktop/language/ca@valencia/)\n" "Language: ca@valencia\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/ml.po0000664000175000017500000001560412265245673011314 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Malayalam (http://www.transifex.com/projects/p/freedesktop/" "language/ml/)\n" "Language: ml\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/gu.po0000664000175000017500000001560312265245672011315 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Gujarati (http://www.transifex.com/projects/p/freedesktop/" "language/gu/)\n" "Language: gu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/he.po0000664000175000017500000001560112265245673011275 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Hebrew (http://www.transifex.com/projects/p/freedesktop/" "language/he/)\n" "Language: he\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/POTFILES.in0000664000175000017500000000011612162233754012102 00000000000000# List of source files which contain translatable strings. p11-kit/messages.c p11-kit-0.20.2/po/ms.po0000664000175000017500000001557112265245673011326 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Malay (http://www.transifex.com/projects/p/freedesktop/" "language/ms/)\n" "Language: ms\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/en@quot.header0000644000175000017500000000226312265207774013124 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # p11-kit-0.20.2/po/it_IT.po0000664000175000017500000001562012265245673011712 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Italian (Italy) (http://www.transifex.com/projects/p/" "freedesktop/language/it_IT/)\n" "Language: it_IT\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/en@quot.po0000664000175000017500000002515512265243753012316 00000000000000# English translations for p11-kit package. # Copyright (C) 2014 Collabora Ltd. # This file is distributed under the same license as the p11-kit package. # Automatically generated, 2014. # # All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # msgid "" msgstr "" "Project-Id-Version: p11-kit 0.20.2\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2014-01-14 15:21+0100\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" "Language: en@quot\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "The operation was cancelled" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Insufficient memory available" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "The specified slot ID is not valid" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Internal error" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "The operation failed" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Invalid arguments" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "The module cannot create needed threads" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "The module cannot lock data properly" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "The field is read-only" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "The field is sensitive and cannot be revealed" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "The field is invalid or does not exist" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Invalid value for field" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "The data is not valid or unrecognized" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "The data is too long" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "An error occurred on the device" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Insufficient memory available on the device" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "The device was removed or unplugged" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "The encrypted data is not valid or unrecognized" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "The encrypted data is too long" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "This operation is not supported" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "The key is missing or invalid" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "The key is the wrong size" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "The key is of the wrong type" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "No key is needed" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "The key is different than before" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "A key is needed" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Cannot include the key in the digest" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "This operation cannot be done with this key" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "The key cannot be wrapped" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Cannot export this key" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "The crypto mechanism is invalid or unrecognized" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "The crypto mechanism has an invalid argument" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "The object is missing or invalid" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Another operation is already taking place" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "No operation is taking place" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "The password or PIN is incorrect" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "The password or PIN is invalid" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "The password or PIN is of an invalid length" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "The password or PIN has expired" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "The password or PIN is locked" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "The session is closed" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Too many sessions are active" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "The session is invalid" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "The session is read-only" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "An open session exists" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "A read-only session exists" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "An administrator session exists" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "The signature is bad or corrupted" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "The signature is unrecognized or corrupted" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Certain required fields are missing" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Certain fields have invalid values" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "The device is not present or unplugged" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "The device is invalid or unrecognizable" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "The device is write protected" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Cannot import because the key is invalid" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Cannot import because the key is of the wrong size" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Cannot import because the key is of the wrong type" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "You are already logged in" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "No user has logged in" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "The user's password or PIN is not set" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "The user is of an invalid type" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Another user is already logged in" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Too many users of different types are logged in" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Cannot import an invalid key" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Cannot import a key of the wrong size" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Cannot export because the key is invalid" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Cannot export because the key is of the wrong size" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Cannot export because the key is of the wrong type" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Unable to initialize the random number generator" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "No random number generator available" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "The crypto mechanism has an invalid parameter" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Not enough space to store the result" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "The saved state is invalid" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "The information is sensitive and cannot be revealed" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "The state cannot be saved" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "The module has not been initialized" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "The module has already been initialized" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Cannot lock data" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "The data cannot be locked" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "The request was rejected by the user" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Unknown error" p11-kit-0.20.2/po/kk.gmo0000664000175000017500000000100412265245674011443 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Kazakh (http://www.transifex.com/projects/p/freedesktop/language/kk/) Language: kk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; p11-kit-0.20.2/po/id.gmo0000664000175000017500000001636412265245674011451 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\5G[r*-,4a%'),+$'Px+$(#2D^$n%%020,c %!<,[ &,)Bb~-)1 M[n  '7$U!z#/$==\2D KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-04-11 07:54+0000 Last-Translator: Andika Triwidada Language-Team: Indonesian (http://www.transifex.com/projects/p/freedesktop/language/id/) Language: id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; Perlu suatu kunciAda sesi hanya-bacaAda sesi administratorTerjadi galat pada perangkatAda sesi terbukaOperasi lain tengah berjalanPengguna lain telah log masukTak bisa mengekspor karena kunci tak validTak bisa mengekspor karena kunci salah ukuranTak bisa mengekspor karena kunci salah jenisTak bisa mengekspor kunci iniTak bisa mengimpor kunci salah ukuranTak bisa mengimpor kunci yang tak validTak bisa mengimpor karena kunci tak validTak bisa mengimpor karena ukuran kunci salahTak bisa mengimpor karena jenis kunci salahTak bisa menyertakan kunci dalam digestTak bisa mengunci dataRuas tertentu memiliki nilai yang tak validRuas tertentu yang diperlukan hilangTak tersedia cukup memoriTak tersedia cukup memori pada perangkatGalat internalArgumen tak validNilai tak valid bagi ruasTak perlu kunciTak ada operasi yang sedang berjalanTak tersedia pembangkit bilangan acakTak ada pengguna yang log masukTak cukup ruang untuk menyimpan hasilMekanisme kripto memiliki argumen yang tak validMekanisme kripto memiliki parameter yang tak validMekanisme kripto tak valid atau tak dikenaliData tak bisa dikunciData tak valid atau tak dikenaliData terlalu panjangPerangkat tak valid atau tak dikenaliPerangkat tak ada atau dicabutPerangkat terlindung tulisPerangkat dihapus atau dicabutData terenkripsi tak valid atau tak dikenaliData terenkripsi terlalu panjangRuas tak valid atau tak adaRuas hanya-bacaRuas sensitif dan tak bisa diungkapkanInformasi sensitif dan tak dapat diungkapkanKunci tak bisa dibungkusKunci berbeda dengan sebelumnyaKunci hilang atau tak validJenis kunci salahUkuran kunci salahModul tak bisa membuat thread yang diperlukanModul tak bisa mengunci data secara benarModul telah diinisialisasiModul belum diinisialisasiObjek hilang atau tak validOperasi gagalOperasi dibatalkanSandi atau PIN kadaluarsaSandi atau PIN salahSandi atau PIN tak validSandi atau PIN terkunciPanjang sandi atau PIN tak validKeadaan tersimpan tak validSesi ditutupSesi tak validSesi hanya-bacaTanda tangan buruk atau rusakTanda tangan tak dikenali atau rusakID slot yang dinyatakan tak validKeadaan tak dapat disimpanJenis pengguna tak validSandi atau PIN pengguna belum diisiOperasi ini tak bisa dilakukan dengan kunci iniOperasi ini tak didukungTerlalu banyak sesi yang aktifTerlalu banyak pengguna dengan jenis berbeda sedang log masukTak bisa menginisialisasi pembangkit bilangan acakGalat tak dikenalAnda sudah log masukp11-kit-0.20.2/po/es.gmo0000664000175000017500000001770212265245673011460 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\C"Y#|&#1&@X;5)+2U@=*2)R |$6 ="Z:}#356F;}+/$5T/&4'">a*}1!8$Z.4  %EZ$t'')2 Fg&'-4#R9v0"8$;]D KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-08-27 16:15+0000 Last-Translator: Daniel Mustieles Language-Team: Spanish (http://www.transifex.com/projects/p/freedesktop/language/es/) Language: es MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Se necesita una claveExiste una sesión de solo lecturaExiste una sesión de administradorHa ocurrido un error en el dispositivoExiste una sesión abiertaYa hay otra operación en cursoYa ha iniciado sesión otro usuarioNo se puede exportar poque la clave no es válidaNo se puede exportar porque la clave tiene un tamaño incorrectoNo se puede exportar porque la clave es del tipo incorrectoNo se puede exportar esta claveNo se puede importar una clave del tamaño incorrectoNo se puede importar una clave no válidaNo se puede importar porque la clave no es válidaNo se puede importar porque la clave tiene un tamaño incorrectoNo se puede importar porque la clave es de un tipo incorrectoNo se puede incluir la clave en el resumenNo se pueden bloquear los datosCiertos campos tienen valores no válidosFaltan ciertos campos requeridosNo hay suficiente memoria disponibleNo hay memoria suficiente disponible en el dispositivoError internoArgumentos no válidosValor no válido para el campoNo se necesita ninguna claveNo hay ninguna operación en cursoNo hay ningún generador de números aleatorios disponibleNingún usuario ha iniciado sesiónNo hay espacio suficiente para guardar el resultadoEl mecanismo de cifrado tiene un argumento no válidoEl mecanismo de cifrado tiene un parámetro no válidoEl mecanismo de cifrado no es válido o no se ha reconocidoNo se pueden bloquear los datosLos datos no son válidos o no se reconocenLos datos son demasiado largosEl dispositivo no es válido o es irreconocibleEl dispositivo no está presente o está desconectadoEl dispositivo está protegido contra escrituraSe quitó o desconectó el dispositivoLos datos cifrados no son válidos o no se reconocenLos datos cifrados son demasiado largosEl campo no es válido o no existeEl campo es de solo lecturaEl campo es sensible y no se puede revelarLa información es sensible y no se puede revelarNo se puede encapsular la claveLa clave no es igual que antesFalta la clave o no es válidaEl tipo de la clave es incorrectoEl tamaño de la clave es incorrectoEl módulo no puede crear los hilos necesariosEl módulo no puede bloquear los datos correctamenteYa se ha inicializado el móduloNo se ha inicializado el móduloFalta el objeto o no es válidoFalló la operaciónSe canceló la operaciónLa contraseña o el PIN han expiradoLa contraseña o el PIN son incorrectosLa contraseña o el PIN no son válidosLa contraseña o el PIN están bloqueadosLa contraseña o PIN tiene una longitud no válidaEl estado guardado no es válidoLa sesión está cerradaLa sesión no es válidaLa sesión es de solo lecturaLa firma tiene errores o está dañadaLa firma no se reconoce o está dañadaEl ID de la ranura especificada no es válidoNo se puede guardar el estadoEl usuario es de un tipo no válidoLa contraseña o el PIN del usuario no se han establecidoNo se puede hacer esta operación con esta claveEsta operación no está soportadaHay demasiadas sesiones activasHan iniciado sesión demasiados usuarios de varios tiposNo se puede inicializar el generador de números aleatoriosError desconocidoYa ha iniciado sesiónp11-kit-0.20.2/po/sv.po0000664000175000017500000001560212265245673011332 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Swedish (http://www.transifex.com/projects/p/freedesktop/" "language/sv/)\n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/Rules-quot0000644000175000017500000000341112265207774012336 00000000000000# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header p11-kit-0.20.2/po/en@boldquot.po0000664000175000017500000002536712265243753013164 00000000000000# English translations for p11-kit package. # Copyright (C) 2014 Collabora Ltd. # This file is distributed under the same license as the p11-kit package. # Automatically generated, 2014. # # All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # msgid "" msgstr "" "Project-Id-Version: p11-kit 0.20.2\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2014-01-14 15:21+0100\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" "Language: en@boldquot\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "The operation was cancelled" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Insufficient memory available" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "The specified slot ID is not valid" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Internal error" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "The operation failed" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Invalid arguments" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "The module cannot create needed threads" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "The module cannot lock data properly" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "The field is read-only" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "The field is sensitive and cannot be revealed" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "The field is invalid or does not exist" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Invalid value for field" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "The data is not valid or unrecognized" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "The data is too long" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "An error occurred on the device" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Insufficient memory available on the device" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "The device was removed or unplugged" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "The encrypted data is not valid or unrecognized" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "The encrypted data is too long" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "This operation is not supported" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "The key is missing or invalid" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "The key is the wrong size" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "The key is of the wrong type" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "No key is needed" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "The key is different than before" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "A key is needed" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Cannot include the key in the digest" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "This operation cannot be done with this key" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "The key cannot be wrapped" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Cannot export this key" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "The crypto mechanism is invalid or unrecognized" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "The crypto mechanism has an invalid argument" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "The object is missing or invalid" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Another operation is already taking place" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "No operation is taking place" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "The password or PIN is incorrect" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "The password or PIN is invalid" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "The password or PIN is of an invalid length" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "The password or PIN has expired" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "The password or PIN is locked" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "The session is closed" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Too many sessions are active" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "The session is invalid" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "The session is read-only" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "An open session exists" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "A read-only session exists" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "An administrator session exists" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "The signature is bad or corrupted" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "The signature is unrecognized or corrupted" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Certain required fields are missing" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Certain fields have invalid values" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "The device is not present or unplugged" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "The device is invalid or unrecognizable" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "The device is write protected" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Cannot import because the key is invalid" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Cannot import because the key is of the wrong size" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Cannot import because the key is of the wrong type" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "You are already logged in" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "No user has logged in" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "The user's password or PIN is not set" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "The user is of an invalid type" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Another user is already logged in" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Too many users of different types are logged in" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Cannot import an invalid key" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Cannot import a key of the wrong size" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Cannot export because the key is invalid" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Cannot export because the key is of the wrong size" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Cannot export because the key is of the wrong type" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Unable to initialize the random number generator" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "No random number generator available" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "The crypto mechanism has an invalid parameter" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Not enough space to store the result" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "The saved state is invalid" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "The information is sensitive and cannot be revealed" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "The state cannot be saved" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "The module has not been initialized" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "The module has already been initialized" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Cannot lock data" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "The data cannot be locked" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "The request was rejected by the user" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Unknown error" p11-kit-0.20.2/po/quot.sed0000644000175000017500000000023112265207774012015 00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g p11-kit-0.20.2/po/en@quot.gmo0000664000175000017500000001671412265243754012464 00000000000000Rm<<\)s!(22N%e(22 $7 \ "m #  +    7 H $e  $ , - / P %j  ' &  # /6 f &  - 3 % ? ` ~  ' $ '#* No +$Jo!*"@Z%y+/08 iw,<Ww)!(2#2V%(2 2?$r"#+ 9HZr$$,--/[%'&/#M/q&-3,` z'$'=#e  ;+Y$! *-"X{%+&/C0s E LM2*B4)@R<?OJ 3 Q810=#!HD(.AG:5,>6-+ IP"&'9 F%N7;$K/ CA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe request was rejected by the userThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit 0.20.2 Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2014-01-14 15:21+0100 Last-Translator: Automatically generated Language-Team: none Language: en@quot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); A key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe request was rejected by the userThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inp11-kit-0.20.2/po/nn.po0000664000175000017500000001561412265245673011320 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Norwegian Nynorsk (http://www.transifex.com/projects/p/" "freedesktop/language/nn/)\n" "Language: nn\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/or.po0000664000175000017500000001560012265245673011320 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Oriya (http://www.transifex.com/projects/p/freedesktop/" "language/or/)\n" "Language: or\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/ru.gmo0000664000175000017500000000112612265245674011471 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Russian (http://www.transifex.com/projects/p/freedesktop/language/ru/) Language: ru MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); p11-kit-0.20.2/po/boldquot.sed0000644000175000017500000000033112265207774012657 00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g s/“/“/g s/”/”/g s/‘/‘/g s/’/’/g p11-kit-0.20.2/po/kk.po0000664000175000017500000001557212265245673011315 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Kazakh (http://www.transifex.com/projects/p/freedesktop/" "language/kk/)\n" "Language: kk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/bg.gmo0000664000175000017500000000101612265245673011430 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Bulgarian (http://www.transifex.com/projects/p/freedesktop/language/bg/) Language: bg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/ia.po0000664000175000017500000001560612265245673011277 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Interlingua (http://www.transifex.com/projects/p/freedesktop/" "language/ia/)\n" "Language: ia\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/ko.po0000664000175000017500000002341312265245673011312 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Shinjo Park , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-04-14 16:48+0000\n" "Last-Translator: Shinjo Park \n" "Language-Team: Korean (http://www.transifex.com/projects/p/freedesktop/" "language/ko/)\n" "Language: ko\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "작업이 취소됨" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "사용 가능한 메모리가 부족함" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "지정한 슬롯 ID가 올바르지 않음" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "내부 오류" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "작업이 실패함" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "인자가 잘못됨" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "모듈에서 필요한 스레드를 만들 수 없음" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "모듈에서 데이터를 올바르게 잠글 수 없음" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "필드가 읽기 전용임" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "필드가 민감한 정보를 포함하고 있어서 볼 수 없음" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "필드가 잘못되었거나 존재하지 않음" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "필드의 값이 잘못됨" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "데이터가 올바르지 않거나 인식되지 않음" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "데이터가 너무 김" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "장치에 오류가 발생함" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "장치에 메모리가 부족함" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "장치가 제거되었거나 연결이 해제됨" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "암호화된 데이터가 올바르지 않거나 인식되지 않음" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "암호화된 데이터가 너무 김" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "이 동작이 지원되지 않음" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "키가 없거나 올바르지 않음" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "키 크기가 잘못됨" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "키 종류가 잘못됨" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "키가 필요하지 않음" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "키가 이전과 달라짐" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "키가 필요함" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "다이제스트에 키를 포함할 수 없음" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "이 키를 사용하여 작업을 수행할 수 없음" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "키를 둘러쌀 수 없음" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "키를 내보낼 수 없음" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "암호화 방식이 잘못되었거나 인식할 수 없음" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "암호화 방식의 인자가 잘못됨" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "객체가 존재하지 않거나 잘못됨" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "다른 작업이 진행 중" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "진행 중인 작업 없음" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "암호나 PIN이 올바르지 않음" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "암호나 PIN이 잘못됨" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "암호나 PIN의 길이가 잘못됨" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "암호나 PIN이 만료됨" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "암호나 PIN이 잠김" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "세션이 닫힘" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "세션이 너무 많이 열려 있음" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "세션이 잘못됨" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "세션이 읽기 전용임" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "열린 세션이 존재함" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "읽기 전용 세션이 존재함" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "관리자 세션이 존재함" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "서명이 잘못되었거나 손상됨" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "서명이 인식되지 않았거나 손상됨" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "필요한 필드의 값이 빠졌음" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "필드의 값이 잘못됨" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "장치가 존재하지 않거나 연결이 해제됨" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "장치가 잘못되었거나 인식할 수 없음" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "장치가 쓰기 금지되어 있음" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "키가 잘못되어 가져올 수 없음" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "키 크기가 잘못되어 가져올 수 없음" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "키 종류가 잘못되어 가져올 수 없음" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "이미 로그인되어 있음" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "로그인한 사용자가 없음" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "사용자의 암호나 PIN이 설정되지 않음" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "사용자 종류가 잘못됨" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "다른 사용자가 로그인되어 있음" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "다른 종류의 사용자가 너무 많이 로그인되어 있음" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "잘못된 키를 가져올 수 없음" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "크기가 잘못된 키를 가져올 수 없음" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "잘못된 키를 내보낼 수 없음" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "크기가 잘못된 키를 내보낼 수 없음" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "종류가 잘못된 키를 내보낼 수 없음" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "난수 생성기를 초기화할 수 없음" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "난수 생성기를 사용할 수 없음" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "암호화 방식의 인자가 잘못됨" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "결과를 저장할 공간이 없음" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "저장된 상태가 잘못됨" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "민감한 정보를 노출할 수 없음" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "상태를 저장할 수 없음" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "모듈이 초기화되지 않았음" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "모듈이 이미 초기화되었음" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "데이터를 잠글 수 없음" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "데이터를 잠글 수 없음" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "사용자가 서명 요청을 거부함" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "알 수 없는 오류" p11-kit-0.20.2/po/te.po0000664000175000017500000001560112265245673011311 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Telugu (http://www.transifex.com/projects/p/freedesktop/" "language/te/)\n" "Language: te\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/en_GB.gmo0000664000175000017500000000104312265245673012012 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: English (United Kingdom) (http://www.transifex.com/projects/p/freedesktop/language/en_GB/) Language: en_GB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/as.po0000664000175000017500000001560312265245672011305 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Assamese (http://www.transifex.com/projects/p/freedesktop/" "language/as/)\n" "Language: as\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/hi.po0000664000175000017500000001560012265245673011300 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Hindi (http://www.transifex.com/projects/p/freedesktop/" "language/hi/)\n" "Language: hi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/pa.gmo0000664000175000017500000002356512265245674011456 00000000000000Kte`aq)! (/2X2%(2A2t"#+ I X j   $  $ , /= m %  ' &  #/ /S  &    < 'V $~ ' #  % A a   +  3!L*n"%+Gg0 'M974q9JG+xsyZnaZu++DG=BES""=*`A=Y :e^VMVD[-E:sdCMWS1K7C GM44`n` d M4!A!,!0!a"";"=":"Q9#0###4#C-$Fq$?$@$19%^k%o%=:&=x&`&'@4'E#6 5JH!(IG/3-% ?:<&K 17 )9' >AD@*, 8;4.+B"=C2F0$A key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-08-07 02:16+0000 Last-Translator: A S Alam Language-Team: Panjabi (Punjabi) (http://www.transifex.com/projects/p/freedesktop/language/pa/) Language: pa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); ਕੁੰਜੀ ਦੀ ਲੋੜ ਹੈਕੇਵਲ ਪੜ੍ਹਨ ਵਾਲਾ ਸ਼ੈਸ਼ਨ ਮੌਜੂਦ ਹੈਪਰਸ਼ਾਸ਼ਕੀ ਸ਼ੈਸ਼ਨ ਮੌਜੂਦ ਹੈਜੰਤਰ ਉੱਤੇ ਗਲਤੀ ਆਈ ਹੈਖੁੱਲ੍ਹਾ ਸ਼ੈਸ਼ਨ ਮੌਜੂਦ ਹੈਹੋਰ ਕਾਰਵਾਈ ਪਹਿਲਾਂ ਹੀ ਜਾਰੀ ਹੈਹੋਰ ਯੂਜ਼ਰ ਪਹਿਲਾਂ ਹੀ ਲਾਗਇਨ ਹੈਐਕਸਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਗਲਤ ਹੈਐਕਸਪੋਰਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਦਾ ਆਕਾਰ ਗਲਤ ਹੈਐਕਸਪੋਰਟ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਦੀ ਗਲਤ ਕਿਸਮ ਹੈਇਹ ਕੁੰਜੀ ਐਕਸਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀਗਲਤ ਆਕਾਰ ਦੀ ਕੁੰਜੀ ਇੰਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀਗਲਤ ਕੁੰਜੀ ਇੰਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀਇੰਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਗਲਤ ਹੈਇੰਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਦਾ ਆਕਾਰ ਗਲਤ ਹੈਇੰਪੋਰਟ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ, ਕਿਉਂਕਿ ਕੁੰਜੀ ਦੀ ਕਿਸਮ ਗਲਤ ਹੈਡਾਟਾ ਲਾਕ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾਕੁਝ ਖੇਤਰਾਂ ਵਿੱਚ ਗਲਤ ਮੁੱਲ ਹਨਕੁਝ ਲੋੜੀਦੇ ਖੇਤਰ ਗੁੰਮ ਹਨਲੋੜੀਦੀ ਮੈਮੋਰੀ ਉਪਲੱਬਧ ਨਹੀਂਜੰਤਰ ਉੱਤੇ ਲੋੜੀਦੀ ਮੈਮੋਰੀ ਨਹੀਂ ਹੈਅੰਦਰੂਨੀ ਗਲਤੀਗਲਤ ਆਰਗੂਮੈਂਟਖੇਤਰ ਲਈ ਗਲਤ ਮੁੱਲਕਿਸੇ ਕੁੰਜੀ ਦੀ ਲੋੜ ਨਹੀਂ ਹੈਕੋਈ ਕਾਰਵਾਈ ਜਾਰੀ ਨਹੀਂ ਹੈਕੋਈ ਰੈਂਡਮ ਨੰਬਰ ਜਰਨੇਟਰ ਉਪਲੱਬਧ ਨਹੀਂਕੋਈ ਯੂਜ਼ਰ ਲਾਗਇਨ ਨਹੀਂ ਹੈਨਤੀਜਾ ਸਟੋਰ ਕਰਨ ਲਈ ਲੋੜੀਦੀ ਥਾਂ ਨਹੀਂ ਹੈਕ੍ਰਿਪਟੂ ਢੰਗ ਵਿੱਚ ਗਲਤ ਆਰਗੂਮੈਂਟ ਹੈਕ੍ਰਿਪਟੂ ਢੰਗ ਗਲਤ ਜਾਂ ਬੇਪਛਾਣ ਹੈਡਾਟਾ ਲਾਕ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾਡਾਟਾ ਗਲਤ ਹੈ ਜਾਂ ਪਛਾਣਿਆ ਨਹੀਂ ਜਾ ਸਕਦਾਡਾਟਾ ਬਹੁਤ ਲੰਮਾ ਹੈਜੰਤਰ ਗਲਤ ਜਾਂ ਬੇਪਛਾਣ ਹੈਜੰਤਰ ਮੌਜੂਦ ਨਹੀਂ ਜਾਂ ਪਲੱਗ ਕੱਢਿਆ ਹੋਇਆ ਹੈਜੰਤਰ ਲਿਖਣ ਤੋਂ ਸੁਰੱਖਿਅਤ ਹੈਜੰਤਰ ਹਟਾਇਆ ਗਿਆ ਜਾਂ ਪਲੱਗ ਕੱਢਿਆਇੰਕ੍ਰਿਪਟ ਕੀਤਾ ਡਾਟਾ ਠੀਕ ਨਹੀਂ ਜਾਂ ਪਛਾਣ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀਇੰਕ੍ਰਿਪਟ ਕੀਤਾ ਡਾਟਾ ਬਹੁਤ ਲੰਮਾ ਹੈਖੇਤਰ ਗਲਤ ਹੈ ਜਾਂ ਮੌਜੂਦ ਨਹੀਂ ਹੈਖੇਤਰ ਕੇਵਲ ਪੜ੍ਹਨ ਲਈ ਹੈਕੁੰਜੀ ਪਹਿਲਾਂ ਤੋਂ ਵੱਖਰੀ ਹੈਕੁੰਜੀ ਮੌਜੂਦ ਨਹੀਂ ਜਾਂ ਗਲਤ ਹੈਕੁੰਜੀ ਦੀ ਕਿਸਮ ਗਲਤ ਹੈਕੁੰਜੀ ਦਾ ਆਕਾਰ ਗਲਤ ਹੈਮੋਡੀਊਲ ਲੋੜੀਦੇ ਥਰਿੱਡ ਨਹੀਂ ਬਣਾ ਸਕਦਾ ਹੈਮੋਡੀਊਲ ਲਾਕ ਡਾਟਾ ਠੀਕ ਤਰ੍ਹਾਂ ਨਹੀਂ ਕਰ ਸਕਦਾ ਹੈਮੋਡੀਊਲ ਪਹਿਲਾਂ ਹੀ ਸ਼ੁਰੂ ਕੀਤਾ ਜਾ ਚੁੱਕਾ ਹੈਮੋਡੀਊਲ ਸ਼ੁਰੂ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾਆਬਜੈਕਟ ਗੁੰਮ ਹੈ ਜਾਂ ਗਲਤ ਹੈਕਾਰਵਾਈ ਫੇਲ੍ਹ ਹੋਈਕਾਰਵਾਈ ਰੱਦ ਕੀਤੀ ਗਈਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਦੀ ਮਿਆਦ ਪੁੱਗ ਚੁੱਕੀ ਹੈਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਗਲਤ ਹੈਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਅਵੈਧ ਹੈਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਲਾਕ ਹੈਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਦੀ ਲੰਬਾਈ ਗਲਤ ਹੈਸੰਭਾਲੀ ਹਾਲਤ ਗਲਤ ਹੈਸ਼ੈਸ਼ਨ ਬੰਦ ਹੈਸ਼ੈਸ਼ਨ ਗਲਤ ਹੈਸ਼ੈਸ਼ਨ ਕੇਵਲ ਪੜ੍ਹਨ ਲਈ ਹਦਸਤਖਤ ਖ਼ਰਾਬ ਜਾਂ ਨਿਕਾਰਾ ਹਨਦਸਤਖਤ ਬੇਪਛਾਣ ਜਾਂ ਨਿਕਾਰਾ ਹਨਦਿੱਤੀ ਸਲਾਟ ID ਉਪਲੱਬਧ ਨਹੀਂਹਾਲਤ ਸੰਭਾਲੀ ਨਹੀਂ ਜਾ ਸਕਦੀਯੂਜ਼ਰ ਦੀ ਕਿਸਮ ਗਲਤ ਹੈਯੂਜ਼ਰ ਦਾ ਪਾਸਵਰਡ ਜਾਂ ਪਿੰਨ ਸੈੱਟ ਨਹੀਂ ਹੈਇਹ ਕਾਰਵਾਈ ਇਸ ਕੁੰਜੀ ਨਾਲ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ ਹੈਇਹ ਕਾਰਵਾਈ ਸਹਾਇਕ ਨਹੀਂ ਹੈਬਹੁਤ ਸਾਰੇ ਸ਼ੈਸ਼ਨ ਐਕਟਿਵ ਹਨਰੈਂਡਮ ਨੰਬਰ ਜਰਨੇਟਰ ਸ਼ੁਰੂ ਕਰਨ ਲਈ ਅਸਮਰੱਥਅਣਜਾਣ ਗਲਤੀਤੁਸੀਂ ਪਹਿਲਾਂ ਹੀ ਲਾਗਇਨ ਹੋp11-kit-0.20.2/po/fr.gmo0000664000175000017500000000073712265245673011460 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: French Language: fr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); p11-kit-0.20.2/po/hr.gmo0000664000175000017500000001706612265245673011465 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\c!v!"!!!;*]&) '/9+i*' "7Zj$, -&-T.6(/%E&k3 "";+^05!2L'j+"/)Eo''>"[&~+, 38l34!D KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-10-04 20:37+0000 Last-Translator: Tomislav Krznar Language-Team: Croatian Language: hr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; Potreban je ključPostoji sjednica samo za čitanjePostoji administratorska sjednicaDošlo je do pogreške na uređajuPostoji otvorena sjednicaVeć se izvršava druga operacijaDrugi korisnik je već prijavljenNe mogu izvesti neispravan ključNe mogu izvesti ključ pogrešne veličineNe mogu izvesti ključ pogrešne vrsteNe mogu izvesti ključNe mogu uvesti ključ pogrešne veličineNe mogu uvesti neispravan ključNe mogu uvesti zbog neispravnog ključaNe mogu uvesti zbog ključa pogrešne veličineNe mogu uvesti zbog ključa pogrešne vrsteNe mogu uključiti ključ u kontrolnu sumuNe mogu zaključati podatkeNeka polja imaju neispravne vrijednostiNedostaju neka nužna poljaNema dovoljno memorijeNema dovoljno memorije na uređajuInterna greškaNeispravni argumentiNeispravna vrijednost za poljeKljuč nije potrebanNe izvršava se niti jedna operacijaNema dostupnih generatora slučajnih brojevaNijedan korisnik nije prijavljenNema dovoljno prostora za spremanje rezultataMehanizam kriptiranja ima neispravan argumentMehanizam kriptiranja ima neispravan parametarMehanizam kriptiranja nije prepoznat ili nije ispravanPodaci se ne mogu zaključatiPodaci nisu prepoznati ili nisu ispravniPodaci su predugačkiUređaj je neispravan ili neprepoznatUređaj nije prisutan ili je iskopčanUređaj ima zaštitu pisanjaUređaj je uklonjenKriptirani podaci nisu prepoznati ili nisu ispravniKriptirani podaci su predugačkiPolje ne postoji ili nije ispravnoPolje ima dozvole samo za čitanjePolje je osjetljivo i ne može se prikazatiInformacije su osjetljive i ne mogu se prikazatiSadržaj ključa se ne može prelomiti u više redakaKljuč se razlikuje od prethodnogNema ključa ili nije ispravanKljuč je pogrešne vrsteKljuč je pogrešne veličineModul ne može stvoriti potrebne dretveModul ne može pravilno zaključati podatkeModul je već inicijaliziranModul nije inicijaliziranNedostaje objekt ili nije ispravanOperacija nije uspjelaOperacija je otkazanaLozinki ili PIN-u je istekao rok trajanjaLozinka ili PIN su pogrešniLozinka ili PIN nisu ispravniLozinka ili PIN su zaključaniLozinka ili PIN nemaju ispravnu duljinuSpremljeno stanje nije ispravnoSjednica je zatvorenaSjednica nije ispravnaSjednica je samo za čitanjePotpis je neispravan ili oštećenPotpis nije prepoznat ili je oštećenIdentifikator navedenog utora nije ispravanStanje se ne može spremitiVrsta korisnika nije ispravnaKorisnička lozinka ili PIN nisu postavljeniOva operacija se ne može izvršiti s ovim ključemOva operacija nije podržanaPreviše sjednica je aktivnoPrijavljeno je previše korisnika različitih vrstaNe mogu inicijalizirati generator slučajnih brojevaNepoznata greškaVeć ste prijavljenip11-kit-0.20.2/po/ka.po0000664000175000017500000002246112265245673011276 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # George Machitidze , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-08-21 18:45+0000\n" "Last-Translator: George Machitidze \n" "Language-Team: Georgian (http://www.transifex.com/projects/p/freedesktop/" "language/ka/)\n" "Language: ka\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "ოპერაცია შეწყვეტილ იქნა" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "ხელმისაწვდომი მეხსიერება არასაკმარისია" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "მითითებული სლოტის ID არასწორია" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "შიდა შეცდომა" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "ოპერაცია ვერ განხორციელდა" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "არგუმენტები არასწორია" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "ველი მხოლოდ კითხვადია" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "ველი მგრძნობიარეა და მისი გამოტანა არ არის დაშვებული" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "ველი არასწორია ან არ არსებობს" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "ცვლადის მნიშვნელობა არასწორია" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "მონაცემები არასწორია ან ამოუცნობი" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "მონაცემები ძალიან დიდია" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "შეცდომა მოწყობილობაში" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "დაშიფრული მონაცემები არასწორია ან ამოუცნოი" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "დაშიფრული მონაცემები ძალიან დიდია" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "ოპერაცია არ არის მხარდაჭერილი" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "გასაღები არ არის ან არასწორია" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "გასაღები არასწორი ზომისაა" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "გასაღები არასწორი ტიპისაა" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "გასაღები არ არის საჭირო" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "გასაღები ძველისგან განსხვავდება" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "საჭიროა გასაღები" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "ამ გასაღების დაექსპორტება შეუძლებელია" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "ობიექტი არ არის ან არასწორია" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "პაროლი ან PIN მცდარია" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "პაროლი ან PIN არასწორია" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "სესია დაკეტილია" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "სესია არასწორია" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "სესია მხოლოდ კითხვადია" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "მონაცემების დაბლოკვა შეუძლებელია" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "ხელმოწერის მოთხოვნა უარყოფილია მომხმარებლის მიერ" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "უცნობი შეცდომა" p11-kit-0.20.2/po/ml.gmo0000664000175000017500000000101612265245674011451 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Malayalam (http://www.transifex.com/projects/p/freedesktop/language/ml/) Language: ml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/as.gmo0000664000175000017500000000101512265245673011442 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Assamese (http://www.transifex.com/projects/p/freedesktop/language/as/) Language: as MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/hu.gmo0000664000175000017500000001722312265245674011464 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\&$)Ku !,1343h(&.060g#1$ .0C t1,7.d92%A.V-87$='b13#$9^~64!#(@i . @a|!&)%&?:f+82<oD KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-05-03 23:26+0000 Last-Translator: kelemeng Language-Team: Hungarian Language: hu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Kulcs szükségesMár létezik írásvédett munkamenetMár létezik adminisztrátori munkamenetHiba történt az eszközönMár létezik nyitott munkamenetMár folyamatban van egy műveletMár bejelentkezett egy másik felhasználóNem lehet exportálni, mert a kulcs érvénytelenNem lehet exportálni, mert a kulcs hibás méretűNem lehet exportálni, mert a kulcs hibás típusúA kulcs nem exportálhatóNem importálható hibás méretű kulcsNem importálható érvénytelen kulcsNem importálható, mert a kulcs érvénytelenNem importálható, mert a kulcs hibás méretűNem importálható, mert a kulcs hibás típusúA kivonatba nem vehető fel a kulcsNem zárolhatók az adatokNéhány szükséges mező értéke érvénytelenNéhány szükséges mező hiányzikNincs elég memóriaNem érhető el elegendő memória az eszközönBelső hibaÉrvénytelen argumentumokA mező értéke érvénytelenNem szükséges kulcsNincs folyamatban műveletNem áll rendelkezésre véletlenszám-generátorSenki sem jelentkezett beNincs elég hely az eredmény tárolásáhozA titkosítási mód argumentuma érvénytelenA titkosítási mechanizmus egy paramétere érvénytelenA titkosítási mód érvénytelen vagy ismeretlenAz adatok nem zárolhatókAz adat érvénytelen vagy ismeretlenAz adat túl hosszúAz eszköz érvénytelen vagy felismerhetetlenAz eszköz nincs jelen vagy eltávolítottákAz eszköz írásvédettAz eszköz eltávolításra vagy leválasztásra kerültA titkosított adatok érvénytelenek vagy ismeretlenekA titkosított adatok túl hosszúakA mező érvénytelen vagy nem létezikA mező írásvédettA mező adatai érzékenyek és nem fedhetők felAz információk érzékenyek és nem fedhetők felA kulcs nem alakítható átA kulcs megváltozottA kulcs hiányzik vagy érvénytelenA kulcs nem megfelelő típusúA kulcs mérete hibásA modul nem képes létrehozni a szükséges szálakatA modul nem képes megfelelően zárolni az adatokatA modul már elő lett készítveA modul nincs előkészítveAz objektum hiányzik vagy érvénytelenA művelet meghiúsultA művelet megszakítvaA jelszó vagy PIN lejártA jelszó vagy PIN helytelenA jelszó vagy PIN érvénytelenA jelszó vagy PIN zárolva vanA jelszó vagy PIN érvénytelen hosszúságúA mentett állapot érvénytelenA munkamenet le van zárvaA munkamenet érvénytelenA munkamenet írásvédettAz aláírás rossz vagy sérültAz aláírás ismeretlen vagy sérültA megadott helyazonosító nem érvényesAz állapot nem menthetőA felhasználó érvénytelen típusúA felhasználó jelszava vagy PIN kódja nincs beállítvaEz a művelet nem végezhető el a kulccsalA művelet nem támogatottTúl sok munkamenet aktívTúl sok eltérő típusú felhasználó jelentkezett beA véletlenszám-generátor nem készíthető előIsmeretlen hibaMár bejelentkezettp11-kit-0.20.2/po/bn_IN.po0000664000175000017500000001562012265245672011666 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Bengali (India) (http://www.transifex.com/projects/p/" "freedesktop/language/bn_IN/)\n" "Language: bn_IN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/fo.po0000664000175000017500000001560212265245672011305 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Faroese (http://www.transifex.com/projects/p/freedesktop/" "language/fo/)\n" "Language: fo\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/ca.po0000664000175000017500000001560212265245672011264 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Catalan (http://www.transifex.com/projects/p/freedesktop/" "language/ca/)\n" "Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/mr.po0000664000175000017500000001560212265245673011320 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Marathi (http://www.transifex.com/projects/p/freedesktop/" "language/mr/)\n" "Language: mr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/ar.po0000664000175000017500000001572712265245672011313 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Arabic (http://www.transifex.com/projects/p/freedesktop/" "language/ar/)\n" "Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/sk.po0000664000175000017500000001563412265245673011324 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Slovak (http://www.transifex.com/projects/p/freedesktop/" "language/sk/)\n" "Language: sk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/fi.gmo0000664000175000017500000001770412265245673011451 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\8%H(n%7-)9W:"/&1F=xB1+8B({28-K,y4/- *9>d74 +?k!?5>;\:!&0!W/y%!#;%R(x&"/ <Ph,7(.+;Z:!P+d"D KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2013-02-13 17:07+0000 Last-Translator: Stef Walter Language-Team: Finnish (http://www.transifex.com/projects/p/freedesktop/language/fi/) Language: fi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Avain vaaditaanLukutilassa oleva istunto on olemassaYlläpitäjän istunto on olemassaTapahtui virhe laitteellaAvoin istunto on olemassaToinen toiminto on jo käynnissäToinen käyttäjä on jo kirjautunut sisäänVienti ei onnistu koska avain on virheellinenVienti ei onnistu koska avain on väärän kokoinenVienti ei onnistu koska avain on väärän tyyppinenTätä avainta ei voi viedäVäärän kokoista avainta ei voida tuodaVirheellistä avainta ei voida tuodaTuonti epäonnistui koska avain on virheellinenTuonti epäonnistui koska avain on väärän kokoinenTuonti epäonnistui koska avain on väärää tyyppiäAvainta ei voi sisällyttää tiivisteeseenTietoa ei voida lukitaJotkin kentät sisältävät virheellisia arvojaJotkut vaadituista kentistä puuttuvatMuisti ei riitäLaitteen muistimäärä liian vähäinenSisäinen virheVirheellisiä argumenttejaKentän arvo on virheellinenAvainta ei vaaditaYhtään toimintoa ei ole käynnissäSatunnaislukugeneraattoria ei ole saatavillaKäyttäjiä ei ole kirjautuneena sisäänLiian vähän tilaa tulosten tallentamiseenSalausmekanismissa on virheellinen argumenttiSalausmekanismin parametri on virheellinenSalausmekanismi on virheellinen tai sitä ei voida tunnistaaTietoa ei voida lukitaTieto ei ole kelvollista tai sitä ei voida tunnistaaTieto on liian pitkäLaite on virheellinen tai sitä ei voida tunnistaaLaite ei ole saatavilla tai se on irrotettuLaite on kirjoitussuojattuLaite poistettiin tai irrotettiinSalattu tieto ei ole kelvollista tai sitä ei voida tunnistaaSalattu tieto on liian pitkäKenttä on virheellinen tai sitä ei ole olemassaKenttä on vain luettavissaKenttä on arkaluonteinen eikä sitä voida paljastaaTieto on luottamuksellista eikä sitä voida paljastaaAvainta ei voi rivittääAvain on eri kuin aikaisempiAvain puuttuu tai on virheellinenAvain on väärää tyyppiäAvain on väärän kokoinenModuuli ei voi luoda vaadittavia säikeitäModuuli ei voi lukita tietoa kunnollaModuuli on jo alustettuModuulia ei ole alustettuKohde puuttuu tai on virheellinenToiminto epäonnistuiToiminto keskeytettiinSalasana tai PIN-koodi on vanhentunutSalasana tai PIN-koodi on vääräSalasana tai PIN-koodi on virheellinenSalasana tai PIN-koodin on lukittuSalasanan tai PIN-koodin pituus on virheellinenTallennettu tila on virheellinenIstunto on suljettuIstunto on virheellinenIstunto on vain luettavissaAllekirjoitus on virheellinen tai vioittunutAllekirjoitusta ei voida tunnistaa tai se on vioittunutAnnettu lohkotunniste ei ole kelvollinenTilaa ei voida tallentaaKäyttäjä on väärän tyyppinenKäyttäjän salasanaa tai PIN-koodia ei ole asetettuTätä toimintoa ei voi tehdä tällä avaimellaTämä toiminto ei ole tuettuLiian monta aktiivista istuntoaLiian monta eri tyyppistä käyttäjää on kirjautuneena sisäänSatunnaislukugeneraattoria ei voida alustaaTuntematon virheOlet jo kirjautuneena sisäänp11-kit-0.20.2/po/zh_HK.po0000664000175000017500000001561512265245673011711 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese (Hong Kong) (http://www.transifex.com/projects/p/" "freedesktop/language/zh_HK/)\n" "Language: zh_HK\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/fo.gmo0000664000175000017500000000101412265245673011442 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Faroese (http://www.transifex.com/projects/p/freedesktop/language/fo/) Language: fo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/remove-potcdate.sin0000644000175000017500000000066012265207774014147 00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } p11-kit-0.20.2/po/sl.po0000664000175000017500000002304712265245673011322 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Martin Srebotnjak , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-06-04 06:55+0000\n" "Last-Translator: Martin Srebotnjak \n" "Language-Team: Slovenian \n" "Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" "%100==4 ? 2 : 3);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Operacija je bila preklicana" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Na voljo ni dovolj pomnilnika" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "Navedeni ID mesta ni veljaven" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Notranja napaka" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Operacija ni uspela" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Neveljavni argumenti" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "Modul ne more ustvariti potrebnih niti" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "Modul ne more ustrezno zakleniti podatkov" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Polje je samo za branje" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Polje je občutljive narave in ga ni mogoče razkriti" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Polje ni veljavno ali ne obstaja" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Neveljavna vrednost za polje" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Podatki niso veljavni ali prepoznavni" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Podatki so preobsežni" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Na napravi je prišlo do naprave" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Na napravi ni dovolj pomnilnika" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Naprava je bila odstranjena ali iztaknjena" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "Šifrirani podatki niso veljavni ali prepoznavni" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Šifrirani podatki so preobsežni" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Ta operacija ni podprta" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Ključ manjka ali ni veljaven" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "Ključ je napačne velikosti" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "Ključ je napačne vrste" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Ključ ni potreben" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "Ključ se razlikuje od prejšnjega" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Potreben je ključ" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Ključa ni mogoče vključiti v povzetek" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "S tem ključem te operacije ni moč opraviti" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "Ključa ni mogoče ovijati" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Tega ključa ni mogoče izvoziti" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "Šifrirni mehanizem ni veljaven ali prepoznan" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Šifrirni mehanizem ima neveljaven argument" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Predmet manjka ali ni veljaven" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Poteka že druga operacija" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Ne poteka nobena operacija" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Geslo ali PIN ni pravilen" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Geslo ali PIN ni veljaven" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Geslo ali PIN ni ustrezne dolžine" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Geslo ali PIN je potekel" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Geslo ali PIN je zaklenjen" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "Seja je zaprta" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Aktivnih je preveč sej" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "Seja ni veljavna" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "Seja je samo za branje" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Obstaja odprta seja" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Obstaja seja le za branje" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Obstaja skrbniška seja" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "Podpis je slab ali okvarjen" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "Podpis ni razpoznaven ali je okvarjen" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Določena obvezna polja manjkajo" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Določena polja imajo neveljavne vrednosti" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Naprava ni prisotna ali pa je iztaknjena" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Naprava ni veljavna ali prepoznavna" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Naprava je zaščitena pred pisanjem" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Uvoz ni možen, ker je ključ neveljaven" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Ker ključ ni ustrezne velikosti, uvoz ni mogoč" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Ker ključ ni ustrezne vrste, uvoz ni mogoč" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Ste že prijavljeni" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Prijavil se ni noben uporabnik" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "Geslo ali PIN uporabnika ni nastavljen" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "Uporabnik je neveljavne vrste" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Prijavljen je že drug uporabnik" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Prijavljenih je preveč uporabnikov različnih vrst" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Neveljavnega ključa ni mogoče uvoziti" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Ključa neprimerne velikosti ni mogoče uvoziti" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Ključa ni mogoče izvoziti, ker je neveljaven" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Ključa ni mogoče izvoziti, ker ni ustrezne velikosti" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Ključa ni mogoče izvoziti, ker je napačne vrste" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Generatorja naključnih števil ni mogoče inicializirati" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Noben generator naključnih števil ni na voljo" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Mehanizem šifriranja ima neveljaven parameter" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Za shranjevanje rezultata primanjkuje prostora" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "Shranjeno stanje ni veljavno" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Podatki so občutljive narave in jih ni mogoče razkriti" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Stanja ni mogoče shraniti" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "Modil ni bil inicializiran" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Modul je že inicializiran" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Podatkov ni mogoče zakleniti" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Podatkov ni mogoče zakleniti" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "Zahtevo po podpisu je zavrnil uporabnik" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Neznana napaka" p11-kit-0.20.2/po/hi.gmo0000664000175000017500000000101212265245673011434 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Hindi (http://www.transifex.com/projects/p/freedesktop/language/hi/) Language: hi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/en@boldquot.gmo0000664000175000017500000001672012265243754013322 00000000000000Rm<<\)s!(22N%e(22 $7 \ "m #  +    7 H $e  $ , - / P %j  ' &  # /6 f &  - 3 % ? ` ~  ' $ '#* No +$Jo!*"@Z%y+/08 iw0@[{)!(2'2Z%(22C$v"#+=L^v$$,-1/_%'& 3#Q/u&-30d ~'$'A#i   ?+]$!*1"\%+ */G0w E LM2*B4)@R<?OJ 3 Q810=#!HD(.AG:5,>6-+ IP"&'9 F%N7;$K/ CA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe request was rejected by the userThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit 0.20.2 Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2014-01-14 15:21+0100 Last-Translator: Automatically generated Language-Team: none Language: en@boldquot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); A key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe request was rejected by the userThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inp11-kit-0.20.2/po/pl.gmo0000664000175000017500000001777012265245674011472 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\p %% >F>?%5*0`==> (Lu.%@FY!r%,&:&9a9?)3]1q0(/6- d)062N#n.- $E$e#&##0G!x#( 03d&~2?#<:Z1 D KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-03-10 20:27+0000 Last-Translator: Piotr Drąg Language-Team: Polish (http://www.transifex.com/projects/p/freedesktop/language/pl/) Language: pl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); Wymagany jest kluczIstnieje sesja tylko do odczytuIstnieje sesja administratoraWystąpił błąd na urządzeniuIstnieje otwarta sesjaInne działanie jest teraz wykonywaneInny użytkownik jest już zalogowanyNie można wyeksportować, ponieważ klucz jest nieprawidłowyNie można wyeksportować, ponieważ klucz ma błędny rozmiarNie można wyeksportować, ponieważ klucz jest błędnego typuNie można wyeksportować tego kluczaNie można zaimportować klucza o błędnym rozmiarzeNie można zaimportować nieprawidłowego kluczaNie można zaimportować, ponieważ klucz jest nieprawidłowyNie można zaimportować, ponieważ klucz ma błędny rozmiarNie można zaimportować, ponieważ klucz jest błędnego typuNie można dołączyć klucza w wyciąguNie można zablokować danychPewne pola zawierają nieprawidłowe wartościBrak pewnych wymaganych pólBrak wystarczającej ilości pamięciDostępna jest niewystarczająca ilość pamięci na urządzeniuWewnętrzny błądNieprawidłowe parametryNieprawidłowa wartość dla polaKlucz nie jest wymaganyŻadne działanie nie jest wykonywaneBrak dostępnych generatorów liczb losowychŻaden użytkownik nie jest zalogowanyBrak wystarczającej ilości miejsca, by przechować wynikMechanizm kryptograficzny posiada nieprawidłowy parametrMechanizm kryptograficzny posiada nieprawidłowy parametrMechanizm kryptograficzny jest nieprawidłowy lub nierozpoznanyNie można zablokować danychDane są nieprawidłowe lub nierozpoznaneDane są za długieUrządzenie jest nieprawidłowe lub nierozpoznaneUrządzenie nie jest obecne lub jest odłączoneUrządzenie jest chronione przed zapisemUrządzenie zostało usunięte lub rozłączoneZaszyfrowane dane są nieprawidłowe lub nierozpoznaneZaszyfrowane dane są za długiePole jest nieprawidłowe lub nie istniejePole jest tylko do odczytuPole jest prywatne i nie może zostać ujawnioneInformacja jest prywatna i nie może zostać ujawnionaNie można opakować kluczaKlucz jest inny niż poprzednioBrak klucza lub jest nieprawidłowyKlucz jest błędnego typuKlucz ma błędny rozmiarModuł nie może utworzyć wymaganych wątkówModuł nie może poprawnie zablokować danychModuł został już zainicjowanyModuł nie został zainicjowanyBrak obiektu lub jest nieprawidłowyDziałanie się nie powiodłoAnulowano działanieHasło lub kod PIN wygasłHasło lub kod PIN jest niepoprawnyHasło lub kod PIN jest nieprawidłowyHasło lub kod PIN jest zablokowanyHasło lub kod PIN ma nieprawidłową długośćZapisany stan jest nieprawidłowySesja jest zamkniętaSesja jest nieprawidłowaSesja jest tylko do odczytuPodpis jest błędny lub uszkodzonyPodpis jest nierozpoznany lub uszkodzonyPodany identyfikator gniazda jest nieprawidłowyNie można zapisać stanuUżytkownik jest nieprawidłowego typuHasło lub kod PIN użytkownika nie jest ustawionyTo działanie nie może zostać wykonane za pomocą tego kluczaTo działanie nie jest obsługiwaneZa dużo sesji jest aktywnychZa dużo użytkowników różnych typów jest zalogowanychNie można zainicjować generatora liczb losowychNieznany błądUżytkownik jest już zalogowanyp11-kit-0.20.2/po/kn.gmo0000664000175000017500000000100512265245674011447 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Kannada (http://www.transifex.com/projects/p/freedesktop/language/kn/) Language: kn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; p11-kit-0.20.2/po/az.po0000664000175000017500000001557712265245672011326 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Azerbaijani (http://www.transifex.com/projects/p/freedesktop/" "language/az/)\n" "Language: az\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/kn.po0000664000175000017500000001557312265245673011321 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Kannada (http://www.transifex.com/projects/p/freedesktop/" "language/kn/)\n" "Language: kn\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/lv.po0000664000175000017500000002322712265245673011325 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Rūdolfs Mazurs , 2013. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2013-02-10 17:38+0000\n" "Last-Translator: Rūdolfs Mazurs \n" "Language-Team: Latvian (http://www.transifex.com/projects/p/freedesktop/" "language/lv/)\n" "Language: lv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " "2);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Darbība tika atcelta" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Nav pietiekami daudz brīvas atmiņas" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "Norādītais slota ID nav derīgs" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Iekšēja kļūda" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Darbība cieta neveiksmi" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Nederīgi parametri" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "Modulis nevar izveidot vajadzīgos pavedienus" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "Modulis nevar noslēgt datu īpašību" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Lauks ir tikai lasāms" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Lauks ir sensitīvs un to nevar atklāt" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Lauks ir nederīgs vai arī neeksistē" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Nederīga vērtība vai lauks" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Dati nav derīgi vai arī nav atpazīti" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Pārāk daudz datu" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Uz ierīces gadījās kļūda" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Uz ierīces nepietiek brīvās atmiņas" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Ierīce tika izņemta vai atvienota" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "Šifrētie dati nav derīgi vai nav atpazīti" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Šifrētie dati ir pārāk daudz" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Darbība nav atbalstīta" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Trūkst vai nav derīga atslēga" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "Atslēgai ir nepareizs izmērs" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "Atslēgai ir nepareizs tips" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Atslēgas nav vajadzīgas" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "Atslēga ir citādāka, kā iepriekš" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Ir nepieciešama atslēga" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Īssavilkumā nevar iekļaut atslēgu" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Ar šo atslēgu nevar izpildīt šo darbību" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "Atslēgu nevar ietīt" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Nevar eksportēt šo atslēgu" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "Šifrēšanas mehānisms ir nederīgs vai nav atpazīts" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Šifrēšanas mehānismam ir nederīgi parametri" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Trūkst objekta, vai arī tas ir nederīgs" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Jau notiek cita darbība" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Pašlaik nenotiek neviena darbība" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Parole vai PIN nav pareiza" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Parole vai PIN nav derīga" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Parolei vai PIN ir nederīgs garums" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Parolei vai PIN ir beidzies termiņš" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Parole vai PIN ir bloķēta" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "Sesija ir aizvērta" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Ir pārāk daudz aktīvu sesiju" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "Sesija nav derīga" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "Sesija ir tikai lasāma" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Eksistē atvērta sesija" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Eksistē tikai lasāma sesija" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Eksistē administratora sesija" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "Paraksts ir slikts vai bojāts" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "Paraksts ir neatpazīts vai bojāts" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Trūkst noteikti pieprasītie lauki" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Noteiktiem laukiem ir nederīgas vērtības" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Ierīce nav pievienota" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Ierīce ir nederīga vai nav atpazīta" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Ierīcē nevar rakstīt" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Nevar importēt, jo atslēga nav derīga" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Nevar importēt, jo atslēgai ir nepareizs izmērs" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Nevar importēt, jo atslēgai ir nepareizs tips" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Jūs jau esat ierakstījies" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Neviens lietotājs nav ierakstījies" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "Lietotāja parole vai PIN nav iestatīta" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "Lietotājam ir nederīgs tips" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Kāds cits lietotājs jau ir ierakstījies" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Ir ierakstījušies pārāk daudz dažādu veidu lietotāji" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Nevar importēt nederīgu atslēgu" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Nevar eksportēt, jo atslēgai ir nepareizs izmērs" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Nevar eksportēt, jo atslēga ir nederīga" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Nevar eksportēt, jo atslēgai ir nepareizs izmērs" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Nevar eksportēt, jo atslēgai ir nepareizs tips" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Nevar inicializēt nejaušo skaitļu ģeneratoru" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Nav pieejams nejaušo skaitļu ģenerators" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Šifrēšanas mehānismam ir nederīgs parametrs" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Nepietiek vietas, lai saglabātu rezultātu" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "Saglabātais stāvoklis nav derīgs" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Informācija ir sensitīva un to nevar atklāt" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Stāvokli nevar saglabāt" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "Modulis nav inicializēts" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Modulis jau ir inicializēts" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Nevar noslēgt datus" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Datus nevar noslēgt" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "Lietotājs noraidīja paraksta pieprasījumu" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Nezināma kļūda" p11-kit-0.20.2/po/nl.gmo0000664000175000017500000001762612265245674011470 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\F^|$+)0(?Y> 4%.0T>>%)(D#m 0  ,9(f/137C#{,(-)6+`9$ 4$9Y!#$&4A4v#"'!D"f!$0!#;Q(k6#$05E:{%;97qD KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-04-18 16:10+0000 Last-Translator: Richard E. van der Luit Language-Team: Dutch (http://www.transifex.com/projects/p/freedesktop/language/nl/) Language: nl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Er is een sleutel nodigEr is een alleen-lezen sessieEr is een beheerder sessieEr trad een fout op bij het apparaatEr is een open sessieEr wordt al een andere bewerking uitgevoerdEr is reeds een andere gebruiker ingelogdKan niet exporteren omdat de sleutel ongeldig isKan niet exporteren omdat de sleutel de verkeerde grootte heeftKan niet exporteren omdat de sleutel van het verkeerde type isKan deze sleutel niet exporterenKan geen sleutel importeren van de verkeerde grootteKan geen ongeldige sleutel importerenKan niet importeren omdat de sleutel ongeldig isKan niet importeren omdat de sleutel de verkeerde lengte heeftKan niet importeren omdat de sleutel van het verkeerde type isKan geen sleutel in de digest opnemenKan data niet vergrendelenBepaalde velden hebben ongeldige waardenSommige verplichte velden ontbrekenOnvoldoende geheugen beschikbaarOnvoldoende geheugen op het apparaat beschikbaarInterne foutOngeldige argumentenOngeldige waarde voor veldEr is geen sleutel nodigEr wordt momenteel geen bewerking uitgevoerdGeen random-number-generator beschikbaarEr is geen gebruiker ingelogdNiet genoeg ruimte om het resultaat op te slaanHet crypto mechanisme heeft een ongeldig argumentHet crypto mechanisme heeft een ongeldige parameterHet crypto mechanisme is ongeldig of wordt niet herkendDe data kan niet vergrendeld wordenDe data is niet geldig of wordt niet herkendDe data is te langHet apparaat is ongeldig of onherkenbaarHet apparaat is niet aanwezig of afgekoppeld Het apparaat is beveiligd tegen schrijvenHet apparaat werd verwijderd of afgekoppeldDe versleutelde data is niet geldig of wordt niet herkendDe versleutelde data is te langHet veld is ongeldig of bestaat nietHet veld is alleen-lezenHet veld is vertrouwelijk en kan niet worden onthuldDe informatie is vertrouwelijk en kan niet worden onthuldSleutelwrapping niet geluktDe sleutel is anders dan voorheenDe sleutel ontbreekt of is ongeldigDe sleutel is van het verkeerde typeDe sleutel heeft een verkeerde grootteDe module kan de noodzakelijke threads niet aanmakenDe module kan de data niet naar behoren vergrendelenDe module is reeds geïnitialiseerdDe module is niet geïnitialiseerdHet object mist of is ongeldigDe bewerking mislukteDe bewerking werd afgebrokenHet wachtwoord of PIN is verlopenHet wachtwoord of PIN in incorrectHet wachtwoord of PIN is ongeldigHet wachtwoord of PIN is vergrendeldHet wachtwoord of PIN heeft een ongeldige lengteDe opgeslagen status is ongeldig De sessie is afgeslotenDe sessie is ongeldigDe sessie is alleen-lezenDe handtekening is fout of gecorrumpeerdDe handtekening wordt niet herkend of is gecorrumpeerdDe opgegeven slot ID is niet geldigDe status kan niet opgeslagen wordenDe gebruiker is van het verkeerde gebruikerstypeHet wachtwoord of PIN van gebruiker is niet ingesteldDeze bewerking kan niet met deze sleutel uitgevoerd wordenDeze bewerking wordt niet ondersteundEr zijn te veel sessies actiefEr zijn te veel gebruikers van verschillende types ingelogdNiet in staat de random-number-generator te initialiserenOnbekende foutU bent reeds ingelogdp11-kit-0.20.2/po/ta.po0000664000175000017500000001560012265245673011304 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Tamil (http://www.transifex.com/projects/p/freedesktop/" "language/ta/)\n" "Language: ta\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/zh_HK.gmo0000664000175000017500000000102712265245674012046 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Chinese (Hong Kong) (http://www.transifex.com/projects/p/freedesktop/language/zh_HK/) Language: zh_HK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; p11-kit-0.20.2/po/fa.po0000664000175000017500000001557312265245672011276 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Persian (http://www.transifex.com/projects/p/freedesktop/" "language/fa/)\n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/pt.po0000664000175000017500000001560512265245673011330 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Portuguese (http://www.transifex.com/projects/p/freedesktop/" "language/pt/)\n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/ro.gmo0000664000175000017500000000106612265245674011466 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Romanian (http://www.transifex.com/projects/p/freedesktop/language/ro/) Language: ro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1)); p11-kit-0.20.2/po/en@boldquot.header0000644000175000017500000000247112265207774013766 00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # p11-kit-0.20.2/po/lv.gmo0000664000175000017500000001705012265245674011467 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\c}* *53`03"(:2c/%+#-%Q'w"* $K+p0076'Ks&#- .&Ov'.% A]-|&*3L%b##"6Ia#!(,'Tm;0 D KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2013-02-10 17:38+0000 Last-Translator: Rūdolfs Mazurs Language-Team: Latvian (http://www.transifex.com/projects/p/freedesktop/language/lv/) Language: lv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2); Ir nepieciešama atslēgaEksistē tikai lasāma sesijaEksistē administratora sesijaUz ierīces gadījās kļūdaEksistē atvērta sesijaJau notiek cita darbībaKāds cits lietotājs jau ir ierakstījiesNevar eksportēt, jo atslēga ir nederīgaNevar eksportēt, jo atslēgai ir nepareizs izmērsNevar eksportēt, jo atslēgai ir nepareizs tipsNevar eksportēt šo atslēguNevar eksportēt, jo atslēgai ir nepareizs izmērsNevar importēt nederīgu atslēguNevar importēt, jo atslēga nav derīgaNevar importēt, jo atslēgai ir nepareizs izmērsNevar importēt, jo atslēgai ir nepareizs tipsĪssavilkumā nevar iekļaut atslēguNevar noslēgt datusNoteiktiem laukiem ir nederīgas vērtībasTrūkst noteikti pieprasītie laukiNav pietiekami daudz brīvas atmiņasUz ierīces nepietiek brīvās atmiņasIekšēja kļūdaNederīgi parametriNederīga vērtība vai lauksAtslēgas nav vajadzīgasPašlaik nenotiek neviena darbībaNav pieejams nejaušo skaitļu ģeneratorsNeviens lietotājs nav ierakstījiesNepietiek vietas, lai saglabātu rezultātuŠifrēšanas mehānismam ir nederīgi parametriŠifrēšanas mehānismam ir nederīgs parametrsŠifrēšanas mehānisms ir nederīgs vai nav atpazītsDatus nevar noslēgtDati nav derīgi vai arī nav atpazītiPārāk daudz datuIerīce ir nederīga vai nav atpazītaIerīce nav pievienotaIerīcē nevar rakstītIerīce tika izņemta vai atvienotaŠifrētie dati nav derīgi vai nav atpazītiŠifrētie dati ir pārāk daudzLauks ir nederīgs vai arī neeksistēLauks ir tikai lasāmsLauks ir sensitīvs un to nevar atklātInformācija ir sensitīva un to nevar atklātAtslēgu nevar ietītAtslēga ir citādāka, kā iepriekšTrūkst vai nav derīga atslēgaAtslēgai ir nepareizs tipsAtslēgai ir nepareizs izmērsModulis nevar izveidot vajadzīgos pavedienusModulis nevar noslēgt datu īpašībuModulis jau ir inicializētsModulis nav inicializētsTrūkst objekta, vai arī tas ir nederīgsDarbība cieta neveiksmiDarbība tika atceltaParolei vai PIN ir beidzies termiņšParole vai PIN nav pareizaParole vai PIN nav derīgaParole vai PIN ir bloķētaParolei vai PIN ir nederīgs garumsSaglabātais stāvoklis nav derīgsSesija ir aizvērtaSesija nav derīgaSesija ir tikai lasāmaParaksts ir slikts vai bojātsParaksts ir neatpazīts vai bojātsNorādītais slota ID nav derīgsStāvokli nevar saglabātLietotājam ir nederīgs tipsLietotāja parole vai PIN nav iestatītaAr šo atslēgu nevar izpildīt šo darbībuDarbība nav atbalstītaIr pārāk daudz aktīvu sesijuIr ierakstījušies pārāk daudz dažādu veidu lietotājiNevar inicializēt nejaušo skaitļu ģeneratoruNezināma kļūdaJūs jau esat ierakstījiesp11-kit-0.20.2/po/bg.po0000664000175000017500000001560412265245672011273 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Bulgarian (http://www.transifex.com/projects/p/freedesktop/" "language/bg/)\n" "Language: bg\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/sq.po0000664000175000017500000001560312265245673011326 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Albanian (http://www.transifex.com/projects/p/freedesktop/" "language/sq/)\n" "Language: sq\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/fi.po0000664000175000017500000002425012265245672011276 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Eerik Uusi-Illikainen https://launchpad.net/~ekiuusi-4, 2012. # Jiri Grönroos , 2012. # Timo Jyrinki , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2013-02-13 17:07+0000\n" "Last-Translator: Stef Walter \n" "Language-Team: Finnish (http://www.transifex.com/projects/p/freedesktop/" "language/fi/)\n" "Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Toiminto keskeytettiin" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Muisti ei riitä" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "Annettu lohkotunniste ei ole kelvollinen" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Sisäinen virhe" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Toiminto epäonnistui" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Virheellisiä argumentteja" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "Moduuli ei voi luoda vaadittavia säikeitä" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "Moduuli ei voi lukita tietoa kunnolla" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Kenttä on vain luettavissa" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Kenttä on arkaluonteinen eikä sitä voida paljastaa" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Kenttä on virheellinen tai sitä ei ole olemassa" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Kentän arvo on virheellinen" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Tieto ei ole kelvollista tai sitä ei voida tunnistaa" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Tieto on liian pitkä" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Tapahtui virhe laitteella" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Laitteen muistimäärä liian vähäinen" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Laite poistettiin tai irrotettiin" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "Salattu tieto ei ole kelvollista tai sitä ei voida tunnistaa" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Salattu tieto on liian pitkä" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Tämä toiminto ei ole tuettu" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Avain puuttuu tai on virheellinen" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "Avain on väärän kokoinen" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "Avain on väärää tyyppiä" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Avainta ei vaadita" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "Avain on eri kuin aikaisempi" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Avain vaaditaan" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Avainta ei voi sisällyttää tiivisteeseen" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Tätä toimintoa ei voi tehdä tällä avaimella" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "Avainta ei voi rivittää" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Tätä avainta ei voi viedä" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "Salausmekanismi on virheellinen tai sitä ei voida tunnistaa" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Salausmekanismissa on virheellinen argumentti" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Kohde puuttuu tai on virheellinen" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Toinen toiminto on jo käynnissä" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Yhtään toimintoa ei ole käynnissä" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Salasana tai PIN-koodi on väärä" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Salasana tai PIN-koodi on virheellinen" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Salasanan tai PIN-koodin pituus on virheellinen" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Salasana tai PIN-koodi on vanhentunut" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Salasana tai PIN-koodin on lukittu" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "Istunto on suljettu" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Liian monta aktiivista istuntoa" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "Istunto on virheellinen" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "Istunto on vain luettavissa" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Avoin istunto on olemassa" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Lukutilassa oleva istunto on olemassa" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Ylläpitäjän istunto on olemassa" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "Allekirjoitus on virheellinen tai vioittunut" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "Allekirjoitusta ei voida tunnistaa tai se on vioittunut" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Jotkut vaadituista kentistä puuttuvat" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Jotkin kentät sisältävät virheellisia arvoja" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Laite ei ole saatavilla tai se on irrotettu" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Laite on virheellinen tai sitä ei voida tunnistaa" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Laite on kirjoitussuojattu" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Tuonti epäonnistui koska avain on virheellinen" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Tuonti epäonnistui koska avain on väärän kokoinen" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Tuonti epäonnistui koska avain on väärää tyyppiä" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Olet jo kirjautuneena sisään" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Käyttäjiä ei ole kirjautuneena sisään" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "Käyttäjän salasanaa tai PIN-koodia ei ole asetettu" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "Käyttäjä on väärän tyyppinen" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Toinen käyttäjä on jo kirjautunut sisään" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Liian monta eri tyyppistä käyttäjää on kirjautuneena sisään" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Virheellistä avainta ei voida tuoda" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Väärän kokoista avainta ei voida tuoda" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Vienti ei onnistu koska avain on virheellinen" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Vienti ei onnistu koska avain on väärän kokoinen" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Vienti ei onnistu koska avain on väärän tyyppinen" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Satunnaislukugeneraattoria ei voida alustaa" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Satunnaislukugeneraattoria ei ole saatavilla" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Salausmekanismin parametri on virheellinen" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Liian vähän tilaa tulosten tallentamiseen" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "Tallennettu tila on virheellinen" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Tieto on luottamuksellista eikä sitä voida paljastaa" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Tilaa ei voida tallentaa" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "Moduulia ei ole alustettu" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Moduuli on jo alustettu" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Tietoa ei voida lukita" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Tietoa ei voida lukita" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "Käyttäjä ei hyväksynyt allekirjoituspyyntöä" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Tuntematon virhe" p11-kit-0.20.2/po/sr.po0000664000175000017500000002735212265245673011333 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Мирослав Николић , 2013. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2013-02-07 20:07+0000\n" "Last-Translator: MirosNik \n" "Language-Team: Serbian (http://www.transifex.com/projects/p/freedesktop/" "language/sr/)\n" "Language: sr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Радња је отказана" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Недовољно доступне меморије" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "ИБ наведеног уреза није исправан" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Унутрашња грешка" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Радња није успела" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Неисправни аргументи" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "Модул не може да направи потребне нити" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "Модул не може исправно да закључа податке" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "Поље је само за читање" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "Поље је осетљиво и не може бити откривено" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "Поље је неисправно или не постоји" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Неисправна вредност за поље" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Подаци нису исправни или су непрепознатљиви" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Подаци су предуги" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Дошло је до грешке на уређају" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Нема довољно доступне меморије на уређају" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Уређај је уклоњен или је искључен" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "Шифровани подаци нису исправни или су непрепознатљиви" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Шифровани подаци су предуги" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Ова радња није подржана" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Кључ недостаје или је неисправан" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "Кључ је погрешне величине" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "Кључ је погрешне врсте" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Није потребан кључ" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "Кључ је другачији него раније" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Потребан је кључ" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Не могу да укључим кључ у одабиру" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Ова радња не може бити обављена овим кључем" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "Кључ не може бити прекинут" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Не могу да извезем овај кључ" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "Механизам шифровања је неисправан или непрепознатљив" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "Механизам шифровања има неисправан аргумент" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Предмет недостаје или је неисправан" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Друга радња је ступила на снагу" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Ниједна радња није ступила на снагу" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "Није тачна лозинка или ПИН" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "Није исправна лозинка или ПИН" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "Лозинка или ПИН су неисправне дужине" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "Истекла је лозинка или ПИН" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "Закључана је лозинка или ПИН" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "Сесија је затворена" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Превише радних сесија" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "Сесија је неисправна" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "Сесија је само за читање" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Постоји отворена сесија" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Постоји сесија само за читање" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Постоји сесија администратора" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "Потпис је лош или оштећен" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "Потпис је непрепознатљив или оштећен" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Недостају одређена потребна поља" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Одређена поља имају неисправне вредности" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Уређај није присутан или је откачен" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Уређај је неисправан или је непрепознатљив" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Уређај је заштићен од писања" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Не могу да увезем јер је кључ неисправан" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Не могу да увезем јер је кључ погрешне величине" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Не могу да увезем јер је кључ погрешне врсте" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Већ сте пријављени" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Ниједан корисник није пријављен" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "Није подешена корисничка лозинка или ПИН" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "Корисник је неисправне врсте" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Други корисник је већ пријављен" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Пријављено је превише корисника различитих врста" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Не могу да увезем неисправан кључ" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Не могу да увезем кључ погрешне величине" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Не могу да извезем јер је кључ неисправан" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Не могу да извезем јер је кључ погрешне величине" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Не могу да извезем јер је кључ погрешне врсте" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Не могу да покренем ствараоца насумичног броја" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Није доступан стваралац насумичног броја" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "Механизам шифровања има неисправан параметар" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Недовољно места за складиштење резултата" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "Сачувано стање је неисправно" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Подаци су осетљиви и не могу бити откривени" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Стање не може бити сачувано" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "Модул није покренут" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "Модул је већ покренут" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Не могу да закључам податке" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Подаци не могу бити закључани" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "Корисник је одбацио захтев за потписом" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Непозната грешка" p11-kit-0.20.2/po/de.gmo0000664000175000017500000002050212265245673011431 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\!71Y'#!+,%=RGD/AM8=GDN:#% #97]"&"=/`=@O(_;(.!4)VP(/*8H?,%($='b67&$ $Ej),(''5O& )6+-b)"1C %S !y : ; !%!D KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2013-02-13 17:07+0000 Last-Translator: Stef Walter Language-Team: German (http://www.transifex.com/projects/p/freedesktop/language/de/) Language: de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Es wird ein Schlüssel benötigt.Es existiert eine Sitzung mit reinem Lesezugriff.Es existiert eine Administratorsitzung.Auf dem Gerät trat ein Fehler auf.Es existiert eine offene Sitzung.Es findet bereits eine andere Aktion statt.Ein anderer Benutzer ist bereits angemeldet.Kann nicht exportiert werden, da der Schlüssel ungültig istKann nicht exportiert werden, da der Schlüssel die falsche Größe hatKann nicht exportiert werden, da der Schlüssel vom falschen Typ istDieser Schlüssel kann nicht exportiert werden.Ein Schlüssel mit falscher Größe kann nicht importiert werden.Ein ungültiger Schlüssel kann nicht importiert werden.Kann nicht importiert werden, da der Schlüssel ungültig istKann nicht importiert werden, da der Schlüssel die falsche Größe hatKann nicht importiert werden, da der Schlüssel vom falschen Typ istDer Schlüssel kann nicht in den Digest integriert werden.Daten können nicht gesperrt werdenEinige Felder haben ungültige Werte.Einige benötigte Felder fehlen.Nicht genügend Speicher verfügbarAuf dem Gerät ist nicht genügend Speicher verfügbar.Interner FehlerUngültige ArgumenteUngültiger Wert für FeldEs wird kein Schlüssel benötigt.Es findet keine Aktion statt.Kein Zufallszahlengenerator verfügbarKein Benutzer hat sich angemeldet.Nicht genug Platz, um das Ergebnis zu speichernDer kryptografische Mechanismus hat ein ungültiges Argument.Der kryptografische Mechanismus hat einen ungültigen Parameter.Der kryptografische Mechanismus ist ungültig oder konnte nicht erkannt werden.Die Daten können nicht gesperrt werden.Die Daten sind ungültig oder konnten nicht erkannt werden.Die Daten sind zu lang.Das Gerät ist ungültig oder unbekannt.Das Gerät ist nicht vorhanden oder abgezogen.Das Gerät ist schreibgeschützt.Das Gerät wurde entfernt oder abgezogen.Die verschlüsselten Daten sind nicht gültig oder konnten nicht erkannt werden.Die verschlüsselten Daten sind zu lang.Das Feld ist ungültig oder es existiert nicht.Das Feld hat nur Lesezugriff.Das Feld ist sensibel und kann nicht offengelegt werden.Die Information ist sensibel und kann nicht offengelegt werden.Der Schlüssel kann nicht eingepackt werden.Der Schlüssel ist anders als vorher.Der Schlüssel fehlt oder ist ungültig.Der Schlüssel ist vom falschen Typ.Der Schlüssel hat die falsche Größe.Das Modul kann nicht die benötigten Threads erzeugen.Das Modul kann die Daten nicht ordnungsgemäß sperren.Das Modul wurde bereits initialisiert.Das Modul wurde nicht initialisiert.Das Objekt fehlt oder ist ungültig.Die Aktion ist fehlgeschlagen.Die Aktion wurde abgebrochen.Das Passwort oder die PIN ist abgelaufen.Das Passwort oder die PIN ist nicht korrekt.Das Passwort oder die PIN ist ungültig.Das Passwort oder die PIN ist gesperrt.Das Passwort oder die PIN hat eine ungültige Länge.Der gespeicherte Status ist ungültig.Die Sitzung ist beendet.Die Sitzung ist ungültig.Die Sitzung hat nur Lesezugriff.Die Signatur ist falsch oder beschädigt.Die Signatur wurde nicht erkannt oder ist beschädigt.Die angegebene Slot-Kennziffer ist ungültig.Der Status kann nicht gespeichert werden.Der Benutzer ist vom falschen Typ.Passwort oder PIN des Benutzers ist nicht gesetztDiese Aktion kann nicht mit diesem Schlüssel durchgeführt werden.Diese Aktion wird nicht unterstützt.Es sind zu viele Sitzungen aktiv.Zu viele Benutzer unterschiedlicher Typen sind angemeldet.Der Zufallszahlengenerator kann nicht initialisiert werden.Unbekannter FehlerSie sind bereits angemeldet.p11-kit-0.20.2/po/en_GB.po0000664000175000017500000001563112265245672011655 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: English (United Kingdom) (http://www.transifex.com/projects/p/" "freedesktop/language/en_GB/)\n" "Language: en_GB\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/el.po0000664000175000017500000001560012265245672011277 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Greek (http://www.transifex.com/projects/p/freedesktop/" "language/el/)\n" "Language: el\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/nb.gmo0000664000175000017500000000102612265245674011441 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Norwegian Bokmål (http://www.transifex.com/projects/p/freedesktop/language/nb/) Language: nb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/gl.po0000664000175000017500000002376612265245672011315 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Fran Diéguez , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-04-14 18:34+0000\n" "Last-Translator: Fran Diéguez \n" "Language-Team: Galician \n" "Language: gl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "Cancelouse a operación" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Non hai memoria dispoñíbel dabondo" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "O ID de slot especificado non é válido" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Erro interno" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "Operacción fallada" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Argumentos non válidos" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "O módulo non pode crear os fíos necesarios" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "O módulo non pode bloquear os datos correctamente" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "O campo é de só lectura" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "O campo é sensíbel e non pode ser revelado" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "O campo non é válido ou non existe" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "Valor non válido para o campo" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "O dato non é válido ou non se recoñece" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "O dato é demasiado longo" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Produciuse un erro no dispositivo" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "A memoria dispoñíbel no dispositivo non é suficiente" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "O dispositivo foi extraído ou desconectado" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "Os datos cifrados non son válidos ou non se recoñecen" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "Os datos cifrados son demasiado longos" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "Esta operación non se admite" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "Falta a chave ou non é válida" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "A chave ten un tamaño incorrecto" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "A chave é dun tipo incorrecto" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Non se precisa chave" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "A chave cambiou" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Precísase unha chave" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "Non é posíbel incluir a chave no digest" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Esta operación non pode levarse a cabo con esta chave" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "A chave non pode envolverse" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "Non é posíbel exportar esta chave" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "O mecanismo de criptografía non é válida ou non se recoñece" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "O mecanismo de criptografía ten un argumento non válido" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "O obxecto falta ou non é válido" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Xa se esta executando outra operación" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Non se está levando a cabo outra operación" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "O contrasinal ou PIN é incorrecto" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "O contrasinal ou PIn non é válido" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "O contrasinal ou PIN ten unha lonxitude non válida" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "O contrasinal ou PIN expirou" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "O contrasinal ou PIN está bloqueado" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "A sesión está pechada" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Demasiadas sesións activas" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "A sesión non é válida" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "A sesión é e só lectura" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Existe unha sesión aberta" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Existe unha sesión de só lectura" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Existe unha sesión de administrador" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "A sinatura é mala ou está corrompida" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "A sinatura non se recoñece ou está corrompida" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Faltan algúns campos requiridos" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Certos campos teñen valores non válidos" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "O dispositivo non está presente ou non está conectado" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "O dispositivo non é válido ou non está conectado" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "O dispositivo está protexido contra a escritura" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Non é posíbel importar porque a chave non é válida" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Non é posíbel importar a chave xa que ten un tamaño incorrecto" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Non é posíbel importar porque a chave ten un tipo non válido" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Xa ten unha sesión iniciada" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Non hai usuarios coa sesión iniciada" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "O contrasinal ou PIN do usuario non está estabelecido" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "O usuario ten un tipo non válido" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Xa hai outro usuario coa sesión iniciada" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Hai varios usuarios de tipos diferentes coa sesión iniciada" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Non é posíble importar unha chave non válida" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Non é posíbel importar unha chave de tamaño incorrecto" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Non é posíbel a chave porque non é válida" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Non é posíbel a chave porque ten un tamaño incorrecto " #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Non é posíbel exportar a chave porque é do tipo incorrecto" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "Non é posíbel inicializar o xerador de números aleatorios" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Non hai ningún xerador de números aleatorios dispoñíbel" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "O mecanismo criptográfico ten un parámetro non válido" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Non hai espazo dabondo para almacenar o resultado" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "O estado gardado non é válido" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "A información é sensíbel e non pode revelarse" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Non é posíbel gardar o estado" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "O módulo non foi inicializado" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "O módulo xa foi inicializado" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Non é posíbel bloquear os datos" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Non é posíbel bloquear os datos" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "A sinatura solicitada foi rexeitada polo usuario" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Erro descoñecido" p11-kit-0.20.2/po/Makefile.in.in0000644000175000017500000004042312265207774013011 00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.18.3 GETTEXT_MACRO_VERSION = 0.18 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SED = @SED@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. CHECK_MACRO_VERSION = \ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. # The determination of whether the package xyz is a GNU one is based on the # heuristic whether some file in the top level directory mentions "GNU xyz". # If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ else \ LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ fi; \ } | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_gnu}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use @SHELL@, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: p11-kit-0.20.2/po/cy.po0000664000175000017500000001566012265245672011320 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Welsh (http://www.transifex.com/projects/p/freedesktop/" "language/cy/)\n" "Language: cy\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != " "11) ? 2 : 3;\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/pt_BR.gmo0000664000175000017500000001766312265245674012066 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\N"g%("65>l;9.?6nB>%'!M(o*!0 #9V&s066":Y; /!-<7j/*C)A#k-4  ,&Mt .79$Y~-Ge}%0)2"Q,t66:LD KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-04-01 03:48+0000 Last-Translator: Rafael Ferreira Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/freedesktop/language/pt_BR/) Language: pt_BR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Uma chave é necessáriaUma sessão somente leitura existeUma sessão de administração existeUm erro ocorreu no dispositivoUma sessão aberta existeOutra operação já está em execuçãoOutro usuário já está conectadoNão é possível exportar porque a chave é inválidaNão é possível exportar porque a chave é do tamanho erradoNão é possível exportar porque a chave é do tipo erradoNão pode exportar essa chaveNão é possível importar uma chave do tamanho incorretoNão é possível importar uma chave inválidaNão é possível importar porque a chave é inválidaNão é possível importar porque a chave possui tamanho incorretoNão é possível importar porque a chave é do tipo incorretoFalha na inclusão da chave no digestNão é possível travar os dadosCertos campos possuem valores inválidosCertos campos necessários estão faltandoMemória insuficiente disponívelMemória insuficiente disponível no dispositivoErro internoArgumentos inválidosValor inválido para o campoNenhuma chave é necessáriaNenhuma operação está em execuçãoNenhum gerador de número aleatório disponívelNenhum usuário está conectadoNão há espaço suficiente para armazenar o resultadoO mecanismo de criptografia tem um argumento inválidoO mecanismo de criptografia possui um parâmetro inválidoO mecanismo de criptografia é inválido ou irreconhecívelOs dados não podem ser travadosOs dados não são válidos ou irreconhecíveisOs dados são muito longosO dispositivo é inválido ou irreconhecívelO dispositivo não está presente ou está desconectadoO dispositivo está protegido contra gravaçãoO dispositivo foi removido ou desconectadoOs dados criptografados não são válidos ou são irreconhecíveisOs dados criptografados são muito longosO campo é inválido ou não existeO campo é somente leituraO campo é sensitivo e não pode ser reveladoA informação é sensível e não pode ser reveladaA chave não pode ser ajustadaA chave é diferente da anteriorA chave está faltando ou é inválidoA chave possui tipo incorretoA chave possui tamanho incorretoO módulo não pode criar threads necessáriasO módulo não pode travar os dados da forma apropriadaO módulo já foi inicializadoO módulo não foi inicializadoO objeto está faltando ou inválidoA operação falhouA operação foi canceladaA senha ou PIN expirouA senha ou PIN é incorretaA senha ou PIN é inválidaA senha ou PIN está travadaA senha ou PIN possui um comprimeto inválidoO estado salvado é inválidoA sessão está fechadaA sessão é inválidaA sessão é somente leituraA assinatura está ruim ou corrompidaA assinatura está irreconhecível ou corrompidaO ID do slot especificado não é válidoO estado não pode ser salvadoO usuário é de um tipo inválidoA senha do usuário ou PIN não foi definidaEssa operação não pode ser executada com esta chaveA operação não é suportadaSessões demais estão ativasUsuários demais de diferentes tipos estão conectadosNão conseguiu inicializar o gerador de número aleatórioErro desconhecidoVocê já está conectadop11-kit-0.20.2/po/nn.gmo0000664000175000017500000000102612265245674011455 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Norwegian Nynorsk (http://www.transifex.com/projects/p/freedesktop/language/nn/) Language: nn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/hu.po0000664000175000017500000002340112265245673011312 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: # Gabor Kelemen , 2012. msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-05-03 23:26+0000\n" "Last-Translator: kelemeng \n" "Language-Team: Hungarian \n" "Language: hu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "A művelet megszakítva" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "Nincs elég memória" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "A megadott helyazonosító nem érvényes" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "Belső hiba" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "A művelet meghiúsult" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "Érvénytelen argumentumok" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "A modul nem képes létrehozni a szükséges szálakat" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "A modul nem képes megfelelően zárolni az adatokat" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "A mező írásvédett" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "A mező adatai érzékenyek és nem fedhetők fel" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "A mező érvénytelen vagy nem létezik" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "A mező értéke érvénytelen" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "Az adat érvénytelen vagy ismeretlen" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "Az adat túl hosszú" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "Hiba történt az eszközön" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "Nem érhető el elegendő memória az eszközön" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "Az eszköz eltávolításra vagy leválasztásra került" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "A titkosított adatok érvénytelenek vagy ismeretlenek" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "A titkosított adatok túl hosszúak" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "A művelet nem támogatott" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "A kulcs hiányzik vagy érvénytelen" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "A kulcs mérete hibás" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "A kulcs nem megfelelő típusú" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "Nem szükséges kulcs" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "A kulcs megváltozott" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "Kulcs szükséges" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "A kivonatba nem vehető fel a kulcs" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "Ez a művelet nem végezhető el a kulccsal" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "A kulcs nem alakítható át" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "A kulcs nem exportálható" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "A titkosítási mód érvénytelen vagy ismeretlen" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "A titkosítási mód argumentuma érvénytelen" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "Az objektum hiányzik vagy érvénytelen" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "Már folyamatban van egy művelet" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "Nincs folyamatban művelet" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "A jelszó vagy PIN helytelen" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "A jelszó vagy PIN érvénytelen" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "A jelszó vagy PIN érvénytelen hosszúságú" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "A jelszó vagy PIN lejárt" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "A jelszó vagy PIN zárolva van" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "A munkamenet le van zárva" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "Túl sok munkamenet aktív" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "A munkamenet érvénytelen" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "A munkamenet írásvédett" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "Már létezik nyitott munkamenet" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "Már létezik írásvédett munkamenet" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "Már létezik adminisztrátori munkamenet" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "Az aláírás rossz vagy sérült" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "Az aláírás ismeretlen vagy sérült" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "Néhány szükséges mező hiányzik" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "Néhány szükséges mező értéke érvénytelen" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "Az eszköz nincs jelen vagy eltávolították" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "Az eszköz érvénytelen vagy felismerhetetlen" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "Az eszköz írásvédett" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "Nem importálható, mert a kulcs érvénytelen" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "Nem importálható, mert a kulcs hibás méretű" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "Nem importálható, mert a kulcs hibás típusú" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "Már bejelentkezett" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "Senki sem jelentkezett be" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "A felhasználó jelszava vagy PIN kódja nincs beállítva" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "A felhasználó érvénytelen típusú" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "Már bejelentkezett egy másik felhasználó" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "Túl sok eltérő típusú felhasználó jelentkezett be" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "Nem importálható érvénytelen kulcs" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "Nem importálható hibás méretű kulcs" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "Nem lehet exportálni, mert a kulcs érvénytelen" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "Nem lehet exportálni, mert a kulcs hibás méretű" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "Nem lehet exportálni, mert a kulcs hibás típusú" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "A véletlenszám-generátor nem készíthető elő" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "Nem áll rendelkezésre véletlenszám-generátor" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "A titkosítási mechanizmus egy paramétere érvénytelen" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "Nincs elég hely az eredmény tárolásához" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "A mentett állapot érvénytelen" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "Az információk érzékenyek és nem fedhetők fel" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "Az állapot nem menthető" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "A modul nincs előkészítve" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "A modul már elő lett készítve" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "Nem zárolhatók az adatok" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "Az adatok nem zárolhatók" #: p11-kit/messages.c:237 #, fuzzy msgid "The request was rejected by the user" msgstr "A felhasználó elutasította az aláíráskérést" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "Ismeretlen hiba" p11-kit-0.20.2/po/it_IT.gmo0000664000175000017500000000103212265245674012047 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Italian (Italy) (http://www.transifex.com/projects/p/freedesktop/language/it_IT/) Language: it_IT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/stamp-po0000664000175000017500000000001212265243754012010 00000000000000timestamp p11-kit-0.20.2/po/th.gmo0000664000175000017500000000100212265245674011447 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Thai (http://www.transifex.com/projects/p/freedesktop/language/th/) Language: th MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; p11-kit-0.20.2/po/fr.po0000664000175000017500000001552212265245672011311 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/ga.po0000664000175000017500000001565112265245672011274 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Collabora Ltd. # This file is distributed under the same license as the PACKAGE package. # # Translators: msgid "" msgstr "" "Project-Id-Version: p11-kit\n" "Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-" "glue\n" "POT-Creation-Date: 2014-01-14 15:21+0100\n" "PO-Revision-Date: 2012-02-29 09:23+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: Irish (http://www.transifex.com/projects/p/freedesktop/" "language/ga/)\n" "Language: ga\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=5; plural=(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : " "4);\n" #: p11-kit/messages.c:78 msgid "The operation was cancelled" msgstr "" #: p11-kit/messages.c:81 msgid "Insufficient memory available" msgstr "" #: p11-kit/messages.c:83 msgid "The specified slot ID is not valid" msgstr "" #: p11-kit/messages.c:85 msgid "Internal error" msgstr "" #: p11-kit/messages.c:87 msgid "The operation failed" msgstr "" #: p11-kit/messages.c:89 msgid "Invalid arguments" msgstr "" #: p11-kit/messages.c:91 msgid "The module cannot create needed threads" msgstr "" #: p11-kit/messages.c:93 msgid "The module cannot lock data properly" msgstr "" #: p11-kit/messages.c:95 msgid "The field is read-only" msgstr "" #: p11-kit/messages.c:97 msgid "The field is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:99 msgid "The field is invalid or does not exist" msgstr "" #: p11-kit/messages.c:101 msgid "Invalid value for field" msgstr "" #: p11-kit/messages.c:103 msgid "The data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:105 msgid "The data is too long" msgstr "" #: p11-kit/messages.c:107 msgid "An error occurred on the device" msgstr "" #: p11-kit/messages.c:109 msgid "Insufficient memory available on the device" msgstr "" #: p11-kit/messages.c:111 msgid "The device was removed or unplugged" msgstr "" #: p11-kit/messages.c:113 msgid "The encrypted data is not valid or unrecognized" msgstr "" #: p11-kit/messages.c:115 msgid "The encrypted data is too long" msgstr "" #: p11-kit/messages.c:117 msgid "This operation is not supported" msgstr "" #: p11-kit/messages.c:119 msgid "The key is missing or invalid" msgstr "" #: p11-kit/messages.c:121 msgid "The key is the wrong size" msgstr "" #: p11-kit/messages.c:123 msgid "The key is of the wrong type" msgstr "" #: p11-kit/messages.c:125 msgid "No key is needed" msgstr "" #: p11-kit/messages.c:127 msgid "The key is different than before" msgstr "" #: p11-kit/messages.c:129 msgid "A key is needed" msgstr "" #: p11-kit/messages.c:131 msgid "Cannot include the key in the digest" msgstr "" #: p11-kit/messages.c:133 msgid "This operation cannot be done with this key" msgstr "" #: p11-kit/messages.c:135 msgid "The key cannot be wrapped" msgstr "" #: p11-kit/messages.c:137 msgid "Cannot export this key" msgstr "" #: p11-kit/messages.c:139 msgid "The crypto mechanism is invalid or unrecognized" msgstr "" #: p11-kit/messages.c:141 msgid "The crypto mechanism has an invalid argument" msgstr "" #: p11-kit/messages.c:143 msgid "The object is missing or invalid" msgstr "" #: p11-kit/messages.c:145 msgid "Another operation is already taking place" msgstr "" #: p11-kit/messages.c:147 msgid "No operation is taking place" msgstr "" #: p11-kit/messages.c:149 msgid "The password or PIN is incorrect" msgstr "" #: p11-kit/messages.c:151 msgid "The password or PIN is invalid" msgstr "" #: p11-kit/messages.c:153 msgid "The password or PIN is of an invalid length" msgstr "" #: p11-kit/messages.c:155 msgid "The password or PIN has expired" msgstr "" #: p11-kit/messages.c:157 msgid "The password or PIN is locked" msgstr "" #: p11-kit/messages.c:159 msgid "The session is closed" msgstr "" #: p11-kit/messages.c:161 msgid "Too many sessions are active" msgstr "" #: p11-kit/messages.c:163 msgid "The session is invalid" msgstr "" #: p11-kit/messages.c:165 msgid "The session is read-only" msgstr "" #: p11-kit/messages.c:167 msgid "An open session exists" msgstr "" #: p11-kit/messages.c:169 msgid "A read-only session exists" msgstr "" #: p11-kit/messages.c:171 msgid "An administrator session exists" msgstr "" #: p11-kit/messages.c:173 msgid "The signature is bad or corrupted" msgstr "" #: p11-kit/messages.c:175 msgid "The signature is unrecognized or corrupted" msgstr "" #: p11-kit/messages.c:177 msgid "Certain required fields are missing" msgstr "" #: p11-kit/messages.c:179 msgid "Certain fields have invalid values" msgstr "" #: p11-kit/messages.c:181 msgid "The device is not present or unplugged" msgstr "" #: p11-kit/messages.c:183 msgid "The device is invalid or unrecognizable" msgstr "" #: p11-kit/messages.c:185 msgid "The device is write protected" msgstr "" #: p11-kit/messages.c:187 msgid "Cannot import because the key is invalid" msgstr "" #: p11-kit/messages.c:189 msgid "Cannot import because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:191 msgid "Cannot import because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:193 msgid "You are already logged in" msgstr "" #: p11-kit/messages.c:195 msgid "No user has logged in" msgstr "" #: p11-kit/messages.c:197 msgid "The user's password or PIN is not set" msgstr "" #: p11-kit/messages.c:199 msgid "The user is of an invalid type" msgstr "" #: p11-kit/messages.c:201 msgid "Another user is already logged in" msgstr "" #: p11-kit/messages.c:203 msgid "Too many users of different types are logged in" msgstr "" #: p11-kit/messages.c:205 msgid "Cannot import an invalid key" msgstr "" #: p11-kit/messages.c:207 msgid "Cannot import a key of the wrong size" msgstr "" #: p11-kit/messages.c:209 msgid "Cannot export because the key is invalid" msgstr "" #: p11-kit/messages.c:211 msgid "Cannot export because the key is of the wrong size" msgstr "" #: p11-kit/messages.c:213 msgid "Cannot export because the key is of the wrong type" msgstr "" #: p11-kit/messages.c:215 msgid "Unable to initialize the random number generator" msgstr "" #: p11-kit/messages.c:217 msgid "No random number generator available" msgstr "" #: p11-kit/messages.c:219 msgid "The crypto mechanism has an invalid parameter" msgstr "" #: p11-kit/messages.c:221 msgid "Not enough space to store the result" msgstr "" #: p11-kit/messages.c:223 msgid "The saved state is invalid" msgstr "" #: p11-kit/messages.c:225 msgid "The information is sensitive and cannot be revealed" msgstr "" #: p11-kit/messages.c:227 msgid "The state cannot be saved" msgstr "" #: p11-kit/messages.c:229 msgid "The module has not been initialized" msgstr "" #: p11-kit/messages.c:231 msgid "The module has already been initialized" msgstr "" #: p11-kit/messages.c:233 msgid "Cannot lock data" msgstr "" #: p11-kit/messages.c:235 msgid "The data cannot be locked" msgstr "" #: p11-kit/messages.c:237 msgid "The request was rejected by the user" msgstr "" #: p11-kit/messages.c:240 msgid "Unknown error" msgstr "" p11-kit-0.20.2/po/te.gmo0000664000175000017500000000101312265245674011446 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Telugu (http://www.transifex.com/projects/p/freedesktop/language/te/) Language: te MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/sl.gmo0000664000175000017500000001670612265245674011473 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\FYs  .6+2b /'(07,h(* (Ffv/.%+T.-%!#8(\$*0! (I5a8",E&b)9Rl"%4Zx&,359iD KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-06-04 06:55+0000 Last-Translator: Martin Srebotnjak Language-Team: Slovenian Language: sl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3); Potreben je ključObstaja seja le za branjeObstaja skrbniška sejaNa napravi je prišlo do napraveObstaja odprta sejaPoteka že druga operacijaPrijavljen je že drug uporabnikKljuča ni mogoče izvoziti, ker je neveljavenKljuča ni mogoče izvoziti, ker ni ustrezne velikostiKljuča ni mogoče izvoziti, ker je napačne vrsteTega ključa ni mogoče izvozitiKljuča neprimerne velikosti ni mogoče uvozitiNeveljavnega ključa ni mogoče uvozitiUvoz ni možen, ker je ključ neveljavenKer ključ ni ustrezne velikosti, uvoz ni mogočKer ključ ni ustrezne vrste, uvoz ni mogočKljuča ni mogoče vključiti v povzetekPodatkov ni mogoče zaklenitiDoločena polja imajo neveljavne vrednostiDoločena obvezna polja manjkajoNa voljo ni dovolj pomnilnikaNa napravi ni dovolj pomnilnikaNotranja napakaNeveljavni argumentiNeveljavna vrednost za poljeKljuč ni potrebenNe poteka nobena operacijaNoben generator naključnih števil ni na voljoPrijavil se ni noben uporabnikZa shranjevanje rezultata primanjkuje prostoraŠifrirni mehanizem ima neveljaven argumentMehanizem šifriranja ima neveljaven parameterŠifrirni mehanizem ni veljaven ali prepoznanPodatkov ni mogoče zaklenitiPodatki niso veljavni ali prepoznavniPodatki so preobsežniNaprava ni veljavna ali prepoznavnaNaprava ni prisotna ali pa je iztaknjenaNaprava je zaščitena pred pisanjemNaprava je bila odstranjena ali iztaknjenaŠifrirani podatki niso veljavni ali prepoznavniŠifrirani podatki so preobsežniPolje ni veljavno ali ne obstajaPolje je samo za branjePolje je občutljive narave in ga ni mogoče razkritiPodatki so občutljive narave in jih ni mogoče razkritiKljuča ni mogoče ovijatiKljuč se razlikuje od prejšnjegaKljuč manjka ali ni veljavenKljuč je napačne vrsteKljuč je napačne velikostiModul ne more ustvariti potrebnih nitiModul ne more ustrezno zakleniti podatkovModul je že inicializiranModil ni bil inicializiranPredmet manjka ali ni veljavenOperacija ni uspelaOperacija je bila preklicanaGeslo ali PIN je potekelGeslo ali PIN ni pravilenGeslo ali PIN ni veljavenGeslo ali PIN je zaklenjenGeslo ali PIN ni ustrezne dolžineShranjeno stanje ni veljavnoSeja je zaprtaSeja ni veljavnaSeja je samo za branjePodpis je slab ali okvarjenPodpis ni razpoznaven ali je okvarjenNavedeni ID mesta ni veljavenStanja ni mogoče shranitiUporabnik je neveljavne vrsteGeslo ali PIN uporabnika ni nastavljenS tem ključem te operacije ni moč opravitiTa operacija ni podprtaAktivnih je preveč sejPrijavljenih je preveč uporabnikov različnih vrstGeneratorja naključnih števil ni mogoče inicializiratiNeznana napakaSte že prijavljenip11-kit-0.20.2/po/cy.gmo0000664000175000017500000000106712265245673011461 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Welsh (http://www.transifex.com/projects/p/freedesktop/language/cy/) Language: cy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3; p11-kit-0.20.2/po/or.gmo0000664000175000017500000000101212265245674011455 00000000000000$,89Project-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-02-29 09:23+0000 Last-Translator: FULL NAME Language-Team: Oriya (http://www.transifex.com/projects/p/freedesktop/language/or/) Language: or MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); p11-kit-0.20.2/po/ko.gmo0000664000175000017500000001726012265245674011462 00000000000000Qm, ,L)c!(22 >%U{(22$' L "] #  +    ' 8 $U z $ , - / @ %Z  ' &  # /& V &u  - 3  / P n  ' $ ' # >_t +:Uk!*" %%D+j/0 4B\,!=_}*%/#/S/%(//N.~$'  4 Ucw( $'8'`;7134e$0D$50ZC(/$Jo58##2*V$$A_p&-*>1\6!%B +P|D KL2*A4)@Q<?NI 3 P810=#!GC(.F:5,>6-+ HO"&'9 E%M7;$J/ BA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2012-04-14 16:48+0000 Last-Translator: Shinjo Park Language-Team: Korean (http://www.transifex.com/projects/p/freedesktop/language/ko/) Language: ko MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; 키가 필요함읽기 전용 세션이 존재함관리자 세션이 존재함장치에 오류가 발생함열린 세션이 존재함다른 작업이 진행 중다른 사용자가 로그인되어 있음잘못된 키를 내보낼 수 없음크기가 잘못된 키를 내보낼 수 없음종류가 잘못된 키를 내보낼 수 없음키를 내보낼 수 없음크기가 잘못된 키를 가져올 수 없음잘못된 키를 가져올 수 없음키가 잘못되어 가져올 수 없음키 크기가 잘못되어 가져올 수 없음키 종류가 잘못되어 가져올 수 없음다이제스트에 키를 포함할 수 없음데이터를 잠글 수 없음필드의 값이 잘못됨필요한 필드의 값이 빠졌음사용 가능한 메모리가 부족함장치에 메모리가 부족함내부 오류인자가 잘못됨필드의 값이 잘못됨키가 필요하지 않음진행 중인 작업 없음난수 생성기를 사용할 수 없음로그인한 사용자가 없음결과를 저장할 공간이 없음암호화 방식의 인자가 잘못됨암호화 방식의 인자가 잘못됨암호화 방식이 잘못되었거나 인식할 수 없음데이터를 잠글 수 없음데이터가 올바르지 않거나 인식되지 않음데이터가 너무 김장치가 잘못되었거나 인식할 수 없음장치가 존재하지 않거나 연결이 해제됨장치가 쓰기 금지되어 있음장치가 제거되었거나 연결이 해제됨암호화된 데이터가 올바르지 않거나 인식되지 않음암호화된 데이터가 너무 김필드가 잘못되었거나 존재하지 않음필드가 읽기 전용임필드가 민감한 정보를 포함하고 있어서 볼 수 없음민감한 정보를 노출할 수 없음키를 둘러쌀 수 없음키가 이전과 달라짐키가 없거나 올바르지 않음키 종류가 잘못됨키 크기가 잘못됨모듈에서 필요한 스레드를 만들 수 없음모듈에서 데이터를 올바르게 잠글 수 없음모듈이 이미 초기화되었음모듈이 초기화되지 않았음객체가 존재하지 않거나 잘못됨작업이 실패함작업이 취소됨암호나 PIN이 만료됨암호나 PIN이 올바르지 않음암호나 PIN이 잘못됨암호나 PIN이 잠김암호나 PIN의 길이가 잘못됨저장된 상태가 잘못됨세션이 닫힘세션이 잘못됨세션이 읽기 전용임서명이 잘못되었거나 손상됨서명이 인식되지 않았거나 손상됨지정한 슬롯 ID가 올바르지 않음상태를 저장할 수 없음사용자 종류가 잘못됨사용자의 암호나 PIN이 설정되지 않음이 키를 사용하여 작업을 수행할 수 없음이 동작이 지원되지 않음세션이 너무 많이 열려 있음다른 종류의 사용자가 너무 많이 로그인되어 있음난수 생성기를 초기화할 수 없음알 수 없는 오류이미 로그인되어 있음p11-kit-0.20.2/po/da.gmo0000664000175000017500000001732512265245673011436 00000000000000Rm<<\)s!(22N%e(22 $7 \ "m #  +    7 H $e  $ , - / P %j  ' &  # /6 f &  - 3 % ? ` ~  ' $ '#* No +$Jo!*"@Z%y+/08 iwj%"#&')N5x/ 3$3(X4.)%# Ij3  =%c&))4/0Gx+)$;#_$&/#0 Tu(#($#"Hk"&!*&&Qx'4#:^y/1$4:?o E LM2*B4)@R<?OJ 3 Q810=#!HD(.AG:5,>6-+ IP"&'9 F%N7;$K/ CA key is neededA read-only session existsAn administrator session existsAn error occurred on the deviceAn open session existsAnother operation is already taking placeAnother user is already logged inCannot export because the key is invalidCannot export because the key is of the wrong sizeCannot export because the key is of the wrong typeCannot export this keyCannot import a key of the wrong sizeCannot import an invalid keyCannot import because the key is invalidCannot import because the key is of the wrong sizeCannot import because the key is of the wrong typeCannot include the key in the digestCannot lock dataCertain fields have invalid valuesCertain required fields are missingInsufficient memory availableInsufficient memory available on the deviceInternal errorInvalid argumentsInvalid value for fieldNo key is neededNo operation is taking placeNo random number generator availableNo user has logged inNot enough space to store the resultThe crypto mechanism has an invalid argumentThe crypto mechanism has an invalid parameterThe crypto mechanism is invalid or unrecognizedThe data cannot be lockedThe data is not valid or unrecognizedThe data is too longThe device is invalid or unrecognizableThe device is not present or unpluggedThe device is write protectedThe device was removed or unpluggedThe encrypted data is not valid or unrecognizedThe encrypted data is too longThe field is invalid or does not existThe field is read-onlyThe field is sensitive and cannot be revealedThe information is sensitive and cannot be revealedThe key cannot be wrappedThe key is different than beforeThe key is missing or invalidThe key is of the wrong typeThe key is the wrong sizeThe module cannot create needed threadsThe module cannot lock data properlyThe module has already been initializedThe module has not been initializedThe object is missing or invalidThe operation failedThe operation was cancelledThe password or PIN has expiredThe password or PIN is incorrectThe password or PIN is invalidThe password or PIN is lockedThe password or PIN is of an invalid lengthThe request was rejected by the userThe saved state is invalidThe session is closedThe session is invalidThe session is read-onlyThe signature is bad or corruptedThe signature is unrecognized or corruptedThe specified slot ID is not validThe state cannot be savedThe user is of an invalid typeThe user's password or PIN is not setThis operation cannot be done with this keyThis operation is not supportedToo many sessions are activeToo many users of different types are logged inUnable to initialize the random number generatorUnknown errorYou are already logged inProject-Id-Version: p11-kit Report-Msgid-Bugs-To: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue POT-Creation-Date: 2014-01-14 15:21+0100 PO-Revision-Date: 2013-12-24 13:36+0000 Last-Translator: Joe Hansen Language-Team: Danish (http://www.transifex.com/projects/p/freedesktop/language/da/) Language: da MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); En nøgle er krævetDer findes en skrivebeskyttet sessionDer findes en administratorsessionDer opstod en fejl på enhedenDer findes en åben sessionEn anden handling foregår alleredeEn anden bruger er allerede logget indKan ikke eksportere da nøglen er ugyldigKan ikke eksportere da nøglen har forkert størrelseKan ikke eksportere da nøglen har forkert typeKan ikke eksportere denne nøgleKan ikke importere en nøgle med forkert størrelseKan ikke importere en ugyldig nøgleKan ikke importere da nøglen er ugyldigKan ikke importere da nøglen har forkert størrelseKan ikke importere da nøglen har forkert typeKan ikke inkludere nøglen i sammendragetKan ikke låse dataBestemte felter har ugyldige værdierBestemte krævede felter manglerDer er ikke nok hukommelseUtilstrækkelig tilgængelig hukommelse på enhedenIntern fejlUgyldige parametreUgyldigt værdi for feltIngen nøgle er krævetDer udføres ingen handlingIntet oprettelsesprogram for vilkårlige tal er tilgængeligtIngen bruger har logget indIkke nok plads til at lagre resultatetKryptomekanismen har en ugyldig parameterKryptomekanismen har en ugyldig parameterKryptomekanismen er ugyldig eller blev ikke genkendtDataene kan ikke låsesDataene er ikke gyldige eller blev ikke genkendtDataene er for langeEnheden er ugyldig eller kan ikke genkendesEnheden er ikke til stede eller frakobletEnheden er skrivebeskyttetEnheden blev fjernet eller frakobletDe krypterede data er ikke gyldige eller blev ikke genkendtDe krypterede data er for langeFeltet er ugyldigt eller findes ikkeFeltet er skrivebeskyttetFeltet er sensitivt kan ikke afsløresInformationen er sensitiv og kan ikke afsløresNøglen kan ikke omsluttesNøglen er anderledes end tidligereNøglen mangler eller er ugyldigNøglen har forkert typeNøglen har forkert størrelseModulet kan ikke oprette krævede trådeModulet kan ikke låse data korrektModulet er allerede blevet initialiseretModulet er ikke blevet initialiseretObjektet mangler eller er ugyldigtHandlingen mislykkedesHandlingen blev afbrudtAdgangskoden eller PIN er udløbetAdgangskoden eller PIN er ikke korrektAdgangskoden eller PIN er ugyldigAdgangskoden eller PIN er låstAdgangskoden eller PIN har forkert længdeForespørgslen blev afvist af brugerenDen lagrede tilstand er ugyldigSessionen er låstSessionen er ugyldigSessionen er skrivebeskyttetUnderskriften er ugyldig eller ødelagtUnderskriften kunne ikke genkendes eller er ødelagtDet angivne slot-id er ikke gyldigtTilstanden kan ikke gemmesBrugeren er af ugyldig typeBrugerens adgangskode eller PIN er ikke angivetDenne handling kan ikke udføres med denne nøgleDenne handling er ikke understøttetFor mange sessioner er aktiveFor mange brugere af forskellige typer er logget indKan ikke initialisere oprettelsesprogrammet for vilkårlige talUkendt fejlDu er allerede logget indp11-kit-0.20.2/trust/0000775000175000017500000000000012265245672011160 500000000000000p11-kit-0.20.2/trust/extract-pem.c0000664000175000017500000000760312263255461013476 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #define P11_DEBUG_FLAG P11_DEBUG_TOOL #include "compat.h" #include "debug.h" #include "extract.h" #include "message.h" #include "pem.h" #include "save.h" #include bool p11_extract_pem_bundle (p11_enumerate *ex, const char *destination) { char *comment; p11_buffer buf; p11_save_file *file; bool ret = true; bool first = true; CK_RV rv; file = p11_save_open_file (destination, NULL, ex->flags); if (!file) return false; p11_buffer_init (&buf, 0); while ((rv = p11_kit_iter_next (ex->iter)) == CKR_OK) { if (!p11_buffer_reset (&buf, 2048)) return_val_if_reached (false); if (!p11_pem_write (ex->cert_der, ex->cert_len, "CERTIFICATE", &buf)) return_val_if_reached (false); comment = p11_enumerate_comment (ex, first); first = false; ret = p11_save_write (file, comment, -1) && p11_save_write (file, buf.data, buf.len); free (comment); if (!ret) break; } p11_buffer_uninit (&buf); if (rv != CKR_OK && rv != CKR_CANCEL) { p11_message ("failed to find certificates: %s", p11_kit_strerror (rv)); ret = false; } /* * This will produce an empty file (which is a valid PEM bundle) if no * certificates were found. */ if (!p11_save_finish_file (file, NULL, ret)) ret = false; return ret; } bool p11_extract_pem_directory (p11_enumerate *ex, const char *destination) { p11_save_file *file; p11_save_dir *dir; p11_buffer buf; bool ret = true; char *filename; CK_RV rv; dir = p11_save_open_directory (destination, ex->flags); if (dir == NULL) return false; p11_buffer_init (&buf, 0); while ((rv = p11_kit_iter_next (ex->iter)) == CKR_OK) { if (!p11_buffer_reset (&buf, 2048)) return_val_if_reached (false); if (!p11_pem_write (ex->cert_der, ex->cert_len, "CERTIFICATE", &buf)) return_val_if_reached (false); filename = p11_enumerate_filename (ex); return_val_if_fail (filename != NULL, false); file = p11_save_open_file_in (dir, filename, ".pem"); free (filename); ret = p11_save_write_and_finish (file, buf.data, buf.len); if (!ret) break; } p11_buffer_uninit (&buf); if (rv != CKR_OK && rv != CKR_CANCEL) { p11_message ("failed to find certificates: %s", p11_kit_strerror (rv)); ret = false; } p11_save_finish_directory (dir, ret); return ret; } p11-kit-0.20.2/trust/pem.c0000664000175000017500000001547712226763526012043 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include "base64.h" #include "buffer.h" #include "debug.h" #include "pem.h" #include #include #include #include #define ARMOR_SUFF "-----" #define ARMOR_SUFF_L 5 #define ARMOR_PREF_BEGIN "-----BEGIN " #define ARMOR_PREF_BEGIN_L 11 #define ARMOR_PREF_END "-----END " #define ARMOR_PREF_END_L 9 enum { NONE = 0, TRUSTED_CERTIFICATE, CERTIFICATE }; static const char * pem_find_begin (const char *data, size_t n_data, char **type) { const char *pref, *suff; /* Look for a prefix */ pref = strnstr ((char *)data, ARMOR_PREF_BEGIN, n_data); if (!pref) return NULL; n_data -= (pref - data) + ARMOR_PREF_BEGIN_L; data = pref + ARMOR_PREF_BEGIN_L; /* Look for the end of that begin */ suff = strnstr ((char *)data, ARMOR_SUFF, n_data); if (!suff) return NULL; /* Make sure on the same line */ if (memchr (pref, '\n', suff - pref)) return NULL; if (type) { pref += ARMOR_PREF_BEGIN_L; assert (suff > pref); *type = malloc (suff - pref + 1); return_val_if_fail (*type != NULL, NULL); memcpy (*type, pref, suff - pref); (*type)[suff - pref] = 0; } /* The byte after this ---BEGIN--- */ return suff + ARMOR_SUFF_L; } static const char * pem_find_end (const char *data, size_t n_data, const char *type) { const char *pref; size_t n_type; /* Look for a prefix */ pref = strnstr (data, ARMOR_PREF_END, n_data); if (!pref) return NULL; n_data -= (pref - data) + ARMOR_PREF_END_L; data = pref + ARMOR_PREF_END_L; /* Next comes the type string */ n_type = strlen (type); if (n_type > n_data || strncmp ((char *)data, type, n_type) != 0) return NULL; n_data -= n_type; data += n_type; /* Next comes the suffix */ if (ARMOR_SUFF_L > n_data || strncmp ((char *)data, ARMOR_SUFF, ARMOR_SUFF_L) != 0) return NULL; /* The end of the data */ return pref; } static unsigned char * pem_parse_block (const char *data, size_t n_data, size_t *n_decoded) { const char *x, *hbeg, *hend; const char *p, *end; unsigned char *decoded; size_t length; int ret; assert (data != NULL); assert (n_data != 0); assert (n_decoded != NULL); p = data; end = p + n_data; hbeg = hend = NULL; /* Try and find a pair of blank lines with only white space between */ while (hend == NULL) { x = memchr (p, '\n', end - p); if (!x) break; ++x; while (isspace (*x)) { /* Found a second line, with only spaces between */ if (*x == '\n') { hbeg = data; hend = x; break; /* Found a space between two lines */ } else { ++x; } } /* Try next line */ p = x; } /* Headers found? */ if (hbeg && hend) { data = hend; n_data = end - data; } length = (n_data * 3) / 4 + 1; decoded = malloc (length); return_val_if_fail (decoded != NULL, 0); ret = p11_b64_pton (data, n_data, decoded, length); if (ret < 0) { free (decoded); return NULL; } /* No need to parse headers for our use cases */ *n_decoded = ret; return decoded; } unsigned int p11_pem_parse (const char *data, size_t n_data, p11_pem_sink sink, void *user_data) { const char *beg, *end; unsigned int nfound = 0; unsigned char *decoded = NULL; size_t n_decoded = 0; char *type; assert (data != NULL); while (n_data > 0) { /* This returns the first character after the PEM BEGIN header */ beg = pem_find_begin (data, n_data, &type); if (beg == NULL) break; assert (type != NULL); /* This returns the character position before the PEM END header */ end = pem_find_end (beg, n_data - (beg - data), type); if (end == NULL) { free (type); break; } if (beg != end) { decoded = pem_parse_block (beg, end - beg, &n_decoded); if (decoded) { if (sink != NULL) (sink) (type, decoded, n_decoded, user_data); ++nfound; free (decoded); } } free (type); /* Try for another block */ end += ARMOR_SUFF_L; n_data -= (const char *)end - (const char *)data; data = end; } return nfound; } bool p11_pem_write (const unsigned char *contents, size_t length, const char *type, p11_buffer *buf) { size_t estimate; size_t prefix; char *target; int len; return_val_if_fail (contents || !length, false); return_val_if_fail (type, false); return_val_if_fail (buf, false); /* Estimate from base64 data. Algorithm from Glib reference */ estimate = length * 4 / 3 + 7; estimate += estimate / 64 + 1; p11_buffer_add (buf, ARMOR_PREF_BEGIN, ARMOR_PREF_BEGIN_L); p11_buffer_add (buf, type, -1); p11_buffer_add (buf, ARMOR_SUFF, ARMOR_SUFF_L); prefix = buf->len; target = p11_buffer_append (buf, estimate); return_val_if_fail (target != NULL, NULL); /* * OpenSSL is absolutely certain that it wants its PEM base64 * lines to be 64 characters in len. */ len = p11_b64_ntop (contents, length, target, estimate, 64); assert (len > 0); assert (len <= estimate); buf->len = prefix + len; p11_buffer_add (buf, "\n", 1); p11_buffer_add (buf, ARMOR_PREF_END, ARMOR_PREF_END_L); p11_buffer_add (buf, type, -1); p11_buffer_add (buf, ARMOR_SUFF, ARMOR_SUFF_L); p11_buffer_add (buf, "\n", 1); return p11_buffer_ok (buf); } p11-kit-0.20.2/trust/asn1.h0000664000175000017500000000747212226763526012125 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include #include "dict.h" #ifndef P11_ASN1_H_ #define P11_ASN1_H_ typedef struct _p11_asn1_cache p11_asn1_cache; p11_dict * p11_asn1_defs_load (void); node_asn * p11_asn1_decode (p11_dict *asn1_defs, const char *struct_name, const unsigned char *der, size_t der_len, char *message); node_asn * p11_asn1_create (p11_dict *asn1_defs, const char *struct_name); unsigned char * p11_asn1_encode (node_asn *asn, size_t *der_len); void * p11_asn1_read (node_asn *asn, const char *field, size_t *length); void p11_asn1_free (void *asn); ssize_t p11_asn1_tlv_length (const unsigned char *data, size_t length); p11_asn1_cache * p11_asn1_cache_new (void); p11_dict * p11_asn1_cache_defs (p11_asn1_cache *cache); node_asn * p11_asn1_cache_get (p11_asn1_cache *cache, const char *struct_name, const unsigned char *der, size_t der_len); void p11_asn1_cache_take (p11_asn1_cache *cache, node_asn *node, const char *struct_name, const unsigned char *der, size_t der_len); void p11_asn1_cache_flush (p11_asn1_cache *cache); void p11_asn1_cache_free (p11_asn1_cache *cache); #endif /* P11_ASN1_H_ */ p11-kit-0.20.2/trust/x509.h0000664000175000017500000001015012226763526011753 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include #include "array.h" #include "dict.h" #ifndef P11_X509_H_ #define P11_X509_H_ unsigned char * p11_x509_find_extension (node_asn *cert, const unsigned char *oid, const unsigned char *der, size_t der_len, size_t *ext_len); bool p11_x509_calc_keyid (node_asn *cert, const unsigned char *der, size_t der_len, unsigned char *keyid); bool p11_x509_parse_basic_constraints (p11_dict *asn1_defs, const unsigned char *ext_der, size_t ext_len, bool *is_ca); bool p11_x509_parse_key_usage (p11_dict *asn1_defs, const unsigned char *data, size_t length, unsigned int *ku); p11_array * p11_x509_parse_extended_key_usage (p11_dict *asn1_defs, const unsigned char *ext_der, size_t ext_len); char * p11_x509_parse_dn_name (p11_dict *asn_defs, const unsigned char *der, size_t der_len, const unsigned char *oid); char * p11_x509_lookup_dn_name (node_asn *asn, const char *dn_field, const unsigned char *der, size_t der_len, const unsigned char *oid); char * p11_x509_parse_directory_string (const unsigned char *input, size_t input_len, bool *unknown_string, size_t *string_len); #endif /* P11_X509_H_ */ p11-kit-0.20.2/trust/session.h0000664000175000017500000000453212226763526012740 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "builder.h" #include "index.h" #include "pkcs11.h" #include "token.h" #ifndef P11_SESSION_H_ #define P11_SESSION_H_ typedef void (* p11_session_cleanup) (void *data); typedef struct { CK_SESSION_HANDLE handle; p11_index *index; p11_builder *builder; p11_token *token; CK_BBOOL loaded; bool read_write; /* Used by various operations */ p11_session_cleanup cleanup; void *operation; } p11_session; p11_session * p11_session_new (p11_token *token); void p11_session_free (void *data); void p11_session_set_operation (p11_session *session, p11_session_cleanup cleanup, void *operation); #endif /* P11_SESSION_H_ */ p11-kit-0.20.2/trust/trust-extract-compat.in0000775000175000017500000000220212226763526015541 00000000000000#!/bin/sh # This script is a placeholder designed to be replaced when this software # has been customized for distribution. It should be symlinked linked to the # distribution's update-ca-certificates or update-ca-trust command as # appropriate. In the future this script will be called when the PKCS#11 # trust module is used to modifiy trust anchors and related data. if [ $# -ne 0 ]; then echo "usage: trust extract-compat" >&2 exit 2 fi uid=$(id -u) if [ "$uid" != 0 ]; then echo "trust: running as non-root user: skip extracting compat bundles" >&2 exit 0 fi echo "trust: the placeholder extract-compat command has not been customized by your distribution." >&2 # You can use commands like this to extract data from trust modules # into appropriate locations for your distribution. # # trust extract --format=openssl-bundle --filter=ca-anchors \ # --overwrite /tmp/openssl-bundle.pem # trust extract --format=pem-bundle --filter=ca-anchors --overwrite \ # --purpose server-auth /tmp/server-auth-bundle.pem # trust extract --format=java-cacerts --filter=ca-anchors --overwrite \ # --purpose server-auth /tmp/cacerts exit 1 p11-kit-0.20.2/trust/oid.c0000664000175000017500000000557612226763526012034 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "hash.h" #include "oid.h" #include #include #include #include /* * We deal with OIDs a lot in their DER form. These have the * advantage of having the length encoded in their second byte, * at least for all the OIDs we're interested in. * * The goal here is to avoid carrying around extra length * information about DER encoded OIDs. */ bool p11_oid_simple (const unsigned char *oid, int len) { return (oid != NULL && len > 3 && /* minimum length */ oid[0] == 0x06 && /* simple encoding */ (oid[1] & 128) == 0 && /* short form length */ (size_t)oid[1] == len - 2); /* matches length */ } unsigned int p11_oid_hash (const void *oid) { uint32_t hash; int len; len = p11_oid_length (oid); p11_hash_murmur3 (&hash, oid, len, NULL); return hash; } bool p11_oid_equal (const void *oid_one, const void *oid_two) { int len_one; int len_two; len_one = p11_oid_length (oid_one); len_two = p11_oid_length (oid_two); return (len_one == len_two && memcmp (oid_one, oid_two, len_one) == 0); } int p11_oid_length (const unsigned char *oid) { assert (oid[0] == 0x06); assert ((oid[1] & 128) == 0); return (int)oid[1] + 2; } p11-kit-0.20.2/trust/anchor.h0000664000175000017500000000345112226763526012526 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #ifndef P11_ANCHOR_H_ #define P11_ANCHOR_H_ int p11_trust_anchor (int argc, char **argv); #endif /* P11_ANCHOR_H_ */ p11-kit-0.20.2/trust/extract.h0000664000175000017500000000625412263255461012725 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #ifndef P11_EXTRACT_H_ #define P11_EXTRACT_H_ #include "enumerate.h" #include "pkcs11.h" enum { /* These overlap with the flags in save.h, so start higher */ P11_EXTRACT_COMMENT = 1 << 10, }; typedef bool (* p11_extract_func) (p11_enumerate *ex, const char *destination); bool p11_extract_x509_file (p11_enumerate *ex, const char *destination); bool p11_extract_x509_directory (p11_enumerate *ex, const char *destination); bool p11_extract_pem_bundle (p11_enumerate *ex, const char *destination); bool p11_extract_pem_directory (p11_enumerate *ex, const char *destination); bool p11_extract_jks_cacerts (p11_enumerate *ex, const char *destination); bool p11_extract_openssl_bundle (p11_enumerate *ex, const char *destination); bool p11_extract_openssl_directory (p11_enumerate *ex, const char *destination); int p11_trust_extract (int argc, char **argv); int p11_trust_extract_compat (int argc, char *argv[]); #endif /* P11_EXTRACT_H_ */ p11-kit-0.20.2/trust/persist.h0000664000175000017500000000471412226763526012750 00000000000000/* * Copyright (C) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_PERSIST_H_ #define P11_PERSIST_H_ #include "array.h" #include "compat.h" #include "dict.h" #include typedef struct _p11_persist p11_persist; p11_persist * p11_persist_new (void); bool p11_persist_magic (const unsigned char *data, size_t length); bool p11_persist_read (p11_persist *persist, const char *filename, const unsigned char *data, size_t length, p11_array *objects); bool p11_persist_write (p11_persist *persist, CK_ATTRIBUTE *object, p11_buffer *buf); void p11_persist_free (p11_persist *persist); #endif /* P11_PERSIST_H_ */ p11-kit-0.20.2/trust/parser.c0000664000175000017500000005327112226763526012550 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "array.h" #include "asn1.h" #include "attrs.h" #define P11_DEBUG_FLAG P11_DEBUG_TRUST #include "debug.h" #include "dict.h" #include "digest.h" #include "message.h" #include "module.h" #include "oid.h" #include "parser.h" #include "path.h" #include "pem.h" #include "pkcs11x.h" #include "persist.h" #include "x509.h" #include #include #include #include #include #include #include #include #include #include struct _p11_parser { p11_asn1_cache *asn1_cache; p11_dict *asn1_defs; bool asn1_owned; p11_persist *persist; char *basename; p11_array *parsed; p11_array *formats; int flags; }; #define ID_LENGTH P11_DIGEST_SHA1_LEN typedef int (* parser_func) (p11_parser *parser, const unsigned char *data, size_t length); static CK_ATTRIBUTE * populate_trust (p11_parser *parser, CK_ATTRIBUTE *attrs) { CK_BBOOL trustedv; CK_BBOOL distrustv; CK_ATTRIBUTE trusted = { CKA_TRUSTED, &trustedv, sizeof (trustedv) }; CK_ATTRIBUTE distrust = { CKA_X_DISTRUSTED, &distrustv, sizeof (distrustv) }; /* * If we're are parsing an anchor location, then warn about any ditsrusted * certificates there, but don't go ahead and automatically make them * trusted anchors. */ if (parser->flags & P11_PARSE_FLAG_ANCHOR) { if (p11_attrs_find_bool (attrs, CKA_X_DISTRUSTED, &distrustv) && distrustv) { p11_message ("certificate with distrust in location for anchors: %s", parser->basename); return attrs; } trustedv = CK_TRUE; distrustv = CK_FALSE; /* * If we're parsing a blacklist location, then force all certificates to * be blacklisted, regardless of whether they contain anchor information. */ } else if (parser->flags & P11_PARSE_FLAG_BLACKLIST) { if (p11_attrs_find_bool (attrs, CKA_TRUSTED, &trustedv) && trustedv) p11_message ("overriding trust for anchor in blacklist: %s", parser->basename); trustedv = CK_FALSE; distrustv = CK_TRUE; /* * If the location doesn't have a flag, then fill in trust attributes * if they are missing: neither an anchor or blacklist. */ } else { trustedv = CK_FALSE; distrustv = CK_FALSE; if (p11_attrs_find_valid (attrs, CKA_TRUSTED)) trusted.type = CKA_INVALID; if (p11_attrs_find_valid (attrs, CKA_X_DISTRUSTED)) distrust.type = CKA_INVALID; } return p11_attrs_build (attrs, &trusted, &distrust, NULL); } static void sink_object (p11_parser *parser, CK_ATTRIBUTE *attrs) { CK_OBJECT_CLASS klass; if (p11_attrs_find_ulong (attrs, CKA_CLASS, &klass) && klass == CKO_CERTIFICATE) { attrs = populate_trust (parser, attrs); return_if_fail (attrs != NULL); } if (!p11_array_push (parser->parsed, attrs)) return_if_reached (); } static CK_ATTRIBUTE * certificate_attrs (p11_parser *parser, CK_ATTRIBUTE *id, const unsigned char *der, size_t der_len) { CK_OBJECT_CLASS klassv = CKO_CERTIFICATE; CK_CERTIFICATE_TYPE x509 = CKC_X_509; CK_BBOOL modifiablev = CK_FALSE; CK_ATTRIBUTE modifiable = { CKA_MODIFIABLE, &modifiablev, sizeof (modifiablev) }; CK_ATTRIBUTE klass = { CKA_CLASS, &klassv, sizeof (klassv) }; CK_ATTRIBUTE certificate_type = { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }; CK_ATTRIBUTE value = { CKA_VALUE, (void *)der, der_len }; return p11_attrs_build (NULL, &klass, &modifiable, &certificate_type, &value, id, NULL); } int p11_parser_format_x509 (p11_parser *parser, const unsigned char *data, size_t length) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; CK_BYTE idv[ID_LENGTH]; CK_ATTRIBUTE id = { CKA_ID, idv, sizeof (idv) }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *value; node_asn *cert; cert = p11_asn1_decode (parser->asn1_defs, "PKIX1.Certificate", data, length, message); if (cert == NULL) return P11_PARSE_UNRECOGNIZED; /* The CKA_ID links related objects */ if (!p11_x509_calc_keyid (cert, data, length, idv)) id.type = CKA_INVALID; attrs = certificate_attrs (parser, &id, data, length); return_val_if_fail (attrs != NULL, P11_PARSE_FAILURE); value = p11_attrs_find_valid (attrs, CKA_VALUE); return_val_if_fail (value != NULL, P11_PARSE_FAILURE); p11_asn1_cache_take (parser->asn1_cache, cert, "PKIX1.Certificate", value->pValue, value->ulValueLen); sink_object (parser, attrs); return P11_PARSE_SUCCESS; } static CK_ATTRIBUTE * extension_attrs (p11_parser *parser, CK_ATTRIBUTE *id, CK_ATTRIBUTE *public_key_info, const char *oid_str, const unsigned char *oid_der, bool critical, const unsigned char *value, int length) { CK_OBJECT_CLASS klassv = CKO_X_CERTIFICATE_EXTENSION; CK_BBOOL modifiablev = CK_FALSE; CK_ATTRIBUTE klass = { CKA_CLASS, &klassv, sizeof (klassv) }; CK_ATTRIBUTE modifiable = { CKA_MODIFIABLE, &modifiablev, sizeof (modifiablev) }; CK_ATTRIBUTE oid = { CKA_OBJECT_ID, (void *)oid_der, p11_oid_length (oid_der) }; CK_ATTRIBUTE *attrs; node_asn *dest; unsigned char *der; size_t len; int ret; attrs = p11_attrs_build (NULL, id, public_key_info, &klass, &modifiable, &oid, NULL); return_val_if_fail (attrs != NULL, NULL); dest = p11_asn1_create (parser->asn1_defs, "PKIX1.Extension"); return_val_if_fail (dest != NULL, NULL); ret = asn1_write_value (dest, "extnID", oid_str, 1); return_val_if_fail (ret == ASN1_SUCCESS, NULL); if (critical) ret = asn1_write_value (dest, "critical", "TRUE", 1); return_val_if_fail (ret == ASN1_SUCCESS, NULL); ret = asn1_write_value (dest, "extnValue", value, length); return_val_if_fail (ret == ASN1_SUCCESS, NULL); der = p11_asn1_encode (dest, &len); return_val_if_fail (der != NULL, NULL); attrs = p11_attrs_take (attrs, CKA_VALUE, der, len); return_val_if_fail (attrs != NULL, NULL); /* An opmitization so that the builder can get at this without parsing */ p11_asn1_cache_take (parser->asn1_cache, dest, "PKIX1.Extension", der, len); return attrs; } static CK_ATTRIBUTE * stapled_attrs (p11_parser *parser, CK_ATTRIBUTE *id, CK_ATTRIBUTE *public_key_info, const char *oid_str, const unsigned char *oid_der, bool critical, node_asn *ext) { CK_ATTRIBUTE *attrs; unsigned char *der; size_t len; der = p11_asn1_encode (ext, &len); return_val_if_fail (der != NULL, NULL); attrs = extension_attrs (parser, id, public_key_info, oid_str, oid_der, critical, der, len); return_val_if_fail (attrs != NULL, NULL); free (der); return attrs; } static p11_dict * load_seq_of_oid_str (node_asn *node, const char *seqof) { p11_dict *oids; char field[128]; char *oid; size_t len; int i; oids = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, NULL); for (i = 1; ; i++) { if (snprintf (field, sizeof (field), "%s.?%u", seqof, i) < 0) return_val_if_reached (NULL); oid = p11_asn1_read (node, field, &len); if (oid == NULL) break; if (!p11_dict_set (oids, oid, oid)) return_val_if_reached (NULL); } return oids; } static CK_ATTRIBUTE * stapled_eku_attrs (p11_parser *parser, CK_ATTRIBUTE *id, CK_ATTRIBUTE *public_key_info, const char *oid_str, const unsigned char *oid_der, bool critical, p11_dict *oid_strs) { CK_ATTRIBUTE *attrs; p11_dictiter iter; node_asn *dest; int count = 0; void *value; int ret; dest = p11_asn1_create (parser->asn1_defs, "PKIX1.ExtKeyUsageSyntax"); return_val_if_fail (dest != NULL, NULL); p11_dict_iterate (oid_strs, &iter); while (p11_dict_next (&iter, NULL, &value)) { ret = asn1_write_value (dest, "", "NEW", 1); return_val_if_fail (ret == ASN1_SUCCESS, NULL); ret = asn1_write_value (dest, "?LAST", value, -1); return_val_if_fail (ret == ASN1_SUCCESS, NULL); count++; } /* * If no oids have been written, then we have to put in a reserved * value, due to the way that ExtendedKeyUsage is defined in RFC 5280. * There must be at least one purpose. This is important since *not* * having an ExtendedKeyUsage is very different than having one without * certain usages. * * We account for this in p11_parse_extended_key_usage(). However for * most callers this should not matter, as they only check whether a * given purpose is present, and don't make assumptions about ones * that they don't know about. */ if (count == 0) { ret = asn1_write_value (dest, "", "NEW", 1); return_val_if_fail (ret == ASN1_SUCCESS, NULL); ret = asn1_write_value (dest, "?LAST", P11_OID_RESERVED_PURPOSE_STR, -1); return_val_if_fail (ret == ASN1_SUCCESS, NULL); } attrs = stapled_attrs (parser, id, public_key_info, oid_str, oid_der, critical, dest); asn1_delete_structure (&dest); return attrs; } static CK_ATTRIBUTE * build_openssl_extensions (p11_parser *parser, CK_ATTRIBUTE *cert, CK_ATTRIBUTE *id, CK_ATTRIBUTE *public_key_info, node_asn *aux, const unsigned char *aux_der, size_t aux_len) { CK_BBOOL trusted = CK_FALSE; CK_BBOOL distrust = CK_FALSE; CK_ATTRIBUTE trust_attrs[] = { { CKA_TRUSTED, &trusted, sizeof (trusted) }, { CKA_X_DISTRUSTED, &distrust, sizeof (distrust) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; p11_dict *trust = NULL; p11_dict *reject = NULL; p11_dictiter iter; void *key; int start; int end; int ret; int num; /* * This will load an empty list if there is no OPTIONAL trust field. * OpenSSL assumes that for a TRUSTED CERTIFICATE a missing trust field * is identical to untrusted for all purposes. * * This is different from ExtendedKeyUsage, where a missing certificate * extension means that it is trusted for all purposes. */ trust = load_seq_of_oid_str (aux, "trust"); ret = asn1_number_of_elements (aux, "reject", &num); return_val_if_fail (ret == ASN1_SUCCESS || ret == ASN1_ELEMENT_NOT_FOUND, NULL); if (ret == ASN1_SUCCESS) reject = load_seq_of_oid_str (aux, "reject"); /* Remove all rejected oids from the trust set */ if (trust && reject) { p11_dict_iterate (reject, &iter); while (p11_dict_next (&iter, &key, NULL)) p11_dict_remove (trust, key); } /* * The trust field (or lack of it) becomes a standard ExtKeyUsageSyntax. * * critical: require that this is enforced */ if (trust) { attrs = stapled_eku_attrs (parser, id, public_key_info, P11_OID_EXTENDED_KEY_USAGE_STR, P11_OID_EXTENDED_KEY_USAGE, true, trust); return_val_if_fail (attrs != NULL, NULL); sink_object (parser, attrs); } /* * For the reject field we use a custom defined extension. We track this * for completeness, although the above ExtendedKeyUsage extension handles * this data fine. See oid.h for more details. It uses ExtKeyUsageSyntax structure. * * non-critical: non-standard, and also covered by trusts */ if (reject && p11_dict_size (reject) > 0) { attrs = stapled_eku_attrs (parser, id, public_key_info, P11_OID_OPENSSL_REJECT_STR, P11_OID_OPENSSL_REJECT, false, reject); return_val_if_fail (attrs != NULL, NULL); sink_object (parser, attrs); } /* * OpenSSL model blacklists as anchors with all purposes being removed/rejected, * we account for that here. If there is an ExtendedKeyUsage without any * useful purposes, then treat like a blacklist. */ if (trust && p11_dict_size (trust) == 0) { trusted = CK_FALSE; distrust = CK_TRUE; /* * Otherwise a 'TRUSTED CERTIFICATE' in an input directory is enough to * mark this as a trusted certificate. */ } else if (trust && p11_dict_size (trust) > 0) { trusted = CK_TRUE; distrust = CK_FALSE; } /* * OpenSSL model blacklists as anchors with all purposes being removed/rejected, * we account for that here. If there is an ExtendedKeyUsage without any * useful purposes, then treat like a blacklist. */ cert = p11_attrs_merge (cert, p11_attrs_dup (trust_attrs), true); return_val_if_fail (cert != NULL, NULL); p11_dict_free (trust); p11_dict_free (reject); /* * For the keyid field we use the SubjectKeyIdentifier extension. It * is already in the correct form, an OCTET STRING. * * non-critical: as recommended in RFC 5280 */ ret = asn1_der_decoding_startEnd (aux, aux_der, aux_len, "keyid", &start, &end); return_val_if_fail (ret == ASN1_SUCCESS || ret == ASN1_ELEMENT_NOT_FOUND, NULL); if (ret == ASN1_SUCCESS) { attrs = extension_attrs (parser, id, public_key_info, P11_OID_SUBJECT_KEY_IDENTIFIER_STR, P11_OID_SUBJECT_KEY_IDENTIFIER, false, aux_der + start, (end - start) + 1); return_val_if_fail (attrs != NULL, NULL); sink_object (parser, attrs); } return cert; } static int parse_openssl_trusted_certificate (p11_parser *parser, const unsigned char *data, size_t length) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; CK_ATTRIBUTE *attrs; CK_BYTE idv[ID_LENGTH]; CK_ATTRIBUTE id = { CKA_ID, idv, sizeof (idv) }; CK_ATTRIBUTE public_key_info = { CKA_X_PUBLIC_KEY_INFO }; CK_ATTRIBUTE *value; char *label = NULL; node_asn *cert; node_asn *aux; ssize_t cert_len; size_t len; int start; int end; int ret; /* * This OpenSSL format is a wierd. It's just two DER structures * placed end to end without any wrapping SEQ. So calculate the * length of the first DER TLV we see and try to parse that as * the X.509 certificate. */ cert_len = p11_asn1_tlv_length (data, length); if (cert_len <= 0) return P11_PARSE_UNRECOGNIZED; cert = p11_asn1_decode (parser->asn1_defs, "PKIX1.Certificate", data, cert_len, message); if (cert == NULL) return P11_PARSE_UNRECOGNIZED; aux = p11_asn1_decode (parser->asn1_defs, "OPENSSL.CertAux", data + cert_len, length - cert_len, message); if (aux == NULL) { asn1_delete_structure (&cert); return P11_PARSE_UNRECOGNIZED; } /* The CKA_ID links related objects */ if (!p11_x509_calc_keyid (cert, data, cert_len, idv)) id.type = CKA_INVALID; attrs = certificate_attrs (parser, &id, data, cert_len); return_val_if_fail (attrs != NULL, P11_PARSE_FAILURE); /* Cache the parsed certificate ASN.1 for later use by the builder */ value = p11_attrs_find_valid (attrs, CKA_VALUE); return_val_if_fail (value != NULL, P11_PARSE_FAILURE); /* Pull out the subject public key info */ ret = asn1_der_decoding_startEnd (cert, data, cert_len, "tbsCertificate.subjectPublicKeyInfo", &start, &end); return_val_if_fail (ret == ASN1_SUCCESS, P11_PARSE_FAILURE); public_key_info.pValue = (char *)data + start; public_key_info.ulValueLen = (end - start) + 1; p11_asn1_cache_take (parser->asn1_cache, cert, "PKIX1.Certificate", value->pValue, value->ulValueLen); /* Pull the label out of the CertAux */ len = 0; label = p11_asn1_read (aux, "alias", &len); if (label != NULL) { attrs = p11_attrs_take (attrs, CKA_LABEL, label, strlen (label)); return_val_if_fail (attrs != NULL, P11_PARSE_FAILURE); } attrs = build_openssl_extensions (parser, attrs, &id, &public_key_info, aux, data + cert_len, length - cert_len); return_val_if_fail (attrs != NULL, P11_PARSE_FAILURE); sink_object (parser, attrs); asn1_delete_structure (&aux); return P11_PARSE_SUCCESS; } static void on_pem_block (const char *type, const unsigned char *contents, size_t length, void *user_data) { p11_parser *parser = user_data; int ret; if (strcmp (type, "CERTIFICATE") == 0) { ret = p11_parser_format_x509 (parser, contents, length); } else if (strcmp (type, "TRUSTED CERTIFICATE") == 0) { ret = parse_openssl_trusted_certificate (parser, contents, length); } else { p11_debug ("Saw unsupported or unrecognized PEM block of type %s", type); ret = P11_PARSE_SUCCESS; } if (ret != P11_PARSE_SUCCESS) p11_message ("Couldn't parse PEM block of type %s", type); } int p11_parser_format_pem (p11_parser *parser, const unsigned char *data, size_t length) { int num; num = p11_pem_parse ((const char *)data, length, on_pem_block, parser); if (num == 0) return P11_PARSE_UNRECOGNIZED; return P11_PARSE_SUCCESS; } int p11_parser_format_persist (p11_parser *parser, const unsigned char *data, size_t length) { CK_BBOOL modifiablev = CK_TRUE; CK_ATTRIBUTE *attrs; p11_array *objects; bool ret; int i; CK_ATTRIBUTE modifiable = { CKA_MODIFIABLE, &modifiablev, sizeof (modifiablev) }; if (!p11_persist_magic (data, length)) return P11_PARSE_UNRECOGNIZED; if (!parser->persist) { parser->persist = p11_persist_new (); return_val_if_fail (parser->persist != NULL, P11_PARSE_UNRECOGNIZED); } objects = p11_array_new (NULL); return_val_if_fail (objects != NULL, P11_PARSE_FAILURE); ret = p11_persist_read (parser->persist, parser->basename, data, length, objects); if (ret) { for (i = 0; i < objects->num; i++) { attrs = p11_attrs_build (objects->elem[i], &modifiable, NULL); sink_object (parser, attrs); } } p11_array_free (objects); return ret ? P11_PARSE_SUCCESS : P11_PARSE_FAILURE; } p11_parser * p11_parser_new (p11_asn1_cache *asn1_cache) { p11_parser parser = { 0, }; if (asn1_cache == NULL) { parser.asn1_owned = true; parser.asn1_defs = p11_asn1_defs_load (); } else { parser.asn1_defs = p11_asn1_cache_defs (asn1_cache); parser.asn1_cache = asn1_cache; parser.asn1_owned = false; } parser.parsed = p11_array_new (p11_attrs_free); return_val_if_fail (parser.parsed != NULL, NULL); return memdup (&parser, sizeof (parser)); } void p11_parser_free (p11_parser *parser) { return_if_fail (parser != NULL); p11_persist_free (parser->persist); p11_array_free (parser->parsed); p11_array_free (parser->formats); if (parser->asn1_owned) p11_dict_free (parser->asn1_defs); free (parser); } p11_array * p11_parser_parsed (p11_parser *parser) { return_val_if_fail (parser != NULL, NULL); return parser->parsed; } void p11_parser_formats (p11_parser *parser, ...) { p11_array *formats; parser_func func; va_list va; formats = p11_array_new (NULL); return_if_fail (formats != NULL); va_start (va, parser); for (;;) { func = va_arg (va, parser_func); if (func == NULL) break; if (!p11_array_push (formats, func)) return_if_reached (); } va_end (va); p11_array_free (parser->formats); parser->formats = formats; } int p11_parse_memory (p11_parser *parser, const char *filename, int flags, const unsigned char *data, size_t length) { int ret = P11_PARSE_UNRECOGNIZED; char *base; int i; return_val_if_fail (parser != NULL, P11_PARSE_FAILURE); return_val_if_fail (filename != NULL, P11_PARSE_FAILURE); return_val_if_fail (parser->formats != NULL, P11_PARSE_FAILURE); p11_array_clear (parser->parsed); base = p11_path_base (filename); parser->basename = base; parser->flags = flags; for (i = 0; ret == P11_PARSE_UNRECOGNIZED && i < parser->formats->num; i++) ret = ((parser_func)parser->formats->elem[i]) (parser, data, length); p11_asn1_cache_flush (parser->asn1_cache); free (base); parser->basename = NULL; parser->flags = 0; return ret; } int p11_parse_file (p11_parser *parser, const char *filename, struct stat *sb, int flags) { p11_mmap *map; void *data; size_t size; int ret; return_val_if_fail (parser != NULL, P11_PARSE_FAILURE); return_val_if_fail (filename != NULL, P11_PARSE_FAILURE); map = p11_mmap_open (filename, sb, &data, &size); if (map == NULL) { p11_message_err (errno, "couldn't open and map file: %s", filename); return P11_PARSE_FAILURE; } ret = p11_parse_memory (parser, filename, flags, data, size); p11_mmap_close (map); return ret; } p11-kit-0.20.2/trust/persist.c0000664000175000017500000004307612226763526012747 00000000000000/* * Copyright (C) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "asn1.h" #include "attrs.h" #include "constants.h" #include "debug.h" #include "lexer.h" #include "message.h" #include "pem.h" #include "persist.h" #include "pkcs11.h" #include "pkcs11x.h" #include "types.h" #include "url.h" #include "basic.asn.h" #include #include #include #include #define PERSIST_HEADER "p11-kit-object-v1" struct _p11_persist { p11_dict *constants; node_asn *asn1_defs; }; bool p11_persist_magic (const unsigned char *data, size_t length) { return (strnstr ((char *)data, "[" PERSIST_HEADER "]", length) != NULL); } p11_persist * p11_persist_new (void) { p11_persist *persist; persist = calloc (1, sizeof (p11_persist)); return_val_if_fail (persist != NULL, NULL); persist->constants = p11_constant_reverse (true); return_val_if_fail (persist->constants != NULL, NULL); return persist; } void p11_persist_free (p11_persist *persist) { if (!persist) return; p11_dict_free (persist->constants); asn1_delete_structure (&persist->asn1_defs); free (persist); } struct constant { CK_ULONG value; const char *string; }; static bool parse_string (p11_lexer *lexer, CK_ATTRIBUTE *attr) { const char *value; const char *end; size_t length; unsigned char *data; value = lexer->tok.field.value; end = value + strlen (value); /* Not a string/binary value */ if (value == end || value[0] != '\"' || *(end - 1) != '\"') return false; /* Note that we don't skip whitespace when decoding, as you might in other URLs */ data = p11_url_decode (value + 1, end - 1, "", &length); if (data == NULL) { p11_lexer_msg(lexer, "bad encoding of attribute value"); return false; } attr->pValue = data; attr->ulValueLen = length; return true; } static void format_string (CK_ATTRIBUTE *attr, p11_buffer *buf) { const unsigned char *value; assert (attr->ulValueLen != CK_UNAVAILABLE_INFORMATION); p11_buffer_add (buf, "\"", 1); value = attr->pValue; p11_url_encode (value, value + attr->ulValueLen, P11_URL_VERBATIM, buf); p11_buffer_add (buf, "\"", 1); } static bool parse_bool (p11_lexer *lexer, CK_ATTRIBUTE *attr) { const char *value = lexer->tok.field.value; CK_BBOOL boolean; if (strcmp (value, "true") == 0) { boolean = CK_TRUE; } else if (strcmp (value, "false") == 0) { boolean = CK_FALSE; } else { /* Not a valid boolean value */ return false; } attr->pValue = memdup (&boolean, sizeof (boolean)); return_val_if_fail (attr != NULL, FALSE); attr->ulValueLen = sizeof (boolean); return true; } static bool format_bool (CK_ATTRIBUTE *attr, p11_buffer *buf) { const CK_BBOOL *value; if (attr->ulValueLen != sizeof (CK_BBOOL)) return false; switch (attr->type) { case CKA_TOKEN: case CKA_PRIVATE: case CKA_TRUSTED: case CKA_SENSITIVE: case CKA_ENCRYPT: case CKA_DECRYPT: case CKA_WRAP: case CKA_UNWRAP: case CKA_SIGN: case CKA_SIGN_RECOVER: case CKA_VERIFY: case CKA_VERIFY_RECOVER: case CKA_DERIVE: case CKA_EXTRACTABLE: case CKA_LOCAL: case CKA_NEVER_EXTRACTABLE: case CKA_ALWAYS_SENSITIVE: case CKA_MODIFIABLE: case CKA_SECONDARY_AUTH: case CKA_ALWAYS_AUTHENTICATE: case CKA_WRAP_WITH_TRUSTED: case CKA_RESET_ON_INIT: case CKA_HAS_RESET: case CKA_COLOR: case CKA_X_DISTRUSTED: break; default: return false; } value = attr->pValue; if (*value == CK_TRUE) p11_buffer_add (buf, "true", -1); else if (*value == CK_FALSE) p11_buffer_add (buf, "false", -1); else return false; return true; } static bool parse_ulong (p11_lexer *lexer, CK_ATTRIBUTE *attr) { unsigned long value; char *end; end = NULL; value = strtoul (lexer->tok.field.value, &end, 10); /* Not a valid number value */ if (!end || *end != '\0') return false; attr->pValue = memdup (&value, sizeof (CK_ULONG)); return_val_if_fail (attr->pValue != NULL, false); attr->ulValueLen = sizeof (CK_ULONG); return true; } static bool format_ulong (CK_ATTRIBUTE *attr, p11_buffer *buf) { char string[sizeof (CK_ULONG) * 4]; const CK_ULONG *value; if (attr->ulValueLen != sizeof (CK_ULONG)) return false; switch (attr->type) { case CKA_CERTIFICATE_CATEGORY: case CKA_CERTIFICATE_TYPE: case CKA_CLASS: case CKA_JAVA_MIDP_SECURITY_DOMAIN: case CKA_KEY_GEN_MECHANISM: case CKA_KEY_TYPE: case CKA_MECHANISM_TYPE: case CKA_MODULUS_BITS: case CKA_PRIME_BITS: case CKA_SUB_PRIME_BITS: case CKA_VALUE_BITS: case CKA_VALUE_LEN: case CKA_TRUST_DIGITAL_SIGNATURE: case CKA_TRUST_NON_REPUDIATION: case CKA_TRUST_KEY_ENCIPHERMENT: case CKA_TRUST_DATA_ENCIPHERMENT: case CKA_TRUST_KEY_AGREEMENT: case CKA_TRUST_KEY_CERT_SIGN: case CKA_TRUST_CRL_SIGN: case CKA_TRUST_SERVER_AUTH: case CKA_TRUST_CLIENT_AUTH: case CKA_TRUST_CODE_SIGNING: case CKA_TRUST_EMAIL_PROTECTION: case CKA_TRUST_IPSEC_END_SYSTEM: case CKA_TRUST_IPSEC_TUNNEL: case CKA_TRUST_IPSEC_USER: case CKA_TRUST_TIME_STAMPING: case CKA_TRUST_STEP_UP_APPROVED: case CKA_X_ASSERTION_TYPE: case CKA_AUTH_PIN_FLAGS: case CKA_HW_FEATURE_TYPE: case CKA_PIXEL_X: case CKA_PIXEL_Y: case CKA_RESOLUTION: case CKA_CHAR_ROWS: case CKA_CHAR_COLUMNS: case CKA_BITS_PER_PIXEL: break; default: return false; } value = attr->pValue; snprintf (string, sizeof (string), "%lu", *value); p11_buffer_add (buf, string, -1); return true; } static bool parse_constant (p11_persist *persist, p11_lexer *lexer, CK_ATTRIBUTE *attr) { CK_ULONG value; value = p11_constant_resolve (persist->constants, lexer->tok.field.value); /* Not a valid constant */ if (value == CKA_INVALID) return false; attr->pValue = memdup (&value, sizeof (CK_ULONG)); return_val_if_fail (attr->pValue != NULL, false); attr->ulValueLen = sizeof (CK_ULONG); return true; } static bool format_constant (CK_ATTRIBUTE *attr, p11_buffer *buf) { const p11_constant *table; const CK_ULONG *value; const char *nick; if (attr->ulValueLen != sizeof (CK_ULONG)) return false; switch (attr->type) { case CKA_TRUST_DIGITAL_SIGNATURE: case CKA_TRUST_NON_REPUDIATION: case CKA_TRUST_KEY_ENCIPHERMENT: case CKA_TRUST_DATA_ENCIPHERMENT: case CKA_TRUST_KEY_AGREEMENT: case CKA_TRUST_KEY_CERT_SIGN: case CKA_TRUST_CRL_SIGN: case CKA_TRUST_SERVER_AUTH: case CKA_TRUST_CLIENT_AUTH: case CKA_TRUST_CODE_SIGNING: case CKA_TRUST_EMAIL_PROTECTION: case CKA_TRUST_IPSEC_END_SYSTEM: case CKA_TRUST_IPSEC_TUNNEL: case CKA_TRUST_IPSEC_USER: case CKA_TRUST_TIME_STAMPING: table = p11_constant_trusts; break; case CKA_CLASS: table = p11_constant_classes; break; case CKA_CERTIFICATE_TYPE: table = p11_constant_certs; break; case CKA_KEY_TYPE: table = p11_constant_keys; break; case CKA_X_ASSERTION_TYPE: table = p11_constant_asserts; break; case CKA_CERTIFICATE_CATEGORY: table = p11_constant_categories; break; case CKA_KEY_GEN_MECHANISM: case CKA_MECHANISM_TYPE: table = p11_constant_mechanisms; break; default: table = NULL; }; if (!table) return false; value = attr->pValue; nick = p11_constant_nick (table, *value); if (!nick) return false; p11_buffer_add (buf, nick, -1); return true; } static bool parse_oid (p11_persist *persist, p11_lexer *lexer, CK_ATTRIBUTE *attr) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = { 0, }; node_asn *asn; size_t length; char *value; int ret; value = lexer->tok.field.value; length = strlen (value); /* Not an OID value? */ if (length < 4 || strchr (value, '.') == NULL || strspn (value, "0123456790.") != length || strstr (value, "..") != NULL || value[0] == '.' || value[0] == '0' || value[length - 1] == '.' || strchr (value, '.') == strrchr (value, '.')) { return false; } if (!persist->asn1_defs) { ret = asn1_array2tree (basic_asn1_tab, &persist->asn1_defs, message); if (ret != ASN1_SUCCESS) { p11_debug_precond ("failed to load BASIC definitions: %s: %s\n", asn1_strerror (ret), message); return false; } } ret = asn1_create_element (persist->asn1_defs, "BASIC.ObjectIdentifier", &asn); if (ret != ASN1_SUCCESS) { p11_debug_precond ("failed to create ObjectIdentifier element: %s\n", asn1_strerror (ret)); return false; } ret = asn1_write_value (asn, "", value, 1); if (ret == ASN1_VALUE_NOT_VALID) { p11_lexer_msg (lexer, "invalid oid value"); asn1_delete_structure (&asn); return false; } return_val_if_fail (ret == ASN1_SUCCESS, false); attr->pValue = p11_asn1_encode (asn, &length); return_val_if_fail (attr->pValue != NULL, false); attr->ulValueLen = length; asn1_delete_structure (&asn); return true; } static bool format_oid (p11_persist *persist, CK_ATTRIBUTE *attr, p11_buffer *buf) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = { 0, }; node_asn *asn; char *data; size_t len; int ret; if (attr->type != CKA_OBJECT_ID || attr->ulValueLen == 0) return false; if (!persist->asn1_defs) { ret = asn1_array2tree (basic_asn1_tab, &persist->asn1_defs, message); if (ret != ASN1_SUCCESS) { p11_debug_precond ("failed to load BASIC definitions: %s: %s\n", asn1_strerror (ret), message); return false; } } ret = asn1_create_element (persist->asn1_defs, "BASIC.ObjectIdentifier", &asn); if (ret != ASN1_SUCCESS) { p11_debug_precond ("failed to create ObjectIdentifier element: %s\n", asn1_strerror (ret)); return false; } ret = asn1_der_decoding (&asn, attr->pValue, attr->ulValueLen, message); if (ret != ASN1_SUCCESS) { p11_message ("invalid oid value: %s", message); return false; } data = p11_asn1_read (asn, "", &len); return_val_if_fail (data != NULL, false); asn1_delete_structure (&asn); p11_buffer_add (buf, data, len - 1); free (data); return true; } static bool parse_value (p11_persist *persist, p11_lexer *lexer, CK_ATTRIBUTE *attr) { return parse_constant (persist, lexer, attr) || parse_string (lexer, attr) || parse_bool (lexer, attr) || parse_ulong (lexer, attr) || parse_oid (persist, lexer, attr); } static void format_value (p11_persist *persist, CK_ATTRIBUTE *attr, p11_buffer *buf) { assert (attr->ulValueLen != CK_UNAVAILABLE_INFORMATION); if (format_bool (attr, buf) || format_constant (attr, buf) || format_ulong (attr, buf) || format_oid (persist, attr, buf)) return; /* Everything else as string */ format_string (attr, buf); } static bool field_to_attribute (p11_persist *persist, p11_lexer *lexer, CK_ATTRIBUTE **attrs) { CK_ATTRIBUTE attr = { 0, }; char *end; end = NULL; attr.type = strtoul (lexer->tok.field.name, &end, 10); /* Not a valid number value, probably a constant */ if (!end || *end != '\0') { attr.type = p11_constant_resolve (persist->constants, lexer->tok.field.name); if (attr.type == CKA_INVALID || !p11_constant_name (p11_constant_types, attr.type)) { p11_lexer_msg (lexer, "invalid or unsupported attribute"); return false; } } if (!parse_value (persist, lexer, &attr)) { p11_lexer_msg (lexer, "invalid value"); return false; } *attrs = p11_attrs_take (*attrs, attr.type, attr.pValue, attr.ulValueLen); return true; } static CK_ATTRIBUTE * certificate_to_attributes (const unsigned char *der, size_t length) { CK_OBJECT_CLASS klassv = CKO_CERTIFICATE; CK_CERTIFICATE_TYPE x509 = CKC_X_509; CK_ATTRIBUTE klass = { CKA_CLASS, &klassv, sizeof (klassv) }; CK_ATTRIBUTE certificate_type = { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }; CK_ATTRIBUTE value = { CKA_VALUE, (void *)der, length }; return p11_attrs_build (NULL, &klass, &certificate_type, &value, NULL); } typedef struct { p11_lexer *lexer; CK_ATTRIBUTE *attrs; bool result; } parse_block; static void on_pem_block (const char *type, const unsigned char *contents, size_t length, void *user_data) { parse_block *pb = user_data; CK_ATTRIBUTE *attrs; if (strcmp (type, "CERTIFICATE") == 0) { attrs = certificate_to_attributes (contents, length); pb->attrs = p11_attrs_merge (pb->attrs, attrs, false); pb->result = true; } else { p11_lexer_msg (pb->lexer, "unsupported pem block in store"); pb->result = false; } } static bool pem_to_attributes (p11_lexer *lexer, CK_ATTRIBUTE **attrs) { parse_block pb = { lexer, *attrs, false }; unsigned int count; count = p11_pem_parse (lexer->tok.pem.begin, lexer->tok.pem.length, on_pem_block, &pb); if (count == 0) { p11_lexer_msg (lexer, "invalid pem block"); return false; } /* The lexer should have only matched one block */ return_val_if_fail (count == 1, false); *attrs = pb.attrs; return pb.result; } bool p11_persist_read (p11_persist *persist, const char *filename, const unsigned char *data, size_t length, p11_array *objects) { p11_lexer lexer; CK_ATTRIBUTE *attrs; bool failed; bool skip; return_val_if_fail (persist != NULL, false); return_val_if_fail (objects != NULL, false); skip = false; attrs = NULL; failed = false; p11_lexer_init (&lexer, filename, (const char *)data, length); while (p11_lexer_next (&lexer, &failed)) { switch (lexer.tok_type) { case TOK_SECTION: if (attrs && !p11_array_push (objects, attrs)) return_val_if_reached (false); attrs = NULL; if (strcmp (lexer.tok.section.name, PERSIST_HEADER) != 0) { p11_lexer_msg (&lexer, "unrecognized or invalid section header"); skip = true; } else { attrs = p11_attrs_build (NULL, NULL); return_val_if_fail (attrs != NULL, false); skip = false; } failed = false; break; case TOK_FIELD: if (skip) { failed = false; } else if (!attrs) { p11_lexer_msg (&lexer, "attribute before p11-kit section header"); failed = true; } else { failed = !field_to_attribute (persist, &lexer, &attrs); } break; case TOK_PEM: if (skip) { failed = false; } else if (!attrs) { p11_lexer_msg (&lexer, "pem block before p11-kit section header"); failed = true; } else { failed = !pem_to_attributes (&lexer, &attrs); } break; } if (failed) break; } if (attrs && !p11_array_push (objects, attrs)) return_val_if_reached (false); attrs = NULL; p11_lexer_done (&lexer); return !failed; } static CK_ATTRIBUTE * find_certificate_value (CK_ATTRIBUTE *attrs) { CK_OBJECT_CLASS klass; CK_CERTIFICATE_TYPE type; if (!p11_attrs_find_ulong (attrs, CKA_CLASS, &klass) || klass != CKO_CERTIFICATE) return NULL; if (!p11_attrs_find_ulong (attrs, CKA_CERTIFICATE_TYPE, &type) || type != CKC_X_509) return NULL; return p11_attrs_find_valid (attrs, CKA_VALUE); } bool p11_persist_write (p11_persist *persist, CK_ATTRIBUTE *attrs, p11_buffer *buf) { char string[sizeof (CK_ULONG) * 4]; CK_ATTRIBUTE *cert_value; const char *nick; int i; cert_value = find_certificate_value (attrs); p11_buffer_add (buf, "[" PERSIST_HEADER "]\n", -1); for (i = 0; !p11_attrs_terminator (attrs + i); i++) { /* These are written later? */ if (cert_value != NULL && (attrs[i].type == CKA_CLASS || attrs[i].type == CKA_CERTIFICATE_TYPE || attrs[i].type == CKA_VALUE)) continue; /* These are never written */ if (attrs[i].type == CKA_TOKEN || attrs[i].type == CKA_X_ORIGIN || attrs[i].type == CKA_X_GENERATED) continue; if (attrs[i].ulValueLen == CK_UNAVAILABLE_INFORMATION) continue; nick = p11_constant_nick (p11_constant_types, attrs[i].type); if (nick == NULL) { snprintf (string, sizeof (string), "%lu", attrs[i].type); nick = string; } p11_buffer_add (buf, nick, -1); p11_buffer_add (buf, ": ", 2); format_value (persist, attrs + i, buf); p11_buffer_add (buf, "\n", 1); } if (cert_value != NULL) { if (!p11_pem_write (cert_value->pValue, cert_value->ulValueLen, "CERTIFICATE", buf)) return_val_if_reached (false); } p11_buffer_add (buf, "\n", 1); return p11_buffer_ok (buf); } p11-kit-0.20.2/trust/session.c0000664000175000017500000000570012226763526012731 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "attrs.h" #define P11_DEBUG_FLAG P11_DEBUG_TRUST #include "debug.h" #include "dict.h" #include "message.h" #include "pkcs11.h" #include "module.h" #include "session.h" #include #include #include #include p11_session * p11_session_new (p11_token *token) { p11_session *session; session = calloc (1, sizeof (p11_session)); return_val_if_fail (session != NULL, NULL); session->handle = p11_module_next_id (); session->builder = p11_builder_new (P11_BUILDER_FLAG_NONE); return_val_if_fail (session->builder, NULL); session->index = p11_index_new (p11_builder_build, NULL, NULL, p11_builder_changed, session->builder); return_val_if_fail (session->index != NULL, NULL); session->token = token; return session; } void p11_session_free (void *data) { p11_session *session = data; p11_session_set_operation (session, NULL, NULL); p11_builder_free (session->builder); p11_index_free (session->index); free (session); } void p11_session_set_operation (p11_session *session, p11_session_cleanup cleanup, void *operation) { assert (session != NULL); if (session->cleanup) (session->cleanup) (session->operation); session->cleanup = cleanup; session->operation = operation; } p11-kit-0.20.2/trust/pkix.asn.h0000664000175000017500000003673112226763526013016 00000000000000#if HAVE_CONFIG_H # include "config.h" #endif #include const ASN1_ARRAY_TYPE pkix_asn1_tab[] = { { "PKIX1", 536875024, NULL }, { NULL, 1073741836, NULL }, { "id-pkix", 1879048204, NULL }, { "iso", 1073741825, "1"}, { "identified-organization", 1073741825, "3"}, { "dod", 1073741825, "6"}, { "internet", 1073741825, "1"}, { "security", 1073741825, "5"}, { "mechanisms", 1073741825, "5"}, { "pkix", 1, "7"}, { "AuthorityKeyIdentifier", 1610612741, NULL }, { "keyIdentifier", 1610637314, "KeyIdentifier"}, { NULL, 4104, "0"}, { "authorityCertIssuer", 1610637314, "GeneralNames"}, { NULL, 4104, "1"}, { "authorityCertSerialNumber", 536895490, "CertificateSerialNumber"}, { NULL, 4104, "2"}, { "KeyIdentifier", 1073741831, NULL }, { "SubjectKeyIdentifier", 1073741826, "KeyIdentifier"}, { "KeyUsage", 1073741830, NULL }, { "DirectoryString", 1610612754, NULL }, { "teletexString", 1612709890, "TeletexString"}, { "MAX", 524298, "1"}, { "printableString", 1612709890, "PrintableString"}, { "MAX", 524298, "1"}, { "universalString", 1612709890, "UniversalString"}, { "MAX", 524298, "1"}, { "utf8String", 1612709890, "UTF8String"}, { "MAX", 524298, "1"}, { "bmpString", 1612709890, "BMPString"}, { "MAX", 524298, "1"}, { "ia5String", 538968066, "IA5String"}, { "MAX", 524298, "1"}, { "SubjectAltName", 1073741826, "GeneralNames"}, { "GeneralNames", 1612709899, NULL }, { "MAX", 1074266122, "1"}, { NULL, 2, "GeneralName"}, { "GeneralName", 1610612754, NULL }, { "otherName", 1610620930, "AnotherName"}, { NULL, 4104, "0"}, { "rfc822Name", 1610620930, "IA5String"}, { NULL, 4104, "1"}, { "dNSName", 1610620930, "IA5String"}, { NULL, 4104, "2"}, { "x400Address", 1610620941, NULL }, { NULL, 4104, "3"}, { "directoryName", 1610620930, "RDNSequence"}, { NULL, 2056, "4"}, { "ediPartyName", 1610620941, NULL }, { NULL, 4104, "5"}, { "uniformResourceIdentifier", 1610620930, "IA5String"}, { NULL, 4104, "6"}, { "iPAddress", 1610620935, NULL }, { NULL, 4104, "7"}, { "registeredID", 536879116, NULL }, { NULL, 4104, "8"}, { "AnotherName", 1610612741, NULL }, { "type-id", 1073741836, NULL }, { "value", 541073421, NULL }, { NULL, 1073743880, "0"}, { "type-id", 1, NULL }, { "IssuerAltName", 1073741826, "GeneralNames"}, { "BasicConstraints", 1610612741, NULL }, { "cA", 1610645508, NULL }, { NULL, 131081, NULL }, { "pathLenConstraint", 537411587, NULL }, { "0", 10, "MAX"}, { "CRLDistributionPoints", 1612709899, NULL }, { "MAX", 1074266122, "1"}, { NULL, 2, "DistributionPoint"}, { "DistributionPoint", 1610612741, NULL }, { "distributionPoint", 1610637314, "DistributionPointName"}, { NULL, 2056, "0"}, { "reasons", 1610637314, "ReasonFlags"}, { NULL, 4104, "1"}, { "cRLIssuer", 536895490, "GeneralNames"}, { NULL, 4104, "2"}, { "DistributionPointName", 1610612754, NULL }, { "fullName", 1610620930, "GeneralNames"}, { NULL, 4104, "0"}, { "nameRelativeToCRLIssuer", 536879106, "RelativeDistinguishedName"}, { NULL, 4104, "1"}, { "ReasonFlags", 1073741830, NULL }, { "ExtKeyUsageSyntax", 1612709899, NULL }, { "MAX", 1074266122, "1"}, { NULL, 2, "KeyPurposeId"}, { "KeyPurposeId", 1073741836, NULL }, { "CRLNumber", 1611137027, NULL }, { "0", 10, "MAX"}, { "CertificateIssuer", 1073741826, "GeneralNames"}, { "NumericString", 1610620935, NULL }, { NULL, 4360, "18"}, { "IA5String", 1610620935, NULL }, { NULL, 4360, "22"}, { "TeletexString", 1610620935, NULL }, { NULL, 4360, "20"}, { "PrintableString", 1610620935, NULL }, { NULL, 4360, "19"}, { "UniversalString", 1610620935, NULL }, { NULL, 4360, "28"}, { "BMPString", 1610620935, NULL }, { NULL, 4360, "30"}, { "UTF8String", 1610620935, NULL }, { NULL, 4360, "12"}, { "Attribute", 1610612741, NULL }, { "type", 1073741826, "AttributeType"}, { "values", 536870927, NULL }, { NULL, 2, "AttributeValue"}, { "AttributeType", 1073741836, NULL }, { "AttributeValue", 1614807053, NULL }, { "type", 1, NULL }, { "AttributeTypeAndValue", 1610612741, NULL }, { "type", 1073741826, "AttributeType"}, { "value", 2, "AttributeValue"}, { "id-at", 1879048204, NULL }, { "joint-iso-ccitt", 1073741825, "2"}, { "ds", 1073741825, "5"}, { NULL, 1, "4"}, { "PostalAddress", 1610612747, NULL }, { NULL, 2, "DirectoryString"}, { "emailAddress", 1880096780, "AttributeType"}, { "iso", 1073741825, "1"}, { "member-body", 1073741825, "2"}, { "us", 1073741825, "840"}, { "rsadsi", 1073741825, "113549"}, { "pkcs", 1073741825, "1"}, { NULL, 1073741825, "9"}, { NULL, 1, "1"}, { "Pkcs9email", 1612709890, "IA5String"}, { "ub-emailaddress-length", 524298, "1"}, { "Name", 1610612754, NULL }, { "rdnSequence", 2, "RDNSequence"}, { "RDNSequence", 1610612747, NULL }, { NULL, 2, "RelativeDistinguishedName"}, { "DistinguishedName", 1073741826, "RDNSequence"}, { "RelativeDistinguishedName", 1612709903, NULL }, { "MAX", 1074266122, "1"}, { NULL, 2, "AttributeTypeAndValue"}, { "Certificate", 1610612741, NULL }, { "tbsCertificate", 1073741826, "TBSCertificate"}, { "signatureAlgorithm", 1073741826, "AlgorithmIdentifier"}, { "signature", 6, NULL }, { "TBSCertificate", 1610612741, NULL }, { "version", 1610653698, "Version"}, { NULL, 1073741833, "v1"}, { NULL, 2056, "0"}, { "serialNumber", 1073741826, "CertificateSerialNumber"}, { "signature", 1073741826, "AlgorithmIdentifier"}, { "issuer", 1073741826, "Name"}, { "validity", 1073741826, "Validity"}, { "subject", 1073741826, "Name"}, { "subjectPublicKeyInfo", 1073741826, "SubjectPublicKeyInfo"}, { "issuerUniqueID", 1610637314, "UniqueIdentifier"}, { NULL, 4104, "1"}, { "subjectUniqueID", 1610637314, "UniqueIdentifier"}, { NULL, 4104, "2"}, { "extensions", 536895490, "Extensions"}, { NULL, 2056, "3"}, { "Version", 1610874883, NULL }, { "v1", 1073741825, "0"}, { "v2", 1073741825, "1"}, { "v3", 1, "2"}, { "CertificateSerialNumber", 1073741827, NULL }, { "Validity", 1610612741, NULL }, { "notBefore", 1073741826, "Time"}, { "notAfter", 2, "Time"}, { "Time", 1610612754, NULL }, { "utcTime", 1090519057, NULL }, { "generalTime", 8388625, NULL }, { "UniqueIdentifier", 1073741830, NULL }, { "SubjectPublicKeyInfo", 1610612741, NULL }, { "algorithm", 1073741826, "AlgorithmIdentifier"}, { "subjectPublicKey", 6, NULL }, { "Extensions", 1612709899, NULL }, { "MAX", 1074266122, "1"}, { NULL, 2, "Extension"}, { "Extension", 1610612741, NULL }, { "extnID", 1073741836, NULL }, { "critical", 1610645508, NULL }, { NULL, 131081, NULL }, { "extnValue", 7, NULL }, { "CertificateList", 1610612741, NULL }, { "tbsCertList", 1073741826, "TBSCertList"}, { "signatureAlgorithm", 1073741826, "AlgorithmIdentifier"}, { "signature", 6, NULL }, { "TBSCertList", 1610612741, NULL }, { "version", 1073758210, "Version"}, { "signature", 1073741826, "AlgorithmIdentifier"}, { "issuer", 1073741826, "Name"}, { "thisUpdate", 1073741826, "Time"}, { "nextUpdate", 1073758210, "Time"}, { "revokedCertificates", 1610629131, NULL }, { NULL, 536870917, NULL }, { "userCertificate", 1073741826, "CertificateSerialNumber"}, { "revocationDate", 1073741826, "Time"}, { "crlEntryExtensions", 16386, "Extensions"}, { "crlExtensions", 536895490, "Extensions"}, { NULL, 2056, "0"}, { "AlgorithmIdentifier", 1610612741, NULL }, { "algorithm", 1073741836, NULL }, { "parameters", 541081613, NULL }, { "algorithm", 1, NULL }, { "Dss-Sig-Value", 1610612741, NULL }, { "r", 1073741827, NULL }, { "s", 3, NULL }, { "DomainParameters", 1610612741, NULL }, { "p", 1073741827, NULL }, { "g", 1073741827, NULL }, { "q", 1073741827, NULL }, { "j", 1073758211, NULL }, { "validationParms", 16386, "ValidationParms"}, { "ValidationParms", 1610612741, NULL }, { "seed", 1073741830, NULL }, { "pgenCounter", 3, NULL }, { "Dss-Parms", 1610612741, NULL }, { "p", 1073741827, NULL }, { "q", 1073741827, NULL }, { "g", 3, NULL }, { "CountryName", 1610620946, NULL }, { NULL, 1073746952, "1"}, { "x121-dcc-code", 1612709890, "NumericString"}, { NULL, 1048586, "ub-country-name-numeric-length"}, { "iso-3166-alpha2-code", 538968066, "PrintableString"}, { NULL, 1048586, "ub-country-name-alpha-length"}, { "OrganizationName", 1612709890, "PrintableString"}, { "ub-organization-name-length", 524298, "1"}, { "NumericUserIdentifier", 1612709890, "NumericString"}, { "ub-numeric-user-id-length", 524298, "1"}, { "OrganizationalUnitNames", 1612709899, NULL }, { "ub-organizational-units", 1074266122, "1"}, { NULL, 2, "OrganizationalUnitName"}, { "OrganizationalUnitName", 1612709890, "PrintableString"}, { "ub-organizational-unit-name-length", 524298, "1"}, { "CommonName", 1073741826, "PrintableString"}, { "pkcs-7-ContentInfo", 1610612741, NULL }, { "contentType", 1073741826, "pkcs-7-ContentType"}, { "content", 541073421, NULL }, { NULL, 1073743880, "0"}, { "contentType", 1, NULL }, { "pkcs-7-DigestInfo", 1610612741, NULL }, { "digestAlgorithm", 1073741826, "pkcs-7-DigestAlgorithmIdentifier"}, { "digest", 2, "pkcs-7-Digest"}, { "pkcs-7-Digest", 1073741831, NULL }, { "pkcs-7-ContentType", 1073741836, NULL }, { "pkcs-7-SignedData", 1610612741, NULL }, { "version", 1073741826, "pkcs-7-CMSVersion"}, { "digestAlgorithms", 1073741826, "pkcs-7-DigestAlgorithmIdentifiers"}, { "encapContentInfo", 1073741826, "pkcs-7-EncapsulatedContentInfo"}, { "certificates", 1610637314, "pkcs-7-CertificateSet"}, { NULL, 4104, "0"}, { "crls", 1610637314, "pkcs-7-CertificateRevocationLists"}, { NULL, 4104, "1"}, { "signerInfos", 2, "pkcs-7-SignerInfos"}, { "pkcs-7-CMSVersion", 1610874883, NULL }, { "v0", 1073741825, "0"}, { "v1", 1073741825, "1"}, { "v2", 1073741825, "2"}, { "v3", 1073741825, "3"}, { "v4", 1, "4"}, { "pkcs-7-DigestAlgorithmIdentifiers", 1610612751, NULL }, { NULL, 2, "pkcs-7-DigestAlgorithmIdentifier"}, { "pkcs-7-DigestAlgorithmIdentifier", 1073741826, "AlgorithmIdentifier"}, { "pkcs-7-EncapsulatedContentInfo", 1610612741, NULL }, { "eContentType", 1073741826, "pkcs-7-ContentType"}, { "eContent", 536895495, NULL }, { NULL, 2056, "0"}, { "pkcs-7-CertificateRevocationLists", 1610612751, NULL }, { NULL, 13, NULL }, { "pkcs-7-CertificateChoices", 1610612754, NULL }, { "certificate", 13, NULL }, { "pkcs-7-CertificateSet", 1610612751, NULL }, { NULL, 2, "pkcs-7-CertificateChoices"}, { "pkcs-7-SignerInfos", 1610612751, NULL }, { NULL, 13, NULL }, { "pkcs-10-CertificationRequestInfo", 1610612741, NULL }, { "version", 1610874883, NULL }, { "v1", 1, "0"}, { "subject", 1073741826, "Name"}, { "subjectPKInfo", 1073741826, "SubjectPublicKeyInfo"}, { "attributes", 536879106, "Attributes"}, { NULL, 4104, "0"}, { "Attributes", 1610612751, NULL }, { NULL, 2, "Attribute"}, { "pkcs-10-CertificationRequest", 1610612741, NULL }, { "certificationRequestInfo", 1073741826, "pkcs-10-CertificationRequestInfo"}, { "signatureAlgorithm", 1073741826, "AlgorithmIdentifier"}, { "signature", 6, NULL }, { "pkcs-9-at-challengePassword", 1879048204, NULL }, { "iso", 1073741825, "1"}, { "member-body", 1073741825, "2"}, { "us", 1073741825, "840"}, { "rsadsi", 1073741825, "113549"}, { "pkcs", 1073741825, "1"}, { NULL, 1073741825, "9"}, { NULL, 1, "7"}, { "pkcs-9-challengePassword", 1610612754, NULL }, { "printableString", 1073741826, "PrintableString"}, { "utf8String", 2, "UTF8String"}, { "pkcs-9-localKeyId", 1073741831, NULL }, { "pkcs-8-PrivateKeyInfo", 1610612741, NULL }, { "version", 1073741826, "pkcs-8-Version"}, { "privateKeyAlgorithm", 1073741826, "AlgorithmIdentifier"}, { "privateKey", 1073741826, "pkcs-8-PrivateKey"}, { "attributes", 536895490, "Attributes"}, { NULL, 4104, "0"}, { "pkcs-8-Version", 1610874883, NULL }, { "v1", 1, "0"}, { "pkcs-8-PrivateKey", 1073741831, NULL }, { "pkcs-8-Attributes", 1610612751, NULL }, { NULL, 2, "Attribute"}, { "pkcs-8-EncryptedPrivateKeyInfo", 1610612741, NULL }, { "encryptionAlgorithm", 1073741826, "AlgorithmIdentifier"}, { "encryptedData", 2, "pkcs-8-EncryptedData"}, { "pkcs-8-EncryptedData", 1073741831, NULL }, { "pkcs-5-des-EDE3-CBC-params", 1612709895, NULL }, { NULL, 1048586, "8"}, { "pkcs-5-aes128-CBC-params", 1612709895, NULL }, { NULL, 1048586, "16"}, { "pkcs-5-aes192-CBC-params", 1612709895, NULL }, { NULL, 1048586, "16"}, { "pkcs-5-aes256-CBC-params", 1612709895, NULL }, { NULL, 1048586, "16"}, { "pkcs-5-PBES2-params", 1610612741, NULL }, { "keyDerivationFunc", 1073741826, "AlgorithmIdentifier"}, { "encryptionScheme", 2, "AlgorithmIdentifier"}, { "pkcs-5-PBKDF2-params", 1610612741, NULL }, { "salt", 1610612754, NULL }, { "specified", 1073741831, NULL }, { "otherSource", 2, "AlgorithmIdentifier"}, { "iterationCount", 1611137027, NULL }, { "1", 10, "MAX"}, { "keyLength", 1611153411, NULL }, { "1", 10, "MAX"}, { "prf", 16386, "AlgorithmIdentifier"}, { "pkcs-12-PFX", 1610612741, NULL }, { "version", 1610874883, NULL }, { "v3", 1, "3"}, { "authSafe", 1073741826, "pkcs-7-ContentInfo"}, { "macData", 16386, "pkcs-12-MacData"}, { "pkcs-12-PbeParams", 1610612741, NULL }, { "salt", 1073741831, NULL }, { "iterations", 3, NULL }, { "pkcs-12-MacData", 1610612741, NULL }, { "mac", 1073741826, "pkcs-7-DigestInfo"}, { "macSalt", 1073741831, NULL }, { "iterations", 536903683, NULL }, { NULL, 9, "1"}, { "pkcs-12-AuthenticatedSafe", 1610612747, NULL }, { NULL, 2, "pkcs-7-ContentInfo"}, { "pkcs-12-SafeContents", 1610612747, NULL }, { NULL, 2, "pkcs-12-SafeBag"}, { "pkcs-12-SafeBag", 1610612741, NULL }, { "bagId", 1073741836, NULL }, { "bagValue", 1614815245, NULL }, { NULL, 1073743880, "0"}, { "badId", 1, NULL }, { "bagAttributes", 536887311, NULL }, { NULL, 2, "pkcs-12-PKCS12Attribute"}, { "pkcs-12-KeyBag", 1073741826, "pkcs-8-PrivateKeyInfo"}, { "pkcs-12-PKCS8ShroudedKeyBag", 1073741826, "pkcs-8-EncryptedPrivateKeyInfo"}, { "pkcs-12-CertBag", 1610612741, NULL }, { "certId", 1073741836, NULL }, { "certValue", 541073421, NULL }, { NULL, 1073743880, "0"}, { "certId", 1, NULL }, { "pkcs-12-CRLBag", 1610612741, NULL }, { "crlId", 1073741836, NULL }, { "crlValue", 541073421, NULL }, { NULL, 1073743880, "0"}, { "crlId", 1, NULL }, { "pkcs-12-SecretBag", 1610612741, NULL }, { "secretTypeId", 1073741836, NULL }, { "secretValue", 541073421, NULL }, { NULL, 1073743880, "0"}, { "secretTypeId", 1, NULL }, { "pkcs-12-PKCS12Attribute", 1073741826, "Attribute"}, { "pkcs-7-Data", 1073741831, NULL }, { "pkcs-7-EncryptedData", 1610612741, NULL }, { "version", 1073741826, "pkcs-7-CMSVersion"}, { "encryptedContentInfo", 1073741826, "pkcs-7-EncryptedContentInfo"}, { "unprotectedAttrs", 536895490, "pkcs-7-UnprotectedAttributes"}, { NULL, 4104, "1"}, { "pkcs-7-EncryptedContentInfo", 1610612741, NULL }, { "contentType", 1073741826, "pkcs-7-ContentType"}, { "contentEncryptionAlgorithm", 1073741826, "pkcs-7-ContentEncryptionAlgorithmIdentifier"}, { "encryptedContent", 536895490, "pkcs-7-EncryptedContent"}, { NULL, 4104, "0"}, { "pkcs-7-ContentEncryptionAlgorithmIdentifier", 1073741826, "AlgorithmIdentifier"}, { "pkcs-7-EncryptedContent", 1073741831, NULL }, { "pkcs-7-UnprotectedAttributes", 1612709903, NULL }, { "MAX", 1074266122, "1"}, { NULL, 2, "Attribute"}, { "ProxyCertInfo", 1610612741, NULL }, { "pCPathLenConstraint", 1611153411, NULL }, { "0", 10, "MAX"}, { "proxyPolicy", 2, "ProxyPolicy"}, { "ProxyPolicy", 536870917, NULL }, { "policyLanguage", 1073741836, NULL }, { "policy", 16391, NULL }, { NULL, 0, NULL } }; p11-kit-0.20.2/trust/utf8.c0000664000175000017500000002035012226763526012132 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "buffer.h" #include "debug.h" #include "utf8.h" #include #include #include #include /* * Some parts come from FreeBSD utf8.c * * Copyright (c) 2002-2004 Tim J. Robbins * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ static ssize_t utf8_to_uchar (const char *str, size_t len, uint32_t *uc) { int ch, i, mask, want; uint32_t lbound, uch; assert (str != NULL); assert (len > 0); assert (uc != NULL); if (((ch = (unsigned char)*str) & ~0x7f) == 0) { /* Fast path for plain ASCII characters. */ *uc = ch; return 1; } /* * Determine the number of octets that make up this character * from the first octet, and a mask that extracts the * interesting bits of the first octet. We already know * the character is at least two bytes long. * * We also specify a lower bound for the character code to * detect redundant, non-"shortest form" encodings. For * example, the sequence C0 80 is _not_ a legal representation * of the null character. This enforces a 1-to-1 mapping * between character codes and their multibyte representations. */ ch = (unsigned char)*str; if ((ch & 0xe0) == 0xc0) { mask = 0x1f; want = 2; lbound = 0x80; } else if ((ch & 0xf0) == 0xe0) { mask = 0x0f; want = 3; lbound = 0x800; } else if ((ch & 0xf8) == 0xf0) { mask = 0x07; want = 4; lbound = 0x10000; } else if ((ch & 0xfc) == 0xf8) { mask = 0x03; want = 5; lbound = 0x200000; } else if ((ch & 0xfe) == 0xfc) { mask = 0x01; want = 6; lbound = 0x4000000; } else { /* * Malformed input; input is not UTF-8. */ return -1; } if (want > len) { /* Incomplete multibyte sequence. */ return -1; } /* * Decode the octet sequence representing the character in chunks * of 6 bits, most significant first. */ uch = (unsigned char)*str++ & mask; for (i = 1; i < want; i++) { if ((*str & 0xc0) != 0x80) { /* * Malformed input; bad characters in the middle * of a character. */ return -1; } uch <<= 6; uch |= *str++ & 0x3f; } if (uch < lbound) { /* * Malformed input; redundant encoding. */ return -1; } *uc = uch; return want; } static size_t utf8_for_uchar (uint32_t uc, char *str, size_t len) { unsigned char lead; int i, want; assert (str != NULL); assert (len >= 6); if ((uc & ~0x7f) == 0) { /* Fast path for plain ASCII characters. */ *str = (char)uc; return 1; } /* * Determine the number of octets needed to represent this character. * We always output the shortest sequence possible. Also specify the * first few bits of the first octet, which contains the information * about the sequence length. */ if ((uc & ~0x7ff) == 0) { lead = 0xc0; want = 2; } else if ((uc & ~0xffff) == 0) { lead = 0xe0; want = 3; } else if ((uc & ~0x1fffff) == 0) { lead = 0xf0; want = 4; } else if ((uc & ~0x3ffffff) == 0) { lead = 0xf8; want = 5; } else if ((uc & ~0x7fffffff) == 0) { lead = 0xfc; want = 6; } else { return -1; } assert (want <= len); /* * Output the octets representing the character in chunks * of 6 bits, least significant last. The first octet is * a special case because it contains the sequence length * information. */ for (i = want - 1; i > 0; i--) { str[i] = (uc & 0x3f) | 0x80; uc >>= 6; } *str = (uc & 0xff) | lead; return want; } static ssize_t ucs2be_to_uchar (const unsigned char *str, size_t len, uint32_t *wc) { assert (str != NULL); assert (len != 0); assert (wc != NULL); if (len < 2) return -1; *wc = (str[0] << 8 | str[1]); return 2; } static ssize_t ucs4be_to_uchar (const unsigned char *str, size_t len, uint32_t *uc) { assert (str != NULL); assert (len != 0); assert (uc != NULL); if (len < 4) return -1; *uc = (str[0] << 24 | str[1] << 16 | str[2] << 8 | str[3]); return 4; } bool p11_utf8_validate (const char *str, ssize_t len) { uint32_t dummy; ssize_t ret; if (len < 0) len = strlen (str); while (len > 0) { ret = utf8_to_uchar (str, len, &dummy); if (ret < 0) return false; str += ret; len -= ret; } return true; } static char * utf8_for_convert (ssize_t (* convert) (const unsigned char *, size_t, uint32_t *), const unsigned char *str, size_t num_bytes, size_t *ret_len) { p11_buffer buf; char block[6]; uint32_t uc; ssize_t ret; assert (convert); if (!p11_buffer_init_null (&buf, num_bytes)) return_val_if_reached (NULL); while (num_bytes != 0) { ret = (convert) (str, num_bytes, &uc); if (ret < 0) { p11_buffer_uninit (&buf); return NULL; } str += ret; num_bytes -= ret; ret = utf8_for_uchar (uc, block, 6); if (ret < 0) { p11_buffer_uninit (&buf); return NULL; } p11_buffer_add (&buf, block, ret); } return_val_if_fail (p11_buffer_ok (&buf), NULL); return p11_buffer_steal (&buf, ret_len); } char * p11_utf8_for_ucs2be (const unsigned char *str, size_t num_bytes, size_t *ret_len) { assert (str != NULL); return utf8_for_convert (ucs2be_to_uchar, str, num_bytes, ret_len); } char * p11_utf8_for_ucs4be (const unsigned char *str, size_t num_bytes, size_t *ret_len) { assert (str != NULL); return utf8_for_convert (ucs4be_to_uchar, str, num_bytes, ret_len); } p11-kit-0.20.2/trust/save.h0000664000175000017500000000657112226763526012220 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_SAVE_H_ #define P11_SAVE_H_ #include "compat.h" enum { P11_SAVE_OVERWRITE = 1 << 0, P11_SAVE_UNIQUE = 1 << 1, }; typedef struct _p11_save_file p11_save_file; typedef struct _p11_save_dir p11_save_dir; p11_save_file * p11_save_open_file (const char *path, const char *extension, int flags); bool p11_save_write (p11_save_file *file, const void *data, ssize_t length); bool p11_save_write_and_finish (p11_save_file *file, const void *data, ssize_t length); bool p11_save_finish_file (p11_save_file *file, char **path, bool commit); const char * p11_save_file_name (p11_save_file *file); p11_save_dir * p11_save_open_directory (const char *path, int flags); p11_save_file * p11_save_open_file_in (p11_save_dir *directory, const char *basename, const char *extension); #ifdef OS_UNIX bool p11_save_symlink_in (p11_save_dir *dir, const char *linkname, const char *extension, const char *destination); #endif /* OS_UNIX */ bool p11_save_finish_directory (p11_save_dir *dir, bool commit); #endif /* P11_SAVE_H_ */ p11-kit-0.20.2/trust/tests/0000775000175000017500000000000012265245672012322 500000000000000p11-kit-0.20.2/trust/tests/frob-oid.c0000664000175000017500000000575312226763526014121 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include #include #include #include #include #include "pkix.asn.h" #define err_if_fail(ret, msg) \ do { if ((ret) != ASN1_SUCCESS) { \ fprintf (stderr, "%s: %s\n", msg, asn1_strerror (ret)); \ exit (1); \ } } while (0) int main (int argc, char *argv[]) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = { 0, }; node_asn *definitions = NULL; node_asn *oid = NULL; char *buf; int len; int ret; if (argc != 2) { fprintf (stderr, "usage: frob-oid 1.1.1\n"); return 2; } ret = asn1_array2tree (pkix_asn1_tab, &definitions, message); if (ret != ASN1_SUCCESS) { fprintf (stderr, "definitions: %s\n", message); return 1; } /* AttributeType is a OBJECT IDENTIFIER */ ret = asn1_create_element (definitions, "PKIX1.AttributeType", &oid); err_if_fail (ret, "AttributeType"); ret = asn1_write_value (oid, "", argv[1], strlen (argv[1])); err_if_fail (ret, "asn1_write_value"); len = 0; ret = asn1_der_coding (oid, "", NULL, &len, message); assert (ret == ASN1_MEM_ERROR); buf = malloc (len); assert (buf != NULL); ret = asn1_der_coding (oid, "", buf, &len, message); if (ret != ASN1_SUCCESS) { fprintf (stderr, "asn1_der_coding: %s\n", message); return 1; } fwrite (buf, 1, len, stdout); fflush (stdout); asn1_delete_structure (&oid); asn1_delete_structure (&definitions); return 0; } p11-kit-0.20.2/trust/tests/test-digest.c0000664000175000017500000001025312226763526014643 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include #include #include "digest.h" const char *sha1_input[] = { "abc", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", NULL }; const char *sha1_checksum[] = { "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D", "\x84\x98\x3E\x44\x1C\x3B\xD2\x6E\xBA\xAE\x4A\xA1\xF9\x51\x29\xE5\xE5\x46\x70\xF1", NULL }; static void test_sha1 (void) { unsigned char checksum[P11_DIGEST_SHA1_LEN]; size_t len; int i; for (i = 0; sha1_input[i] != NULL; i++) { memset (checksum, 0, sizeof (checksum)); len = strlen (sha1_input[i]); p11_digest_sha1 (checksum, sha1_input[i], len, NULL); assert (memcmp (sha1_checksum[i], checksum, P11_DIGEST_SHA1_LEN) == 0); if (len > 6) { p11_digest_sha1 (checksum, sha1_input[i], 6, sha1_input[i] + 6, len - 6, NULL); assert (memcmp (sha1_checksum[i], checksum, P11_DIGEST_SHA1_LEN) == 0); } } } static void test_sha1_long (void) { unsigned char checksum[P11_DIGEST_SHA1_LEN]; char *expected = "\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F"; char *input; input = malloc (1000000); assert (input != NULL); memset (input, 'a', 1000000); p11_digest_sha1 (checksum, input, 1000000, NULL); assert (memcmp (expected, checksum, P11_DIGEST_SHA1_LEN) == 0); free (input); } const char *md5_input[] = { "", "a", "abc", "message digest", "abcdefghijklmnopqrstuvwxyz", NULL }; const char *md5_checksum[] = { "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04\xe9\x80\x09\x98\xec\xf8\x42\x7e", "\x0c\xc1\x75\xb9\xc0\xf1\xb6\xa8\x31\xc3\x99\xe2\x69\x77\x26\x61", "\x90\x01\x50\x98\x3c\xd2\x4f\xb0\xd6\x96\x3f\x7d\x28\xe1\x7f\x72", "\xf9\x6b\x69\x7d\x7c\xb7\x93\x8d\x52\x5a\x2f\x31\xaa\xf1\x61\xd0", "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00\x7d\xfb\x49\x6c\xca\x67\xe1\x3b", NULL }; static void test_md5 (void) { unsigned char checksum[P11_DIGEST_MD5_LEN]; size_t len; int i; for (i = 0; md5_input[i] != NULL; i++) { memset (checksum, 0, sizeof (checksum)); len = strlen (md5_input[i]); p11_digest_md5 (checksum, md5_input[i], len, NULL); assert (memcmp (md5_checksum[i], checksum, P11_DIGEST_MD5_LEN) == 0); if (len > 5) { p11_digest_md5 (checksum, md5_input[i], 5, md5_input[i] + 5, len - 5, NULL); assert (memcmp (md5_checksum[i], checksum, P11_DIGEST_MD5_LEN) == 0); } } } int main (int argc, char *argv[]) { p11_test (test_sha1, "/digest/sha1"); p11_test (test_sha1_long, "/digest/sha1-long"); p11_test (test_md5, "/digest/md5"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/test-persist.c0000664000175000017500000004331512226763526015062 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "test-trust.h" #include #include #include #include #include "array.h" #include "attrs.h" #include "compat.h" #include "debug.h" #include "message.h" #include "persist.h" #include "pkcs11.h" #include "pkcs11x.h" static void test_magic (void) { const char *input = "[p11-kit-object-v1]\n" "class: data\n" "value: \"blah\"\n" "application: \"test-persist\"\n"; const char *other = " " "\n\n[p11-kit-object-v1]\n" "class: data\n" "value: \"blah\"\n" "application: \"test-persist\"\n"; assert (p11_persist_magic ((unsigned char *)input, strlen (input))); assert (!p11_persist_magic ((unsigned char *)input, 5)); assert (p11_persist_magic ((unsigned char *)other, strlen (other))); assert (!p11_persist_magic ((unsigned char *)"blah", 4)); } static p11_array * args_to_array (void *arg, ...) GNUC_NULL_TERMINATED; static p11_array * args_to_array (void *arg, ...) { p11_array *array = p11_array_new (NULL); va_list (va); va_start (va, arg); while (arg != NULL) { p11_array_push (array, arg); arg = va_arg (va, void *); } va_end (va); return array; } static void check_read_msg (const char *file, int line, const char *function, const char *input, p11_array *expected) { p11_array *objects; p11_persist *persist; int i; persist = p11_persist_new (); objects = p11_array_new (p11_attrs_free); if (p11_persist_read (persist, "test", (const unsigned char *)input, strlen (input), objects)) { if (expected == NULL) p11_test_fail (file, line, function, "decoding should have failed"); for (i = 0; i < expected->num; i++) { if (i >= objects->num) p11_test_fail (file, line, function, "too few objects read"); test_check_attrs_msg (file, line, function, expected->elem[i], objects->elem[i]); } if (i != objects->num) p11_test_fail (file, line, function, "too many objects read"); } else { if (expected != NULL) p11_test_fail (file, line, function, "decoding failed"); } p11_array_free (objects); p11_persist_free (persist); p11_array_free (expected); } static void check_write_msg (const char *file, int line, const char *function, const char *expected, p11_array *input) { p11_persist *persist; p11_buffer buf; int i; persist = p11_persist_new (); p11_buffer_init_null (&buf, 0); for (i = 0; i < input->num; i++) { if (!p11_persist_write (persist, input->elem[i], &buf)) p11_test_fail (file, line, function, "persist write failed"); } if (strcmp (buf.data, expected) != 0) { p11_test_fail (file, line, function, "persist doesn't match: (\n%s----\n%s\n)", \ expected, (char *)buf.data); } p11_buffer_uninit (&buf); p11_array_free (input); p11_persist_free (persist); } #define check_read_success(input, objs) \ check_read_msg (__FILE__, __LINE__, __FUNCTION__, input, args_to_array objs) #define check_read_failure(input) \ check_read_msg (__FILE__, __LINE__, __FUNCTION__, input, NULL) #define check_write_success(expected, inputs) \ check_write_msg (__FILE__, __LINE__, __FUNCTION__, expected, args_to_array inputs) static CK_OBJECT_CLASS certificate = CKO_CERTIFICATE; static CK_CERTIFICATE_TYPE x509 = CKC_X_509; static CK_OBJECT_CLASS nss_trust = CKO_NSS_TRUST; static CK_OBJECT_CLASS data = CKO_DATA; static CK_BBOOL truev = CK_TRUE; static CK_BBOOL falsev = CK_FALSE; static void test_simple (void) { const char *output = "[p11-kit-object-v1]\n" "class: data\n" "value: \"blah\"\n" "application: \"test-persist\"\n\n"; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_VALUE, "blah", 4 }, { CKA_APPLICATION, "test-persist", 12 }, { CKA_INVALID }, }; check_read_success (output, (attrs, NULL)); check_write_success (output, (attrs, NULL)); } static void test_number (void) { const char *output = "[p11-kit-object-v1]\n" "class: data\n" "value-len: 29202390\n" "application: \"test-persist\"\n\n"; CK_ULONG value = 29202390; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_VALUE_LEN, &value, sizeof (value) }, { CKA_APPLICATION, "test-persist", 12 }, { CKA_INVALID }, }; check_read_success (output, (attrs, NULL)); check_write_success (output, (attrs, NULL)); } static void test_bool (void) { const char *output = "[p11-kit-object-v1]\n" "class: data\n" "private: true\n" "modifiable: false\n" "application: \"test-persist\"\n\n"; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_PRIVATE, &truev, sizeof (truev) }, { CKA_MODIFIABLE, &falsev, sizeof (falsev) }, { CKA_APPLICATION, "test-persist", 12 }, { CKA_INVALID }, }; check_read_success (output, (attrs, NULL)); check_write_success (output, (attrs, NULL)); } static void test_oid (void) { const char *output = "[p11-kit-object-v1]\n" "class: data\n" "object-id: 1.2.3.4\n\n"; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_OBJECT_ID, "\x06\x03*\x03\x04", 5 }, { CKA_INVALID }, }; check_read_success (output, (attrs, NULL)); check_write_success (output, (attrs, NULL)); } static void test_constant (void) { const char *output = "[p11-kit-object-v1]\n" "class: data\n" "certificate-type: x-509-attr-cert\n" "key-type: rsa\n" "x-assertion-type: x-pinned-certificate\n" "certificate-category: authority\n" "mechanism-type: rsa-pkcs-key-pair-gen\n" "trust-server-auth: nss-trust-unknown\n\n"; CK_TRUST trust = CKT_NSS_TRUST_UNKNOWN; CK_CERTIFICATE_TYPE type = CKC_X_509_ATTR_CERT; CK_X_ASSERTION_TYPE ass = CKT_X_PINNED_CERTIFICATE; CK_MECHANISM_TYPE mech = CKM_RSA_PKCS_KEY_PAIR_GEN; CK_ULONG category = 2; CK_KEY_TYPE key = CKK_RSA; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_CERTIFICATE_TYPE, &type, sizeof (type) }, { CKA_KEY_TYPE, &key, sizeof (key) }, { CKA_X_ASSERTION_TYPE, &ass, sizeof (ass) }, { CKA_CERTIFICATE_CATEGORY, &category, sizeof (category) }, { CKA_MECHANISM_TYPE, &mech, sizeof (mech) }, { CKA_TRUST_SERVER_AUTH, &trust, sizeof (trust) }, { CKA_INVALID }, }; check_read_success (output, (attrs, NULL)); check_write_success (output, (attrs, NULL)); } static void test_unknown (void) { const char *output = "[p11-kit-object-v1]\n" "class: data\n" "38383838: \"the-value-here\"\n\n"; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &data, sizeof (data) }, { 38383838, "the-value-here", 14 }, { CKA_INVALID }, }; check_read_success (output, (attrs, NULL)); check_write_success (output, (attrs, NULL)); } static void test_multiple (void) { const char *output = "[p11-kit-object-v1]\n" "class: data\n" "object-id: 1.2.3.4\n\n" "[p11-kit-object-v1]\n" "class: nss-trust\n" "trust-server-auth: nss-trust-unknown\n\n"; CK_TRUST trust = CKT_NSS_TRUST_UNKNOWN; CK_ATTRIBUTE attrs1[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_OBJECT_ID, "\x06\x03*\x03\x04", 5 }, { CKA_INVALID }, }; CK_ATTRIBUTE attrs2[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust) }, { CKA_TRUST_SERVER_AUTH, &trust, sizeof (trust) }, { CKA_INVALID }, }; check_read_success (output, (attrs1, attrs2, NULL)); check_write_success (output, (attrs1, attrs2, NULL)); } static void test_pem_block (void) { const char *output = "[p11-kit-object-v1]\n" "id: \"292c92\"\n" "trusted: true\n" "-----BEGIN CERTIFICATE-----\n" "MIICPDCCAaUCED9pHoGc8JpK83P/uUii5N0wDQYJKoZIhvcNAQEFBQAwXzELMAkG\n" "A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz\n" "cyAxIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2\n" "MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV\n" "BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmlt\n" "YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN\n" "ADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0f\n" "zGVuDLDQVoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHi\n" "TkVWaR94AoDa3EeRKbs2yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0G\n" "CSqGSIb3DQEBBQUAA4GBAFgVKTk8d6PaXCUDfGD67gmZPCcQcMgMCeazh88K4hiW\n" "NWLMv5sneYlfycQJ9M61Hd8qveXbhpxoJeUwfLaJFf5n0a3hUKw8fGJLj7qE1xIV\n" "Gx/KXQ/BUpQqEZnae88MNhPVNdwQGVnqlMEAv3WP2fr9dgTbYruQagPZRjXZ+Hxb\n" "-----END CERTIFICATE-----\n" "\n"; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_ID, "292c92", 6, }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_VALUE, &verisign_v1_ca, sizeof (verisign_v1_ca) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_INVALID }, }; check_read_success (output, (attrs, NULL)); check_write_success (output, (attrs, NULL)); } static void test_pem_middle (void) { const char *input = "[p11-kit-object-v1]\n" "class: certificate\n" "id: \"292c92\"\n" "-----BEGIN CERTIFICATE-----\n" "MIICPDCCAaUCED9pHoGc8JpK83P/uUii5N0wDQYJKoZIhvcNAQEFBQAwXzELMAkG\n" "A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz\n" "cyAxIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2\n" "MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV\n" "BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmlt\n" "YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN\n" "ADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0f\n" "zGVuDLDQVoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHi\n" "TkVWaR94AoDa3EeRKbs2yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0G\n" "CSqGSIb3DQEBBQUAA4GBAFgVKTk8d6PaXCUDfGD67gmZPCcQcMgMCeazh88K4hiW\n" "NWLMv5sneYlfycQJ9M61Hd8qveXbhpxoJeUwfLaJFf5n0a3hUKw8fGJLj7qE1xIV\n" "Gx/KXQ/BUpQqEZnae88MNhPVNdwQGVnqlMEAv3WP2fr9dgTbYruQagPZRjXZ+Hxb\n" "-----END CERTIFICATE-----\n" "\n" "trusted: true"; CK_ATTRIBUTE expected[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_VALUE, &verisign_v1_ca, sizeof (verisign_v1_ca) }, { CKA_INVALID }, }; check_read_success (input, (expected, NULL)); } static void test_pem_invalid (void) { const char *input = "[p11-kit-object-v1]\n" "class: certificate\n" "-----BEGIN CERT-----\n" "MIICPDCCAaUCED9pHoGc8JpK83P/uUii5N0wDQYJKoZIhvcNAQEFBQAwXzELMAkG\n" "A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz\n" "cyAxIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2\n" "MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV\n" "BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmlt\n" "YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN\n" "ADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0f\n" "zGVuDLDQVoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHi\n" "TkVWaR94AoDa3EeRKbs2yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0G\n" "CSqGSIb3DQEBBQUAA4GBAFgVKTk8d6PaXCUDfGD67gmZPCcQcMgMCeazh88K4hiW\n" "NWLMv5sneYlfycQJ9M61Hd8qveXbhpxoJeUwfLaJFf5n0a3hUKw8fGJLj7qE1xIV\n" "Gx/KXQ/BUpQqEZnae88MNhPVNdwQGVnqlMEAv3WP2fr9dgTbYruQagPZRjXZ+Hxb\n" "-----END CERTIFICATEXXX-----\n"; p11_message_quiet (); check_read_failure (input); p11_message_loud (); } static void test_pem_unsupported (void) { const char *input = "[p11-kit-object-v1]\n" "class: certificate\n" "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1-----\n"; p11_message_quiet (); check_read_failure (input); p11_message_loud (); } static void test_pem_first (void) { const char *input = "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1-----\n" "[p11-kit-object-v1]\n" "class: certificate\n"; p11_message_quiet (); check_read_failure (input); p11_message_loud (); } static void test_skip_unknown (void) { const char *input = "[version-2]\n" "class: data\n" "object-id: 1.2.3.4\n" "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1-----\n" "[p11-kit-object-v1]\n" "class: nss-trust\n" "trust-server-auth: nss-trust-unknown"; CK_TRUST trust = CKT_NSS_TRUST_UNKNOWN; CK_ATTRIBUTE expected2[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust) }, { CKA_TRUST_SERVER_AUTH, &trust, sizeof (trust) }, { CKA_INVALID }, }; p11_message_quiet (); check_read_success (input, (expected2, NULL)); p11_message_loud (); } static void test_bad_value (void) { const char *input = "[p11-kit-object-v1]\n" "class: data\n" "value: \"%38%\"\n"; p11_message_quiet (); check_read_failure (input); p11_message_loud (); } static void test_bad_oid (void) { const char *input = "[p11-kit-object-v1]\n" "class: data\n" "object-id: 1.2"; p11_message_quiet (); check_read_failure (input); p11_message_loud (); } static void test_bad_field (void) { const char *input = "[p11-kit-object-v1]\n" "class: data\n" "invalid-field: true"; p11_message_quiet (); check_read_failure (input); p11_message_loud (); } static void test_attribute_first (void) { const char *input = "class: data\n" "[p11-kit-object-v1]\n" "invalid-field: true"; p11_message_quiet (); check_read_failure (input); p11_message_loud (); } static void test_not_boolean (void) { const char *output = "[p11-kit-object-v1]\n" "private: \"x\"\n\n"; CK_ATTRIBUTE attrs[] = { { CKA_PRIVATE, "x", 1 }, { CKA_INVALID }, }; check_write_success (output, (attrs, NULL)); } static void test_not_ulong (void) { char buffer[sizeof (CK_ULONG) + 1]; char *output; CK_ATTRIBUTE attrs[] = { { CKA_BITS_PER_PIXEL, "xx", 2 }, { CKA_VALUE, buffer, sizeof (CK_ULONG) }, { CKA_INVALID }, }; memset (buffer, 'x', sizeof (buffer)); buffer[sizeof (CK_ULONG)] = 0; if (asprintf (&output, "[p11-kit-object-v1]\n" "bits-per-pixel: \"xx\"\n" "value: \"%s\"\n\n", buffer) < 0) assert_not_reached (); check_write_success (output, (attrs, NULL)); free (output); } int main (int argc, char *argv[]) { p11_test (test_magic, "/persist/magic"); p11_test (test_simple, "/persist/simple"); p11_test (test_number, "/persist/number"); p11_test (test_bool, "/persist/bool"); p11_test (test_oid, "/persist/oid"); p11_test (test_constant, "/persist/constant"); p11_test (test_unknown, "/persist/unknown"); p11_test (test_multiple, "/persist/multiple"); p11_test (test_pem_block, "/persist/pem_block"); p11_test (test_pem_middle, "/persist/pem-middle"); p11_test (test_pem_invalid, "/persist/pem_invalid"); p11_test (test_pem_unsupported, "/persist/pem_unsupported"); p11_test (test_pem_first, "/persist/pem_first"); p11_test (test_bad_value, "/persist/bad_value"); p11_test (test_bad_oid, "/persist/bad_oid"); p11_test (test_bad_field, "/persist/bad_field"); p11_test (test_skip_unknown, "/persist/skip_unknown"); p11_test (test_attribute_first, "/persist/attribute_first"); p11_test (test_not_boolean, "/persist/not-boolean"); p11_test (test_not_ulong, "/persist/not-ulong"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/frob-eku.c0000664000175000017500000000600612226763526014122 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include #include #include #include #include #include "pkix.asn.h" #define err_if_fail(ret, msg) \ do { if ((ret) != ASN1_SUCCESS) { \ fprintf (stderr, "%s: %s\n", msg, asn1_strerror (ret)); \ exit (1); \ } } while (0) int main (int argc, char *argv[]) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = { 0, }; node_asn *definitions = NULL; node_asn *ekus = NULL; char *buf; int len; int ret; int i; ret = asn1_array2tree (pkix_asn1_tab, &definitions, message); if (ret != ASN1_SUCCESS) { fprintf (stderr, "definitions: %s\n", message); return 1; } ret = asn1_create_element (definitions, "PKIX1.ExtKeyUsageSyntax", &ekus); err_if_fail (ret, "ExtKeyUsageSyntax"); for (i = 1; i < argc; i++) { ret = asn1_write_value (ekus, "", "NEW", 1); err_if_fail (ret, "NEW"); ret = asn1_write_value (ekus, "?LAST", argv[i], strlen (argv[i])); err_if_fail (ret, "asn1_write_value"); } len = 0; ret = asn1_der_coding (ekus, "", NULL, &len, message); assert (ret == ASN1_MEM_ERROR); buf = malloc (len); assert (buf != NULL); ret = asn1_der_coding (ekus, "", buf, &len, message); if (ret != ASN1_SUCCESS) { fprintf (stderr, "asn1_der_coding: %s\n", message); return 1; } fwrite (buf, 1, len, stdout); fflush (stdout); free (buf); asn1_delete_structure (&ekus); asn1_delete_structure (&definitions); return 0; } p11-kit-0.20.2/trust/tests/test-token.c0000664000175000017500000005210512226763526014506 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "test-trust.h" #include #include #include #include "attrs.h" #include "debug.h" #include "parser.h" #include "path.h" #include "pkcs11x.h" #include "message.h" #include "token.h" static CK_OBJECT_CLASS certificate = CKO_CERTIFICATE; static CK_OBJECT_CLASS data = CKO_DATA; static CK_BBOOL falsev = CK_FALSE; static CK_BBOOL truev = CK_TRUE; struct { p11_token *token; p11_index *index; p11_parser *parser; char *directory; } test; static void setup (void *path) { test.token = p11_token_new (333, path, "Label"); assert_ptr_not_null (test.token); test.index = p11_token_index (test.token); assert_ptr_not_null (test.token); test.parser = p11_token_parser (test.token); assert_ptr_not_null (test.parser); } static void setup_temp (void *unused) { test.directory = p11_test_directory ("test-module"); setup (test.directory); } static void teardown (void *path) { p11_token_free (test.token); memset (&test, 0, sizeof (test)); } static void teardown_temp (void *unused) { test_delete_directory (test.directory); free (test.directory); teardown (test.directory); } static void test_token_load (void *path) { p11_index *index; int count; count = p11_token_load (test.token); assert_num_eq (6, count); /* A certificate and trust object for each parsed object */ index = p11_token_index (test.token); assert (((count - 1) * 2) + 1 <= p11_index_size (index)); } static void test_token_flags (void *path) { /* * blacklist comes from the input/distrust.pem file. It is not in the blacklist * directory, but is an OpenSSL trusted certificate file, and is marked * in the blacklist style for OpenSSL. */ CK_ATTRIBUTE blacklist[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_LABEL, "Red Hat Is the CA", 17 }, { CKA_SERIAL_NUMBER, "\x02\x01\x01", 3 }, { CKA_TRUSTED, &falsev, sizeof (falsev) }, { CKA_X_DISTRUSTED, &truev, sizeof (truev) }, { CKA_INVALID }, }; /* * blacklist2 comes from the input/blacklist/self-server.der file. It is * explicitly put on the blacklist, even though it containts no trust * policy information. */ const unsigned char self_server_subject[] = { 0x30, 0x4b, 0x31, 0x13, 0x30, 0x11, 0x06, 0x0a, 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x19, 0x16, 0x03, 0x43, 0x4f, 0x4d, 0x31, 0x17, 0x30, 0x15, 0x06, 0x0a, 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x19, 0x16, 0x07, 0x45, 0x58, 0x41, 0x4d, 0x50, 0x4c, 0x45, 0x31, 0x1b, 0x30, 0x19, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x12, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, }; CK_ATTRIBUTE blacklist2[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_SUBJECT, (void *)self_server_subject, sizeof (self_server_subject) }, { CKA_TRUSTED, &falsev, sizeof (falsev) }, { CKA_X_DISTRUSTED, &truev, sizeof (truev) }, { CKA_INVALID }, }; /* * anchor comes from the input/anchors/cacert3.der file. It is * explicitly marked as an anchor, even though it containts no trust * policy information. */ CK_ATTRIBUTE anchor[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_X_DISTRUSTED, &falsev, sizeof (falsev) }, { CKA_INVALID }, }; const unsigned char cacert_root_subject[] = { 0x30, 0x79, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x07, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x15, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x31, 0x22, 0x30, 0x20, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x19, 0x43, 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x12, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, }; /* * notrust comes from the input/cacert-ca.der file. It contains no * trust information, and is not explicitly marked as an anchor, so * it's neither trusted or distrusted. */ CK_ATTRIBUTE notrust[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_SUBJECT, (void *)cacert_root_subject, sizeof (cacert_root_subject) }, { CKA_TRUSTED, &falsev, sizeof (falsev) }, { CKA_X_DISTRUSTED, &falsev, sizeof (falsev) }, { CKA_INVALID }, }; CK_ATTRIBUTE *expected[] = { anchor, blacklist, blacklist2, notrust, NULL, }; CK_OBJECT_HANDLE handle; CK_ATTRIBUTE *object; int i; if (p11_token_load (test.token) < 0) assert_not_reached (); /* The other objects */ for (i = 0; expected[i]; i++) { handle = p11_index_find (p11_token_index (test.token), expected[i], 2); assert (handle != 0); object = p11_index_lookup (p11_token_index (test.token), handle); assert_ptr_not_null (object); test_check_attrs (expected[i], object); } } static void test_token_path (void *path) { assert_str_eq (path, p11_token_get_path (test.token)); } static void test_token_label (void *path) { assert_str_eq ("Label", p11_token_get_label (test.token)); } static void test_token_slot (void *path) { assert_num_eq (333, p11_token_get_slot (test.token)); } static void test_not_writable (void) { p11_token *token; if (getuid () != 0) { token = p11_token_new (333, "/", "Label"); assert (!p11_token_is_writable (token)); p11_token_free (token); } token = p11_token_new (333, "", "Label"); assert (!p11_token_is_writable (token)); p11_token_free (token); token = p11_token_new (333, "/non-existant", "Label"); assert (!p11_token_is_writable (token)); p11_token_free (token); } static void test_writable_exists (void) { /* A writable directory since we created it */ assert (p11_token_is_writable (test.token)); } static void test_writable_no_exist (void) { char *directory; p11_token *token; char *path; directory = p11_test_directory ("test-module"); path = p11_path_build (directory, "subdir", NULL); assert (path != NULL); token = p11_token_new (333, path, "Label"); free (path); /* A writable directory since parent is writable */ assert (p11_token_is_writable (token)); p11_token_free (token); if (rmdir (directory) < 0) assert_not_reached (); free (directory); } static void test_load_already (void) { CK_ATTRIBUTE cert[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_INVALID }, }; CK_OBJECT_HANDLE handle; int ret; test_write_file (test.directory, "test.cer", test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); ret = p11_token_load (test.token); assert_num_eq (ret, 1); handle = p11_index_find (test.index, cert, -1); assert (handle != 0); /* Have to wait to make sure changes are detected */ p11_sleep_ms (1100); ret = p11_token_load (test.token); assert_num_eq (ret, 0); assert_num_eq (p11_index_find (test.index, cert, -1), handle); } static void test_load_unreadable (void) { CK_ATTRIBUTE cert[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_INVALID }, }; int ret; test_write_file (test.directory, "test.cer", test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); ret = p11_token_load (test.token); assert_num_eq (ret, 1); assert (p11_index_find (test.index, cert, -1) != 0); test_write_file (test.directory, "test.cer", "", 0); /* Have to wait to make sure changes are detected */ p11_sleep_ms (1100); ret = p11_token_load (test.token); assert_num_eq (ret, 0); assert (p11_index_find (test.index, cert, -1) == 0); } static void test_load_gone (void) { CK_ATTRIBUTE cert[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_INVALID }, }; int ret; test_write_file (test.directory, "test.cer", test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); ret = p11_token_load (test.token); assert_num_eq (ret, 1); assert (p11_index_find (test.index, cert, -1) != 0); test_delete_file (test.directory, "test.cer"); /* Have to wait to make sure changes are detected */ p11_sleep_ms (1100); ret = p11_token_load (test.token); assert_num_eq (ret, 0); assert (p11_index_find (test.index, cert, -1) == 0); } static void test_load_found (void) { CK_ATTRIBUTE cert[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_INVALID }, }; int ret; ret = p11_token_load (test.token); assert_num_eq (ret, 0); assert (p11_index_find (test.index, cert, -1) == 0); /* Have to wait to make sure changes are detected */ p11_sleep_ms (1100); test_write_file (test.directory, "test.cer", test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); ret = p11_token_load (test.token); assert_num_eq (ret, 1); assert (p11_index_find (test.index, cert, -1) != 0); } static void test_reload_changed (void) { CK_ATTRIBUTE cacert3[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_INVALID }, }; CK_ATTRIBUTE verisign[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_VALUE, (void *)verisign_v1_ca, sizeof (verisign_v1_ca) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_OBJECT_HANDLE handle; int ret; /* Just one file */ test_write_file (test.directory, "test.cer", test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); ret = p11_token_load (test.token); assert_num_eq (ret, 1); handle = p11_index_find (test.index, cacert3, -1); assert (handle != 0); /* Replace the file with verisign */ test_write_file (test.directory, "test.cer", verisign_v1_ca, sizeof (verisign_v1_ca)); /* Add another file with cacert3, but not reloaded */ test_write_file (test.directory, "another.cer", test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); attrs = p11_index_lookup (test.index, handle); assert_ptr_not_null (attrs); if (!p11_token_reload (test.token, attrs)) assert_not_reached (); assert (p11_index_find (test.index, cacert3, -1) == 0); assert (p11_index_find (test.index, verisign, -1) != 0); } static void test_reload_gone (void) { CK_ATTRIBUTE cacert3[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_INVALID }, }; CK_ATTRIBUTE verisign[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_VALUE, (void *)verisign_v1_ca, sizeof (verisign_v1_ca) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_OBJECT_HANDLE handle; int ret; /* Just one file */ test_write_file (test.directory, "cacert3.cer", test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); test_write_file (test.directory, "verisign.cer", verisign_v1_ca, sizeof (verisign_v1_ca)); ret = p11_token_load (test.token); assert_num_eq (ret, 2); handle = p11_index_find (test.index, cacert3, -1); assert (handle != 0); assert (p11_index_find (test.index, verisign, -1) != 0); test_delete_file (test.directory, "cacert3.cer"); test_delete_file (test.directory, "verisign.cer"); attrs = p11_index_lookup (test.index, handle); assert_ptr_not_null (attrs); if (p11_token_reload (test.token, attrs)) assert_not_reached (); assert (p11_index_find (test.index, cacert3, -1) == 0); assert (p11_index_find (test.index, verisign, -1) != 0); } static void test_reload_no_origin (void) { CK_ATTRIBUTE cacert3[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_INVALID }, }; if (p11_token_reload (test.token, cacert3)) assert_not_reached (); } static void test_write_new (void) { CK_ATTRIBUTE original[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "Yay!", 4 }, { CKA_VALUE, "eight", 5 }, { CKA_TOKEN, &truev, sizeof (truev) }, { CKA_INVALID } }; CK_ATTRIBUTE expected[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "Yay!", 4 }, { CKA_VALUE, "eight", 5 }, { CKA_APPLICATION, "", 0 }, { CKA_OBJECT_ID, "", 0 }, { CKA_INVALID } }; CK_OBJECT_HANDLE handle; p11_array *parsed; char *path; CK_RV rv; int ret; rv = p11_index_add (test.index, original, 4, &handle); assert_num_eq (rv, CKR_OK); /* The expected file name */ path = p11_path_build (test.directory, "Yay_.p11-kit", NULL); ret = p11_parse_file (test.parser, path, NULL, 0); assert_num_eq (ret, P11_PARSE_SUCCESS); free (path); parsed = p11_parser_parsed (test.parser); assert_num_eq (parsed->num, 1); test_check_attrs (expected, parsed->elem[0]); } static void test_write_no_label (void) { CK_ATTRIBUTE original[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_VALUE, "eight", 5 }, { CKA_TOKEN, &truev, sizeof (truev) }, { CKA_INVALID } }; CK_ATTRIBUTE expected[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "", 0 }, { CKA_VALUE, "eight", 5 }, { CKA_APPLICATION, "", 0 }, { CKA_OBJECT_ID, "", 0 }, { CKA_INVALID } }; CK_OBJECT_HANDLE handle; p11_array *parsed; char *path; CK_RV rv; int ret; rv = p11_index_add (test.index, original, 4, &handle); assert_num_eq (rv, CKR_OK); /* The expected file name */ path = p11_path_build (test.directory, "data.p11-kit", NULL); ret = p11_parse_file (test.parser, path, NULL, 0); assert_num_eq (ret, P11_PARSE_SUCCESS); free (path); parsed = p11_parser_parsed (test.parser); assert_num_eq (parsed->num, 1); test_check_attrs (expected, parsed->elem[0]); } static void test_modify_multiple (void) { const char *test_data = "[p11-kit-object-v1]\n" "class: data\n" "label: \"first\"\n" "value: \"1\"\n" "\n" "[p11-kit-object-v1]\n" "class: data\n" "label: \"second\"\n" "value: \"2\"\n" "\n" "[p11-kit-object-v1]\n" "class: data\n" "label: \"third\"\n" "value: \"3\"\n"; CK_ATTRIBUTE first[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "first", 5 }, { CKA_VALUE, "1", 1 }, { CKA_INVALID }, }; CK_ATTRIBUTE second[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "zwei", 4 }, { CKA_VALUE, "2", 2 }, { CKA_INVALID }, }; CK_ATTRIBUTE third[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "third", 5 }, { CKA_VALUE, "3", 1 }, { CKA_INVALID }, }; CK_ATTRIBUTE match = { CKA_LABEL, "second", 6 }; CK_OBJECT_HANDLE handle; p11_array *parsed; char *path; int ret; CK_RV rv; test_write_file (test.directory, "Test.p11-kit", test_data, strlen (test_data)); /* Reload now that we have this new file */ p11_token_load (test.token); handle = p11_index_find (test.index, &match, 1); rv = p11_index_update (test.index, handle, p11_attrs_dup (second)); assert_num_eq (rv, CKR_OK); /* Now read in the file and make sure it has all the objects */ path = p11_path_build (test.directory, "Test.p11-kit", NULL); ret = p11_parse_file (test.parser, path, NULL, 0); assert_num_eq (ret, P11_PARSE_SUCCESS); free (path); parsed = p11_parser_parsed (test.parser); assert_num_eq (parsed->num, 3); /* The modified one will be first */ test_check_attrs (second, parsed->elem[0]); test_check_attrs (first, parsed->elem[1]); test_check_attrs (third, parsed->elem[2]); } static void test_remove_one (void) { const char *test_data = "[p11-kit-object-v1]\n" "class: data\n" "label: \"first\"\n" "value: \"1\"\n" "\n"; CK_ATTRIBUTE match = { CKA_LABEL, "first", 5 }; CK_OBJECT_HANDLE handle; CK_RV rv; test_write_file (test.directory, "Test.p11-kit", test_data, strlen (test_data)); test_check_directory (test.directory, ("Test.p11-kit", NULL)); /* Reload now that we have this new file */ p11_token_load (test.token); handle = p11_index_find (test.index, &match, 1); assert_num_cmp (handle, !=, 0); rv = p11_index_remove (test.index, handle); assert_num_eq (rv, CKR_OK); /* No other files in the test directory, all files gone */ test_check_directory (test.directory, (NULL, NULL)); } static void test_remove_multiple (void) { const char *test_data = "[p11-kit-object-v1]\n" "class: data\n" "label: \"first\"\n" "value: \"1\"\n" "\n" "[p11-kit-object-v1]\n" "class: data\n" "label: \"second\"\n" "value: \"2\"\n" "\n" "[p11-kit-object-v1]\n" "class: data\n" "label: \"third\"\n" "value: \"3\"\n"; CK_ATTRIBUTE first[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "first", 5 }, { CKA_VALUE, "1", 1 }, { CKA_INVALID }, }; CK_ATTRIBUTE third[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "third", 5 }, { CKA_VALUE, "3", 1 }, { CKA_INVALID }, }; CK_ATTRIBUTE match = { CKA_LABEL, "second", 6 }; CK_OBJECT_HANDLE handle; p11_array *parsed; char *path; int ret; CK_RV rv; test_write_file (test.directory, "Test.p11-kit", test_data, strlen (test_data)); /* Reload now that we have this new file */ p11_token_load (test.token); handle = p11_index_find (test.index, &match, 1); assert_num_cmp (handle, !=, 0); rv = p11_index_remove (test.index, handle); assert_num_eq (rv, CKR_OK); /* Now read in the file and make sure it has all the objects */ path = p11_path_build (test.directory, "Test.p11-kit", NULL); ret = p11_parse_file (test.parser, path, NULL, 0); assert_num_eq (ret, P11_PARSE_SUCCESS); free (path); parsed = p11_parser_parsed (test.parser); assert_num_eq (parsed->num, 2); /* The modified one will be first */ test_check_attrs (first, parsed->elem[0]); test_check_attrs (third, parsed->elem[1]); } int main (int argc, char *argv[]) { p11_fixture (setup, teardown); p11_testx (test_token_load, SRCDIR "/input", "/token/load"); p11_testx (test_token_flags, SRCDIR "/input", "/token/flags"); p11_testx (test_token_path, "/wheee", "/token/path"); p11_testx (test_token_label, "/wheee", "/token/label"); p11_testx (test_token_slot, "/unneeded", "/token/slot"); p11_fixture (NULL, NULL); p11_test (test_not_writable, "/token/not-writable"); p11_test (test_writable_no_exist, "/token/writable-no-exist"); p11_fixture (setup_temp, teardown_temp); p11_test (test_writable_exists, "/token/writable-exists"); p11_test (test_load_found, "/token/load-found"); p11_test (test_load_already, "/token/load-already"); p11_test (test_load_unreadable, "/token/load-unreadable"); p11_test (test_load_gone, "/token/load-gone"); p11_test (test_reload_changed, "/token/reload-changed"); p11_test (test_reload_gone, "/token/reload-gone"); p11_test (test_reload_no_origin, "/token/reload-no-origin"); p11_test (test_write_new, "/token/write-new"); p11_test (test_write_no_label, "/token/write-no-label"); p11_test (test_modify_multiple, "/token/modify-multiple"); p11_test (test_remove_one, "/token/remove-one"); p11_test (test_remove_multiple, "/token/remove-multiple"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/test-cer.c0000664000175000017500000001523512226763526014142 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #define P11_KIT_DISABLE_DEPRECATED #include "config.h" #include "test-trust.h" #include "attrs.h" #include "compat.h" #include "debug.h" #include "dict.h" #include "extract.h" #include "message.h" #include "mock.h" #include "path.h" #include "pkcs11.h" #include "pkcs11x.h" #include "oid.h" #include "test.h" #include #include #include #include #include struct { CK_FUNCTION_LIST module; p11_enumerate ex; char *directory; } test; static void setup (void *unused) { CK_RV rv; mock_module_reset (); memcpy (&test.module, &mock_module, sizeof (CK_FUNCTION_LIST)); rv = test.module.C_Initialize (NULL); assert_num_eq (CKR_OK, rv); p11_enumerate_init (&test.ex); test.directory = p11_test_directory ("test-extract"); } static void teardown (void *unused) { CK_RV rv; if (rmdir (test.directory) < 0) assert_fail ("rmdir() failed", test.directory); free (test.directory); p11_enumerate_cleanup (&test.ex); rv = test.module.C_Finalize (NULL); assert_num_eq (CKR_OK, rv); } static CK_OBJECT_CLASS certificate_class = CKO_CERTIFICATE; static CK_CERTIFICATE_TYPE x509_type = CKC_X_509; static CK_ATTRIBUTE cacert3_authority_attrs[] = { { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_CERTIFICATE_TYPE, &x509_type, sizeof (x509_type) }, { CKA_LABEL, "Cacert3 Here", 12 }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_ID, "ID1", 3 }, { CKA_INVALID }, }; static CK_ATTRIBUTE certificate_filter[] = { { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_INVALID }, }; static void test_file (void) { char *destination; bool ret; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_authority_attrs); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.cer") < 0) assert_not_reached (); ret = p11_extract_x509_file (&test.ex, destination); assert_num_eq (true, ret); test_check_file (test.directory, "extract.cer", SRCDIR "/files/cacert3.der"); free (destination); } static void test_file_multiple (void) { char *destination; bool ret; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_authority_attrs); mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_authority_attrs); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.cer") < 0) assert_not_reached (); p11_message_quiet (); ret = p11_extract_x509_file (&test.ex, destination); assert_num_eq (true, ret); assert (strstr (p11_message_last (), "multiple certificates") != NULL); p11_message_loud (); test_check_file (test.directory, "extract.cer", SRCDIR "/files/cacert3.der"); free (destination); } static void test_file_without (void) { char *destination; bool ret; p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.cer") < 0) assert_not_reached (); p11_message_quiet (); ret = p11_extract_x509_file (&test.ex, destination); assert_num_eq (false, ret); assert (strstr (p11_message_last (), "no certificate") != NULL); p11_message_loud (); free (destination); } static void test_directory (void) { bool ret; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_authority_attrs); mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_authority_attrs); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); /* Yes, this is a race, and why you shouldn't build software as root */ if (rmdir (test.directory) < 0) assert_not_reached (); ret = p11_extract_x509_directory (&test.ex, test.directory); assert_num_eq (true, ret); test_check_directory (test.directory, ("Cacert3_Here.cer", "Cacert3_Here.1.cer", NULL)); test_check_file (test.directory, "Cacert3_Here.cer", SRCDIR "/files/cacert3.der"); test_check_file (test.directory, "Cacert3_Here.1.cer", SRCDIR "/files/cacert3.der"); } static void test_directory_empty (void) { bool ret; p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); /* Yes, this is a race, and why you shouldn't build software as root */ if (rmdir (test.directory) < 0) assert_not_reached (); ret = p11_extract_x509_directory (&test.ex, test.directory); assert_num_eq (true, ret); test_check_directory (test.directory, (NULL, NULL)); } int main (int argc, char *argv[]) { mock_module_init (); p11_fixture (setup, teardown); p11_test (test_file, "/x509/test_file"); p11_test (test_file_multiple, "/x509/test_file_multiple"); p11_test (test_file_without, "/x509/test_file_without"); p11_test (test_directory, "/x509/test_directory"); p11_test (test_directory_empty, "/x509/test_directory_empty"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/frob-pow.c0000664000175000017500000000357512161102014014124 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include static unsigned int nearest_pow_2 (int num) { unsigned int n = num ? 1 : 0; while (n < num && n > 0) n <<= 1; return n; } int main (void) { int i; for (i = 0; i < 40; i++) printf ("nearest_pow_2 (%d) == %u\n", i, nearest_pow_2 (i)); return 0; } p11-kit-0.20.2/trust/tests/test-oid.c0000664000175000017500000001110412226763526014133 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include "debug.h" #include "oid.h" #include #include "pkix.asn.h" static void test_known_oids (void) { char buffer[128]; node_asn *definitions = NULL; node_asn *node; int ret; int len; int i; struct { const unsigned char *oid; size_t length; const char *string; } known_oids[] = { { P11_OID_SUBJECT_KEY_IDENTIFIER, sizeof (P11_OID_SUBJECT_KEY_IDENTIFIER), P11_OID_SUBJECT_KEY_IDENTIFIER_STR, }, { P11_OID_KEY_USAGE, sizeof (P11_OID_KEY_USAGE), P11_OID_KEY_USAGE_STR, }, { P11_OID_BASIC_CONSTRAINTS, sizeof (P11_OID_BASIC_CONSTRAINTS), P11_OID_BASIC_CONSTRAINTS_STR }, { P11_OID_EXTENDED_KEY_USAGE, sizeof (P11_OID_EXTENDED_KEY_USAGE), P11_OID_EXTENDED_KEY_USAGE_STR }, { P11_OID_OPENSSL_REJECT, sizeof (P11_OID_OPENSSL_REJECT), P11_OID_OPENSSL_REJECT_STR }, { P11_OID_SERVER_AUTH, sizeof (P11_OID_SERVER_AUTH), P11_OID_SERVER_AUTH_STR }, { P11_OID_CLIENT_AUTH, sizeof (P11_OID_CLIENT_AUTH), P11_OID_CLIENT_AUTH_STR }, { P11_OID_CODE_SIGNING, sizeof (P11_OID_CODE_SIGNING), P11_OID_CODE_SIGNING_STR }, { P11_OID_EMAIL_PROTECTION, sizeof (P11_OID_EMAIL_PROTECTION), P11_OID_EMAIL_PROTECTION_STR }, { P11_OID_IPSEC_END_SYSTEM, sizeof (P11_OID_IPSEC_END_SYSTEM), P11_OID_IPSEC_END_SYSTEM_STR }, { P11_OID_IPSEC_TUNNEL, sizeof (P11_OID_IPSEC_TUNNEL), P11_OID_IPSEC_TUNNEL_STR }, { P11_OID_IPSEC_USER, sizeof (P11_OID_IPSEC_USER), P11_OID_IPSEC_USER_STR }, { P11_OID_TIME_STAMPING, sizeof (P11_OID_TIME_STAMPING), P11_OID_TIME_STAMPING_STR }, { P11_OID_RESERVED_PURPOSE, sizeof (P11_OID_RESERVED_PURPOSE), P11_OID_RESERVED_PURPOSE_STR }, { NULL }, }; ret = asn1_array2tree (pkix_asn1_tab, &definitions, NULL); assert (ret == ASN1_SUCCESS); for (i = 0; known_oids[i].oid != NULL; i++) { assert (p11_oid_simple (known_oids[i].oid, known_oids[i].length)); assert_num_eq (known_oids[i].length, p11_oid_length (known_oids[i].oid)); assert (p11_oid_equal (known_oids[i].oid, known_oids[i].oid)); if (i > 0) assert (!p11_oid_equal (known_oids[i].oid, known_oids[i - 1].oid)); /* AttributeType is a OBJECT IDENTIFIER */ ret = asn1_create_element (definitions, "PKIX1.AttributeType", &node); assert (ret == ASN1_SUCCESS); ret = asn1_der_decoding (&node, known_oids[i].oid, known_oids[i].length, NULL); assert (ret == ASN1_SUCCESS); len = sizeof (buffer); ret = asn1_read_value (node, "", buffer, &len); assert (ret == ASN1_SUCCESS); assert_str_eq (known_oids[i].string, buffer); asn1_delete_structure (&node); } asn1_delete_structure (&definitions); } static void test_hash (void) { assert_num_cmp (p11_oid_hash (P11_OID_CN), !=, 0); assert_num_cmp (p11_oid_hash (P11_OID_CN), ==, p11_oid_hash (P11_OID_CN)); assert_num_cmp (p11_oid_hash (P11_OID_CN), !=, p11_oid_hash (P11_OID_BASIC_CONSTRAINTS)); } int main (int argc, char *argv[]) { p11_test (test_known_oids, "/oids/known"); p11_test (test_hash, "/oids/hash"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/frob-ku.c0000664000175000017500000000725312226763526013762 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include "oid.h" #include #include #include #include #include #include "pkix.asn.h" #define err_if_fail(ret, msg) \ do { if ((ret) != ASN1_SUCCESS) { \ fprintf (stderr, "%s: %s\n", msg, asn1_strerror (ret)); \ exit (1); \ } } while (0) int main (int argc, char *argv[]) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = { 0, }; node_asn *definitions = NULL; node_asn *ku = NULL; unsigned int usage = 0; char bits[2]; char *buf; int len; int ret; int i; for (i = 1; i < argc; i++) { if (strcmp (argv[i], "digital-signature") == 0) usage |= P11_KU_DIGITAL_SIGNATURE; else if (strcmp (argv[i], "non-repudiation") == 0) usage |= P11_KU_NON_REPUDIATION; else if (strcmp (argv[i], "key-encipherment") == 0) usage |= P11_KU_KEY_ENCIPHERMENT; else if (strcmp (argv[i], "data-encipherment") == 0) usage |= P11_KU_DATA_ENCIPHERMENT; else if (strcmp (argv[i], "key-agreement") == 0) usage |= P11_KU_KEY_AGREEMENT; else if (strcmp (argv[i], "key-cert-sign") == 0) usage |= P11_KU_KEY_CERT_SIGN; else if (strcmp (argv[i], "crl-sign") == 0) usage |= P11_KU_CRL_SIGN; else { fprintf (stderr, "unsupported or unknown key usage: %s\n", argv[i]); return 2; } } ret = asn1_array2tree (pkix_asn1_tab, &definitions, message); if (ret != ASN1_SUCCESS) { fprintf (stderr, "definitions: %s\n", message); return 1; } ret = asn1_create_element (definitions, "PKIX1.KeyUsage", &ku); err_if_fail (ret, "KeyUsage"); bits[0] = usage & 0xff; bits[1] = (usage >> 8) & 0xff; ret = asn1_write_value (ku, "", bits, 9); err_if_fail (ret, "asn1_write_value"); len = 0; ret = asn1_der_coding (ku, "", NULL, &len, message); assert (ret == ASN1_MEM_ERROR); buf = malloc (len); assert (buf != NULL); ret = asn1_der_coding (ku, "", buf, &len, message); if (ret != ASN1_SUCCESS) { fprintf (stderr, "asn1_der_coding: %s\n", message); return 1; } fwrite (buf, 1, len, stdout); fflush (stdout); asn1_delete_structure (&ku); asn1_delete_structure (&definitions); return 0; } p11-kit-0.20.2/trust/tests/frob-cert.c0000664000175000017500000000724312226763526014277 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include #include #include #include #include #include #include #include #include #include "pkix.asn.h" #define err_if_fail(ret, msg) \ do { if ((ret) != ASN1_SUCCESS) { \ fprintf (stderr, "%s: %s\n", msg, asn1_strerror (ret)); \ exit (1); \ } } while (0) static ssize_t tlv_length (const unsigned char *data, size_t length) { unsigned char cls; int counter = 0; int cb, len; unsigned long tag; if (asn1_get_tag_der (data, length, &cls, &cb, &tag) == ASN1_SUCCESS) { counter += cb; len = asn1_get_length_der (data + cb, length - cb, &cb); counter += cb; if (len >= 0) { len += counter; if (length >= len) return len; } } return -1; } int main (int argc, char *argv[]) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = { 0, }; node_asn *definitions = NULL; node_asn *cert = NULL; p11_mmap *map; void *data; size_t size; int start, end; ssize_t len; int ret; if (argc != 4) { fprintf (stderr, "usage: frob-cert struct field filename\n"); return 2; } ret = asn1_array2tree (pkix_asn1_tab, &definitions, message); if (ret != ASN1_SUCCESS) { fprintf (stderr, "definitions: %s\n", message); return 1; } ret = asn1_create_element (definitions, argv[1], &cert); err_if_fail (ret, "Certificate"); map = p11_mmap_open (argv[3], NULL, &data, &size); if (map == NULL) { fprintf (stderr, "couldn't open file: %s\n", argv[3]); return 1; } ret = asn1_der_decoding (&cert, data, size, message); err_if_fail (ret, message); ret = asn1_der_decoding_startEnd (cert, data, size, argv[2], &start, &end); err_if_fail (ret, "asn1_der_decoding_startEnd"); len = tlv_length ((unsigned char *)data + start, size - start); assert (len >= 0); fprintf (stderr, "%lu %d %d %ld\n", (unsigned long)size, start, end, (long)len); fwrite ((unsigned char *)data + start, 1, len, stdout); fflush (stdout); p11_mmap_close (map); asn1_delete_structure (&cert); asn1_delete_structure (&definitions); return 0; } p11-kit-0.20.2/trust/tests/files/0000775000175000017500000000000012226763526013424 500000000000000p11-kit-0.20.2/trust/tests/files/unrecognized-file.txt0000664000175000017500000000005312161102014017465 00000000000000# This file is not recognized by the parserp11-kit-0.20.2/trust/tests/files/cacert3-trusted-keyid.pem0000664000175000017500000000511612226763526020171 00000000000000-----BEGIN TRUSTED CERTIFICATE----- MIIHWTCCBUGgAwIBAgIDCkGKMA0GCSqGSIb3DQEBCwUAMHkxEDAOBgNVBAoTB1Jv b3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAGA1UEAxMZ Q0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYSc3VwcG9y dEBjYWNlcnQub3JnMB4XDTExMDUyMzE3NDgwMloXDTIxMDUyMDE3NDgwMlowVDEU MBIGA1UEChMLQ0FjZXJ0IEluYy4xHjAcBgNVBAsTFWh0dHA6Ly93d3cuQ0FjZXJ0 Lm9yZzEcMBoGA1UEAxMTQ0FjZXJ0IENsYXNzIDMgUm9vdDCCAiIwDQYJKoZIhvcN AQEBBQADggIPADCCAgoCggIBAKtJNRFIfNImflOUz0Op3SjXQiqL84d4GVh8D57a iX3h++tykA10oZZkq5+gJJlz2uJVdscXe/UErEa4w75/ZI0QbCTzYZzA8pD6Ueb1 aQFjww9W4kpCz+JEjCUoqMV5CX1GuYrz6fM0KQhF5Byfy5QEHIGoFLOYZcRD7E6C jQnRvapbjZLQ7N6QxX8KwuPr5jFaXnQ+lzNZ6MMDPWAzv/fRb0fEze5ig1JuLgia pNkVGJGmhZJHsK5I6223IeyFGmhyNav/8BBdwPSUp2rVO5J+TJAFfpPBLIukjmJ0 FXFuC3ED6q8VOJrU0gVyb4z5K+taciX5OUbjchs+BMNkJyIQKopPWKcDrb60LhPt XapI19V91Cp7XPpGBFDkzA5CW4zt2/LP/JaT4NsRNlRiNDiPDGCbO5dWOK3z0luL oFvqTpa4fNfVoIZwQNORKbeiPK31jLvPGpKK5DR7wNhsX+kKwsOnIJpa3yxdUly6 R9Wb7yQocDggL9V/KcCyQQNokszgnMyXS0XvOhAKq3A6mJVwrTWx6oUrpByAITGp rmB6gCZIALgBwJNjVSKRPFbnr9s6JfOPMVTqJouBWfmh0VMRxXudA/Z0EeBtsSw/ LIaRmXGapneLNGDRFLQsrJ2vjBDTn8Rq+G8T/HNZ92ZCdB6K4/jc0m+YnMtHmJVA BfvpAgMBAAGjggINMIICCTAdBgNVHQ4EFgQUdahxYEyIE/B42Yl3tW3Fid+8sXow gaMGA1UdIwSBmzCBmIAUFrUyG9TH8+DmjvO90rA67rI5GNGhfaR7MHkxEDAOBgNV BAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAG A1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS c3VwcG9ydEBjYWNlcnQub3JnggEAMA8GA1UdEwEB/wQFMAMBAf8wXQYIKwYBBQUH AQEEUTBPMCMGCCsGAQUFBzABhhdodHRwOi8vb2NzcC5DQWNlcnQub3JnLzAoBggr BgEFBQcwAoYcaHR0cDovL3d3dy5DQWNlcnQub3JnL2NhLmNydDBKBgNVHSAEQzBB MD8GCCsGAQQBgZBKMDMwMQYIKwYBBQUHAgEWJWh0dHA6Ly93d3cuQ0FjZXJ0Lm9y Zy9pbmRleC5waHA/aWQ9MTAwNAYJYIZIAYb4QgEIBCcWJWh0dHA6Ly93d3cuQ0Fj ZXJ0Lm9yZy9pbmRleC5waHA/aWQ9MTAwUAYJYIZIAYb4QgENBEMWQVRvIGdldCB5 b3VyIG93biBjZXJ0aWZpY2F0ZSBmb3IgRlJFRSwgZ28gdG8gaHR0cDovL3d3dy5D QWNlcnQub3JnMA0GCSqGSIb3DQEBCwUAA4ICAQApKIWuRKm5r6R5E/CooyuXYPNc 7uMvwfbiZqARrjY3OnYVBFPqQvX56sAV2KaC2eRhrnILKVyQQ+hBsuF32wITRHhH Va9Y/MyY9kW50SD42CEH/m2qc9SzxgfpCYXMO/K2viwcJdVxjDm1Luq+GIG6sJO4 D+Pm1yaMMVpyA4RS5qb1MyJFCsgLDYq4Nm+QCaGrvdfVTi5xotSu+qdUK+s1jVq3 VIgv7nSf7UgWyg1I0JTTrKSi9iTfkuO960NAkW4cGI5WtIIS86mTn9S8nK2cde5a lxuV53QtHA+wLJef+6kzOXrnAzqSjiL2jA3k2X4Ndhj3AfnvlpaiVXPAPHG0HRpW Q7fDCo1y/OIQCQtBzoyUoPkD/XFzS4pXM+WOdH4VAQDmzEoc53+VGS3FpQyLu7Xt hbNc09+4ufLKxw0BFKxwWMWMjTPUnWajGlCVI/xI4AZDEtnNp4Y5LzZyo4AQ5OHz 0ctbGsDkgJp8E3MGT9ujayQKurMcvEp4u+XjdTilSKeiHq921F73OIZWWonO1sOn ebJSoMbxhbQljPI/lrMQ2Y1sVzufb4Y6GIIiNsiwkTjbKqGTqoQ/9SdlrnPVyNXT d+pLncdBu8fA46A/5H2kjXPmEkvfoXNzczqA6NXLji/L6hOn1kGLrPo8idck9U60 4GGSt/M3mMS+lqO3ijAJBAcAAQIDBAUG -----END TRUSTED CERTIFICATE----- p11-kit-0.20.2/trust/tests/files/cacert3.pem0000664000175000017500000000506212165274405015371 00000000000000-----BEGIN CERTIFICATE----- MIIHWTCCBUGgAwIBAgIDCkGKMA0GCSqGSIb3DQEBCwUAMHkxEDAOBgNVBAoTB1Jv b3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAGA1UEAxMZ Q0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYSc3VwcG9y dEBjYWNlcnQub3JnMB4XDTExMDUyMzE3NDgwMloXDTIxMDUyMDE3NDgwMlowVDEU MBIGA1UEChMLQ0FjZXJ0IEluYy4xHjAcBgNVBAsTFWh0dHA6Ly93d3cuQ0FjZXJ0 Lm9yZzEcMBoGA1UEAxMTQ0FjZXJ0IENsYXNzIDMgUm9vdDCCAiIwDQYJKoZIhvcN AQEBBQADggIPADCCAgoCggIBAKtJNRFIfNImflOUz0Op3SjXQiqL84d4GVh8D57a iX3h++tykA10oZZkq5+gJJlz2uJVdscXe/UErEa4w75/ZI0QbCTzYZzA8pD6Ueb1 aQFjww9W4kpCz+JEjCUoqMV5CX1GuYrz6fM0KQhF5Byfy5QEHIGoFLOYZcRD7E6C jQnRvapbjZLQ7N6QxX8KwuPr5jFaXnQ+lzNZ6MMDPWAzv/fRb0fEze5ig1JuLgia pNkVGJGmhZJHsK5I6223IeyFGmhyNav/8BBdwPSUp2rVO5J+TJAFfpPBLIukjmJ0 FXFuC3ED6q8VOJrU0gVyb4z5K+taciX5OUbjchs+BMNkJyIQKopPWKcDrb60LhPt XapI19V91Cp7XPpGBFDkzA5CW4zt2/LP/JaT4NsRNlRiNDiPDGCbO5dWOK3z0luL oFvqTpa4fNfVoIZwQNORKbeiPK31jLvPGpKK5DR7wNhsX+kKwsOnIJpa3yxdUly6 R9Wb7yQocDggL9V/KcCyQQNokszgnMyXS0XvOhAKq3A6mJVwrTWx6oUrpByAITGp rmB6gCZIALgBwJNjVSKRPFbnr9s6JfOPMVTqJouBWfmh0VMRxXudA/Z0EeBtsSw/ LIaRmXGapneLNGDRFLQsrJ2vjBDTn8Rq+G8T/HNZ92ZCdB6K4/jc0m+YnMtHmJVA BfvpAgMBAAGjggINMIICCTAdBgNVHQ4EFgQUdahxYEyIE/B42Yl3tW3Fid+8sXow gaMGA1UdIwSBmzCBmIAUFrUyG9TH8+DmjvO90rA67rI5GNGhfaR7MHkxEDAOBgNV BAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAG A1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS c3VwcG9ydEBjYWNlcnQub3JnggEAMA8GA1UdEwEB/wQFMAMBAf8wXQYIKwYBBQUH AQEEUTBPMCMGCCsGAQUFBzABhhdodHRwOi8vb2NzcC5DQWNlcnQub3JnLzAoBggr BgEFBQcwAoYcaHR0cDovL3d3dy5DQWNlcnQub3JnL2NhLmNydDBKBgNVHSAEQzBB MD8GCCsGAQQBgZBKMDMwMQYIKwYBBQUHAgEWJWh0dHA6Ly93d3cuQ0FjZXJ0Lm9y Zy9pbmRleC5waHA/aWQ9MTAwNAYJYIZIAYb4QgEIBCcWJWh0dHA6Ly93d3cuQ0Fj ZXJ0Lm9yZy9pbmRleC5waHA/aWQ9MTAwUAYJYIZIAYb4QgENBEMWQVRvIGdldCB5 b3VyIG93biBjZXJ0aWZpY2F0ZSBmb3IgRlJFRSwgZ28gdG8gaHR0cDovL3d3dy5D QWNlcnQub3JnMA0GCSqGSIb3DQEBCwUAA4ICAQApKIWuRKm5r6R5E/CooyuXYPNc 7uMvwfbiZqARrjY3OnYVBFPqQvX56sAV2KaC2eRhrnILKVyQQ+hBsuF32wITRHhH Va9Y/MyY9kW50SD42CEH/m2qc9SzxgfpCYXMO/K2viwcJdVxjDm1Luq+GIG6sJO4 D+Pm1yaMMVpyA4RS5qb1MyJFCsgLDYq4Nm+QCaGrvdfVTi5xotSu+qdUK+s1jVq3 VIgv7nSf7UgWyg1I0JTTrKSi9iTfkuO960NAkW4cGI5WtIIS86mTn9S8nK2cde5a lxuV53QtHA+wLJef+6kzOXrnAzqSjiL2jA3k2X4Ndhj3AfnvlpaiVXPAPHG0HRpW Q7fDCo1y/OIQCQtBzoyUoPkD/XFzS4pXM+WOdH4VAQDmzEoc53+VGS3FpQyLu7Xt hbNc09+4ufLKxw0BFKxwWMWMjTPUnWajGlCVI/xI4AZDEtnNp4Y5LzZyo4AQ5OHz 0ctbGsDkgJp8E3MGT9ujayQKurMcvEp4u+XjdTilSKeiHq921F73OIZWWonO1sOn ebJSoMbxhbQljPI/lrMQ2Y1sVzufb4Y6GIIiNsiwkTjbKqGTqoQ/9SdlrnPVyNXT d+pLncdBu8fA46A/5H2kjXPmEkvfoXNzczqA6NXLji/L6hOn1kGLrPo8idck9U60 4GGSt/M3mMS+lqO3ig== -----END CERTIFICATE----- p11-kit-0.20.2/trust/tests/files/multiple.pem0000664000175000017500000000674212226763526015713 00000000000000-----BEGIN TRUSTED CERTIFICATE----- MIIHWTCCBUGgAwIBAgIDCkGKMA0GCSqGSIb3DQEBCwUAMHkxEDAOBgNVBAoTB1Jv b3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAGA1UEAxMZ Q0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYSc3VwcG9y dEBjYWNlcnQub3JnMB4XDTExMDUyMzE3NDgwMloXDTIxMDUyMDE3NDgwMlowVDEU MBIGA1UEChMLQ0FjZXJ0IEluYy4xHjAcBgNVBAsTFWh0dHA6Ly93d3cuQ0FjZXJ0 Lm9yZzEcMBoGA1UEAxMTQ0FjZXJ0IENsYXNzIDMgUm9vdDCCAiIwDQYJKoZIhvcN AQEBBQADggIPADCCAgoCggIBAKtJNRFIfNImflOUz0Op3SjXQiqL84d4GVh8D57a iX3h++tykA10oZZkq5+gJJlz2uJVdscXe/UErEa4w75/ZI0QbCTzYZzA8pD6Ueb1 aQFjww9W4kpCz+JEjCUoqMV5CX1GuYrz6fM0KQhF5Byfy5QEHIGoFLOYZcRD7E6C jQnRvapbjZLQ7N6QxX8KwuPr5jFaXnQ+lzNZ6MMDPWAzv/fRb0fEze5ig1JuLgia pNkVGJGmhZJHsK5I6223IeyFGmhyNav/8BBdwPSUp2rVO5J+TJAFfpPBLIukjmJ0 FXFuC3ED6q8VOJrU0gVyb4z5K+taciX5OUbjchs+BMNkJyIQKopPWKcDrb60LhPt XapI19V91Cp7XPpGBFDkzA5CW4zt2/LP/JaT4NsRNlRiNDiPDGCbO5dWOK3z0luL oFvqTpa4fNfVoIZwQNORKbeiPK31jLvPGpKK5DR7wNhsX+kKwsOnIJpa3yxdUly6 R9Wb7yQocDggL9V/KcCyQQNokszgnMyXS0XvOhAKq3A6mJVwrTWx6oUrpByAITGp rmB6gCZIALgBwJNjVSKRPFbnr9s6JfOPMVTqJouBWfmh0VMRxXudA/Z0EeBtsSw/ LIaRmXGapneLNGDRFLQsrJ2vjBDTn8Rq+G8T/HNZ92ZCdB6K4/jc0m+YnMtHmJVA BfvpAgMBAAGjggINMIICCTAdBgNVHQ4EFgQUdahxYEyIE/B42Yl3tW3Fid+8sXow gaMGA1UdIwSBmzCBmIAUFrUyG9TH8+DmjvO90rA67rI5GNGhfaR7MHkxEDAOBgNV BAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAG A1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS c3VwcG9ydEBjYWNlcnQub3JnggEAMA8GA1UdEwEB/wQFMAMBAf8wXQYIKwYBBQUH AQEEUTBPMCMGCCsGAQUFBzABhhdodHRwOi8vb2NzcC5DQWNlcnQub3JnLzAoBggr BgEFBQcwAoYcaHR0cDovL3d3dy5DQWNlcnQub3JnL2NhLmNydDBKBgNVHSAEQzBB MD8GCCsGAQQBgZBKMDMwMQYIKwYBBQUHAgEWJWh0dHA6Ly93d3cuQ0FjZXJ0Lm9y Zy9pbmRleC5waHA/aWQ9MTAwNAYJYIZIAYb4QgEIBCcWJWh0dHA6Ly93d3cuQ0Fj ZXJ0Lm9yZy9pbmRleC5waHA/aWQ9MTAwUAYJYIZIAYb4QgENBEMWQVRvIGdldCB5 b3VyIG93biBjZXJ0aWZpY2F0ZSBmb3IgRlJFRSwgZ28gdG8gaHR0cDovL3d3dy5D QWNlcnQub3JnMA0GCSqGSIb3DQEBCwUAA4ICAQApKIWuRKm5r6R5E/CooyuXYPNc 7uMvwfbiZqARrjY3OnYVBFPqQvX56sAV2KaC2eRhrnILKVyQQ+hBsuF32wITRHhH Va9Y/MyY9kW50SD42CEH/m2qc9SzxgfpCYXMO/K2viwcJdVxjDm1Luq+GIG6sJO4 D+Pm1yaMMVpyA4RS5qb1MyJFCsgLDYq4Nm+QCaGrvdfVTi5xotSu+qdUK+s1jVq3 VIgv7nSf7UgWyg1I0JTTrKSi9iTfkuO960NAkW4cGI5WtIIS86mTn9S8nK2cde5a lxuV53QtHA+wLJef+6kzOXrnAzqSjiL2jA3k2X4Ndhj3AfnvlpaiVXPAPHG0HRpW Q7fDCo1y/OIQCQtBzoyUoPkD/XFzS4pXM+WOdH4VAQDmzEoc53+VGS3FpQyLu7Xt hbNc09+4ufLKxw0BFKxwWMWMjTPUnWajGlCVI/xI4AZDEtnNp4Y5LzZyo4AQ5OHz 0ctbGsDkgJp8E3MGT9ujayQKurMcvEp4u+XjdTilSKeiHq921F73OIZWWonO1sOn ebJSoMbxhbQljPI/lrMQ2Y1sVzufb4Y6GIIiNsiwkTjbKqGTqoQ/9SdlrnPVyNXT d+pLncdBu8fA46A/5H2kjXPmEkvfoXNzczqA6NXLji/L6hOn1kGLrPo8idck9U60 4GGSt/M3mMS+lqO3ijAmMAoGCCsGAQUFBwMBoAoGCCsGAQUFBwMEDAxDdXN0b20g TGFiZWw= -----END TRUSTED CERTIFICATE----- -----BEGIN TRUSTED CERTIFICATE----- MIICPDCCAaUCED9pHoGc8JpK83P/uUii5N0wDQYJKoZIhvcNAQEFBQAwXzELMAkG A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz cyAxIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmlt YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN ADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0f zGVuDLDQVoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHi TkVWaR94AoDa3EeRKbs2yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0G CSqGSIb3DQEBBQUAA4GBAFgVKTk8d6PaXCUDfGD67gmZPCcQcMgMCeazh88K4hiW NWLMv5sneYlfycQJ9M61Hd8qveXbhpxoJeUwfLaJFf5n0a3hUKw8fGJLj7qE1xIV Gx/KXQ/BUpQqEZnae88MNhPVNdwQGVnqlMEAv3WP2fr9dgTbYruQagPZRjXZ+Hxb MA4MDEN1c3RvbSBMYWJlbA== -----END TRUSTED CERTIFICATE----- p11-kit-0.20.2/trust/tests/files/cacert3-not-trusted.pem0000664000175000017500000000510612226763526017663 00000000000000-----BEGIN TRUSTED CERTIFICATE----- MIIHWTCCBUGgAwIBAgIDCkGKMA0GCSqGSIb3DQEBCwUAMHkxEDAOBgNVBAoTB1Jv b3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAGA1UEAxMZ Q0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYSc3VwcG9y dEBjYWNlcnQub3JnMB4XDTExMDUyMzE3NDgwMloXDTIxMDUyMDE3NDgwMlowVDEU MBIGA1UEChMLQ0FjZXJ0IEluYy4xHjAcBgNVBAsTFWh0dHA6Ly93d3cuQ0FjZXJ0 Lm9yZzEcMBoGA1UEAxMTQ0FjZXJ0IENsYXNzIDMgUm9vdDCCAiIwDQYJKoZIhvcN AQEBBQADggIPADCCAgoCggIBAKtJNRFIfNImflOUz0Op3SjXQiqL84d4GVh8D57a iX3h++tykA10oZZkq5+gJJlz2uJVdscXe/UErEa4w75/ZI0QbCTzYZzA8pD6Ueb1 aQFjww9W4kpCz+JEjCUoqMV5CX1GuYrz6fM0KQhF5Byfy5QEHIGoFLOYZcRD7E6C jQnRvapbjZLQ7N6QxX8KwuPr5jFaXnQ+lzNZ6MMDPWAzv/fRb0fEze5ig1JuLgia pNkVGJGmhZJHsK5I6223IeyFGmhyNav/8BBdwPSUp2rVO5J+TJAFfpPBLIukjmJ0 FXFuC3ED6q8VOJrU0gVyb4z5K+taciX5OUbjchs+BMNkJyIQKopPWKcDrb60LhPt XapI19V91Cp7XPpGBFDkzA5CW4zt2/LP/JaT4NsRNlRiNDiPDGCbO5dWOK3z0luL oFvqTpa4fNfVoIZwQNORKbeiPK31jLvPGpKK5DR7wNhsX+kKwsOnIJpa3yxdUly6 R9Wb7yQocDggL9V/KcCyQQNokszgnMyXS0XvOhAKq3A6mJVwrTWx6oUrpByAITGp rmB6gCZIALgBwJNjVSKRPFbnr9s6JfOPMVTqJouBWfmh0VMRxXudA/Z0EeBtsSw/ LIaRmXGapneLNGDRFLQsrJ2vjBDTn8Rq+G8T/HNZ92ZCdB6K4/jc0m+YnMtHmJVA BfvpAgMBAAGjggINMIICCTAdBgNVHQ4EFgQUdahxYEyIE/B42Yl3tW3Fid+8sXow gaMGA1UdIwSBmzCBmIAUFrUyG9TH8+DmjvO90rA67rI5GNGhfaR7MHkxEDAOBgNV BAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEiMCAG A1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS c3VwcG9ydEBjYWNlcnQub3JnggEAMA8GA1UdEwEB/wQFMAMBAf8wXQYIKwYBBQUH AQEEUTBPMCMGCCsGAQUFBzABhhdodHRwOi8vb2NzcC5DQWNlcnQub3JnLzAoBggr BgEFBQcwAoYcaHR0cDovL3d3dy5DQWNlcnQub3JnL2NhLmNydDBKBgNVHSAEQzBB MD8GCCsGAQQBgZBKMDMwMQYIKwYBBQUHAgEWJWh0dHA6Ly93d3cuQ0FjZXJ0Lm9y Zy9pbmRleC5waHA/aWQ9MTAwNAYJYIZIAYb4QgEIBCcWJWh0dHA6Ly93d3cuQ0Fj ZXJ0Lm9yZy9pbmRleC5waHA/aWQ9MTAwUAYJYIZIAYb4QgENBEMWQVRvIGdldCB5 b3VyIG93biBjZXJ0aWZpY2F0ZSBmb3IgRlJFRSwgZ28gdG8gaHR0cDovL3d3dy5D QWNlcnQub3JnMA0GCSqGSIb3DQEBCwUAA4ICAQApKIWuRKm5r6R5E/CooyuXYPNc 7uMvwfbiZqARrjY3OnYVBFPqQvX56sAV2KaC2eRhrnILKVyQQ+hBsuF32wITRHhH Va9Y/MyY9kW50SD42CEH/m2qc9SzxgfpCYXMO/K2viwcJdVxjDm1Luq+GIG6sJO4 D+Pm1yaMMVpyA4RS5qb1MyJFCsgLDYq4Nm+QCaGrvdfVTi5xotSu+qdUK+s1jVq3 VIgv7nSf7UgWyg1I0JTTrKSi9iTfkuO960NAkW4cGI5WtIIS86mTn9S8nK2cde5a lxuV53QtHA+wLJef+6kzOXrnAzqSjiL2jA3k2X4Ndhj3AfnvlpaiVXPAPHG0HRpW Q7fDCo1y/OIQCQtBzoyUoPkD/XFzS4pXM+WOdH4VAQDmzEoc53+VGS3FpQyLu7Xt hbNc09+4ufLKxw0BFKxwWMWMjTPUnWajGlCVI/xI4AZDEtnNp4Y5LzZyo4AQ5OHz 0ctbGsDkgJp8E3MGT9ujayQKurMcvEp4u+XjdTilSKeiHq921F73OIZWWonO1sOn ebJSoMbxhbQljPI/lrMQ2Y1sVzufb4Y6GIIiNsiwkTjbKqGTqoQ/9SdlrnPVyNXT d+pLncdBu8fA46A/5H2kjXPmEkvfoXNzczqA6NXLji/L6hOn1kGLrPo8idck9U60 4GGSt/M3mMS+lqO3ijACMAA= -----END TRUSTED CERTIFICATE----- p11-kit-0.20.2/trust/tests/files/testing-server.der0000664000175000017500000000105212165274405017012 000000000000000&00  *H 010 &,dCOM10 &,dEXAMPLE10U Certificate Authority10Uca.example.com10 *H  ca@example.com0 110117194717Z 210114194717Z0K10 &,dCOM10 &,dEXAMPLE10Userver.example.com0\0  *H K0HAIWf3\ukc9(߅jR὎#^_HԠO"0 0 U00U% 0 +0  *H c24<ɜ XyPTia:Q ǔ(\$=ܠJۗG FT  ϻV@x|cwW,D"BHT|3#l(8(~p11-kit-0.20.2/trust/tests/files/self-signed-with-eku.der0000664000175000017500000000074012165274405017767 0000000000000000Ex0  *H 0+1)0'U self-signed-with-eku.example.com0 130131092109Z 130302092109Z0+1)0'U self-signed-with-eku.example.com00  *H 0RޙUbn sx2((AbБB^=SuLJP'Ƹ H)0en+y\E7V,@A I& fxufh@~ULx)P(6=<0 0 U0  *H i osEORXٮsZH&.7EJ/c|-T=(a_]TW =bGx˹z_ zw pb X\ޓOM{00U p^x4!&V50U#0 p^x4!&V501 0 UUS10UNorth Carolina10URaleigh10U  Red Hat, Inc.1 0 U IS10U Red Hat IS CA1&0$ *H  sysadmin-rdu@redhat.com0 U00  *H P`;%(cA[oDȮ`OR㿚 &p@(N)r(+l iYguFwK0,]iZvy.52|rtʸɃZҷ]e1K'OdYp11-kit-0.20.2/trust/tests/files/cacert-ca.der0000664000175000017500000000350112165274405015654 000000000000000=0%0  *H 0y10U Root CA10U http://www.cacert.org1"0 UCA Cert Signing Authority1!0 *H  support@cacert.org0 030330122949Z 330329122949Z0y10U Root CA10U http://www.cacert.org1"0 UCA Cert Signing Authority1!0 *H  support@cacert.org0"0  *H 0 "F}6(P3@K;f?1k6|Nw6A Fs`n~XdͰE cg ҿ>L5]l!ޞ ٺf27rXɎ^> l[df*zKSy{/ a+~MVڒDAX`efD˔B~ ehQWkzr%[ 2H.0B%k?:SHҶ4zX+[8]fɘמtq r`o34v>$zoE8GAJ. Yתғ}h.݋KX/ꕧTۋQ"þ,x ӊ/?Qe!eE|ALO)!3u Qwi"Ṕ1{8h[+~_rLK Wʑu!7c g>FOp gYͺbA )d)B"xC QKZZqs 00U2Ұ:90U#02Ұ:9ѡ}{0y10U Root CA10U http://www.cacert.org1"0 UCA Cert Signing Authority1!0 *H  support@cacert.org0U002U+0)0'%#!https://www.cacert.org/revoke.crl00 `HB#!https://www.cacert.org/revoke.crl04 `HB'%http://www.cacert.org/index.php?id=100V `HB IGTo get your own certificate for FREE head over to http://www.cacert.org0  *H (\5 ojhX>ÐZ`CpbgX 06;Htq>+h4b@F;S(fSM];`yi;eƁ\MU7paj|.T>O!܂EMs7;N˛͚۲p-JذoEH3<2*T#Gdzqc~/ܟ+H%B>Wiw4 Kʠƌ27hs_QIS6 Ly:u pg/y= s og/ ${H5)@`ᖆPzY؏! ς;kV#lH3Y=`3oGbRn.GHm!hr5]j;~L~,btqn q8ro+Zr%9Fr>d'"*OX.]H}*{\FPB[6Tb48 `;V8[[N|ՠp@ӑ)<4{l_ ç Z,]R\G՛$(p8 /)Ah̗KE: p:p5+!1`z&HcU" */ #include "config.h" #include "test.h" #include "test-trust.h" #include #include #include #include "attrs.h" #include "builder.h" #include "debug.h" #include "digest.h" #include "index.h" #include "message.h" #include "oid.h" #include "pkcs11x.h" struct { p11_builder *builder; p11_index *index; } test; static CK_TRUST trusted = CKT_NSS_TRUSTED; static CK_TRUST trusted_delegator = CKT_NSS_TRUSTED_DELEGATOR; static CK_TRUST not_trusted = CKT_NSS_NOT_TRUSTED; static CK_TRUST trust_unknown = CKT_NSS_TRUST_UNKNOWN; static CK_OBJECT_CLASS certificate = CKO_CERTIFICATE; static CK_OBJECT_CLASS data = CKO_DATA; static CK_OBJECT_CLASS certificate_extension = CKO_X_CERTIFICATE_EXTENSION; static CK_OBJECT_CLASS nss_trust = CKO_NSS_TRUST; static CK_OBJECT_CLASS trust_assertion = CKO_X_TRUST_ASSERTION; static CK_X_ASSERTION_TYPE anchored_certificate = CKT_X_ANCHORED_CERTIFICATE; static CK_X_ASSERTION_TYPE distrusted_certificate = CKT_X_DISTRUSTED_CERTIFICATE; static CK_CERTIFICATE_TYPE x509 = CKC_X_509; static CK_ULONG certificate_authority = 2; static CK_ULONG other_entity = 3; static CK_BBOOL truev = CK_TRUE; static CK_BBOOL falsev = CK_FALSE; static void setup (void *unused) { test.builder = p11_builder_new (P11_BUILDER_FLAG_TOKEN); assert_ptr_not_null (test.builder); test.index = p11_index_new (p11_builder_build, NULL, NULL, p11_builder_changed, test.builder); assert_ptr_not_null (test.index); } static void teardown (void *unused) { p11_builder_free (test.builder); p11_index_free (test.index); memset (&test, 0, sizeof (test)); } static void test_get_cache (void) { p11_asn1_cache *cache; cache = p11_builder_get_cache (test.builder); assert_ptr_eq (NULL, p11_asn1_cache_get (cache, "blah", (unsigned char *)"blah", 4)); } static void test_build_data (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_VALUE, "the value", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE check[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_TOKEN, &truev, sizeof (truev) }, { CKA_MODIFIABLE, &falsev, sizeof (falsev) }, { CKA_PRIVATE, &falsev, sizeof (falsev) }, { CKA_LABEL, "", 0 }, { CKA_VALUE, "the value", 9 }, { CKA_APPLICATION, "", 0 }, { CKA_OBJECT_ID, "", 0 }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; attrs = NULL; extra = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, merge, true); attrs = p11_attrs_merge (attrs, extra, false); test_check_attrs (check, attrs); p11_attrs_free (attrs); } static void test_build_certificate (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_LABEL, "the label", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE expected[] = { { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CERTIFICATE_CATEGORY, &certificate_authority, sizeof (certificate_authority) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_CHECK_VALUE, "\xad\x7c\x3f", 3 }, { CKA_START_DATE, "20110523", 8 }, { CKA_END_DATE, "20210520", 8, }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_LABEL, "the label", 9 }, { CKA_ID, "\xf0""a\xd8?\x95\x8fMx\xb1G\xb3\x13""9\x97\x8e\xa9\xc2Q\xba\x9b", 20}, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; attrs = NULL; extra = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, merge, true); attrs = p11_attrs_merge (attrs, extra, false); test_check_attrs (expected, attrs); p11_attrs_free (attrs); } static void test_build_certificate_empty (void) { unsigned char checksum[P11_DIGEST_SHA1_LEN]; CK_ULONG domain = 0; CK_ULONG category = 0; CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_URL, "http://blah", 11 }, { CKA_HASH_OF_ISSUER_PUBLIC_KEY, checksum, sizeof (checksum) }, { CKA_HASH_OF_SUBJECT_PUBLIC_KEY, checksum, sizeof (checksum) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_LABEL, "the label", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE expected[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CERTIFICATE_CATEGORY, &category, sizeof (category) }, { CKA_VALUE, "", 0 }, { CKA_START_DATE, "", 0 }, { CKA_END_DATE, "", 0, }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_ISSUER, "", 0 }, { CKA_SERIAL_NUMBER, "", 0 }, { CKA_HASH_OF_ISSUER_PUBLIC_KEY, checksum, sizeof (checksum) }, { CKA_HASH_OF_SUBJECT_PUBLIC_KEY, checksum, sizeof (checksum) }, { CKA_LABEL, "the label", 9 }, { CKA_JAVA_MIDP_SECURITY_DOMAIN, &domain, sizeof (domain) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; p11_digest_sha1 (checksum, test_cacert3_ca_der, sizeof (test_cacert3_ca_der), NULL); attrs = NULL; extra = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, merge, true); attrs = p11_attrs_merge (attrs, extra, false); test_check_attrs (expected, attrs); p11_attrs_free (attrs); } static const unsigned char entrust_pretend_ca[] = { 0x30, 0x82, 0x04, 0x5c, 0x30, 0x82, 0x03, 0x44, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x04, 0x38, 0x63, 0xb9, 0x66, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x81, 0xb4, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0b, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x31, 0x40, 0x30, 0x3e, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x14, 0x37, 0x77, 0x77, 0x77, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x43, 0x50, 0x53, 0x5f, 0x32, 0x30, 0x34, 0x38, 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x20, 0x62, 0x79, 0x20, 0x72, 0x65, 0x66, 0x2e, 0x20, 0x28, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x20, 0x6c, 0x69, 0x61, 0x62, 0x2e, 0x29, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1c, 0x28, 0x63, 0x29, 0x20, 0x31, 0x39, 0x39, 0x39, 0x20, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x31, 0x33, 0x30, 0x31, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x2a, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x28, 0x32, 0x30, 0x34, 0x38, 0x29, 0x30, 0x1e, 0x17, 0x0d, 0x39, 0x39, 0x31, 0x32, 0x32, 0x34, 0x31, 0x37, 0x35, 0x30, 0x35, 0x31, 0x5a, 0x17, 0x0d, 0x31, 0x39, 0x31, 0x32, 0x32, 0x34, 0x31, 0x38, 0x32, 0x30, 0x35, 0x31, 0x5a, 0x30, 0x81, 0xb4, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0b, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x31, 0x40, 0x30, 0x3e, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x14, 0x37, 0x77, 0x77, 0x77, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x43, 0x50, 0x53, 0x5f, 0x32, 0x30, 0x34, 0x38, 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x20, 0x62, 0x79, 0x20, 0x72, 0x65, 0x66, 0x2e, 0x20, 0x28, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x20, 0x6c, 0x69, 0x61, 0x62, 0x2e, 0x29, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1c, 0x28, 0x63, 0x29, 0x20, 0x31, 0x39, 0x39, 0x39, 0x20, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x31, 0x33, 0x30, 0x31, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x2a, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x28, 0x32, 0x30, 0x34, 0x38, 0x29, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xad, 0x4d, 0x4b, 0xa9, 0x12, 0x86, 0xb2, 0xea, 0xa3, 0x20, 0x07, 0x15, 0x16, 0x64, 0x2a, 0x2b, 0x4b, 0xd1, 0xbf, 0x0b, 0x4a, 0x4d, 0x8e, 0xed, 0x80, 0x76, 0xa5, 0x67, 0xb7, 0x78, 0x40, 0xc0, 0x73, 0x42, 0xc8, 0x68, 0xc0, 0xdb, 0x53, 0x2b, 0xdd, 0x5e, 0xb8, 0x76, 0x98, 0x35, 0x93, 0x8b, 0x1a, 0x9d, 0x7c, 0x13, 0x3a, 0x0e, 0x1f, 0x5b, 0xb7, 0x1e, 0xcf, 0xe5, 0x24, 0x14, 0x1e, 0xb1, 0x81, 0xa9, 0x8d, 0x7d, 0xb8, 0xcc, 0x6b, 0x4b, 0x03, 0xf1, 0x02, 0x0c, 0xdc, 0xab, 0xa5, 0x40, 0x24, 0x00, 0x7f, 0x74, 0x94, 0xa1, 0x9d, 0x08, 0x29, 0xb3, 0x88, 0x0b, 0xf5, 0x87, 0x77, 0x9d, 0x55, 0xcd, 0xe4, 0xc3, 0x7e, 0xd7, 0x6a, 0x64, 0xab, 0x85, 0x14, 0x86, 0x95, 0x5b, 0x97, 0x32, 0x50, 0x6f, 0x3d, 0xc8, 0xba, 0x66, 0x0c, 0xe3, 0xfc, 0xbd, 0xb8, 0x49, 0xc1, 0x76, 0x89, 0x49, 0x19, 0xfd, 0xc0, 0xa8, 0xbd, 0x89, 0xa3, 0x67, 0x2f, 0xc6, 0x9f, 0xbc, 0x71, 0x19, 0x60, 0xb8, 0x2d, 0xe9, 0x2c, 0xc9, 0x90, 0x76, 0x66, 0x7b, 0x94, 0xe2, 0xaf, 0x78, 0xd6, 0x65, 0x53, 0x5d, 0x3c, 0xd6, 0x9c, 0xb2, 0xcf, 0x29, 0x03, 0xf9, 0x2f, 0xa4, 0x50, 0xb2, 0xd4, 0x48, 0xce, 0x05, 0x32, 0x55, 0x8a, 0xfd, 0xb2, 0x64, 0x4c, 0x0e, 0xe4, 0x98, 0x07, 0x75, 0xdb, 0x7f, 0xdf, 0xb9, 0x08, 0x55, 0x60, 0x85, 0x30, 0x29, 0xf9, 0x7b, 0x48, 0xa4, 0x69, 0x86, 0xe3, 0x35, 0x3f, 0x1e, 0x86, 0x5d, 0x7a, 0x7a, 0x15, 0xbd, 0xef, 0x00, 0x8e, 0x15, 0x22, 0x54, 0x17, 0x00, 0x90, 0x26, 0x93, 0xbc, 0x0e, 0x49, 0x68, 0x91, 0xbf, 0xf8, 0x47, 0xd3, 0x9d, 0x95, 0x42, 0xc1, 0x0e, 0x4d, 0xdf, 0x6f, 0x26, 0xcf, 0xc3, 0x18, 0x21, 0x62, 0x66, 0x43, 0x70, 0xd6, 0xd5, 0xc0, 0x07, 0xe1, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x74, 0x30, 0x72, 0x30, 0x11, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x00, 0x07, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x55, 0xe4, 0x81, 0xd1, 0x11, 0x80, 0xbe, 0xd8, 0x89, 0xb9, 0x08, 0xa3, 0x31, 0xf9, 0xa1, 0x24, 0x09, 0x16, 0xb9, 0x70, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x55, 0xe4, 0x81, 0xd1, 0x11, 0x80, 0xbe, 0xd8, 0x89, 0xb9, 0x08, 0xa3, 0x31, 0xf9, 0xa1, 0x24, 0x09, 0x16, 0xb9, 0x70, 0x30, 0x1d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf6, 0x7d, 0x07, 0x41, 0x00, 0x04, 0x10, 0x30, 0x0e, 0x1b, 0x08, 0x56, 0x35, 0x2e, 0x30, 0x3a, 0x34, 0x2e, 0x30, 0x03, 0x02, 0x04, 0x90, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x59, 0x47, 0xac, 0x21, 0x84, 0x8a, 0x17, 0xc9, 0x9c, 0x89, 0x53, 0x1e, 0xba, 0x80, 0x85, 0x1a, 0xc6, 0x3c, 0x4e, 0x3e, 0xb1, 0x9c, 0xb6, 0x7c, 0xc6, 0x92, 0x5d, 0x18, 0x64, 0x02, 0xe3, 0xd3, 0x06, 0x08, 0x11, 0x61, 0x7c, 0x63, 0xe3, 0x2b, 0x9d, 0x31, 0x03, 0x70, 0x76, 0xd2, 0xa3, 0x28, 0xa0, 0xf4, 0xbb, 0x9a, 0x63, 0x73, 0xed, 0x6d, 0xe5, 0x2a, 0xdb, 0xed, 0x14, 0xa9, 0x2b, 0xc6, 0x36, 0x11, 0xd0, 0x2b, 0xeb, 0x07, 0x8b, 0xa5, 0xda, 0x9e, 0x5c, 0x19, 0x9d, 0x56, 0x12, 0xf5, 0x54, 0x29, 0xc8, 0x05, 0xed, 0xb2, 0x12, 0x2a, 0x8d, 0xf4, 0x03, 0x1b, 0xff, 0xe7, 0x92, 0x10, 0x87, 0xb0, 0x3a, 0xb5, 0xc3, 0x9d, 0x05, 0x37, 0x12, 0xa3, 0xc7, 0xf4, 0x15, 0xb9, 0xd5, 0xa4, 0x39, 0x16, 0x9b, 0x53, 0x3a, 0x23, 0x91, 0xf1, 0xa8, 0x82, 0xa2, 0x6a, 0x88, 0x68, 0xc1, 0x79, 0x02, 0x22, 0xbc, 0xaa, 0xa6, 0xd6, 0xae, 0xdf, 0xb0, 0x14, 0x5f, 0xb8, 0x87, 0xd0, 0xdd, 0x7c, 0x7f, 0x7b, 0xff, 0xaf, 0x1c, 0xcf, 0xe6, 0xdb, 0x07, 0xad, 0x5e, 0xdb, 0x85, 0x9d, 0xd0, 0x2b, 0x0d, 0x33, 0xdb, 0x04, 0xd1, 0xe6, 0x49, 0x40, 0x13, 0x2b, 0x76, 0xfb, 0x3e, 0xe9, 0x9c, 0x89, 0x0f, 0x15, 0xce, 0x18, 0xb0, 0x85, 0x78, 0x21, 0x4f, 0x6b, 0x4f, 0x0e, 0xfa, 0x36, 0x67, 0xcd, 0x07, 0xf2, 0xff, 0x08, 0xd0, 0xe2, 0xde, 0xd9, 0xbf, 0x2a, 0xaf, 0xb8, 0x87, 0x86, 0x21, 0x3c, 0x04, 0xca, 0xb7, 0x94, 0x68, 0x7f, 0xcf, 0x3c, 0xe9, 0x98, 0xd7, 0x38, 0xff, 0xec, 0xc0, 0xd9, 0x50, 0xf0, 0x2e, 0x4b, 0x58, 0xae, 0x46, 0x6f, 0xd0, 0x2e, 0xc3, 0x60, 0xda, 0x72, 0x55, 0x72, 0xbd, 0x4c, 0x45, 0x9e, 0x61, 0xba, 0xbf, 0x84, 0x81, 0x92, 0x03, 0xd1, 0xd2, 0x69, 0x7c, 0xc5, }; static const unsigned char entrust_public_key[] = { 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xad, 0x4d, 0x4b, 0xa9, 0x12, 0x86, 0xb2, 0xea, 0xa3, 0x20, 0x07, 0x15, 0x16, 0x64, 0x2a, 0x2b, 0x4b, 0xd1, 0xbf, 0x0b, 0x4a, 0x4d, 0x8e, 0xed, 0x80, 0x76, 0xa5, 0x67, 0xb7, 0x78, 0x40, 0xc0, 0x73, 0x42, 0xc8, 0x68, 0xc0, 0xdb, 0x53, 0x2b, 0xdd, 0x5e, 0xb8, 0x76, 0x98, 0x35, 0x93, 0x8b, 0x1a, 0x9d, 0x7c, 0x13, 0x3a, 0x0e, 0x1f, 0x5b, 0xb7, 0x1e, 0xcf, 0xe5, 0x24, 0x14, 0x1e, 0xb1, 0x81, 0xa9, 0x8d, 0x7d, 0xb8, 0xcc, 0x6b, 0x4b, 0x03, 0xf1, 0x02, 0x0c, 0xdc, 0xab, 0xa5, 0x40, 0x24, 0x00, 0x7f, 0x74, 0x94, 0xa1, 0x9d, 0x08, 0x29, 0xb3, 0x88, 0x0b, 0xf5, 0x87, 0x77, 0x9d, 0x55, 0xcd, 0xe4, 0xc3, 0x7e, 0xd7, 0x6a, 0x64, 0xab, 0x85, 0x14, 0x86, 0x95, 0x5b, 0x97, 0x32, 0x50, 0x6f, 0x3d, 0xc8, 0xba, 0x66, 0x0c, 0xe3, 0xfc, 0xbd, 0xb8, 0x49, 0xc1, 0x76, 0x89, 0x49, 0x19, 0xfd, 0xc0, 0xa8, 0xbd, 0x89, 0xa3, 0x67, 0x2f, 0xc6, 0x9f, 0xbc, 0x71, 0x19, 0x60, 0xb8, 0x2d, 0xe9, 0x2c, 0xc9, 0x90, 0x76, 0x66, 0x7b, 0x94, 0xe2, 0xaf, 0x78, 0xd6, 0x65, 0x53, 0x5d, 0x3c, 0xd6, 0x9c, 0xb2, 0xcf, 0x29, 0x03, 0xf9, 0x2f, 0xa4, 0x50, 0xb2, 0xd4, 0x48, 0xce, 0x05, 0x32, 0x55, 0x8a, 0xfd, 0xb2, 0x64, 0x4c, 0x0e, 0xe4, 0x98, 0x07, 0x75, 0xdb, 0x7f, 0xdf, 0xb9, 0x08, 0x55, 0x60, 0x85, 0x30, 0x29, 0xf9, 0x7b, 0x48, 0xa4, 0x69, 0x86, 0xe3, 0x35, 0x3f, 0x1e, 0x86, 0x5d, 0x7a, 0x7a, 0x15, 0xbd, 0xef, 0x00, 0x8e, 0x15, 0x22, 0x54, 0x17, 0x00, 0x90, 0x26, 0x93, 0xbc, 0x0e, 0x49, 0x68, 0x91, 0xbf, 0xf8, 0x47, 0xd3, 0x9d, 0x95, 0x42, 0xc1, 0x0e, 0x4d, 0xdf, 0x6f, 0x26, 0xcf, 0xc3, 0x18, 0x21, 0x62, 0x66, 0x43, 0x70, 0xd6, 0xd5, 0xc0, 0x07, 0xe1, 0x02, 0x03, 0x01, 0x00, 0x01, }; static void test_build_certificate_non_ca (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_VALUE, (void *)entrust_pretend_ca, sizeof (entrust_pretend_ca) }, { CKA_INVALID }, }; CK_ATTRIBUTE expected[] = { { CKA_CERTIFICATE_CATEGORY, &other_entity, sizeof (other_entity) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *extra; CK_RV rv; attrs = NULL; extra = NULL; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, p11_attrs_dup (input), true); attrs = p11_attrs_merge (attrs, extra, false); test_check_attrs (expected, attrs); p11_attrs_free (attrs); } static void test_build_certificate_v1_ca (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_VALUE, (void *)verisign_v1_ca, sizeof (verisign_v1_ca) }, { CKA_INVALID }, }; CK_ATTRIBUTE expected[] = { { CKA_CERTIFICATE_CATEGORY, &certificate_authority, sizeof (certificate_authority) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *extra; CK_RV rv; attrs = NULL; extra = NULL; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, p11_attrs_dup (input), true); attrs = p11_attrs_merge (attrs, extra, false); test_check_attrs (expected, attrs); p11_attrs_free (attrs); } static void test_build_certificate_staple_ca (void) { CK_ULONG category = 2; /* CA */ CK_ATTRIBUTE stapled[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension) }, { CKA_OBJECT_ID, (void *)P11_OID_BASIC_CONSTRAINTS, sizeof (P11_OID_BASIC_CONSTRAINTS) }, { CKA_VALUE, "\x30\x0f\x06\x03\x55\x1d\x13\x01\x01\xff\x04\x05\x30\x03\x01\x01\xff", 17 }, { CKA_X_PUBLIC_KEY_INFO, (void *)entrust_public_key, sizeof (entrust_public_key) }, { CKA_INVALID }, }; CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_VALUE, (void *)entrust_pretend_ca, sizeof (entrust_pretend_ca) }, { CKA_INVALID }, }; CK_ATTRIBUTE expected[] = { { CKA_CERTIFICATE_CATEGORY, &category, sizeof (category) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *extra; CK_RV rv; /* Adding the stapled extension *first*, and then the certificate */ /* Add a stapled certificate */ rv = p11_index_add (test.index, stapled, 4, NULL); assert_num_eq (CKR_OK, rv); attrs = NULL; extra = NULL; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, p11_attrs_dup (input), true); attrs = p11_attrs_merge (attrs, extra, false); /* * Even though the certificate is not a valid CA, the presence of the * stapled certificate extension transforms it into a CA. */ test_check_attrs (expected, attrs); p11_attrs_free (attrs); } static void test_build_certificate_staple_ca_backwards (void) { CK_ULONG category = 2; /* CA */ CK_ATTRIBUTE stapled[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension) }, { CKA_OBJECT_ID, (void *)P11_OID_BASIC_CONSTRAINTS, sizeof (P11_OID_BASIC_CONSTRAINTS) }, { CKA_VALUE, "\x30\x0f\x06\x03\x55\x1d\x13\x01\x01\xff\x04\x05\x30\x03\x01\x01\xff", 17 }, { CKA_X_PUBLIC_KEY_INFO, (void *)entrust_public_key, sizeof (entrust_public_key) }, { CKA_INVALID }, }; CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_VALUE, (void *)entrust_pretend_ca, sizeof (entrust_pretend_ca) }, { CKA_INVALID }, }; CK_ATTRIBUTE expected[] = { { CKA_CERTIFICATE_CATEGORY, &category, sizeof (category) }, { CKA_INVALID }, }; CK_RV rv; CK_ATTRIBUTE *attrs; CK_OBJECT_HANDLE handle; /* Adding the certificate *first*, and then the stapled extension */ rv = p11_index_add (test.index, input, 4, &handle); assert_num_eq (CKR_OK, rv); /* Add a stapled certificate */ rv = p11_index_add (test.index, stapled, 4, NULL); assert_num_eq (CKR_OK, rv); /* * Even though the certificate is not a valid CA, the presence of the * stapled certificate extension transforms it into a CA. */ attrs = p11_index_lookup (test.index, handle); test_check_attrs (expected, attrs); } static void test_build_certificate_no_type (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; p11_message_quiet (); attrs = NULL; extra = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_TEMPLATE_INCOMPLETE, rv); p11_attrs_free (merge); p11_message_loud (); } static void test_build_certificate_bad_type (void) { CK_CERTIFICATE_TYPE type = CKC_WTLS; CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &type, sizeof (type) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; p11_message_quiet (); attrs = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_TEMPLATE_INCONSISTENT, rv); p11_attrs_free (merge); p11_message_loud (); } static void test_build_extension (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_VALUE, "\x30\x11\x06\x03\x55\x1d\x50\x04\x0a\x74\x68\x65\x20\x76\x61\x6c\x75\x65\x0a", 19 }, { CKA_INVALID }, }; CK_ATTRIBUTE check[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension) }, { CKA_TOKEN, &truev, sizeof (truev) }, { CKA_MODIFIABLE, &falsev, sizeof (falsev) }, { CKA_PRIVATE, &falsev, sizeof (falsev) }, { CKA_OBJECT_ID, "\x06\x03\x55\x1d\x50", 5 }, { CKA_VALUE, "\x30\x11\x06\x03\x55\x1d\x50\x04\x0a\x74\x68\x65\x20\x76\x61\x6c\x75\x65\x0a", 19 }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_LABEL, "", 0 }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *extra; CK_RV rv; attrs = NULL; extra = NULL; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, p11_attrs_dup (input), true); attrs = p11_attrs_merge (attrs, extra, false); test_check_attrs (check, attrs); p11_attrs_free (attrs); } /* This certificate has and end date in 2067 */ static const unsigned char cert_distant_end_date[] = { 0x30, 0x82, 0x01, 0x6a, 0x30, 0x82, 0x01, 0x14, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x02, 0x03, 0xe7, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1d, 0x66, 0x61, 0x72, 0x2d, 0x69, 0x6e, 0x2d, 0x74, 0x68, 0x65, 0x2d, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x20, 0x17, 0x0d, 0x31, 0x33, 0x30, 0x33, 0x32, 0x37, 0x31, 0x36, 0x34, 0x39, 0x33, 0x33, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x36, 0x37, 0x31, 0x32, 0x32, 0x39, 0x31, 0x36, 0x34, 0x39, 0x33, 0x33, 0x5a, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1d, 0x66, 0x61, 0x72, 0x2d, 0x69, 0x6e, 0x2d, 0x74, 0x68, 0x65, 0x2d, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x5c, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x4b, 0x00, 0x30, 0x48, 0x02, 0x41, 0x00, 0xe2, 0x2d, 0x35, 0x70, 0x75, 0xc0, 0x07, 0x56, 0x40, 0x7d, 0x63, 0xbc, 0xd2, 0x60, 0xb3, 0xcf, 0xb8, 0x3d, 0x27, 0x6e, 0x10, 0xcd, 0x42, 0x50, 0x51, 0x9d, 0x79, 0x30, 0x79, 0x5a, 0xe3, 0xc3, 0x51, 0x38, 0x85, 0x4c, 0xb4, 0x91, 0xd9, 0xe6, 0x8d, 0x69, 0x6a, 0xd4, 0x9c, 0x1c, 0x49, 0xc2, 0x25, 0x2a, 0xc9, 0x2b, 0xf2, 0xf4, 0x8e, 0x8a, 0x3f, 0x8b, 0x4c, 0x97, 0xc3, 0x16, 0x96, 0x99, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x26, 0x30, 0x24, 0x30, 0x22, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x1b, 0x30, 0x19, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, 0x06, 0x03, 0x2a, 0x03, 0x04, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x41, 0x00, 0xc2, 0x83, 0x27, 0x32, 0x80, 0x74, 0x73, 0xe2, 0xa3, 0x92, 0xaa, 0x7c, 0xd8, 0x50, 0xf4, 0x61, 0x50, 0xb1, 0x63, 0x9e, 0x29, 0xef, 0x38, 0x1d, 0xc0, 0x55, 0x20, 0x0f, 0x7e, 0xe9, 0x1f, 0xa1, 0x54, 0x1a, 0x5f, 0x8c, 0x26, 0x1b, 0x66, 0x96, 0x0e, 0x64, 0x52, 0x1c, 0x00, 0x96, 0xfb, 0x81, 0x77, 0xa2, 0x3a, 0x1d, 0x49, 0x0c, 0x03, 0xd5, 0x19, 0xf2, 0x6a, 0x01, 0x29, 0x31, 0xfb, 0xf5, }; static void test_build_distant_end_date (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_VALUE, (void *)cert_distant_end_date, sizeof (cert_distant_end_date) }, { CKA_INVALID }, }; CK_ATTRIBUTE expected[] = { { CKA_END_DATE, "20671229", 8 }, { CKA_START_DATE, "20130327", 8 }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *extra; CK_RV rv; attrs = NULL; extra = NULL; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, p11_attrs_dup (input), true); attrs = p11_attrs_merge (attrs, extra, false); test_check_attrs (expected, attrs); p11_attrs_free (attrs); } static void test_valid_bool (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_BBOOL value = CK_TRUE; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_PRIVATE, &value, sizeof (value) }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_attrs_free (extra); } static void test_invalid_bool (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_PRIVATE, NULL, 0 }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; p11_message_quiet (); input[0].pValue = "123"; input[0].ulValueLen = 3; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); input[0].pValue = NULL; input[0].ulValueLen = sizeof (CK_BBOOL); rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); p11_message_loud (); } static void test_valid_ulong (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_ULONG value = 2; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_CERTIFICATE_CATEGORY, &value, sizeof (value) }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_attrs_free (extra); } static void test_invalid_ulong (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_CERTIFICATE_CATEGORY, NULL, 0 }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; p11_message_quiet (); input[0].pValue = "123"; input[0].ulValueLen = 3; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); input[0].pValue = NULL; input[0].ulValueLen = sizeof (CK_ULONG); rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); p11_message_loud (); } static void test_valid_utf8 (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_LABEL, NULL, 0 }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; input[0].pValue = NULL; input[0].ulValueLen = 0; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_attrs_free (extra); } static void test_invalid_utf8 (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_LABEL, NULL, 0 }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; p11_message_quiet (); input[0].pValue = "\xfex23"; input[0].ulValueLen = 4; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); input[0].pValue = NULL; input[0].ulValueLen = 4; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); p11_message_loud (); } static void test_valid_dates (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_DATE date; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_START_DATE, &date, sizeof (CK_DATE) }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; memcpy (date.year, "2000", sizeof (date.year)); memcpy (date.month, "10", sizeof (date.month)); memcpy (date.day, "10", sizeof (date.day)); rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_attrs_free (extra); p11_attrs_free (attrs); attrs = NULL; input[0].ulValueLen = 0; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_attrs_free (extra); p11_attrs_free (attrs); } static void test_invalid_dates (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_DATE date; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_START_DATE, &date, sizeof (CK_DATE) }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; p11_message_quiet (); memcpy (date.year, "AAAA", sizeof (date.year)); memcpy (date.month, "BB", sizeof (date.month)); memcpy (date.day, "CC", sizeof (date.day)); rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); memcpy (date.year, "2000", sizeof (date.year)); memcpy (date.month, "15", sizeof (date.month)); memcpy (date.day, "80", sizeof (date.day)); rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); input[0].pValue = NULL; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); p11_message_loud (); } static void test_valid_name (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_SUBJECT, NULL, 0 }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; input[0].pValue = NULL; input[0].ulValueLen = 0; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_attrs_free (extra); p11_attrs_free (attrs); attrs = NULL; input[0].pValue = (void *)test_cacert3_ca_issuer; input[0].ulValueLen = sizeof (test_cacert3_ca_issuer); rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_attrs_free (extra); p11_attrs_free (attrs); } static void test_invalid_name (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_SUBJECT, NULL, 0 }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; p11_message_quiet (); input[0].pValue = "blah"; input[0].ulValueLen = 4; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); input[0].pValue = NULL; input[0].ulValueLen = 4; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); p11_message_loud (); } static void test_valid_serial (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_SERIAL_NUMBER, NULL, 0 }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; input[0].pValue = NULL; input[0].ulValueLen = 0; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_attrs_free (extra); attrs = NULL; input[0].pValue = (void *)test_cacert3_ca_serial; input[0].ulValueLen = sizeof (test_cacert3_ca_serial); rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_attrs_free (extra); } static void test_invalid_serial (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_SERIAL_NUMBER, NULL, 0 }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; p11_message_quiet (); input[0].pValue = "blah"; input[0].ulValueLen = 4; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); input[0].pValue = (void *)test_cacert3_ca_subject; input[0].ulValueLen = sizeof (test_cacert3_ca_subject); rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); input[0].pValue = NULL; input[0].ulValueLen = 4; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); p11_message_loud (); } static void test_valid_cert (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_VALUE, NULL, 0 }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; input[0].pValue = NULL; input[0].ulValueLen = 0; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_attrs_free (extra); attrs = NULL; input[0].pValue = (void *)test_cacert3_ca_der; input[0].ulValueLen = sizeof (test_cacert3_ca_der); rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_attrs_free (extra); } static void test_invalid_cert (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_VALUE, NULL, 0 }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_INVALID }, }; p11_message_quiet (); input[0].pValue = "blah"; input[0].ulValueLen = 4; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); input[0].pValue = (void *)test_cacert3_ca_subject; input[0].ulValueLen = sizeof (test_cacert3_ca_subject); rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); input[0].pValue = NULL; input[0].ulValueLen = 4; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_ATTRIBUTE_VALUE_INVALID, rv); p11_message_loud (); } static void test_invalid_schema (void) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *extra = NULL; CK_RV rv; CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_URL, "http://blah", 11 }, { CKA_INVALID }, }; p11_message_quiet (); /* Missing CKA_HASH_OF_SUBJECT_PUBLIC_KEY and CKA_HASH_OF_ISSUER_PUBLIC_KEY */ rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_TEMPLATE_INCONSISTENT, rv); p11_message_loud (); } static void test_create_not_settable (void) { /* * CKA_X_PUBLIC_KEY_INFO cannot be created/modified */ CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_X_PUBLIC_KEY_INFO, (void *)verisign_v1_ca_public_key, sizeof (verisign_v1_ca_public_key) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; p11_message_quiet (); attrs = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_ATTRIBUTE_READ_ONLY, rv); p11_attrs_free (merge); p11_message_loud (); p11_attrs_free (attrs); } static void test_create_but_loadable (void) { /* * CKA_X_PUBLIC_KEY_INFO cannot be set on creation, but can be set if we're * loading from our store. This is signified by batching. */ CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_X_PUBLIC_KEY_INFO, (void *)verisign_v1_ca_public_key, sizeof (verisign_v1_ca_public_key) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *extra; CK_RV rv; p11_index_load (test.index); attrs = NULL; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); p11_index_finish (test.index); attrs = p11_attrs_merge (attrs, p11_attrs_dup (input), true); attrs = p11_attrs_merge (attrs, extra, false); test_check_attrs (input, attrs); p11_attrs_free (attrs); } static void test_create_unsupported (void) { CK_OBJECT_CLASS klass = CKO_PRIVATE_KEY; CK_ATTRIBUTE input[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; p11_message_quiet (); attrs = NULL; extra = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_TEMPLATE_INCONSISTENT, rv); p11_attrs_free (merge); p11_message_loud (); } static void test_create_generated (void) { CK_OBJECT_CLASS klass = CKO_NSS_TRUST; CK_ATTRIBUTE input[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; p11_message_quiet (); attrs = NULL; extra = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_TEMPLATE_INCONSISTENT, rv); p11_attrs_free (merge); p11_message_loud (); } static void test_create_bad_attribute (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_VALUE, "the value", 9 }, { CKA_COLOR, "blue", 4 }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; p11_message_quiet (); attrs = NULL; extra = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_TEMPLATE_INCONSISTENT, rv); p11_attrs_free (merge); p11_message_loud (); } static void test_create_missing_attribute (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; p11_message_quiet (); attrs = NULL; extra = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_TEMPLATE_INCOMPLETE, rv); p11_attrs_free (merge); p11_message_loud (); } static void test_create_no_class (void) { CK_ATTRIBUTE input[] = { { CKA_VALUE, "the value", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; p11_message_quiet (); attrs = NULL; extra = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_TEMPLATE_INCOMPLETE, rv); p11_attrs_free (merge); p11_message_loud (); } static void test_create_token_mismatch (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_TOKEN, &falsev, sizeof (falsev) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; p11_message_quiet (); attrs = NULL; extra = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_TEMPLATE_INCONSISTENT, rv); p11_attrs_free (merge); p11_message_loud (); } static void test_modify_success (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_MODIFIABLE, &truev, sizeof (truev) }, { CKA_VALUE, "the value", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE modify[] = { { CKA_VALUE, "new value long", 14 }, { CKA_LABEL, "new label", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE expected[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_MODIFIABLE, &truev, sizeof (truev) }, { CKA_VALUE, "new value long", 14 }, { CKA_LABEL, "new label", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *extra; CK_RV rv; attrs = NULL; extra = NULL; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, p11_attrs_dup (input), true); attrs = p11_attrs_merge (attrs, extra, false); extra = NULL; rv = p11_builder_build (test.builder, test.index, attrs, modify, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, p11_attrs_dup (modify), true); attrs = p11_attrs_merge (attrs, extra, false); test_check_attrs (expected, attrs); p11_attrs_free (attrs); } static void test_modify_read_only (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_MODIFIABLE, &truev, sizeof (truev) }, { CKA_VALUE, "the value", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE modify[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; attrs = NULL; extra = NULL; merge = p11_attrs_dup (input); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, merge, true); attrs = p11_attrs_merge (attrs, extra, false); p11_message_quiet (); extra = NULL; merge = p11_attrs_dup (modify); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_ATTRIBUTE_READ_ONLY, rv); p11_attrs_free (merge); p11_message_loud (); p11_attrs_free (attrs); } static void test_modify_unchanged (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_MODIFIABLE, &truev, sizeof (truev) }, { CKA_VALUE, "the value", 9 }, { CKA_INVALID }, }; /* * Although CKA_CLASS is read-only, changing to same value * shouldn't fail */ CK_ATTRIBUTE modify[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_VALUE, "the other", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE expected[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_VALUE, "the other", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *extra; CK_RV rv; attrs = NULL; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, p11_attrs_dup (input), true); attrs = p11_attrs_merge (attrs, extra, false); extra = NULL; rv = p11_builder_build (test.builder, test.index, attrs, modify, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, p11_attrs_dup (modify), true); attrs = p11_attrs_merge (attrs, extra, false); test_check_attrs (expected, attrs); p11_attrs_free (attrs); } static void test_modify_not_modifiable (void) { CK_ATTRIBUTE input[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_MODIFIABLE, &falsev, sizeof (falsev) }, { CKA_VALUE, "the value", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE modify[] = { { CKA_VALUE, "the value", 9 }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; CK_ATTRIBUTE *extra; CK_RV rv; attrs = NULL; extra = NULL; rv = p11_builder_build (test.builder, test.index, attrs, input, &extra); assert_num_eq (CKR_OK, rv); attrs = p11_attrs_merge (attrs, p11_attrs_dup (input), true); attrs = p11_attrs_merge (attrs, extra, false); p11_message_quiet (); extra = NULL; merge = p11_attrs_dup (modify); rv = p11_builder_build (test.builder, test.index, attrs, merge, &extra); assert_num_eq (CKR_ATTRIBUTE_READ_ONLY, rv); p11_attrs_free (merge); p11_message_loud (); p11_attrs_free (attrs); } static CK_ATTRIBUTE cacert3_assert_distrust_server[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_SERVER_AUTH_STR, sizeof (P11_OID_SERVER_AUTH_STR) - 1 }, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_X_ASSERTION_TYPE, &distrusted_certificate, sizeof (distrusted_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE cacert3_assert_distrust_client[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_CLIENT_AUTH_STR, sizeof (P11_OID_CLIENT_AUTH_STR) - 1}, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_X_ASSERTION_TYPE, &distrusted_certificate, sizeof (distrusted_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE cacert3_assert_distrust_code[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_CODE_SIGNING_STR, sizeof (P11_OID_CODE_SIGNING_STR) - 1}, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_X_ASSERTION_TYPE, &distrusted_certificate, sizeof (distrusted_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE cacert3_assert_distrust_email[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_EMAIL_PROTECTION_STR, sizeof (P11_OID_EMAIL_PROTECTION_STR) - 1}, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_X_ASSERTION_TYPE, &distrusted_certificate, sizeof (distrusted_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE cacert3_assert_distrust_system[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_IPSEC_END_SYSTEM_STR, sizeof (P11_OID_IPSEC_END_SYSTEM_STR) - 1}, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_X_ASSERTION_TYPE, &distrusted_certificate, sizeof (distrusted_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE cacert3_assert_distrust_tunnel[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_IPSEC_TUNNEL_STR, sizeof (P11_OID_IPSEC_TUNNEL_STR) - 1}, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_X_ASSERTION_TYPE, &distrusted_certificate, sizeof (distrusted_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE cacert3_assert_distrust_user[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_IPSEC_USER_STR, sizeof (P11_OID_IPSEC_USER_STR) - 1}, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_X_ASSERTION_TYPE, &distrusted_certificate, sizeof (distrusted_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE cacert3_assert_distrust_time[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_TIME_STAMPING_STR, sizeof (P11_OID_TIME_STAMPING_STR) - 1}, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_X_ASSERTION_TYPE, &distrusted_certificate, sizeof (distrusted_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static void test_changed_trusted_certificate (void) { static CK_ATTRIBUTE cacert3_trusted_certificate[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CERTIFICATE_CATEGORY, &certificate_authority, sizeof (certificate_authority) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_CHECK_VALUE, "\xad\x7c\x3f", 3 }, { CKA_START_DATE, "20110523", 8 }, { CKA_END_DATE, "20210520", 8, }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_ID, "cacert3", 7 }, { CKA_LABEL, "Custom Label", 12 }, { CKA_INVALID }, }; static unsigned char eku_server_and_client[] = { 0x30, 0x20, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x01, 0x01, 0xff, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, }; CK_ATTRIBUTE eku_extension_server_and_client[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension), }, { CKA_OBJECT_ID, (void *)P11_OID_EXTENDED_KEY_USAGE, sizeof (P11_OID_EXTENDED_KEY_USAGE) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_LABEL, "Custom Label", 12 }, { CKA_VALUE, eku_server_and_client, sizeof (eku_server_and_client) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static char eku_client_email[] = { 0x30, 0x1a, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x99, 0x77, 0x06, 0x0a, 0x01, 0x04, 0x0c, 0x30, 0x0a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, }; static CK_ATTRIBUTE reject_extension_email[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension), }, { CKA_OBJECT_ID, (void *)P11_OID_OPENSSL_REJECT, sizeof (P11_OID_OPENSSL_REJECT) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_LABEL, "Custom Label", 12 }, { CKA_VALUE, eku_client_email, sizeof (eku_client_email) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE nss_trust_server_and_client_distrust_email[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust), }, { CKA_ID, "cacert3", 7 }, { CKA_CERT_SHA1_HASH, "\xad\x7c\x3f\x64\xfc\x44\x39\xfe\xf4\xe9\x0b\xe8\xf4\x7c\x6c\xfa\x8a\xad\xfd\xce", 20 }, { CKA_CERT_MD5_HASH, "\xf7\x25\x12\x82\x4e\x67\xb5\xd0\x8d\x92\xb7\x7c\x0b\x86\x7a\x42", 16 }, { CKA_LABEL, "Custom Label", 12 }, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_TRUST_SERVER_AUTH, &trusted_delegator, sizeof (trusted_delegator) }, { CKA_TRUST_CLIENT_AUTH, &trusted_delegator, sizeof (trusted_delegator) }, { CKA_TRUST_EMAIL_PROTECTION, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_CODE_SIGNING, &trust_unknown, sizeof (trust_unknown) }, { CKA_TRUST_IPSEC_END_SYSTEM, &trust_unknown, sizeof (trust_unknown) }, { CKA_TRUST_IPSEC_TUNNEL, &trust_unknown, sizeof (trust_unknown) }, { CKA_TRUST_IPSEC_USER, &trust_unknown, sizeof (trust_unknown) }, { CKA_TRUST_TIME_STAMPING, &trust_unknown, sizeof (trust_unknown) }, { CKA_TRUST_DIGITAL_SIGNATURE, &trusted_delegator, sizeof (trusted_delegator) }, { CKA_TRUST_NON_REPUDIATION, &trusted_delegator, sizeof (trusted_delegator) }, { CKA_TRUST_KEY_ENCIPHERMENT, &trusted_delegator, sizeof (trusted_delegator) }, { CKA_TRUST_DATA_ENCIPHERMENT, &trusted_delegator, sizeof (trusted_delegator) }, { CKA_TRUST_KEY_AGREEMENT, &trusted_delegator, sizeof (trusted_delegator) }, { CKA_TRUST_KEY_CERT_SIGN, &trusted_delegator, sizeof (trusted_delegator) }, { CKA_TRUST_CRL_SIGN, &trusted_delegator, sizeof (trusted_delegator) }, { CKA_INVALID, } }; static CK_ATTRIBUTE server_anchor_assertion[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_SERVER_AUTH_STR, sizeof (P11_OID_SERVER_AUTH_STR) - 1 }, { CKA_LABEL, "Custom Label", 12 }, { CKA_X_CERTIFICATE_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_X_ASSERTION_TYPE, &anchored_certificate, sizeof (anchored_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE client_anchor_assertion[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_CLIENT_AUTH_STR, sizeof (P11_OID_CLIENT_AUTH_STR) - 1 }, { CKA_LABEL, "Custom Label", 12 }, { CKA_X_CERTIFICATE_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_X_ASSERTION_TYPE, &anchored_certificate, sizeof (anchored_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; /* * We should get an NSS trust object and various assertions here. * The first two attributes of each object are enough to look it up, * and then we check the rest of the attributes match. */ CK_ATTRIBUTE *expected[] = { nss_trust_server_and_client_distrust_email, cacert3_assert_distrust_email, server_anchor_assertion, client_anchor_assertion, NULL, }; CK_OBJECT_HANDLE handle; CK_ATTRIBUTE *attrs; CK_RV rv; int i; /* * A trusted cetrificate, trusted for server and client purposes, * and explicitly rejects the email and timestamping purposes. */ p11_index_load (test.index); rv = p11_index_take (test.index, p11_attrs_dup (cacert3_trusted_certificate), NULL); assert_num_eq (CKR_OK, rv); rv = p11_index_take (test.index, p11_attrs_dup (eku_extension_server_and_client), NULL); assert_num_eq (CKR_OK, rv); rv = p11_index_take (test.index, p11_attrs_dup (reject_extension_email), NULL); assert_num_eq (CKR_OK, rv); p11_index_finish (test.index); /* The other objects */ for (i = 0; expected[i]; i++) { handle = p11_index_find (test.index, expected[i], 2); assert (handle != 0); attrs = p11_index_lookup (test.index, handle); assert_ptr_not_null (attrs); test_check_attrs (expected[i], attrs); } } static void test_changed_distrust_value (void) { CK_ATTRIBUTE distrust_cert[] = { { CKA_CLASS, &certificate, sizeof (certificate), }, { CKA_CERTIFICATE_CATEGORY, &certificate_authority, sizeof (certificate_authority) }, { CKA_PRIVATE, &falsev, sizeof (falsev) }, { CKA_MODIFIABLE, &falsev, sizeof (falsev) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_TRUSTED, &falsev, sizeof (falsev) }, { CKA_X_DISTRUSTED, &truev, sizeof (truev) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; CK_ATTRIBUTE eku_extension[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension), }, { CKA_OBJECT_ID, (void *)P11_OID_EXTENDED_KEY_USAGE, sizeof (P11_OID_EXTENDED_KEY_USAGE) }, { CKA_VALUE, "\x30\x18\x06\x03\x55\x1d\x25\x01\x01\xff\x04\x0e\x30\x0c\x06\x0a\x2b\x06\x01\x04\x01\x99\x77\x06\x0a\x10", 26 }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; CK_ATTRIBUTE reject_extension[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension), }, { CKA_OBJECT_ID, (void *)P11_OID_OPENSSL_REJECT, sizeof (P11_OID_OPENSSL_REJECT) }, { CKA_VALUE, "\x30\x1a\x06\x0a\x2b\x06\x01\x04\x01\x99\x77\x06\x0a\x01\x04\x0c\x30\x0a\x06\x08\x2b\x06\x01\x05\x05\x07\x03\x02", 28 }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; CK_ATTRIBUTE nss_trust_nothing[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust), }, { CKA_ID, "cacert3", 7 }, { CKA_CERT_SHA1_HASH, "\xad\x7c\x3f\x64\xfc\x44\x39\xfe\xf4\xe9\x0b\xe8\xf4\x7c\x6c\xfa\x8a\xad\xfd\xce", 20 }, { CKA_CERT_MD5_HASH, "\xf7\x25\x12\x82\x4e\x67\xb5\xd0\x8d\x92\xb7\x7c\x0b\x86\x7a\x42", 16 }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_TRUST_SERVER_AUTH, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_CLIENT_AUTH, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_EMAIL_PROTECTION, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_CODE_SIGNING, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_IPSEC_END_SYSTEM, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_IPSEC_TUNNEL, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_IPSEC_USER, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_TIME_STAMPING, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_DIGITAL_SIGNATURE, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_NON_REPUDIATION, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_KEY_ENCIPHERMENT, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_DATA_ENCIPHERMENT, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_KEY_AGREEMENT, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_KEY_CERT_SIGN, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_CRL_SIGN, ¬_trusted, sizeof (not_trusted) }, { CKA_INVALID, } }; /* * We should get an NSS trust object and various assertions here. * The first two attributes of each object are enough to look it up, * and then we check the rest of the attributes match. */ CK_ATTRIBUTE *expected[] = { nss_trust_nothing, cacert3_assert_distrust_server, cacert3_assert_distrust_client, cacert3_assert_distrust_code, cacert3_assert_distrust_email, cacert3_assert_distrust_system, cacert3_assert_distrust_tunnel, cacert3_assert_distrust_user, cacert3_assert_distrust_time, NULL }; CK_OBJECT_HANDLE handle; CK_ATTRIBUTE *attrs; CK_RV rv; int i; /* * A distrusted certificate with a value, plus some extra * extensions (which should be ignored). */ p11_index_load (test.index); rv = p11_index_take (test.index, p11_attrs_dup (distrust_cert), NULL); assert_num_eq (CKR_OK, rv); rv = p11_index_take (test.index, p11_attrs_dup (eku_extension), NULL); assert_num_eq (CKR_OK, rv); rv = p11_index_take (test.index, p11_attrs_dup (reject_extension), NULL); assert_num_eq (CKR_OK, rv); p11_index_finish (test.index); /* The other objects */ for (i = 0; expected[i]; i++) { handle = p11_index_find (test.index, expected[i], 2); assert (handle != 0); attrs = p11_index_lookup (test.index, handle); assert_ptr_not_null (attrs); test_check_attrs (expected[i], attrs); } } static void test_changed_distrust_serial (void) { CK_ATTRIBUTE distrust_cert[] = { { CKA_CLASS, &certificate, sizeof (certificate), }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_TRUSTED, &falsev, sizeof (falsev) }, { CKA_X_DISTRUSTED, &truev, sizeof (truev) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; CK_ATTRIBUTE nss_trust_distrust[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust), }, { CKA_ID, "cacert3", 7 }, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_TRUST_SERVER_AUTH, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_CLIENT_AUTH, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_EMAIL_PROTECTION, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_CODE_SIGNING, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_IPSEC_END_SYSTEM, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_IPSEC_TUNNEL, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_IPSEC_USER, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_TIME_STAMPING, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_DIGITAL_SIGNATURE, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_NON_REPUDIATION, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_KEY_ENCIPHERMENT, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_DATA_ENCIPHERMENT, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_KEY_AGREEMENT, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_KEY_CERT_SIGN, ¬_trusted, sizeof (not_trusted) }, { CKA_TRUST_CRL_SIGN, ¬_trusted, sizeof (not_trusted) }, { CKA_INVALID, } }; /* * We should get an NSS trust object and various assertions here. * The first two attributes of each object are enough to look it up, * and then we check the rest of the attributes match. */ CK_ATTRIBUTE *expected[] = { nss_trust_distrust, cacert3_assert_distrust_server, cacert3_assert_distrust_client, cacert3_assert_distrust_code, cacert3_assert_distrust_email, cacert3_assert_distrust_system, cacert3_assert_distrust_tunnel, cacert3_assert_distrust_user, cacert3_assert_distrust_time, NULL }; CK_OBJECT_HANDLE handle; CK_ATTRIBUTE *attrs; CK_RV rv; int i; /* * A distrusted certificate without a value. */ p11_index_load (test.index); rv = p11_index_take (test.index, p11_attrs_dup (distrust_cert), NULL); assert_num_eq (CKR_OK, rv); p11_index_finish (test.index); for (i = 0; expected[i]; i++) { handle = p11_index_find (test.index, expected[i], 2); assert (handle != 0); attrs = p11_index_lookup (test.index, handle); assert_ptr_not_null (attrs); test_check_attrs (expected[i], attrs); } } static void test_changed_dup_certificates (void) { static CK_ATTRIBUTE trusted_cert[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CERTIFICATE_CATEGORY, &certificate_authority, sizeof (certificate_authority) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE distrust_cert[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CERTIFICATE_CATEGORY, &certificate_authority, sizeof (certificate_authority) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_X_DISTRUSTED, &truev, sizeof (truev) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE trusted_nss[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust), }, { CKA_CERT_SHA1_HASH, "\xad\x7c\x3f\x64\xfc\x44\x39\xfe\xf4\xe9\x0b\xe8\xf4\x7c\x6c\xfa\x8a\xad\xfd\xce", 20 }, { CKA_TRUST_SERVER_AUTH, &trusted_delegator, sizeof (trusted_delegator) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID, } }; static CK_ATTRIBUTE distrust_nss[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust), }, { CKA_CERT_SHA1_HASH, "\xad\x7c\x3f\x64\xfc\x44\x39\xfe\xf4\xe9\x0b\xe8\xf4\x7c\x6c\xfa\x8a\xad\xfd\xce", 20 }, { CKA_TRUST_SERVER_AUTH, ¬_trusted, sizeof (not_trusted) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID, } }; static CK_ATTRIBUTE unknown_nss[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust), }, { CKA_CERT_SHA1_HASH, "\xad\x7c\x3f\x64\xfc\x44\x39\xfe\xf4\xe9\x0b\xe8\xf4\x7c\x6c\xfa\x8a\xad\xfd\xce", 20 }, { CKA_TRUST_SERVER_AUTH, &trust_unknown, sizeof (trust_unknown) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID, } }; static CK_ATTRIBUTE match_nss[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust), }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID, } }; static CK_ATTRIBUTE anchor_assertion[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_SERVER_AUTH_STR, sizeof (P11_OID_SERVER_AUTH_STR) - 1 }, { CKA_X_CERTIFICATE_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_X_ASSERTION_TYPE, &anchored_certificate, sizeof (anchored_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE distrust_assertion[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_X_PURPOSE, (void *)P11_OID_SERVER_AUTH_STR, sizeof (P11_OID_SERVER_AUTH_STR) - 1 }, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_X_ASSERTION_TYPE, &distrusted_certificate, sizeof (distrusted_certificate) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID }, }; static CK_ATTRIBUTE match_assertion[] = { { CKA_CLASS, &trust_assertion, sizeof (trust_assertion) }, { CKA_ID, "cacert3", 7 }, { CKA_INVALID, } }; CK_OBJECT_HANDLE handle1; CK_OBJECT_HANDLE handle2; CK_OBJECT_HANDLE handle; CK_RV rv; /* * A trusted certificate, should create trutsed nss trust * and anchor assertions */ p11_index_load (test.index); rv = p11_index_take (test.index, p11_attrs_dup (trusted_cert), &handle1); assert_num_eq (CKR_OK, rv); p11_index_finish (test.index); handle = p11_index_find (test.index, match_nss, -1); assert (handle != 0); handle = p11_index_find (test.index, match_assertion, -1); assert (handle != 0); handle = p11_index_find (test.index, trusted_nss, -1); assert (handle != 0); handle = p11_index_find (test.index, anchor_assertion, -1); assert (handle != 0); /* Now we add a distrusted certificate, should update the objects */ p11_index_load (test.index); rv = p11_index_take (test.index, p11_attrs_dup (distrust_cert), &handle2); assert_num_eq (CKR_OK, rv); p11_index_finish (test.index); handle = p11_index_find (test.index, trusted_nss, -1); assert (handle == 0); handle = p11_index_find (test.index, distrust_nss, -1); assert (handle != 0); handle = p11_index_find (test.index, anchor_assertion, -1); assert (handle == 0); handle = p11_index_find (test.index, distrust_assertion, -1); assert (handle != 0); /* Now remove the trusted cetrificate, should update again */ rv = p11_index_remove (test.index, handle2); assert_num_eq (CKR_OK, rv); handle = p11_index_find (test.index, trusted_nss, -1); assert (handle != 0); handle = p11_index_find (test.index, distrust_nss, -1); assert (handle == 0); handle = p11_index_find (test.index, anchor_assertion, -1); assert (handle != 0); handle = p11_index_find (test.index, distrust_assertion, -1); assert (handle == 0); /* Now remove the original certificate, unknown nss and no assertions */ rv = p11_index_remove (test.index, handle1); assert_num_eq (CKR_OK, rv); handle = p11_index_find (test.index, unknown_nss, -1); assert (handle != 0); handle = p11_index_find (test.index, match_assertion, -1); assert (handle == 0); } static void test_changed_without_id (void) { static CK_ATTRIBUTE trusted_without_id[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CERTIFICATE_CATEGORY, &certificate_authority, sizeof (certificate_authority) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_ID, NULL, 0, }, { CKA_INVALID }, }; CK_OBJECT_CLASS klass = 0; CK_ATTRIBUTE match[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_INVALID }, }; /* * A cetrificate without a CKA_ID that's created should still * automatically create compat objects. */ CK_OBJECT_HANDLE handle; CK_RV rv; p11_index_load (test.index); rv = p11_index_take (test.index, p11_attrs_dup (trusted_without_id), NULL); assert_num_eq (CKR_OK, rv); p11_index_finish (test.index); klass = CKO_NSS_TRUST; handle = p11_index_find (test.index, match, -1); assert (handle != 0); klass = CKO_X_TRUST_ASSERTION; handle = p11_index_find (test.index, match, -1); assert (handle != 0); } static void test_changed_staple_ca (void) { CK_ULONG category = 0; CK_ATTRIBUTE stapled[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension) }, { CKA_OBJECT_ID, (void *)P11_OID_BASIC_CONSTRAINTS, sizeof (P11_OID_BASIC_CONSTRAINTS) }, { CKA_VALUE, "\x30\x0c\x06\x03\x55\x1d\x13\x04\x05\x30\x03\x01\x01\xff", 14 }, { CKA_X_PUBLIC_KEY_INFO, (void *)entrust_public_key, sizeof (entrust_public_key) }, { CKA_ID, "the id", 6 }, { CKA_INVALID }, }; CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_VALUE, (void *)entrust_pretend_ca, sizeof (entrust_pretend_ca) }, { CKA_ID, "the id", 6 }, { CKA_INVALID }, }; CK_ATTRIBUTE match[] = { { CKA_VALUE, (void *)entrust_pretend_ca, sizeof (entrust_pretend_ca) }, { CKA_CERTIFICATE_CATEGORY, &category, sizeof (category) }, { CKA_INVALID }, }; CK_ATTRIBUTE *attrs; CK_RV rv; attrs = NULL; rv = p11_index_take (test.index, p11_attrs_dup (input), NULL); assert_num_eq (CKR_OK, rv); /* Not a CA at this point, until we staple */ category = 0; assert (p11_index_find (test.index, match, -1) == 0); /* Add a stapled basic constraint */ rv = p11_index_add (test.index, stapled, 4, NULL); assert_num_eq (CKR_OK, rv); /* Now should be a CA */ category = 2; assert (p11_index_find (test.index, match, -1) != 0); p11_attrs_free (attrs); } static void test_changed_staple_ku (void) { CK_ATTRIBUTE stapled_ds_and_np[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension) }, { CKA_OBJECT_ID, (void *)P11_OID_KEY_USAGE, sizeof (P11_OID_KEY_USAGE) }, { CKA_VALUE, "\x30\x0c\x06\x03\x55\x1d\x0f\x04\x05\x03\x03\x07\xc0\x00", 14 }, { CKA_X_PUBLIC_KEY_INFO, (void *)entrust_public_key, sizeof (entrust_public_key) }, { CKA_ID, "the id", 6 }, { CKA_INVALID }, }; CK_ATTRIBUTE input[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_VALUE, (void *)entrust_pretend_ca, sizeof (entrust_pretend_ca) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_ID, "the id", 6 }, { CKA_INVALID }, }; static CK_ATTRIBUTE nss_trust_ds_and_np[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust), }, { CKA_ID, "the id", 6 }, { CKA_TRUST_SERVER_AUTH, &trusted, sizeof (trusted) }, { CKA_TRUST_CLIENT_AUTH, &trusted, sizeof (trusted) }, { CKA_TRUST_EMAIL_PROTECTION, &trusted, sizeof (trusted) }, { CKA_TRUST_CODE_SIGNING, &trusted, sizeof (trusted) }, { CKA_TRUST_IPSEC_END_SYSTEM, &trusted, sizeof (trusted) }, { CKA_TRUST_IPSEC_TUNNEL, &trusted, sizeof (trusted) }, { CKA_TRUST_IPSEC_USER, &trusted, sizeof (trusted) }, { CKA_TRUST_TIME_STAMPING, &trusted, sizeof (trusted) }, { CKA_TRUST_DIGITAL_SIGNATURE, &trusted, sizeof (trusted) }, { CKA_TRUST_NON_REPUDIATION, &trusted, sizeof (trusted) }, { CKA_TRUST_KEY_ENCIPHERMENT, &trust_unknown, sizeof (trust_unknown) }, { CKA_TRUST_DATA_ENCIPHERMENT, &trust_unknown, sizeof (trust_unknown) }, { CKA_TRUST_KEY_AGREEMENT, &trust_unknown, sizeof (trust_unknown) }, { CKA_TRUST_KEY_CERT_SIGN, &trust_unknown, sizeof (trust_unknown) }, { CKA_TRUST_CRL_SIGN, &trust_unknown, sizeof (trust_unknown) }, { CKA_INVALID, } }; CK_OBJECT_HANDLE handle; CK_ATTRIBUTE *attrs; CK_RV rv; p11_index_load (test.index); rv = p11_index_take (test.index, p11_attrs_dup (input), NULL); assert_num_eq (CKR_OK, rv); rv = p11_index_take (test.index, p11_attrs_dup (stapled_ds_and_np), NULL); assert_num_eq (CKR_OK, rv); p11_index_finish (test.index); handle = p11_index_find (test.index, nss_trust_ds_and_np, 2); assert (handle != 0); attrs = p11_index_lookup (test.index, handle); test_check_attrs (nss_trust_ds_and_np, attrs); } int main (int argc, char *argv[]) { p11_fixture (setup, teardown); p11_test (test_get_cache, "/builder/get_cache"); p11_test (test_build_data, "/builder/build_data"); p11_test (test_build_certificate, "/builder/build_certificate"); p11_test (test_build_certificate_empty, "/builder/build_certificate_empty"); p11_test (test_build_certificate_non_ca, "/builder/build_certificate_non_ca"); p11_test (test_build_certificate_v1_ca, "/builder/build_certificate_v1_ca"); p11_test (test_build_certificate_staple_ca, "/builder/build_certificate_staple_ca"); p11_test (test_build_certificate_staple_ca_backwards, "/builder/build-certificate-staple-ca-backwards"); p11_test (test_build_certificate_no_type, "/builder/build_certificate_no_type"); p11_test (test_build_certificate_bad_type, "/builder/build_certificate_bad_type"); p11_test (test_build_extension, "/builder/build_extension"); p11_test (test_build_distant_end_date, "/builder/build_distant_end_date"); p11_test (test_valid_bool, "/builder/valid-bool"); p11_test (test_valid_ulong, "/builder/valid-ulong"); p11_test (test_valid_utf8, "/builder/valid-utf8"); p11_test (test_valid_dates, "/builder/valid-date"); p11_test (test_valid_name, "/builder/valid-name"); p11_test (test_valid_serial, "/builder/valid-serial"); p11_test (test_valid_cert, "/builder/valid-cert"); p11_test (test_invalid_bool, "/builder/invalid-bool"); p11_test (test_invalid_ulong, "/builder/invalid-ulong"); p11_test (test_invalid_utf8, "/builder/invalid-utf8"); p11_test (test_invalid_dates, "/builder/invalid-date"); p11_test (test_invalid_name, "/builder/invalid-name"); p11_test (test_invalid_serial, "/builder/invalid-serial"); p11_test (test_invalid_cert, "/builder/invalid-cert"); p11_test (test_invalid_schema, "/builder/invalid-schema"); p11_test (test_create_not_settable, "/builder/create_not_settable"); p11_test (test_create_but_loadable, "/builder/create_but_loadable"); p11_test (test_create_unsupported, "/builder/create_unsupported"); p11_test (test_create_generated, "/builder/create_generated"); p11_test (test_create_bad_attribute, "/builder/create_bad_attribute"); p11_test (test_create_missing_attribute, "/builder/create_missing_attribute"); p11_test (test_create_no_class, "/builder/create_no_class"); p11_test (test_create_token_mismatch, "/builder/create_token_mismatch"); p11_test (test_modify_success, "/builder/modify_success"); p11_test (test_modify_read_only, "/builder/modify_read_only"); p11_test (test_modify_unchanged, "/builder/modify_unchanged"); p11_test (test_modify_not_modifiable, "/builder/modify_not_modifiable"); p11_test (test_changed_trusted_certificate, "/builder/changed_trusted_certificate"); p11_test (test_changed_distrust_value, "/builder/changed_distrust_value"); p11_test (test_changed_distrust_serial, "/builder/changed_distrust_serial"); p11_test (test_changed_without_id, "/builder/changed_without_id"); p11_test (test_changed_staple_ca, "/builder/changed_staple_ca"); p11_test (test_changed_staple_ku, "/builder/changed_staple_ku"); p11_test (test_changed_dup_certificates, "/builder/changed_dup_certificates"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/test-extract.in0000664000175000017500000000711312265212171015207 00000000000000#!/bin/sh set -euf # ----------------------------------------------------------------------------- # Basic fundamentals prefix=@prefix@ exec_prefix=@exec_prefix@ datarootdir=@datarootdir@ datadir=@datadir@ sysconfdir=@sysconfdir@ libdir=@libdir@ privatedir=@privatedir@ with_trust_paths=@with_trust_paths@ script=$(basename $0) # ----------------------------------------------------------------------------- # Testing warning() { echo "$script: $@" >&2 } assert_fail() { warning $@ exit 1 } assert_contains() { if ! grep -qF $2 $1; then assert_fail "$1 does not contain $2" fi } assert_not_contains() { if grep -qF $2 $1; then assert_fail "$1 contains $2" fi } teardown() { for x in $TD; do if [ -d $x ]; then rmdir $x elif [ -f $x ]; then rm $x fi done TD="" } teardown_dirty() { echo "not ok $TEST_NUMBER $TEST_NAME" teardown } openssl_quiet() ( command='/Generating a|-----|^[.+]+$|writing new private key/d' exec 3>&1 openssl $@ 2>&1 >&3 3>&- | sed -r "$command" 3>&- ) skip() { TEST_SKIP=yes echo "ok $TEST_NUMBER # skip $TEST_NAME: $@" } setup() { # Parse the trust paths oldifs="$IFS" IFS=: set $with_trust_paths IFS="$oldifs" if [ ! -d $1 ]; then skip "$1 is not a directory" return fi SOURCE_1=$1 if [ $# -lt 2 ]; then warning "certain tests neutered if only 1 trust path: $with_trust_paths" SOURCE_2=$1 else SOURCE_2=$2 fi # Make a temporary directory dir=$(mktemp -d) cd $dir CLEANUP="$dir $TD" # Generate a unique identifier CERT_1_CN=test_$(dd if=/dev/urandom count=40 bs=1 status=none | base64 | tr -d '+/=') CERT_2_CN=test_$(dd if=/dev/urandom count=40 bs=1 status=none | base64 | tr -d '+/=') CERT_3_CN=test_$(dd if=/dev/urandom count=40 bs=1 status=none | base64 | tr -d '+/=') # Generate relevant certificates openssl_quiet req -x509 -newkey rsa:512 -keyout /dev/null -days 3 -nodes \ -out cert_1.pem -subj /CN=$CERT_1_CN openssl_quiet req -x509 -newkey rsa:512 -keyout /dev/null -days 3 -nodes \ -out cert_2.pem -subj /CN=$CERT_2_CN openssl_quiet req -x509 -newkey rsa:512 -keyout /dev/null -days 3 -nodes \ -out cert_3.pem -subj /CN=$CERT_3_CN TD="cert_1.pem cert_2.pem cert_3.pem $TD" mkdir -p $SOURCE_1/anchors cp cert_1.pem $SOURCE_1/anchors/ mkdir -p $SOURCE_2/anchors cp cert_2.pem $SOURCE_2/anchors/ cp cert_3.pem $SOURCE_2/anchors/ TD="$SOURCE_1/anchors/cert_1.pem $SOURCE_2/anchors/cert_2.pem $SOURCE_2/anchors/cert_3.pem $TD" } run() { TOTAL=0 for TEST_NAME in $@; do TOTAL=$(expr $TOTAL + 1) done echo "1..$TOTAL" TEST_NUMBER=0 for TEST_NAME in $@; do TEST_NUMBER=$(expr $TEST_NUMBER + 1) ( trap teardown_dirty EXIT trap "teardown_dirty; exit 127" INT TERM TD="" TEST_SKIP=no setup if [ $TEST_SKIP != "yes" ]; then $TEST_NAME fi if [ $TEST_SKIP != "yes" ]; then echo "ok $TEST_NUMBER $TEST_NAME" fi trap - EXIT teardown ) done } # ----------------------------------------------------------------------------- # Main tests test_extract() { trust extract --filter=ca-anchors --format=pem-bundle \ --purpose=server-auth --comment \ extract-test.pem assert_contains extract-test.pem $CERT_1_CN assert_contains extract-test.pem $CERT_2_CN assert_contains extract-test.pem $CERT_3_CN } test_blacklist() { mkdir -p $SOURCE_1/blacklist cp cert_3.pem $SOURCE_1/blacklist TD="$SOURCE_1/blacklist/cert_3.pem $TD" trust extract --filter=ca-anchors --format=pem-bundle \ --purpose=server-auth --comment \ blacklist-test.pem assert_contains blacklist-test.pem $CERT_1_CN assert_not_contains blacklist-test.pem $CERT_3_CN } run test_extract test_blacklist p11-kit-0.20.2/trust/tests/frob-token.c0000664000175000017500000000411112161102014014422 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include #include "token.h" int main (int argc, char *argv[]) { p11_token *token; p11_index *index; int count; if (argc != 2) { fprintf (stderr, "usage: frob-token path\n"); return 2; } token = p11_token_new (1, argv[1], "Label"); count = p11_token_load (token); printf ("%d files loaded\n", count); index = p11_token_index (token); printf ("%d objects loaded\n", p11_index_size (index)); p11_token_free (token); return 0; } p11-kit-0.20.2/trust/tests/test-pem.c0000664000175000017500000002305712226763526014153 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include "compat.h" #include "pem.h" struct { const char *input; struct { const char *type; const char *data; unsigned int length; } output[8]; } success_fixtures[] = { { /* one block */ "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1-----", { { "BLOCK1", "\x69\x83\x4d\x5e\xab\x21\x95\x5c\x42\x76\x8f\x10\x7c\xa7\x97\x87" "\x71\x94\xcd\xdf\xf2\x9f\x82\xd8\x21\x58\x10\xaf\x1e\x1a", 30, }, { NULL, } } }, { /* one block, with header */ "-----BEGIN BLOCK1-----\n" "Header1: value1 \n" " Header2: value2\n" "\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1-----", { { "BLOCK1", "\x69\x83\x4d\x5e\xab\x21\x95\x5c\x42\x76\x8f\x10\x7c\xa7\x97\x87" "\x71\x94\xcd\xdf\xf2\x9f\x82\xd8\x21\x58\x10\xaf\x1e\x1a", 30, }, { NULL, } } }, { /* two blocks, junk data */ "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1-----\n" "blah blah\n" "-----BEGIN TWO-----\n" "oy5L157C671HyJMCf9FiK9prvPZfSch6V4EoUfylFoI1Bq6SbL53kg==\n" "-----END TWO-----\n" "trailing data", { { "BLOCK1", "\x69\x83\x4d\x5e\xab\x21\x95\x5c\x42\x76\x8f\x10\x7c\xa7\x97\x87" "\x71\x94\xcd\xdf\xf2\x9f\x82\xd8\x21\x58\x10\xaf\x1e\x1a", 30, }, { "TWO", "\xa3\x2e\x4b\xd7\x9e\xc2\xeb\xbd\x47\xc8\x93\x02\x7f\xd1\x62\x2b" "\xda\x6b\xbc\xf6\x5f\x49\xc8\x7a\x57\x81\x28\x51\xfc\xa5\x16\x82" "\x35\x06\xae\x92\x6c\xbe\x77\x92", 40 }, { NULL, } } }, { NULL, } }; typedef struct { int input_index; int output_index; int parsed; } Closure; static void on_parse_pem_success (const char *type, const unsigned char *contents, size_t length, void *user_data) { Closure *cl = user_data; assert_num_eq (success_fixtures[cl->input_index].output[cl->output_index].length, length); assert (memcmp (success_fixtures[cl->input_index].output[cl->output_index].data, contents, success_fixtures[cl->input_index].output[cl->output_index].length) == 0); cl->output_index++; cl->parsed++; } static void test_pem_success (void) { Closure cl; int ret; int i; int j; for (i = 0; success_fixtures[i].input != NULL; i++) { cl.input_index = i; cl.output_index = 0; cl.parsed = 0; ret = p11_pem_parse (success_fixtures[i].input, strlen (success_fixtures[i].input), on_parse_pem_success, &cl); assert (success_fixtures[i].output[cl.output_index].type == NULL); /* Count number of outputs, return from p11_pem_parse() should match */ for (j = 0; success_fixtures[i].output[j].type != NULL; j++); assert_num_eq (j, ret); assert_num_eq (ret, cl.parsed); } } const char *failure_fixtures[] = { /* too short at end of opening line */ "-----BEGIN BLOCK1---\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1-----", /* truncated */ "-----BEGIN BLOCK1---", /* no ending */ "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n", /* wrong ending */ "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK2-----", /* wrong ending */ "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END INVALID-----", /* too short at end of ending line */ "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1---", /* invalid base64 data */ "-----BEGIN BLOCK1-----\n" "!!!!NNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1-----", NULL, }; static void on_parse_pem_failure (const char *type, const unsigned char *contents, size_t length, void *user_data) { assert (false && "not reached"); } static void test_pem_failure (void) { int ret; int i; for (i = 0; failure_fixtures[i] != NULL; i++) { ret = p11_pem_parse (failure_fixtures[i], strlen (failure_fixtures[i]), on_parse_pem_failure, NULL); assert_num_eq (0, ret); } } typedef struct { const char *input; size_t length; const char *type; const char *output; } WriteFixture; static WriteFixture write_fixtures[] = { { "\x69\x83\x4d\x5e\xab\x21\x95\x5c\x42\x76\x8f\x10\x7c\xa7\x97\x87" "\x71\x94\xcd\xdf\xf2\x9f\x82\xd8\x21\x58\x10\xaf\x1e\x1a", 30, "BLOCK1", "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1-----\n", }, { "\x50\x31\x31\x2d\x4b\x49\x54\x0a\x0a\x50\x72\x6f\x76\x69\x64\x65" "\x73\x20\x61\x20\x77\x61\x79\x20\x74\x6f\x20\x6c\x6f\x61\x64\x20" "\x61\x6e\x64\x20\x65\x6e\x75\x6d\x65\x72\x61\x74\x65\x20\x50\x4b" "\x43\x53\x23\x31\x31\x20\x6d\x6f\x64\x75\x6c\x65\x73\x2e\x20\x50" "\x72\x6f\x76\x69\x64\x65\x73\x20\x61\x20\x73\x74\x61\x6e\x64\x61" "\x72\x64\x0a\x63\x6f\x6e\x66\x69\x67\x75\x72\x61\x74\x69\x6f\x6e" "\x20\x73\x65\x74\x75\x70\x20\x66\x6f\x72\x20\x69\x6e\x73\x74\x61" "\x6c\x6c\x69\x6e\x67\x20\x50\x4b\x43\x53\x23\x31\x31\x20\x6d\x6f" "\x64\x75\x6c\x65\x73\x20\x69\x6e\x20\x73\x75\x63\x68\x20\x61\x20" "\x77\x61\x79\x20\x74\x68\x61\x74\x20\x74\x68\x65\x79\x27\x72\x65" "\x0a\x64\x69\x73\x63\x6f\x76\x65\x72\x61\x62\x6c\x65\x2e\x0a\x0a" "\x41\x6c\x73\x6f\x20\x73\x6f\x6c\x76\x65\x73\x20\x70\x72\x6f\x62" "\x6c\x65\x6d\x73\x20\x77\x69\x74\x68\x20\x63\x6f\x6f\x72\x64\x69" "\x6e\x61\x74\x69\x6e\x67\x20\x74\x68\x65\x20\x75\x73\x65\x20\x6f" "\x66\x20\x50\x4b\x43\x53\x23\x31\x31\x20\x62\x79\x20\x64\x69\x66" "\x66\x65\x72\x65\x6e\x74\x0a\x63\x6f\x6d\x70\x6f\x6e\x65\x6e\x74" "\x73\x20\x6f\x72\x20\x6c\x69\x62\x72\x61\x72\x69\x65\x73\x20\x6c" "\x69\x76\x69\x6e\x67\x20\x69\x6e\x20\x74\x68\x65\x20\x73\x61\x6d" "\x65\x20\x70\x72\x6f\x63\x65\x73\x73\x2e\x0a", 299, "LONG TYPE WITH SPACES", "-----BEGIN LONG TYPE WITH SPACES-----\n" "UDExLUtJVAoKUHJvdmlkZXMgYSB3YXkgdG8gbG9hZCBhbmQgZW51bWVyYXRlIFBL\n" "Q1MjMTEgbW9kdWxlcy4gUHJvdmlkZXMgYSBzdGFuZGFyZApjb25maWd1cmF0aW9u\n" "IHNldHVwIGZvciBpbnN0YWxsaW5nIFBLQ1MjMTEgbW9kdWxlcyBpbiBzdWNoIGEg\n" "d2F5IHRoYXQgdGhleSdyZQpkaXNjb3ZlcmFibGUuCgpBbHNvIHNvbHZlcyBwcm9i\n" "bGVtcyB3aXRoIGNvb3JkaW5hdGluZyB0aGUgdXNlIG9mIFBLQ1MjMTEgYnkgZGlm\n" "ZmVyZW50CmNvbXBvbmVudHMgb3IgbGlicmFyaWVzIGxpdmluZyBpbiB0aGUgc2Ft\n" "ZSBwcm9jZXNzLgo=\n" "-----END LONG TYPE WITH SPACES-----\n" }, { "\x69\x83\x4d\x5e\xab\x21\x95\x5c\x42\x76\x8f\x10\x7c\xa7\x97\x87" "\x71\x94\xcd\xdf\xf2\x9f\x82\xd8\x21\x58\x10\xaf", 28, "BLOCK1", "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrw==\n" "-----END BLOCK1-----\n", }, { NULL, } }; static void on_parse_written (const char *type, const unsigned char *contents, size_t length, void *user_data) { WriteFixture *fixture = user_data; assert_str_eq (fixture->type, type); assert_num_eq (fixture->length, length); assert (memcmp (contents, fixture->input, length) == 0); } static void test_pem_write (void) { WriteFixture *fixture; p11_buffer buf; unsigned int count; int i; for (i = 0; write_fixtures[i].input != NULL; i++) { fixture = write_fixtures + i; if (!p11_buffer_init_null (&buf, 0)) assert_not_reached (); if (!p11_pem_write ((unsigned char *)fixture->input, fixture->length, fixture->type, &buf)) assert_not_reached (); assert_str_eq (fixture->output, buf.data); assert_num_eq (strlen (fixture->output), buf.len); count = p11_pem_parse (buf.data, buf.len, on_parse_written, fixture); assert_num_eq (1, count); p11_buffer_uninit (&buf); } } int main (int argc, char *argv[]) { p11_test (test_pem_success, "/pem/success"); p11_test (test_pem_failure, "/pem/failure"); p11_test (test_pem_write, "/pem/write"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/test-utf8.c0000664000175000017500000001421212226763526014251 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "utf8.h" #include #include #define ELEMS(x) (sizeof (x) / sizeof (x[0])) static void test_ucs2be (void) { char *output; size_t length; int i; struct { const char *output; size_t output_len; const unsigned char input[100]; size_t input_len; } fixtures[] = { { "This is a test", 14, { 0x00, 'T', 0x00, 'h', 0x00, 'i', 0x00, 's', 0x00, ' ', 0x00, 'i', 0x00, 's', 0x00, ' ', 0x00, 'a', 0x00, ' ', 0x00, 't', 0x00, 'e', 0x00, 's', 0x00, 't' }, 28, }, { "V\303\266gel", 6, { 0x00, 'V', 0x00, 0xF6, 0x00, 'g', 0x00, 'e', 0x00, 'l' }, 10, }, { "M\303\244nwich \340\264\205", 12, { 0x00, 'M', 0x00, 0xE4, 0x00, 'n', 0x00, 'w', 0x00, 'i', 0x00, 'c', 0x00, 'h', 0x00, ' ', 0x0D, 0x05 }, 18, } }; for (i = 0; i < ELEMS (fixtures); i++) { output = p11_utf8_for_ucs2be (fixtures[i].input, fixtures[i].input_len, &length); assert_num_eq (fixtures[i].output_len, length); assert_str_eq (fixtures[i].output, output); free (output); } } static void test_ucs2be_fail (void) { char *output; size_t length; int i; struct { const unsigned char input[100]; size_t input_len; } fixtures[] = { { { 0x00, 'T', 0x00, 'h', 0x00, 'i', 0x00, }, 7 /* truncated */ } }; for (i = 0; i < ELEMS (fixtures); i++) { output = p11_utf8_for_ucs2be (fixtures[i].input, fixtures[i].input_len, &length); assert_ptr_eq (NULL, output); } } static void test_ucs4be (void) { char *output; size_t length; int i; struct { const char *output; size_t output_len; const unsigned char input[100]; size_t input_len; } fixtures[] = { { "This is a test", 14, { 0x00, 0x00, 0x00, 'T', 0x00, 0x00, 0x00, 'h', 0x00, 0x00, 0x00, 'i', 0x00, 0x00, 0x00, 's', 0x00, 0x00, 0x00, ' ', 0x00, 0x00, 0x00, 'i', 0x00, 0x00, 0x00, 's', 0x00, 0x00, 0x00, ' ', 0x00, 0x00, 0x00, 'a', 0x00, 0x00, 0x00, ' ', 0x00, 0x00, 0x00, 't', 0x00, 0x00, 0x00, 'e', 0x00, 0x00, 0x00, 's', 0x00, 0x00, 0x00, 't', }, 56, }, { "Fun \360\220\214\231", 8, { 0x00, 0x00, 0x00, 'F', 0x00, 0x00, 0x00, 'u', 0x00, 0x00, 0x00, 'n', 0x00, 0x00, 0x00, ' ', 0x00, 0x01, 0x03, 0x19, /* U+10319: looks like an antenna */ }, 20, } }; for (i = 0; i < ELEMS (fixtures); i++) { output = p11_utf8_for_ucs4be (fixtures[i].input, fixtures[i].input_len, &length); assert_num_eq (fixtures[i].output_len, length); assert_str_eq (fixtures[i].output, output); free (output); } } static void test_ucs4be_fail (void) { char *output; size_t length; int i; struct { const unsigned char input[100]; size_t input_len; } fixtures[] = { { { 0x00, 0x00, 'T', }, 7 /* truncated */ }, { { 0x00, 0x00, 0x00, 'F', 0x00, 0x00, 0x00, 'u', 0x00, 0x00, 0x00, 'n', 0x00, 0x00, 0x00, ' ', 0xD8, 0x00, 0xDF, 0x19, }, 20, } }; for (i = 0; i < ELEMS (fixtures); i++) { output = p11_utf8_for_ucs4be (fixtures[i].input, fixtures[i].input_len, &length); assert_ptr_eq (NULL, output); } } static void test_utf8 (void) { bool ret; int i; struct { const char *input; size_t input_len; } fixtures[] = { { "This is a test", 14 }, { "Good news everyone", -1 }, { "Fun \360\220\214\231", -1 }, { "Fun invalid here: \xfe", 4 }, /* but limited length */ { "V\303\266gel", 6, }, }; for (i = 0; i < ELEMS (fixtures); i++) { ret = p11_utf8_validate (fixtures[i].input, fixtures[i].input_len); assert_num_eq (true, ret); } } static void test_utf8_fail (void) { bool ret; int i; struct { const char *input; size_t input_len; } fixtures[] = { { "This is a test\x80", 15 }, { "Good news everyone\x88", -1 }, { "Bad \xe0v following chars should be |0x80", -1 }, { "Truncated \xe0", -1 }, }; for (i = 0; i < ELEMS (fixtures); i++) { ret = p11_utf8_validate (fixtures[i].input, fixtures[i].input_len); assert_num_eq (false, ret); } } int main (int argc, char *argv[]) { p11_test (test_ucs2be, "/utf8/ucs2be"); p11_test (test_ucs2be_fail, "/utf8/ucs2be_fail"); p11_test (test_ucs4be, "/utf8/ucs4be"); p11_test (test_ucs4be_fail, "/utf8/ucs4be_fail"); p11_test (test_utf8, "/utf8/utf8"); p11_test (test_utf8_fail, "/utf8/utf8_fail"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/test-openssl.c0000664000175000017500000004645112226763526015060 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #define P11_KIT_DISABLE_DEPRECATED #include "config.h" #include "test-trust.h" #include "attrs.h" #include "buffer.h" #include "compat.h" #include "debug.h" #include "dict.h" #include "extract.h" #include "message.h" #include "mock.h" #include "path.h" #include "pkcs11.h" #include "pkcs11x.h" #include "oid.h" #include "test.h" #include #include #include #include #include #define ELEMS(x) (sizeof (x) / sizeof (x[0])) struct { CK_FUNCTION_LIST module; p11_enumerate ex; char *directory; } test; static void setup (void *unused) { CK_RV rv; mock_module_reset (); memcpy (&test.module, &mock_module, sizeof (CK_FUNCTION_LIST)); rv = test.module.C_Initialize (NULL); assert_num_eq (CKR_OK, rv); p11_enumerate_init (&test.ex); test.directory = p11_test_directory ("test-extract"); } static void teardown (void *unused) { CK_RV rv; if (rmdir (test.directory) < 0) assert_not_reached (); free (test.directory); p11_enumerate_cleanup (&test.ex); p11_kit_iter_free (test.ex.iter); rv = test.module.C_Finalize (NULL); assert_num_eq (CKR_OK, rv); } static CK_OBJECT_CLASS certificate_class = CKO_CERTIFICATE; static CK_OBJECT_CLASS extension_class = CKO_X_CERTIFICATE_EXTENSION; static CK_CERTIFICATE_TYPE x509_type = CKC_X_509; static CK_BBOOL vtrue = CK_TRUE; static CK_ATTRIBUTE cacert3_authority_attrs[] = { { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_CERTIFICATE_TYPE, &x509_type, sizeof (x509_type) }, { CKA_LABEL, "Custom Label", 12 }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_TRUSTED, &vtrue, sizeof (vtrue) }, { CKA_INVALID }, }; static CK_ATTRIBUTE verisign_v1_attrs[] = { { CKA_VALUE, (void *)verisign_v1_ca, sizeof (verisign_v1_ca) }, { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_CERTIFICATE_TYPE, &x509_type, sizeof (x509_type) }, { CKA_LABEL, "Custom Label", 12 }, { CKA_SUBJECT, (void *)verisign_v1_ca_subject, sizeof (verisign_v1_ca_subject) }, { CKA_X_PUBLIC_KEY_INFO, (void *)verisign_v1_ca_public_key, sizeof (verisign_v1_ca_public_key) }, { CKA_TRUSTED, &vtrue, sizeof (vtrue) }, { CKA_INVALID }, }; static CK_ATTRIBUTE extension_eku_server[] = { { CKA_CLASS, &extension_class, sizeof (extension_class) }, { CKA_OBJECT_ID, (void *)P11_OID_EXTENDED_KEY_USAGE, sizeof (P11_OID_EXTENDED_KEY_USAGE) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_VALUE, "\x30\x13\x06\x03\x55\x1d\x25\x04\x0c\x30\x0a\x06\x08\x2b\x06\x01\x05\x05\x07\x03\x01", 21 }, { CKA_INVALID }, }; static CK_ATTRIBUTE extension_reject_email[] = { { CKA_CLASS, &extension_class, sizeof (extension_class) }, { CKA_OBJECT_ID, (void *)P11_OID_OPENSSL_REJECT, sizeof (P11_OID_OPENSSL_REJECT) }, { CKA_VALUE, "\x30\x1a\x06\x0a\x2b\x06\x01\x04\x01\x99\x77\x06\x0a\x01\x04\x0c\x30\x0a\x06\x08\x2b\x06\x01\x05\x05\x07\x03\x04", 28 }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_INVALID }, }; static CK_ATTRIBUTE certificate_filter[] = { { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_INVALID }, }; static void setup_objects (const CK_ATTRIBUTE *attrs, ...) GNUC_NULL_TERMINATED; static void setup_objects (const CK_ATTRIBUTE *attrs, ...) { static CK_ULONG id_value = 8888; CK_ATTRIBUTE id = { CKA_ID, &id_value, sizeof (id_value) }; CK_ATTRIBUTE *copy; va_list va; va_start (va, attrs); while (attrs != NULL) { copy = p11_attrs_build (p11_attrs_dup (attrs), &id, NULL); assert (copy != NULL); mock_module_take_object (MOCK_SLOT_ONE_ID, copy); attrs = va_arg (va, const CK_ATTRIBUTE *); } va_end (va); id_value++; } static void test_file (void) { char *destination; bool ret; setup_objects (cacert3_authority_attrs, extension_eku_server, extension_reject_email, NULL); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.pem") < 0) assert_not_reached (); ret = p11_extract_openssl_bundle (&test.ex, destination); assert_num_eq (true, ret); test_check_file (test.directory, "extract.pem", SRCDIR "/files/cacert3-trusted-server-alias.pem"); free (destination); } static void test_plain (void) { char *destination; bool ret; setup_objects (cacert3_authority_attrs, NULL); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.pem") < 0) assert_not_reached (); ret = p11_extract_openssl_bundle (&test.ex, destination); assert_num_eq (true, ret); test_check_file (test.directory, "extract.pem", SRCDIR "/files/cacert3-trusted-alias.pem"); free (destination); } static void test_keyid (void) { char *destination; bool ret; static CK_ATTRIBUTE cacert3_plain[] = { { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_CERTIFICATE_TYPE, &x509_type, sizeof (x509_type) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_TRUSTED, &vtrue, sizeof (vtrue) }, { CKA_INVALID }, }; static CK_ATTRIBUTE extension_subject_key_identifier[] = { { CKA_CLASS, &extension_class, sizeof (extension_class) }, { CKA_OBJECT_ID, (void *)P11_OID_SUBJECT_KEY_IDENTIFIER, sizeof (P11_OID_SUBJECT_KEY_IDENTIFIER) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_VALUE, "\x30\x0e\x06\x03\x55\x1d\x0e\x04\x07\x00\x01\x02\x03\x04\x05\x06", 16 }, { CKA_INVALID }, }; setup_objects (cacert3_plain, extension_subject_key_identifier, NULL); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.pem") < 0) assert_not_reached (); ret = p11_extract_openssl_bundle (&test.ex, destination); assert_num_eq (true, ret); test_check_file (test.directory, "extract.pem", SRCDIR "/files/cacert3-trusted-keyid.pem"); free (destination); } static void test_not_authority (void) { char *destination; bool ret; static CK_ATTRIBUTE cacert3_not_trusted[] = { { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_CERTIFICATE_TYPE, &x509_type, sizeof (x509_type) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_INVALID }, }; setup_objects (cacert3_not_trusted, NULL); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.pem") < 0) assert_not_reached (); ret = p11_extract_openssl_bundle (&test.ex, destination); assert_num_eq (true, ret); test_check_file (test.directory, "extract.pem", SRCDIR "/files/cacert3-not-trusted.pem"); free (destination); } static void test_distrust_all (void) { char *destination; bool ret; static CK_ATTRIBUTE cacert3_blacklist[] = { { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_CERTIFICATE_TYPE, &x509_type, sizeof (x509_type) }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_X_DISTRUSTED, &vtrue, sizeof (vtrue) }, { CKA_INVALID }, }; setup_objects (cacert3_blacklist, NULL); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.pem") < 0) assert_not_reached (); ret = p11_extract_openssl_bundle (&test.ex, destination); assert_num_eq (true, ret); test_check_file (test.directory, "extract.pem", SRCDIR "/files/cacert3-distrust-all.pem"); free (destination); } static void test_file_multiple (void) { char *destination; bool ret; setup_objects (cacert3_authority_attrs, extension_eku_server, extension_reject_email, NULL); setup_objects (verisign_v1_attrs, NULL); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.pem") < 0) assert_not_reached (); ret = p11_extract_openssl_bundle (&test.ex, destination); assert_num_eq (true, ret); test_check_file (test.directory, "extract.pem", SRCDIR "/files/multiple.pem"); free (destination); } static void test_file_without (void) { char *destination; bool ret; p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.pem") < 0) assert_not_reached (); ret = p11_extract_openssl_bundle (&test.ex, destination); assert_num_eq (true, ret); test_check_data (test.directory, "extract.pem", "", 0); free (destination); } /* From extract-openssl.c */ void p11_openssl_canon_string (char *str, size_t *len); static void test_canon_string (void) { struct { char *input; int input_len; char *output; int output_len; } fixtures[] = { { "A test", -1, "a test", -1 }, { " Strip spaces ", -1, "strip spaces", -1 }, { " Collapse \n\t spaces", -1, "collapse spaces", -1 }, { "Ignore non-ASCII \303\204", -1, "ignore non-ascii \303\204", -1 }, { "no-space", -1, "no-space", -1 }, }; char *str; size_t len; size_t out; int i; for (i = 0; i < ELEMS (fixtures); i++) { if (fixtures[i].input_len < 0) len = strlen (fixtures[i].input); else len = fixtures[i].input_len; str = strndup (fixtures[i].input, len); p11_openssl_canon_string (str, &len); if (fixtures[i].output_len < 0) out = strlen (fixtures[i].output); else out = fixtures[i].output_len; assert_num_eq (out, len); assert_str_eq (fixtures[i].output, str); free (str); } } bool p11_openssl_canon_string_der (p11_buffer *der); static void test_canon_string_der (void) { struct { unsigned char input[100]; int input_len; unsigned char output[100]; int output_len; } fixtures[] = { /* UTF8String */ { { 0x0c, 0x0f, 0xc3, 0x84, ' ', 'U', 'T', 'F', '8', ' ', 's', 't', 'r', 'i', 'n', 'g', ' ', }, 17, { 0x0c, 0x0e, 0xc3, 0x84, ' ', 'u', 't', 'f', '8', ' ', 's', 't', 'r', 'i', 'n', 'g', }, 16, }, /* NumericString */ { { 0x12, 0x04, '0', '1', '2', '3', }, 6, { 0x0c, 0x04, '0', '1', '2', '3' }, 6, }, /* IA5String */ { { 0x16, 0x04, ' ', 'A', 'B', ' ', }, 6, { 0x0c, 0x02, 'a', 'b', }, 4, }, /* TeletexString */ { { 0x14, 0x07, 'A', ' ', ' ', 'n', 'i', 'c', 'e' }, 9, { 0x0c, 0x06, 'a', ' ', 'n', 'i', 'c', 'e' }, 8, }, /* PrintableString */ { { 0x13, 0x07, 'A', ' ', ' ', 'n', 'i', 'c', 'e' }, 9, { 0x0c, 0x06, 'a', ' ', 'n', 'i', 'c', 'e' }, 8, }, /* No change, not a known string type */ { { 0x05, 0x07, 'A', ' ', ' ', 'n', 'i', 'c', 'e' }, 9, { 0x05, 0x07, 'A', ' ', ' ', 'n', 'i', 'c', 'e' }, 9 }, /* UniversalString */ { { 0x1c, 0x14, 0x00, 0x00, 0x00, 'F', 0x00, 0x00, 0x00, 'u', 0x00, 0x00, 0x00, 'n', 0x00, 0x00, 0x00, ' ', 0x00, 0x01, 0x03, 0x19, }, 22, { 0x0c, 0x08, 'f', 'u', 'n', ' ', 0xf0, 0x90, 0x8c, 0x99 }, 10, }, /* BMPString */ { { 0x1e, 0x0a, 0x00, 'V', 0x00, 0xF6, 0x00, 'g', 0x00, 'e', 0x00, 'l' }, 12, { 0x0c, 0x06, 'v', 0xc3, 0xb6, 'g', 'e', 'l' }, 8, }, }; p11_buffer buf; bool ret; int i; for (i = 0; i < ELEMS (fixtures); i++) { p11_buffer_init_full (&buf, memdup (fixtures[i].input, fixtures[i].input_len), fixtures[i].input_len, 0, realloc, free); ret = p11_openssl_canon_string_der (&buf); assert_num_eq (true, ret); assert_num_eq (fixtures[i].output_len, buf.len); assert (memcmp (buf.data, fixtures[i].output, buf.len) == 0); p11_buffer_uninit (&buf); } } bool p11_openssl_canon_name_der (p11_dict *asn1_defs, p11_buffer *der); static void test_canon_name_der (void) { struct { unsigned char input[100]; int input_len; unsigned char output[100]; int output_len; } fixtures[] = { { { '0', 'T', '1', 0x14, '0', 0x12, 0x06, 0x03, 'U', 0x04, 0x0a, 0x13, 0x0b, 'C', 'A', 'c', 'e', 'r', 't', 0x20, 'I', 'n', 'c', '.', '1', 0x1e, '0', 0x1c, 0x06, 0x03, 'U', 0x04, 0x0b, 0x13, 0x15, 'h', 't', 't', 'p', ':', '/', '/', 'w', 'w', 'w', '.', 'C', 'A', 'c', 'e', 'r', 't', '.', 'o', 'r', 'g', '1', 0x1c, '0', 0x1a, 0x06, 0x03, 'U', 0x04, 0x03, 0x13, 0x13, 'C', 'A', 'c', 'e', 'r', 't', 0x20, 'C', 'l', 'a', 's', 's', 0x20, '3', 0x20, 'R', 'o', 'o', 't', }, 86, { '1', 0x14, '0', 0x12, 0x06, 0x03, 'U', 0x04, 0x0a, 0x0c, 0x0b, 'c', 'a', 'c', 'e', 'r', 't', 0x20, 'i', 'n', 'c', '.', '1', 0x1e, '0', 0x1c, 0x06, 0x03, 'U', 0x04, 0x0b, 0x0c, 0x15, 'h', 't', 't', 'p', ':', '/', '/', 'w', 'w', 'w', '.', 'c', 'a', 'c', 'e', 'r', 't', '.', 'o', 'r', 'g', '1', 0x1c, '0', 0x1a, 0x06, 0x03, 'U', 0x04, 0x03, 0x0c, 0x13, 'c', 'a', 'c', 'e', 'r', 't', 0x20, 'c', 'l', 'a', 's', 's', 0x20, '3', 0x20, 'r', 'o', 'o', 't', }, 84, }, { { '0', 0x00, }, 2, { }, 0, }, }; p11_buffer buf; p11_dict *asn1_defs; bool ret; int i; asn1_defs = p11_asn1_defs_load (); for (i = 0; i < ELEMS (fixtures); i++) { p11_buffer_init_full (&buf, memdup (fixtures[i].input, fixtures[i].input_len), fixtures[i].input_len, 0, realloc, free); ret = p11_openssl_canon_name_der (asn1_defs, &buf); assert_num_eq (true, ret); assert_num_eq (fixtures[i].output_len, buf.len); assert (memcmp (buf.data, fixtures[i].output, buf.len) == 0); p11_buffer_uninit (&buf); } p11_dict_free (asn1_defs); } static void test_canon_string_der_fail (void) { struct { unsigned char input[100]; int input_len; } fixtures[] = { { { 0x0c, 0x02, 0xc3, 0xc4 /* Invalid UTF-8 */ }, 4 }, { { 0x1e, 0x01, 0x00 /* Invalid UCS2 */ }, 3 }, { { 0x1c, 0x02, 0x00, 0x01 /* Invalid UCS4 */ }, 4 }, }; p11_buffer buf; bool ret; int i; for (i = 0; i < ELEMS (fixtures); i++) { p11_buffer_init_full (&buf, memdup (fixtures[i].input, fixtures[i].input_len), fixtures[i].input_len, 0, realloc, free); ret = p11_openssl_canon_string_der (&buf); assert_num_eq (false, ret); p11_buffer_uninit (&buf); } } static void test_directory (void) { bool ret; setup_objects (cacert3_authority_attrs, extension_eku_server, extension_reject_email, NULL); /* Accesses the above objects */ setup_objects (cacert3_authority_attrs, NULL); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); /* Yes, this is a race, and why you shouldn't build software as root */ if (rmdir (test.directory) < 0) assert_not_reached (); ret = p11_extract_openssl_directory (&test.ex, test.directory); assert_num_eq (true, ret); test_check_directory (test.directory, ("Custom_Label.pem", "Custom_Label.1.pem", #ifdef OS_UNIX "e5662767.1", "e5662767.0", "590d426f.1", "590d426f.0", #endif NULL)); test_check_file (test.directory, "Custom_Label.pem", SRCDIR "/files/cacert3-trusted-server-alias.pem"); test_check_file (test.directory, "Custom_Label.1.pem", SRCDIR "/files/cacert3-trusted-server-alias.pem"); #ifdef OS_UNIX test_check_symlink (test.directory, "e5662767.0", "Custom_Label.pem"); test_check_symlink (test.directory, "e5662767.1", "Custom_Label.1.pem"); test_check_symlink (test.directory, "590d426f.0", "Custom_Label.pem"); test_check_symlink (test.directory, "590d426f.1", "Custom_Label.1.pem"); #endif } static void test_directory_empty (void) { bool ret; p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); /* Yes, this is a race, and why you shouldn't build software as root */ if (rmdir (test.directory) < 0) assert_not_reached (); ret = p11_extract_openssl_directory (&test.ex, test.directory); assert_num_eq (true, ret); test_check_directory (test.directory, (NULL, NULL)); } int main (int argc, char *argv[]) { mock_module_init (); p11_fixture (setup, teardown); p11_test (test_file, "/openssl/test_file"); p11_test (test_plain, "/openssl/test_plain"); p11_test (test_keyid, "/openssl/test_keyid"); p11_test (test_not_authority, "/openssl/test_not_authority"); p11_test (test_distrust_all, "/openssl/test_distrust_all"); p11_test (test_file_multiple, "/openssl/test_file_multiple"); p11_test (test_file_without, "/openssl/test_file_without"); p11_fixture (NULL, NULL); p11_test (test_canon_string, "/openssl/test_canon_string"); p11_test (test_canon_string_der, "/openssl/test_canon_string_der"); p11_test (test_canon_string_der_fail, "/openssl/test_canon_string_der_fail"); p11_test (test_canon_name_der, "/openssl/test_canon_name_der"); p11_fixture (setup, teardown); p11_test (test_directory, "/openssl/test_directory"); p11_test (test_directory_empty, "/openssl/test_directory_empty"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/test-enumerate.c0000664000175000017500000003656612265242533015361 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #define P11_KIT_DISABLE_DEPRECATED #include "config.h" #include "test-trust.h" #include "attrs.h" #include "compat.h" #include "debug.h" #include "dict.h" #include "extract.h" #include "message.h" #include "mock.h" #include "pkcs11.h" #include "pkcs11x.h" #include "oid.h" #include "test.h" #include #include static void test_file_name_for_label (void) { CK_ATTRIBUTE label = { CKA_LABEL, "The Label!", 10 }; p11_enumerate ex; char *name; p11_enumerate_init (&ex); ex.attrs = p11_attrs_build (NULL, &label, NULL); name = p11_enumerate_filename (&ex); assert_str_eq ("The_Label_", name); free (name); p11_enumerate_cleanup (&ex); } static void test_file_name_for_class (void) { p11_enumerate ex; char *name; p11_enumerate_init (&ex); ex.klass = CKO_CERTIFICATE; name = p11_enumerate_filename (&ex); assert_str_eq ("certificate", name); free (name); ex.klass = CKO_DATA; name = p11_enumerate_filename (&ex); assert_str_eq ("unknown", name); free (name); p11_enumerate_cleanup (&ex); } static void test_comment_for_label (void) { CK_ATTRIBUTE label = { CKA_LABEL, "The Label!", 10 }; p11_enumerate ex; char *comment; p11_enumerate_init (&ex); ex.flags = P11_EXTRACT_COMMENT; ex.attrs = p11_attrs_build (NULL, &label, NULL); comment = p11_enumerate_comment (&ex, true); assert_str_eq ("# The Label!\n", comment); free (comment); comment = p11_enumerate_comment (&ex, false); assert_str_eq ("\n# The Label!\n", comment); free (comment); p11_enumerate_cleanup (&ex); } static void test_comment_not_enabled (void) { CK_ATTRIBUTE label = { CKA_LABEL, "The Label!", 10 }; p11_enumerate ex; char *comment; p11_enumerate_init (&ex); ex.attrs = p11_attrs_build (NULL, &label, NULL); comment = p11_enumerate_comment (&ex, true); assert_ptr_eq (NULL, comment); comment = p11_enumerate_comment (&ex, false); assert_ptr_eq (NULL, comment); p11_enumerate_cleanup (&ex); } struct { CK_FUNCTION_LIST module; CK_FUNCTION_LIST_PTR modules[2]; p11_enumerate ex; } test; static void setup (void *unused) { CK_RV rv; mock_module_reset (); memcpy (&test.module, &mock_module, sizeof (CK_FUNCTION_LIST)); rv = test.module.C_Initialize (NULL); assert_num_eq (CKR_OK, rv); p11_enumerate_init (&test.ex); /* Prefill the modules */ test.modules[0] = &test.module; test.modules[1] = NULL; test.ex.modules = test.modules; } static void teardown (void *unused) { CK_RV rv; /* Don't free the modules */ test.ex.modules = NULL; p11_enumerate_cleanup (&test.ex); rv = test.module.C_Finalize (NULL); assert_num_eq (CKR_OK, rv); } static CK_OBJECT_CLASS certificate_class = CKO_CERTIFICATE; static CK_OBJECT_CLASS public_key_class = CKO_PUBLIC_KEY; static CK_OBJECT_CLASS extension_class = CKO_X_CERTIFICATE_EXTENSION; static CK_CERTIFICATE_TYPE x509_type = CKC_X_509; static CK_BBOOL truev = CK_TRUE; static CK_ATTRIBUTE cacert3_trusted[] = { { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_CERTIFICATE_TYPE, &x509_type, sizeof (x509_type) }, { CKA_LABEL, "Cacert3 Here", 11 }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_ID, "ID1", 3 }, { CKA_INVALID }, }; static CK_ATTRIBUTE cacert3_distrusted[] = { { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_CERTIFICATE_TYPE, &x509_type, sizeof (x509_type) }, { CKA_LABEL, "Another CaCert", 11 }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_X_DISTRUSTED, &truev, sizeof (truev) }, { CKA_INVALID }, }; static CK_ATTRIBUTE cacert3_distrusted_by_key[] = { { CKA_CLASS, &public_key_class, sizeof (public_key_class) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_X_DISTRUSTED, &truev, sizeof (truev) }, { CKA_INVALID }, }; static CK_ATTRIBUTE certificate_filter[] = { { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_INVALID }, }; static CK_ATTRIBUTE extension_eku_server_client[] = { { CKA_CLASS, &extension_class, sizeof (extension_class) }, { CKA_ID, "ID1", 3 }, { CKA_OBJECT_ID, (void *)P11_OID_EXTENDED_KEY_USAGE, sizeof (P11_OID_EXTENDED_KEY_USAGE) }, { CKA_VALUE, "\x30\x1d\x06\x03\x55\x1d\x25\x04\x16\x30\x14\x06\x08\x2b\x06\x01\x05\x05\x07\x03\x01\x06\x08\x2b\x06\x01\x05\x05\x07\x03\x02", 31 }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_INVALID }, }; static CK_ATTRIBUTE extension_eku_invalid[] = { { CKA_CLASS, &extension_class, sizeof (extension_class) }, { CKA_ID, "ID1", 3 }, { CKA_OBJECT_ID, (void *)P11_OID_EXTENDED_KEY_USAGE, sizeof (P11_OID_EXTENDED_KEY_USAGE) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_VALUE, "\x30\x0e\x06\x03\x55\x1d\x25\x04\x07\x69\x6e\x76\x61\x6c\x69\x64", 16 }, { CKA_INVALID }, }; static void test_info_simple_certificate (void) { void *value; size_t length; CK_RV rv; assert_ptr_not_null (test.ex.asn1_defs); mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); mock_module_add_object (MOCK_SLOT_ONE_ID, extension_eku_server_client); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_enumerate_ready (&test.ex, NULL); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_OK, rv); assert_num_eq (CKO_CERTIFICATE, test.ex.klass); assert_ptr_not_null (test.ex.attrs); value = p11_attrs_find_value (test.ex.attrs, CKA_VALUE, &length); assert_ptr_not_null (value); assert (memcmp (value, test_cacert3_ca_der, length) == 0); assert_ptr_not_null (test.ex.cert_der); assert (memcmp (test.ex.cert_der, test_cacert3_ca_der, test.ex.cert_len) == 0); assert_ptr_not_null (test.ex.cert_asn); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_CANCEL, rv); } static void test_info_limit_purposes (void) { CK_RV rv; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); mock_module_add_object (MOCK_SLOT_ONE_ID, extension_eku_server_client); /* This should not match the above, with the stapled certificat ext */ assert_ptr_eq (NULL, test.ex.limit_to_purposes); p11_enumerate_opt_purpose (&test.ex, "1.1.1"); assert_ptr_not_null (test.ex.limit_to_purposes); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_enumerate_ready (&test.ex, NULL); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_CANCEL, rv); } static void test_info_invalid_purposes (void) { CK_RV rv; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); mock_module_add_object (MOCK_SLOT_ONE_ID, extension_eku_invalid); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_enumerate_ready (&test.ex, NULL); p11_kit_be_quiet (); /* No results due to invalid purpose on certificate */ rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_CANCEL, rv); p11_kit_be_loud (); } static void test_info_skip_non_certificate (void) { CK_RV rv; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); p11_enumerate_ready (&test.ex, NULL); p11_message_quiet (); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_OK, rv); assert_num_eq (CKO_CERTIFICATE, test.ex.klass); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_CANCEL, rv); p11_message_loud (); } static void test_limit_to_purpose_match (void) { CK_RV rv; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); mock_module_add_object (MOCK_SLOT_ONE_ID, extension_eku_server_client); p11_enumerate_opt_purpose (&test.ex, P11_OID_SERVER_AUTH_STR); p11_enumerate_ready (&test.ex, NULL); p11_message_quiet (); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_OK, rv); p11_message_loud (); } static void test_limit_to_purpose_no_match (void) { CK_RV rv; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); mock_module_add_object (MOCK_SLOT_ONE_ID, extension_eku_server_client); p11_enumerate_opt_purpose (&test.ex, "3.3.3.3"); p11_enumerate_ready (&test.ex, NULL); p11_message_quiet (); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_CANCEL, rv); p11_message_loud (); } static void test_duplicate_extract (void) { CK_ATTRIBUTE certificate = { CKA_CLASS, &certificate_class, sizeof (certificate_class) }; CK_RV rv; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_distrusted); p11_kit_iter_add_filter (test.ex.iter, &certificate, 1); p11_enumerate_ready (&test.ex, NULL); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_OK, rv); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_OK, rv); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_CANCEL, rv); } static void test_duplicate_distrusted (void) { CK_ATTRIBUTE certificate = { CKA_CLASS, &certificate_class, sizeof (certificate_class) }; CK_ATTRIBUTE attrs[] = { { CKA_X_DISTRUSTED, NULL, 0 }, }; CK_BBOOL val; CK_RV rv; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_distrusted); mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); test.ex.flags = P11_ENUMERATE_COLLAPSE; p11_kit_iter_add_filter (test.ex.iter, &certificate, 1); p11_enumerate_ready (&test.ex, NULL); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_OK, rv); rv = p11_kit_iter_load_attributes (test.ex.iter, attrs, 1); assert_num_eq (CKR_OK, rv); assert (p11_attrs_findn_bool (attrs, 1, CKA_X_DISTRUSTED, &val)); assert_num_eq (val, CK_TRUE); free (attrs[0].pValue); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_CANCEL, rv); } static void test_trusted_match (void) { CK_ATTRIBUTE certificate = { CKA_CLASS, &certificate_class, sizeof (certificate_class) }; CK_RV rv; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_distrusted); test.ex.flags = P11_ENUMERATE_ANCHORS; p11_kit_iter_add_filter (test.ex.iter, &certificate, 1); p11_enumerate_ready (&test.ex, NULL); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_CANCEL, rv); } static void test_distrust_match (void) { CK_ATTRIBUTE certificate = { CKA_CLASS, &certificate_class, sizeof (certificate_class) }; CK_BBOOL boolv; CK_RV rv; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_distrusted); test.ex.flags = P11_ENUMERATE_BLACKLIST; p11_kit_iter_add_filter (test.ex.iter, &certificate, 1); p11_enumerate_ready (&test.ex, NULL); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_OK, rv); if (!p11_attrs_find_bool (test.ex.attrs, CKA_X_DISTRUSTED, &boolv)) boolv = CK_FALSE; assert_num_eq (CK_TRUE, boolv); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_CANCEL, rv); } static void test_override_by_issuer_serial (void) { CK_ATTRIBUTE certificate = { CKA_CLASS, &certificate_class, sizeof (certificate_class) }; CK_BBOOL distrusted = CK_FALSE; CK_RV rv; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_distrusted); test.ex.flags = P11_ENUMERATE_ANCHORS | P11_ENUMERATE_BLACKLIST; p11_kit_iter_add_filter (test.ex.iter, &certificate, 1); p11_enumerate_ready (&test.ex, NULL); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_OK, rv); assert (p11_attrs_find_bool (test.ex.attrs, CKA_X_DISTRUSTED, &distrusted)); assert_num_eq (CK_TRUE, distrusted); rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_CANCEL, rv); } static void test_override_by_public_key (void) { CK_ATTRIBUTE certificate = { CKA_CLASS, &certificate_class, sizeof (certificate_class) }; CK_RV rv; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_trusted); mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_distrusted_by_key); test.ex.flags = P11_ENUMERATE_ANCHORS | P11_ENUMERATE_BLACKLIST; p11_kit_iter_add_filter (test.ex.iter, &certificate, 1); p11_enumerate_ready (&test.ex, NULL); /* No results returned, because distrust is not a cert */ rv = p11_kit_iter_next (test.ex.iter); assert_num_eq (CKR_CANCEL, rv); } int main (int argc, char *argv[]) { mock_module_init (); p11_test (test_file_name_for_label, "/extract/test_file_name_for_label"); p11_test (test_file_name_for_class, "/extract/test_file_name_for_class"); p11_test (test_comment_for_label, "/extract/test_comment_for_label"); p11_test (test_comment_not_enabled, "/extract/test_comment_not_enabled"); p11_fixture (setup, teardown); p11_test (test_info_simple_certificate, "/extract/test_info_simple_certificate"); p11_test (test_info_limit_purposes, "/extract/test_info_limit_purposes"); p11_test (test_info_invalid_purposes, "/extract/test_info_invalid_purposes"); p11_test (test_info_skip_non_certificate, "/extract/test_info_skip_non_certificate"); p11_test (test_limit_to_purpose_match, "/extract/test_limit_to_purpose_match"); p11_test (test_limit_to_purpose_no_match, "/extract/test_limit_to_purpose_no_match"); p11_test (test_duplicate_extract, "/extract/test_duplicate_extract"); p11_test (test_duplicate_distrusted, "/extract/test-duplicate-distrusted"); p11_test (test_trusted_match, "/extract/test_trusted_match"); p11_test (test_distrust_match, "/extract/test_distrust_match"); p11_test (test_override_by_issuer_serial, "/extract/override-by-issuer-and-serial"); p11_test (test_override_by_public_key, "/extract/override-by-public-key"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/test-index.c0000664000175000017500000006050712226763526014502 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "test-trust.h" #include #include #include #include #include "attrs.h" #include "debug.h" #include "index.h" #include "message.h" struct { p11_index *index; } test; static void setup (void *unused) { test.index = p11_index_new (NULL, NULL, NULL, NULL, NULL); assert_ptr_not_null (test.index); } static void teardown (void *unused) { p11_index_free (test.index); memset (&test, 0, sizeof (test)); } static void test_take_lookup (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *check; CK_OBJECT_HANDLE handle; CK_RV rv; attrs = p11_attrs_dup (original); rv = p11_index_take (test.index, attrs, &handle); assert (rv == CKR_OK); check = p11_index_lookup (test.index, handle); test_check_attrs (original, check); check = p11_index_lookup (test.index, 1UL); assert_ptr_eq (NULL, check); check = p11_index_lookup (test.index, 0UL); assert_ptr_eq (NULL, check); } static void test_add_lookup (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE *check; CK_OBJECT_HANDLE handle; CK_RV rv; rv = p11_index_add (test.index, original, 2, &handle); assert (rv == CKR_OK); check = p11_index_lookup (test.index, handle); test_check_attrs (original, check); } static void test_size (void) { static CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_RV rv; rv = p11_index_add (test.index, original, 2, NULL); assert (rv == CKR_OK); rv = p11_index_add (test.index, original, 2, NULL); assert (rv == CKR_OK); rv = p11_index_add (test.index, original, 2, NULL); assert (rv == CKR_OK); assert_num_eq (3, p11_index_size (test.index)); } static int compar_ulong (const void *one, const void *two) { const CK_ULONG *u1 = one; const CK_ULONG *u2 = two; if (*u1 == *u2) return 0; if (*u1 < *u2) return -1; return 1; } static void test_snapshot (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; static const int NUM = 16; CK_OBJECT_HANDLE expected[NUM]; CK_OBJECT_HANDLE *snapshot; int i; for (i = 0; i < NUM; i++) p11_index_add (test.index, original, 2, expected + i); snapshot = p11_index_snapshot (test.index, NULL, NULL, 0); assert_ptr_not_null (snapshot); for (i = 0; i < NUM; i++) assert (snapshot[i] != 0); assert (snapshot[NUM] == 0); qsort (snapshot, NUM, sizeof (CK_OBJECT_HANDLE), compar_ulong); for (i = 0; i < NUM; i++) assert_num_eq (expected[i], snapshot[i]); free (snapshot); } static void test_snapshot_base (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; static const int NUM = 16; CK_OBJECT_HANDLE expected[NUM]; CK_OBJECT_HANDLE *snapshot; CK_RV rv; int i; for (i = 0; i < NUM; i++) { rv = p11_index_add (test.index, original, 2, expected + i); assert (rv == CKR_OK); } snapshot = p11_index_snapshot (test.index, test.index, NULL, 0); assert_ptr_not_null (snapshot); for (i = 0; i < NUM * 2; i++) assert (snapshot[i] != 0); assert (snapshot[NUM * 2] == 0); qsort (snapshot, NUM * 2, sizeof (CK_OBJECT_HANDLE), compar_ulong); for (i = 0; i < NUM * 2; i++) assert_num_eq (expected[i / 2], snapshot[i]); free (snapshot); } static void test_remove (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *check; CK_OBJECT_HANDLE handle; CK_RV rv; attrs = p11_attrs_dup (original); rv = p11_index_take (test.index, attrs, &handle); assert (rv == CKR_OK); check = p11_index_lookup (test.index, handle); assert_ptr_eq (attrs, check); rv = p11_index_remove (test.index, 1UL); assert (rv == CKR_OBJECT_HANDLE_INVALID); rv = p11_index_remove (test.index, handle); assert (rv == CKR_OK); check = p11_index_lookup (test.index, handle); assert_ptr_eq (NULL, check); } static void test_set (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE change = { CKA_LABEL, "naay", 4 }; CK_ATTRIBUTE changed[] = { { CKA_LABEL, "naay", 4 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *check; CK_OBJECT_HANDLE handle; CK_RV rv; attrs = p11_attrs_dup (original); rv = p11_index_take (test.index, attrs, &handle); assert (rv == CKR_OK); check = p11_index_lookup (test.index, handle); test_check_attrs (original, check); rv = p11_index_set (test.index, handle, &change, 1); assert (rv == CKR_OK); check = p11_index_lookup (test.index, handle); test_check_attrs (changed, check); rv = p11_index_set (test.index, 1UL, &change, 1); assert (rv == CKR_OBJECT_HANDLE_INVALID); } static void test_update (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE change = { CKA_LABEL, "naay", 4 }; CK_ATTRIBUTE changed[] = { { CKA_LABEL, "naay", 4 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *check; CK_OBJECT_HANDLE handle; CK_RV rv; attrs = p11_attrs_dup (original); rv = p11_index_take (test.index, attrs, &handle); assert (rv == CKR_OK); check = p11_index_lookup (test.index, handle); test_check_attrs (original, check); attrs = p11_attrs_build (NULL, &change, NULL); rv = p11_index_update (test.index, handle, attrs); assert (rv == CKR_OK); check = p11_index_lookup (test.index, handle); test_check_attrs (changed, check); attrs = p11_attrs_build (NULL, &change, NULL); rv = p11_index_update (test.index, 1L, attrs); assert (rv == CKR_OBJECT_HANDLE_INVALID); } static void test_find (void) { CK_ATTRIBUTE first[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "one", 3 }, { CKA_INVALID } }; CK_ATTRIBUTE second[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "two", 3 }, { CKA_INVALID } }; CK_ATTRIBUTE third[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "three", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE match3[] = { { CKA_VALUE, "three", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE match_any[] = { { CKA_LABEL, "yay", 3 }, { CKA_INVALID } }; CK_ATTRIBUTE match_none[] = { { CKA_VALUE, "blonononon", 10 }, { CKA_LABEL, "yay", 3 }, { CKA_INVALID } }; CK_OBJECT_HANDLE check; CK_OBJECT_HANDLE one; CK_OBJECT_HANDLE two; CK_OBJECT_HANDLE three; p11_index_add (test.index, first, 2, &one); p11_index_add (test.index, second, 2, &two); p11_index_add (test.index, third, 2, &three); check = p11_index_find (test.index, match3, -1); assert_num_eq (three, check); check = p11_index_find (test.index, match3, 1); assert_num_eq (three, check); check = p11_index_find (test.index, match_any, -1); assert (check == one || check == two || check == three); check = p11_index_find (test.index, match_any, 1); assert (check == one || check == two || check == three); check = p11_index_find (test.index, match_none, -1); assert_num_eq (0, check); check = p11_index_find (test.index, match_none, 2); assert_num_eq (0, check); } static bool handles_are (CK_OBJECT_HANDLE *handles, ...) { CK_OBJECT_HANDLE handle; bool matched = true; int count; int num; va_list va; int i; if (!handles) return false; /* Count number of handles */ for (num = 0; handles[num]; num++); va_start (va, handles); for (count = 0; matched; count++) { handle = va_arg (va, CK_OBJECT_HANDLE); if (handle == 0) break; for (i = 0; handles[i]; i++) { if (handle == handles[i]) break; } if (handles[i] != handle) matched = false; } va_end (va); return matched && (count == num); } static void test_find_all (void) { CK_ATTRIBUTE first[] = { { CKA_LABEL, "odd", 3 }, { CKA_VALUE, "one", 3 }, { CKA_APPLICATION, "test", 4 }, { CKA_INVALID } }; CK_ATTRIBUTE second[] = { { CKA_LABEL, "even", 4 }, { CKA_VALUE, "two", 3 }, { CKA_APPLICATION, "test", 4 }, { CKA_INVALID } }; CK_ATTRIBUTE third[] = { { CKA_LABEL, "odd", 3 }, { CKA_VALUE, "three", 5 }, { CKA_APPLICATION, "test", 4 }, { CKA_INVALID } }; CK_ATTRIBUTE match_odd[] = { { CKA_LABEL, "odd", 3 }, { CKA_APPLICATION, "test", 4 }, { CKA_INVALID } }; CK_ATTRIBUTE match_3[] = { { CKA_VALUE, "three", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE match_any[] = { { CKA_INVALID } }; CK_ATTRIBUTE match_none[] = { { CKA_VALUE, "blonononon", 10 }, { CKA_LABEL, "yay", 3 }, { CKA_INVALID } }; CK_OBJECT_HANDLE *check; CK_OBJECT_HANDLE one; CK_OBJECT_HANDLE two; CK_OBJECT_HANDLE three; p11_index_add (test.index, first, 3, &one); p11_index_add (test.index, second, 3, &two); p11_index_add (test.index, third, 3, &three); check = p11_index_find_all (test.index, match_3, -1); assert (handles_are (check, three, 0UL)); free (check); check = p11_index_find_all (test.index, match_none, -1); assert (handles_are (check, 0UL)); free (check); check = p11_index_find_all (test.index, match_odd, -1); assert (handles_are (check, one, three, 0UL)); free (check); check = p11_index_find_all (test.index, match_any, -1); assert (handles_are (check, one, two, three, 0UL)); free (check); check = p11_index_find_all (test.index, match_none, -1); assert_ptr_not_null (check); assert_num_eq (0, check[0]); free (check); /* A double check of this method */ one = 0UL; check = &one; assert (!handles_are (check, 29292929, 0UL)); assert (!handles_are (NULL, 0UL)); } static void test_find_realloc (void) { CK_ATTRIBUTE attrs[] = { { CKA_LABEL, "odd", 3 }, { CKA_VALUE, "one", 3 }, { CKA_APPLICATION, "test", 4 }, { CKA_INVALID } }; CK_ATTRIBUTE match[] = { { CKA_INVALID } }; CK_OBJECT_HANDLE *check; int i; for (i = 0; i < 1000; i++) p11_index_add (test.index, attrs, 3, NULL); check = p11_index_find_all (test.index, match, -1); assert_ptr_not_null (check); for (i = 0; i < 1000; i++) assert (check[i] != 0); assert_num_eq (0, check[1000]); free (check); } static void test_replace_all (void) { CK_ATTRIBUTE first[] = { { CKA_LABEL, "odd", 3 }, { CKA_VALUE, "one", 3 }, { CKA_APPLICATION, "test", 4 }, { CKA_INVALID } }; CK_ATTRIBUTE second[] = { { CKA_LABEL, "even", 4 }, { CKA_VALUE, "two", 3 }, { CKA_APPLICATION, "test", 4 }, { CKA_INVALID } }; CK_ATTRIBUTE third[] = { { CKA_LABEL, "odd", 3 }, { CKA_VALUE, "three", 5 }, { CKA_APPLICATION, "test", 4 }, { CKA_INVALID } }; CK_ATTRIBUTE fifth[] = { { CKA_LABEL, "odd", 3 }, { CKA_VALUE, "five", 4 }, { CKA_APPLICATION, "test", 4 }, { CKA_INVALID } }; CK_ATTRIBUTE match[] = { { CKA_LABEL, "odd", 3 }, { CKA_INVALID } }; CK_ATTRIBUTE eins[] = { { CKA_LABEL, "odd", 3 }, { CKA_VALUE, "one", 3 }, { CKA_APPLICATION, "replace", 7 }, { CKA_INVALID } }; CK_ATTRIBUTE sieben[] = { { CKA_LABEL, "odd", 3 }, { CKA_VALUE, "seven", 5 }, { CKA_APPLICATION, "replace", 7 }, { CKA_INVALID } }; CK_ATTRIBUTE neun[] = { { CKA_LABEL, "odd", 3 }, { CKA_VALUE, "nine", 4 }, { CKA_APPLICATION, "replace", 7 }, { CKA_INVALID } }; CK_OBJECT_HANDLE check; CK_OBJECT_HANDLE one; CK_OBJECT_HANDLE two; CK_OBJECT_HANDLE three; CK_OBJECT_HANDLE five; p11_array *array; CK_RV rv; p11_index_add (test.index, first, 3, &one); assert (one != 0); p11_index_add (test.index, second, 3, &two); assert (two != 0); p11_index_add (test.index, third, 3, &three); assert (three != 0); p11_index_add (test.index, fifth, 3, &five); assert (five != 0); array = p11_array_new (p11_attrs_free); p11_array_push (array, p11_attrs_buildn (NULL, eins, 3)); p11_array_push (array, p11_attrs_buildn (NULL, sieben, 3)); p11_array_push (array, p11_attrs_buildn (NULL, neun, 3)); rv = p11_index_replace_all (test.index, match, CKA_VALUE, array); assert (rv == CKR_OK); assert_num_eq (0, array->num); p11_array_free (array); /* eins should have replaced one */ check = p11_index_find (test.index, eins, -1); assert_num_eq (one, check); /* two should still be around */ check = p11_index_find (test.index, second, -1); assert_num_eq (two, check); /* three should have been removed */ check = p11_index_find (test.index, third, -1); assert_num_eq (0, check); /* five should have been removed */ check = p11_index_find (test.index, fifth, -1); assert_num_eq (0, check); /* sieben should have been added */ check = p11_index_find (test.index, sieben, -1); assert (check != one && check != two && check != three && check != five); /* neun should have been added */ check = p11_index_find (test.index, neun, -1); assert (check != one && check != two && check != three && check != five); assert_num_eq (4, p11_index_size (test.index)); } static CK_RV on_index_build_fail (void *data, p11_index *index, CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge, CK_ATTRIBUTE **populate) { CK_ATTRIBUTE *match = data; if (p11_attrs_match (merge, match)) return CKR_FUNCTION_FAILED; return CKR_OK; } static void test_replace_all_build_fails (void) { CK_ATTRIBUTE replace[] = { { CKA_LABEL, "odd", 3 }, { CKA_VALUE, "one", 3 }, { CKA_APPLICATION, "test", 4 }, { CKA_INVALID } }; CK_ATTRIBUTE match[] = { { CKA_LABEL, "odd", 3 }, { CKA_INVALID } }; p11_array *array; p11_index *index; CK_RV rv; index = p11_index_new (on_index_build_fail, NULL, NULL, NULL, &match); assert_ptr_not_null (index); array = p11_array_new (p11_attrs_free); if (!p11_array_push (array, p11_attrs_dup (replace))) assert_not_reached (); rv = p11_index_replace_all (index, NULL, CKA_INVALID, array); assert_num_eq (rv, CKR_FUNCTION_FAILED); p11_array_free (array); p11_index_free (index); } static CK_RV on_build_populate (void *data, p11_index *index, CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge, CK_ATTRIBUTE **populate) { CK_ATTRIBUTE more[] = { { CKA_APPLICATION, "vigorous", 8 }, { CKA_LABEL, "naay", 4 }, }; assert_str_eq (data, "blah"); assert_ptr_not_null (index); assert_ptr_not_null (merge); *populate = p11_attrs_buildn (*populate, more, 2); return CKR_OK; } static void test_build_populate (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE after[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_APPLICATION, "vigorous", 8 }, { CKA_INVALID } }; CK_OBJECT_HANDLE handle; CK_ATTRIBUTE *check; p11_index *index; CK_RV rv; index = p11_index_new (on_build_populate, NULL, NULL, NULL, "blah"); assert_ptr_not_null (index); rv = p11_index_add (index, original, 2, &handle); assert (rv == CKR_OK); check = p11_index_lookup (index, handle); assert_ptr_not_null (check); test_check_attrs (after, check); rv = p11_index_set (index, handle, original, 2); assert (rv == CKR_OK); check = p11_index_lookup (index, handle); assert_ptr_not_null (check); test_check_attrs (after, check); p11_index_free (index); } static CK_RV on_build_fail (void *data, p11_index *index, CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge, CK_ATTRIBUTE **populate) { CK_ATTRIBUTE check[] = { { CKA_LABEL, "nay", 3 }, { CKA_INVALID } }; assert_str_eq (data, "testo"); assert_ptr_not_null (merge); if (p11_attrs_match (merge, check)) return CKR_DEVICE_ERROR; return CKR_OK; } static void test_build_fail (void) { CK_ATTRIBUTE okay[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE fails[] = { { CKA_LABEL, "nay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_OBJECT_HANDLE handle; p11_index *index; CK_RV rv; index = p11_index_new (on_build_fail, NULL, NULL, NULL, "testo"); assert_ptr_not_null (index); rv = p11_index_add (index, okay, 2, &handle); assert (rv == CKR_OK); rv = p11_index_add (index, fails, 2, NULL); assert (rv == CKR_DEVICE_ERROR); rv = p11_index_set (index, handle, fails, 2); assert (rv == CKR_DEVICE_ERROR); rv = p11_index_set (index, handle, okay, 2); assert (rv == CKR_OK); p11_index_free (index); } static int on_change_called = 0; static bool on_change_removing = false; static bool on_change_batching = false; static void on_change_check (void *data, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs) { CK_ATTRIBUTE check[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; assert_str_eq (data, "change-check"); assert_ptr_not_null (index); assert_ptr_not_null (attrs); if (!on_change_batching) { if (on_change_removing) assert_num_eq (0, handle); else assert (handle != 0); } test_check_attrs (check, attrs); on_change_called++; } static void test_change_called (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_OBJECT_HANDLE handle; p11_index *index; CK_RV rv; index = p11_index_new (NULL, NULL, NULL, on_change_check, "change-check"); assert_ptr_not_null (index); on_change_removing = false; on_change_called = 0; rv = p11_index_add (index, original, 2, NULL); assert (rv == CKR_OK); assert_num_eq (1, on_change_called); rv = p11_index_add (index, original, 2, NULL); assert (rv == CKR_OK); assert_num_eq (2, on_change_called); rv = p11_index_add (index, original, 2, &handle); assert (rv == CKR_OK); assert_num_eq (3, on_change_called); on_change_removing = true; rv = p11_index_remove (index, handle); assert (rv == CKR_OK); assert_num_eq (4, on_change_called); p11_index_free (index); } static void test_change_batch (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_OBJECT_HANDLE handle; p11_index *index; CK_RV rv; index = p11_index_new (NULL, NULL, NULL, on_change_check, "change-check"); assert_ptr_not_null (index); on_change_batching = true; on_change_called = 0; p11_index_load (index); assert (p11_index_loading (index)); rv = p11_index_add (index, original, 2, NULL); assert (rv == CKR_OK); assert_num_eq (0, on_change_called); rv = p11_index_add (index, original, 2, NULL); assert (rv == CKR_OK); assert_num_eq (0, on_change_called); rv = p11_index_add (index, original, 2, &handle); assert (rv == CKR_OK); assert_num_eq (0, on_change_called); /* Nested batch is a noop */ p11_index_load (index); rv = p11_index_remove (index, handle); assert (rv == CKR_OK); assert_num_eq (0, on_change_called); /* * Batch finishes when first finish call is called, * even when batches are nested */ p11_index_finish (index); assert (!p11_index_loading (index)); /* * Only three calls, because later operations on the * same handle override the earlier one. */ assert_num_eq (3, on_change_called); /* This is a noop */ p11_index_finish (index); assert (!p11_index_loading (index)); p11_index_free (index); } static void on_change_nested (void *data, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs) { CK_RV rv; CK_ATTRIBUTE second[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; assert_str_eq (data, "change-nested"); on_change_called++; /* A nested call */ rv = p11_index_add (index, second, 2, NULL); assert (rv == CKR_OK); } static void test_change_nested (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; p11_index *index; CK_RV rv; index = p11_index_new (NULL, NULL, NULL, on_change_nested, "change-nested"); assert_ptr_not_null (index); on_change_called = 0; rv = p11_index_add (index, original, 2, NULL); assert (rv == CKR_OK); assert_num_eq (1, on_change_called); on_change_called = 0; p11_index_load (index); rv = p11_index_add (index, original, 2, NULL); assert (rv == CKR_OK); p11_index_finish (index); assert_num_eq (1, on_change_called); p11_index_free (index); } static CK_RV on_remove_callback (void *data, p11_index *index, CK_ATTRIBUTE *attrs) { int *removed = data; assert_ptr_not_null (removed); assert_num_eq (*removed, 0); *removed = 1; return CKR_OK; } static void test_remove_callback (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_OBJECT_HANDLE handle; p11_index *index; int removed = 0; CK_RV rv; index = p11_index_new (NULL, NULL, on_remove_callback, NULL, &removed); assert_ptr_not_null (index); rv = p11_index_add (index, original, 2, &handle); assert_num_eq (rv, CKR_OK); assert_ptr_not_null (p11_index_lookup (index, handle)); rv = p11_index_remove (index, handle); assert_num_eq (rv, CKR_OK); assert_num_eq (removed, 1); assert_ptr_eq (p11_index_lookup (index, handle), NULL); p11_index_free (index); } static CK_RV on_remove_fail (void *data, p11_index *index, CK_ATTRIBUTE *attrs) { assert_str_eq (data, "remove-fail"); return CKR_DEVICE_REMOVED; } static void test_remove_fail (void) { CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_OBJECT_HANDLE handle; p11_index *index; CK_RV rv; index = p11_index_new (NULL, NULL, on_remove_fail, NULL, "remove-fail"); assert_ptr_not_null (index); rv = p11_index_add (index, original, 2, &handle); assert (rv == CKR_OK); assert_ptr_not_null (p11_index_lookup (index, handle)); rv = p11_index_remove (index, handle); assert_num_eq (rv, CKR_DEVICE_REMOVED); assert_ptr_not_null (p11_index_lookup (index, handle)); p11_index_free (index); } int main (int argc, char *argv[]) { p11_message_quiet (); p11_fixture (setup, teardown); p11_test (test_add_lookup, "/index/add_lookup"); p11_test (test_take_lookup, "/index/take_lookup"); p11_test (test_size, "/index/size"); p11_test (test_remove, "/index/remove"); p11_test (test_snapshot, "/index/snapshot"); p11_test (test_snapshot_base, "/index/snapshot_base"); p11_test (test_set, "/index/set"); p11_test (test_update, "/index/update"); p11_test (test_find, "/index/find"); p11_test (test_find_all, "/index/find_all"); p11_test (test_find_realloc, "/index/find_realloc"); p11_test (test_replace_all, "/index/replace_all"); p11_fixture (NULL, NULL); p11_test (test_build_populate, "/index/build_populate"); p11_test (test_build_fail, "/index/build_fail"); p11_test (test_change_called, "/index/change_called"); p11_test (test_change_batch, "/index/change_batch"); p11_test (test_change_nested, "/index/change_nested"); p11_test (test_replace_all_build_fails, "/index/replace-all-build-fails"); p11_test (test_remove_callback, "/index/remove-callback"); p11_test (test_remove_fail, "/index/remove-fail"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/frob-nss-trust.c0000664000175000017500000001362212226763526015322 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include "attrs.h" #include "debug.h" #include "pkcs11x.h" #include "p11-kit/iter.h" #include "p11-kit/p11-kit.h" #include #include #include static void dump_object (P11KitIter *iter, CK_ATTRIBUTE *attrs) { CK_ATTRIBUTE label = { CKA_LABEL, }; CK_ATTRIBUTE *attr; char *string; char *name; CK_RV rv; attr = p11_attrs_find_valid (attrs, CKA_LABEL); if (!attr) { rv = p11_kit_iter_load_attributes (iter, &label, 1); if (rv == CKR_OK) attr = &label; } if (attr) name = strndup (attr->pValue, attr->ulValueLen); else name = strdup ("unknown"); string = p11_attrs_to_string (attrs, -1); printf ("\"%s\" = %s\n", name, string); free (string); free (label.pValue); free (name); } static int dump_trust_module (const char *path) { CK_FUNCTION_LIST *module; CK_OBJECT_CLASS nss_trust = CKO_NSS_TRUST; CK_ATTRIBUTE match = { CKA_CLASS, &nss_trust, sizeof (nss_trust) }; P11KitIter *iter; CK_ATTRIBUTE *attrs; CK_RV rv; CK_ATTRIBUTE template[] = { { CKA_CLASS,}, { CKA_LABEL, }, { CKA_CERT_MD5_HASH, }, { CKA_CERT_SHA1_HASH }, { CKA_ISSUER, }, { CKA_SERIAL_NUMBER, }, { CKA_TRUST_SERVER_AUTH, }, { CKA_TRUST_EMAIL_PROTECTION, }, { CKA_TRUST_CODE_SIGNING, }, { CKA_TRUST_STEP_UP_APPROVED, }, { CKA_INVALID, } }; CK_ULONG count = p11_attrs_count (template); module = p11_kit_module_load (path, 0); return_val_if_fail (module != NULL, 1); rv = p11_kit_module_initialize (module); return_val_if_fail (rv == CKR_OK, 1); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_add_filter (iter, &match, 1); p11_kit_iter_begin_with (iter, module, 0, 0); while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { attrs = p11_attrs_dup (template); rv = p11_kit_iter_load_attributes (iter, attrs, count); return_val_if_fail (rv == CKR_OK || rv == CKR_ATTRIBUTE_VALUE_INVALID, 1); p11_attrs_purge (attrs); dump_object (iter, attrs); p11_attrs_free (attrs); } return_val_if_fail (rv == CKR_CANCEL, 1); p11_kit_module_finalize (module); p11_kit_module_release (module); return 0; } static int compare_trust_modules (const char *path1, const char *path2) { CK_FUNCTION_LIST *module1; CK_FUNCTION_LIST *module2; CK_OBJECT_CLASS nss_trust = CKO_NSS_TRUST; CK_ATTRIBUTE match = { CKA_CLASS, &nss_trust, sizeof (nss_trust) }; P11KitIter *iter; P11KitIter *iter2; CK_ATTRIBUTE *check; CK_RV rv; CK_ATTRIBUTE template[] = { { CKA_CLASS, }, { CKA_ISSUER, }, { CKA_SERIAL_NUMBER, }, { CKA_CERT_MD5_HASH, }, { CKA_CERT_SHA1_HASH }, { CKA_TRUST_SERVER_AUTH, }, { CKA_TRUST_EMAIL_PROTECTION, }, { CKA_TRUST_CODE_SIGNING, }, { CKA_TRUST_STEP_UP_APPROVED, }, { CKA_INVALID, } }; module1 = p11_kit_module_load (path1, 0); return_val_if_fail (module1 != NULL, 1); rv = p11_kit_module_initialize (module1); return_val_if_fail (rv == CKR_OK, 1); module2 = p11_kit_module_load (path2, 0); return_val_if_fail (module2 != NULL, 1); rv = p11_kit_module_initialize (module2); return_val_if_fail (rv == CKR_OK, 1); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_add_filter (iter, &match, 1); p11_kit_iter_begin_with (iter, module1, 0, 0); while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { check = p11_attrs_dup (template); rv = p11_kit_iter_load_attributes (iter, check, p11_attrs_count (check)); return_val_if_fail (rv == CKR_OK || rv == CKR_ATTRIBUTE_TYPE_INVALID, 1); /* Go through and remove anything not found */ p11_attrs_purge (check); /* Check that this object exists */ iter2 = p11_kit_iter_new (NULL, 0); p11_kit_iter_add_filter (iter2, check, p11_attrs_count (check)); p11_kit_iter_begin_with (iter2, module2, 0, 0); rv = p11_kit_iter_next (iter2); p11_kit_iter_free (iter2); if (rv != CKR_OK) dump_object (iter, check); p11_attrs_free (check); } return_val_if_fail (rv == CKR_CANCEL, 1); p11_kit_module_finalize (module1); p11_kit_module_release (module1); p11_kit_module_finalize (module2); p11_kit_module_release (module2); return 0; } int main (int argc, char *argv[]) { if (argc == 2) { return dump_trust_module (argv[1]); } else if (argc == 3) { return compare_trust_modules (argv[1], argv[2]); } else { fprintf (stderr, "usage: frob-nss-trust module\n"); fprintf (stderr, " frob-nss-trust module1 module2\n"); return 2; } } p11-kit-0.20.2/trust/tests/test-parser.c0000664000175000017500000003422512226763526014665 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "test-trust.h" #include #include #include #include "array.h" #include "attrs.h" #include "builder.h" #include "debug.h" #include "message.h" #include "oid.h" #include "parser.h" #include "pkcs11x.h" struct { p11_parser *parser; p11_array *parsed; p11_asn1_cache *cache; } test; static void setup (void *unused) { test.cache = p11_asn1_cache_new (); test.parser = p11_parser_new (test.cache); assert_ptr_not_null (test.parser); test.parsed = p11_parser_parsed (test.parser); assert_ptr_not_null (test.parsed); } static void teardown (void *unused) { p11_parser_free (test.parser); p11_asn1_cache_free (test.cache); memset (&test, 0, sizeof (test)); } static CK_OBJECT_CLASS certificate = CKO_CERTIFICATE; static CK_OBJECT_CLASS certificate_extension = CKO_X_CERTIFICATE_EXTENSION; static CK_BBOOL falsev = CK_FALSE; static CK_BBOOL truev = CK_TRUE; static CK_CERTIFICATE_TYPE x509 = CKC_X_509; static CK_ATTRIBUTE certificate_match[] = { { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_INVALID, }, }; static CK_ATTRIBUTE * parsed_attrs (CK_ATTRIBUTE *match, int length) { int i; if (length < 0) length = p11_attrs_count (match); for (i = 0; i < test.parsed->num; i++) { if (p11_attrs_matchn (test.parsed->elem[i], match, length)) return test.parsed->elem[i]; } return NULL; } static void test_parse_der_certificate (void) { CK_ATTRIBUTE *cert; int ret; CK_ATTRIBUTE expected[] = { { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_MODIFIABLE, &falsev, sizeof (falsev) }, { CKA_TRUSTED, &falsev, sizeof (falsev) }, { CKA_X_DISTRUSTED, &falsev, sizeof (falsev) }, { CKA_INVALID }, }; p11_parser_formats (test.parser, p11_parser_format_x509, NULL); ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.der", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_SUCCESS, ret); /* Should have gotten certificate */ assert_num_eq (1, test.parsed->num); cert = parsed_attrs (certificate_match, -1); test_check_attrs (expected, cert); } static void test_parse_pem_certificate (void) { CK_ATTRIBUTE *cert; int ret; CK_ATTRIBUTE expected[] = { { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_MODIFIABLE, &falsev, sizeof (falsev) }, { CKA_TRUSTED, &falsev, sizeof (falsev) }, { CKA_X_DISTRUSTED, &falsev, sizeof (falsev) }, { CKA_INVALID }, }; p11_parser_formats (test.parser, p11_parser_format_pem, NULL); ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.pem", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_SUCCESS, ret); /* Should have gotten certificate */ assert_num_eq (1, test.parsed->num); cert = parsed_attrs (certificate_match, -1); test_check_attrs (expected, cert); } static void test_parse_p11_kit_persist (void) { CK_ATTRIBUTE *cert; int ret; CK_ATTRIBUTE expected[] = { { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_VALUE, (void *)verisign_v1_ca, sizeof (verisign_v1_ca) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_X_DISTRUSTED, &falsev, sizeof (falsev) }, { CKA_INVALID }, }; p11_parser_formats (test.parser, p11_parser_format_persist, NULL); ret = p11_parse_file (test.parser, SRCDIR "/input/verisign-v1.p11-kit", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_SUCCESS, ret); /* Should have gotten certificate */ assert_num_eq (1, test.parsed->num); cert = parsed_attrs (certificate_match, -1); test_check_attrs (expected, cert); } static void test_parse_openssl_trusted (void) { CK_ATTRIBUTE cacert3[] = { { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_MODIFIABLE, &falsev, sizeof (falsev) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_X_DISTRUSTED, &falsev, sizeof (falsev) }, { CKA_INVALID }, }; CK_ATTRIBUTE eku_extension[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension), }, { CKA_OBJECT_ID, (void *)P11_OID_EXTENDED_KEY_USAGE, sizeof (P11_OID_EXTENDED_KEY_USAGE) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_VALUE, "\x30\x16\x06\x03\x55\x1d\x25\x01\x01\xff\x04\x0c\x30\x0a\x06\x08\x2b\x06\x01\x05\x05\x07\x03\x01", 24 }, { CKA_INVALID }, }; CK_ATTRIBUTE reject_extension[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension), }, { CKA_OBJECT_ID, (void *)P11_OID_OPENSSL_REJECT, sizeof (P11_OID_OPENSSL_REJECT) }, { CKA_X_PUBLIC_KEY_INFO, (void *)test_cacert3_ca_public_key, sizeof (test_cacert3_ca_public_key) }, { CKA_VALUE, "\x30\x1a\x06\x0a\x2b\x06\x01\x04\x01\x99\x77\x06\x0a\x01\x04\x0c\x30\x0a\x06\x08\x2b\x06\x01\x05\x05\x07\x03\x04", 28 }, { CKA_INVALID }, }; CK_ATTRIBUTE *expected[] = { cacert3, eku_extension, reject_extension, NULL }; CK_ATTRIBUTE *cert; CK_ATTRIBUTE *object; int ret; int i; p11_parser_formats (test.parser, p11_parser_format_pem, NULL); ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3-trusted.pem", NULL, P11_PARSE_FLAG_ANCHOR); assert_num_eq (P11_PARSE_SUCCESS, ret); /* * Should have gotten: * - 1 certificate * - 2 stapled extensions */ assert_num_eq (3, test.parsed->num); /* The certificate */ cert = parsed_attrs (certificate_match, -1); test_check_attrs (expected[0], cert); /* The other objects */ for (i = 1; expected[i]; i++) { object = parsed_attrs (expected[i], 2); assert_ptr_not_null (object); test_check_attrs (expected[i], object); test_check_id (cert, object); } } static void test_parse_openssl_distrusted (void) { static const char distrust_public_key[] = { 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xdf, 0xc7, 0x0d, 0x61, 0xa2, 0x2f, 0xc0, 0x5a, 0xad, 0x45, 0x83, 0x22, 0x33, 0x42, 0xea, 0xec, 0x42, 0x5e, 0xa6, 0x0d, 0x42, 0x4c, 0x1c, 0x9a, 0x12, 0x0b, 0x5f, 0xe7, 0x25, 0xf9, 0x8b, 0x83, 0x0c, 0x0a, 0xc5, 0x2f, 0x5a, 0x58, 0x56, 0xb8, 0xad, 0x87, 0x6d, 0xbc, 0x80, 0x5d, 0xdd, 0x49, 0x45, 0x39, 0x5f, 0xb9, 0x08, 0x3a, 0x63, 0xe4, 0x92, 0x33, 0x61, 0x79, 0x19, 0x1b, 0x9d, 0xab, 0x3a, 0xd5, 0x7f, 0xa7, 0x8b, 0x7f, 0x8a, 0x5a, 0xf6, 0xd7, 0xde, 0xaf, 0xa1, 0xe5, 0x53, 0x31, 0x29, 0x7d, 0x9c, 0x03, 0x55, 0x3e, 0x47, 0x78, 0xcb, 0xb9, 0x7a, 0x98, 0x8c, 0x5f, 0x8d, 0xda, 0x09, 0x0f, 0xc8, 0xfb, 0xf1, 0x7a, 0x80, 0xee, 0x12, 0x77, 0x0a, 0x00, 0x8b, 0x70, 0xfa, 0x62, 0xbf, 0xaf, 0xee, 0x0b, 0x58, 0x16, 0xf9, 0x9c, 0x5c, 0xde, 0x93, 0xb8, 0x4f, 0xdf, 0x4d, 0x7b, 0x02, 0x03, 0x01, 0x00, 0x01, }; CK_ATTRIBUTE distrust_cert[] = { { CKA_CLASS, &certificate, sizeof (certificate), }, { CKA_MODIFIABLE, &falsev, sizeof (falsev) }, { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_TRUSTED, &falsev, sizeof (falsev) }, { CKA_X_DISTRUSTED, &truev, sizeof (truev) }, { CKA_INVALID }, }; CK_ATTRIBUTE eku_extension[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension), }, { CKA_OBJECT_ID, (void *)P11_OID_EXTENDED_KEY_USAGE, sizeof (P11_OID_EXTENDED_KEY_USAGE) }, { CKA_X_PUBLIC_KEY_INFO, (void *)distrust_public_key, sizeof (distrust_public_key) }, { CKA_VALUE, "\x30\x18\x06\x03\x55\x1d\x25\x01\x01\xff\x04\x0e\x30\x0c\x06\x0a\x2b\x06\x01\x04\x01\x99\x77\x06\x0a\x10", 26 }, { CKA_INVALID }, }; CK_ATTRIBUTE reject_extension[] = { { CKA_CLASS, &certificate_extension, sizeof (certificate_extension), }, { CKA_OBJECT_ID, (void *)P11_OID_OPENSSL_REJECT, sizeof (P11_OID_OPENSSL_REJECT) }, { CKA_X_PUBLIC_KEY_INFO, (void *)distrust_public_key, sizeof (distrust_public_key) }, { CKA_VALUE, "\x30\x1a\x06\x0a\x2b\x06\x01\x04\x01\x99\x77\x06\x0a\x01\x04\x0c\x30\x0a\x06\x08\x2b\x06\x01\x05\x05\x07\x03\x02", 28 }, { CKA_INVALID }, }; CK_ATTRIBUTE *expected[] = { distrust_cert, eku_extension, reject_extension, NULL }; CK_ATTRIBUTE *cert; CK_ATTRIBUTE *object; int ret; int i; /* * OpenSSL style is to litter the blacklist in with the anchors, * so we parse this as an anchor, but expect it to be blacklisted */ p11_parser_formats (test.parser, p11_parser_format_pem, NULL); ret = p11_parse_file (test.parser, SRCDIR "/files/distrusted.pem", NULL, P11_PARSE_FLAG_ANCHOR); assert_num_eq (P11_PARSE_SUCCESS, ret); /* * Should have gotten: * - 1 certificate * - 2 stapled extensions */ assert_num_eq (3, test.parsed->num); cert = parsed_attrs (certificate_match, -1); test_check_attrs (expected[0], cert); /* The other objects */ for (i = 1; expected[i]; i++) { object = parsed_attrs (expected[i], 2); assert_ptr_not_null (object); test_check_attrs (expected[i], object); test_check_id (cert, object); } } static void test_parse_anchor (void) { CK_ATTRIBUTE cacert3[] = { { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_MODIFIABLE, &falsev, sizeof (falsev) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_X_DISTRUSTED, &falsev, sizeof (falsev) }, { CKA_INVALID }, }; CK_ATTRIBUTE *cert; int ret; p11_parser_formats (test.parser, p11_parser_format_x509, NULL); ret = p11_parse_file (test.parser, SRCDIR "/files/cacert3.der", NULL, P11_PARSE_FLAG_ANCHOR); assert_num_eq (P11_PARSE_SUCCESS, ret); /* * Should have gotten: * - 1 certificate */ assert_num_eq (1, test.parsed->num); cert = parsed_attrs (certificate_match, -1); test_check_attrs (cacert3, cert); } static void test_parse_thawte (void) { CK_ATTRIBUTE *cert; int ret; CK_ATTRIBUTE expected[] = { { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CLASS, &certificate, sizeof (certificate) }, { CKA_MODIFIABLE, &falsev, sizeof (falsev) }, { CKA_TRUSTED, &falsev, sizeof (falsev) }, { CKA_X_DISTRUSTED, &falsev, sizeof (falsev) }, { CKA_INVALID }, }; p11_parser_formats (test.parser, p11_parser_format_pem, NULL); ret = p11_parse_file (test.parser, SRCDIR "/files/thawte.pem", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_SUCCESS, ret); /* Should have gotten certificate */ assert_num_eq (1, test.parsed->num); cert = parsed_attrs (certificate_match, -1); test_check_attrs (expected, cert); } /* TODO: A certificate that uses generalTime needs testing */ static void test_parse_invalid_file (void) { int ret; p11_message_quiet (); p11_parser_formats (test.parser, p11_parser_format_x509, NULL); ret = p11_parse_file (test.parser, "/nonexistant", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_FAILURE, ret); p11_message_loud (); } static void test_parse_unrecognized (void) { int ret; p11_message_quiet (); p11_parser_formats (test.parser, p11_parser_format_x509, NULL); ret = p11_parse_file (test.parser, SRCDIR "/files/unrecognized-file.txt", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_UNRECOGNIZED, ret); p11_message_loud (); } static void test_parse_no_asn1_cache (void) { p11_parser *parser; int ret; parser = p11_parser_new (NULL); assert_ptr_not_null (parser); p11_parser_formats (parser, p11_parser_format_x509, NULL); ret = p11_parse_file (parser, SRCDIR "/files/cacert3.der", NULL, P11_PARSE_FLAG_NONE); assert_num_eq (P11_PARSE_SUCCESS, ret); /* Should have gotten certificate */ assert_num_eq (1, p11_parser_parsed (parser)->num); p11_parser_free (parser); } int main (int argc, char *argv[]) { p11_fixture (setup, teardown); p11_test (test_parse_der_certificate, "/parser/parse_der_certificate"); p11_test (test_parse_pem_certificate, "/parser/parse_pem_certificate"); p11_test (test_parse_p11_kit_persist, "/parser/parse_p11_kit_persist"); p11_test (test_parse_openssl_trusted, "/parser/parse_openssl_trusted"); p11_test (test_parse_openssl_distrusted, "/parser/parse_openssl_distrusted"); p11_test (test_parse_anchor, "/parser/parse_anchor"); p11_test (test_parse_thawte, "/parser/parse_thawte"); p11_test (test_parse_invalid_file, "/parser/parse_invalid_file"); p11_test (test_parse_unrecognized, "/parser/parse_unrecognized"); p11_fixture (NULL, NULL); p11_test (test_parse_no_asn1_cache, "/parser/null-asn1-cache"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/test-save.c0000664000175000017500000003725112226763526014331 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test-trust.h" #include "attrs.h" #include "compat.h" #include "debug.h" #include "dict.h" #include "message.h" #include "path.h" #include "save.h" #include "test.h" #include #include #include #include #include #include #include #include #include struct { char *directory; } test; static void setup (void *unused) { test.directory = p11_test_directory ("test-extract"); } static void teardown (void *unused) { if (rmdir (test.directory) < 0) assert_fail ("rmdir() failed", strerror (errno)); free (test.directory); } static void write_zero_file (const char *directory, const char *name) { char *filename; int res; int fd; if (asprintf (&filename, "%s/%s", directory, name) < 0) assert_not_reached (); fd = open (filename, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); assert (fd != -1); res = close (fd); assert (res >= 0); free (filename); } static void test_file_write (void) { p11_save_file *file; char *filename; bool ret; if (asprintf (&filename, "%s/%s", test.directory, "extract-file") < 0) assert_not_reached (); file = p11_save_open_file (filename, NULL, 0); assert_ptr_not_null (file); ret = p11_save_write_and_finish (file, test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); assert_num_eq (true, ret); free (filename); test_check_file (test.directory, "extract-file", SRCDIR "/files/cacert3.der"); } static void test_file_exists (void) { p11_save_file *file; char *filename; if (asprintf (&filename, "%s/%s", test.directory, "extract-file") < 0) assert_not_reached (); write_zero_file (test.directory, "extract-file"); p11_message_quiet (); file = p11_save_open_file (filename, NULL, 0); assert (file != NULL); if (p11_save_finish_file (file, NULL, true)) assert_not_reached (); p11_message_loud (); unlink (filename); free (filename); } static void test_file_bad_directory (void) { p11_save_file *file; char *filename; if (asprintf (&filename, "/non-existent/%s/%s", test.directory, "extract-file") < 0) assert_not_reached (); p11_message_quiet (); file = p11_save_open_file (filename, NULL, 0); assert (file == NULL); p11_message_loud (); free (filename); } static void test_file_overwrite (void) { p11_save_file *file; char *filename; bool ret; if (asprintf (&filename, "%s/%s", test.directory, "extract-file") < 0) assert_not_reached (); write_zero_file (test.directory, "extract-file"); file = p11_save_open_file (filename, NULL, P11_SAVE_OVERWRITE); assert_ptr_not_null (file); ret = p11_save_write_and_finish (file, test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); assert_num_eq (true, ret); free (filename); test_check_file (test.directory, "extract-file", SRCDIR "/files/cacert3.der"); } static void test_file_unique (void) { p11_save_file *file; char *filename; bool ret; if (asprintf (&filename, "%s/%s", test.directory, "extract-file") < 0) assert_not_reached (); write_zero_file (test.directory, "extract-file"); file = p11_save_open_file (filename, NULL, P11_SAVE_UNIQUE); assert_ptr_not_null (file); ret = p11_save_write_and_finish (file, test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); assert_num_eq (true, ret); free (filename); test_check_file (test.directory, "extract-file", SRCDIR "/files/empty-file"); test_check_file (test.directory, "extract-file.1", SRCDIR "/files/cacert3.der"); } static void test_file_auto_empty (void) { p11_save_file *file; char *filename; bool ret; if (asprintf (&filename, "%s/%s", test.directory, "extract-file") < 0) assert_not_reached (); file = p11_save_open_file (filename, NULL, 0); assert_ptr_not_null (file); ret = p11_save_write_and_finish (file, NULL, -1); assert_num_eq (true, ret); free (filename); test_check_file (test.directory, "extract-file", SRCDIR "/files/empty-file"); } static void test_file_auto_length (void) { p11_save_file *file; char *filename; bool ret; if (asprintf (&filename, "%s/%s", test.directory, "extract-file") < 0) assert_not_reached (); file = p11_save_open_file (filename, NULL, 0); assert_ptr_not_null (file); ret = p11_save_write_and_finish (file, "The simple string is hairy", -1); assert_num_eq (true, ret); free (filename); test_check_file (test.directory, "extract-file", SRCDIR "/files/simple-string"); } static void test_write_with_null (void) { bool ret; ret = p11_save_write (NULL, "test", 4); assert_num_eq (false, ret); } static void test_write_and_finish_with_null (void) { bool ret; ret = p11_save_write_and_finish (NULL, "test", 4); assert_num_eq (false, ret); } static void test_file_abort (void) { struct stat st; p11_save_file *file; char *filename; char *path; bool ret; if (asprintf (&filename, "%s/%s", test.directory, "extract-file") < 0) assert_not_reached (); file = p11_save_open_file (filename, NULL, 0); assert_ptr_not_null (file); path = NULL; ret = p11_save_finish_file (file, &path, false); assert_num_eq (true, ret); assert (path == NULL); if (stat (filename, &st) >= 0 || errno != ENOENT) assert_fail ("file should not exist", filename); free (filename); } static void test_directory_empty (void) { p11_save_dir *dir; char *subdir; bool ret; if (asprintf (&subdir, "%s/%s", test.directory, "extract-dir") < 0) assert_not_reached (); dir = p11_save_open_directory (subdir, 0); assert_ptr_not_null (dir); ret = p11_save_finish_directory (dir, true); assert_num_eq (true, ret); test_check_directory (subdir, (NULL, NULL)); assert (rmdir (subdir) >= 0); free (subdir); } static void test_directory_files (void) { char *path; char *check; p11_save_file *file; p11_save_dir *dir; char *subdir; bool ret; if (asprintf (&subdir, "%s/%s", test.directory, "extract-dir") < 0) assert_not_reached (); dir = p11_save_open_directory (subdir, 0); assert_ptr_not_null (dir); file = p11_save_open_file_in (dir, "blah", ".cer"); assert_ptr_not_null (file); ret = p11_save_write (file, test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); assert_num_eq (true, ret); ret = p11_save_finish_file (file, &path, true); assert_num_eq (true, ret); if (asprintf (&check, "%s/%s", subdir, "blah.cer") < 0) assert_not_reached (); assert_str_eq (check, path); free (check); free (path); file = p11_save_open_file_in (dir, "file", ".txt"); assert_ptr_not_null (file); ret = p11_save_write (file, test_text, strlen (test_text)); assert_num_eq (true, ret); ret = p11_save_finish_file (file, &path, true); assert_num_eq (true, ret); if (asprintf (&check, "%s/%s", subdir, "file.txt") < 0) assert_not_reached (); assert_str_eq (check, path); free (check); free (path); #ifdef OS_UNIX ret = p11_save_symlink_in (dir, "link", ".ext", "/the/destination"); assert_num_eq (true, ret); #endif ret = p11_save_finish_directory (dir, true); assert_num_eq (true, ret); test_check_directory (subdir, ("blah.cer", "file.txt", #ifdef OS_UNIX "link.ext", #endif NULL)); test_check_file (subdir, "blah.cer", SRCDIR "/files/cacert3.der"); test_check_data (subdir, "file.txt", test_text, strlen (test_text)); #ifdef OS_UNIX test_check_symlink (subdir, "link.ext", "/the/destination"); #endif assert (rmdir (subdir) >= 0); free (subdir); } static void test_directory_dups (void) { char *path; char *check; p11_save_file *file; p11_save_dir *dir; char *subdir; bool ret; if (asprintf (&subdir, "%s/%s", test.directory, "extract-dir") < 0) assert_not_reached (); dir = p11_save_open_directory (subdir, 0); assert_ptr_not_null (dir); file = p11_save_open_file_in (dir, "file", ".txt"); assert_ptr_not_null (file); ret = p11_save_write (file, test_text, 5); assert_num_eq (true, ret); ret = p11_save_finish_file (file, &path, true); assert_num_eq (true, ret); if (asprintf (&check, "%s/%s", subdir, "file.txt") < 0) assert_not_reached (); assert_str_eq (check, path); free (check); free (path); file = p11_save_open_file_in (dir, "file", ".txt"); assert_ptr_not_null (file); ret = p11_save_write (file, test_text, 10); assert_num_eq (true, ret); ret = p11_save_finish_file (file, &path, true); assert_num_eq (true, ret); if (asprintf (&check, "%s/%s", subdir, "file.1.txt") < 0) assert_not_reached (); assert_str_eq (check, path); free (check); free (path); ret = p11_save_write_and_finish (p11_save_open_file_in (dir, "file", ".txt"), test_text, 15); assert_num_eq (true, ret); ret = p11_save_write_and_finish (p11_save_open_file_in (dir, "no-ext", NULL), test_text, 8); assert_num_eq (true, ret); ret = p11_save_write_and_finish (p11_save_open_file_in (dir, "no-ext", NULL), test_text, 16); assert_num_eq (true, ret); ret = p11_save_write_and_finish (p11_save_open_file_in (dir, "with-num", ".0"), test_text, 14); assert_num_eq (true, ret); ret = p11_save_write_and_finish (p11_save_open_file_in (dir, "with-num", ".0"), test_text, 15); assert_num_eq (true, ret); #ifdef OS_UNIX ret = p11_save_symlink_in (dir, "link", ".0", "/destination1"); assert_num_eq (true, ret); ret = p11_save_symlink_in (dir, "link", ".0", "/destination2"); assert_num_eq (true, ret); #endif ret = p11_save_finish_directory (dir, true); assert_num_eq (true, ret); test_check_directory (subdir, ("file.txt", "file.1.txt", "file.2.txt", "no-ext", "no-ext.1", "with-num.0", "with-num.1", #ifdef OS_UNIX "link.0", "link.1", #endif NULL)); test_check_data (subdir, "file.txt", test_text, 5); test_check_data (subdir, "file.1.txt", test_text, 10); test_check_data (subdir, "file.2.txt", test_text, 15); test_check_data (subdir, "no-ext", test_text, 8); test_check_data (subdir, "no-ext.1", test_text, 16); test_check_data (subdir, "with-num.0", test_text, 14); test_check_data (subdir, "with-num.1", test_text, 15); #ifdef OS_UNIX test_check_symlink (subdir, "link.0", "/destination1"); test_check_symlink (subdir, "link.1", "/destination2"); #endif assert (rmdir (subdir) >= 0); free (subdir); } static void test_directory_exists (void) { p11_save_dir *dir; char *subdir; if (asprintf (&subdir, "%s/%s", test.directory, "extract-dir") < 0) assert_not_reached (); #ifdef OS_UNIX if (mkdir (subdir, S_IRWXU) < 0) #else if (mkdir (subdir) < 0) #endif assert_fail ("mkdir() failed", subdir); p11_message_quiet (); dir = p11_save_open_directory (subdir, 0); assert_ptr_eq (NULL, dir); p11_message_loud (); rmdir (subdir); free (subdir); } static void test_directory_overwrite (void) { char *path; char *check; p11_save_file *file; p11_save_dir *dir; char *subdir; bool ret; if (asprintf (&subdir, "%s/%s", test.directory, "extract-dir") < 0) assert_not_reached (); /* Some initial files into this directory, which get overwritten */ dir = p11_save_open_directory (subdir, 0); ret = p11_save_write_and_finish (p11_save_open_file_in (dir, "file", ".txt"), "", 0) && p11_save_write_and_finish (p11_save_open_file_in (dir, "another-file", NULL), "", 0) && p11_save_write_and_finish (p11_save_open_file_in (dir, "third-file", NULL), "", 0) && p11_save_finish_directory (dir, true); assert (ret && dir); /* Now the actual test, using the same directory */ dir = p11_save_open_directory (subdir, P11_SAVE_OVERWRITE); assert_ptr_not_null (dir); file = p11_save_open_file_in (dir, "blah", ".cer"); assert_ptr_not_null (file); ret = p11_save_write (file, test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); assert_num_eq (true, ret); ret = p11_save_finish_file (file, &path, true); assert_num_eq (true, ret); if (asprintf (&check, "%s/%s", subdir, "blah.cer") < 0) assert_not_reached (); assert_str_eq (check, path); free (check); free (path); file = p11_save_open_file_in (dir, "file", ".txt"); assert_ptr_not_null (file); ret = p11_save_write (file, test_text, strlen (test_text)); assert_num_eq (true, ret); ret = p11_save_finish_file (file, &path, true); assert_num_eq (true, ret); if (asprintf (&check, "%s/%s", subdir, "file.txt") < 0) assert_not_reached (); assert_str_eq (check, path); free (check); free (path); file = p11_save_open_file_in (dir, "file", ".txt"); assert_ptr_not_null (file); ret = p11_save_write (file, test_text, 10); assert_num_eq (true, ret); ret = p11_save_finish_file (file, &path, true); assert_num_eq (true, ret); if (asprintf (&check, "%s/%s", subdir, "file.1.txt") < 0) assert_not_reached (); assert_str_eq (check, path); free (check); free (path); ret = p11_save_finish_directory (dir, true); assert_num_eq (true, ret); test_check_directory (subdir, ("blah.cer", "file.txt", "file.1.txt", NULL)); test_check_data (subdir, "blah.cer", test_cacert3_ca_der, sizeof (test_cacert3_ca_der)); test_check_data (subdir, "file.txt", test_text, strlen (test_text)); test_check_data (subdir, "file.1.txt", test_text, 10); assert (rmdir (subdir) >= 0); free (subdir); } int main (int argc, char *argv[]) { p11_fixture (setup, teardown); p11_test (test_file_write, "/save/test_file_write"); p11_test (test_file_exists, "/save/test_file_exists"); p11_test (test_file_bad_directory, "/save/test_file_bad_directory"); p11_test (test_file_overwrite, "/save/test_file_overwrite"); p11_test (test_file_unique, "/save/file-unique"); p11_test (test_file_auto_empty, "/save/test_file_auto_empty"); p11_test (test_file_auto_length, "/save/test_file_auto_length"); p11_fixture (NULL, NULL); p11_test (test_write_with_null, "/save/test_write_with_null"); p11_test (test_write_and_finish_with_null, "/save/test_write_and_finish_with_null"); p11_fixture (setup, teardown); p11_test (test_file_abort, "/save/test_file_abort"); p11_test (test_directory_empty, "/save/test_directory_empty"); p11_test (test_directory_files, "/save/test_directory_files"); p11_test (test_directory_dups, "/save/test_directory_dups"); p11_test (test_directory_exists, "/save/test_directory_exists"); p11_test (test_directory_overwrite, "/save/test_directory_overwrite"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/Makefile.in0000664000175000017500000016213612265245665014322 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/build/Makefile.tests $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/test-extract.in \ $(top_srcdir)/build/aux/depcomp noinst_PROGRAMS = frob-pow$(EXEEXT) frob-token$(EXEEXT) \ frob-nss-trust$(EXEEXT) frob-cert$(EXEEXT) frob-bc$(EXEEXT) \ frob-ku$(EXEEXT) frob-eku$(EXEEXT) frob-ext$(EXEEXT) \ frob-cert$(EXEEXT) frob-oid$(EXEEXT) $(am__EXEEXT_2) TESTS = $(am__EXEEXT_2) subdir = trust/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/gettext.m4 \ $(top_srcdir)/build/m4/iconv.m4 \ $(top_srcdir)/build/m4/lib-ld.m4 \ $(top_srcdir)/build/m4/lib-link.m4 \ $(top_srcdir)/build/m4/lib-prefix.m4 \ $(top_srcdir)/build/m4/libtool.m4 \ $(top_srcdir)/build/m4/ltoptions.m4 \ $(top_srcdir)/build/m4/ltsugar.m4 \ $(top_srcdir)/build/m4/ltversion.m4 \ $(top_srcdir)/build/m4/lt~obsolete.m4 \ $(top_srcdir)/build/m4/nls.m4 $(top_srcdir)/build/m4/po.m4 \ $(top_srcdir)/build/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = test-extract CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libtrust_test_la_LIBADD = am_libtrust_test_la_OBJECTS = test-trust.lo digest.lo libtrust_test_la_OBJECTS = $(am_libtrust_test_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__EXEEXT_1 = am__EXEEXT_2 = test-digest$(EXEEXT) test-asn1$(EXEEXT) \ test-base64$(EXEEXT) test-pem$(EXEEXT) test-oid$(EXEEXT) \ test-utf8$(EXEEXT) test-x509$(EXEEXT) test-persist$(EXEEXT) \ test-index$(EXEEXT) test-parser$(EXEEXT) test-builder$(EXEEXT) \ test-token$(EXEEXT) test-module$(EXEEXT) test-save$(EXEEXT) \ test-enumerate$(EXEEXT) test-cer$(EXEEXT) test-bundle$(EXEEXT) \ test-openssl$(EXEEXT) $(am__EXEEXT_1) PROGRAMS = $(noinst_PROGRAMS) frob_bc_SOURCES = frob-bc.c frob_bc_OBJECTS = frob-bc.$(OBJEXT) frob_bc_LDADD = $(LDADD) am__DEPENDENCIES_1 = frob_bc_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) frob_cert_SOURCES = frob-cert.c frob_cert_OBJECTS = frob-cert.$(OBJEXT) frob_cert_LDADD = $(LDADD) frob_cert_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) frob_eku_SOURCES = frob-eku.c frob_eku_OBJECTS = frob-eku.$(OBJEXT) frob_eku_LDADD = $(LDADD) frob_eku_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) frob_ext_SOURCES = frob-ext.c frob_ext_OBJECTS = frob-ext.$(OBJEXT) frob_ext_LDADD = $(LDADD) frob_ext_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) frob_ku_SOURCES = frob-ku.c frob_ku_OBJECTS = frob-ku.$(OBJEXT) frob_ku_LDADD = $(LDADD) frob_ku_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) frob_nss_trust_SOURCES = frob-nss-trust.c frob_nss_trust_OBJECTS = frob-nss-trust.$(OBJEXT) frob_nss_trust_DEPENDENCIES = $(top_builddir)/common/libp11-common.la \ $(top_builddir)/p11-kit/libp11-kit.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) frob_oid_SOURCES = frob-oid.c frob_oid_OBJECTS = frob-oid.$(OBJEXT) frob_oid_LDADD = $(LDADD) frob_oid_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) frob_pow_SOURCES = frob-pow.c frob_pow_OBJECTS = frob-pow.$(OBJEXT) frob_pow_LDADD = $(LDADD) frob_pow_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) frob_token_SOURCES = frob-token.c frob_token_OBJECTS = frob-token.$(OBJEXT) frob_token_LDADD = $(LDADD) frob_token_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_asn1_SOURCES = test-asn1.c test_asn1_OBJECTS = test-asn1.$(OBJEXT) test_asn1_LDADD = $(LDADD) test_asn1_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_base64_SOURCES = test-base64.c test_base64_OBJECTS = test-base64.$(OBJEXT) test_base64_LDADD = $(LDADD) test_base64_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_builder_SOURCES = test-builder.c test_builder_OBJECTS = test-builder.$(OBJEXT) test_builder_LDADD = $(LDADD) test_builder_DEPENDENCIES = \ $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__objects_1 = am_test_bundle_OBJECTS = test-bundle.$(OBJEXT) enumerate.$(OBJEXT) \ extract-pem.$(OBJEXT) save.$(OBJEXT) $(am__objects_1) test_bundle_OBJECTS = $(am_test_bundle_OBJECTS) test_bundle_LDADD = $(LDADD) test_bundle_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_cer_OBJECTS = test-cer.$(OBJEXT) enumerate.$(OBJEXT) \ extract-cer.$(OBJEXT) save.$(OBJEXT) $(am__objects_1) test_cer_OBJECTS = $(am_test_cer_OBJECTS) test_cer_LDADD = $(LDADD) test_cer_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_digest_SOURCES = test-digest.c test_digest_OBJECTS = test-digest.$(OBJEXT) test_digest_LDADD = $(LDADD) test_digest_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_enumerate_OBJECTS = test-enumerate.$(OBJEXT) \ enumerate.$(OBJEXT) $(am__objects_1) test_enumerate_OBJECTS = $(am_test_enumerate_OBJECTS) test_enumerate_LDADD = $(LDADD) test_enumerate_DEPENDENCIES = \ $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_index_SOURCES = test-index.c test_index_OBJECTS = test-index.$(OBJEXT) test_index_LDADD = $(LDADD) test_index_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_module_SOURCES = test-module.c test_module_OBJECTS = test-module.$(OBJEXT) test_module_LDADD = $(LDADD) test_module_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_oid_SOURCES = test-oid.c test_oid_OBJECTS = test-oid.$(OBJEXT) test_oid_LDADD = $(LDADD) test_oid_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_openssl_OBJECTS = test-openssl.$(OBJEXT) enumerate.$(OBJEXT) \ extract-openssl.$(OBJEXT) save.$(OBJEXT) $(am__objects_1) test_openssl_OBJECTS = $(am_test_openssl_OBJECTS) test_openssl_LDADD = $(LDADD) test_openssl_DEPENDENCIES = \ $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_parser_SOURCES = test-parser.c test_parser_OBJECTS = test-parser.$(OBJEXT) test_parser_LDADD = $(LDADD) test_parser_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_pem_SOURCES = test-pem.c test_pem_OBJECTS = test-pem.$(OBJEXT) test_pem_LDADD = $(LDADD) test_pem_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_persist_SOURCES = test-persist.c test_persist_OBJECTS = test-persist.$(OBJEXT) test_persist_LDADD = $(LDADD) test_persist_DEPENDENCIES = \ $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_save_OBJECTS = test-save.$(OBJEXT) save.$(OBJEXT) \ $(am__objects_1) test_save_OBJECTS = $(am_test_save_OBJECTS) test_save_LDADD = $(LDADD) test_save_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_token_SOURCES = test-token.c test_token_OBJECTS = test-token.$(OBJEXT) test_token_LDADD = $(LDADD) test_token_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_utf8_SOURCES = test-utf8.c test_utf8_OBJECTS = test-utf8.$(OBJEXT) test_utf8_LDADD = $(LDADD) test_utf8_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_x509_SOURCES = test-x509.c test_x509_OBJECTS = test-x509.$(OBJEXT) test_x509_LDADD = $(LDADD) test_x509_DEPENDENCIES = $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) SCRIPTS = $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtrust_test_la_SOURCES) frob-bc.c frob-cert.c frob-eku.c \ frob-ext.c frob-ku.c frob-nss-trust.c frob-oid.c frob-pow.c \ frob-token.c test-asn1.c test-base64.c test-builder.c \ $(test_bundle_SOURCES) $(test_cer_SOURCES) test-digest.c \ $(test_enumerate_SOURCES) test-index.c test-module.c \ test-oid.c $(test_openssl_SOURCES) test-parser.c test-pem.c \ test-persist.c $(test_save_SOURCES) test-token.c test-utf8.c \ test-x509.c DIST_SOURCES = $(libtrust_test_la_SOURCES) frob-bc.c frob-cert.c \ frob-eku.c frob-ext.c frob-ku.c frob-nss-trust.c frob-oid.c \ frob-pow.c frob-token.c test-asn1.c test-base64.c \ test-builder.c $(test_bundle_SOURCES) $(test_cer_SOURCES) \ test-digest.c $(test_enumerate_SOURCES) test-index.c \ test-module.c test-oid.c $(test_openssl_SOURCES) test-parser.c \ test-pem.c test-persist.c $(test_save_SOURCES) test-token.c \ test-utf8.c test-x509.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTKDOC_SCAN = @GTKDOC_SCAN@ HASH_LIBS = @HASH_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_CFLAGS = @LIBFFI_CFLAGS@ LIBFFI_LIBS = @LIBFFI_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTASN1_CFLAGS = @LIBTASN1_CFLAGS@ LIBTASN1_LIBS = @LIBTASN1_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P11KIT_LT_RELEASE = @P11KIT_LT_RELEASE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLEXT = @SHLEXT@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ p11_module_path = @p11_module_path@ p11_package_config_modules = @p11_package_config_modules@ p11_system_config = @p11_system_config@ p11_system_config_file = @p11_system_config_file@ p11_system_config_modules = @p11_system_config_modules@ p11_user_config = @p11_user_config@ p11_user_config_file = @p11_user_config_file@ p11_user_config_modules = @p11_user_config_modules@ pdfdir = @pdfdir@ prefix = @prefix@ privatedir = @privatedir@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_trust_paths = @with_trust_paths@ NULL = TEST_CFLAGS = \ -DSRCDIR=\"$(abs_srcdir)\" \ -DBUILDDIR=\"$(abs_builddir)\" \ -DP11_KIT_FUTURE_UNSTABLE_API MEMCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=80 --quiet LEAKCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=81 --quiet --leak-check=yes HELLCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=82 --quiet --tool=helgrind COMMON = $(top_srcdir)/common TRUST = $(top_srcdir)/trust AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(srcdir)/.. \ -I$(top_srcdir)/p11-kit \ -I$(COMMON) \ -DDATADIR=\"$(datadir)\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -DP11_KIT_FUTURE_UNSTABLE_API \ $(LIBTASN1_CFLAGS) \ $(TEST_CFLAGS) \ $(NULL) noinst_LTLIBRARIES = \ libtrust-test.la libtrust_test_la_SOURCES = \ test-trust.c test-trust.h \ $(TRUST)/digest.c LDADD = \ $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la \ $(LIBTASN1_LIBS) \ $(HASH_LIBS) \ $(NULL) CHECK_PROGS = \ test-digest \ test-asn1 \ test-base64 \ test-pem \ test-oid \ test-utf8 \ test-x509 \ test-persist \ test-index \ test-parser \ test-builder \ test-token \ test-module \ test-save \ test-enumerate \ test-cer \ test-bundle \ test-openssl \ $(NULL) frob_nss_trust_LDADD = \ $(top_builddir)/common/libp11-common.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(HASH_LIBS) \ $(NULL) EXTRA_DIST = \ input \ files \ $(NULL) TEST_RUNNER = libtool --mode=execute test_save_SOURCES = \ test-save.c \ $(TRUST)/save.c \ $(NULL) test_enumerate_SOURCES = \ test-enumerate.c \ $(TRUST)/enumerate.c \ $(NULL) test_cer_SOURCES = \ test-cer.c \ $(TRUST)/enumerate.c \ $(TRUST)/extract-cer.c \ $(TRUST)/save.c \ $(NULL) test_bundle_SOURCES = \ test-bundle.c \ $(TRUST)/enumerate.c \ $(TRUST)/extract-pem.c \ $(TRUST)/save.c \ $(NULL) test_openssl_SOURCES = \ test-openssl.c \ $(TRUST)/enumerate.c \ $(TRUST)/extract-openssl.c \ $(TRUST)/save.c \ $(NULL) noinst_SCRIPTS = \ test-extract all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/build/Makefile.tests $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign trust/tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign trust/tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/build/Makefile.tests: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): test-extract: $(top_builddir)/config.status $(srcdir)/test-extract.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libtrust-test.la: $(libtrust_test_la_OBJECTS) $(libtrust_test_la_DEPENDENCIES) $(EXTRA_libtrust_test_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libtrust_test_la_OBJECTS) $(libtrust_test_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list frob-bc$(EXEEXT): $(frob_bc_OBJECTS) $(frob_bc_DEPENDENCIES) $(EXTRA_frob_bc_DEPENDENCIES) @rm -f frob-bc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(frob_bc_OBJECTS) $(frob_bc_LDADD) $(LIBS) frob-cert$(EXEEXT): $(frob_cert_OBJECTS) $(frob_cert_DEPENDENCIES) $(EXTRA_frob_cert_DEPENDENCIES) @rm -f frob-cert$(EXEEXT) $(AM_V_CCLD)$(LINK) $(frob_cert_OBJECTS) $(frob_cert_LDADD) $(LIBS) frob-eku$(EXEEXT): $(frob_eku_OBJECTS) $(frob_eku_DEPENDENCIES) $(EXTRA_frob_eku_DEPENDENCIES) @rm -f frob-eku$(EXEEXT) $(AM_V_CCLD)$(LINK) $(frob_eku_OBJECTS) $(frob_eku_LDADD) $(LIBS) frob-ext$(EXEEXT): $(frob_ext_OBJECTS) $(frob_ext_DEPENDENCIES) $(EXTRA_frob_ext_DEPENDENCIES) @rm -f frob-ext$(EXEEXT) $(AM_V_CCLD)$(LINK) $(frob_ext_OBJECTS) $(frob_ext_LDADD) $(LIBS) frob-ku$(EXEEXT): $(frob_ku_OBJECTS) $(frob_ku_DEPENDENCIES) $(EXTRA_frob_ku_DEPENDENCIES) @rm -f frob-ku$(EXEEXT) $(AM_V_CCLD)$(LINK) $(frob_ku_OBJECTS) $(frob_ku_LDADD) $(LIBS) frob-nss-trust$(EXEEXT): $(frob_nss_trust_OBJECTS) $(frob_nss_trust_DEPENDENCIES) $(EXTRA_frob_nss_trust_DEPENDENCIES) @rm -f frob-nss-trust$(EXEEXT) $(AM_V_CCLD)$(LINK) $(frob_nss_trust_OBJECTS) $(frob_nss_trust_LDADD) $(LIBS) frob-oid$(EXEEXT): $(frob_oid_OBJECTS) $(frob_oid_DEPENDENCIES) $(EXTRA_frob_oid_DEPENDENCIES) @rm -f frob-oid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(frob_oid_OBJECTS) $(frob_oid_LDADD) $(LIBS) frob-pow$(EXEEXT): $(frob_pow_OBJECTS) $(frob_pow_DEPENDENCIES) $(EXTRA_frob_pow_DEPENDENCIES) @rm -f frob-pow$(EXEEXT) $(AM_V_CCLD)$(LINK) $(frob_pow_OBJECTS) $(frob_pow_LDADD) $(LIBS) frob-token$(EXEEXT): $(frob_token_OBJECTS) $(frob_token_DEPENDENCIES) $(EXTRA_frob_token_DEPENDENCIES) @rm -f frob-token$(EXEEXT) $(AM_V_CCLD)$(LINK) $(frob_token_OBJECTS) $(frob_token_LDADD) $(LIBS) test-asn1$(EXEEXT): $(test_asn1_OBJECTS) $(test_asn1_DEPENDENCIES) $(EXTRA_test_asn1_DEPENDENCIES) @rm -f test-asn1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_asn1_OBJECTS) $(test_asn1_LDADD) $(LIBS) test-base64$(EXEEXT): $(test_base64_OBJECTS) $(test_base64_DEPENDENCIES) $(EXTRA_test_base64_DEPENDENCIES) @rm -f test-base64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_base64_OBJECTS) $(test_base64_LDADD) $(LIBS) test-builder$(EXEEXT): $(test_builder_OBJECTS) $(test_builder_DEPENDENCIES) $(EXTRA_test_builder_DEPENDENCIES) @rm -f test-builder$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_builder_OBJECTS) $(test_builder_LDADD) $(LIBS) test-bundle$(EXEEXT): $(test_bundle_OBJECTS) $(test_bundle_DEPENDENCIES) $(EXTRA_test_bundle_DEPENDENCIES) @rm -f test-bundle$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_bundle_OBJECTS) $(test_bundle_LDADD) $(LIBS) test-cer$(EXEEXT): $(test_cer_OBJECTS) $(test_cer_DEPENDENCIES) $(EXTRA_test_cer_DEPENDENCIES) @rm -f test-cer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_cer_OBJECTS) $(test_cer_LDADD) $(LIBS) test-digest$(EXEEXT): $(test_digest_OBJECTS) $(test_digest_DEPENDENCIES) $(EXTRA_test_digest_DEPENDENCIES) @rm -f test-digest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_digest_OBJECTS) $(test_digest_LDADD) $(LIBS) test-enumerate$(EXEEXT): $(test_enumerate_OBJECTS) $(test_enumerate_DEPENDENCIES) $(EXTRA_test_enumerate_DEPENDENCIES) @rm -f test-enumerate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_enumerate_OBJECTS) $(test_enumerate_LDADD) $(LIBS) test-index$(EXEEXT): $(test_index_OBJECTS) $(test_index_DEPENDENCIES) $(EXTRA_test_index_DEPENDENCIES) @rm -f test-index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_index_OBJECTS) $(test_index_LDADD) $(LIBS) test-module$(EXEEXT): $(test_module_OBJECTS) $(test_module_DEPENDENCIES) $(EXTRA_test_module_DEPENDENCIES) @rm -f test-module$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_module_OBJECTS) $(test_module_LDADD) $(LIBS) test-oid$(EXEEXT): $(test_oid_OBJECTS) $(test_oid_DEPENDENCIES) $(EXTRA_test_oid_DEPENDENCIES) @rm -f test-oid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_oid_OBJECTS) $(test_oid_LDADD) $(LIBS) test-openssl$(EXEEXT): $(test_openssl_OBJECTS) $(test_openssl_DEPENDENCIES) $(EXTRA_test_openssl_DEPENDENCIES) @rm -f test-openssl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_openssl_OBJECTS) $(test_openssl_LDADD) $(LIBS) test-parser$(EXEEXT): $(test_parser_OBJECTS) $(test_parser_DEPENDENCIES) $(EXTRA_test_parser_DEPENDENCIES) @rm -f test-parser$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_parser_OBJECTS) $(test_parser_LDADD) $(LIBS) test-pem$(EXEEXT): $(test_pem_OBJECTS) $(test_pem_DEPENDENCIES) $(EXTRA_test_pem_DEPENDENCIES) @rm -f test-pem$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_pem_OBJECTS) $(test_pem_LDADD) $(LIBS) test-persist$(EXEEXT): $(test_persist_OBJECTS) $(test_persist_DEPENDENCIES) $(EXTRA_test_persist_DEPENDENCIES) @rm -f test-persist$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_persist_OBJECTS) $(test_persist_LDADD) $(LIBS) test-save$(EXEEXT): $(test_save_OBJECTS) $(test_save_DEPENDENCIES) $(EXTRA_test_save_DEPENDENCIES) @rm -f test-save$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_save_OBJECTS) $(test_save_LDADD) $(LIBS) test-token$(EXEEXT): $(test_token_OBJECTS) $(test_token_DEPENDENCIES) $(EXTRA_test_token_DEPENDENCIES) @rm -f test-token$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_token_OBJECTS) $(test_token_LDADD) $(LIBS) test-utf8$(EXEEXT): $(test_utf8_OBJECTS) $(test_utf8_DEPENDENCIES) $(EXTRA_test_utf8_DEPENDENCIES) @rm -f test-utf8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_utf8_OBJECTS) $(test_utf8_LDADD) $(LIBS) test-x509$(EXEEXT): $(test_x509_OBJECTS) $(test_x509_DEPENDENCIES) $(EXTRA_test_x509_DEPENDENCIES) @rm -f test-x509$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_x509_OBJECTS) $(test_x509_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/digest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enumerate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract-cer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract-openssl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract-pem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob-bc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob-cert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob-eku.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob-ext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob-ku.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob-nss-trust.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob-oid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob-pow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob-token.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/save.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-asn1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-builder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-bundle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-digest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-enumerate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-module.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-oid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-openssl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-persist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-save.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-token.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-trust.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-utf8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-x509.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< digest.lo: $(TRUST)/digest.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT digest.lo -MD -MP -MF $(DEPDIR)/digest.Tpo -c -o digest.lo `test -f '$(TRUST)/digest.c' || echo '$(srcdir)/'`$(TRUST)/digest.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/digest.Tpo $(DEPDIR)/digest.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(TRUST)/digest.c' object='digest.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o digest.lo `test -f '$(TRUST)/digest.c' || echo '$(srcdir)/'`$(TRUST)/digest.c enumerate.o: $(TRUST)/enumerate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enumerate.o -MD -MP -MF $(DEPDIR)/enumerate.Tpo -c -o enumerate.o `test -f '$(TRUST)/enumerate.c' || echo '$(srcdir)/'`$(TRUST)/enumerate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enumerate.Tpo $(DEPDIR)/enumerate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(TRUST)/enumerate.c' object='enumerate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enumerate.o `test -f '$(TRUST)/enumerate.c' || echo '$(srcdir)/'`$(TRUST)/enumerate.c enumerate.obj: $(TRUST)/enumerate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT enumerate.obj -MD -MP -MF $(DEPDIR)/enumerate.Tpo -c -o enumerate.obj `if test -f '$(TRUST)/enumerate.c'; then $(CYGPATH_W) '$(TRUST)/enumerate.c'; else $(CYGPATH_W) '$(srcdir)/$(TRUST)/enumerate.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enumerate.Tpo $(DEPDIR)/enumerate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(TRUST)/enumerate.c' object='enumerate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o enumerate.obj `if test -f '$(TRUST)/enumerate.c'; then $(CYGPATH_W) '$(TRUST)/enumerate.c'; else $(CYGPATH_W) '$(srcdir)/$(TRUST)/enumerate.c'; fi` extract-pem.o: $(TRUST)/extract-pem.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extract-pem.o -MD -MP -MF $(DEPDIR)/extract-pem.Tpo -c -o extract-pem.o `test -f '$(TRUST)/extract-pem.c' || echo '$(srcdir)/'`$(TRUST)/extract-pem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract-pem.Tpo $(DEPDIR)/extract-pem.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(TRUST)/extract-pem.c' object='extract-pem.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extract-pem.o `test -f '$(TRUST)/extract-pem.c' || echo '$(srcdir)/'`$(TRUST)/extract-pem.c extract-pem.obj: $(TRUST)/extract-pem.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extract-pem.obj -MD -MP -MF $(DEPDIR)/extract-pem.Tpo -c -o extract-pem.obj `if test -f '$(TRUST)/extract-pem.c'; then $(CYGPATH_W) '$(TRUST)/extract-pem.c'; else $(CYGPATH_W) '$(srcdir)/$(TRUST)/extract-pem.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract-pem.Tpo $(DEPDIR)/extract-pem.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(TRUST)/extract-pem.c' object='extract-pem.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extract-pem.obj `if test -f '$(TRUST)/extract-pem.c'; then $(CYGPATH_W) '$(TRUST)/extract-pem.c'; else $(CYGPATH_W) '$(srcdir)/$(TRUST)/extract-pem.c'; fi` save.o: $(TRUST)/save.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT save.o -MD -MP -MF $(DEPDIR)/save.Tpo -c -o save.o `test -f '$(TRUST)/save.c' || echo '$(srcdir)/'`$(TRUST)/save.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/save.Tpo $(DEPDIR)/save.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(TRUST)/save.c' object='save.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o save.o `test -f '$(TRUST)/save.c' || echo '$(srcdir)/'`$(TRUST)/save.c save.obj: $(TRUST)/save.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT save.obj -MD -MP -MF $(DEPDIR)/save.Tpo -c -o save.obj `if test -f '$(TRUST)/save.c'; then $(CYGPATH_W) '$(TRUST)/save.c'; else $(CYGPATH_W) '$(srcdir)/$(TRUST)/save.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/save.Tpo $(DEPDIR)/save.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(TRUST)/save.c' object='save.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o save.obj `if test -f '$(TRUST)/save.c'; then $(CYGPATH_W) '$(TRUST)/save.c'; else $(CYGPATH_W) '$(srcdir)/$(TRUST)/save.c'; fi` extract-cer.o: $(TRUST)/extract-cer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extract-cer.o -MD -MP -MF $(DEPDIR)/extract-cer.Tpo -c -o extract-cer.o `test -f '$(TRUST)/extract-cer.c' || echo '$(srcdir)/'`$(TRUST)/extract-cer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract-cer.Tpo $(DEPDIR)/extract-cer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(TRUST)/extract-cer.c' object='extract-cer.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extract-cer.o `test -f '$(TRUST)/extract-cer.c' || echo '$(srcdir)/'`$(TRUST)/extract-cer.c extract-cer.obj: $(TRUST)/extract-cer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extract-cer.obj -MD -MP -MF $(DEPDIR)/extract-cer.Tpo -c -o extract-cer.obj `if test -f '$(TRUST)/extract-cer.c'; then $(CYGPATH_W) '$(TRUST)/extract-cer.c'; else $(CYGPATH_W) '$(srcdir)/$(TRUST)/extract-cer.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract-cer.Tpo $(DEPDIR)/extract-cer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(TRUST)/extract-cer.c' object='extract-cer.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extract-cer.obj `if test -f '$(TRUST)/extract-cer.c'; then $(CYGPATH_W) '$(TRUST)/extract-cer.c'; else $(CYGPATH_W) '$(srcdir)/$(TRUST)/extract-cer.c'; fi` extract-openssl.o: $(TRUST)/extract-openssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extract-openssl.o -MD -MP -MF $(DEPDIR)/extract-openssl.Tpo -c -o extract-openssl.o `test -f '$(TRUST)/extract-openssl.c' || echo '$(srcdir)/'`$(TRUST)/extract-openssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract-openssl.Tpo $(DEPDIR)/extract-openssl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(TRUST)/extract-openssl.c' object='extract-openssl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extract-openssl.o `test -f '$(TRUST)/extract-openssl.c' || echo '$(srcdir)/'`$(TRUST)/extract-openssl.c extract-openssl.obj: $(TRUST)/extract-openssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT extract-openssl.obj -MD -MP -MF $(DEPDIR)/extract-openssl.Tpo -c -o extract-openssl.obj `if test -f '$(TRUST)/extract-openssl.c'; then $(CYGPATH_W) '$(TRUST)/extract-openssl.c'; else $(CYGPATH_W) '$(srcdir)/$(TRUST)/extract-openssl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/extract-openssl.Tpo $(DEPDIR)/extract-openssl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(TRUST)/extract-openssl.c' object='extract-openssl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o extract-openssl.obj `if test -f '$(TRUST)/extract-openssl.c'; then $(CYGPATH_W) '$(TRUST)/extract-openssl.c'; else $(CYGPATH_W) '$(srcdir)/$(TRUST)/extract-openssl.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: installcheck-local maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installcheck-local \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am memcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(MEMCHECK_ENV)" check-TESTS leakcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(LEAKCHECK_ENV)" check-TESTS hellcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(HELLCHECK_ENV)" check-TESTS installcheck-local: sh $(builddir)/test-extract # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: p11-kit-0.20.2/trust/tests/test-x509.c0000664000175000017500000004701312226763526014075 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "asn1.h" #include "debug.h" #include "oid.h" #include "x509.h" #include #include #include #define ELEMS(x) (sizeof (x) / sizeof (x[0])) struct { p11_dict *asn1_defs; } test; static void setup (void *unused) { test.asn1_defs = p11_asn1_defs_load (); assert_ptr_not_null (test.asn1_defs); } static void teardown (void *unused) { p11_dict_free (test.asn1_defs); memset (&test, 0, sizeof (test)); } static const char test_ku_ds_and_np[] = { 0x03, 0x03, 0x07, 0xc0, 0x00, }; static const char test_ku_none[] = { 0x03, 0x03, 0x07, 0x00, 0x00, }; static const char test_ku_cert_crl_sign[] = { 0x03, 0x03, 0x07, 0x06, 0x00, }; static const char test_eku_server_and_client[] = { 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, }; static const char test_eku_none[] = { 0x30, 0x00, }; static const char test_eku_client_email_and_timestamp[] = { 0x30, 0x1e, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08, }; static const unsigned char test_cacert3_ca_der[] = { 0x30, 0x82, 0x07, 0x59, 0x30, 0x82, 0x05, 0x41, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x03, 0x0a, 0x41, 0x8a, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x79, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x07, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x15, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x31, 0x22, 0x30, 0x20, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x19, 0x43, 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x12, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x31, 0x30, 0x35, 0x32, 0x33, 0x31, 0x37, 0x34, 0x38, 0x30, 0x32, 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x35, 0x32, 0x30, 0x31, 0x37, 0x34, 0x38, 0x30, 0x32, 0x5a, 0x30, 0x54, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0b, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x15, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x13, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x82, 0x02, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x02, 0x0f, 0x00, 0x30, 0x82, 0x02, 0x0a, 0x02, 0x82, 0x02, 0x01, 0x00, 0xab, 0x49, 0x35, 0x11, 0x48, 0x7c, 0xd2, 0x26, 0x7e, 0x53, 0x94, 0xcf, 0x43, 0xa9, 0xdd, 0x28, 0xd7, 0x42, 0x2a, 0x8b, 0xf3, 0x87, 0x78, 0x19, 0x58, 0x7c, 0x0f, 0x9e, 0xda, 0x89, 0x7d, 0xe1, 0xfb, 0xeb, 0x72, 0x90, 0x0d, 0x74, 0xa1, 0x96, 0x64, 0xab, 0x9f, 0xa0, 0x24, 0x99, 0x73, 0xda, 0xe2, 0x55, 0x76, 0xc7, 0x17, 0x7b, 0xf5, 0x04, 0xac, 0x46, 0xb8, 0xc3, 0xbe, 0x7f, 0x64, 0x8d, 0x10, 0x6c, 0x24, 0xf3, 0x61, 0x9c, 0xc0, 0xf2, 0x90, 0xfa, 0x51, 0xe6, 0xf5, 0x69, 0x01, 0x63, 0xc3, 0x0f, 0x56, 0xe2, 0x4a, 0x42, 0xcf, 0xe2, 0x44, 0x8c, 0x25, 0x28, 0xa8, 0xc5, 0x79, 0x09, 0x7d, 0x46, 0xb9, 0x8a, 0xf3, 0xe9, 0xf3, 0x34, 0x29, 0x08, 0x45, 0xe4, 0x1c, 0x9f, 0xcb, 0x94, 0x04, 0x1c, 0x81, 0xa8, 0x14, 0xb3, 0x98, 0x65, 0xc4, 0x43, 0xec, 0x4e, 0x82, 0x8d, 0x09, 0xd1, 0xbd, 0xaa, 0x5b, 0x8d, 0x92, 0xd0, 0xec, 0xde, 0x90, 0xc5, 0x7f, 0x0a, 0xc2, 0xe3, 0xeb, 0xe6, 0x31, 0x5a, 0x5e, 0x74, 0x3e, 0x97, 0x33, 0x59, 0xe8, 0xc3, 0x03, 0x3d, 0x60, 0x33, 0xbf, 0xf7, 0xd1, 0x6f, 0x47, 0xc4, 0xcd, 0xee, 0x62, 0x83, 0x52, 0x6e, 0x2e, 0x08, 0x9a, 0xa4, 0xd9, 0x15, 0x18, 0x91, 0xa6, 0x85, 0x92, 0x47, 0xb0, 0xae, 0x48, 0xeb, 0x6d, 0xb7, 0x21, 0xec, 0x85, 0x1a, 0x68, 0x72, 0x35, 0xab, 0xff, 0xf0, 0x10, 0x5d, 0xc0, 0xf4, 0x94, 0xa7, 0x6a, 0xd5, 0x3b, 0x92, 0x7e, 0x4c, 0x90, 0x05, 0x7e, 0x93, 0xc1, 0x2c, 0x8b, 0xa4, 0x8e, 0x62, 0x74, 0x15, 0x71, 0x6e, 0x0b, 0x71, 0x03, 0xea, 0xaf, 0x15, 0x38, 0x9a, 0xd4, 0xd2, 0x05, 0x72, 0x6f, 0x8c, 0xf9, 0x2b, 0xeb, 0x5a, 0x72, 0x25, 0xf9, 0x39, 0x46, 0xe3, 0x72, 0x1b, 0x3e, 0x04, 0xc3, 0x64, 0x27, 0x22, 0x10, 0x2a, 0x8a, 0x4f, 0x58, 0xa7, 0x03, 0xad, 0xbe, 0xb4, 0x2e, 0x13, 0xed, 0x5d, 0xaa, 0x48, 0xd7, 0xd5, 0x7d, 0xd4, 0x2a, 0x7b, 0x5c, 0xfa, 0x46, 0x04, 0x50, 0xe4, 0xcc, 0x0e, 0x42, 0x5b, 0x8c, 0xed, 0xdb, 0xf2, 0xcf, 0xfc, 0x96, 0x93, 0xe0, 0xdb, 0x11, 0x36, 0x54, 0x62, 0x34, 0x38, 0x8f, 0x0c, 0x60, 0x9b, 0x3b, 0x97, 0x56, 0x38, 0xad, 0xf3, 0xd2, 0x5b, 0x8b, 0xa0, 0x5b, 0xea, 0x4e, 0x96, 0xb8, 0x7c, 0xd7, 0xd5, 0xa0, 0x86, 0x70, 0x40, 0xd3, 0x91, 0x29, 0xb7, 0xa2, 0x3c, 0xad, 0xf5, 0x8c, 0xbb, 0xcf, 0x1a, 0x92, 0x8a, 0xe4, 0x34, 0x7b, 0xc0, 0xd8, 0x6c, 0x5f, 0xe9, 0x0a, 0xc2, 0xc3, 0xa7, 0x20, 0x9a, 0x5a, 0xdf, 0x2c, 0x5d, 0x52, 0x5c, 0xba, 0x47, 0xd5, 0x9b, 0xef, 0x24, 0x28, 0x70, 0x38, 0x20, 0x2f, 0xd5, 0x7f, 0x29, 0xc0, 0xb2, 0x41, 0x03, 0x68, 0x92, 0xcc, 0xe0, 0x9c, 0xcc, 0x97, 0x4b, 0x45, 0xef, 0x3a, 0x10, 0x0a, 0xab, 0x70, 0x3a, 0x98, 0x95, 0x70, 0xad, 0x35, 0xb1, 0xea, 0x85, 0x2b, 0xa4, 0x1c, 0x80, 0x21, 0x31, 0xa9, 0xae, 0x60, 0x7a, 0x80, 0x26, 0x48, 0x00, 0xb8, 0x01, 0xc0, 0x93, 0x63, 0x55, 0x22, 0x91, 0x3c, 0x56, 0xe7, 0xaf, 0xdb, 0x3a, 0x25, 0xf3, 0x8f, 0x31, 0x54, 0xea, 0x26, 0x8b, 0x81, 0x59, 0xf9, 0xa1, 0xd1, 0x53, 0x11, 0xc5, 0x7b, 0x9d, 0x03, 0xf6, 0x74, 0x11, 0xe0, 0x6d, 0xb1, 0x2c, 0x3f, 0x2c, 0x86, 0x91, 0x99, 0x71, 0x9a, 0xa6, 0x77, 0x8b, 0x34, 0x60, 0xd1, 0x14, 0xb4, 0x2c, 0xac, 0x9d, 0xaf, 0x8c, 0x10, 0xd3, 0x9f, 0xc4, 0x6a, 0xf8, 0x6f, 0x13, 0xfc, 0x73, 0x59, 0xf7, 0x66, 0x42, 0x74, 0x1e, 0x8a, 0xe3, 0xf8, 0xdc, 0xd2, 0x6f, 0x98, 0x9c, 0xcb, 0x47, 0x98, 0x95, 0x40, 0x05, 0xfb, 0xe9, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x02, 0x0d, 0x30, 0x82, 0x02, 0x09, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x75, 0xa8, 0x71, 0x60, 0x4c, 0x88, 0x13, 0xf0, 0x78, 0xd9, 0x89, 0x77, 0xb5, 0x6d, 0xc5, 0x89, 0xdf, 0xbc, 0xb1, 0x7a, 0x30, 0x81, 0xa3, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x81, 0x9b, 0x30, 0x81, 0x98, 0x80, 0x14, 0x16, 0xb5, 0x32, 0x1b, 0xd4, 0xc7, 0xf3, 0xe0, 0xe6, 0x8e, 0xf3, 0xbd, 0xd2, 0xb0, 0x3a, 0xee, 0xb2, 0x39, 0x18, 0xd1, 0xa1, 0x7d, 0xa4, 0x7b, 0x30, 0x79, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x07, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x15, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x31, 0x22, 0x30, 0x20, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x19, 0x43, 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x12, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x82, 0x01, 0x00, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x5d, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x51, 0x30, 0x4f, 0x30, 0x23, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x17, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x30, 0x28, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x1c, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x63, 0x61, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x4a, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x43, 0x30, 0x41, 0x30, 0x3f, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x81, 0x90, 0x4a, 0x30, 0x33, 0x30, 0x31, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x25, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x70, 0x68, 0x70, 0x3f, 0x69, 0x64, 0x3d, 0x31, 0x30, 0x30, 0x34, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x08, 0x04, 0x27, 0x16, 0x25, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x70, 0x68, 0x70, 0x3f, 0x69, 0x64, 0x3d, 0x31, 0x30, 0x30, 0x50, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0d, 0x04, 0x43, 0x16, 0x41, 0x54, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x77, 0x6e, 0x20, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x46, 0x52, 0x45, 0x45, 0x2c, 0x20, 0x67, 0x6f, 0x20, 0x74, 0x6f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x02, 0x01, 0x00, 0x29, 0x28, 0x85, 0xae, 0x44, 0xa9, 0xb9, 0xaf, 0xa4, 0x79, 0x13, 0xf0, 0xa8, 0xa3, 0x2b, 0x97, 0x60, 0xf3, 0x5c, 0xee, 0xe3, 0x2f, 0xc1, 0xf6, 0xe2, 0x66, 0xa0, 0x11, 0xae, 0x36, 0x37, 0x3a, 0x76, 0x15, 0x04, 0x53, 0xea, 0x42, 0xf5, 0xf9, 0xea, 0xc0, 0x15, 0xd8, 0xa6, 0x82, 0xd9, 0xe4, 0x61, 0xae, 0x72, 0x0b, 0x29, 0x5c, 0x90, 0x43, 0xe8, 0x41, 0xb2, 0xe1, 0x77, 0xdb, 0x02, 0x13, 0x44, 0x78, 0x47, 0x55, 0xaf, 0x58, 0xfc, 0xcc, 0x98, 0xf6, 0x45, 0xb9, 0xd1, 0x20, 0xf8, 0xd8, 0x21, 0x07, 0xfe, 0x6d, 0xaa, 0x73, 0xd4, 0xb3, 0xc6, 0x07, 0xe9, 0x09, 0x85, 0xcc, 0x3b, 0xf2, 0xb6, 0xbe, 0x2c, 0x1c, 0x25, 0xd5, 0x71, 0x8c, 0x39, 0xb5, 0x2e, 0xea, 0xbe, 0x18, 0x81, 0xba, 0xb0, 0x93, 0xb8, 0x0f, 0xe3, 0xe6, 0xd7, 0x26, 0x8c, 0x31, 0x5a, 0x72, 0x03, 0x84, 0x52, 0xe6, 0xa6, 0xf5, 0x33, 0x22, 0x45, 0x0a, 0xc8, 0x0b, 0x0d, 0x8a, 0xb8, 0x36, 0x6f, 0x90, 0x09, 0xa1, 0xab, 0xbd, 0xd7, 0xd5, 0x4e, 0x2e, 0x71, 0xa2, 0xd4, 0xae, 0xfa, 0xa7, 0x54, 0x2b, 0xeb, 0x35, 0x8d, 0x5a, 0xb7, 0x54, 0x88, 0x2f, 0xee, 0x74, 0x9f, 0xed, 0x48, 0x16, 0xca, 0x0d, 0x48, 0xd0, 0x94, 0xd3, 0xac, 0xa4, 0xa2, 0xf6, 0x24, 0xdf, 0x92, 0xe3, 0xbd, 0xeb, 0x43, 0x40, 0x91, 0x6e, 0x1c, 0x18, 0x8e, 0x56, 0xb4, 0x82, 0x12, 0xf3, 0xa9, 0x93, 0x9f, 0xd4, 0xbc, 0x9c, 0xad, 0x9c, 0x75, 0xee, 0x5a, 0x97, 0x1b, 0x95, 0xe7, 0x74, 0x2d, 0x1c, 0x0f, 0xb0, 0x2c, 0x97, 0x9f, 0xfb, 0xa9, 0x33, 0x39, 0x7a, 0xe7, 0x03, 0x3a, 0x92, 0x8e, 0x22, 0xf6, 0x8c, 0x0d, 0xe4, 0xd9, 0x7e, 0x0d, 0x76, 0x18, 0xf7, 0x01, 0xf9, 0xef, 0x96, 0x96, 0xa2, 0x55, 0x73, 0xc0, 0x3c, 0x71, 0xb4, 0x1d, 0x1a, 0x56, 0x43, 0xb7, 0xc3, 0x0a, 0x8d, 0x72, 0xfc, 0xe2, 0x10, 0x09, 0x0b, 0x41, 0xce, 0x8c, 0x94, 0xa0, 0xf9, 0x03, 0xfd, 0x71, 0x73, 0x4b, 0x8a, 0x57, 0x33, 0xe5, 0x8e, 0x74, 0x7e, 0x15, 0x01, 0x00, 0xe6, 0xcc, 0x4a, 0x1c, 0xe7, 0x7f, 0x95, 0x19, 0x2d, 0xc5, 0xa5, 0x0c, 0x8b, 0xbb, 0xb5, 0xed, 0x85, 0xb3, 0x5c, 0xd3, 0xdf, 0xb8, 0xb9, 0xf2, 0xca, 0xc7, 0x0d, 0x01, 0x14, 0xac, 0x70, 0x58, 0xc5, 0x8c, 0x8d, 0x33, 0xd4, 0x9d, 0x66, 0xa3, 0x1a, 0x50, 0x95, 0x23, 0xfc, 0x48, 0xe0, 0x06, 0x43, 0x12, 0xd9, 0xcd, 0xa7, 0x86, 0x39, 0x2f, 0x36, 0x72, 0xa3, 0x80, 0x10, 0xe4, 0xe1, 0xf3, 0xd1, 0xcb, 0x5b, 0x1a, 0xc0, 0xe4, 0x80, 0x9a, 0x7c, 0x13, 0x73, 0x06, 0x4f, 0xdb, 0xa3, 0x6b, 0x24, 0x0a, 0xba, 0xb3, 0x1c, 0xbc, 0x4a, 0x78, 0xbb, 0xe5, 0xe3, 0x75, 0x38, 0xa5, 0x48, 0xa7, 0xa2, 0x1e, 0xaf, 0x76, 0xd4, 0x5e, 0xf7, 0x38, 0x86, 0x56, 0x5a, 0x89, 0xce, 0xd6, 0xc3, 0xa7, 0x79, 0xb2, 0x52, 0xa0, 0xc6, 0xf1, 0x85, 0xb4, 0x25, 0x8c, 0xf2, 0x3f, 0x96, 0xb3, 0x10, 0xd9, 0x8d, 0x6c, 0x57, 0x3b, 0x9f, 0x6f, 0x86, 0x3a, 0x18, 0x82, 0x22, 0x36, 0xc8, 0xb0, 0x91, 0x38, 0xdb, 0x2a, 0xa1, 0x93, 0xaa, 0x84, 0x3f, 0xf5, 0x27, 0x65, 0xae, 0x73, 0xd5, 0xc8, 0xd5, 0xd3, 0x77, 0xea, 0x4b, 0x9d, 0xc7, 0x41, 0xbb, 0xc7, 0xc0, 0xe3, 0xa0, 0x3f, 0xe4, 0x7d, 0xa4, 0x8d, 0x73, 0xe6, 0x12, 0x4b, 0xdf, 0xa1, 0x73, 0x73, 0x73, 0x3a, 0x80, 0xe8, 0xd5, 0xcb, 0x8e, 0x2f, 0xcb, 0xea, 0x13, 0xa7, 0xd6, 0x41, 0x8b, 0xac, 0xfa, 0x3c, 0x89, 0xd7, 0x24, 0xf5, 0x4e, 0xb4, 0xe0, 0x61, 0x92, 0xb7, 0xf3, 0x37, 0x98, 0xc4, 0xbe, 0x96, 0xa3, 0xb7, 0x8a, }; struct { const char *eku; size_t length; const char *expected[16]; } extended_key_usage_fixtures[] = { { test_eku_server_and_client, sizeof (test_eku_server_and_client), { P11_OID_SERVER_AUTH_STR, P11_OID_CLIENT_AUTH_STR, NULL }, }, { test_eku_none, sizeof (test_eku_none), { NULL, }, }, { test_eku_client_email_and_timestamp, sizeof (test_eku_client_email_and_timestamp), { P11_OID_CLIENT_AUTH_STR, P11_OID_EMAIL_PROTECTION_STR, P11_OID_TIME_STAMPING_STR }, }, { NULL }, }; static void test_parse_extended_key_usage (void) { p11_array *ekus; int i, j, count; for (i = 0; extended_key_usage_fixtures[i].eku != NULL; i++) { ekus = p11_x509_parse_extended_key_usage (test.asn1_defs, (const unsigned char *)extended_key_usage_fixtures[i].eku, extended_key_usage_fixtures[i].length); assert_ptr_not_null (ekus); for (count = 0; extended_key_usage_fixtures[i].expected[count] != NULL; count++); assert_num_eq (count, ekus->num); for (j = 0; j < count; j++) assert_str_eq (ekus->elem[j], extended_key_usage_fixtures[i].expected[j]); p11_array_free (ekus); } } struct { const char *ku; size_t length; unsigned int expected; } key_usage_fixtures[] = { { test_ku_ds_and_np, sizeof (test_ku_ds_and_np), P11_KU_DIGITAL_SIGNATURE | P11_KU_NON_REPUDIATION }, { test_ku_none, sizeof (test_ku_none), 0 }, { test_ku_cert_crl_sign, sizeof (test_ku_cert_crl_sign), P11_KU_KEY_CERT_SIGN | P11_KU_CRL_SIGN }, { NULL }, }; static void test_parse_key_usage (void) { unsigned int ku; int i; bool ret; for (i = 0; key_usage_fixtures[i].ku != NULL; i++) { ku = 0; ret = p11_x509_parse_key_usage (test.asn1_defs, (const unsigned char *)key_usage_fixtures[i].ku, key_usage_fixtures[i].length, &ku); assert_num_eq (true, ret); assert_num_eq (key_usage_fixtures[i].expected, ku); } } static void test_parse_extension (void) { node_asn *cert; unsigned char *ext; size_t length; bool is_ca; cert = p11_asn1_decode (test.asn1_defs, "PKIX1.Certificate", test_cacert3_ca_der, sizeof (test_cacert3_ca_der), NULL); assert_ptr_not_null (cert); ext = p11_x509_find_extension (cert, P11_OID_BASIC_CONSTRAINTS, test_cacert3_ca_der, sizeof (test_cacert3_ca_der), &length); assert_ptr_not_null (ext); assert (length > 0); asn1_delete_structure (&cert); if (!p11_x509_parse_basic_constraints (test.asn1_defs, ext, length, &is_ca)) assert_fail ("failed to parse message", "basic constraints"); free (ext); } static void test_parse_extension_not_found (void) { node_asn *cert; unsigned char *ext; size_t length; cert = p11_asn1_decode (test.asn1_defs, "PKIX1.Certificate", test_cacert3_ca_der, sizeof (test_cacert3_ca_der), NULL); assert_ptr_not_null (cert); ext = p11_x509_find_extension (cert, P11_OID_OPENSSL_REJECT, test_cacert3_ca_der, sizeof (test_cacert3_ca_der), &length); assert_ptr_eq (NULL, ext); asn1_delete_structure (&cert); } static void test_directory_string (void) { struct { unsigned char input[100]; int input_len; char *output; int output_len; } fixtures[] = { /* UTF8String */ { { 0x0c, 0x0f, 0xc3, 0x84, ' ', 'U', 'T', 'F', '8', ' ', 's', 't', 'r', 'i', 'n', 'g', ' ', }, 17, "\xc3\x84 UTF8 string ", 15, }, /* NumericString */ { { 0x12, 0x04, '0', '1', '2', '3', }, 6, "0123", 4, }, /* IA5String */ { { 0x16, 0x04, ' ', 'A', 'B', ' ', }, 6, " AB ", 4 }, /* TeletexString */ { { 0x14, 0x07, 'A', ' ', ' ', 'n', 'i', 'c', 'e' }, 9, "A nice", 7 }, /* PrintableString */ { { 0x13, 0x07, 'A', ' ', ' ', 'n', 'i', 'c', 'e' }, 9, "A nice", 7, }, /* UniversalString */ { { 0x1c, 0x14, 0x00, 0x00, 0x00, 'F', 0x00, 0x00, 0x00, 'u', 0x00, 0x00, 0x00, 'n', 0x00, 0x00, 0x00, ' ', 0x00, 0x01, 0x03, 0x19, }, 22, "Fun \xf0\x90\x8c\x99", 8 }, /* BMPString */ { { 0x1e, 0x0a, 0x00, 'V', 0x00, 0xF6, 0x00, 'g', 0x00, 'e', 0x00, 'l' }, 12, "V\xc3\xb6gel", 6 }, }; char *string; bool unknown; size_t length; int i; for (i = 0; i < ELEMS (fixtures); i++) { string = p11_x509_parse_directory_string (fixtures[i].input, fixtures[i].input_len, &unknown, &length); assert_ptr_not_null (string); assert_num_eq (false, unknown); assert_num_eq (fixtures[i].output_len, length); assert_str_eq (fixtures[i].output, string); free (string); } } static void test_directory_string_unknown (void) { /* Not a valid choice in DirectoryString */ unsigned char input[] = { 0x05, 0x07, 'A', ' ', ' ', 'n', 'i', 'c', 'e' }; char *string; bool unknown = false; size_t length; string = p11_x509_parse_directory_string (input, sizeof (input), &unknown, &length); assert_ptr_eq (NULL, string); assert_num_eq (true, unknown); } int main (int argc, char *argv[]) { p11_fixture (setup, teardown); p11_test (test_parse_extended_key_usage, "/x509/parse-extended-key-usage"); p11_test (test_parse_key_usage, "/x509/parse-key-usage"); p11_test (test_parse_extension, "/x509/parse-extension"); p11_test (test_parse_extension_not_found, "/x509/parse-extension-not-found"); p11_fixture (NULL, NULL); p11_test (test_directory_string, "/x509/directory-string"); p11_test (test_directory_string_unknown, "/x509/directory-string-unknown"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/frob-ext.c0000664000175000017500000000650412226763526014141 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include #include #include #include #include #include "pkix.asn.h" #define err_if_fail(ret, msg) \ do { if ((ret) != ASN1_SUCCESS) { \ fprintf (stderr, "%s: %s\n", msg, asn1_strerror (ret)); \ exit (1); \ } } while (0) int main (int argc, char *argv[]) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = { 0, }; node_asn *definitions = NULL; node_asn *ext = NULL; unsigned char input[1024]; char *buf; size_t size; int len; int ret; if (argc == 1 || argc > 3) { fprintf (stderr, "usage: frob-ext 1.2.3 TRUE\n"); return 2; } size = fread (input, 1, sizeof (input), stdin); if (ferror (stdin) || !feof (stdin)) { fprintf (stderr, "bad input\n"); return 1; } ret = asn1_array2tree (pkix_asn1_tab, &definitions, message); if (ret != ASN1_SUCCESS) { fprintf (stderr, "definitions: %s\n", message); return 1; } ret = asn1_create_element (definitions, "PKIX1.Extension", &ext); err_if_fail (ret, "Extension"); ret = asn1_write_value (ext, "extnID", argv[1], 1); err_if_fail (ret, "extnID"); if (argc == 3) { ret = asn1_write_value (ext, "critical", argv[2], 1); err_if_fail (ret, "critical"); } ret = asn1_write_value (ext, "extnValue", input, size); err_if_fail (ret, "extnValue"); len = 0; ret = asn1_der_coding (ext, "", NULL, &len, message); assert (ret == ASN1_MEM_ERROR); buf = malloc (len); assert (buf != NULL); ret = asn1_der_coding (ext, "", buf, &len, message); if (ret != ASN1_SUCCESS) { fprintf (stderr, "asn1_der_coding: %s\n", message); return 1; } fwrite (buf, 1, len, stdout); fflush (stdout); free (buf); asn1_delete_structure (&ext); asn1_delete_structure (&definitions); return 0; } p11-kit-0.20.2/trust/tests/input/0000775000175000017500000000000012161102014013432 500000000000000p11-kit-0.20.2/trust/tests/input/blacklist/0000775000175000017500000000000012161102014015402 500000000000000p11-kit-0.20.2/trust/tests/input/blacklist/self-server.der0000664000175000017500000000061412165274405020276 00000000000000002 ؖ0  *H 0K10 &,dCOM10 &,dEXAMPLE10Userver.example.com0 110119031638Z 210116031638Z0K10 &,dCOM10 &,dEXAMPLE10Userver.example.com0\0  *H K0HAIWf3\ukc9(߅jR὎#^_HԠO0  *H A͏P~c; #LjŽѽ ͣSwaԺ p11-kit-0.20.2/trust/tests/input/distrusted.pem0000664000175000017500000000256712165274405016303 00000000000000-----BEGIN TRUSTED CERTIFICATE----- MIIDsDCCAxmgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCVVMx FzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMRAwDgYDVQQHEwdSYWxlaWdoMRYwFAYD VQQKEw1SZWQgSGF0LCBJbmMuMQswCQYDVQQLEwJJUzEWMBQGA1UEAxMNUmVkIEhh dCBJUyBDQTEmMCQGCSqGSIb3DQEJARYXc3lzYWRtaW4tcmR1QHJlZGhhdC5jb20w HhcNMDkwOTE2MTg0NTI1WhcNMTkwOTE0MTg0NTI1WjCBnTELMAkGA1UEBhMCVVMx FzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMRAwDgYDVQQHEwdSYWxlaWdoMRYwFAYD VQQKEw1SZWQgSGF0LCBJbmMuMQswCQYDVQQLEwJJUzEWMBQGA1UEAxMNUmVkIEhh dCBJUyBDQTEmMCQGCSqGSIb3DQEJARYXc3lzYWRtaW4tcmR1QHJlZGhhdC5jb20w gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAN/HDWGiL8BarUWDIjNC6uxCXqYN QkwcmhILX+cl+YuDDArFL1pYVrith228gF3dSUU5X7kIOmPkkjNheRkbnas61X+n i3+KWvbX3q+h5VMxKX2cA1U+R3jLuXqYjF+N2gkPyPvxeoDuEncKAItw+mK/r+4L WBb5nFzek7hP3017AgMBAAGjgf0wgfowHQYDVR0OBBYEFA2sGXDtBKdeeKv+i6g0 6yEmwVY1MIHKBgNVHSMEgcIwgb+AFA2sGXDtBKdeeKv+i6g06yEmwVY1oYGjpIGg MIGdMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExEDAOBgNV BAcTB1JhbGVpZ2gxFjAUBgNVBAoTDVJlZCBIYXQsIEluYy4xCzAJBgNVBAsTAklT MRYwFAYDVQQDEw1SZWQgSGF0IElTIENBMSYwJAYJKoZIhvcNAQkBFhdzeXNhZG1p bi1yZHVAcmVkaGF0LmNvbYIBATAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA A4GBAFBgO5y3JcPXH/goumNBW7rr8m9EFZmQyK5gT1Ljv5qaCSZwxkAomhriv04p mb1y8yjrK5OY3WwgaRaAWRHp4/hn2HWaRvx3S+gwLM7p8V1pWnbSFJOXF3kbuC41 voMIMqAFfHKidKN/yrjJg/1ahIjSt11lMUvRJ4TNT+pk5VnBMB+gCgYIKwYBBQUH AwIMEVJlZCBIYXQgSXMgdGhlIENB -----END TRUSTED CERTIFICATE----- p11-kit-0.20.2/trust/tests/input/cacert-ca.der0000664000175000017500000000350112165274405015711 000000000000000=0%0  *H 0y10U Root CA10U http://www.cacert.org1"0 UCA Cert Signing Authority1!0 *H  support@cacert.org0 030330122949Z 330329122949Z0y10U Root CA10U http://www.cacert.org1"0 UCA Cert Signing Authority1!0 *H  support@cacert.org0"0  *H 0 "F}6(P3@K;f?1k6|Nw6A Fs`n~XdͰE cg ҿ>L5]l!ޞ ٺf27rXɎ^> l[df*zKSy{/ a+~MVڒDAX`efD˔B~ ehQWkzr%[ 2H.0B%k?:SHҶ4zX+[8]fɘמtq r`o34v>$zoE8GAJ. Yתғ}h.݋KX/ꕧTۋQ"þ,x ӊ/?Qe!eE|ALO)!3u Qwi"Ṕ1{8h[+~_rLK Wʑu!7c g>FOp gYͺbA )d)B"xC QKZZqs 00U2Ұ:90U#02Ұ:9ѡ}{0y10U Root CA10U http://www.cacert.org1"0 UCA Cert Signing Authority1!0 *H  support@cacert.org0U002U+0)0'%#!https://www.cacert.org/revoke.crl00 `HB#!https://www.cacert.org/revoke.crl04 `HB'%http://www.cacert.org/index.php?id=100V `HB IGTo get your own certificate for FREE head over to http://www.cacert.org0  *H (\5 ojhX>ÐZ`CpbgX 06;Htq>+h4b@F;S(fSM];`yi;eƁ\MU7paj|.T>O!܂EMs7;N˛͚۲p-JذoEH3<2*T#Gdzqc~/ܟ+H%B>Wiw4 Kʠƌ27hs_QIS6 Ly:u pg/y= s og/ ${H5)@`ᖆPzY؏! ς;kV#lH3Y=`3oGbRn.GHm!hr5]j;~L~,btqn q8ro+Zr%9Fr>d'"*OX.]H}*{\FPB[6Tb48 `;V8[[N|ՠp@ӑ)<4{l_ ç Z,]R\G՛$(p8 /)Ah̗KE: p:p5+!1`z&HcU" */ #include "config.h" #include "compat.h" #include #include #include #include #include #include "pkix.asn.h" #define err_if_fail(ret, msg) \ do { if ((ret) != ASN1_SUCCESS) { \ fprintf (stderr, "%s: %s\n", msg, asn1_strerror (ret)); \ exit (1); \ } } while (0) int main (int argc, char *argv[]) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = { 0, }; node_asn *definitions = NULL; node_asn *ext = NULL; char *buf; int len; int ret; ret = asn1_array2tree (pkix_asn1_tab, &definitions, message); if (ret != ASN1_SUCCESS) { fprintf (stderr, "definitions: %s\n", message); return 1; } ret = asn1_create_element (definitions, "PKIX1.BasicConstraints", &ext); err_if_fail (ret, "BasicConstraints"); if (argc > 1) { ret = asn1_write_value (ext, "cA", argv[1], 1); err_if_fail (ret, "cA"); } ret = asn1_write_value (ext, "pathLenConstraint", NULL, 0); err_if_fail (ret, "pathLenConstraint"); len = 0; ret = asn1_der_coding (ext, "", NULL, &len, message); assert (ret == ASN1_MEM_ERROR); buf = malloc (len); assert (buf != NULL); ret = asn1_der_coding (ext, "", buf, &len, message); if (ret != ASN1_SUCCESS) { fprintf (stderr, "asn1_der_coding: %s\n", message); return 1; } fwrite (buf, 1, len, stdout); fflush (stdout); free (buf); asn1_delete_structure (&ext); asn1_delete_structure (&definitions); return 0; } p11-kit-0.20.2/trust/tests/test-trust.h0000664000175000017500000007203112226763526014554 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "dict.h" #include "pkcs11.h" #include "test.h" #include #include #ifndef TEST_DATA_H_ #define TEST_DATA_H_ #define test_check_object(attrs, klass, label) \ test_check_object_msg (__FILE__, __LINE__, __FUNCTION__, attrs, klass, label) void test_check_object_msg (const char *file, int line, const char *function, CK_ATTRIBUTE *attrs, CK_OBJECT_CLASS klass, const char *label); #define test_check_cacert3_ca(attrs, label) \ test_check_cacert3_ca_msg (__FILE__, __LINE__, __FUNCTION__, attrs, label) void test_check_cacert3_ca_msg (const char *file, int line, const char *function, CK_ATTRIBUTE *attrs, const char *label); #define test_check_attrs(expected, attrs) \ test_check_attrs_msg (__FILE__, __LINE__, __FUNCTION__, expected, attrs) void test_check_attrs_msg (const char *file, int line, const char *function, CK_ATTRIBUTE *expected, CK_ATTRIBUTE *attrs); #define test_check_attr(expected, attr) \ test_check_attr_msg (__FILE__, __LINE__, __FUNCTION__, CKA_INVALID, expected, attr) void test_check_attr_msg (const char *file, int line, const char *function, CK_OBJECT_CLASS klass, CK_ATTRIBUTE *expected, CK_ATTRIBUTE *attr); #define test_check_id(expected, attrs) \ test_check_id_msg (__FILE__, __LINE__, __FUNCTION__, expected, attrs) void test_check_id_msg (const char *file, int line, const char *function, CK_ATTRIBUTE *expected, CK_ATTRIBUTE *attr); static const unsigned char test_cacert3_ca_der[] = { 0x30, 0x82, 0x07, 0x59, 0x30, 0x82, 0x05, 0x41, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x03, 0x0a, 0x41, 0x8a, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x79, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x07, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x15, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x31, 0x22, 0x30, 0x20, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x19, 0x43, 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x12, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x31, 0x30, 0x35, 0x32, 0x33, 0x31, 0x37, 0x34, 0x38, 0x30, 0x32, 0x5a, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x35, 0x32, 0x30, 0x31, 0x37, 0x34, 0x38, 0x30, 0x32, 0x5a, 0x30, 0x54, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0b, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x15, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x13, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x82, 0x02, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x02, 0x0f, 0x00, 0x30, 0x82, 0x02, 0x0a, 0x02, 0x82, 0x02, 0x01, 0x00, 0xab, 0x49, 0x35, 0x11, 0x48, 0x7c, 0xd2, 0x26, 0x7e, 0x53, 0x94, 0xcf, 0x43, 0xa9, 0xdd, 0x28, 0xd7, 0x42, 0x2a, 0x8b, 0xf3, 0x87, 0x78, 0x19, 0x58, 0x7c, 0x0f, 0x9e, 0xda, 0x89, 0x7d, 0xe1, 0xfb, 0xeb, 0x72, 0x90, 0x0d, 0x74, 0xa1, 0x96, 0x64, 0xab, 0x9f, 0xa0, 0x24, 0x99, 0x73, 0xda, 0xe2, 0x55, 0x76, 0xc7, 0x17, 0x7b, 0xf5, 0x04, 0xac, 0x46, 0xb8, 0xc3, 0xbe, 0x7f, 0x64, 0x8d, 0x10, 0x6c, 0x24, 0xf3, 0x61, 0x9c, 0xc0, 0xf2, 0x90, 0xfa, 0x51, 0xe6, 0xf5, 0x69, 0x01, 0x63, 0xc3, 0x0f, 0x56, 0xe2, 0x4a, 0x42, 0xcf, 0xe2, 0x44, 0x8c, 0x25, 0x28, 0xa8, 0xc5, 0x79, 0x09, 0x7d, 0x46, 0xb9, 0x8a, 0xf3, 0xe9, 0xf3, 0x34, 0x29, 0x08, 0x45, 0xe4, 0x1c, 0x9f, 0xcb, 0x94, 0x04, 0x1c, 0x81, 0xa8, 0x14, 0xb3, 0x98, 0x65, 0xc4, 0x43, 0xec, 0x4e, 0x82, 0x8d, 0x09, 0xd1, 0xbd, 0xaa, 0x5b, 0x8d, 0x92, 0xd0, 0xec, 0xde, 0x90, 0xc5, 0x7f, 0x0a, 0xc2, 0xe3, 0xeb, 0xe6, 0x31, 0x5a, 0x5e, 0x74, 0x3e, 0x97, 0x33, 0x59, 0xe8, 0xc3, 0x03, 0x3d, 0x60, 0x33, 0xbf, 0xf7, 0xd1, 0x6f, 0x47, 0xc4, 0xcd, 0xee, 0x62, 0x83, 0x52, 0x6e, 0x2e, 0x08, 0x9a, 0xa4, 0xd9, 0x15, 0x18, 0x91, 0xa6, 0x85, 0x92, 0x47, 0xb0, 0xae, 0x48, 0xeb, 0x6d, 0xb7, 0x21, 0xec, 0x85, 0x1a, 0x68, 0x72, 0x35, 0xab, 0xff, 0xf0, 0x10, 0x5d, 0xc0, 0xf4, 0x94, 0xa7, 0x6a, 0xd5, 0x3b, 0x92, 0x7e, 0x4c, 0x90, 0x05, 0x7e, 0x93, 0xc1, 0x2c, 0x8b, 0xa4, 0x8e, 0x62, 0x74, 0x15, 0x71, 0x6e, 0x0b, 0x71, 0x03, 0xea, 0xaf, 0x15, 0x38, 0x9a, 0xd4, 0xd2, 0x05, 0x72, 0x6f, 0x8c, 0xf9, 0x2b, 0xeb, 0x5a, 0x72, 0x25, 0xf9, 0x39, 0x46, 0xe3, 0x72, 0x1b, 0x3e, 0x04, 0xc3, 0x64, 0x27, 0x22, 0x10, 0x2a, 0x8a, 0x4f, 0x58, 0xa7, 0x03, 0xad, 0xbe, 0xb4, 0x2e, 0x13, 0xed, 0x5d, 0xaa, 0x48, 0xd7, 0xd5, 0x7d, 0xd4, 0x2a, 0x7b, 0x5c, 0xfa, 0x46, 0x04, 0x50, 0xe4, 0xcc, 0x0e, 0x42, 0x5b, 0x8c, 0xed, 0xdb, 0xf2, 0xcf, 0xfc, 0x96, 0x93, 0xe0, 0xdb, 0x11, 0x36, 0x54, 0x62, 0x34, 0x38, 0x8f, 0x0c, 0x60, 0x9b, 0x3b, 0x97, 0x56, 0x38, 0xad, 0xf3, 0xd2, 0x5b, 0x8b, 0xa0, 0x5b, 0xea, 0x4e, 0x96, 0xb8, 0x7c, 0xd7, 0xd5, 0xa0, 0x86, 0x70, 0x40, 0xd3, 0x91, 0x29, 0xb7, 0xa2, 0x3c, 0xad, 0xf5, 0x8c, 0xbb, 0xcf, 0x1a, 0x92, 0x8a, 0xe4, 0x34, 0x7b, 0xc0, 0xd8, 0x6c, 0x5f, 0xe9, 0x0a, 0xc2, 0xc3, 0xa7, 0x20, 0x9a, 0x5a, 0xdf, 0x2c, 0x5d, 0x52, 0x5c, 0xba, 0x47, 0xd5, 0x9b, 0xef, 0x24, 0x28, 0x70, 0x38, 0x20, 0x2f, 0xd5, 0x7f, 0x29, 0xc0, 0xb2, 0x41, 0x03, 0x68, 0x92, 0xcc, 0xe0, 0x9c, 0xcc, 0x97, 0x4b, 0x45, 0xef, 0x3a, 0x10, 0x0a, 0xab, 0x70, 0x3a, 0x98, 0x95, 0x70, 0xad, 0x35, 0xb1, 0xea, 0x85, 0x2b, 0xa4, 0x1c, 0x80, 0x21, 0x31, 0xa9, 0xae, 0x60, 0x7a, 0x80, 0x26, 0x48, 0x00, 0xb8, 0x01, 0xc0, 0x93, 0x63, 0x55, 0x22, 0x91, 0x3c, 0x56, 0xe7, 0xaf, 0xdb, 0x3a, 0x25, 0xf3, 0x8f, 0x31, 0x54, 0xea, 0x26, 0x8b, 0x81, 0x59, 0xf9, 0xa1, 0xd1, 0x53, 0x11, 0xc5, 0x7b, 0x9d, 0x03, 0xf6, 0x74, 0x11, 0xe0, 0x6d, 0xb1, 0x2c, 0x3f, 0x2c, 0x86, 0x91, 0x99, 0x71, 0x9a, 0xa6, 0x77, 0x8b, 0x34, 0x60, 0xd1, 0x14, 0xb4, 0x2c, 0xac, 0x9d, 0xaf, 0x8c, 0x10, 0xd3, 0x9f, 0xc4, 0x6a, 0xf8, 0x6f, 0x13, 0xfc, 0x73, 0x59, 0xf7, 0x66, 0x42, 0x74, 0x1e, 0x8a, 0xe3, 0xf8, 0xdc, 0xd2, 0x6f, 0x98, 0x9c, 0xcb, 0x47, 0x98, 0x95, 0x40, 0x05, 0xfb, 0xe9, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x02, 0x0d, 0x30, 0x82, 0x02, 0x09, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x75, 0xa8, 0x71, 0x60, 0x4c, 0x88, 0x13, 0xf0, 0x78, 0xd9, 0x89, 0x77, 0xb5, 0x6d, 0xc5, 0x89, 0xdf, 0xbc, 0xb1, 0x7a, 0x30, 0x81, 0xa3, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x81, 0x9b, 0x30, 0x81, 0x98, 0x80, 0x14, 0x16, 0xb5, 0x32, 0x1b, 0xd4, 0xc7, 0xf3, 0xe0, 0xe6, 0x8e, 0xf3, 0xbd, 0xd2, 0xb0, 0x3a, 0xee, 0xb2, 0x39, 0x18, 0xd1, 0xa1, 0x7d, 0xa4, 0x7b, 0x30, 0x79, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x07, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x15, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x31, 0x22, 0x30, 0x20, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x19, 0x43, 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x12, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x82, 0x01, 0x00, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x5d, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, 0x51, 0x30, 0x4f, 0x30, 0x23, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x86, 0x17, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, 0x73, 0x70, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x30, 0x28, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x1c, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x63, 0x61, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x4a, 0x06, 0x03, 0x55, 0x1d, 0x20, 0x04, 0x43, 0x30, 0x41, 0x30, 0x3f, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x81, 0x90, 0x4a, 0x30, 0x33, 0x30, 0x31, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, 0x16, 0x25, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x70, 0x68, 0x70, 0x3f, 0x69, 0x64, 0x3d, 0x31, 0x30, 0x30, 0x34, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x08, 0x04, 0x27, 0x16, 0x25, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x70, 0x68, 0x70, 0x3f, 0x69, 0x64, 0x3d, 0x31, 0x30, 0x30, 0x50, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0d, 0x04, 0x43, 0x16, 0x41, 0x54, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x77, 0x6e, 0x20, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x46, 0x52, 0x45, 0x45, 0x2c, 0x20, 0x67, 0x6f, 0x20, 0x74, 0x6f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x02, 0x01, 0x00, 0x29, 0x28, 0x85, 0xae, 0x44, 0xa9, 0xb9, 0xaf, 0xa4, 0x79, 0x13, 0xf0, 0xa8, 0xa3, 0x2b, 0x97, 0x60, 0xf3, 0x5c, 0xee, 0xe3, 0x2f, 0xc1, 0xf6, 0xe2, 0x66, 0xa0, 0x11, 0xae, 0x36, 0x37, 0x3a, 0x76, 0x15, 0x04, 0x53, 0xea, 0x42, 0xf5, 0xf9, 0xea, 0xc0, 0x15, 0xd8, 0xa6, 0x82, 0xd9, 0xe4, 0x61, 0xae, 0x72, 0x0b, 0x29, 0x5c, 0x90, 0x43, 0xe8, 0x41, 0xb2, 0xe1, 0x77, 0xdb, 0x02, 0x13, 0x44, 0x78, 0x47, 0x55, 0xaf, 0x58, 0xfc, 0xcc, 0x98, 0xf6, 0x45, 0xb9, 0xd1, 0x20, 0xf8, 0xd8, 0x21, 0x07, 0xfe, 0x6d, 0xaa, 0x73, 0xd4, 0xb3, 0xc6, 0x07, 0xe9, 0x09, 0x85, 0xcc, 0x3b, 0xf2, 0xb6, 0xbe, 0x2c, 0x1c, 0x25, 0xd5, 0x71, 0x8c, 0x39, 0xb5, 0x2e, 0xea, 0xbe, 0x18, 0x81, 0xba, 0xb0, 0x93, 0xb8, 0x0f, 0xe3, 0xe6, 0xd7, 0x26, 0x8c, 0x31, 0x5a, 0x72, 0x03, 0x84, 0x52, 0xe6, 0xa6, 0xf5, 0x33, 0x22, 0x45, 0x0a, 0xc8, 0x0b, 0x0d, 0x8a, 0xb8, 0x36, 0x6f, 0x90, 0x09, 0xa1, 0xab, 0xbd, 0xd7, 0xd5, 0x4e, 0x2e, 0x71, 0xa2, 0xd4, 0xae, 0xfa, 0xa7, 0x54, 0x2b, 0xeb, 0x35, 0x8d, 0x5a, 0xb7, 0x54, 0x88, 0x2f, 0xee, 0x74, 0x9f, 0xed, 0x48, 0x16, 0xca, 0x0d, 0x48, 0xd0, 0x94, 0xd3, 0xac, 0xa4, 0xa2, 0xf6, 0x24, 0xdf, 0x92, 0xe3, 0xbd, 0xeb, 0x43, 0x40, 0x91, 0x6e, 0x1c, 0x18, 0x8e, 0x56, 0xb4, 0x82, 0x12, 0xf3, 0xa9, 0x93, 0x9f, 0xd4, 0xbc, 0x9c, 0xad, 0x9c, 0x75, 0xee, 0x5a, 0x97, 0x1b, 0x95, 0xe7, 0x74, 0x2d, 0x1c, 0x0f, 0xb0, 0x2c, 0x97, 0x9f, 0xfb, 0xa9, 0x33, 0x39, 0x7a, 0xe7, 0x03, 0x3a, 0x92, 0x8e, 0x22, 0xf6, 0x8c, 0x0d, 0xe4, 0xd9, 0x7e, 0x0d, 0x76, 0x18, 0xf7, 0x01, 0xf9, 0xef, 0x96, 0x96, 0xa2, 0x55, 0x73, 0xc0, 0x3c, 0x71, 0xb4, 0x1d, 0x1a, 0x56, 0x43, 0xb7, 0xc3, 0x0a, 0x8d, 0x72, 0xfc, 0xe2, 0x10, 0x09, 0x0b, 0x41, 0xce, 0x8c, 0x94, 0xa0, 0xf9, 0x03, 0xfd, 0x71, 0x73, 0x4b, 0x8a, 0x57, 0x33, 0xe5, 0x8e, 0x74, 0x7e, 0x15, 0x01, 0x00, 0xe6, 0xcc, 0x4a, 0x1c, 0xe7, 0x7f, 0x95, 0x19, 0x2d, 0xc5, 0xa5, 0x0c, 0x8b, 0xbb, 0xb5, 0xed, 0x85, 0xb3, 0x5c, 0xd3, 0xdf, 0xb8, 0xb9, 0xf2, 0xca, 0xc7, 0x0d, 0x01, 0x14, 0xac, 0x70, 0x58, 0xc5, 0x8c, 0x8d, 0x33, 0xd4, 0x9d, 0x66, 0xa3, 0x1a, 0x50, 0x95, 0x23, 0xfc, 0x48, 0xe0, 0x06, 0x43, 0x12, 0xd9, 0xcd, 0xa7, 0x86, 0x39, 0x2f, 0x36, 0x72, 0xa3, 0x80, 0x10, 0xe4, 0xe1, 0xf3, 0xd1, 0xcb, 0x5b, 0x1a, 0xc0, 0xe4, 0x80, 0x9a, 0x7c, 0x13, 0x73, 0x06, 0x4f, 0xdb, 0xa3, 0x6b, 0x24, 0x0a, 0xba, 0xb3, 0x1c, 0xbc, 0x4a, 0x78, 0xbb, 0xe5, 0xe3, 0x75, 0x38, 0xa5, 0x48, 0xa7, 0xa2, 0x1e, 0xaf, 0x76, 0xd4, 0x5e, 0xf7, 0x38, 0x86, 0x56, 0x5a, 0x89, 0xce, 0xd6, 0xc3, 0xa7, 0x79, 0xb2, 0x52, 0xa0, 0xc6, 0xf1, 0x85, 0xb4, 0x25, 0x8c, 0xf2, 0x3f, 0x96, 0xb3, 0x10, 0xd9, 0x8d, 0x6c, 0x57, 0x3b, 0x9f, 0x6f, 0x86, 0x3a, 0x18, 0x82, 0x22, 0x36, 0xc8, 0xb0, 0x91, 0x38, 0xdb, 0x2a, 0xa1, 0x93, 0xaa, 0x84, 0x3f, 0xf5, 0x27, 0x65, 0xae, 0x73, 0xd5, 0xc8, 0xd5, 0xd3, 0x77, 0xea, 0x4b, 0x9d, 0xc7, 0x41, 0xbb, 0xc7, 0xc0, 0xe3, 0xa0, 0x3f, 0xe4, 0x7d, 0xa4, 0x8d, 0x73, 0xe6, 0x12, 0x4b, 0xdf, 0xa1, 0x73, 0x73, 0x73, 0x3a, 0x80, 0xe8, 0xd5, 0xcb, 0x8e, 0x2f, 0xcb, 0xea, 0x13, 0xa7, 0xd6, 0x41, 0x8b, 0xac, 0xfa, 0x3c, 0x89, 0xd7, 0x24, 0xf5, 0x4e, 0xb4, 0xe0, 0x61, 0x92, 0xb7, 0xf3, 0x37, 0x98, 0xc4, 0xbe, 0x96, 0xa3, 0xb7, 0x8a, }; static const char test_cacert3_ca_subject[] = { 0x30, 0x54, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0b, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x15, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x13, 0x43, 0x41, 0x63, 0x65, 0x72, 0x74, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x52, 0x6f, 0x6f, 0x74, }; static const char test_cacert3_ca_issuer[] = { 0x30, 0x79, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x07, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x15, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x31, 0x22, 0x30, 0x20, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x19, 0x43, 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x12, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x63, 0x61, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6f, 0x72, 0x67, }; static const char test_cacert3_ca_serial[] = { 0x02, 0x03, 0x0a, 0x41, 0x8a, }; static const char test_cacert3_ca_public_key[] = { 0x30, 0x82, 0x02, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x02, 0x0f, 0x00, 0x30, 0x82, 0x02, 0x0a, 0x02, 0x82, 0x02, 0x01, 0x00, 0xab, 0x49, 0x35, 0x11, 0x48, 0x7c, 0xd2, 0x26, 0x7e, 0x53, 0x94, 0xcf, 0x43, 0xa9, 0xdd, 0x28, 0xd7, 0x42, 0x2a, 0x8b, 0xf3, 0x87, 0x78, 0x19, 0x58, 0x7c, 0x0f, 0x9e, 0xda, 0x89, 0x7d, 0xe1, 0xfb, 0xeb, 0x72, 0x90, 0x0d, 0x74, 0xa1, 0x96, 0x64, 0xab, 0x9f, 0xa0, 0x24, 0x99, 0x73, 0xda, 0xe2, 0x55, 0x76, 0xc7, 0x17, 0x7b, 0xf5, 0x04, 0xac, 0x46, 0xb8, 0xc3, 0xbe, 0x7f, 0x64, 0x8d, 0x10, 0x6c, 0x24, 0xf3, 0x61, 0x9c, 0xc0, 0xf2, 0x90, 0xfa, 0x51, 0xe6, 0xf5, 0x69, 0x01, 0x63, 0xc3, 0x0f, 0x56, 0xe2, 0x4a, 0x42, 0xcf, 0xe2, 0x44, 0x8c, 0x25, 0x28, 0xa8, 0xc5, 0x79, 0x09, 0x7d, 0x46, 0xb9, 0x8a, 0xf3, 0xe9, 0xf3, 0x34, 0x29, 0x08, 0x45, 0xe4, 0x1c, 0x9f, 0xcb, 0x94, 0x04, 0x1c, 0x81, 0xa8, 0x14, 0xb3, 0x98, 0x65, 0xc4, 0x43, 0xec, 0x4e, 0x82, 0x8d, 0x09, 0xd1, 0xbd, 0xaa, 0x5b, 0x8d, 0x92, 0xd0, 0xec, 0xde, 0x90, 0xc5, 0x7f, 0x0a, 0xc2, 0xe3, 0xeb, 0xe6, 0x31, 0x5a, 0x5e, 0x74, 0x3e, 0x97, 0x33, 0x59, 0xe8, 0xc3, 0x03, 0x3d, 0x60, 0x33, 0xbf, 0xf7, 0xd1, 0x6f, 0x47, 0xc4, 0xcd, 0xee, 0x62, 0x83, 0x52, 0x6e, 0x2e, 0x08, 0x9a, 0xa4, 0xd9, 0x15, 0x18, 0x91, 0xa6, 0x85, 0x92, 0x47, 0xb0, 0xae, 0x48, 0xeb, 0x6d, 0xb7, 0x21, 0xec, 0x85, 0x1a, 0x68, 0x72, 0x35, 0xab, 0xff, 0xf0, 0x10, 0x5d, 0xc0, 0xf4, 0x94, 0xa7, 0x6a, 0xd5, 0x3b, 0x92, 0x7e, 0x4c, 0x90, 0x05, 0x7e, 0x93, 0xc1, 0x2c, 0x8b, 0xa4, 0x8e, 0x62, 0x74, 0x15, 0x71, 0x6e, 0x0b, 0x71, 0x03, 0xea, 0xaf, 0x15, 0x38, 0x9a, 0xd4, 0xd2, 0x05, 0x72, 0x6f, 0x8c, 0xf9, 0x2b, 0xeb, 0x5a, 0x72, 0x25, 0xf9, 0x39, 0x46, 0xe3, 0x72, 0x1b, 0x3e, 0x04, 0xc3, 0x64, 0x27, 0x22, 0x10, 0x2a, 0x8a, 0x4f, 0x58, 0xa7, 0x03, 0xad, 0xbe, 0xb4, 0x2e, 0x13, 0xed, 0x5d, 0xaa, 0x48, 0xd7, 0xd5, 0x7d, 0xd4, 0x2a, 0x7b, 0x5c, 0xfa, 0x46, 0x04, 0x50, 0xe4, 0xcc, 0x0e, 0x42, 0x5b, 0x8c, 0xed, 0xdb, 0xf2, 0xcf, 0xfc, 0x96, 0x93, 0xe0, 0xdb, 0x11, 0x36, 0x54, 0x62, 0x34, 0x38, 0x8f, 0x0c, 0x60, 0x9b, 0x3b, 0x97, 0x56, 0x38, 0xad, 0xf3, 0xd2, 0x5b, 0x8b, 0xa0, 0x5b, 0xea, 0x4e, 0x96, 0xb8, 0x7c, 0xd7, 0xd5, 0xa0, 0x86, 0x70, 0x40, 0xd3, 0x91, 0x29, 0xb7, 0xa2, 0x3c, 0xad, 0xf5, 0x8c, 0xbb, 0xcf, 0x1a, 0x92, 0x8a, 0xe4, 0x34, 0x7b, 0xc0, 0xd8, 0x6c, 0x5f, 0xe9, 0x0a, 0xc2, 0xc3, 0xa7, 0x20, 0x9a, 0x5a, 0xdf, 0x2c, 0x5d, 0x52, 0x5c, 0xba, 0x47, 0xd5, 0x9b, 0xef, 0x24, 0x28, 0x70, 0x38, 0x20, 0x2f, 0xd5, 0x7f, 0x29, 0xc0, 0xb2, 0x41, 0x03, 0x68, 0x92, 0xcc, 0xe0, 0x9c, 0xcc, 0x97, 0x4b, 0x45, 0xef, 0x3a, 0x10, 0x0a, 0xab, 0x70, 0x3a, 0x98, 0x95, 0x70, 0xad, 0x35, 0xb1, 0xea, 0x85, 0x2b, 0xa4, 0x1c, 0x80, 0x21, 0x31, 0xa9, 0xae, 0x60, 0x7a, 0x80, 0x26, 0x48, 0x00, 0xb8, 0x01, 0xc0, 0x93, 0x63, 0x55, 0x22, 0x91, 0x3c, 0x56, 0xe7, 0xaf, 0xdb, 0x3a, 0x25, 0xf3, 0x8f, 0x31, 0x54, 0xea, 0x26, 0x8b, 0x81, 0x59, 0xf9, 0xa1, 0xd1, 0x53, 0x11, 0xc5, 0x7b, 0x9d, 0x03, 0xf6, 0x74, 0x11, 0xe0, 0x6d, 0xb1, 0x2c, 0x3f, 0x2c, 0x86, 0x91, 0x99, 0x71, 0x9a, 0xa6, 0x77, 0x8b, 0x34, 0x60, 0xd1, 0x14, 0xb4, 0x2c, 0xac, 0x9d, 0xaf, 0x8c, 0x10, 0xd3, 0x9f, 0xc4, 0x6a, 0xf8, 0x6f, 0x13, 0xfc, 0x73, 0x59, 0xf7, 0x66, 0x42, 0x74, 0x1e, 0x8a, 0xe3, 0xf8, 0xdc, 0xd2, 0x6f, 0x98, 0x9c, 0xcb, 0x47, 0x98, 0x95, 0x40, 0x05, 0xfb, 0xe9, 0x02, 0x03, 0x01, 0x00, 0x01, }; static const unsigned char verisign_v1_ca[] = { 0x30, 0x82, 0x02, 0x3c, 0x30, 0x82, 0x01, 0xa5, 0x02, 0x10, 0x3f, 0x69, 0x1e, 0x81, 0x9c, 0xf0, 0x9a, 0x4a, 0xf3, 0x73, 0xff, 0xb9, 0x48, 0xa2, 0xe4, 0xdd, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x5f, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x37, 0x30, 0x35, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x31, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x1e, 0x17, 0x0d, 0x39, 0x36, 0x30, 0x31, 0x32, 0x39, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x32, 0x38, 0x30, 0x38, 0x30, 0x32, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x5f, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x37, 0x30, 0x35, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x31, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xe5, 0x19, 0xbf, 0x6d, 0xa3, 0x56, 0x61, 0x2d, 0x99, 0x48, 0x71, 0xf6, 0x67, 0xde, 0xb9, 0x8d, 0xeb, 0xb7, 0x9e, 0x86, 0x80, 0x0a, 0x91, 0x0e, 0xfa, 0x38, 0x25, 0xaf, 0x46, 0x88, 0x82, 0xe5, 0x73, 0xa8, 0xa0, 0x9b, 0x24, 0x5d, 0x0d, 0x1f, 0xcc, 0x65, 0x6e, 0x0c, 0xb0, 0xd0, 0x56, 0x84, 0x18, 0x87, 0x9a, 0x06, 0x9b, 0x10, 0xa1, 0x73, 0xdf, 0xb4, 0x58, 0x39, 0x6b, 0x6e, 0xc1, 0xf6, 0x15, 0xd5, 0xa8, 0xa8, 0x3f, 0xaa, 0x12, 0x06, 0x8d, 0x31, 0xac, 0x7f, 0xb0, 0x34, 0xd7, 0x8f, 0x34, 0x67, 0x88, 0x09, 0xcd, 0x14, 0x11, 0xe2, 0x4e, 0x45, 0x56, 0x69, 0x1f, 0x78, 0x02, 0x80, 0xda, 0xdc, 0x47, 0x91, 0x29, 0xbb, 0x36, 0xc9, 0x63, 0x5c, 0xc5, 0xe0, 0xd7, 0x2d, 0x87, 0x7b, 0xa1, 0xb7, 0x32, 0xb0, 0x7b, 0x30, 0xba, 0x2a, 0x2f, 0x31, 0xaa, 0xee, 0xa3, 0x67, 0xda, 0xdb, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x58, 0x15, 0x29, 0x39, 0x3c, 0x77, 0xa3, 0xda, 0x5c, 0x25, 0x03, 0x7c, 0x60, 0xfa, 0xee, 0x09, 0x99, 0x3c, 0x27, 0x10, 0x70, 0xc8, 0x0c, 0x09, 0xe6, 0xb3, 0x87, 0xcf, 0x0a, 0xe2, 0x18, 0x96, 0x35, 0x62, 0xcc, 0xbf, 0x9b, 0x27, 0x79, 0x89, 0x5f, 0xc9, 0xc4, 0x09, 0xf4, 0xce, 0xb5, 0x1d, 0xdf, 0x2a, 0xbd, 0xe5, 0xdb, 0x86, 0x9c, 0x68, 0x25, 0xe5, 0x30, 0x7c, 0xb6, 0x89, 0x15, 0xfe, 0x67, 0xd1, 0xad, 0xe1, 0x50, 0xac, 0x3c, 0x7c, 0x62, 0x4b, 0x8f, 0xba, 0x84, 0xd7, 0x12, 0x15, 0x1b, 0x1f, 0xca, 0x5d, 0x0f, 0xc1, 0x52, 0x94, 0x2a, 0x11, 0x99, 0xda, 0x7b, 0xcf, 0x0c, 0x36, 0x13, 0xd5, 0x35, 0xdc, 0x10, 0x19, 0x59, 0xea, 0x94, 0xc1, 0x00, 0xbf, 0x75, 0x8f, 0xd9, 0xfa, 0xfd, 0x76, 0x04, 0xdb, 0x62, 0xbb, 0x90, 0x6a, 0x03, 0xd9, 0x46, 0x35, 0xd9, 0xf8, 0x7c, 0x5b, }; static const unsigned char verisign_v1_ca_subject[] = { 0x30, 0x5f, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0e, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x37, 0x30, 0x35, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x31, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, }; static const unsigned char verisign_v1_ca_public_key[] = { 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xe5, 0x19, 0xbf, 0x6d, 0xa3, 0x56, 0x61, 0x2d, 0x99, 0x48, 0x71, 0xf6, 0x67, 0xde, 0xb9, 0x8d, 0xeb, 0xb7, 0x9e, 0x86, 0x80, 0x0a, 0x91, 0x0e, 0xfa, 0x38, 0x25, 0xaf, 0x46, 0x88, 0x82, 0xe5, 0x73, 0xa8, 0xa0, 0x9b, 0x24, 0x5d, 0x0d, 0x1f, 0xcc, 0x65, 0x6e, 0x0c, 0xb0, 0xd0, 0x56, 0x84, 0x18, 0x87, 0x9a, 0x06, 0x9b, 0x10, 0xa1, 0x73, 0xdf, 0xb4, 0x58, 0x39, 0x6b, 0x6e, 0xc1, 0xf6, 0x15, 0xd5, 0xa8, 0xa8, 0x3f, 0xaa, 0x12, 0x06, 0x8d, 0x31, 0xac, 0x7f, 0xb0, 0x34, 0xd7, 0x8f, 0x34, 0x67, 0x88, 0x09, 0xcd, 0x14, 0x11, 0xe2, 0x4e, 0x45, 0x56, 0x69, 0x1f, 0x78, 0x02, 0x80, 0xda, 0xdc, 0x47, 0x91, 0x29, 0xbb, 0x36, 0xc9, 0x63, 0x5c, 0xc5, 0xe0, 0xd7, 0x2d, 0x87, 0x7b, 0xa1, 0xb7, 0x32, 0xb0, 0x7b, 0x30, 0xba, 0x2a, 0x2f, 0x31, 0xaa, 0xee, 0xa3, 0x67, 0xda, 0xdb, 0x02, 0x03, 0x01, 0x00, 0x01, }; static const char test_text[] = "This is the file text"; static const char test_eku_server_and_client[] = { 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, }; static const char test_eku_server[] = { 0x30, 0x0a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, }; static const char test_eku_email[] = { 0x30, 0x0a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04 }; static const char test_eku_none[] = { 0x30, 0x00, }; void test_check_file_msg (const char *file, int line, const char *function, const char *directory, const char *filename, const char *reference); void test_check_data_msg (const char *file, int line, const char *function, const char *directory, const char *filename, const void *refdata, long reflen); #ifdef OS_UNIX void test_check_symlink_msg (const char *file, int line, const char *function, const char *directory, const char *name, const char *destination); #endif /* OS_UNIX */ p11_dict * test_check_directory_files (const char *file, ...) GNUC_NULL_TERMINATED; void test_check_directory_msg (const char *file, int line, const char *function, const char *directory, p11_dict *files); #define test_check_file(directory, name, reference) \ (test_check_file_msg (__FILE__, __LINE__, __FUNCTION__, directory, name, reference)) #define test_check_data(directory, name, data, length) \ (test_check_data_msg (__FILE__, __LINE__, __FUNCTION__, directory, name, data, length)) #ifdef OS_UNIX #define test_check_symlink(directory, name, destination) \ (test_check_symlink_msg (__FILE__, __LINE__, __FUNCTION__, directory, name, destination)) #endif /* OS_UNIX */ #define test_check_directory(directory, files) \ (test_check_directory_msg (__FILE__, __LINE__, __FUNCTION__, directory, \ test_check_directory_files files)) #define test_write_file(directory, name, data, length) \ (test_write_file_msg (__FILE__, __LINE__, __FUNCTION__, directory, name, data, length)) void test_write_file_msg (const char *file, int line, const char *function, const char *directory, const char *name, const void *contents, size_t length); #define test_delete_file(directory, name) \ (test_delete_file_msg (__FILE__, __LINE__, __FUNCTION__, directory, name)) void test_delete_file_msg (const char *file, int line, const char *function, const char *directory, const char *name); #define test_delete_directory(directory) \ (test_delete_directory_msg (__FILE__, __LINE__, __FUNCTION__, directory)) void test_delete_directory_msg (const char *file, int line, const char *function, const char *directory); #endif /* TEST_DATA_H_ */ p11-kit-0.20.2/trust/tests/test-bundle.c0000664000175000017500000001472412226763526014644 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #define P11_KIT_DISABLE_DEPRECATED #include "config.h" #include "test-trust.h" #include "attrs.h" #include "compat.h" #include "debug.h" #include "dict.h" #include "extract.h" #include "message.h" #include "mock.h" #include "path.h" #include "pkcs11.h" #include "pkcs11x.h" #include "oid.h" #include "test.h" #include #include #include #include #include struct { CK_FUNCTION_LIST module; p11_enumerate ex; char *directory; } test; static void setup (void *unused) { CK_RV rv; mock_module_reset (); memcpy (&test.module, &mock_module, sizeof (CK_FUNCTION_LIST)); rv = test.module.C_Initialize (NULL); assert_num_eq (CKR_OK, rv); p11_enumerate_init (&test.ex); test.directory = p11_test_directory ("test-extract"); } static void teardown (void *unused) { CK_RV rv; if (rmdir (test.directory) < 0) assert_not_reached (); free (test.directory); p11_enumerate_cleanup (&test.ex); rv = test.module.C_Finalize (NULL); assert_num_eq (CKR_OK, rv); } static CK_OBJECT_CLASS certificate_class = CKO_CERTIFICATE; static CK_CERTIFICATE_TYPE x509_type = CKC_X_509; static CK_ATTRIBUTE cacert3_authority_attrs[] = { { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_CERTIFICATE_TYPE, &x509_type, sizeof (x509_type) }, { CKA_LABEL, "Cacert3 Here", 12 }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_ID, "ID1", 3 }, { CKA_INVALID }, }; static CK_ATTRIBUTE certificate_filter[] = { { CKA_CLASS, &certificate_class, sizeof (certificate_class) }, { CKA_INVALID }, }; static void test_file (void) { char *destination; bool ret; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_authority_attrs); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.pem") < 0) assert_not_reached (); ret = p11_extract_pem_bundle (&test.ex, destination); assert_num_eq (true, ret); test_check_file (test.directory, "extract.pem", SRCDIR "/files/cacert3.pem"); free (destination); } static void test_file_multiple (void) { char *destination; bool ret; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_authority_attrs); mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_authority_attrs); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.pem") < 0) assert_not_reached (); ret = p11_extract_pem_bundle (&test.ex, destination); assert_num_eq (true, ret); test_check_file (test.directory, "extract.pem", SRCDIR "/files/cacert3-twice.pem"); free (destination); } static void test_file_without (void) { char *destination; bool ret; p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); if (asprintf (&destination, "%s/%s", test.directory, "extract.pem") < 0) assert_not_reached (); ret = p11_extract_pem_bundle (&test.ex, destination); assert_num_eq (true, ret); test_check_data (test.directory, "extract.pem", "", 0); free (destination); } static void test_directory (void) { bool ret; mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_authority_attrs); mock_module_add_object (MOCK_SLOT_ONE_ID, cacert3_authority_attrs); p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); /* Yes, this is a race, and why you shouldn't build software as root */ if (rmdir (test.directory) < 0) assert_not_reached (); ret = p11_extract_pem_directory (&test.ex, test.directory); assert_num_eq (true, ret); test_check_directory (test.directory, ("Cacert3_Here.pem", "Cacert3_Here.1.pem", NULL)); test_check_file (test.directory, "Cacert3_Here.pem", SRCDIR "/files/cacert3.pem"); test_check_file (test.directory, "Cacert3_Here.1.pem", SRCDIR "/files/cacert3.pem"); } static void test_directory_empty (void) { bool ret; p11_kit_iter_add_filter (test.ex.iter, certificate_filter, 1); p11_kit_iter_begin_with (test.ex.iter, &test.module, 0, 0); /* Yes, this is a race, and why you shouldn't build software as root */ if (rmdir (test.directory) < 0) assert_not_reached (); ret = p11_extract_pem_directory (&test.ex, test.directory); assert_num_eq (true, ret); test_check_directory (test.directory, (NULL, NULL)); } int main (int argc, char *argv[]) { mock_module_init (); p11_fixture (setup, teardown); p11_test (test_file, "/pem/test_file"); p11_test (test_file_multiple, "/pem/test_file_multiple"); p11_test (test_file_without, "/pem/test_file_without"); p11_test (test_directory, "/pem/test_directory"); p11_test (test_directory_empty, "/pem/test_directory_empty"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/Makefile.am0000664000175000017500000000404712265210534014270 00000000000000 include $(top_srcdir)/build/Makefile.tests COMMON = $(top_srcdir)/common TRUST = $(top_srcdir)/trust AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(srcdir)/.. \ -I$(top_srcdir)/p11-kit \ -I$(COMMON) \ -DDATADIR=\"$(datadir)\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -DP11_KIT_FUTURE_UNSTABLE_API \ $(LIBTASN1_CFLAGS) \ $(TEST_CFLAGS) \ $(NULL) noinst_LTLIBRARIES = \ libtrust-test.la libtrust_test_la_SOURCES = \ test-trust.c test-trust.h \ $(TRUST)/digest.c LDADD = \ $(top_builddir)/trust/libtrust-testable.la \ $(top_builddir)/trust/libtrust-data.la \ $(builddir)/libtrust-test.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la \ $(LIBTASN1_LIBS) \ $(HASH_LIBS) \ $(NULL) CHECK_PROGS = \ test-digest \ test-asn1 \ test-base64 \ test-pem \ test-oid \ test-utf8 \ test-x509 \ test-persist \ test-index \ test-parser \ test-builder \ test-token \ test-module \ test-save \ test-enumerate \ test-cer \ test-bundle \ test-openssl \ $(NULL) noinst_PROGRAMS = \ frob-pow \ frob-token \ frob-nss-trust \ frob-cert \ frob-bc \ frob-ku \ frob-eku \ frob-ext \ frob-cert \ frob-oid \ $(CHECK_PROGS) frob_nss_trust_LDADD = \ $(top_builddir)/common/libp11-common.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(HASH_LIBS) \ $(NULL) TESTS = $(CHECK_PROGS) EXTRA_DIST = \ input \ files \ $(NULL) TEST_RUNNER = libtool --mode=execute test_save_SOURCES = \ test-save.c \ $(TRUST)/save.c \ $(NULL) test_enumerate_SOURCES = \ test-enumerate.c \ $(TRUST)/enumerate.c \ $(NULL) test_cer_SOURCES = \ test-cer.c \ $(TRUST)/enumerate.c \ $(TRUST)/extract-cer.c \ $(TRUST)/save.c \ $(NULL) test_bundle_SOURCES = \ test-bundle.c \ $(TRUST)/enumerate.c \ $(TRUST)/extract-pem.c \ $(TRUST)/save.c \ $(NULL) test_openssl_SOURCES = \ test-openssl.c \ $(TRUST)/enumerate.c \ $(TRUST)/extract-openssl.c \ $(TRUST)/save.c \ $(NULL) noinst_SCRIPTS = \ test-extract installcheck-local: sh $(builddir)/test-extract p11-kit-0.20.2/trust/tests/test-base64.c0000664000175000017500000002722312226763526014455 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "base64.h" #include "debug.h" #include "message.h" #include #include #include #include static void check_decode_msg (const char *file, int line, const char *function, const char *input, ssize_t input_len, const unsigned char *expected, ssize_t expected_len) { unsigned char decoded[8192]; int length; if (input_len < 0) input_len = strlen (input); if (expected_len < 0) expected_len = strlen ((char *)expected); length = p11_b64_pton (input, input_len, decoded, sizeof (decoded)); if (expected == NULL) { if (length >= 0) p11_test_fail (file, line, function, "decoding should have failed"); } else { if (length < 0) p11_test_fail (file, line, function, "decoding failed"); if (expected_len != length) p11_test_fail (file, line, function, "wrong length: (%lu != %lu)", (unsigned long)expected_len, (unsigned long)length); if (memcmp (decoded, expected, length) != 0) p11_test_fail (file, line, function, "decoded wrong"); } } #define check_decode_success(input, input_len, expected, expected_len) \ check_decode_msg (__FILE__, __LINE__, __FUNCTION__, input, input_len, expected, expected_len) #define check_decode_failure(input, input_len) \ check_decode_msg (__FILE__, __LINE__, __FUNCTION__, input, input_len, NULL, 0) static void test_decode_simple (void) { check_decode_success ("", 0, (unsigned char *)"", 0); check_decode_success ("MQ==", 0, (unsigned char *)"1", 0); check_decode_success ("YmxhaAo=", -1, (unsigned char *)"blah\n", -1); check_decode_success ("bGVlbGEK", -1, (unsigned char *)"leela\n", -1); check_decode_success ("bGVlbG9vCg==", -1, (unsigned char *)"leeloo\n", -1); } static void test_decode_thawte (void) { const char *input = "MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB" "rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf" "Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw" "MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV" "BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa" "Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl" "LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u" "MTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl" "ZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz" "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm" "gcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8" "YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf" "b1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9" "9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S" "zhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk" "OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV" "HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA" "2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW" "oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu" "t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c" "KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM" "m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu" "MdRAGmI0Nj81Aa6sY6A="; const unsigned char output[] = { 0x30, 0x82, 0x04, 0x2a, 0x30, 0x82, 0x03, 0x12, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x60, 0x01, 0x97, 0xb7, 0x46, 0xa7, 0xea, 0xb4, 0xb4, 0x9a, 0xd6, 0x4b, 0x2f, 0xf7, 0x90, 0xfb, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x81, 0xae, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0c, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x28, 0x30, 0x26, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1f, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x44, 0x69, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x31, 0x38, 0x30, 0x36, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x31, 0x24, 0x30, 0x22, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1b, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x33, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x38, 0x30, 0x34, 0x30, 0x32, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x33, 0x37, 0x31, 0x32, 0x30, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x81, 0xae, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0c, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x28, 0x30, 0x26, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x1f, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x44, 0x69, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x31, 0x38, 0x30, 0x36, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x31, 0x24, 0x30, 0x22, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1b, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x33, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xb2, 0xbf, 0x27, 0x2c, 0xfb, 0xdb, 0xd8, 0x5b, 0xdd, 0x78, 0x7b, 0x1b, 0x9e, 0x77, 0x66, 0x81, 0xcb, 0x3e, 0xbc, 0x7c, 0xae, 0xf3, 0xa6, 0x27, 0x9a, 0x34, 0xa3, 0x68, 0x31, 0x71, 0x38, 0x33, 0x62, 0xe4, 0xf3, 0x71, 0x66, 0x79, 0xb1, 0xa9, 0x65, 0xa3, 0xa5, 0x8b, 0xd5, 0x8f, 0x60, 0x2d, 0x3f, 0x42, 0xcc, 0xaa, 0x6b, 0x32, 0xc0, 0x23, 0xcb, 0x2c, 0x41, 0xdd, 0xe4, 0xdf, 0xfc, 0x61, 0x9c, 0xe2, 0x73, 0xb2, 0x22, 0x95, 0x11, 0x43, 0x18, 0x5f, 0xc4, 0xb6, 0x1f, 0x57, 0x6c, 0x0a, 0x05, 0x58, 0x22, 0xc8, 0x36, 0x4c, 0x3a, 0x7c, 0xa5, 0xd1, 0xcf, 0x86, 0xaf, 0x88, 0xa7, 0x44, 0x02, 0x13, 0x74, 0x71, 0x73, 0x0a, 0x42, 0x59, 0x02, 0xf8, 0x1b, 0x14, 0x6b, 0x42, 0xdf, 0x6f, 0x5f, 0xba, 0x6b, 0x82, 0xa2, 0x9d, 0x5b, 0xe7, 0x4a, 0xbd, 0x1e, 0x01, 0x72, 0xdb, 0x4b, 0x74, 0xe8, 0x3b, 0x7f, 0x7f, 0x7d, 0x1f, 0x04, 0xb4, 0x26, 0x9b, 0xe0, 0xb4, 0x5a, 0xac, 0x47, 0x3d, 0x55, 0xb8, 0xd7, 0xb0, 0x26, 0x52, 0x28, 0x01, 0x31, 0x40, 0x66, 0xd8, 0xd9, 0x24, 0xbd, 0xf6, 0x2a, 0xd8, 0xec, 0x21, 0x49, 0x5c, 0x9b, 0xf6, 0x7a, 0xe9, 0x7f, 0x55, 0x35, 0x7e, 0x96, 0x6b, 0x8d, 0x93, 0x93, 0x27, 0xcb, 0x92, 0xbb, 0xea, 0xac, 0x40, 0xc0, 0x9f, 0xc2, 0xf8, 0x80, 0xcf, 0x5d, 0xf4, 0x5a, 0xdc, 0xce, 0x74, 0x86, 0xa6, 0x3e, 0x6c, 0x0b, 0x53, 0xca, 0xbd, 0x92, 0xce, 0x19, 0x06, 0x72, 0xe6, 0x0c, 0x5c, 0x38, 0x69, 0xc7, 0x04, 0xd6, 0xbc, 0x6c, 0xce, 0x5b, 0xf6, 0xf7, 0x68, 0x9c, 0xdc, 0x25, 0x15, 0x48, 0x88, 0xa1, 0xe9, 0xa9, 0xf8, 0x98, 0x9c, 0xe0, 0xf3, 0xd5, 0x31, 0x28, 0x61, 0x11, 0x6c, 0x67, 0x96, 0x8d, 0x39, 0x99, 0xcb, 0xc2, 0x45, 0x24, 0x39, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x42, 0x30, 0x40, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xad, 0x6c, 0xaa, 0x94, 0x60, 0x9c, 0xed, 0xe4, 0xff, 0xfa, 0x3e, 0x0a, 0x74, 0x2b, 0x63, 0x03, 0xf7, 0xb6, 0x59, 0xbf, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x1a, 0x40, 0xd8, 0x95, 0x65, 0xac, 0x09, 0x92, 0x89, 0xc6, 0x39, 0xf4, 0x10, 0xe5, 0xa9, 0x0e, 0x66, 0x53, 0x5d, 0x78, 0xde, 0xfa, 0x24, 0x91, 0xbb, 0xe7, 0x44, 0x51, 0xdf, 0xc6, 0x16, 0x34, 0x0a, 0xef, 0x6a, 0x44, 0x51, 0xea, 0x2b, 0x07, 0x8a, 0x03, 0x7a, 0xc3, 0xeb, 0x3f, 0x0a, 0x2c, 0x52, 0x16, 0xa0, 0x2b, 0x43, 0xb9, 0x25, 0x90, 0x3f, 0x70, 0xa9, 0x33, 0x25, 0x6d, 0x45, 0x1a, 0x28, 0x3b, 0x27, 0xcf, 0xaa, 0xc3, 0x29, 0x42, 0x1b, 0xdf, 0x3b, 0x4c, 0xc0, 0x33, 0x34, 0x5b, 0x41, 0x88, 0xbf, 0x6b, 0x2b, 0x65, 0xaf, 0x28, 0xef, 0xb2, 0xf5, 0xc3, 0xaa, 0x66, 0xce, 0x7b, 0x56, 0xee, 0xb7, 0xc8, 0xcb, 0x67, 0xc1, 0xc9, 0x9c, 0x1a, 0x18, 0xb8, 0xc4, 0xc3, 0x49, 0x03, 0xf1, 0x60, 0x0e, 0x50, 0xcd, 0x46, 0xc5, 0xf3, 0x77, 0x79, 0xf7, 0xb6, 0x15, 0xe0, 0x38, 0xdb, 0xc7, 0x2f, 0x28, 0xa0, 0x0c, 0x3f, 0x77, 0x26, 0x74, 0xd9, 0x25, 0x12, 0xda, 0x31, 0xda, 0x1a, 0x1e, 0xdc, 0x29, 0x41, 0x91, 0x22, 0x3c, 0x69, 0xa7, 0xbb, 0x02, 0xf2, 0xb6, 0x5c, 0x27, 0x03, 0x89, 0xf4, 0x06, 0xea, 0x9b, 0xe4, 0x72, 0x82, 0xe3, 0xa1, 0x09, 0xc1, 0xe9, 0x00, 0x19, 0xd3, 0x3e, 0xd4, 0x70, 0x6b, 0xba, 0x71, 0xa6, 0xaa, 0x58, 0xae, 0xf4, 0xbb, 0xe9, 0x6c, 0xb6, 0xef, 0x87, 0xcc, 0x9b, 0xbb, 0xff, 0x39, 0xe6, 0x56, 0x61, 0xd3, 0x0a, 0xa7, 0xc4, 0x5c, 0x4c, 0x60, 0x7b, 0x05, 0x77, 0x26, 0x7a, 0xbf, 0xd8, 0x07, 0x52, 0x2c, 0x62, 0xf7, 0x70, 0x63, 0xd9, 0x39, 0xbc, 0x6f, 0x1c, 0xc2, 0x79, 0xdc, 0x76, 0x29, 0xaf, 0xce, 0xc5, 0x2c, 0x64, 0x04, 0x5e, 0x88, 0x36, 0x6e, 0x31, 0xd4, 0x40, 0x1a, 0x62, 0x34, 0x36, 0x3f, 0x35, 0x01, 0xae, 0xac, 0x63, 0xa0, }; check_decode_success (input, -1, output, sizeof (output)); } int main (int argc, char *argv[]) { p11_test (test_decode_simple, "/base64/decode-simple"); p11_test (test_decode_thawte, "/base64/decode-thawte"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/test-trust.c0000664000175000017500000002624112226763526014551 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "attrs.h" #include "debug.h" #include "message.h" #include "path.h" #include "test.h" #include "test-trust.h" #include #include #include #include #include #include #include #include #include #include #ifdef OS_UNIX #include #endif void test_check_object_msg (const char *file, int line, const char *function, CK_ATTRIBUTE *attrs, CK_OBJECT_CLASS klass, const char *label) { CK_BBOOL vfalse = CK_FALSE; CK_ATTRIBUTE expected[] = { { CKA_PRIVATE, &vfalse, sizeof (vfalse) }, { CKA_CLASS, &klass, sizeof (klass) }, { label ? CKA_LABEL : CKA_INVALID, (void *)label, label ? strlen (label) : 0 }, { CKA_INVALID }, }; test_check_attrs_msg (file, line, function, expected, attrs); } void test_check_cacert3_ca_msg (const char *file, int line, const char *function, CK_ATTRIBUTE *attrs, const char *label) { CK_CERTIFICATE_TYPE x509 = CKC_X_509; CK_ULONG category = 2; /* authority */ CK_ATTRIBUTE expected[] = { { CKA_CERTIFICATE_TYPE, &x509, sizeof (x509) }, { CKA_CERTIFICATE_CATEGORY, &category, sizeof (category) }, { CKA_VALUE, (void *)test_cacert3_ca_der, sizeof (test_cacert3_ca_der) }, { CKA_CHECK_VALUE, "\xad\x7c\x3f", 3 }, { CKA_START_DATE, "20110523", 8 }, { CKA_END_DATE, "20210520", 8, }, { CKA_SUBJECT, (void *)test_cacert3_ca_subject, sizeof (test_cacert3_ca_subject) }, { CKA_ISSUER, (void *)test_cacert3_ca_issuer, sizeof (test_cacert3_ca_issuer) }, { CKA_SERIAL_NUMBER, (void *)test_cacert3_ca_serial, sizeof (test_cacert3_ca_serial) }, { CKA_INVALID }, }; test_check_object_msg (file, line, function, attrs, CKO_CERTIFICATE, label); test_check_attrs_msg (file, line, function, expected, attrs); } void test_check_id_msg (const char *file, int line, const char *function, CK_ATTRIBUTE *expected, CK_ATTRIBUTE *attr) { CK_ATTRIBUTE *one; CK_ATTRIBUTE *two; one = p11_attrs_find (expected, CKA_ID); two = p11_attrs_find (attr, CKA_ID); test_check_attr_msg (file, line, function, CKA_INVALID, one, two); } void test_check_attrs_msg (const char *file, int line, const char *function, CK_ATTRIBUTE *expected, CK_ATTRIBUTE *attrs) { CK_OBJECT_CLASS klass; CK_ATTRIBUTE *attr; if (!p11_attrs_find_ulong (expected, CKA_CLASS, &klass)) klass = CKA_INVALID; while (!p11_attrs_terminator (expected)) { attr = p11_attrs_find (attrs, expected->type); test_check_attr_msg (file, line, function, klass, expected, attr); expected++; } } void test_check_attr_msg (const char *file, int line, const char *function, CK_OBJECT_CLASS klass, CK_ATTRIBUTE *expected, CK_ATTRIBUTE *attr) { assert (expected != NULL); if (attr == NULL) { p11_test_fail (file, line, function, "attribute does not match: (expected %s but found NULL)", p11_attr_to_string (expected, klass)); } if (!p11_attr_equal (attr, expected)) { p11_test_fail (file, line, function, "attribute does not match: (expected %s but found %s)", p11_attr_to_string (expected, klass), attr ? p11_attr_to_string (attr, klass) : "(null)"); } } static char * read_file (const char *file, int line, const char *function, const char *filename, long *len) { struct stat sb; FILE *f = NULL; char *data; f = fopen (filename, "rb"); if (f == NULL) p11_test_fail (file, line, function, "Couldn't open file: %s", filename); /* Figure out size */ if (stat (filename, &sb) < 0) p11_test_fail (file, line, function, "Couldn't stat file: %s", filename); *len = sb.st_size; data = malloc (*len ? *len : 1); assert (data != NULL); /* And read in one block */ if (fread (data, 1, *len, f) != *len) p11_test_fail (file, line, function, "Couldn't read file: %s", filename); fclose (f); return data; } void test_check_file_msg (const char *file, int line, const char *function, const char *directory, const char *name, const char *reference) { char *refdata; long reflen; refdata = read_file (file, line, function, reference, &reflen); test_check_data_msg (file, line, function, directory, name, refdata, reflen); free (refdata); } void test_check_data_msg (const char *file, int line, const char *function, const char *directory, const char *name, const void *refdata, long reflen) { char *filedata; char *filename; long filelen; if (asprintf (&filename, "%s/%s", directory, name) < 0) assert_not_reached (); filedata = read_file (file, line, function, filename, &filelen); if (filelen != reflen || memcmp (filedata, refdata, reflen) != 0) p11_test_fail (file, line, function, "File contents not as expected: %s", filename); if (unlink (filename) < 0) p11_test_fail (file, line, function, "Couldn't remove file: %s", filename); free (filename); free (filedata); } #ifdef OS_UNIX void test_check_symlink_msg (const char *file, int line, const char *function, const char *directory, const char *name, const char *destination) { char buf[1024] = { 0, }; char *filename; if (asprintf (&filename, "%s/%s", directory, name) < 0) assert_not_reached (); if (readlink (filename, buf, sizeof (buf)) < 0) p11_test_fail (file, line, function, "Couldn't read symlink: %s", filename); if (strcmp (destination, buf) != 0) p11_test_fail (file, line, function, "Symlink contents wrong: %s != %s", destination, buf); if (unlink (filename) < 0) p11_test_fail (file, line, function, "Couldn't remove symlink: %s", filename); free (filename); } #endif /* OS_UNIX */ p11_dict * test_check_directory_files (const char *file, ...) { p11_dict *files; va_list va; files = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, NULL, NULL); va_start (va, file); while (file != NULL) { if (!p11_dict_set (files, (void *)file, (void *)file)) return_val_if_reached (NULL); file = va_arg (va, const char *); } va_end (va); return files; } void test_check_directory_msg (const char *file, int line, const char *function, const char *directory, p11_dict *files) { p11_dictiter iter; struct dirent *dp; const char *name; DIR *dir; dir = opendir (directory); if (dir == NULL) p11_test_fail (file ,line, function, "Couldn't open directory: %s", directory); while ((dp = readdir (dir)) != NULL) { if (strcmp (dp->d_name, ".") == 0 || strcmp (dp->d_name, "..") == 0) continue; if (!p11_dict_remove (files, dp->d_name)) p11_test_fail (file, line, function, "Unexpected file in directory: %s", dp->d_name); } closedir (dir); #ifdef OS_UNIX if (chmod (directory, S_IRWXU) < 0) p11_test_fail (file, line, function, "couldn't chown directory: %s: %s", directory, strerror (errno)); #endif p11_dict_iterate (files, &iter); while (p11_dict_next (&iter, (void **)&name, NULL)) p11_test_fail (file, line, function, "Couldn't find file in directory: %s", name); p11_dict_free (files); } void test_write_file_msg (const char *file, int line, const char *function, const char *directory, const char *name, const void *contents, size_t length) { char *path; FILE *f; if (asprintf (&path, "%s/%s", directory, name) < 0) assert_not_reached (); f = fopen (path, "wb"); if (f == NULL) { p11_test_fail (file, line, function, "Couldn't open file for writing: %s: %s", path, strerror (errno)); } if (fwrite (contents, 1, length, f) != length || fclose (f) != 0) { p11_test_fail (file, line, function, "Couldn't write file: %s: %s", path, strerror (errno)); } free (path); } void test_delete_file_msg (const char *file, int line, const char *function, const char *directory, const char *name) { char *path; if (asprintf (&path, "%s/%s", directory, name) < 0) assert_not_reached (); if (unlink (path) < 0) p11_test_fail (file, line, function, "Couldn't delete file: %s", path); free (path); } void test_delete_directory_msg (const char *file, int line, const char *function, const char *directory) { struct dirent *dp; DIR *dir; dir = opendir (directory); if (dir == NULL) p11_test_fail (file ,line, function, "Couldn't open directory: %s", directory); while ((dp = readdir (dir)) != NULL) { if (strcmp (dp->d_name, ".") == 0 || strcmp (dp->d_name, "..") == 0) continue; test_delete_file_msg (file, line, function, directory, dp->d_name); } closedir (dir); if (rmdir (directory) < 0) p11_test_fail (file, line, function, "Couldn't remove directory: %s", directory); } p11-kit-0.20.2/trust/tests/test-module.c0000664000175000017500000007676212226763526014672 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #define CRYPTOKI_EXPORTS #include "config.h" #include "test.h" #include "test-trust.h" #include #include #include #include "attrs.h" #include "digest.h" #include "library.h" #include "path.h" #include "parser.h" #include "pkcs11x.h" #include "token.h" #include /* * This is the number of input paths. Should match the * paths below near : * * paths='%s' */ #define NUM_SLOTS 3 static CK_OBJECT_CLASS data = CKO_DATA; static CK_BBOOL vtrue = CK_TRUE; static CK_BBOOL vfalse = CK_FALSE; struct { CK_FUNCTION_LIST *module; CK_SLOT_ID slots[NUM_SLOTS]; char *directory; p11_asn1_cache *cache; p11_parser *parser; } test; static void setup (void *unused) { CK_C_INITIALIZE_ARGS args; const char *paths; char *arguments; CK_ULONG count; CK_RV rv; memset (&test, 0, sizeof (test)); /* This is the entry point of the trust module, linked to this test */ rv = C_GetFunctionList (&test.module); assert (rv == CKR_OK); memset (&args, 0, sizeof (args)); paths = SRCDIR "/input" P11_PATH_SEP \ SRCDIR "/files/self-signed-with-ku.der" P11_PATH_SEP \ SRCDIR "/files/thawte.pem"; if (asprintf (&arguments, "paths='%s'", paths) < 0) assert (false && "not reached"); args.pReserved = arguments; args.flags = CKF_OS_LOCKING_OK; rv = test.module->C_Initialize (&args); assert (rv == CKR_OK); free (arguments); count = NUM_SLOTS; rv = test.module->C_GetSlotList (CK_TRUE, test.slots, &count); assert (rv == CKR_OK); assert (count == NUM_SLOTS); } static void teardown (void *unused) { CK_RV rv; if (test.parser) p11_parser_free (test.parser); p11_asn1_cache_free (test.cache); rv = test.module->C_Finalize (NULL); assert (rv == CKR_OK); free (test.directory); memset (&test, 0, sizeof (test)); } static void setup_writable (void *unused) { CK_C_INITIALIZE_ARGS args; char *arguments; CK_ULONG count; CK_RV rv; memset (&test, 0, sizeof (test)); /* This is the entry point of the trust module, linked to this test */ rv = C_GetFunctionList (&test.module); assert (rv == CKR_OK); test.directory = p11_test_directory ("test-module"); memset (&args, 0, sizeof (args)); if (asprintf (&arguments, "paths='%s'", test.directory) < 0) assert (false && "not reached"); args.pReserved = arguments; args.flags = CKF_OS_LOCKING_OK; rv = test.module->C_Initialize (&args); assert (rv == CKR_OK); free (arguments); count = 1; rv = test.module->C_GetSlotList (CK_TRUE, test.slots, &count); assert_num_eq (rv, CKR_OK); assert_num_eq (count, 1); test.cache = p11_asn1_cache_new (); test.parser = p11_parser_new (test.cache); p11_parser_formats (test.parser, p11_parser_format_persist, NULL); } static void test_get_slot_list (void) { CK_SLOT_ID slots[NUM_SLOTS]; CK_ULONG count; CK_RV rv; int i; rv = test.module->C_GetSlotList (TRUE, NULL, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (NUM_SLOTS, count); count = 1; rv = test.module->C_GetSlotList (TRUE, slots, &count); assert_num_eq (CKR_BUFFER_TOO_SMALL, rv); assert_num_eq (NUM_SLOTS, count); count = NUM_SLOTS; memset (slots, 0, sizeof (slots)); rv = test.module->C_GetSlotList (TRUE, slots, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (NUM_SLOTS, count); for (i = 0; i < NUM_SLOTS; i++) assert (slots[i] != 0); } static void test_null_initialize (void) { CK_FUNCTION_LIST *module; CK_RV rv; /* This is the entry point of the trust module, linked to this test */ rv = C_GetFunctionList (&module); assert_num_eq (rv, CKR_OK); rv = module->C_Initialize (NULL); assert_num_eq (rv, CKR_OK); rv = module->C_Finalize (NULL); assert_num_eq (CKR_OK, rv); } static void test_multi_initialize (void) { static CK_C_INITIALIZE_ARGS args = { NULL, NULL, NULL, NULL, CKF_OS_LOCKING_OK, NULL, }; CK_FUNCTION_LIST *module; CK_SESSION_HANDLE session; CK_SLOT_ID slots[8]; CK_SESSION_INFO info; CK_ULONG count; CK_RV rv; /* This is the entry point of the trust module, linked to this test */ rv = C_GetFunctionList (&module); assert_num_eq (rv, CKR_OK); rv = module->C_Initialize (&args); assert_num_eq (rv, CKR_OK); count = 8; rv = module->C_GetSlotList (CK_TRUE, slots, &count); assert_num_eq (rv, CKR_OK); assert_num_cmp (count, >, 0); rv = module->C_OpenSession (slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert_num_eq (rv, CKR_OK); rv = module->C_GetSessionInfo (session, &info); assert_num_eq (rv, CKR_OK); assert_num_eq (info.slotID, slots[0]); rv = module->C_Initialize (&args); assert_num_eq (rv, CKR_OK); rv = module->C_GetSessionInfo (session, &info); assert_num_eq (rv, CKR_OK); assert_num_eq (info.slotID, slots[0]); rv = module->C_Finalize (NULL); assert_num_eq (CKR_OK, rv); rv = module->C_Finalize (NULL); assert_num_eq (CKR_OK, rv); rv = module->C_Finalize (NULL); assert_num_eq (CKR_CRYPTOKI_NOT_INITIALIZED, rv); } static void test_get_slot_info (void) { CK_SLOT_ID slots[NUM_SLOTS]; CK_SLOT_INFO info; char description[64]; CK_ULONG count; size_t length; CK_RV rv; int i; /* These are the paths passed in in setup() */ const char *paths[] = { SRCDIR "/input", SRCDIR "/files/self-signed-with-ku.der", SRCDIR "/files/thawte.pem" }; count = NUM_SLOTS; rv = test.module->C_GetSlotList (TRUE, slots, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (NUM_SLOTS, count); for (i = 0; i < NUM_SLOTS; i++) { rv = test.module->C_GetSlotInfo (slots[i], &info); assert_num_eq (CKR_OK, rv); memset (description, ' ', sizeof (description)); length = strlen(paths[i]); if (length > sizeof (description)) length = sizeof (description); memcpy (description, paths[i], length); assert (memcmp (info.slotDescription, description, sizeof (description)) == 0); } } static void test_get_token_info (void) { CK_C_INITIALIZE_ARGS args; CK_FUNCTION_LIST *module; CK_SLOT_ID slots[NUM_SLOTS]; CK_TOKEN_INFO info; char label[32]; CK_ULONG count; CK_RV rv; int i; /* These are the paths passed in in setup() */ const char *labels[] = { "System Trust", "Default Trust", "the-basename", }; /* This is the entry point of the trust module, linked to this test */ rv = C_GetFunctionList (&module); assert (rv == CKR_OK); memset (&args, 0, sizeof (args)); args.pReserved = "paths='" \ SYSCONFDIR "/input" P11_PATH_SEP \ DATADIR "/files/blah" P11_PATH_SEP \ "/some/other/path/the-basename'"; args.flags = CKF_OS_LOCKING_OK; rv = module->C_Initialize (&args); assert (rv == CKR_OK); count = NUM_SLOTS; rv = module->C_GetSlotList (CK_TRUE, slots, &count); assert (rv == CKR_OK); assert (count == NUM_SLOTS); for (i = 0; i < NUM_SLOTS; i++) { rv = module->C_GetTokenInfo (slots[i], &info); assert_num_eq (CKR_OK, rv); memset (label, ' ', sizeof (label)); memcpy (label, labels[i], strlen (labels[i])); assert (memcmp (info.label, label, sizeof (label)) == 0); } rv = module->C_Finalize (NULL); assert_num_eq (CKR_OK, rv); } static void test_get_session_info (void) { CK_SLOT_ID slots[NUM_SLOTS]; CK_SESSION_HANDLE sessions[NUM_SLOTS]; CK_SESSION_INFO info; CK_ULONG count; CK_RV rv; int i; count = NUM_SLOTS; rv = test.module->C_GetSlotList (TRUE, slots, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (NUM_SLOTS, count); /* Open two sessions with each token */ for (i = 0; i < NUM_SLOTS; i++) { rv = test.module->C_OpenSession (slots[i], CKF_SERIAL_SESSION, NULL, NULL, &sessions[i]); assert_num_eq (CKR_OK, rv); rv = test.module->C_GetSessionInfo (sessions[i], &info); assert_num_eq (CKR_OK, rv); assert_num_eq (slots[i], info.slotID); assert_num_eq (CKF_SERIAL_SESSION, info.flags); } } static void test_close_all_sessions (void) { CK_SLOT_ID slots[NUM_SLOTS]; CK_SESSION_HANDLE sessions[NUM_SLOTS][2]; CK_SESSION_INFO info; CK_ULONG count; CK_RV rv; int i; count = NUM_SLOTS; rv = test.module->C_GetSlotList (TRUE, slots, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (NUM_SLOTS, count); /* Open two sessions with each token */ for (i = 0; i < NUM_SLOTS; i++) { rv = test.module->C_OpenSession (slots[i], CKF_SERIAL_SESSION, NULL, NULL, &sessions[i][0]); assert_num_eq (CKR_OK, rv); rv = test.module->C_GetSessionInfo (sessions[i][0], &info); assert_num_eq (CKR_OK, rv); rv = test.module->C_OpenSession (slots[i], CKF_SERIAL_SESSION, NULL, NULL, &sessions[i][1]); assert_num_eq (CKR_OK, rv); rv = test.module->C_GetSessionInfo (sessions[i][0], &info); assert_num_eq (CKR_OK, rv); } /* Close all the sessions on the first token */ rv = test.module->C_CloseAllSessions (slots[0]); assert_num_eq (CKR_OK, rv); /* Those sessions should be closed */ rv = test.module->C_GetSessionInfo (sessions[0][0], &info); assert_num_eq (CKR_SESSION_HANDLE_INVALID, rv); rv = test.module->C_GetSessionInfo (sessions[0][1], &info); assert_num_eq (CKR_SESSION_HANDLE_INVALID, rv); /* Other sessions should still be open */ for (i = 1; i < NUM_SLOTS; i++) { rv = test.module->C_GetSessionInfo (sessions[i][0], &info); assert_num_eq (CKR_OK, rv); rv = test.module->C_GetSessionInfo (sessions[i][0], &info); assert_num_eq (CKR_OK, rv); } } static CK_ULONG find_objects (CK_ATTRIBUTE *match, CK_OBJECT_HANDLE *sessions, CK_OBJECT_HANDLE *objects, CK_ULONG max_objects) { CK_SESSION_HANDLE session; CK_RV rv; CK_ULONG found; CK_ULONG count; int i, j; found = 0; for (i = 0; i < NUM_SLOTS; i++) { rv = test.module->C_OpenSession (test.slots[i], CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); rv = test.module->C_FindObjectsInit (session, match, p11_attrs_count (match)); assert (rv == CKR_OK); rv = test.module->C_FindObjects (session, objects + found, max_objects - found, &count); assert (rv == CKR_OK); rv = test.module->C_FindObjectsFinal (session); assert (rv == CKR_OK); for (j = found ; j < found + count; j++) sessions[j] = session; found += count; } assert (found < max_objects); return found; } static void check_trust_object_equiv (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE trust, CK_ATTRIBUTE *cert) { unsigned char subject[1024]; unsigned char issuer[1024]; unsigned char serial[128]; CK_BBOOL private; CK_BBOOL token; CK_RV rv; /* The following attributes should be equivalent to the certificate */ CK_ATTRIBUTE equiv[] = { { CKA_TOKEN, &token, sizeof (token) }, { CKA_PRIVATE, &private, sizeof (private) }, { CKA_ISSUER, issuer, sizeof (issuer) }, { CKA_SUBJECT, subject, sizeof (subject) }, { CKA_SERIAL_NUMBER, serial, sizeof (serial) }, { CKA_INVALID, }, }; rv = test.module->C_GetAttributeValue (session, trust, equiv, 5); assert_num_eq (CKR_OK, rv); test_check_attrs (equiv, cert); } static void check_trust_object_hashes (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE trust, CK_ATTRIBUTE *cert) { unsigned char sha1[P11_DIGEST_SHA1_LEN]; unsigned char md5[P11_DIGEST_MD5_LEN]; unsigned char check[128]; CK_ATTRIBUTE *value; CK_RV rv; CK_ATTRIBUTE hashes[] = { { CKA_CERT_SHA1_HASH, sha1, sizeof (sha1) }, { CKA_CERT_MD5_HASH, md5, sizeof (md5) }, { CKA_INVALID, }, }; rv = test.module->C_GetAttributeValue (session, trust, hashes, 2); assert (rv == CKR_OK); value = p11_attrs_find_valid (cert, CKA_VALUE); assert_ptr_not_null (value); p11_digest_md5 (check, value->pValue, value->ulValueLen, NULL); assert (memcmp (md5, check, sizeof (md5)) == 0); p11_digest_sha1 (check, value->pValue, value->ulValueLen, NULL); assert (memcmp (sha1, check, sizeof (sha1)) == 0); } static void check_has_trust_object (CK_ATTRIBUTE *cert) { CK_OBJECT_CLASS trust_object = CKO_NSS_TRUST; CK_ATTRIBUTE klass = { CKA_CLASS, &trust_object, sizeof (trust_object) }; CK_OBJECT_HANDLE objects[2]; CK_SESSION_HANDLE sessions[2]; CK_ATTRIBUTE *match; CK_ATTRIBUTE *attr; CK_ULONG count; attr = p11_attrs_find_valid (cert, CKA_ID); assert_ptr_not_null (attr); match = p11_attrs_build (NULL, &klass, attr, NULL); count = find_objects (match, sessions, objects, 2); assert_num_eq (1, count); check_trust_object_equiv (sessions[0], objects[0], cert); check_trust_object_hashes (sessions[0], objects[0], cert); p11_attrs_free (match); } static void check_certificate (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE handle) { unsigned char label[4096]= { 0, }; CK_OBJECT_CLASS klass; unsigned char value[4096]; unsigned char subject[1024]; unsigned char issuer[1024]; unsigned char serial[128]; unsigned char id[128]; CK_CERTIFICATE_TYPE type; CK_BYTE check[3]; CK_DATE start; CK_DATE end; CK_ULONG category; CK_BBOOL private; CK_BBOOL token; CK_RV rv; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_TOKEN, &token, sizeof (token) }, { CKA_PRIVATE, &private, sizeof (private) }, { CKA_VALUE, value, sizeof (value) }, { CKA_ISSUER, issuer, sizeof (issuer) }, { CKA_SUBJECT, subject, sizeof (subject) }, { CKA_CERTIFICATE_TYPE, &type, sizeof (type) }, { CKA_CERTIFICATE_CATEGORY, &category, sizeof (category) }, { CKA_START_DATE, &start, sizeof (start) }, { CKA_END_DATE, &end, sizeof (end) }, { CKA_SERIAL_NUMBER, serial, sizeof (serial) }, { CKA_CHECK_VALUE, check, sizeof (check) }, { CKA_ID, id, sizeof (id) }, { CKA_LABEL, label, sizeof (label) }, { CKA_INVALID, }, }; /* Note that we don't pass the CKA_INVALID attribute in */ rv = test.module->C_GetAttributeValue (session, handle, attrs, 14); assert_num_eq (rv, CKR_OK); /* If this is the cacert3 certificate, check its values */ if (memcmp (value, test_cacert3_ca_der, sizeof (test_cacert3_ca_der)) == 0) { CK_BBOOL trusted; CK_BBOOL vtrue = CK_TRUE; CK_ATTRIBUTE anchor[] = { { CKA_TRUSTED, &trusted, sizeof (trusted) }, { CKA_INVALID, }, }; CK_ATTRIBUTE check[] = { { CKA_TRUSTED, &vtrue, sizeof (vtrue) }, { CKA_INVALID, }, }; test_check_cacert3_ca (attrs, NULL); /* Get anchor specific attributes */ rv = test.module->C_GetAttributeValue (session, handle, anchor, 1); assert (rv == CKR_OK); /* It lives in the trusted directory */ test_check_attrs (check, anchor); /* Other certificates, we can't check the values */ } else { test_check_object (attrs, CKO_CERTIFICATE, NULL); } check_has_trust_object (attrs); } static void test_find_certificates (void) { CK_OBJECT_CLASS klass = CKO_CERTIFICATE; CK_ATTRIBUTE match[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_INVALID, } }; CK_OBJECT_HANDLE objects[16]; CK_SESSION_HANDLE sessions[16]; CK_ULONG count; CK_ULONG i; count = find_objects (match, sessions, objects, 16); assert_num_eq (8, count); for (i = 0; i < count; i++) check_certificate (sessions[i], objects[i]); } static void test_find_builtin (void) { CK_OBJECT_CLASS klass = CKO_NSS_BUILTIN_ROOT_LIST; CK_ATTRIBUTE match[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, { CKA_PRIVATE, &vfalse, sizeof (vfalse) }, { CKA_MODIFIABLE, &vfalse, sizeof (vfalse) }, { CKA_INVALID, } }; CK_OBJECT_HANDLE objects[16]; CK_SESSION_HANDLE sessions[16]; CK_ULONG count; /* One per token */ count = find_objects (match, sessions, objects, 16); assert_num_eq (NUM_SLOTS, count); } static void test_session_object (void) { CK_ATTRIBUTE original[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; CK_ULONG size; CK_RV rv; rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); rv = test.module->C_CreateObject (session, original, 2, &handle); assert (rv == CKR_OK); rv = test.module->C_GetObjectSize (session, handle, &size); assert (rv == CKR_OK); } static void test_session_find (void) { CK_ATTRIBUTE original[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; CK_OBJECT_HANDLE check; CK_ULONG count; CK_RV rv; rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert_num_eq (CKR_OK, rv); rv = test.module->C_CreateObject (session, original, 2, &handle); assert_num_eq (CKR_OK, rv); rv = test.module->C_FindObjectsInit (session, original, 2); assert_num_eq (CKR_OK, rv); rv = test.module->C_FindObjects (session, &check, 1, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (1, count); assert_num_eq (handle, check); rv = test.module->C_FindObjectsFinal (session); assert_num_eq (CKR_OK, rv); } static void test_session_find_no_attr (void) { CK_ATTRIBUTE original[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE match[] = { { CKA_COLOR, "blah", 4 }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; CK_OBJECT_HANDLE check; CK_ULONG count; CK_RV rv; rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert_num_eq (CKR_OK, rv); rv = test.module->C_CreateObject (session, original, 3, &handle); assert_num_eq (CKR_OK, rv); rv = test.module->C_FindObjectsInit (session, match, 1); assert_num_eq (CKR_OK, rv); rv = test.module->C_FindObjects (session, &check, 1, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (0, count); rv = test.module->C_FindObjectsFinal (session); assert_num_eq (CKR_OK, rv); } static void test_lookup_invalid (void) { CK_SESSION_HANDLE session; CK_ULONG size; CK_RV rv; rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); rv = test.module->C_GetObjectSize (session, 88888, &size); assert (rv == CKR_OBJECT_HANDLE_INVALID); } static void test_remove_token (void) { CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; CK_ULONG count; CK_RV rv; rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert_num_eq (rv, CKR_OK); rv = test.module->C_FindObjectsInit (session, NULL, 0); assert_num_eq (rv, CKR_OK); rv = test.module->C_FindObjects (session, &handle, 1, &count); assert_num_eq (rv, CKR_OK); assert_num_eq (1, count); rv = test.module->C_DestroyObject (session, handle); if (rv != CKR_TOKEN_WRITE_PROTECTED) assert_num_eq (rv, CKR_SESSION_READ_ONLY); } static void test_setattr_token (void) { CK_ATTRIBUTE original[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; CK_ULONG count; CK_RV rv; rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert_num_eq (rv, CKR_OK); rv = test.module->C_FindObjectsInit (session, NULL, 0); assert_num_eq (rv, CKR_OK); rv = test.module->C_FindObjects (session, &handle, 1, &count); assert_num_eq (rv, CKR_OK); assert_num_eq (1, count); rv = test.module->C_SetAttributeValue (session, handle, original, 2); if (rv != CKR_TOKEN_WRITE_PROTECTED) assert_num_eq (rv, CKR_ATTRIBUTE_READ_ONLY); } static void test_session_copy (void) { CK_ATTRIBUTE original[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; CK_OBJECT_HANDLE copy; CK_ULONG size; CK_RV rv; rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert_num_eq (CKR_OK, rv); rv = test.module->C_CreateObject (session, original, 2, &handle); assert_num_eq (CKR_OK, rv); rv = test.module->C_CopyObject (session, handle, original, 2, ©); assert_num_eq (CKR_OK, rv); rv = test.module->C_GetObjectSize (session, copy, &size); assert_num_eq (CKR_OK, rv); } static void test_session_setattr (void) { CK_ATTRIBUTE original[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; CK_RV rv; rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); rv = test.module->C_CreateObject (session, original, 2, &handle); assert (rv == CKR_OK); rv = test.module->C_SetAttributeValue (session, handle, original, 2); assert (rv == CKR_OK); } static void test_session_remove (void) { CK_ATTRIBUTE original[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; CK_RV rv; rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); rv = test.module->C_CreateObject (session, original, 2, &handle); assert (rv == CKR_OK); rv = test.module->C_DestroyObject (session, handle); assert (rv == CKR_OK); rv = test.module->C_DestroyObject (session, handle); assert (rv == CKR_OBJECT_HANDLE_INVALID); } static void test_find_serial_der_decoded (void) { CK_OBJECT_CLASS nss_trust = CKO_NSS_TRUST; CK_ATTRIBUTE object[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust) }, { CKA_SERIAL_NUMBER, "\x02\x03\x01\x02\x03", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE match_decoded[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust) }, { CKA_SERIAL_NUMBER, "\x01\x02\x03", 3 }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; CK_OBJECT_HANDLE check; CK_ULONG count; CK_RV rv; /* * WORKAROUND: NSS calls us asking for CKA_SERIAL_NUMBER items that are * not DER encoded. It shouldn't be doing this. We never return any certificate * serial numbers that are not DER encoded. * * So work around the issue here while the NSS guys fix this issue. * This code should be removed in future versions. * * See work_around_broken_nss_serial_number_lookups(). */ rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert_num_eq (CKR_OK, rv); rv = test.module->C_CreateObject (session, object, 2, &handle); assert_num_eq (CKR_OK, rv); /* Do a standard find for the same object */ rv = test.module->C_FindObjectsInit (session, object, 2); assert_num_eq (CKR_OK, rv); rv = test.module->C_FindObjects (session, &check, 1, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (1, count); assert_num_eq (handle, check); rv = test.module->C_FindObjectsFinal (session); assert_num_eq (CKR_OK, rv); /* Do a find for the serial number decoded */ rv = test.module->C_FindObjectsInit (session, match_decoded, 2); assert_num_eq (CKR_OK, rv); rv = test.module->C_FindObjects (session, &check, 1, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (1, count); assert_num_eq (handle, check); rv = test.module->C_FindObjectsFinal (session); assert_num_eq (CKR_OK, rv); } static void test_find_serial_der_mismatch (void) { CK_OBJECT_CLASS nss_trust = CKO_NSS_TRUST; CK_ATTRIBUTE object[] = { { CKA_CLASS, &nss_trust, sizeof (nss_trust) }, { CKA_SERIAL_NUMBER, "\x02\x03\x01\x02\x03", 5 }, { CKA_INVALID } }; CK_ATTRIBUTE match[] = { { CKA_SERIAL_NUMBER, NULL, 0 }, { CKA_CLASS, &nss_trust, sizeof (nss_trust) }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; CK_OBJECT_HANDLE check; CK_ULONG count; CK_RV rv; rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert_num_eq (CKR_OK, rv); rv = test.module->C_CreateObject (session, object, 2, &handle); assert_num_eq (CKR_OK, rv); /* Do a find with a null serial number, no match */ rv = test.module->C_FindObjectsInit (session, match, 2); assert_num_eq (CKR_OK, rv); rv = test.module->C_FindObjects (session, &check, 1, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (0, count); rv = test.module->C_FindObjectsFinal (session); assert_num_eq (CKR_OK, rv); /* Do a find with a wrong length, no match */ match[0].pValue = "at"; match[0].ulValueLen = 2; rv = test.module->C_FindObjectsInit (session, match, 2); assert_num_eq (CKR_OK, rv); rv = test.module->C_FindObjects (session, &check, 1, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (0, count); rv = test.module->C_FindObjectsFinal (session); assert_num_eq (CKR_OK, rv); /* Do a find with a right length, wrong value, no match */ match[0].pValue = "one"; match[0].ulValueLen = 3; rv = test.module->C_FindObjectsInit (session, match, 2); assert_num_eq (CKR_OK, rv); rv = test.module->C_FindObjects (session, &check, 1, &count); assert_num_eq (CKR_OK, rv); assert_num_eq (0, count); rv = test.module->C_FindObjectsFinal (session); assert_num_eq (CKR_OK, rv); } static void test_login_logout (void) { CK_SESSION_HANDLE session; CK_RV rv; rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); /* Just testing our stubs for now */ rv = test.module->C_Login (session, CKU_USER, NULL, 0); assert (rv == CKR_USER_TYPE_INVALID); rv = test.module->C_Logout (session); assert (rv == CKR_USER_NOT_LOGGED_IN); } static void test_token_writable (void) { CK_TOKEN_INFO info; CK_RV rv; rv = test.module->C_GetTokenInfo (test.slots[0], &info); assert_num_eq (rv, CKR_OK); assert_num_eq (info.flags & CKF_WRITE_PROTECTED, 0); } static void test_session_read_only_create (void) { CK_ATTRIBUTE original[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; CK_RV rv; /* Read-only session */ rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); /* Create a token object */ rv = test.module->C_CreateObject (session, original, 4, &handle); assert_num_eq (rv, CKR_SESSION_READ_ONLY); } static void test_create_and_write (void) { CK_ATTRIBUTE original[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, { CKA_INVALID } }; CK_ATTRIBUTE expected[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_APPLICATION, "", 0 }, { CKA_OBJECT_ID, "", 0 }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; p11_array *parsed; char *path; CK_RV rv; int ret; /* Read-only session */ rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session); assert_num_eq (rv, CKR_OK); /* Create a token object */ rv = test.module->C_CreateObject (session, original, 4, &handle); assert_num_eq (rv, CKR_OK); /* The expected file name */ path = p11_path_build (test.directory, "yay.p11-kit", NULL); p11_parser_formats (test.parser, p11_parser_format_persist, NULL); ret = p11_parse_file (test.parser, path, NULL, 0); assert_num_eq (ret, P11_PARSE_SUCCESS); free (path); parsed = p11_parser_parsed (test.parser); assert_num_eq (parsed->num, 1); test_check_attrs (expected, parsed->elem[0]); } static void test_modify_and_write (void) { CK_ATTRIBUTE original[] = { { CKA_VALUE, "eight", 5 }, { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, { CKA_MODIFIABLE, &vtrue, sizeof (vtrue) }, { CKA_INVALID } }; CK_ATTRIBUTE expected[] = { { CKA_CLASS, &data, sizeof (data) }, { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "nine", 4 }, { CKA_APPLICATION, "", 0 }, { CKA_OBJECT_ID, "", 0 }, { CKA_INVALID } }; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; p11_array *parsed; char *path; CK_RV rv; int ret; /* Read-only session */ rv = test.module->C_OpenSession (test.slots[0], CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session); assert_num_eq (rv, CKR_OK); /* Create a token object */ rv = test.module->C_CreateObject (session, original, 5, &handle); assert_num_eq (rv, CKR_OK); /* Now modify the object */ original[0].pValue = "nine"; original[0].ulValueLen = 4; rv = test.module->C_SetAttributeValue (session, handle, original, 5); assert_num_eq (rv, CKR_OK); /* The expected file name */ path = p11_path_build (test.directory, "yay.p11-kit", NULL); ret = p11_parse_file (test.parser, path, NULL, 0); assert_num_eq (ret, P11_PARSE_SUCCESS); free (path); parsed = p11_parser_parsed (test.parser); assert_num_eq (parsed->num, 1); test_check_attrs (expected, parsed->elem[0]); } int main (int argc, char *argv[]) { p11_library_init (); p11_fixture (setup, teardown); p11_test (test_get_slot_list, "/module/get_slot_list"); p11_test (test_get_slot_info, "/module/get_slot_info"); p11_fixture (NULL, NULL); p11_test (test_null_initialize, "/module/initialize-null"); p11_test (test_multi_initialize, "/module/initialize-multi"); p11_test (test_get_token_info, "/module/get_token_info"); p11_fixture (setup, teardown); p11_test (test_get_session_info, "/module/get_session_info"); p11_test (test_close_all_sessions, "/module/close_all_sessions"); p11_test (test_find_certificates, "/module/find_certificates"); p11_test (test_find_builtin, "/module/find_builtin"); p11_test (test_lookup_invalid, "/module/lookup_invalid"); p11_test (test_remove_token, "/module/remove_token"); p11_test (test_setattr_token, "/module/setattr_token"); p11_test (test_session_object, "/module/session_object"); p11_test (test_session_find, "/module/session_find"); p11_test (test_session_find_no_attr, "/module/session_find_no_attr"); p11_test (test_session_copy, "/module/session_copy"); p11_test (test_session_remove, "/module/session_remove"); p11_test (test_session_setattr, "/module/session_setattr"); p11_test (test_find_serial_der_decoded, "/module/find_serial_der_decoded"); p11_test (test_find_serial_der_mismatch, "/module/find_serial_der_mismatch"); p11_test (test_login_logout, "/module/login_logout"); p11_fixture (setup_writable, teardown); p11_test (test_token_writable, "/module/token-writable"); p11_test (test_session_read_only_create, "/module/session-read-only-create"); p11_test (test_create_and_write, "/module/create-and-write"); p11_test (test_modify_and_write, "/module/modify-and-write"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/tests/test-asn1.c0000664000175000017500000001100712226763526014224 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "asn1.h" #include "debug.h" #include "oid.h" #include "x509.h" #include #include #include struct { p11_dict *asn1_defs; } test; static void setup (void *unused) { test.asn1_defs = p11_asn1_defs_load (); assert_ptr_not_null (test.asn1_defs); } static void teardown (void *unused) { p11_dict_free (test.asn1_defs); memset (&test, 0, sizeof (test)); } static void test_tlv_length (void) { struct { const char *der; size_t der_len; int expected; } tlv_lengths[] = { { "\x01\x01\x00", 3, 3 }, { "\x01\x01\x00\x01\x02", 5, 3 }, { "\x01\x05\x00", 3, -1 }, { NULL } }; int length; int i; for (i = 0; tlv_lengths[i].der != NULL; i++) { length = p11_asn1_tlv_length ((const unsigned char *)tlv_lengths[i].der, tlv_lengths[i].der_len); assert_num_eq (tlv_lengths[i].expected, length); } } static const unsigned char test_eku_server_and_client[] = { 0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, }; static void test_asn1_cache (void) { p11_asn1_cache *cache; p11_dict *defs; node_asn *asn; node_asn *check; cache = p11_asn1_cache_new (); assert_ptr_not_null (cache); defs = p11_asn1_cache_defs (cache); assert_ptr_not_null (defs); asn = p11_asn1_decode (defs, "PKIX1.ExtKeyUsageSyntax", test_eku_server_and_client, sizeof (test_eku_server_and_client), NULL); assert_ptr_not_null (defs); /* Place the parsed data in the cache */ p11_asn1_cache_take (cache, asn, "PKIX1.ExtKeyUsageSyntax", test_eku_server_and_client, sizeof (test_eku_server_and_client)); /* Get it back out */ check = p11_asn1_cache_get (cache, "PKIX1.ExtKeyUsageSyntax", test_eku_server_and_client, sizeof (test_eku_server_and_client)); assert_ptr_eq (asn, check); /* Flush should remove it */ p11_asn1_cache_flush (cache); check = p11_asn1_cache_get (cache, "PKIX1.ExtKeyUsageSyntax", test_eku_server_and_client, sizeof (test_eku_server_and_client)); assert_ptr_eq (NULL, check); p11_asn1_cache_free (cache); } static void test_asn1_free (void) { p11_dict *defs; node_asn *asn; defs = p11_asn1_defs_load (); assert_ptr_not_null (defs); asn = p11_asn1_decode (defs, "PKIX1.ExtKeyUsageSyntax", test_eku_server_and_client, sizeof (test_eku_server_and_client), NULL); assert_ptr_not_null (asn); p11_asn1_free (asn); p11_asn1_free (NULL); p11_dict_free (defs); } int main (int argc, char *argv[]) { p11_fixture (setup, teardown); p11_test (test_tlv_length, "/asn1/tlv_length"); p11_fixture (NULL, NULL); p11_test (test_asn1_cache, "/asn1/asn1_cache"); p11_test (test_asn1_free, "/asn1/free"); return p11_test_run (argc, argv); } p11-kit-0.20.2/trust/extract.c0000664000175000017500000002053312263255461012714 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "attrs.h" #include "compat.h" #include "debug.h" #include "extract.h" #include "iter.h" #include "message.h" #include "oid.h" #include "path.h" #include "pkcs11.h" #include "pkcs11x.h" #include "save.h" #include "tool.h" #include #include #include #include #include #include #include #include static bool format_argument (const char *optarg, p11_extract_func *func) { int i; /* * Certain formats do not support expressive trust information. * So the caller should limit the supported purposes when asking * for trust information. */ static const struct { const char *format; p11_extract_func func; } formats[] = { { "x509-file", p11_extract_x509_file, }, { "x509-directory", p11_extract_x509_directory, }, { "pem-bundle", p11_extract_pem_bundle, }, { "pem-directory", p11_extract_pem_directory }, { "java-cacerts", p11_extract_jks_cacerts }, { "openssl-bundle", p11_extract_openssl_bundle }, { "openssl-directory", p11_extract_openssl_directory }, { NULL }, }; if (*func != NULL) { p11_message ("a format was already specified"); return false; } for (i = 0; formats[i].format != NULL; i++) { if (strcmp (optarg, formats[i].format) == 0) { *func = formats[i].func; break; } } if (*func == NULL) { p11_message ("unsupported or unrecognized format: %s", optarg); return false; } return true; } static bool validate_filter_and_format (p11_enumerate *ex, p11_extract_func func) { int i; /* * These are the extract functions that contain purpose information. * If we're being asked to export anchors, and the extract function does * not support, and the caller has not specified a purpose, then add a * default purpose to limit to. */ static p11_extract_func supports_trust_policy[] = { p11_extract_openssl_bundle, p11_extract_openssl_directory, NULL }; for (i = 0; supports_trust_policy[i] != NULL; i++) { if (func == supports_trust_policy[i]) return true; } if ((ex->flags & P11_ENUMERATE_ANCHORS) && (ex->flags & P11_ENUMERATE_BLACKLIST)) { /* * If we're extracting *both* anchors and blacklist, then we must have * a format that can represent the different types of information. */ p11_message ("format does not support trust policy"); return false; } else if (ex->flags & P11_ENUMERATE_ANCHORS) { /* * If we're extracting anchors, then we must have either limited the * purposes, or have a format that can represent multiple purposes. */ if (!ex->limit_to_purposes) { p11_message ("format does not support multiple purposes, defaulting to 'server-auth'"); p11_enumerate_opt_purpose (ex, "server-auth"); } } return true; } int p11_trust_extract (int argc, char **argv) { p11_extract_func format = NULL; p11_enumerate ex; int opt = 0; int ret; enum { opt_overwrite = 'f', opt_verbose = 'v', opt_quiet = 'q', opt_help = 'h', opt_filter = 1000, opt_purpose, opt_format, opt_comment, }; struct option options[] = { { "filter", required_argument, NULL, opt_filter }, { "format", required_argument, NULL, opt_format }, { "purpose", required_argument, NULL, opt_purpose }, { "overwrite", no_argument, NULL, opt_overwrite }, { "comment", no_argument, NULL, opt_comment }, { "verbose", no_argument, NULL, opt_verbose }, { "quiet", no_argument, NULL, opt_quiet }, { "help", no_argument, NULL, opt_help }, { 0 }, }; p11_tool_desc usages[] = { { 0, "usage: trust extract --format= " }, { opt_filter, "filter of what to export\n" " ca-anchors certificate anchors (default)\n" " blacklist blacklisted certificates\n" " trust-policy anchors and blacklist\n" " certificates all certificates\n" " pkcs11:object=xx a PKCS#11 URI", "what", }, { opt_format, "format to extract to\n" " x509-file DER X.509 certificate file\n" " x509-directory directory of X.509 certificates\n" " pem-bundle file containing multiple PEM blocks\n" " pem-directory directory of PEM files\n" " openssl-bundle OpenSSL specific PEM bundle\n" " openssl-directory directory of OpenSSL specific files\n" " java-cacerts java keystore cacerts file", "type" }, { opt_purpose, "limit to certificates usable for the purpose\n" " server-auth for authenticating servers\n" " client-auth for authenticating clients\n" " email for email protection\n" " code-signing for authenticating signed code\n" " 1.2.3.4.5... an arbitrary object id", "usage" }, { opt_overwrite, "overwrite output file or directory" }, { opt_comment, "add comments to bundles if possible" }, { opt_verbose, "show verbose debug output", }, { opt_quiet, "supress command output", }, { 0 }, }; p11_enumerate_init (&ex); while ((opt = p11_tool_getopt (argc, argv, options)) != -1) { switch (opt) { case opt_verbose: case opt_quiet: break; case opt_overwrite: ex.flags |= P11_SAVE_OVERWRITE; break; case opt_comment: ex.flags |= P11_EXTRACT_COMMENT; break; case opt_filter: if (!p11_enumerate_opt_filter (&ex, optarg)) exit (2); break; case opt_purpose: if (!p11_enumerate_opt_purpose (&ex, optarg)) exit (2); break; case opt_format: if (!format_argument (optarg, &format)) exit (2); break; case 'h': p11_tool_usage (usages, options); exit (0); case '?': exit (2); default: assert_not_reached (); break; } } argc -= optind; argv += optind; if (argc != 1) { p11_message ("specify one destination file or directory"); exit (2); } if (!format) { p11_message ("no output format specified"); exit (2); } if (!validate_filter_and_format (&ex, format)) exit (1); if (!p11_enumerate_ready (&ex, "ca-anchors")) exit (1); ret = (format) (&ex, argv[0]) ? 0 : 1; p11_enumerate_cleanup (&ex); return ret; } int p11_trust_extract_compat (int argc, char *argv[]) { char *path = NULL; char *path2 = NULL; int error; argv[argc] = NULL; /* * For compatibility with people who deployed p11-kit 0.18.x * before trust stuff was put into its own branch. */ path2 = p11_path_build (PRIVATEDIR, "p11-kit-extract-trust", NULL); return_val_if_fail (path2 != NULL, 1); execv (path2, argv); error = errno; free (path2); if (error == ENOENT) { path = p11_path_build (PRIVATEDIR, "trust-extract-compat", NULL); return_val_if_fail (path != NULL, 1); execv (path, argv); error = errno; free (path); } /* At this point we have no command */ p11_message_err (error, "could not run %s command", path); free (path); free (path2); return 2; } p11-kit-0.20.2/trust/extract-openssl.c0000664000175000017500000004062312263255461014377 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "asn1.h" #include "attrs.h" #include "buffer.h" #include "compat.h" #include "debug.h" #include "dict.h" #include "digest.h" #include "extract.h" #include "message.h" #include "oid.h" #include "path.h" #include "pem.h" #include "pkcs11.h" #include "pkcs11x.h" #include "save.h" #include "utf8.h" #include "x509.h" #include #include #include #include /* These functions are declared with a global scope for testing */ void p11_openssl_canon_string (char *str, size_t *len); bool p11_openssl_canon_string_der (p11_buffer *der); bool p11_openssl_canon_name_der (p11_dict *asn1_defs, p11_buffer *der); static p11_array * empty_usages (void) { return p11_array_new (free); } static bool known_usages (p11_array *oids) { char *string; int i; static const char *const strings[] = { P11_OID_SERVER_AUTH_STR, P11_OID_CLIENT_AUTH_STR, P11_OID_CODE_SIGNING_STR, P11_OID_EMAIL_PROTECTION_STR, P11_OID_IPSEC_END_SYSTEM_STR, P11_OID_IPSEC_TUNNEL_STR, P11_OID_IPSEC_USER_STR, P11_OID_TIME_STAMPING_STR, NULL, }; for (i = 0; strings[i] != NULL; i++) { string = strdup (strings[i]); return_val_if_fail (string != NULL, false); if (!p11_array_push (oids, string)) return_val_if_reached (false); } return true; } static bool load_usage_ext (p11_enumerate *ex, const unsigned char *ext_oid, p11_array **oids) { unsigned char *value; node_asn *ext = NULL; size_t length; if (ex->stapled) ext = p11_dict_get (ex->stapled, ext_oid); if (ext == NULL) { *oids = NULL; return true; } value = p11_asn1_read (ext, "extnValue", &length); return_val_if_fail (value != NULL, false); *oids = p11_x509_parse_extended_key_usage (ex->asn1_defs, value, length); return_val_if_fail (*oids != NULL, false); free (value); return true; } static bool write_usages (node_asn *asn, const char *field, p11_array *oids) { char *last; int ret; int i; /* * No oids? Then doing this will make the entire optional * field go away */ if (oids == NULL) { ret = asn1_write_value (asn, field, NULL, 0); return_val_if_fail (ret == ASN1_SUCCESS, false); } else { if (asprintf (&last, "%s.?LAST", field) < 0) return_val_if_reached (false); for (i = 0; i < oids->num; i++) { ret = asn1_write_value (asn, field, "NEW", 1); return_val_if_fail (ret == ASN1_SUCCESS, false); ret = asn1_write_value (asn, last, oids->elem[i], -1); return_val_if_fail (ret == ASN1_SUCCESS, false); } free (last); } return true; } static bool write_trust_and_rejects (p11_enumerate *ex, node_asn *asn) { p11_array *trusts = NULL; p11_array *rejects = NULL; CK_BBOOL trust; CK_BBOOL distrust; if (!p11_attrs_find_bool (ex->attrs, CKA_TRUSTED, &trust)) trust = CK_FALSE; if (!p11_attrs_find_bool (ex->attrs, CKA_X_DISTRUSTED, &distrust)) distrust = CK_FALSE; if (!load_usage_ext (ex, P11_OID_OPENSSL_REJECT, &rejects)) return_val_if_reached (false); if (distrust) { /* * If this is on the blacklist then, make sure we have * an empty trusts field and add as many things to rejects * as possible. */ trusts = NULL; if (!rejects) rejects = empty_usages (); if (!known_usages (rejects)) return_val_if_reached (false); return_val_if_fail (rejects != NULL, false); } else if (trust) { /* * If this is an anchor, then try and guarantee that there * are some trust anchors. */ if (!load_usage_ext (ex, P11_OID_EXTENDED_KEY_USAGE, &trusts)) return_val_if_reached (false); } else { /* * This is not an anchor, always put an empty trusts * section, with possible rejects, loaded above */ trusts = empty_usages (); } if (!write_usages (asn, "trust", trusts) || !write_usages (asn, "reject", rejects)) return_val_if_reached (false); p11_array_free (trusts); p11_array_free (rejects); return true; } static bool write_keyid (p11_enumerate *ex, node_asn *asn) { unsigned char *value = NULL; node_asn *ext = NULL; size_t length = 0; int ret; if (ex->stapled) ext = p11_dict_get (ex->stapled, P11_OID_SUBJECT_KEY_IDENTIFIER); if (ext != NULL) { value = p11_asn1_read (ext, "extnValue", &length); return_val_if_fail (value != NULL, false); } ret = asn1_write_value (asn, "keyid", value, length); return_val_if_fail (ret == ASN1_SUCCESS, false); free (value); return true; } static bool write_alias (p11_enumerate *ex, node_asn *asn) { CK_ATTRIBUTE *label; int ret; label = p11_attrs_find_valid (ex->attrs, CKA_LABEL); if (label == NULL) { ret = asn1_write_value (asn, "alias", NULL, 0); return_val_if_fail (ret == ASN1_SUCCESS, false); } else { ret = asn1_write_value (asn, "alias", label->pValue, label->ulValueLen); return_val_if_fail (ret == ASN1_SUCCESS, false); } return true; } static bool write_other (p11_enumerate *ex, node_asn *asn) { int ret; ret = asn1_write_value (asn, "other", NULL, 0); return_val_if_fail (ret == ASN1_SUCCESS, false); return true; } static bool prepare_pem_contents (p11_enumerate *ex, p11_buffer *buffer) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; unsigned char *der; node_asn *asn; size_t offset; int ret; int len; p11_buffer_add (buffer, ex->cert_der, ex->cert_len); asn = p11_asn1_create (ex->asn1_defs, "OPENSSL.CertAux"); return_val_if_fail (asn != NULL, false); if (!write_trust_and_rejects (ex, asn) || !write_alias (ex, asn) || !write_keyid (ex, asn) || !write_other (ex, asn)) return_val_if_reached (false); len = 0; offset = buffer->len; ret = asn1_der_coding (asn, "", NULL, &len, message); return_val_if_fail (ret == ASN1_MEM_ERROR, false); der = p11_buffer_append (buffer, len); return_val_if_fail (der != NULL, false); ret = asn1_der_coding (asn, "", der, &len, message); return_val_if_fail (ret == ASN1_SUCCESS, false); buffer->len = offset + len; asn1_delete_structure (&asn); return true; } bool p11_extract_openssl_bundle (p11_enumerate *ex, const char *destination) { p11_save_file *file; p11_buffer output; p11_buffer buf; char *comment; bool ret = true; bool first; CK_RV rv; file = p11_save_open_file (destination, NULL, ex->flags); if (!file) return false; first = true; p11_buffer_init (&output, 0); while ((rv = p11_kit_iter_next (ex->iter)) == CKR_OK) { p11_buffer_init (&buf, 1024); if (!p11_buffer_reset (&output, 2048)) return_val_if_reached (false); if (prepare_pem_contents (ex, &buf)) { if (!p11_pem_write (buf.data, buf.len, "TRUSTED CERTIFICATE", &output)) return_val_if_reached (false); comment = p11_enumerate_comment (ex, first); first = false; ret = p11_save_write (file, comment, -1) && p11_save_write (file, output.data, output.len); free (comment); } p11_buffer_uninit (&buf); if (!ret) break; } p11_buffer_uninit (&output); if (rv != CKR_OK && rv != CKR_CANCEL) { p11_message ("failed to find certificates: %s", p11_kit_strerror (rv)); ret = false; } /* * This will produce an empty file (which is a valid PEM bundle) if no * certificates were found. */ if (!p11_save_finish_file (file, NULL, ret)) ret = false; return ret; } void p11_openssl_canon_string (char *str, size_t *len) { bool nsp; bool sp; char *in; char *out; char *end; /* * Now that the string is UTF-8 here we convert the string to the * OpenSSL canonical form. This is a bit odd and openssl specific. * Basically they ignore any char over 127, do ascii tolower() stuff * and collapse spaces based on isspace(). */ for (in = out = str, end = out + *len, sp = false, nsp = false; in < end; in++) { if (*in & 0x80 || !isspace (*in)) { /* If there has been a space, then add one */ if (sp) *out++ = ' '; *out++ = (*in & 0x80) ? *in : tolower (*in); sp = false; nsp = true; /* If there has been a non-space, then note we should get one */ } else if (nsp) { nsp = false; sp = true; } } if (out < end) out[0] = 0; *len = out - str; } bool p11_openssl_canon_string_der (p11_buffer *der) { char *string; size_t length; int output_len; int len_len; bool unknown_string; unsigned char *output; int len; string = p11_x509_parse_directory_string (der->data, der->len, &unknown_string, &length); /* Just pass through all the non-string types */ if (string == NULL) return unknown_string; p11_openssl_canon_string (string, &length); asn1_length_der (length, NULL, &len_len); output_len = 1 + len_len + length; if (!p11_buffer_reset (der, output_len)) return_val_if_reached (false); output = der->data; der->len = output_len; output[0] = 12; /* UTF8String */ len = output_len - 1; asn1_octet_der ((unsigned char *)string, length, output + 1, &len); assert (len == output_len - 1); free (string); return true; } bool p11_openssl_canon_name_der (p11_dict *asn1_defs, p11_buffer *der) { p11_buffer value; char outer[64]; char field[64]; node_asn *name; void *at; int value_len; bool failed; size_t offset; int ret; int num; int len; int i, j; name = p11_asn1_decode (asn1_defs, "PKIX1.Name", der->data, der->len, NULL); return_val_if_fail (name != NULL, false); ret = asn1_number_of_elements (name, "rdnSequence", &num); return_val_if_fail (ret == ASN1_SUCCESS, false); p11_buffer_init (&value, 0); p11_buffer_reset (der, 0); for (i = 1, failed = false; !failed && i < num + 1; i++) { snprintf (outer, sizeof (outer), "rdnSequence.?%d", i); for (j = 1; !failed; j++) { snprintf (field, sizeof (field), "%s.?%d.value", outer, j); value_len = 0; ret = asn1_read_value (name, field, NULL, &value_len); if (ret == ASN1_ELEMENT_NOT_FOUND) break; return_val_if_fail (ret == ASN1_MEM_ERROR, false); if (!p11_buffer_reset (&value, value_len)) return_val_if_reached (false); ret = asn1_read_value (name, field, value.data, &value_len); return_val_if_fail (ret == ASN1_SUCCESS, false); value.len = value_len; if (p11_openssl_canon_string_der (&value)) { ret = asn1_write_value (name, field, value.data, value.len); return_val_if_fail (ret == ASN1_SUCCESS, false); } else { failed = true; } } /* * Yes the OpenSSL canon strangeness, is a concatenation * of all the RelativeDistinguishedName DER encodings, without * an outside wrapper. */ if (!failed) { len = -1; ret = asn1_der_coding (name, outer, NULL, &len, NULL); return_val_if_fail (ret == ASN1_MEM_ERROR, false); offset = der->len; at = p11_buffer_append (der, len); return_val_if_fail (at != NULL, false); ret = asn1_der_coding (name, outer, at, &len, NULL); return_val_if_fail (ret == ASN1_SUCCESS, false); der->len = offset + len; } } asn1_delete_structure (&name); p11_buffer_uninit (&value); return !failed; } #ifdef OS_UNIX static char * symlink_for_subject_hash (p11_enumerate *ex) { unsigned char md[P11_DIGEST_SHA1_LEN]; p11_buffer der; CK_ATTRIBUTE *subject; unsigned long hash; char *linkname = NULL; subject = p11_attrs_find_valid (ex->attrs, CKA_SUBJECT); if (!subject || !subject->pValue || !subject->ulValueLen) return NULL; p11_buffer_init_full (&der, memdup (subject->pValue, subject->ulValueLen), subject->ulValueLen, 0, realloc, free); return_val_if_fail (der.data != NULL, NULL); if (p11_openssl_canon_name_der (ex->asn1_defs, &der)) { p11_digest_sha1 (md, der.data, der.len, NULL); hash = ( ((unsigned long)md[0] ) | ((unsigned long)md[1] << 8L) | ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L) ) & 0xffffffffL; if (asprintf (&linkname, "%08lx", hash) < 0) return_val_if_reached (NULL); } p11_buffer_uninit (&der); return linkname; } static char * symlink_for_subject_old_hash (p11_enumerate *ex) { unsigned char md[P11_DIGEST_MD5_LEN]; CK_ATTRIBUTE *subject; unsigned long hash; char *linkname; subject = p11_attrs_find_valid (ex->attrs, CKA_SUBJECT); if (!subject) return NULL; p11_digest_md5 (md, subject->pValue, (size_t)subject->ulValueLen, NULL); hash = ( ((unsigned long)md[0] ) | ((unsigned long)md[1] << 8L) | ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L) ) & 0xffffffffL; if (asprintf (&linkname, "%08lx", hash) < 0) return_val_if_reached (NULL); return linkname; } #endif /* OS_UNIX */ bool p11_extract_openssl_directory (p11_enumerate *ex, const char *destination) { char *filename; p11_save_file *file; p11_save_dir *dir; p11_buffer output; p11_buffer buf; bool ret = true; char *path; char *name; CK_RV rv; #ifdef OS_UNIX char *linkname; #endif dir = p11_save_open_directory (destination, ex->flags); if (dir == NULL) return false; p11_buffer_init (&buf, 0); p11_buffer_init (&output, 0); while ((rv = p11_kit_iter_next (ex->iter)) == CKR_OK) { if (!p11_buffer_reset (&buf, 1024)) return_val_if_reached (false); if (!p11_buffer_reset (&output, 2048)) return_val_if_reached (false); if (prepare_pem_contents (ex, &buf)) { if (!p11_pem_write (buf.data, buf.len, "TRUSTED CERTIFICATE", &output)) return_val_if_reached (false); name = p11_enumerate_filename (ex); return_val_if_fail (name != NULL, false); filename = NULL; path = NULL; ret = false; file = p11_save_open_file_in (dir, name, ".pem"); if (file != NULL) { ret = p11_save_write (file, output.data, output.len); if (!p11_save_finish_file (file, &path, ret)) ret = false; if (ret) filename = p11_path_base (path); } /* * The OpenSSL style c_rehash stuff * * Different versions of openssl build these hashes differently * so output both of them. Shouldn't cause confusion, because * multiple certificates can hash to the same link anyway, * and this is the reason for the trailing number after the dot. * * The trailing number is incremented p11_save_symlink_in() if it * conflicts with something we've already written out. * * On Windows no symlinks. */ #ifdef OS_UNIX if (ret) { linkname = symlink_for_subject_hash (ex); if (linkname) { ret = p11_save_symlink_in (dir, linkname, ".0", filename); free (linkname); } } if (ret) { linkname = symlink_for_subject_old_hash (ex); if (linkname) { ret = p11_save_symlink_in (dir, linkname, ".0", filename); free (linkname); } } #endif /* OS_UNIX */ free (filename); free (path); free (name); } if (!ret) break; } p11_buffer_uninit (&buf); p11_buffer_uninit (&output); if (rv != CKR_OK && rv != CKR_CANCEL) { p11_message ("failed to find certificates: %s", p11_kit_strerror (rv)); ret = false; } p11_save_finish_directory (dir, ret); return ret; } p11-kit-0.20.2/trust/extract-cer.c0000664000175000017500000000655712226763526013502 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include "debug.h" #include "extract.h" #include "message.h" #include "save.h" #include bool p11_extract_x509_file (p11_enumerate *ex, const char *destination) { bool found = false; p11_save_file *file; CK_RV rv; while ((rv = p11_kit_iter_next (ex->iter)) == CKR_OK) { if (found) { p11_message ("multiple certificates found but could only write one to file"); break; } file = p11_save_open_file (destination, NULL, ex->flags); if (!p11_save_write_and_finish (file, ex->cert_der, ex->cert_len)) return false; /* Wrote something */ found = true; } if (rv != CKR_OK && rv != CKR_CANCEL) { p11_message ("failed to find certificates: %s", p11_kit_strerror (rv)); return false; /* Remember that an empty DER file is not a valid file, so complain if nothing */ } else if (!found) { p11_message ("no certificate found"); return false; } return true; } bool p11_extract_x509_directory (p11_enumerate *ex, const char *destination) { p11_save_file *file; p11_save_dir *dir; char *filename; CK_RV rv; bool ret; dir = p11_save_open_directory (destination, ex->flags); if (dir == NULL) return false; while ((rv = p11_kit_iter_next (ex->iter)) == CKR_OK) { filename = p11_enumerate_filename (ex); return_val_if_fail (filename != NULL, -1); file = p11_save_open_file_in (dir, filename, ".cer"); free (filename); if (!p11_save_write_and_finish (file, ex->cert_der, ex->cert_len)) { p11_save_finish_directory (dir, false); return false; } } if (rv != CKR_OK && rv != CKR_CANCEL) { p11_message ("failed to find certificates: %s", p11_kit_strerror (rv)); ret = false; } else { ret = true; } p11_save_finish_directory (dir, ret); return ret; } p11-kit-0.20.2/trust/list.c0000664000175000017500000001450212226763526012221 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #define P11_DEBUG_FLAG P11_DEBUG_TOOL #include "attrs.h" #include "constants.h" #include "debug.h" #include "enumerate.h" #include "iter.h" #include "list.h" #include "pkcs11x.h" #include "message.h" #include "tool.h" #include #include #include static char * format_uri (p11_enumerate *ex, int flags) { CK_ATTRIBUTE *attr; p11_kit_uri *uri; char *string; uri = p11_kit_uri_new (); memcpy (p11_kit_uri_get_token_info (uri), p11_kit_iter_get_token (ex->iter), sizeof (CK_TOKEN_INFO)); attr = p11_attrs_find (ex->attrs, CKA_CLASS); if (attr != NULL) p11_kit_uri_set_attribute (uri, attr); attr = p11_attrs_find (ex->attrs, CKA_ID); if (attr != NULL) p11_kit_uri_set_attribute (uri, attr); if (p11_kit_uri_format (uri, flags, &string) != P11_KIT_URI_OK) string = NULL; p11_kit_uri_free (uri); return string; } static bool list_iterate (p11_enumerate *ex, bool details) { CK_OBJECT_HANDLE object; CK_ATTRIBUTE *attr; CK_ULONG klass; CK_ULONG category; CK_BBOOL val; CK_RV rv; const char *nick; char *string; int flags; flags = P11_KIT_URI_FOR_OBJECT; if (details) flags |= P11_KIT_URI_FOR_OBJECT_ON_TOKEN; while ((rv = p11_kit_iter_next (ex->iter)) == CKR_OK) { if (p11_debugging) { object = p11_kit_iter_get_object (ex->iter); p11_debug ("handle: %lu", object); string = p11_attrs_to_string (ex->attrs, -1); p11_debug ("attrs: %s", string); free (string); } string = format_uri (ex, flags); if (string == NULL) { p11_message ("skipping object, couldn't build uri"); continue; } printf ("%s\n", string); free (string); if (p11_attrs_find_ulong (ex->attrs, CKA_CLASS, &klass)) { nick = p11_constant_nick (p11_constant_classes, klass); if (nick != NULL) printf (" type: %s\n", nick); } attr = p11_attrs_find_valid (ex->attrs, CKA_LABEL); if (attr && attr->pValue && attr->ulValueLen) { string = strndup (attr->pValue, attr->ulValueLen); printf (" label: %s\n", string); } if (p11_attrs_find_bool (ex->attrs, CKA_X_DISTRUSTED, &val) && val) printf (" trust: blacklisted\n"); else if (p11_attrs_find_bool (ex->attrs, CKA_TRUSTED, &val) && val) printf (" trust: anchor\n"); else printf (" trust: unspecified\n"); if (p11_attrs_find_ulong (ex->attrs, CKA_CERTIFICATE_CATEGORY, &category)) { nick = p11_constant_nick (p11_constant_categories, category); if (nick != NULL) printf (" category: %s\n", nick); } printf ("\n"); } return (rv == CKR_CANCEL); } int p11_trust_list (int argc, char **argv) { p11_enumerate ex; bool details = false; int opt = 0; int ret; enum { opt_verbose = 'v', opt_quiet = 'q', opt_help = 'h', opt_filter = 1000, opt_purpose, opt_details, }; struct option options[] = { { "filter", required_argument, NULL, opt_filter }, { "purpose", required_argument, NULL, opt_purpose }, { "details", no_argument, NULL, opt_details }, { "verbose", no_argument, NULL, opt_verbose }, { "quiet", no_argument, NULL, opt_quiet }, { "help", no_argument, NULL, opt_help }, { 0 }, }; p11_tool_desc usages[] = { { 0, "usage: trust list --filter=" }, { opt_filter, "filter of what to export\n" " ca-anchors certificate anchors\n" " blacklist blacklisted certificates\n" " trust-policy anchors and blacklist (default)\n" " certificates all certificates\n" " pkcs11:object=xx a PKCS#11 URI", "what", }, { opt_purpose, "limit to certificates usable for the purpose\n" " server-auth for authenticating servers\n" " client-auth for authenticating clients\n" " email for email protection\n" " code-signing for authenticating signed code\n" " 1.2.3.4.5... an arbitrary object id", "usage" }, { opt_verbose, "show verbose debug output", }, { opt_quiet, "supress command output", }, { 0 }, }; p11_enumerate_init (&ex); while ((opt = p11_tool_getopt (argc, argv, options)) != -1) { switch (opt) { case opt_verbose: case opt_quiet: break; case opt_filter: if (!p11_enumerate_opt_filter (&ex, optarg)) exit (2); break; case opt_purpose: if (!p11_enumerate_opt_purpose (&ex, optarg)) exit (2); break; case opt_details: details = true; break; case 'h': p11_tool_usage (usages, options); exit (0); case '?': exit (2); default: assert_not_reached (); break; } } argc -= optind; argv += optind; if (argc != 0) { p11_message ("extra arguments passed to command"); exit (2); } if (!p11_enumerate_ready (&ex, "trust-policy")) exit (1); ret = list_iterate (&ex, details) ? 0 : 1; p11_enumerate_cleanup (&ex); return ret; } p11-kit-0.20.2/trust/types.h0000664000175000017500000000410312226763526012413 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef TYPES_H_ #define TYPES_H_ 1 #include "pkcs11x.h" /* * A boolean value which denotes whether we auto generated * this object, as opposed to coming from outside the builder. * * We set this on all objects. It will always be either CK_TRUE * or CK_FALSE for all objects built by this builder. */ #define CKA_X_GENERATED (CKA_X_VENDOR + 8000) /* * A string pointing to the filename from which this was loaded. */ #define CKA_X_ORIGIN (CKA_X_VENDOR + 8001) #endif /* TYPES_H_ */ p11-kit-0.20.2/trust/enumerate.c0000664000175000017500000004745212265242533013236 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #define P11_DEBUG_FLAG P11_DEBUG_TOOL #include "attrs.h" #include "debug.h" #include "oid.h" #include "dict.h" #include "extract.h" #include "message.h" #include "path.h" #include "pkcs11.h" #include "pkcs11x.h" #include "x509.h" #include #include static bool load_stapled_extension (p11_dict *stapled, p11_dict *asn1_defs, const unsigned char *der, size_t len) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; node_asn *ext; char *oid; int length; int start; int end; int ret; ext = p11_asn1_decode (asn1_defs, "PKIX1.Extension", der, len, message); if (ext == NULL) { p11_message ("couldn't parse stapled certificate extension: %s", message); return false; } ret = asn1_der_decoding_startEnd (ext, der, len, "extnID", &start, &end); return_val_if_fail (ret == ASN1_SUCCESS, false); /* Make sure it's a straightforward oid with certain assumptions */ length = (end - start) + 1; if (!p11_oid_simple (der + start, length)) { p11_debug ("strange complex certificate extension object id"); return false; } oid = memdup (der + start, length); return_val_if_fail (oid != NULL, false); if (!p11_dict_set (stapled, oid, ext)) return_val_if_reached (false); return true; } static p11_dict * load_stapled_extensions (p11_enumerate *ex, CK_ATTRIBUTE *spki) { CK_OBJECT_CLASS extension = CKO_X_CERTIFICATE_EXTENSION; CK_ATTRIBUTE *attrs; P11KitIter *iter; CK_RV rv = CKR_OK; p11_dict *stapled; CK_ATTRIBUTE match[] = { { CKA_CLASS, &extension, sizeof (extension) }, { CKA_X_PUBLIC_KEY_INFO, spki->pValue, spki->ulValueLen }, }; CK_ATTRIBUTE template[] = { { CKA_VALUE, }, }; stapled = p11_dict_new (p11_oid_hash, p11_oid_equal, free, p11_asn1_free); /* No ID to use, just short circuit */ if (!spki->pValue || !spki->ulValueLen) return stapled; iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_add_filter (iter, match, 2); p11_kit_iter_begin_with (iter, p11_kit_iter_get_module (ex->iter), 0, p11_kit_iter_get_session (ex->iter)); while (rv == CKR_OK) { rv = p11_kit_iter_next (iter); if (rv == CKR_OK) { attrs = p11_attrs_buildn (NULL, template, 1); rv = p11_kit_iter_load_attributes (iter, attrs, 1); if (rv == CKR_OK) { if (!load_stapled_extension (stapled, ex->asn1_defs, attrs[0].pValue, attrs[0].ulValueLen)) { rv = CKR_GENERAL_ERROR; } } p11_attrs_free (attrs); } } if (rv != CKR_OK && rv != CKR_CANCEL) { p11_message ("couldn't load stapled extensions for certificate: %s", p11_kit_strerror (rv)); p11_dict_free (stapled); stapled = NULL; } p11_kit_iter_free (iter); return stapled; } static bool extract_purposes (p11_enumerate *ex) { node_asn *ext = NULL; unsigned char *value = NULL; size_t length; if (ex->stapled) { ext = p11_dict_get (ex->stapled, P11_OID_EXTENDED_KEY_USAGE); if (ext != NULL) { value = p11_asn1_read (ext, "extnValue", &length); return_val_if_fail (value != NULL, false); } } if (value == NULL && ex->cert_asn) { value = p11_x509_find_extension (ex->cert_asn, P11_OID_EXTENDED_KEY_USAGE, ex->cert_der, ex->cert_len, &length); } /* No such extension, match anything */ if (value == NULL) return true; ex->purposes = p11_x509_parse_extended_key_usage (ex->asn1_defs, value, length); free (value); return ex->purposes != NULL; } static bool check_trust_flags (p11_enumerate *ex) { CK_BBOOL trusted; CK_BBOOL distrusted; int flags = 0; /* If no extract trust flags, then just continue */ if (!(ex->flags & (P11_ENUMERATE_ANCHORS | P11_ENUMERATE_BLACKLIST))) return true; /* Is this a blacklisted directly? */ if (p11_attrs_find_bool (ex->attrs, CKA_X_DISTRUSTED, &distrusted) && distrusted) flags = P11_ENUMERATE_BLACKLIST; /* Is it blacklisted elsewhere? then prevent it from being an anchor */ else if (p11_dict_get (ex->blacklist_public_key, ex->attrs) || p11_dict_get (ex->blacklist_issuer_serial, ex->attrs)) flags = 0; /* Otherwise it might be an anchor? */ else if (p11_attrs_find_bool (ex->attrs, CKA_TRUSTED, &trusted) && trusted) flags = P11_ENUMERATE_ANCHORS; /* Any of the flags can match */ if (flags & ex->flags) return true; return false; } static bool extract_certificate (p11_enumerate *ex) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; CK_ATTRIBUTE *attr; CK_ULONG type; /* Don't even bother with not X.509 certificates */ if (!p11_attrs_find_ulong (ex->attrs, CKA_CERTIFICATE_TYPE, &type)) type = (CK_ULONG)-1; if (type != CKC_X_509) { p11_debug ("skipping non X.509 certificate"); return false; } attr = p11_attrs_find_valid (ex->attrs, CKA_VALUE); if (!attr || !attr->pValue) { p11_debug ("skipping certificate without a value"); return false; } /* * If collapsing and have already seen this certificate, and shouldn't * process it even again during this extract procedure. */ if (ex->flags & P11_ENUMERATE_COLLAPSE) { if (!ex->already_seen) { ex->already_seen = p11_dict_new (p11_attr_hash, p11_attr_equal, p11_attrs_free, NULL); return_val_if_fail (ex->already_seen != NULL, true); } if (p11_dict_get (ex->already_seen, attr)) return false; } if (!check_trust_flags (ex)) { p11_debug ("skipping certificate that doesn't match trust flags"); return false; } if (ex->already_seen) { if (!p11_dict_set (ex->already_seen, p11_attrs_build (NULL, attr, NULL), "x")) return_val_if_reached (true); } ex->cert_der = attr->pValue; ex->cert_len = attr->ulValueLen; ex->cert_asn = p11_asn1_decode (ex->asn1_defs, "PKIX1.Certificate", ex->cert_der, ex->cert_len, message); if (!ex->cert_asn) { p11_message ("couldn't parse certificate: %s", message); return false; } return true; } static bool extract_info (p11_enumerate *ex) { CK_ATTRIBUTE *attr; CK_RV rv; static const CK_ATTRIBUTE attr_types[] = { { CKA_ID, }, { CKA_CLASS, }, { CKA_CERTIFICATE_TYPE, }, { CKA_LABEL, }, { CKA_VALUE, }, { CKA_SUBJECT, }, { CKA_ISSUER, }, { CKA_SERIAL_NUMBER, }, { CKA_TRUSTED, }, { CKA_CERTIFICATE_CATEGORY }, { CKA_X_DISTRUSTED }, { CKA_X_PUBLIC_KEY_INFO }, { CKA_INVALID, }, }; ex->attrs = p11_attrs_dup (attr_types); rv = p11_kit_iter_load_attributes (ex->iter, ex->attrs, p11_attrs_count (ex->attrs)); /* The attributes couldn't be loaded */ if (rv != CKR_OK && rv != CKR_ATTRIBUTE_TYPE_INVALID && rv != CKR_ATTRIBUTE_SENSITIVE) { p11_message ("couldn't load attributes: %s", p11_kit_strerror (rv)); return false; } /* No class attribute, very strange, just skip */ if (!p11_attrs_find_ulong (ex->attrs, CKA_CLASS, &ex->klass)) return false; /* If a certificate then */ if (ex->klass != CKO_CERTIFICATE) { p11_message ("skipping non-certificate object"); return false; } if (!extract_certificate (ex)) return false; attr = p11_attrs_find_valid (ex->attrs, CKA_X_PUBLIC_KEY_INFO); if (attr) { ex->stapled = load_stapled_extensions (ex, attr); if (!ex->stapled) return false; } if (!extract_purposes (ex)) return false; return true; } static void extract_clear (p11_enumerate *ex) { ex->klass = (CK_ULONG)-1; p11_attrs_free (ex->attrs); ex->attrs = NULL; asn1_delete_structure (&ex->cert_asn); ex->cert_der = NULL; ex->cert_len = 0; p11_dict_free (ex->stapled); ex->stapled = NULL; p11_array_free (ex->purposes); ex->purposes = NULL; } static CK_RV on_iterate_load_filter (p11_kit_iter *iter, CK_BBOOL *matches, void *data) { p11_enumerate *ex = data; int i; extract_clear (ex); /* Try to load the certificate and extensions */ if (!extract_info (ex)) { *matches = CK_FALSE; return CKR_OK; } /* * Limit to certain purposes. Note that the lack of purposes noted * on the certificate means they match any purpose. This is the * behavior of the ExtendedKeyUsage extension. */ if (ex->limit_to_purposes && ex->purposes) { *matches = CK_FALSE; for (i = 0; i < ex->purposes->num; i++) { if (p11_dict_get (ex->limit_to_purposes, ex->purposes->elem[i])) { *matches = CK_TRUE; break; } } } return CKR_OK; } /* * Various skip lookup tables, used for blacklists and collapsing * duplicate entries. * * The dict hash/lookup callbacks are special cased * so we can just pass in full attribute lists for lookup and only match * the attributes we're interested in. * * Note that both p11_attr_hash and p11_attr_equal are NULL safe. */ static bool public_key_equal (const void *one, const void *two) { return p11_attr_equal (p11_attrs_find_valid ((CK_ATTRIBUTE *)one, CKA_X_PUBLIC_KEY_INFO), p11_attrs_find_valid ((CK_ATTRIBUTE *)two, CKA_X_PUBLIC_KEY_INFO)); } static unsigned int public_key_hash (const void *data) { return p11_attr_hash (p11_attrs_find_valid ((CK_ATTRIBUTE *)data, CKA_X_PUBLIC_KEY_INFO)); } static bool issuer_serial_equal (const void *one, const void *two) { return p11_attr_equal (p11_attrs_find_valid ((CK_ATTRIBUTE *)one, CKA_ISSUER), p11_attrs_find_valid ((CK_ATTRIBUTE *)two, CKA_ISSUER)) && p11_attr_equal (p11_attrs_find_valid ((CK_ATTRIBUTE *)one, CKA_SERIAL_NUMBER), p11_attrs_find_valid ((CK_ATTRIBUTE *)two, CKA_SERIAL_NUMBER)); } static unsigned int issuer_serial_hash (const void *data) { return p11_attr_hash (p11_attrs_find_valid ((CK_ATTRIBUTE *)data, CKA_ISSUER)) ^ p11_attr_hash (p11_attrs_find_valid ((CK_ATTRIBUTE *)data, CKA_SERIAL_NUMBER)); } static bool blacklist_load (p11_enumerate *ex) { p11_kit_iter *iter; CK_BBOOL distrusted = CK_TRUE; CK_RV rv = CKR_OK; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *key; CK_ATTRIBUTE *serial; CK_ATTRIBUTE *issuer; CK_ATTRIBUTE *public_key; CK_ATTRIBUTE match[] = { { CKA_X_DISTRUSTED, &distrusted, sizeof (distrusted) }, }; CK_ATTRIBUTE template[] = { { CKA_SERIAL_NUMBER, }, { CKA_X_PUBLIC_KEY_INFO, }, { CKA_ISSUER, }, }; iter = p11_kit_iter_new (ex->uri, 0); p11_kit_iter_add_filter (iter, match, 1); p11_kit_iter_begin (iter, ex->modules); attrs = p11_attrs_buildn (NULL, template, 3); while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { /* * Fail "safe" in that first failure doesn't cause ignoring * the remainder of the blacklist. */ rv = p11_kit_iter_load_attributes (iter, attrs, 3); if (rv != CKR_OK) { p11_message ("couldn't load blacklist: %s", p11_kit_strerror (rv)); continue; } /* A blacklisted item with an issuer and serial number */ issuer = p11_attrs_find_valid (attrs, CKA_ISSUER); serial = p11_attrs_find_valid (attrs, CKA_SERIAL_NUMBER); if (issuer != NULL && serial != NULL) { key = p11_attrs_build (NULL, issuer, serial, NULL); if (!key || !p11_dict_set (ex->blacklist_issuer_serial, key, "x")) return_val_if_reached (false); } /* A blacklisted item with a public key */ public_key = p11_attrs_find_valid (attrs, CKA_X_PUBLIC_KEY_INFO); if (public_key != NULL) { key = p11_attrs_build (NULL, public_key, NULL); if (!public_key || !p11_dict_set (ex->blacklist_public_key, key, "x")) return_val_if_reached (false); } } p11_attrs_free (attrs); p11_kit_iter_free (iter); if (rv == CKR_CANCEL) return true; p11_message ("couldn't load blacklist: %s", p11_kit_strerror (rv)); return false; } void p11_enumerate_init (p11_enumerate *ex) { memset (ex, 0, sizeof (p11_enumerate)); ex->asn1_defs = p11_asn1_defs_load (); return_if_fail (ex->asn1_defs != NULL); ex->iter = p11_kit_iter_new (NULL, 0); return_if_fail (ex->iter != NULL); ex->blacklist_public_key = p11_dict_new (public_key_hash, public_key_equal, p11_attrs_free, NULL); return_if_fail (ex->blacklist_public_key); ex->blacklist_issuer_serial = p11_dict_new (issuer_serial_hash, issuer_serial_equal, p11_attrs_free, NULL); return_if_fail (ex->blacklist_issuer_serial); p11_kit_iter_add_callback (ex->iter, on_iterate_load_filter, ex, NULL); } void p11_enumerate_cleanup (p11_enumerate *ex) { extract_clear (ex); p11_dict_free (ex->limit_to_purposes); ex->limit_to_purposes = NULL; p11_dict_free (ex->already_seen); ex->already_seen = NULL; p11_dict_free (ex->blacklist_public_key); ex->blacklist_public_key = NULL; p11_dict_free (ex->blacklist_issuer_serial); ex->blacklist_issuer_serial = NULL; p11_dict_free (ex->asn1_defs); ex->asn1_defs = NULL; p11_kit_iter_free (ex->iter); ex->iter = NULL; if (ex->modules) { p11_kit_modules_finalize_and_release (ex->modules); ex->modules = NULL; } if (ex->uri) { p11_kit_uri_free (ex->uri); ex->uri = NULL; } } bool p11_enumerate_opt_filter (p11_enumerate *ex, const char *option) { CK_ATTRIBUTE *attrs; int ret; CK_OBJECT_CLASS vcertificate = CKO_CERTIFICATE; CK_ULONG vauthority = 2; CK_CERTIFICATE_TYPE vx509 = CKC_X_509; CK_ATTRIBUTE certificate = { CKA_CLASS, &vcertificate, sizeof (vcertificate) }; CK_ATTRIBUTE authority = { CKA_CERTIFICATE_CATEGORY, &vauthority, sizeof (vauthority) }; CK_ATTRIBUTE x509= { CKA_CERTIFICATE_TYPE, &vx509, sizeof (vx509) }; if (strncmp (option, "pkcs11:", 7) == 0) { if (ex->uri != NULL) { p11_message ("a PKCS#11 URI has already been specified"); return false; } ex->uri = p11_kit_uri_new (); ret = p11_kit_uri_parse (option, P11_KIT_URI_FOR_OBJECT_ON_TOKEN_AND_MODULE, ex->uri); if (ret != P11_KIT_URI_OK) { p11_message ("couldn't parse pkcs11 uri filter: %s", option); return false; } if (p11_kit_uri_any_unrecognized (ex->uri)) p11_message ("uri contained unrecognized components, nothing will be extracted"); p11_kit_iter_set_uri (ex->iter, ex->uri); ex->num_filters++; return true; } if (strcmp (option, "ca-anchors") == 0) { attrs = p11_attrs_build (NULL, &certificate, &authority, &x509, NULL); ex->flags |= P11_ENUMERATE_ANCHORS | P11_ENUMERATE_COLLAPSE; } else if (strcmp (option, "trust-policy") == 0) { attrs = p11_attrs_build (NULL, &certificate, &x509, NULL); ex->flags |= P11_ENUMERATE_ANCHORS | P11_ENUMERATE_BLACKLIST | P11_ENUMERATE_COLLAPSE; } else if (strcmp (option, "blacklist") == 0) { attrs = p11_attrs_build (NULL, &certificate, &x509, NULL); ex->flags |= P11_ENUMERATE_BLACKLIST | P11_ENUMERATE_COLLAPSE; } else if (strcmp (option, "certificates") == 0) { attrs = p11_attrs_build (NULL, &certificate, &x509, NULL); ex->flags |= P11_ENUMERATE_COLLAPSE; } else { p11_message ("unsupported or unrecognized filter: %s", option); return false; } p11_kit_iter_add_filter (ex->iter, attrs, p11_attrs_count (attrs)); ex->num_filters++; return true; } static int is_valid_oid_rough (const char *string) { size_t len; len = strlen (string); /* Rough check if a valid OID */ return (strspn (string, "0123456789.") == len && !strstr (string, "..") && string[0] != '\0' && string[0] != '.' && string[len - 1] != '.'); } bool p11_enumerate_opt_purpose (p11_enumerate *ex, const char *option) { const char *oid; char *value; if (strcmp (option, "server-auth") == 0) { oid = P11_OID_SERVER_AUTH_STR; } else if (strcmp (option, "client-auth") == 0) { oid = P11_OID_CLIENT_AUTH_STR; } else if (strcmp (option, "email-protection") == 0 || strcmp (option, "email") == 0) { oid = P11_OID_EMAIL_PROTECTION_STR; } else if (strcmp (option, "code-signing") == 0) { oid = P11_OID_CODE_SIGNING_STR; } else if (strcmp (option, "ipsec-end-system") == 0) { oid = P11_OID_IPSEC_END_SYSTEM_STR; } else if (strcmp (option, "ipsec-tunnel") == 0) { oid = P11_OID_IPSEC_TUNNEL_STR; } else if (strcmp (option, "ipsec-user") == 0) { oid = P11_OID_IPSEC_USER_STR; } else if (strcmp (option, "time-stamping") == 0) { oid = P11_OID_TIME_STAMPING_STR; } else if (is_valid_oid_rough (option)) { oid = option; } else { p11_message ("unsupported or unregonized purpose: %s", option); return false; } if (!ex->limit_to_purposes) { ex->limit_to_purposes = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, NULL); return_val_if_fail (ex->limit_to_purposes != NULL, false); } value = strdup (oid); return_val_if_fail (value != NULL, false); if (!p11_dict_set (ex->limit_to_purposes, value, value)) return_val_if_reached (false); return true; } bool p11_enumerate_ready (p11_enumerate *ex, const char *def_filter) { if (def_filter && ex->num_filters == 0) { if (!p11_enumerate_opt_filter (ex, def_filter)) return_val_if_reached (false); } /* * We only "believe" the CKA_TRUSTED and CKA_X_DISTRUSTED attributes * we get from modules explicitly marked as containing trust-policy. */ if (!ex->modules) ex->modules = p11_kit_modules_load_and_initialize (P11_KIT_MODULE_TRUSTED); if (!ex->modules) return false; if (ex->modules[0] == NULL) p11_message ("no modules containing trust policy are registered"); /* * If loading anchors, then the caller expects that the blacklist is * "applied" and any anchors on the blacklist are taken out. This is * for compatibility with software that does not support blacklists. */ if (ex->flags & P11_ENUMERATE_ANCHORS) { if (!blacklist_load (ex)) return false; } p11_kit_iter_begin (ex->iter, ex->modules); return true; } static char * extract_label (p11_enumerate *ex) { CK_ATTRIBUTE *attr; /* Look for a label and just use that */ attr = p11_attrs_find_valid (ex->attrs, CKA_LABEL); if (attr && attr->pValue && attr->ulValueLen) return strndup (attr->pValue, attr->ulValueLen); /* For extracting certificates */ if (ex->klass == CKO_CERTIFICATE) return strdup ("certificate"); return strdup ("unknown"); } char * p11_enumerate_filename (p11_enumerate *ex) { char *label; label = extract_label (ex); return_val_if_fail (label != NULL, NULL); p11_path_canon (label); return label; } char * p11_enumerate_comment (p11_enumerate *ex, bool first) { char *comment; char *label; if (!(ex->flags & P11_EXTRACT_COMMENT)) return NULL; label = extract_label (ex); if (!asprintf (&comment, "%s# %s\n", first ? "" : "\n", label ? label : "")) return_val_if_reached (NULL); free (label); return comment; } p11-kit-0.20.2/trust/asn1.c0000664000175000017500000002102512226763526012106 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "asn1.h" #define P11_DEBUG_FLAG P11_DEBUG_TRUST #include "debug.h" #include "oid.h" #include "openssl.asn.h" #include "pkix.asn.h" #include #include #include static void free_asn1_def (void *data) { node_asn *def = data; asn1_delete_structure (&def); } struct { const ASN1_ARRAY_TYPE* tab; const char *prefix; int prefix_len; } asn1_tabs[] = { { pkix_asn1_tab, "PKIX1.", 6 }, { openssl_asn1_tab, "OPENSSL.", 8 }, { NULL, }, }; p11_dict * p11_asn1_defs_load (void) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = { 0, }; node_asn *def; p11_dict *defs; int ret; int i; defs = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, NULL, free_asn1_def); for (i = 0; asn1_tabs[i].tab != NULL; i++) { def = NULL; ret = asn1_array2tree (asn1_tabs[i].tab, &def, message); if (ret != ASN1_SUCCESS) { p11_debug_precond ("failed to load %s* definitions: %s: %s\n", asn1_tabs[i].prefix, asn1_strerror (ret), message); return NULL; } if (!p11_dict_set (defs, (void *)asn1_tabs[i].prefix, def)) return_val_if_reached (NULL); } return defs; } static node_asn * lookup_def (p11_dict *asn1_defs, const char *struct_name) { int i; for (i = 0; asn1_tabs[i].tab != NULL; i++) { if (strncmp (struct_name, asn1_tabs[i].prefix, asn1_tabs[i].prefix_len) == 0) return p11_dict_get (asn1_defs, asn1_tabs[i].prefix); } p11_debug_precond ("unknown prefix for element: %s\n", struct_name); return NULL; } node_asn * p11_asn1_create (p11_dict *asn1_defs, const char *struct_name) { node_asn *def; node_asn *asn; int ret; return_val_if_fail (asn1_defs != NULL, NULL); def = lookup_def (asn1_defs, struct_name); return_val_if_fail (def != NULL, NULL); ret = asn1_create_element (def, struct_name, &asn); if (ret != ASN1_SUCCESS) { p11_debug_precond ("failed to create element %s: %s\n", struct_name, asn1_strerror (ret)); return NULL; } return asn; } node_asn * p11_asn1_decode (p11_dict *asn1_defs, const char *struct_name, const unsigned char *der, size_t der_len, char *message) { char msg[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; node_asn *asn = NULL; int ret; return_val_if_fail (asn1_defs != NULL, NULL); asn = p11_asn1_create (asn1_defs, struct_name); return_val_if_fail (asn != NULL, NULL); /* asn1_der_decoding destroys the element if fails */ ret = asn1_der_decoding (&asn, der, der_len, message ? message : msg); if (ret != ASN1_SUCCESS) { /* If caller passed in a message buffer, assume they're logging */ if (!message) { p11_debug ("couldn't parse %s: %s: %s", struct_name, asn1_strerror (ret), msg); } return NULL; } return asn; } unsigned char * p11_asn1_encode (node_asn *asn, size_t *der_len) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; unsigned char *der; int len; int ret; return_val_if_fail (der_len != NULL, NULL); len = 0; ret = asn1_der_coding (asn, "", NULL, &len, message); return_val_if_fail (ret != ASN1_SUCCESS, NULL); if (ret == ASN1_MEM_ERROR) { der = malloc (len); return_val_if_fail (der != NULL, NULL); ret = asn1_der_coding (asn, "", der, &len, message); } if (ret != ASN1_SUCCESS) { p11_debug_precond ("failed to encode: %s\n", message); return NULL; } if (der_len) *der_len = len; return der; } void * p11_asn1_read (node_asn *asn, const char *field, size_t *length) { unsigned char *value; int len; int ret; return_val_if_fail (asn != NULL, NULL); return_val_if_fail (field != NULL, NULL); return_val_if_fail (length != NULL, NULL); len = 0; ret = asn1_read_value (asn, field, NULL, &len); if (ret == ASN1_ELEMENT_NOT_FOUND) return NULL; return_val_if_fail (ret == ASN1_MEM_ERROR, NULL); value = malloc (len + 1); return_val_if_fail (value != NULL, NULL); ret = asn1_read_value (asn, field, value, &len); return_val_if_fail (ret == ASN1_SUCCESS, NULL); /* Courtesy zero terminated */ value[len] = '\0'; *length = len; return value; } void p11_asn1_free (void *asn) { node_asn *node = asn; if (node != NULL) asn1_delete_structure (&node); } ssize_t p11_asn1_tlv_length (const unsigned char *data, size_t length) { unsigned char cls; int counter = 0; int cb, len; unsigned long tag; if (asn1_get_tag_der (data, length, &cls, &cb, &tag) == ASN1_SUCCESS) { counter += cb; len = asn1_get_length_der (data + cb, length - cb, &cb); counter += cb; if (len >= 0) { len += counter; if (length >= len) return len; } } return -1; } typedef struct { node_asn *node; char *struct_name; size_t length; } asn1_item; static void free_asn1_item (void *data) { asn1_item *item = data; free (item->struct_name); asn1_delete_structure (&item->node); free (item); } struct _p11_asn1_cache { p11_dict *defs; p11_dict *items; }; p11_asn1_cache * p11_asn1_cache_new (void) { p11_asn1_cache *cache; cache = calloc (1, sizeof (p11_asn1_cache)); return_val_if_fail (cache != NULL, NULL); cache->defs = p11_asn1_defs_load (); return_val_if_fail (cache->defs != NULL, NULL); cache->items = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, free_asn1_item); return_val_if_fail (cache->items != NULL, NULL); return cache; } node_asn * p11_asn1_cache_get (p11_asn1_cache *cache, const char *struct_name, const unsigned char *der, size_t der_len) { asn1_item *item; if (cache == NULL) return NULL; return_val_if_fail (struct_name != NULL, NULL); return_val_if_fail (der != NULL, NULL); item = p11_dict_get (cache->items, der); if (item != NULL) { return_val_if_fail (item->length == der_len, NULL); return_val_if_fail (strcmp (item->struct_name, struct_name) == 0, NULL); return item->node; } return NULL; } void p11_asn1_cache_take (p11_asn1_cache *cache, node_asn *node, const char *struct_name, const unsigned char *der, size_t der_len) { asn1_item *item; if (cache == NULL) { asn1_delete_structure (&node); return; } return_if_fail (struct_name != NULL); return_if_fail (der != NULL); return_if_fail (der_len != 0); item = calloc (1, sizeof (asn1_item)); return_if_fail (item != NULL); item->length = der_len; item->node = node; item->struct_name = strdup (struct_name); return_if_fail (item->struct_name != NULL); if (!p11_dict_set (cache->items, (void *)der, item)) return_if_reached (); } void p11_asn1_cache_flush (p11_asn1_cache *cache) { if (cache == NULL) return; p11_dict_clear (cache->items); } p11_dict * p11_asn1_cache_defs (p11_asn1_cache *cache) { return_val_if_fail (cache != NULL, NULL); return cache->defs; } void p11_asn1_cache_free (p11_asn1_cache *cache) { if (!cache) return; p11_dict_free (cache->items); p11_dict_free (cache->defs); free (cache); } p11-kit-0.20.2/trust/anchor.c0000664000175000017500000003557612226763526012536 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #define P11_DEBUG_FLAG P11_DEBUG_TOOL #include "anchor.h" #include "attrs.h" #include "debug.h" #include "constants.h" #include "extract.h" #include "iter.h" #include "message.h" #include "parser.h" #include "p11-kit.h" #include "tool.h" #include #include #include #include #include static p11_parser * create_arg_file_parser (void) { p11_parser *parser; parser = p11_parser_new (NULL); return_val_if_fail (parser != NULL, NULL); p11_parser_formats (parser, p11_parser_format_x509, p11_parser_format_pem, NULL); return parser; } static bool iter_match_anchor (p11_kit_iter *iter, CK_ATTRIBUTE *attrs) { CK_ATTRIBUTE *attr; attr = p11_attrs_find_valid (attrs, CKA_CLASS); if (attr == NULL) return false; p11_kit_iter_add_filter (iter, attr, 1); attr = p11_attrs_find_valid (attrs, CKA_VALUE); if (attr == NULL) return false; p11_kit_iter_add_filter (iter, attr, 1); return true; } static p11_array * uris_or_files_to_iters (int argc, char *argv[], int behavior) { int flags = P11_KIT_URI_FOR_OBJECT_ON_TOKEN_AND_MODULE; p11_parser *parser = NULL; p11_array *iters; p11_array *parsed; p11_kit_uri *uri; p11_kit_iter *iter; int ret; int i, j; iters = p11_array_new ((p11_destroyer)p11_kit_iter_free); return_val_if_fail (iters != NULL, NULL); for (i = 0; i < argc; i++) { /* A PKCS#11 URI */ if (strncmp (argv[i], "pkcs11:", 7) == 0) { uri = p11_kit_uri_new (); if (p11_kit_uri_parse (argv[i], flags, uri) != P11_KIT_URI_OK) { p11_message ("invalid PKCS#11 uri: %s", argv[i]); p11_kit_uri_free (uri); break; } iter = p11_kit_iter_new (uri, behavior); return_val_if_fail (iter != NULL, NULL); p11_kit_uri_free (uri); if (!p11_array_push (iters, iter)) return_val_if_reached (NULL); } else { if (parser == NULL) parser = create_arg_file_parser (); ret = p11_parse_file (parser, argv[i], NULL, P11_PARSE_FLAG_ANCHOR); switch (ret) { case P11_PARSE_SUCCESS: p11_debug ("parsed file: %s", argv[i]); break; case P11_PARSE_UNRECOGNIZED: p11_message ("unrecognized file format: %s", argv[i]); break; default: p11_message ("failed to parse file: %s", argv[i]); break; } if (ret != P11_PARSE_SUCCESS) break; parsed = p11_parser_parsed (parser); for (j = 0; j < parsed->num; j++) { iter = p11_kit_iter_new (NULL, behavior); return_val_if_fail (iter != NULL, NULL); iter_match_anchor (iter, parsed->elem[j]); if (!p11_array_push (iters, iter)) return_val_if_reached (NULL); } } } if (parser) p11_parser_free (parser); if (argc != i) { p11_array_free (iters); return NULL; } return iters; } static p11_array * files_to_attrs (int argc, char *argv[]) { p11_parser *parser; p11_array *parsed; p11_array *array; int ret = P11_PARSE_SUCCESS; int i, j; array = p11_array_new (p11_attrs_free); return_val_if_fail (array != NULL, NULL); parser = create_arg_file_parser (); return_val_if_fail (parser != NULL, NULL); for (i = 0; i < argc; i++) { ret = p11_parse_file (parser, argv[i], NULL, P11_PARSE_FLAG_ANCHOR); switch (ret) { case P11_PARSE_SUCCESS: p11_debug ("parsed file: %s", argv[i]); break; case P11_PARSE_UNRECOGNIZED: p11_message ("unrecognized file format: %s", argv[i]); break; default: p11_message ("failed to parse file: %s", argv[i]); break; } if (ret != P11_PARSE_SUCCESS) break; parsed = p11_parser_parsed (parser); for (j = 0; j < parsed->num; j++) { if (!p11_array_push (array, parsed->elem[j])) return_val_if_reached (NULL); parsed->elem[j] = NULL; } } p11_parser_free (parser); if (ret == P11_PARSE_SUCCESS) return array; p11_array_free (array); return NULL; } static CK_SESSION_HANDLE session_for_store_on_module (const char *name, CK_FUNCTION_LIST *module, bool *found_read_only) { CK_SESSION_HANDLE session = 0; CK_SLOT_ID *slots = NULL; CK_TOKEN_INFO info; CK_ULONG count; CK_ULONG i; CK_RV rv; rv = p11_kit_module_initialize (module); if (rv != CKR_OK) { p11_message ("%s: couldn't initialize: %s", name, p11_kit_message ()); return 0UL; } rv = (module->C_GetSlotList) (CK_TRUE, NULL, &count); if (rv == CKR_OK) { slots = calloc (count, sizeof (CK_ULONG)); return_val_if_fail (slots != NULL, 0UL); rv = (module->C_GetSlotList) (CK_TRUE, slots, &count); } if (rv != CKR_OK) { p11_message ("%s: couldn't enumerate slots: %s", name, p11_kit_strerror (rv)); free (slots); return 0UL; } for (i = 0; session == 0 && i < count; i++) { rv = (module->C_GetTokenInfo) (slots[i], &info); if (rv != CKR_OK) { p11_message ("%s: couldn't get token info: %s", name, p11_kit_strerror (rv)); continue; } if (info.flags & CKF_WRITE_PROTECTED) { *found_read_only = true; continue; } rv = (module->C_OpenSession) (slots[i], CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session); if (rv != CKR_OK) { p11_message ("%s: couldn't open session: %s", name, p11_kit_strerror (rv)); session = 0; } p11_debug ("opened writable session on: %s", name); } free (slots); if (session == 0UL) p11_kit_module_finalize (module); return session; } static CK_SESSION_HANDLE session_for_store (CK_FUNCTION_LIST **module) { CK_SESSION_HANDLE session = 0UL; CK_FUNCTION_LIST **modules; bool found_read_only = false; char *name; int i; modules = p11_kit_modules_load (NULL, P11_KIT_MODULE_TRUSTED); if (modules == NULL) return 0; for (i = 0; modules[i] != NULL; i++) { if (session == 0UL) { name = p11_kit_module_get_name (modules[i]); session = session_for_store_on_module (name, modules[i], &found_read_only); if (session != 0UL) { *module = modules[i]; modules[i] = NULL; } free (name); } if (modules[i]) p11_kit_module_release (modules[i]); } if (session == 0UL) { if (found_read_only) p11_message ("no configured writable location to store anchors"); else p11_message ("no configured location to store anchors"); } free (modules); return session; } static bool create_anchor (CK_FUNCTION_LIST *module, CK_SESSION_HANDLE session, CK_ATTRIBUTE *attrs) { CK_BBOOL truev = CK_TRUE; CK_OBJECT_HANDLE object; char *string; CK_RV rv; CK_ATTRIBUTE basics[] = { { CKA_TOKEN, &truev, sizeof (truev) }, { CKA_TRUSTED, &truev, sizeof (truev) }, { CKA_INVALID, }, }; attrs = p11_attrs_merge (attrs, p11_attrs_dup (basics), true); p11_attrs_remove (attrs, CKA_MODIFIABLE); if (p11_debugging) { string = p11_attrs_to_string (attrs, -1); p11_debug ("storing: %s", string); free (string); } rv = (module->C_CreateObject) (session, attrs, p11_attrs_count (attrs), &object); p11_attrs_free (attrs); if (rv != CKR_OK) { p11_message ("couldn't create object: %s", p11_kit_strerror (rv)); return false; } return true; } static bool modify_anchor (CK_FUNCTION_LIST *module, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE *attrs) { CK_BBOOL truev = CK_TRUE; CK_ATTRIBUTE *changes; CK_ATTRIBUTE *label; char *string; CK_RV rv; CK_ATTRIBUTE trusted = { CKA_TRUSTED, &truev, sizeof (truev) }; label = p11_attrs_find_valid (attrs, CKA_LABEL); changes = p11_attrs_build (NULL, &trusted, label, NULL); return_val_if_fail (attrs != NULL, FALSE); /* Don't need the attributes anymore */ p11_attrs_free (attrs); if (p11_debugging) { string = p11_attrs_to_string (changes, -1); p11_debug ("setting: %s", string); free (string); } rv = (module->C_SetAttributeValue) (session, object, changes, p11_attrs_count (changes)); p11_attrs_free (changes); if (rv != CKR_OK) { p11_message ("couldn't create object: %s", p11_kit_strerror (rv)); return false; } return true; } static CK_OBJECT_HANDLE find_anchor (CK_FUNCTION_LIST *module, CK_SESSION_HANDLE session, CK_ATTRIBUTE *attrs) { CK_OBJECT_HANDLE object = 0UL; CK_ATTRIBUTE *attr; p11_kit_iter *iter; attr = p11_attrs_find_valid (attrs, CKA_CLASS); return_val_if_fail (attr != NULL, 0); iter = p11_kit_iter_new (NULL, 0); return_val_if_fail (iter != NULL, 0); if (iter_match_anchor (iter, attrs)) { p11_kit_iter_begin_with (iter, module, 0, session); if (p11_kit_iter_next (iter) == CKR_OK) object = p11_kit_iter_get_object (iter); } p11_kit_iter_free (iter); return object; } static int anchor_store (int argc, char *argv[], bool *changed) { CK_ATTRIBUTE *attrs; CK_FUNCTION_LIST *module = NULL; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE object; p11_array *anchors; int ret; int i; anchors = files_to_attrs (argc, argv); if (anchors == NULL) return 1; if (anchors->num == 0) { p11_message ("specify at least one anchor input file"); p11_array_free (anchors); return 2; } session = session_for_store (&module); if (session == 0UL) { p11_array_free (anchors); return 1; } for (i = 0, ret = 0; i < anchors->num; i++) { attrs = anchors->elem[i]; anchors->elem[i] = NULL; object = find_anchor (module, session, attrs); if (object == 0) { p11_debug ("don't yet have this anchor"); if (create_anchor (module, session, attrs)) { *changed = true; } else { ret = 1; break; } } else { p11_debug ("already have this anchor"); if (modify_anchor (module, session, object, attrs)) { *changed = true; } else { ret = 1; break; } } } p11_array_free (anchors); p11_kit_module_finalize (module); p11_kit_module_release (module); return ret; } static const char * description_for_object_at_iter (p11_kit_iter *iter) { CK_OBJECT_CLASS klass; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_INVALID }, }; const char *desc = "object"; CK_RV rv; rv = p11_kit_iter_load_attributes (iter, attrs, 1); if (rv == CKR_OK) desc = p11_constant_nick (p11_constant_classes, klass); return desc; } static bool remove_all (p11_kit_iter *iter, bool *changed) { const char *desc; CK_RV rv; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { desc = description_for_object_at_iter (iter); p11_debug ("removing %s: %lu", desc, p11_kit_iter_get_object (iter)); rv = p11_kit_iter_destroy_object (iter); switch (rv) { case CKR_OK: *changed = true; /* fall through */ case CKR_OBJECT_HANDLE_INVALID: continue; case CKR_TOKEN_WRITE_PROTECTED: case CKR_SESSION_READ_ONLY: case CKR_ATTRIBUTE_READ_ONLY: p11_message ("couldn't remove read-only %s", desc); continue; default: p11_message ("couldn't remove %s: %s", desc, p11_kit_strerror (rv)); break; } } return (rv == CKR_CANCEL); } static int anchor_remove (int argc, char *argv[], bool *changed) { CK_FUNCTION_LIST **modules; p11_array *iters; p11_kit_iter *iter; int ret = 0; int i; iters = uris_or_files_to_iters (argc, argv, P11_KIT_ITER_WANT_WRITABLE); return_val_if_fail (iters != NULL, 1); if (iters->num == 0) { p11_message ("at least one file or uri must be specified"); p11_array_free (iters); return 2; } modules = p11_kit_modules_load_and_initialize (P11_KIT_MODULE_TRUSTED); if (modules == NULL) ret = 1; for (i = 0; ret == 0 && i < iters->num; i++) { iter = iters->elem[i]; p11_kit_iter_begin (iter, modules); if (!remove_all (iter, changed)) ret = 1; } p11_array_free (iters); p11_kit_modules_finalize_and_release (modules); return ret; } int p11_trust_anchor (int argc, char **argv) { bool changed = false; int action = 0; int opt; int ret; enum { opt_verbose = 'v', opt_quiet = 'q', opt_help = 'h', opt_store = 's', opt_remove = 'r', }; struct option options[] = { { "store", no_argument, NULL, opt_store }, { "remove", no_argument, NULL, opt_remove }, { "verbose", no_argument, NULL, opt_verbose }, { "quiet", no_argument, NULL, opt_quiet }, { "help", no_argument, NULL, opt_help }, { 0 }, }; p11_tool_desc usages[] = { { 0, "usage: trust anchor --store ..." }, { opt_verbose, "show verbose debug output", }, { opt_quiet, "supress command output", }, { 0 }, }; while ((opt = p11_tool_getopt (argc, argv, options)) != -1) { switch (opt) { case opt_store: case opt_remove: if (action == 0) { action = opt; } else { p11_message ("an action was already specified"); return 2; } break; case opt_verbose: case opt_quiet: break; case opt_help: p11_tool_usage (usages, options); return 0; case '?': p11_tool_usage (usages, options); return 2; default: assert_not_reached (); break; } } while (opt != -1); argc -= optind; argv += optind; if (action == 0) action = opt_store; /* Store is different, and only accepts files */ if (action == opt_store) ret = anchor_store (argc, argv, &changed); else if (action == opt_remove) ret = anchor_remove (argc, argv, &changed); else assert_not_reached (); /* Extract the compat bundles after modification */ if (ret == 0 && changed) { char *args[] = { argv[0], NULL }; ret = p11_trust_extract_compat (1, args); } return ret; } p11-kit-0.20.2/trust/openssl.asn.h0000664000175000017500000000136312226763526013517 00000000000000#if HAVE_CONFIG_H # include "config.h" #endif #include const ASN1_ARRAY_TYPE openssl_asn1_tab[] = { { "OPENSSL", 536875024, NULL }, { NULL, 1073741836, NULL }, { "CertAux", 1610612741, NULL }, { "trust", 1610629131, NULL }, { NULL, 12, NULL }, { "reject", 1610637323, NULL }, { NULL, 1073745928, "0"}, { NULL, 12, NULL }, { "alias", 1073758210, "UTF8String"}, { "keyid", 1073758215, NULL }, { "other", 536895499, NULL }, { NULL, 1073745928, "1"}, { NULL, 2, "AlgorithmIdentifier"}, { "AlgorithmIdentifier", 1610612741, NULL }, { "algorithm", 1073741836, NULL }, { "parameters", 541081613, NULL }, { "algorithm", 1, NULL }, { "UTF8String", 536879111, NULL }, { NULL, 4360, "12"}, { NULL, 0, NULL } }; p11-kit-0.20.2/trust/digest.h0000664000175000017500000000451012226763526012530 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_DIGEST_H_ #define P11_DIGEST_H_ #include "compat.h" /* * The SHA-1 and MD5 digests here are used for checksums in legacy * protocols. We don't use them in cryptographic contexts at all. * These particular algorithms would be poor choices for that. */ #define P11_DIGEST_MD5_LEN 16 void p11_digest_md5 (unsigned char *hash, const void *input, size_t length, ...) GNUC_NULL_TERMINATED; #define P11_DIGEST_SHA1_LEN 20 void p11_digest_sha1 (unsigned char *hash, const void *input, size_t length, ...) GNUC_NULL_TERMINATED; #endif /* P11_DIGEST_H_ */ p11-kit-0.20.2/trust/module.c0000664000175000017500000012332612226763526012540 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #define CRYPTOKI_EXPORTS #include "argv.h" #include "array.h" #include "attrs.h" #define P11_DEBUG_FLAG P11_DEBUG_TRUST #include "debug.h" #include "dict.h" #include "library.h" #include "message.h" #include "module.h" #include "parser.h" #include "path.h" #include "pkcs11.h" #include "pkcs11x.h" #include "session.h" #include "token.h" #include #include #include #include #define MANUFACTURER_ID "PKCS#11 Kit " #define LIBRARY_DESCRIPTION "PKCS#11 Kit Trust Module " #define TOKEN_MODEL "p11-kit-trust " #define TOKEN_SERIAL_NUMBER "1 " /* Initial slot id: non-zero and non-one */ #define BASE_SLOT_ID 18UL static struct _Shared { int initialized; p11_dict *sessions; p11_array *tokens; char *paths; } gl = { 0, NULL, NULL, NULL }; /* Used during FindObjects */ typedef struct _FindObjects { CK_ATTRIBUTE *match; CK_OBJECT_HANDLE *snapshot; CK_ULONG iterator; } FindObjects; static CK_FUNCTION_LIST sys_function_list; static void find_objects_free (void *data) { FindObjects *find = data; p11_attrs_free (find->match); free (find->snapshot); free (find); } static CK_RV lookup_session (CK_SESSION_HANDLE handle, p11_session **session) { p11_session *sess; if (!gl.sessions) return CKR_CRYPTOKI_NOT_INITIALIZED; sess = p11_dict_get (gl.sessions, &handle); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (sess && session) *session = sess; return CKR_OK; } static CK_ATTRIBUTE * lookup_object_inlock (p11_session *session, CK_OBJECT_HANDLE handle, p11_index **index) { CK_ATTRIBUTE *attrs; assert (session != NULL); attrs = p11_index_lookup (session->index, handle); if (attrs) { if (index) *index = session->index; return attrs; } attrs = p11_index_lookup (p11_token_index (session->token), handle); if (attrs) { if (index) *index = p11_token_index (session->token); return attrs; } return NULL; } static CK_RV check_index_writable (p11_session *session, p11_index *index) { if (index == p11_token_index (session->token)) { if (!p11_token_is_writable (session->token)) return CKR_TOKEN_WRITE_PROTECTED; else if (!session->read_write) return CKR_SESSION_READ_ONLY; } return CKR_OK; } static CK_RV lookup_slot_inlock (CK_SLOT_ID id, p11_token **token) { /* * These are invalid inputs, that well behaved callers should * not produce, so have them fail precondations */ return_val_if_fail (gl.tokens != NULL, CKR_CRYPTOKI_NOT_INITIALIZED); return_val_if_fail (id >= BASE_SLOT_ID && id - BASE_SLOT_ID < gl.tokens->num, CKR_SLOT_ID_INVALID); if (token) *token = gl.tokens->elem[id - BASE_SLOT_ID]; return CKR_OK; } static bool check_slot (CK_SLOT_ID id) { bool ret; p11_lock (); ret = lookup_slot_inlock (id, NULL) == CKR_OK; p11_unlock (); return ret; } static bool create_tokens_inlock (p11_array *tokens, const char *paths) { /* * TRANSLATORS: These label strings are used in PKCS#11 URIs and * unfortunately cannot be marked translatable. If localization is * desired they should be translated in GUI applications. These * strings will not change arbitrarily. */ struct { const char *prefix; const char *label; } labels[] = { { "~/", "User Trust" }, { DATADIR, "Default Trust" }, { SYSCONFDIR, "System Trust" }, { NULL }, }; p11_token *token; p11_token *check; CK_SLOT_ID slot; const char *path; const char *label; char *alloc; char *remaining; char *base; char *pos; int i; p11_debug ("using paths: %s", paths); alloc = remaining = strdup (paths); return_val_if_fail (remaining != NULL, false); while (remaining) { path = remaining; pos = strchr (remaining, P11_PATH_SEP_C); if (pos == NULL) { remaining = NULL; } else { pos[0] = '\0'; remaining = pos + 1; } if (path[0] != '\0') { /* The slot for the new token */ slot = BASE_SLOT_ID + tokens->num; label = NULL; base = NULL; /* Claim the various labels based on prefix */ for (i = 0; label == NULL && labels[i].prefix != NULL; i++) { if (strncmp (path, labels[i].prefix, strlen (labels[i].prefix)) == 0) { label = labels[i].label; labels[i].label = NULL; } } /* Didn't find a label above, then make one based on the path */ if (!label) { label = base = p11_path_base (path); return_val_if_fail (base != NULL, false); } token = p11_token_new (slot, path, label); return_val_if_fail (token != NULL, false); if (!p11_array_push (tokens, token)) return_val_if_reached (false); free (base); assert (lookup_slot_inlock (slot, &check) == CKR_OK && check == token); } } free (alloc); return true; } static void parse_argument (char *arg, void *unused) { char *value; value = arg + strcspn (arg, ":="); if (!*value) value = NULL; else *(value++) = 0; if (strcmp (arg, "paths") == 0) { free (gl.paths); gl.paths = value ? strdup (value) : NULL; } else { p11_message ("unrecognized module argument: %s", arg); } } static CK_RV sys_C_Finalize (CK_VOID_PTR reserved) { CK_RV rv = CKR_OK; p11_debug ("in"); /* WARNING: This function must be reentrant */ if (reserved) { rv = CKR_ARGUMENTS_BAD; } else { p11_lock (); if (gl.initialized == 0) { p11_debug ("trust module is not initialized"); rv = CKR_CRYPTOKI_NOT_INITIALIZED; } else if (gl.initialized == 1) { p11_debug ("doing finalization"); free (gl.paths); gl.paths = NULL; p11_dict_free (gl.sessions); gl.sessions = NULL; p11_array_free (gl.tokens); gl.tokens = NULL; rv = CKR_OK; gl.initialized = 0; } else { gl.initialized--; p11_debug ("trust module still initialized %d times", gl.initialized); } p11_unlock (); } p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_Initialize (CK_VOID_PTR init_args) { static const CK_C_INITIALIZE_ARGS def_args = { NULL, NULL, NULL, NULL, CKF_OS_LOCKING_OK, NULL, }; const CK_C_INITIALIZE_ARGS *args = NULL; int supplied_ok; CK_RV rv; p11_library_init_once (); /* WARNING: This function must be reentrant */ p11_debug ("in"); p11_lock (); rv = CKR_OK; args = init_args; if (args == NULL) args = &def_args; /* ALL supplied function pointers need to have the value either NULL or non-NULL. */ supplied_ok = (args->CreateMutex == NULL && args->DestroyMutex == NULL && args->LockMutex == NULL && args->UnlockMutex == NULL) || (args->CreateMutex != NULL && args->DestroyMutex != NULL && args->LockMutex != NULL && args->UnlockMutex != NULL); if (!supplied_ok) { p11_message ("invalid set of mutex calls supplied"); rv = CKR_ARGUMENTS_BAD; } /* * When the CKF_OS_LOCKING_OK flag isn't set return an error. * We must be able to use our pthread functionality. */ if (!(args->flags & CKF_OS_LOCKING_OK)) { p11_message ("can't do without os locking"); rv = CKR_CANT_LOCK; } if (rv == CKR_OK && gl.initialized != 0) { p11_debug ("trust module already initialized %d times", gl.initialized); /* * We support setting the socket path and other arguments from from the * pReserved pointer, similar to how NSS PKCS#11 components are initialized. */ } else if (rv == CKR_OK) { p11_debug ("doing initialization"); if (args->pReserved) p11_argv_parse ((const char*)args->pReserved, parse_argument, NULL); gl.sessions = p11_dict_new (p11_dict_ulongptr_hash, p11_dict_ulongptr_equal, NULL, p11_session_free); gl.tokens = p11_array_new ((p11_destroyer)p11_token_free); if (gl.tokens && !create_tokens_inlock (gl.tokens, gl.paths ? gl.paths : TRUST_PATHS)) gl.tokens = NULL; if (gl.sessions == NULL || gl.tokens == NULL) { warn_if_reached (); rv = CKR_GENERAL_ERROR; } } gl.initialized++; p11_unlock (); if (rv != CKR_OK) sys_C_Finalize (NULL); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_GetInfo (CK_INFO_PTR info) { CK_RV rv = CKR_OK; p11_library_init_once (); p11_debug ("in"); return_val_if_fail (info != NULL, CKR_ARGUMENTS_BAD); p11_lock (); if (!gl.sessions) rv = CKR_CRYPTOKI_NOT_INITIALIZED; p11_unlock (); if (rv == CKR_OK) { memset (info, 0, sizeof (*info)); info->cryptokiVersion.major = CRYPTOKI_VERSION_MAJOR; info->cryptokiVersion.minor = CRYPTOKI_VERSION_MINOR; info->libraryVersion.major = PACKAGE_MAJOR; info->libraryVersion.minor = PACKAGE_MINOR; info->flags = 0; strncpy ((char*)info->manufacturerID, MANUFACTURER_ID, 32); strncpy ((char*)info->libraryDescription, LIBRARY_DESCRIPTION, 32); } p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list) { /* Can be called before C_Initialize */ return_val_if_fail (list != NULL, CKR_ARGUMENTS_BAD); *list = &sys_function_list; return CKR_OK; } static CK_RV sys_C_GetSlotList (CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count) { CK_RV rv = CKR_OK; int i; return_val_if_fail (count != NULL, CKR_ARGUMENTS_BAD); p11_debug ("in"); p11_lock (); if (!gl.sessions) rv = CKR_CRYPTOKI_NOT_INITIALIZED; p11_unlock (); if (rv != CKR_OK) { /* already failed */ } else if (!slot_list) { *count = gl.tokens->num; rv = CKR_OK; } else if (*count < gl.tokens->num) { *count = gl.tokens->num; rv = CKR_BUFFER_TOO_SMALL; } else { for (i = 0; i < gl.tokens->num; i++) slot_list[i] = BASE_SLOT_ID + i; *count = gl.tokens->num; rv = CKR_OK; } p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_GetSlotInfo (CK_SLOT_ID id, CK_SLOT_INFO_PTR info) { CK_RV rv = CKR_OK; p11_token *token; const char *path; size_t length; return_val_if_fail (info != NULL, CKR_ARGUMENTS_BAD); p11_debug ("in"); p11_lock (); rv = lookup_slot_inlock (id, &token); if (rv == CKR_OK) { memset (info, 0, sizeof (*info)); info->firmwareVersion.major = 0; info->firmwareVersion.minor = 0; info->hardwareVersion.major = PACKAGE_MAJOR; info->hardwareVersion.minor = PACKAGE_MINOR; info->flags = CKF_TOKEN_PRESENT; strncpy ((char*)info->manufacturerID, MANUFACTURER_ID, 32); /* If too long, copy the first 64 characters into buffer */ path = p11_token_get_path (token); length = strlen (path); if (length > sizeof (info->slotDescription)) length = sizeof (info->slotDescription); memset (info->slotDescription, ' ', sizeof (info->slotDescription)); memcpy (info->slotDescription, path, length); } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_GetTokenInfo (CK_SLOT_ID id, CK_TOKEN_INFO_PTR info) { CK_RV rv = CKR_OK; p11_token *token; const char *label; size_t length; return_val_if_fail (info != NULL, CKR_ARGUMENTS_BAD); p11_debug ("in"); p11_lock (); rv = lookup_slot_inlock (id, &token); if (rv == CKR_OK) { memset (info, 0, sizeof (*info)); info->firmwareVersion.major = 0; info->firmwareVersion.minor = 0; info->hardwareVersion.major = PACKAGE_MAJOR; info->hardwareVersion.minor = PACKAGE_MINOR; info->flags = CKF_TOKEN_INITIALIZED; strncpy ((char*)info->manufacturerID, MANUFACTURER_ID, 32); strncpy ((char*)info->model, TOKEN_MODEL, 16); strncpy ((char*)info->serialNumber, TOKEN_SERIAL_NUMBER, 16); info->ulMaxSessionCount = CK_EFFECTIVELY_INFINITE; info->ulSessionCount = CK_UNAVAILABLE_INFORMATION; info->ulMaxRwSessionCount = 0; info->ulRwSessionCount = CK_UNAVAILABLE_INFORMATION; info->ulMaxPinLen = 0; info->ulMinPinLen = 0; info->ulTotalPublicMemory = CK_UNAVAILABLE_INFORMATION; info->ulFreePublicMemory = CK_UNAVAILABLE_INFORMATION; info->ulTotalPrivateMemory = CK_UNAVAILABLE_INFORMATION; info->ulFreePrivateMemory = CK_UNAVAILABLE_INFORMATION; /* If too long, copy the first 32 characters into buffer */ label = p11_token_get_label (token); length = strlen (label); if (length > sizeof (info->label)) length = sizeof (info->label); memset (info->label, ' ', sizeof (info->label)); memcpy (info->label, label, length); if (!p11_token_is_writable (token)) info->flags |= CKF_WRITE_PROTECTED; } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_GetMechanismList (CK_SLOT_ID id, CK_MECHANISM_TYPE_PTR mechanism_list, CK_ULONG_PTR count) { CK_RV rv = CKR_OK; return_val_if_fail (count != NULL, CKR_ARGUMENTS_BAD); p11_debug ("in"); *count = 0; p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_GetMechanismInfo (CK_SLOT_ID id, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR info) { return_val_if_fail (info != NULL, CKR_ARGUMENTS_BAD); return_val_if_fail (check_slot (id), CKR_SLOT_ID_INVALID); return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_InitToken (CK_SLOT_ID id, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len, CK_UTF8CHAR_PTR label) { p11_debug ("not supported"); return CKR_FUNCTION_NOT_SUPPORTED; } static CK_RV sys_C_WaitForSlotEvent (CK_FLAGS flags, CK_SLOT_ID_PTR slot, CK_VOID_PTR reserved) { p11_debug ("not supported"); return CKR_FUNCTION_NOT_SUPPORTED; } static CK_RV sys_C_OpenSession (CK_SLOT_ID id, CK_FLAGS flags, CK_VOID_PTR user_data, CK_NOTIFY callback, CK_SESSION_HANDLE_PTR handle) { p11_session *session; p11_token *token; CK_RV rv = CKR_OK; return_val_if_fail (check_slot (id), CKR_SLOT_ID_INVALID); return_val_if_fail (handle != NULL, CKR_ARGUMENTS_BAD); p11_debug ("in"); p11_lock (); rv = lookup_slot_inlock (id, &token); if (rv != CKR_OK) { /* fail below */; } else if (!(flags & CKF_SERIAL_SESSION)) { rv = CKR_SESSION_PARALLEL_NOT_SUPPORTED; } else if ((flags & CKF_RW_SESSION) && !p11_token_is_writable (token)) { rv = CKR_TOKEN_WRITE_PROTECTED; } else { session = p11_session_new (token); if (p11_dict_set (gl.sessions, &session->handle, session)) { rv = CKR_OK; if (flags & CKF_RW_SESSION) session->read_write = true; *handle = session->handle; p11_debug ("session: %lu", *handle); } else { warn_if_reached (); rv = CKR_GENERAL_ERROR; } } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_CloseSession (CK_SESSION_HANDLE handle) { CK_RV rv = CKR_OK; p11_debug ("in"); p11_lock (); if (!gl.sessions) { rv = CKR_CRYPTOKI_NOT_INITIALIZED; } else if (p11_dict_remove (gl.sessions, &handle)) { rv = CKR_OK; } else { rv = CKR_SESSION_HANDLE_INVALID; } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_CloseAllSessions (CK_SLOT_ID id) { CK_SESSION_HANDLE *handle; p11_session *session; p11_token *token; p11_dictiter iter; CK_RV rv; p11_debug ("in"); p11_lock (); rv = lookup_slot_inlock (id, &token); if (rv == CKR_OK) { p11_dict_iterate (gl.sessions, &iter); while (p11_dict_next (&iter, (void **)&handle, (void **)&session)) { if (session->token == token) p11_dict_remove (gl.sessions, handle); } } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_GetFunctionStatus (CK_SESSION_HANDLE handle) { return CKR_SESSION_PARALLEL_NOT_SUPPORTED; } static CK_RV sys_C_CancelFunction (CK_SESSION_HANDLE handle) { return CKR_SESSION_PARALLEL_NOT_SUPPORTED; } static CK_RV sys_C_GetSessionInfo (CK_SESSION_HANDLE handle, CK_SESSION_INFO_PTR info) { p11_session *session; CK_RV rv; return_val_if_fail (info != NULL, CKR_ARGUMENTS_BAD); p11_debug ("in"); p11_lock (); rv = lookup_session (handle, &session); if (rv == CKR_OK) { info->flags = CKF_SERIAL_SESSION; info->state = CKS_RO_PUBLIC_SESSION; info->slotID = p11_token_get_slot (session->token); info->ulDeviceError = 0; } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_InitPIN (CK_SESSION_HANDLE handle, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { p11_debug ("not supported"); return CKR_FUNCTION_NOT_SUPPORTED; } static CK_RV sys_C_SetPIN (CK_SESSION_HANDLE handle, CK_UTF8CHAR_PTR old_pin, CK_ULONG old_pin_len, CK_UTF8CHAR_PTR new_pin, CK_ULONG new_pin_len) { p11_debug ("not supported"); return CKR_FUNCTION_NOT_SUPPORTED; } static CK_RV sys_C_GetOperationState (CK_SESSION_HANDLE handle, CK_BYTE_PTR operation_state, CK_ULONG_PTR operation_state_len) { p11_debug ("not supported"); return CKR_FUNCTION_NOT_SUPPORTED; } static CK_RV sys_C_SetOperationState (CK_SESSION_HANDLE handle, CK_BYTE_PTR operation_state, CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key, CK_OBJECT_HANDLE authentication_key) { p11_debug ("not supported"); return CKR_FUNCTION_NOT_SUPPORTED; } static CK_RV sys_C_Login (CK_SESSION_HANDLE handle, CK_USER_TYPE user_type, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { CK_RV rv; p11_debug ("in"); p11_lock (); rv = lookup_session (handle, NULL); if (rv == CKR_OK) rv = CKR_USER_TYPE_INVALID; p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_Logout (CK_SESSION_HANDLE handle) { CK_RV rv; p11_debug ("in"); p11_lock (); rv = lookup_session (handle, NULL); if (rv == CKR_OK) rv = CKR_USER_NOT_LOGGED_IN; p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_CreateObject (CK_SESSION_HANDLE handle, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { p11_session *session; p11_index *index; CK_BBOOL val; CK_RV rv; return_val_if_fail (new_object != NULL, CKR_ARGUMENTS_BAD); p11_debug ("in"); p11_lock (); rv = lookup_session (handle, &session); if (rv == CKR_OK) { if (p11_attrs_findn_bool (template, count, CKA_TOKEN, &val) && val) index = p11_token_index (session->token); else index = session->index; rv = check_index_writable (session, index); } if (rv == CKR_OK) rv = p11_index_add (index, template, count, new_object); p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_CopyObject (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { CK_BBOOL vfalse = CK_FALSE; CK_ATTRIBUTE token = { CKA_TOKEN, &vfalse, sizeof (vfalse) }; p11_session *session; CK_ATTRIBUTE *original; CK_ATTRIBUTE *attrs; p11_index *index; CK_BBOOL val; CK_RV rv; return_val_if_fail (new_object != NULL, CKR_ARGUMENTS_BAD); p11_debug ("in"); p11_lock (); rv = lookup_session (handle, &session); if (rv == CKR_OK) { original = lookup_object_inlock (session, object, &index); if (original == NULL) rv = CKR_OBJECT_HANDLE_INVALID; } if (rv == CKR_OK) { if (p11_attrs_findn_bool (template, count, CKA_TOKEN, &val)) index = val ? p11_token_index (session->token) : session->index; rv = check_index_writable (session, index); } if (rv == CKR_OK) { attrs = p11_attrs_dup (original); attrs = p11_attrs_buildn (attrs, template, count); attrs = p11_attrs_build (attrs, &token, NULL); rv = p11_index_take (index, attrs, new_object); } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_DestroyObject (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object) { p11_session *session; CK_ATTRIBUTE *attrs; p11_index *index; CK_BBOOL val; CK_RV rv; p11_debug ("in"); p11_lock (); rv = lookup_session (handle, &session); if (rv == CKR_OK) { attrs = lookup_object_inlock (session, object, &index); if (attrs == NULL) rv = CKR_OBJECT_HANDLE_INVALID; else rv = check_index_writable (session, index); if (rv == CKR_OK && p11_attrs_find_bool (attrs, CKA_MODIFIABLE, &val) && !val) { /* TODO: This should be replaced with CKR_ACTION_PROHIBITED */ rv = CKR_ATTRIBUTE_READ_ONLY; } if (rv == CKR_OK) rv = p11_index_remove (index, object); } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_GetObjectSize (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ULONG_PTR size) { p11_session *session; CK_RV rv; return_val_if_fail (size != NULL, CKR_ARGUMENTS_BAD); p11_debug ("in"); p11_lock (); rv = lookup_session (handle, &session); if (rv == CKR_OK) { if (lookup_object_inlock (session, object, NULL)) { *size = CK_UNAVAILABLE_INFORMATION; rv = CKR_OK; } else { rv = CKR_OBJECT_HANDLE_INVALID; } } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_GetAttributeValue (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *result; CK_ATTRIBUTE *attr; p11_session *session; char *string; CK_ULONG i; CK_RV rv; p11_debug ("in: %lu, %lu", handle, object); p11_lock (); rv = lookup_session (handle, &session); if (rv == CKR_OK) { attrs = lookup_object_inlock (session, object, NULL); if (attrs == NULL) rv = CKR_OBJECT_HANDLE_INVALID; } if (rv == CKR_OK) { for (i = 0; i < count; i++) { result = template + i; attr = p11_attrs_find (attrs, result->type); if (!attr) { result->ulValueLen = (CK_ULONG)-1; rv = CKR_ATTRIBUTE_TYPE_INVALID; continue; } if (!result->pValue) { result->ulValueLen = attr->ulValueLen; continue; } if (result->ulValueLen >= attr->ulValueLen) { memcpy (result->pValue, attr->pValue, attr->ulValueLen); result->ulValueLen = attr->ulValueLen; continue; } result->ulValueLen = (CK_ULONG)-1; rv = CKR_BUFFER_TOO_SMALL; } } p11_unlock (); if (p11_debugging) { string = p11_attrs_to_string (template, count); p11_debug ("out: 0x%lx %s", rv, string); free (string); } return rv; } static CK_RV sys_C_SetAttributeValue (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { p11_session *session; CK_ATTRIBUTE *attrs; p11_index *index; CK_BBOOL val; CK_RV rv; p11_debug ("in"); p11_lock (); rv = lookup_session (handle, &session); if (rv == CKR_OK) { attrs = lookup_object_inlock (session, object, &index); if (attrs == NULL) { rv = CKR_OBJECT_HANDLE_INVALID; } else if (p11_attrs_find_bool (attrs, CKA_MODIFIABLE, &val) && !val) { /* TODO: This should be replaced with CKR_ACTION_PROHIBITED */ rv = CKR_ATTRIBUTE_READ_ONLY; } if (rv == CKR_OK) rv = check_index_writable (session, index); /* Reload the item if applicable */ if (rv == CKR_OK && index == p11_token_index (session->token)) { if (p11_token_reload (session->token, attrs)) { attrs = p11_index_lookup (index, object); if (p11_attrs_find_bool (attrs, CKA_MODIFIABLE, &val) && !val) { /* TODO: This should be replaced with CKR_ACTION_PROHIBITED */ rv = CKR_ATTRIBUTE_READ_ONLY; } } } if (rv == CKR_OK) rv = p11_index_set (index, object, template, count); } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_FindObjectsInit (CK_SESSION_HANDLE handle, CK_ATTRIBUTE_PTR template, CK_ULONG count) { p11_index *indices[2] = { NULL, NULL }; CK_BBOOL want_token_objects; CK_BBOOL want_session_objects; CK_BBOOL token; FindObjects *find; p11_session *session; char *string; CK_RV rv; int n = 0; if (p11_debugging) { string = p11_attrs_to_string (template, count); p11_debug ("in: %lu, %s", handle, string); free (string); } p11_lock (); /* Are we searching for token objects? */ if (p11_attrs_findn_bool (template, count, CKA_TOKEN, &token)) { want_token_objects = token; want_session_objects = !token; } else { want_token_objects = CK_TRUE; want_session_objects = CK_TRUE; } rv = lookup_session (handle, &session); /* Refresh from disk if this session hasn't yet */ if (rv == CKR_OK) { if (want_session_objects) indices[n++] = session->index; if (want_token_objects) { if (!session->loaded) p11_token_load (session->token); session->loaded = CK_TRUE; indices[n++] = p11_token_index (session->token); } find = calloc (1, sizeof (FindObjects)); warn_if_fail (find != NULL); /* Make a snapshot of what we're matching */ if (find) { find->match = p11_attrs_buildn (NULL, template, count); warn_if_fail (find->match != NULL); /* Build a session snapshot of all objects */ find->iterator = 0; find->snapshot = p11_index_snapshot (indices[0], indices[1], template, count); warn_if_fail (find->snapshot != NULL); } if (!find || !find->snapshot || !find->match) rv = CKR_HOST_MEMORY; else p11_session_set_operation (session, find_objects_free, find); } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static bool match_for_broken_nss_serial_number_lookups (CK_ATTRIBUTE *attr, CK_ATTRIBUTE *match) { unsigned char der[32]; unsigned char *val_val; size_t der_len; size_t val_len; int len_len; if (!match->pValue || !match->ulValueLen || match->ulValueLen == CKA_INVALID || attr->ulValueLen == CKA_INVALID) return false; der_len = sizeof (der); der[0] = ASN1_TAG_INTEGER | ASN1_CLASS_UNIVERSAL; len_len = der_len - 1; asn1_length_der (match->ulValueLen, der + 1, &len_len); assert (len_len < (der_len - 1)); der_len = 1 + len_len; val_val = attr->pValue; val_len = attr->ulValueLen; if (der_len + match->ulValueLen != val_len) return false; if (memcmp (der, val_val, der_len) != 0 || memcmp (match->pValue, val_val + der_len, match->ulValueLen) != 0) return false; p11_debug ("worked around serial number lookup that's not DER encoded"); return true; } static bool find_objects_match (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *match) { CK_OBJECT_CLASS klass; CK_ATTRIBUTE *attr; for (; !p11_attrs_terminator (match); match++) { attr = p11_attrs_find ((CK_ATTRIBUTE *)attrs, match->type); if (!attr) return false; if (p11_attr_equal (attr, match)) continue; /* * WORKAROUND: NSS calls us asking for CKA_SERIAL_NUMBER items that are * not DER encoded. It shouldn't be doing this. We never return any certificate * serial numbers that are not DER encoded. * * So work around the issue here while the NSS guys fix this issue. * This code should be removed in future versions. */ if (attr->type == CKA_SERIAL_NUMBER && p11_attrs_find_ulong (attrs, CKA_CLASS, &klass) && klass == CKO_NSS_TRUST) { if (match_for_broken_nss_serial_number_lookups (attr, match)) continue; } return false; } return true; } static CK_RV sys_C_FindObjects (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE_PTR objects, CK_ULONG max_count, CK_ULONG_PTR count) { CK_OBJECT_HANDLE object; CK_ATTRIBUTE *attrs; FindObjects *find = NULL; p11_session *session; CK_ULONG matched; p11_index *index; CK_RV rv; return_val_if_fail (count != NULL, CKR_ARGUMENTS_BAD); p11_debug ("in: %lu, %lu", handle, max_count); p11_lock (); rv = lookup_session (handle, &session); if (rv == CKR_OK) { if (session->cleanup != find_objects_free) rv = CKR_OPERATION_NOT_INITIALIZED; find = session->operation; } if (rv == CKR_OK) { matched = 0; while (matched < max_count) { object = find->snapshot[find->iterator]; if (!object) break; find->iterator++; attrs = lookup_object_inlock (session, object, &index); if (attrs == NULL) continue; if (find_objects_match (attrs, find->match)) { objects[matched] = object; matched++; } } *count = matched; } p11_unlock (); p11_debug ("out: 0x%lx, %lu", handle, *count); return rv; } static CK_RV sys_C_FindObjectsFinal (CK_SESSION_HANDLE handle) { p11_session *session; CK_RV rv; p11_debug ("in"); p11_lock (); rv = lookup_session (handle, &session); if (rv == CKR_OK) { if (session->cleanup != find_objects_free) rv = CKR_OPERATION_NOT_INITIALIZED; else p11_session_set_operation (session, NULL, NULL); } p11_unlock (); p11_debug ("out: 0x%lx", rv); return rv; } static CK_RV sys_C_EncryptInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_Encrypt (CK_SESSION_HANDLE handle, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR encrypted_data, CK_ULONG_PTR encrypted_data_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_EncryptUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_EncryptFinal (CK_SESSION_HANDLE handle, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_DecryptInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_Decrypt (CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_data, CK_ULONG enc_data_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_DecryptUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_DecryptFinal (CK_SESSION_HANDLE handle, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_DigestInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_Digest (CK_SESSION_HANDLE handle, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_DigestUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_DigestKey (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE key) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_DigestFinal (CK_SESSION_HANDLE handle, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_SignInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_Sign (CK_SESSION_HANDLE handle, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_SignUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_SignFinal (CK_SESSION_HANDLE handle, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_SignRecoverInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_SignRecover (CK_SESSION_HANDLE handle, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_VerifyInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_Verify (CK_SESSION_HANDLE handle, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG signature_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_VerifyUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_VerifyFinal (CK_SESSION_HANDLE handle, CK_BYTE_PTR signature, CK_ULONG signature_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_VerifyRecoverInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_VerifyRecover (CK_SESSION_HANDLE handle, CK_BYTE_PTR signature, CK_ULONG signature_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_DigestEncryptUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_DecryptDigestUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_SignEncryptUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_DecryptVerifyUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return_val_if_reached (CKR_OPERATION_NOT_INITIALIZED); } static CK_RV sys_C_GenerateKey (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_GenerateKeyPair (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR pub_template, CK_ULONG pub_count, CK_ATTRIBUTE_PTR priv_template, CK_ULONG priv_count, CK_OBJECT_HANDLE_PTR pub_key, CK_OBJECT_HANDLE_PTR priv_key) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_WrapKey (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key, CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_UnwrapKey (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key, CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_DeriveKey (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return_val_if_reached (CKR_MECHANISM_INVALID); } static CK_RV sys_C_SeedRandom (CK_SESSION_HANDLE handle, CK_BYTE_PTR seed, CK_ULONG seed_len) { return_val_if_reached (CKR_RANDOM_NO_RNG); } static CK_RV sys_C_GenerateRandom (CK_SESSION_HANDLE handle, CK_BYTE_PTR random_data, CK_ULONG random_len) { return_val_if_reached (CKR_RANDOM_NO_RNG); } /* -------------------------------------------------------------------- * MODULE ENTRY POINT */ static CK_FUNCTION_LIST sys_function_list = { { CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, /* version */ sys_C_Initialize, sys_C_Finalize, sys_C_GetInfo, sys_C_GetFunctionList, sys_C_GetSlotList, sys_C_GetSlotInfo, sys_C_GetTokenInfo, sys_C_GetMechanismList, sys_C_GetMechanismInfo, sys_C_InitToken, sys_C_InitPIN, sys_C_SetPIN, sys_C_OpenSession, sys_C_CloseSession, sys_C_CloseAllSessions, sys_C_GetSessionInfo, sys_C_GetOperationState, sys_C_SetOperationState, sys_C_Login, sys_C_Logout, sys_C_CreateObject, sys_C_CopyObject, sys_C_DestroyObject, sys_C_GetObjectSize, sys_C_GetAttributeValue, sys_C_SetAttributeValue, sys_C_FindObjectsInit, sys_C_FindObjects, sys_C_FindObjectsFinal, sys_C_EncryptInit, sys_C_Encrypt, sys_C_EncryptUpdate, sys_C_EncryptFinal, sys_C_DecryptInit, sys_C_Decrypt, sys_C_DecryptUpdate, sys_C_DecryptFinal, sys_C_DigestInit, sys_C_Digest, sys_C_DigestUpdate, sys_C_DigestKey, sys_C_DigestFinal, sys_C_SignInit, sys_C_Sign, sys_C_SignUpdate, sys_C_SignFinal, sys_C_SignRecoverInit, sys_C_SignRecover, sys_C_VerifyInit, sys_C_Verify, sys_C_VerifyUpdate, sys_C_VerifyFinal, sys_C_VerifyRecoverInit, sys_C_VerifyRecover, sys_C_DigestEncryptUpdate, sys_C_DecryptDigestUpdate, sys_C_SignEncryptUpdate, sys_C_DecryptVerifyUpdate, sys_C_GenerateKey, sys_C_GenerateKeyPair, sys_C_WrapKey, sys_C_UnwrapKey, sys_C_DeriveKey, sys_C_SeedRandom, sys_C_GenerateRandom, sys_C_GetFunctionStatus, sys_C_CancelFunction, sys_C_WaitForSlotEvent }; #ifdef OS_WIN32 __declspec(dllexport) #endif CK_RV C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list) { p11_library_init_once (); return sys_C_GetFunctionList (list); } CK_ULONG p11_module_next_id (void) { static CK_ULONG unique = 0x10; return (unique)++; } #ifdef OS_UNIX void p11_trust_module_init (void); void p11_trust_module_fini (void); #ifdef __GNUC__ __attribute__((constructor)) #endif void p11_trust_module_init (void) { p11_library_init_once (); } #ifdef __GNUC__ __attribute__((destructor)) #endif void p11_trust_module_fini (void) { p11_library_uninit (); } #endif /* OS_UNIX */ #ifdef OS_WIN32 BOOL WINAPI DllMain (HINSTANCE, DWORD, LPVOID); BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID reserved) { switch (reason) { case DLL_PROCESS_ATTACH: p11_library_init (); break; case DLL_THREAD_DETACH: p11_library_thread_cleanup (); break; case DLL_PROCESS_DETACH: p11_library_uninit (); break; default: break; } return TRUE; } #endif /* OS_WIN32 */ p11-kit-0.20.2/trust/openssl.asn0000664000175000017500000000141512226763526013267 00000000000000 OPENSSL { } DEFINITIONS IMPLICIT TAGS ::= BEGIN -- This module contains structures specific to OpenSSL CertAux ::= SEQUENCE { trust SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, reject [0] SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, alias UTF8String OPTIONAL, keyid OCTET STRING OPTIONAL, other [1] SEQUENCE OF AlgorithmIdentifier OPTIONAL } -- Dependencies brought in from other modules AlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters ANY DEFINED BY algorithm OPTIONAL } UTF8String ::= [UNIVERSAL 12] IMPLICIT OCTET STRING -- The content of this type conforms to RFC 2279. END p11-kit-0.20.2/trust/save.c0000664000175000017500000003260712226763526012212 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "buffer.h" #include "debug.h" #include "dict.h" #include "message.h" #include "save.h" #include #include #include #include #include #include #include #include struct _p11_save_file { char *bare; char *extension; char *temp; int fd; int flags; }; struct _p11_save_dir { p11_dict *cache; char *path; int flags; }; static char * make_unique_name (const char *bare, const char *extension, int (*check) (void *, char *), void *data); bool p11_save_write_and_finish (p11_save_file *file, const void *data, ssize_t length) { bool ret; if (!file) return false; ret = p11_save_write (file, data, length); if (!p11_save_finish_file (file, NULL, ret)) ret = false; return ret; } p11_save_file * p11_save_open_file (const char *path, const char *extension, int flags) { p11_save_file *file; char *temp; int fd; return_val_if_fail (path != NULL, NULL); if (extension == NULL) extension = ""; if (asprintf (&temp, "%s%s.XXXXXX", path, extension) < 0) return_val_if_reached (NULL); fd = mkstemp (temp); if (fd < 0) { p11_message_err (errno, "couldn't create file: %s%s", path, extension); free (temp); return NULL; } file = calloc (1, sizeof (p11_save_file)); return_val_if_fail (file != NULL, NULL); file->temp = temp; file->bare = strdup (path); return_val_if_fail (file->bare != NULL, NULL); file->extension = strdup (extension); return_val_if_fail (file->extension != NULL, NULL); file->flags = flags; file->fd = fd; return file; } bool p11_save_write (p11_save_file *file, const void *data, ssize_t length) { const unsigned char *buf = data; ssize_t written = 0; ssize_t res; if (!file) return false; /* Automatically calculate length */ if (length < 0) { if (!data) return true; length = strlen (data); } while (written < length) { res = write (file->fd, buf + written, length - written); if (res <= 0) { if (errno == EAGAIN && errno == EINTR) continue; p11_message_err (errno, "couldn't write to file: %s", file->temp); return false; } else { written += res; } } return true; } static void filo_free (p11_save_file *file) { free (file->temp); free (file->bare); free (file->extension); free (file); } #ifdef OS_UNIX static int on_unique_try_link (void *data, char *path) { p11_save_file *file = data; if (link (file->temp, path) < 0) { if (errno == EEXIST) return 0; /* Continue trying other names */ p11_message_err (errno, "couldn't complete writing of file: %s", path); return -1; } return 1; /* All done */ } #else /* OS_WIN32 */ static int on_unique_try_rename (void *data, char *path) { p11_save_file *file = data; if (rename (file->temp, path) < 0) { if (errno == EEXIST) return 0; /* Continue trying other names */ p11_message ("couldn't complete writing of file: %s", path); return -1; } return 1; /* All done */ } #endif /* OS_WIN32 */ bool p11_save_finish_file (p11_save_file *file, char **path_out, bool commit) { bool ret = true; char *path; if (!file) return false; if (!commit) { close (file->fd); unlink (file->temp); filo_free (file); return true; } if (asprintf (&path, "%s%s", file->bare, file->extension) < 0) return_val_if_reached (false); if (close (file->fd) < 0) { p11_message_err (errno, "couldn't write file: %s", file->temp); ret = false; #ifdef OS_UNIX /* Set the mode of the file, readable by everyone, but not writable */ } else if (chmod (file->temp, S_IRUSR | S_IRGRP | S_IROTH) < 0) { p11_message_err (errno, "couldn't set file permissions: %s", file->temp); close (file->fd); ret = false; /* Atomically rename the tempfile over the filename */ } else if (file->flags & P11_SAVE_OVERWRITE) { if (rename (file->temp, path) < 0) { p11_message_err (errno, "couldn't complete writing file: %s", path); ret = false; } else { unlink (file->temp); } /* Create a unique name if requested unique file name */ } else if (file->flags & P11_SAVE_UNIQUE) { free (path); path = make_unique_name (file->bare, file->extension, on_unique_try_link, file); if (!path) ret = false; unlink (file->temp); /* When not overwriting, link will fail if filename exists. */ } else { if (link (file->temp, path) < 0) { p11_message_err (errno, "couldn't complete writing of file: %s", path); ret = false; } unlink (file->temp); #else /* OS_WIN32 */ /* Windows does not do atomic renames, so delete original file first */ } else { /* Create a unique name if requested unique file name */ if (file->flags & P11_SAVE_UNIQUE) { free (path); path = make_unique_name (file->bare, file->extension, on_unique_try_rename, file); if (!path) ret = false; } else if ((file->flags & P11_SAVE_OVERWRITE) && unlink (path) < 0 && errno != ENOENT) { p11_message_err (errno, "couldn't remove original file: %s", path); ret = false; } if (ret == true && rename (file->temp, path) < 0) { p11_message_err (errno, "couldn't complete writing file: %s", path); ret = false; } unlink (file->temp); #endif /* OS_WIN32 */ } if (ret && path_out) { *path_out = path; path = NULL; } free (path); filo_free (file); return ret; } p11_save_dir * p11_save_open_directory (const char *path, int flags) { #ifdef OS_UNIX struct stat sb; #endif p11_save_dir *dir; return_val_if_fail (path != NULL, NULL); #ifdef OS_UNIX /* We update the permissions when we finish writing */ if (mkdir (path, S_IRWXU) < 0) { #else /* OS_WIN32 */ if (mkdir (path) < 0) { #endif /* Some random error, report it */ if (errno != EEXIST) { p11_message_err (errno, "couldn't create directory: %s", path); /* The directory exists and we're not overwriting */ } else if (!(flags & P11_SAVE_OVERWRITE)) { p11_message ("directory already exists: %s", path); return NULL; } #ifdef OS_UNIX /* * If the directory exists on unix, we may have restricted * the directory permissions to read-only. We have to change * them back to writable in order for things to work. */ if (stat (path, &sb) >= 0) { if ((sb.st_mode & S_IRWXU) != S_IRWXU && chmod (path, S_IRWXU | sb.st_mode) < 0) { p11_message_err (errno, "couldn't make directory writable: %s", path); return NULL; } } #endif /* OS_UNIX */ } dir = calloc (1, sizeof (p11_save_dir)); return_val_if_fail (dir != NULL, NULL); dir->path = strdup (path); return_val_if_fail (dir->path != NULL, NULL); dir->cache = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, NULL); return_val_if_fail (dir->cache != NULL, NULL); dir->flags = flags; return dir; } static char * make_unique_name (const char *bare, const char *extension, int (*check) (void *, char *), void *data) { char unique[16]; p11_buffer buf; int ret; int i; assert (bare != NULL); assert (check != NULL); p11_buffer_init_null (&buf, 0); for (i = 0; true; i++) { p11_buffer_reset (&buf, 64); switch (i) { /* * For the first iteration, just build the filename as * provided by the caller. */ case 0: p11_buffer_add (&buf, bare, -1); break; /* * On later iterations we try to add a numeric .N suffix * before the extension, so the resulting file might look * like filename.1.ext. * * As a special case if the extension is already '.0' then * just just keep incerementing that. */ case 1: if (extension && strcmp (extension, ".0") == 0) extension = NULL; /* fall through */ default: p11_buffer_add (&buf, bare, -1); snprintf (unique, sizeof (unique), ".%d", i); p11_buffer_add (&buf, unique, -1); break; } if (extension) p11_buffer_add (&buf, extension, -1); return_val_if_fail (p11_buffer_ok (&buf), NULL); ret = check (data, buf.data); if (ret < 0) return NULL; else if (ret > 0) return p11_buffer_steal (&buf, NULL); } assert_not_reached (); } static int on_unique_check_dir (void *data, char *name) { p11_save_dir *dir = data; if (!p11_dict_get (dir->cache, name)) return 1; return 0; /* Keep looking */ } p11_save_file * p11_save_open_file_in (p11_save_dir *dir, const char *basename, const char *extension) { p11_save_file *file = NULL; char *name; char *path; return_val_if_fail (dir != NULL, NULL); return_val_if_fail (basename != NULL, NULL); name = make_unique_name (basename, extension, on_unique_check_dir, dir); return_val_if_fail (name != NULL, NULL); if (asprintf (&path, "%s/%s", dir->path, name) < 0) return_val_if_reached (NULL); file = p11_save_open_file (path, NULL, dir->flags); if (file) { if (!p11_dict_set (dir->cache, name, name)) return_val_if_reached (NULL); name = NULL; } free (name); free (path); return file; } #ifdef OS_UNIX bool p11_save_symlink_in (p11_save_dir *dir, const char *linkname, const char *extension, const char *destination) { char *name; char *path; bool ret; return_val_if_fail (dir != NULL, false); return_val_if_fail (linkname != NULL, false); return_val_if_fail (destination != NULL, false); name = make_unique_name (linkname, extension, on_unique_check_dir, dir); return_val_if_fail (name != NULL, false); if (asprintf (&path, "%s/%s", dir->path, name) < 0) return_val_if_reached (false); unlink (path); if (symlink (destination, path) < 0) { p11_message_err (errno, "couldn't create symlink: %s", path); ret = false; } else { if (!p11_dict_set (dir->cache, name, name)) return_val_if_reached (false); name = NULL; ret = true; } free (path); free (name); return ret; } #endif /* OS_UNIX */ static bool cleanup_directory (const char *directory, p11_dict *cache) { struct dirent *dp; struct stat st; p11_dict *remove; p11_dictiter iter; char *path; DIR *dir; bool ret; /* First we load all the modules */ dir = opendir (directory); if (!dir) { p11_message_err (errno, "couldn't list directory: %s", directory); return false; } remove = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, NULL); while ((dp = readdir (dir)) != NULL) { if (p11_dict_get (cache, dp->d_name)) continue; if (asprintf (&path, "%s/%s", directory, dp->d_name) < 0) return_val_if_reached (false); if (stat (path, &st) >= 0 && !S_ISDIR (st.st_mode)) { if (!p11_dict_set (remove, path, path)) return_val_if_reached (false); } else { free (path); } } closedir (dir); ret = true; /* Remove all the files still in the cache */ p11_dict_iterate (remove, &iter); while (p11_dict_next (&iter, (void **)&path, NULL)) { if (unlink (path) < 0 && errno != ENOENT) { p11_message_err (errno, "couldn't remove file: %s", path); ret = false; break; } } p11_dict_free (remove); return ret; } bool p11_save_finish_directory (p11_save_dir *dir, bool commit) { bool ret = true; if (!dir) return false; if (commit) { if (dir->flags & P11_SAVE_OVERWRITE) ret = cleanup_directory (dir->path, dir->cache); #ifdef OS_UNIX /* Try to set the mode of the directory to readable */ if (ret && chmod (dir->path, S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) < 0) { p11_message_err (errno, "couldn't set directory permissions: %s", dir->path); ret = false; } #endif /* OS_UNIX */ } p11_dict_free (dir->cache); free (dir->path); free (dir); return ret; } p11-kit-0.20.2/trust/builder.c0000664000175000017500000014570212226767024012700 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #define P11_DEBUG_FLAG P11_DEBUG_TRUST #include "array.h" #include "asn1.h" #include "attrs.h" #include "builder.h" #include "constants.h" #include "debug.h" #include "digest.h" #include "index.h" #include "message.h" #include "oid.h" #include "pkcs11x.h" #include "utf8.h" #include "x509.h" #include #include #include struct _p11_builder { p11_asn1_cache *asn1_cache; p11_dict *asn1_defs; int flags; }; enum { NONE = 0, CREATE = 1 << 0, MODIFY = 1 << 1, REQUIRE = 1 << 2, WANT = 1 << 3, }; enum { NORMAL_BUILD = 0, GENERATED_CLASS = 1 << 0, }; typedef struct { int build_flags; struct { CK_ATTRIBUTE_TYPE type; int flags; bool (*validate) (p11_builder *, CK_ATTRIBUTE *); } attrs[32]; CK_ATTRIBUTE * (*populate) (p11_builder *, p11_index *, CK_ATTRIBUTE *); CK_RV (*validate) (p11_builder *, CK_ATTRIBUTE *, CK_ATTRIBUTE *); } builder_schema; static node_asn * decode_or_get_asn1 (p11_builder *builder, const char *struct_name, const unsigned char *der, size_t length) { node_asn *node; node = p11_asn1_cache_get (builder->asn1_cache, struct_name, der, length); if (node != NULL) return node; node = p11_asn1_decode (builder->asn1_defs, struct_name, der, length, NULL); if (node != NULL) p11_asn1_cache_take (builder->asn1_cache, node, struct_name, der, length); return node; } static unsigned char * lookup_extension (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *cert, CK_ATTRIBUTE *public_key, const unsigned char *oid, size_t *ext_len) { CK_OBJECT_CLASS klass = CKO_X_CERTIFICATE_EXTENSION; CK_OBJECT_HANDLE obj; CK_ATTRIBUTE *attrs; void *value; size_t length; node_asn *node; CK_ATTRIBUTE match[] = { { CKA_X_PUBLIC_KEY_INFO, }, { CKA_OBJECT_ID, (void *)oid, p11_oid_length (oid) }, { CKA_CLASS, &klass, sizeof (klass) }, { CKA_INVALID }, }; if (public_key == NULL) public_key = p11_attrs_find_valid (cert, CKA_X_PUBLIC_KEY_INFO); /* Look for a stapled certificate extension */ if (public_key != NULL) { memcpy (match, public_key, sizeof (CK_ATTRIBUTE)); obj = p11_index_find (index, match, -1); attrs = p11_index_lookup (index, obj); if (attrs != NULL) { value = p11_attrs_find_value (attrs, CKA_VALUE, &length); if (value != NULL) { node = decode_or_get_asn1 (builder, "PKIX1.Extension", value, length); return_val_if_fail (node != NULL, NULL); return p11_asn1_read (node, "extnValue", ext_len); } } } /* Couldn't find a parsed extension, so look in the current certificate */ value = p11_attrs_find_value (cert, CKA_VALUE, &length); if (value != NULL) { node = decode_or_get_asn1 (builder, "PKIX1.Certificate", value, length); return_val_if_fail (node != NULL, NULL); return p11_x509_find_extension (node, oid, value, length, ext_len); } return NULL; } static CK_OBJECT_HANDLE * lookup_related (p11_index *index, CK_OBJECT_CLASS klass, CK_ATTRIBUTE *attr) { CK_ATTRIBUTE match[] = { { attr->type, attr->pValue, attr->ulValueLen }, { CKA_CLASS, &klass, sizeof (klass) }, { CKA_INVALID } }; return p11_index_find_all (index, match, -1); } p11_builder * p11_builder_new (int flags) { p11_builder *builder; builder = calloc (1, sizeof (p11_builder)); return_val_if_fail (builder != NULL, NULL); builder->asn1_cache = p11_asn1_cache_new (); return_val_if_fail (builder->asn1_cache, NULL); builder->asn1_defs = p11_asn1_cache_defs (builder->asn1_cache); builder->flags = flags; return builder; } static int atoin (const char *p, int digits) { int ret = 0, base = 1; while(--digits >= 0) { if (p[digits] < '0' || p[digits] > '9') return -1; ret += (p[digits] - '0') * base; base *= 10; } return ret; } static bool type_bool (p11_builder *builder, CK_ATTRIBUTE *attr) { return (attr->pValue != NULL && sizeof (CK_BBOOL) == attr->ulValueLen); } static bool type_ulong (p11_builder *builder, CK_ATTRIBUTE *attr) { return (attr->pValue != NULL && sizeof (CK_ULONG) == attr->ulValueLen); } static bool type_utf8 (p11_builder *builder, CK_ATTRIBUTE *attr) { if (attr->ulValueLen == 0) return true; if (attr->pValue == NULL) return false; return p11_utf8_validate (attr->pValue, attr->ulValueLen); } static bool type_date (p11_builder *builder, CK_ATTRIBUTE *attr) { CK_DATE *date; struct tm tm; struct tm two; if (attr->ulValueLen == 0) return true; if (attr->pValue == NULL || attr->ulValueLen != sizeof (CK_DATE)) return false; date = attr->pValue; memset (&tm, 0, sizeof (tm)); tm.tm_year = atoin ((char *)date->year, 4) - 1900; tm.tm_mon = atoin ((char *)date->month, 2); tm.tm_mday = atoin ((char *)date->day, 2); if (tm.tm_year < 0 || tm.tm_mon <= 0 || tm.tm_mday <= 0) return false; memcpy (&two, &tm, sizeof (tm)); if (mktime (&two) < 0) return false; /* If mktime changed anything, then bad date */ if (tm.tm_year != two.tm_year || tm.tm_mon != two.tm_mon || tm.tm_mday != two.tm_mday) return false; return true; } static bool check_der_struct (p11_builder *builder, const char *struct_name, CK_ATTRIBUTE *attr) { node_asn *asn; if (attr->ulValueLen == 0) return true; if (attr->pValue == NULL) return false; asn = p11_asn1_decode (builder->asn1_defs, struct_name, attr->pValue, attr->ulValueLen, NULL); if (asn == NULL) return false; asn1_delete_structure (&asn); return true; } static bool type_der_name (p11_builder *builder, CK_ATTRIBUTE *attr) { return check_der_struct (builder, "PKIX1.Name", attr); } static bool type_der_serial (p11_builder *builder, CK_ATTRIBUTE *attr) { return check_der_struct (builder, "PKIX1.CertificateSerialNumber", attr); } static bool type_der_oid (p11_builder *builder, CK_ATTRIBUTE *attr) { /* AttributeType is an OBJECT ID */ return check_der_struct (builder, "PKIX1.AttributeType", attr); } static bool type_der_cert (p11_builder *builder, CK_ATTRIBUTE *attr) { return check_der_struct (builder, "PKIX1.Certificate", attr); } static bool type_der_key (p11_builder *builder, CK_ATTRIBUTE *attr) { return check_der_struct (builder, "PKIX1.SubjectPublicKeyInfo", attr); } static bool type_der_ext (p11_builder *builder, CK_ATTRIBUTE *attr) { return check_der_struct (builder, "PKIX1.Extension", attr); } #define COMMON_ATTRS \ { CKA_CLASS, REQUIRE | CREATE, type_ulong }, \ { CKA_TOKEN, CREATE | WANT, type_bool }, \ { CKA_MODIFIABLE, CREATE | WANT, type_bool }, \ { CKA_PRIVATE, CREATE, type_bool }, \ { CKA_LABEL, CREATE | MODIFY | WANT, type_utf8 }, \ { CKA_X_GENERATED, CREATE }, \ { CKA_X_ORIGIN, NONE } \ static CK_ATTRIBUTE * common_populate (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *unused) { CK_BBOOL tokenv = CK_FALSE; CK_BBOOL modifiablev = CK_TRUE; CK_BBOOL privatev = CK_FALSE; CK_BBOOL generatedv = CK_FALSE; CK_ATTRIBUTE token = { CKA_TOKEN, &tokenv, sizeof (tokenv), }; CK_ATTRIBUTE privat = { CKA_PRIVATE, &privatev, sizeof (privatev) }; CK_ATTRIBUTE modifiable = { CKA_MODIFIABLE, &modifiablev, sizeof (modifiablev) }; CK_ATTRIBUTE generated = { CKA_X_GENERATED, &generatedv, sizeof (generatedv) }; CK_ATTRIBUTE label = { CKA_LABEL, "", 0 }; if (builder->flags & P11_BUILDER_FLAG_TOKEN) { tokenv = CK_TRUE; modifiablev = CK_FALSE; } return p11_attrs_build (NULL, &token, &privat, &modifiable, &label, &generated, NULL); } static void calc_check_value (const unsigned char *data, size_t length, CK_BYTE *check_value) { unsigned char checksum[P11_DIGEST_SHA1_LEN]; p11_digest_sha1 (checksum, data, length, NULL); memcpy (check_value, checksum, 3); } static int century_for_two_digit_year (int year) { time_t now; struct tm tm; int century, current; return_val_if_fail (year >= 0 && year <= 99, -1); /* Get the current year */ now = time (NULL); return_val_if_fail (now >= 0, -1); if (!gmtime_r (&now, &tm)) return_val_if_reached (-1); current = (tm.tm_year % 100); century = (tm.tm_year + 1900) - current; /* * Check if it's within 40 years before the * current date. */ if (current < 40) { if (year < current) return century; if (year > 100 - (40 - current)) return century - 100; } else { if (year < current && year > (current - 40)) return century; } /* * If it's after then adjust for overflows to * the next century. */ if (year < current) return century + 100; else return century; } static bool calc_date (node_asn *node, const char *field, CK_DATE *date) { node_asn *choice; char buf[64]; int century; char *sub; int year; int len; int ret; if (!node) return false; choice = asn1_find_node (node, field); return_val_if_fail (choice != NULL, false); len = sizeof (buf) - 1; ret = asn1_read_value (node, field, buf, &len); return_val_if_fail (ret == ASN1_SUCCESS, false); sub = strconcat (field, ".", buf, NULL); /* * So here we take a shortcut and just copy the date from the * certificate into the CK_DATE. This doesn't take into account * time zones. However the PKCS#11 spec does not say what timezone * the dates are in. In the PKCS#11 value have a day resolution, * and time zones aren't that critical. */ if (strcmp (buf, "generalTime") == 0) { len = sizeof (buf) - 1; ret = asn1_read_value (node, sub, buf, &len); return_val_if_fail (ret == ASN1_SUCCESS, false); return_val_if_fail (len >= 8, false); /* Same as first 8 characters of date */ memcpy (date, buf, 8); } else if (strcmp (buf, "utcTime") == 0) { len = sizeof (buf) - 1; ret = asn1_read_value (node, sub, buf, &len); return_val_if_fail (ret == ASN1_SUCCESS, false); return_val_if_fail (len >= 6, false); year = atoin (buf, 2); return_val_if_fail (year >= 0, false); century = century_for_two_digit_year (year); return_val_if_fail (century >= 0, false); snprintf ((char *)date->year, 3, "%02d", century); memcpy (((char *)date) + 2, buf, 6); } else { return_val_if_reached (false); } free (sub); return true; } static bool calc_element (node_asn *node, const unsigned char *data, size_t length, const char *field, CK_ATTRIBUTE *attr) { int ret; int start, end; if (!node) return false; ret = asn1_der_decoding_startEnd (node, data, length, field, &start, &end); return_val_if_fail (ret == ASN1_SUCCESS, false); return_val_if_fail (end >= start, false); attr->pValue = (void *)(data + start); attr->ulValueLen = (end - start) + 1; return true; } static bool is_v1_x509_authority (p11_builder *builder, CK_ATTRIBUTE *cert) { CK_ATTRIBUTE subject; CK_ATTRIBUTE issuer; CK_ATTRIBUTE *value; char buffer[16]; node_asn *node; int len; int ret; value = p11_attrs_find_valid (cert, CKA_VALUE); if (value == NULL) return false; node = decode_or_get_asn1 (builder, "PKIX1.Certificate", value->pValue, value->ulValueLen); return_val_if_fail (node != NULL, false); len = sizeof (buffer); ret = asn1_read_value (node, "tbsCertificate.version", buffer, &len); /* The default value */ if (ret == ASN1_ELEMENT_NOT_FOUND) { ret = ASN1_SUCCESS; buffer[0] = 0; len = 1; } return_val_if_fail (ret == ASN1_SUCCESS, false); /* * In X.509 version v1 is the integer zero. Two's complement * integer, but zero is easy to read. */ if (len != 1 || buffer[0] != 0) return false; /* Must be self-signed, ie: same subject and issuer */ if (!calc_element (node, value->pValue, value->ulValueLen, "tbsCertificate.subject", &subject)) return_val_if_reached (false); if (!calc_element (node, value->pValue, value->ulValueLen, "tbsCertificate.issuer", &issuer)) return_val_if_reached (false); return p11_attr_match_value (&subject, issuer.pValue, issuer.ulValueLen); } static bool calc_certificate_category (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *cert, CK_ATTRIBUTE *public_key, CK_ULONG *category) { unsigned char *ext; size_t ext_len; bool is_ca = 0; bool ret; /* * In the PKCS#11 spec: * 0 = unspecified (default value) * 1 = token user * 2 = authority * 3 = other entity */ /* See if we have a basic constraints extension */ ext = lookup_extension (builder, index, cert, public_key, P11_OID_BASIC_CONSTRAINTS, &ext_len); if (ext != NULL) { ret = p11_x509_parse_basic_constraints (builder->asn1_defs, ext, ext_len, &is_ca); free (ext); if (!ret) { p11_message ("invalid basic constraints certificate extension"); return false; } } else if (is_v1_x509_authority (builder, cert)) { /* * If there is no basic constraints extension, and the CA version is * v1, and is self-signed, then we assume this is a certificate authority. * So we add a BasicConstraints stapled certificate extension */ is_ca = 1; } else if (!p11_attrs_find_valid (cert, CKA_VALUE)) { /* * If we have no certificate value, then this is unknown */ *category = 0; return true; } *category = is_ca ? 2 : 3; return true; } static CK_ATTRIBUTE * certificate_value_attrs (CK_ATTRIBUTE *attrs, node_asn *node, const unsigned char *der, size_t der_len, CK_ATTRIBUTE *public_key) { unsigned char checksum[P11_DIGEST_SHA1_LEN]; CK_BBOOL falsev = CK_FALSE; CK_ULONG zero = 0UL; CK_BYTE checkv[3]; CK_DATE startv; CK_DATE endv; char *labelv = NULL; CK_ATTRIBUTE trusted = { CKA_TRUSTED, &falsev, sizeof (falsev) }; CK_ATTRIBUTE distrusted = { CKA_X_DISTRUSTED, &falsev, sizeof (falsev) }; CK_ATTRIBUTE url = { CKA_URL, "", 0 }; CK_ATTRIBUTE hash_of_subject_public_key = { CKA_HASH_OF_SUBJECT_PUBLIC_KEY, checksum, sizeof (checksum) }; CK_ATTRIBUTE hash_of_issuer_public_key = { CKA_HASH_OF_ISSUER_PUBLIC_KEY, "", 0 }; CK_ATTRIBUTE java_midp_security_domain = { CKA_JAVA_MIDP_SECURITY_DOMAIN, &zero, sizeof (zero) }; CK_ATTRIBUTE check_value = { CKA_CHECK_VALUE, &checkv, sizeof (checkv) }; CK_ATTRIBUTE start_date = { CKA_START_DATE, &startv, sizeof (startv) }; CK_ATTRIBUTE end_date = { CKA_END_DATE, &endv, sizeof (endv) }; CK_ATTRIBUTE subject = { CKA_SUBJECT, }; CK_ATTRIBUTE issuer = { CKA_ISSUER, "", 0 }; CK_ATTRIBUTE serial_number = { CKA_SERIAL_NUMBER, "", 0 }; CK_ATTRIBUTE label = { CKA_LABEL }; CK_ATTRIBUTE id = { CKA_ID, checksum, sizeof (checksum) }; return_val_if_fail (attrs != NULL, NULL); if (der == NULL) check_value.type = CKA_INVALID; else calc_check_value (der, der_len, checkv); if (!calc_date (node, "tbsCertificate.validity.notBefore", &startv)) start_date.ulValueLen = 0; if (!calc_date (node, "tbsCertificate.validity.notAfter", &endv)) end_date.ulValueLen = 0; if (calc_element (node, der, der_len, "tbsCertificate.subjectPublicKeyInfo", public_key)) public_key->type = CKA_X_PUBLIC_KEY_INFO; else public_key->type = CKA_INVALID; calc_element (node, der, der_len, "tbsCertificate.issuer.rdnSequence", &issuer); if (!calc_element (node, der, der_len, "tbsCertificate.subject.rdnSequence", &subject)) subject.type = CKA_INVALID; calc_element (node, der, der_len, "tbsCertificate.serialNumber", &serial_number); if (!node || !p11_x509_calc_keyid (node, der, der_len, checksum)) { hash_of_subject_public_key.ulValueLen = 0; id.type = CKA_INVALID; } if (node) { labelv = p11_x509_lookup_dn_name (node, "tbsCertificate.subject", der, der_len, P11_OID_CN); if (!labelv) labelv = p11_x509_lookup_dn_name (node, "tbsCertificate.subject", der, der_len, P11_OID_OU); if (!labelv) labelv = p11_x509_lookup_dn_name (node, "tbsCertificate.subject", der, der_len, P11_OID_O); } if (labelv) { label.pValue = labelv; label.ulValueLen = strlen (labelv); } else { label.type = CKA_INVALID; } attrs = p11_attrs_build (attrs, &trusted, &distrusted, &url, &hash_of_issuer_public_key, &hash_of_subject_public_key, &java_midp_security_domain, &check_value, &start_date, &end_date, &id, &subject, &issuer, &serial_number, &label, public_key, NULL); return_val_if_fail (attrs != NULL, NULL); free (labelv); return attrs; } static CK_ATTRIBUTE * certificate_populate (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *cert) { CK_ULONG categoryv = 0UL; CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE public_key; node_asn *node = NULL; unsigned char *der = NULL; size_t der_len = 0; CK_ATTRIBUTE category = { CKA_CERTIFICATE_CATEGORY, &categoryv, sizeof (categoryv) }; CK_ATTRIBUTE empty_value = { CKA_VALUE, "", 0 }; attrs = common_populate (builder, index, cert); return_val_if_fail (attrs != NULL, NULL); der = p11_attrs_find_value (cert, CKA_VALUE, &der_len); if (der != NULL) node = decode_or_get_asn1 (builder, "PKIX1.Certificate", der, der_len); attrs = certificate_value_attrs (attrs, node, der, der_len, &public_key); return_val_if_fail (attrs != NULL, NULL); if (!calc_certificate_category (builder, index, cert, &public_key, &categoryv)) categoryv = 0; return p11_attrs_build (attrs, &category, &empty_value, NULL); } static bool have_attribute (CK_ATTRIBUTE *attrs1, CK_ATTRIBUTE *attrs2, CK_ATTRIBUTE_TYPE type) { CK_ATTRIBUTE *attr; attr = p11_attrs_find (attrs1, type); if (attr == NULL) attr = p11_attrs_find (attrs2, type); return attr != NULL && attr->ulValueLen > 0; } static CK_RV certificate_validate (p11_builder *builder, CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge) { /* * In theory we should be validating that in the absence of CKA_VALUE * various other fields must be set. However we do not enforce this * because we want to be able to have certificates without a value * but issuer and serial number, for blacklisting purposes. */ if (have_attribute (attrs, merge, CKA_URL)) { if (!have_attribute (attrs, merge, CKA_HASH_OF_SUBJECT_PUBLIC_KEY)) { p11_message ("missing the CKA_HASH_OF_SUBJECT_PUBLIC_KEY attribute"); return CKR_TEMPLATE_INCONSISTENT; } if (!have_attribute (attrs, merge, CKA_HASH_OF_SUBJECT_PUBLIC_KEY)) { p11_message ("missing the CKA_HASH_OF_ISSUER_PUBLIC_KEY attribute"); return CKR_TEMPLATE_INCONSISTENT; } } return CKR_OK; } const static builder_schema certificate_schema = { NORMAL_BUILD, { COMMON_ATTRS, { CKA_CERTIFICATE_TYPE, REQUIRE | CREATE, type_ulong }, { CKA_TRUSTED, CREATE | WANT, type_bool }, { CKA_X_DISTRUSTED, CREATE | WANT, type_bool }, { CKA_CERTIFICATE_CATEGORY, CREATE | WANT, type_ulong }, { CKA_CHECK_VALUE, CREATE | WANT, }, { CKA_START_DATE, CREATE | MODIFY | WANT, type_date }, { CKA_END_DATE, CREATE | MODIFY | WANT, type_date }, { CKA_SUBJECT, CREATE | WANT, type_der_name }, { CKA_ID, CREATE | MODIFY | WANT }, { CKA_ISSUER, CREATE | MODIFY | WANT, type_der_name }, { CKA_SERIAL_NUMBER, CREATE | MODIFY | WANT, type_der_serial }, { CKA_VALUE, CREATE, type_der_cert }, { CKA_URL, CREATE, type_utf8 }, { CKA_HASH_OF_SUBJECT_PUBLIC_KEY, CREATE }, { CKA_HASH_OF_ISSUER_PUBLIC_KEY, CREATE }, { CKA_JAVA_MIDP_SECURITY_DOMAIN, CREATE, type_ulong }, { CKA_X_PUBLIC_KEY_INFO, WANT, type_der_key }, { CKA_INVALID }, }, certificate_populate, certificate_validate, }; static CK_ATTRIBUTE * extension_populate (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *extension) { CK_ATTRIBUTE object_id = { CKA_OBJECT_ID }; CK_ATTRIBUTE *attrs = NULL; void *der; size_t len; node_asn *asn; attrs = common_populate (builder, index, extension); return_val_if_fail (attrs != NULL, NULL); /* Pull the object id out of the extension if not present */ if (!p11_attrs_find_valid (attrs, CKA_OBJECT_ID)) { der = p11_attrs_find_value (extension, CKA_VALUE, &len); return_val_if_fail (der != NULL, NULL); asn = decode_or_get_asn1 (builder, "PKIX1.Extension", der, len); return_val_if_fail (asn != NULL, NULL); if (calc_element (asn, der, len, "extnID", &object_id)) { attrs = p11_attrs_build (attrs, &object_id, NULL); return_val_if_fail (attrs != NULL, NULL); } } return attrs; } const static builder_schema extension_schema = { NORMAL_BUILD, { COMMON_ATTRS, { CKA_VALUE, REQUIRE | CREATE, type_der_ext }, { CKA_X_PUBLIC_KEY_INFO, REQUIRE | CREATE, type_der_key }, { CKA_OBJECT_ID, CREATE | WANT, type_der_oid }, { CKA_ID, CREATE | MODIFY }, { CKA_INVALID }, }, extension_populate, }; static CK_ATTRIBUTE * data_populate (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *data) { static const CK_ATTRIBUTE value = { CKA_VALUE, "", 0 }; static const CK_ATTRIBUTE application = { CKA_APPLICATION, "", 0 }; static const CK_ATTRIBUTE object_id = { CKA_OBJECT_ID, "", 0 }; CK_ATTRIBUTE *attrs; attrs = common_populate (builder, index, data); return_val_if_fail (attrs != NULL, NULL); return p11_attrs_build (attrs, &value, &application, &object_id, NULL); } const static builder_schema data_schema = { NORMAL_BUILD, { COMMON_ATTRS, { CKA_VALUE, CREATE | MODIFY | WANT }, { CKA_APPLICATION, CREATE | MODIFY | WANT, type_utf8 }, { CKA_OBJECT_ID, CREATE | MODIFY | WANT, type_der_oid }, { CKA_INVALID }, }, data_populate, }; const static builder_schema trust_schema = { GENERATED_CLASS, { COMMON_ATTRS, { CKA_CERT_SHA1_HASH, CREATE }, { CKA_CERT_MD5_HASH, CREATE }, { CKA_ISSUER, CREATE }, { CKA_SUBJECT, CREATE }, { CKA_SERIAL_NUMBER, CREATE }, { CKA_TRUST_SERVER_AUTH, CREATE }, { CKA_TRUST_CLIENT_AUTH, CREATE }, { CKA_TRUST_EMAIL_PROTECTION, CREATE }, { CKA_TRUST_CODE_SIGNING, CREATE }, { CKA_TRUST_IPSEC_END_SYSTEM, CREATE }, { CKA_TRUST_IPSEC_TUNNEL, CREATE }, { CKA_TRUST_IPSEC_USER, CREATE }, { CKA_TRUST_TIME_STAMPING, CREATE }, { CKA_TRUST_DIGITAL_SIGNATURE, CREATE }, { CKA_TRUST_NON_REPUDIATION, CREATE }, { CKA_TRUST_KEY_ENCIPHERMENT, CREATE }, { CKA_TRUST_DATA_ENCIPHERMENT, CREATE }, { CKA_TRUST_KEY_AGREEMENT, CREATE }, { CKA_TRUST_KEY_CERT_SIGN, CREATE }, { CKA_TRUST_CRL_SIGN, CREATE }, { CKA_TRUST_STEP_UP_APPROVED, CREATE }, { CKA_ID, CREATE }, { CKA_INVALID }, }, common_populate }; const static builder_schema assertion_schema = { GENERATED_CLASS, { COMMON_ATTRS, { CKA_X_PURPOSE, REQUIRE | CREATE }, { CKA_X_CERTIFICATE_VALUE, CREATE }, { CKA_X_ASSERTION_TYPE, REQUIRE | CREATE }, { CKA_ISSUER, CREATE }, { CKA_SERIAL_NUMBER, CREATE }, { CKA_X_PEER, CREATE }, { CKA_ID, CREATE }, { CKA_INVALID }, }, common_populate }; const static builder_schema builtin_schema = { GENERATED_CLASS, { COMMON_ATTRS, { CKA_INVALID }, }, common_populate }; static const char * value_name (const p11_constant *info, CK_ATTRIBUTE_TYPE type) { const char *name = p11_constant_name (info, type); return name ? name : "unknown"; } static const char * type_name (CK_ATTRIBUTE_TYPE type) { return value_name (p11_constant_types, type); } static CK_RV build_for_schema (p11_builder *builder, p11_index *index, const builder_schema *schema, CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge, CK_ATTRIBUTE **extra) { CK_BBOOL modifiable; CK_ATTRIBUTE *attr; bool modifying; bool creating; bool populate; bool loading; bool found; int flags; int i, j; CK_RV rv; populate = false; /* Signifies that data is being loaded */ loading = p11_index_loading (index); /* Signifies that this is being created by a caller, instead of loaded */ creating = (attrs == NULL && !loading); /* Item is being modified by a caller */ modifying = (attrs != NULL && !loading); /* This item may not be modifiable */ if (modifying) { if (!p11_attrs_find_bool (attrs, CKA_MODIFIABLE, &modifiable) || !modifiable) { p11_message ("the object is not modifiable"); return CKR_ATTRIBUTE_READ_ONLY; } } if (creating && (builder->flags & P11_BUILDER_FLAG_TOKEN)) { if (schema->build_flags & GENERATED_CLASS) { p11_message ("objects of this type cannot be created"); return CKR_TEMPLATE_INCONSISTENT; } } for (i = 0; merge[i].type != CKA_INVALID; i++) { /* Don't validate attribute if not changed */ attr = p11_attrs_find (attrs, merge[i].type); if (attr && p11_attr_equal (attr, merge + i)) continue; found = false; for (j = 0; schema->attrs[j].type != CKA_INVALID; j++) { if (schema->attrs[j].type != merge[i].type) continue; flags = schema->attrs[j].flags; if (creating && !(flags & CREATE)) { p11_message ("the %s attribute cannot be set", type_name (schema->attrs[j].type)); return CKR_ATTRIBUTE_READ_ONLY; } if (modifying && !(flags & MODIFY)) { p11_message ("the %s attribute cannot be changed", type_name (schema->attrs[j].type)); return CKR_ATTRIBUTE_READ_ONLY; } if (!loading && schema->attrs[j].validate != NULL && !schema->attrs[j].validate (builder, merge + i)) { p11_message ("the %s attribute has an invalid value", type_name (schema->attrs[j].type)); return CKR_ATTRIBUTE_VALUE_INVALID; } found = true; break; } if (!found) { p11_message ("the %s attribute is not valid for the object", type_name (merge[i].type)); return CKR_TEMPLATE_INCONSISTENT; } } if (attrs == NULL) { for (j = 0; schema->attrs[j].type != CKA_INVALID; j++) { flags = schema->attrs[j].flags; found = false; if ((flags & REQUIRE) || (flags & WANT)) { for (i = 0; merge[i].type != CKA_INVALID; i++) { if (schema->attrs[j].type == merge[i].type) { found = true; break; } } } if (!found) { if (flags & REQUIRE) { p11_message ("missing the %s attribute", type_name (schema->attrs[j].type)); return CKR_TEMPLATE_INCOMPLETE; } else if (flags & WANT) { populate = true; } } } } /* Validate the result, before committing to the change. */ if (!loading && schema->validate) { rv = (schema->validate) (builder, attrs, merge); if (rv != CKR_OK) return rv; } if (populate && schema->populate) *extra = schema->populate (builder, index, merge); return CKR_OK; } CK_RV p11_builder_build (void *bilder, p11_index *index, CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge, CK_ATTRIBUTE **populate) { p11_builder *builder = bilder; CK_OBJECT_CLASS klass; CK_CERTIFICATE_TYPE type; CK_BBOOL token; return_val_if_fail (builder != NULL, CKR_GENERAL_ERROR); return_val_if_fail (index != NULL, CKR_GENERAL_ERROR); return_val_if_fail (merge != NULL, CKR_GENERAL_ERROR); if (!p11_attrs_find_ulong (attrs ? attrs : merge, CKA_CLASS, &klass)) { p11_message ("no CKA_CLASS attribute found"); return CKR_TEMPLATE_INCOMPLETE; } if (!attrs && p11_attrs_find_bool (merge, CKA_TOKEN, &token)) { if (token != ((builder->flags & P11_BUILDER_FLAG_TOKEN) ? CK_TRUE : CK_FALSE)) { p11_message ("cannot create a %s object", token ? "token" : "non-token"); return CKR_TEMPLATE_INCONSISTENT; } } switch (klass) { case CKO_CERTIFICATE: if (!p11_attrs_find_ulong (attrs ? attrs : merge, CKA_CERTIFICATE_TYPE, &type)) { p11_message ("missing %s on object", type_name (CKA_CERTIFICATE_TYPE)); return CKR_TEMPLATE_INCOMPLETE; } else if (type == CKC_X_509) { return build_for_schema (builder, index, &certificate_schema, attrs, merge, populate); } else { p11_message ("%s unsupported %s", value_name (p11_constant_certs, type), type_name (CKA_CERTIFICATE_TYPE)); return CKR_TEMPLATE_INCONSISTENT; } case CKO_X_CERTIFICATE_EXTENSION: return build_for_schema (builder, index, &extension_schema, attrs, merge, populate); case CKO_DATA: return build_for_schema (builder, index, &data_schema, attrs, merge, populate); case CKO_NSS_TRUST: return build_for_schema (builder, index, &trust_schema, attrs, merge, populate); case CKO_NSS_BUILTIN_ROOT_LIST: return build_for_schema (builder, index, &builtin_schema, attrs, merge, populate); case CKO_X_TRUST_ASSERTION: return build_for_schema (builder, index, &assertion_schema, attrs, merge, populate); default: p11_message ("%s unsupported object class", value_name (p11_constant_classes, klass)); return CKR_TEMPLATE_INCONSISTENT; } } void p11_builder_free (p11_builder *builder) { return_if_fail (builder != NULL); p11_asn1_cache_free (builder->asn1_cache); free (builder); } p11_asn1_cache * p11_builder_get_cache (p11_builder *builder) { return_val_if_fail (builder != NULL, NULL); return builder->asn1_cache; } static CK_ATTRIBUTE * build_trust_object_ku (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *cert, CK_ATTRIBUTE *object, CK_TRUST present) { unsigned char *data = NULL; unsigned int ku = 0; size_t length; CK_TRUST defawlt; CK_ULONG i; struct { CK_ATTRIBUTE_TYPE type; unsigned int ku; } ku_attribute_map[] = { { CKA_TRUST_DIGITAL_SIGNATURE, P11_KU_DIGITAL_SIGNATURE }, { CKA_TRUST_NON_REPUDIATION, P11_KU_NON_REPUDIATION }, { CKA_TRUST_KEY_ENCIPHERMENT, P11_KU_KEY_ENCIPHERMENT }, { CKA_TRUST_DATA_ENCIPHERMENT, P11_KU_DATA_ENCIPHERMENT }, { CKA_TRUST_KEY_AGREEMENT, P11_KU_KEY_AGREEMENT }, { CKA_TRUST_KEY_CERT_SIGN, P11_KU_KEY_CERT_SIGN }, { CKA_TRUST_CRL_SIGN, P11_KU_CRL_SIGN }, { CKA_INVALID }, }; CK_ATTRIBUTE attrs[sizeof (ku_attribute_map)]; defawlt = present; /* If blacklisted, don't even bother looking at extensions */ if (present != CKT_NSS_NOT_TRUSTED) data = lookup_extension (builder, index, cert, NULL, P11_OID_KEY_USAGE, &length); if (data) { /* * If the certificate extension was missing, then *all* key * usages are to be set. If the extension was invalid, then * fail safe to none of the key usages. */ defawlt = CKT_NSS_TRUST_UNKNOWN; if (!p11_x509_parse_key_usage (builder->asn1_defs, data, length, &ku)) p11_message ("invalid key usage certificate extension"); free (data); } for (i = 0; ku_attribute_map[i].type != CKA_INVALID; i++) { attrs[i].type = ku_attribute_map[i].type; if (data && (ku & ku_attribute_map[i].ku) == ku_attribute_map[i].ku) { attrs[i].pValue = &present; attrs[i].ulValueLen = sizeof (present); } else { attrs[i].pValue = &defawlt; attrs[i].ulValueLen = sizeof (defawlt); } } return p11_attrs_buildn (object, attrs, i); } static bool strv_to_dict (const char **array, p11_dict **dict) { int i; if (!array) { *dict = NULL; return true; } *dict = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, NULL, NULL); return_val_if_fail (*dict != NULL, false); for (i = 0; array[i] != NULL; i++) { if (!p11_dict_set (*dict, (void *)array[i], (void *)array[i])) return_val_if_reached (false); } return true; } static CK_ATTRIBUTE * build_trust_object_eku (CK_ATTRIBUTE *object, CK_TRUST allow, const char **purposes, const char **rejects) { p11_dict *dict_purp; p11_dict *dict_rej; CK_TRUST neutral; CK_TRUST disallow; CK_ULONG i; struct { CK_ATTRIBUTE_TYPE type; const char *oid; } eku_attribute_map[] = { { CKA_TRUST_SERVER_AUTH, P11_OID_SERVER_AUTH_STR }, { CKA_TRUST_CLIENT_AUTH, P11_OID_CLIENT_AUTH_STR }, { CKA_TRUST_CODE_SIGNING, P11_OID_CODE_SIGNING_STR }, { CKA_TRUST_EMAIL_PROTECTION, P11_OID_EMAIL_PROTECTION_STR }, { CKA_TRUST_IPSEC_END_SYSTEM, P11_OID_IPSEC_END_SYSTEM_STR }, { CKA_TRUST_IPSEC_TUNNEL, P11_OID_IPSEC_TUNNEL_STR }, { CKA_TRUST_IPSEC_USER, P11_OID_IPSEC_USER_STR }, { CKA_TRUST_TIME_STAMPING, P11_OID_TIME_STAMPING_STR }, { CKA_INVALID }, }; CK_ATTRIBUTE attrs[sizeof (eku_attribute_map)]; if (!strv_to_dict (purposes, &dict_purp) || !strv_to_dict (rejects, &dict_rej)) return_val_if_reached (NULL); /* The neutral value is set if an purpose is not present */ if (allow == CKT_NSS_NOT_TRUSTED) neutral = CKT_NSS_NOT_TRUSTED; /* If anything explicitly set, then neutral is unknown */ else if (purposes || rejects) neutral = CKT_NSS_TRUST_UNKNOWN; /* Otherwise neutral will allow any purpose */ else neutral = allow; /* The value set if a purpose is explictly rejected */ disallow = CKT_NSS_NOT_TRUSTED; for (i = 0; eku_attribute_map[i].type != CKA_INVALID; i++) { attrs[i].type = eku_attribute_map[i].type; if (dict_rej && p11_dict_get (dict_rej, eku_attribute_map[i].oid)) { attrs[i].pValue = &disallow; attrs[i].ulValueLen = sizeof (disallow); } else if (dict_purp && p11_dict_get (dict_purp, eku_attribute_map[i].oid)) { attrs[i].pValue = &allow; attrs[i].ulValueLen = sizeof (allow); } else { attrs[i].pValue = &neutral; attrs[i].ulValueLen = sizeof (neutral); } } p11_dict_free (dict_purp); p11_dict_free (dict_rej); return p11_attrs_buildn (object, attrs, i); } static void replace_nss_trust_object (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *cert, CK_BBOOL trust, CK_BBOOL distrust, CK_BBOOL authority, const char **purposes, const char **rejects) { CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *match = NULL; CK_TRUST allow; CK_RV rv; CK_OBJECT_CLASS klassv = CKO_NSS_TRUST; CK_BYTE sha1v[P11_DIGEST_SHA1_LEN]; CK_BYTE md5v[P11_DIGEST_MD5_LEN]; CK_BBOOL generatedv = CK_FALSE; CK_BBOOL falsev = CK_FALSE; CK_ATTRIBUTE klass = { CKA_CLASS, &klassv, sizeof (klassv) }; CK_ATTRIBUTE modifiable = { CKA_MODIFIABLE, &falsev, sizeof (falsev) }; CK_ATTRIBUTE generated = { CKA_X_GENERATED, &generatedv, sizeof (generatedv) }; CK_ATTRIBUTE invalid = { CKA_INVALID, }; CK_ATTRIBUTE md5_hash = { CKA_CERT_MD5_HASH, md5v, sizeof (md5v) }; CK_ATTRIBUTE sha1_hash = { CKA_CERT_SHA1_HASH, sha1v, sizeof (sha1v) }; CK_ATTRIBUTE step_up_approved = { CKA_TRUST_STEP_UP_APPROVED, &falsev, sizeof (falsev) }; CK_ATTRIBUTE_PTR label; CK_ATTRIBUTE_PTR id; CK_ATTRIBUTE_PTR subject; CK_ATTRIBUTE_PTR issuer; CK_ATTRIBUTE_PTR serial_number; p11_array *array; void *value; size_t length; issuer = p11_attrs_find_valid (cert, CKA_ISSUER); serial_number = p11_attrs_find_valid (cert, CKA_SERIAL_NUMBER); value = p11_attrs_find_value (cert, CKA_VALUE, &length); if (!issuer && !serial_number && !value) { p11_debug ("can't generate nss trust object for certificate without issuer+serial or value"); return; } if (value == NULL) { md5_hash.type = CKA_INVALID; sha1_hash.type = CKA_INVALID; } else { p11_digest_md5 (md5v, value, length, NULL); p11_digest_sha1 (sha1v, value, length, NULL); } if (!issuer) issuer = &invalid; if (!serial_number) serial_number = &invalid; match = p11_attrs_build (NULL, issuer, serial_number, &sha1_hash, &generated, &klass, NULL); return_if_fail (match != NULL); /* If we find a non-generated object, then don't generate */ if (p11_index_find (index, match, -1)) { p11_debug ("not generating nss trust object because one already exists"); attrs = NULL; } else { generatedv = CK_TRUE; match = p11_attrs_build (match, &generated, NULL); return_if_fail (match != NULL); /* Copy all of the following attributes from certificate */ id = p11_attrs_find_valid (cert, CKA_ID); if (id == NULL) id = &invalid; subject = p11_attrs_find_valid (cert, CKA_SUBJECT); if (subject == NULL) subject = &invalid; label = p11_attrs_find_valid (cert, CKA_LABEL); if (label == NULL) label = &invalid; attrs = p11_attrs_dup (match); return_if_fail (attrs != NULL); attrs = p11_attrs_build (attrs, &klass, &modifiable, id, label, subject, issuer, serial_number, &md5_hash, &sha1_hash, &step_up_approved, NULL); return_if_fail (attrs != NULL); /* Calculate the default allow trust */ if (distrust) allow = CKT_NSS_NOT_TRUSTED; else if (trust && authority) allow = CKT_NSS_TRUSTED_DELEGATOR; else if (trust) allow = CKT_NSS_TRUSTED; else allow = CKT_NSS_TRUST_UNKNOWN; attrs = build_trust_object_ku (builder, index, cert, attrs, allow); return_if_fail (attrs != NULL); attrs = build_trust_object_eku (attrs, allow, purposes, rejects); return_if_fail (attrs != NULL); } /* Replace related generated object with this new one */ array = p11_array_new (NULL); p11_array_push (array, attrs); rv = p11_index_replace_all (index, match, CKA_INVALID, array); return_if_fail (rv == CKR_OK); p11_array_free (array); p11_attrs_free (match); } static void build_assertions (p11_array *array, CK_ATTRIBUTE *cert, CK_X_ASSERTION_TYPE type, const char **oids) { CK_OBJECT_CLASS assertion = CKO_X_TRUST_ASSERTION; CK_BBOOL truev = CK_TRUE; CK_BBOOL falsev = CK_FALSE; CK_ATTRIBUTE klass = { CKA_CLASS, &assertion, sizeof (assertion) }; CK_ATTRIBUTE private = { CKA_PRIVATE, &falsev, sizeof (falsev) }; CK_ATTRIBUTE modifiable = { CKA_MODIFIABLE, &falsev, sizeof (falsev) }; CK_ATTRIBUTE assertion_type = { CKA_X_ASSERTION_TYPE, &type, sizeof (type) }; CK_ATTRIBUTE autogen = { CKA_X_GENERATED, &truev, sizeof (truev) }; CK_ATTRIBUTE purpose = { CKA_X_PURPOSE, }; CK_ATTRIBUTE invalid = { CKA_INVALID, }; CK_ATTRIBUTE certificate_value = { CKA_X_CERTIFICATE_VALUE, }; CK_ATTRIBUTE *issuer; CK_ATTRIBUTE *serial; CK_ATTRIBUTE *value; CK_ATTRIBUTE *label; CK_ATTRIBUTE *id; CK_ATTRIBUTE *attrs; int i; if (type == CKT_X_DISTRUSTED_CERTIFICATE) { certificate_value.type = CKA_INVALID; issuer = p11_attrs_find_valid (cert, CKA_ISSUER); serial = p11_attrs_find_valid (cert, CKA_SERIAL_NUMBER); if (!issuer || !serial) { p11_debug ("not building negative trust assertion for certificate without serial or issuer"); return; } } else { issuer = &invalid; serial = &invalid; value = p11_attrs_find_valid (cert, CKA_VALUE); if (value == NULL) { p11_debug ("not building positive trust assertion for certificate without value"); return; } certificate_value.pValue = value->pValue; certificate_value.ulValueLen = value->ulValueLen; } label = p11_attrs_find (cert, CKA_LABEL); if (label == NULL) label = &invalid; id = p11_attrs_find (cert, CKA_ID); if (id == NULL) id = &invalid; for (i = 0; oids[i] != NULL; i++) { purpose.pValue = (void *)oids[i]; purpose.ulValueLen = strlen (oids[i]); attrs = p11_attrs_build (NULL, &klass, &private, &modifiable, id, label, &assertion_type, &purpose, issuer, serial, &certificate_value, &autogen, NULL); return_if_fail (attrs != NULL); if (!p11_array_push (array, attrs)) return_if_reached (); } } static void build_trust_assertions (p11_array *positives, p11_array *negatives, CK_ATTRIBUTE *cert, CK_BBOOL trust, CK_BBOOL distrust, CK_BBOOL authority, const char **purposes, const char **rejects) { const char *all_purposes[] = { P11_OID_SERVER_AUTH_STR, P11_OID_CLIENT_AUTH_STR, P11_OID_CODE_SIGNING_STR, P11_OID_EMAIL_PROTECTION_STR, P11_OID_IPSEC_END_SYSTEM_STR, P11_OID_IPSEC_TUNNEL_STR, P11_OID_IPSEC_USER_STR, P11_OID_TIME_STAMPING_STR, NULL, }; /* Build assertions for anything that's explicitly rejected */ if (rejects && negatives) { build_assertions (negatives, cert, CKT_X_DISTRUSTED_CERTIFICATE, rejects); } if (distrust && negatives) { /* * Trust assertions are defficient in that they don't blacklist a certificate * for any purposes. So we just have to go wild and write out a bunch of * assertions for all our known purposes. */ build_assertions (negatives, cert, CKT_X_DISTRUSTED_CERTIFICATE, all_purposes); } /* * TODO: Build pinned certificate assertions. That is, trusted * certificates where not an authority. */ if (trust && authority && positives) { if (purposes) { /* If purposes explicitly set, then anchor for those purposes */ build_assertions (positives, cert, CKT_X_ANCHORED_CERTIFICATE, purposes); } else { /* If purposes not-explicitly set, then anchor for all known */ build_assertions (positives, cert, CKT_X_ANCHORED_CERTIFICATE, all_purposes); } } } static void replace_trust_assertions (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *cert, CK_BBOOL trust, CK_BBOOL distrust, CK_BBOOL authority, const char **purposes, const char **rejects) { CK_OBJECT_CLASS assertion = CKO_X_TRUST_ASSERTION; CK_BBOOL generated = CK_TRUE; p11_array *positives = NULL; p11_array *negatives = NULL; CK_ATTRIBUTE *value; CK_ATTRIBUTE *issuer; CK_ATTRIBUTE *serial; CK_RV rv; CK_ATTRIBUTE match_positive[] = { { CKA_X_CERTIFICATE_VALUE, }, { CKA_CLASS, &assertion, sizeof (assertion) }, { CKA_X_GENERATED, &generated, sizeof (generated) }, { CKA_INVALID } }; CK_ATTRIBUTE match_negative[] = { { CKA_ISSUER, }, { CKA_SERIAL_NUMBER, }, { CKA_CLASS, &assertion, sizeof (assertion) }, { CKA_X_GENERATED, &generated, sizeof (generated) }, { CKA_INVALID } }; value = p11_attrs_find_valid (cert, CKA_VALUE); if (value) { positives = p11_array_new (NULL); match_positive[0].pValue = value->pValue; match_positive[0].ulValueLen = value->ulValueLen; } issuer = p11_attrs_find_valid (cert, CKA_ISSUER); serial = p11_attrs_find_valid (cert, CKA_SERIAL_NUMBER); if (issuer && serial) { negatives = p11_array_new (NULL); memcpy (match_negative + 0, issuer, sizeof (CK_ATTRIBUTE)); memcpy (match_negative + 1, serial, sizeof (CK_ATTRIBUTE)); } build_trust_assertions (positives, negatives, cert, trust, distrust, authority, purposes, rejects); if (positives) { rv = p11_index_replace_all (index, match_positive, CKA_X_PURPOSE, positives); return_if_fail (rv == CKR_OK); p11_array_free (positives); } if (negatives) { rv = p11_index_replace_all (index, match_negative, CKA_X_PURPOSE, negatives); return_if_fail (rv == CKR_OK); p11_array_free (negatives); } } static void remove_trust_and_assertions (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *attrs) { replace_nss_trust_object (builder, index, attrs, CK_FALSE, CK_FALSE, CK_FALSE, NULL, NULL); replace_trust_assertions (builder, index, attrs, CK_FALSE, CK_FALSE, CK_FALSE, NULL, NULL); } static void replace_trust_and_assertions (p11_builder *builder, p11_index *index, CK_ATTRIBUTE *cert) { CK_BBOOL trust = CK_FALSE; CK_BBOOL distrust = CK_FALSE; CK_BBOOL authority = CK_FALSE; p11_array *purposes = NULL; p11_array *rejects = NULL; const char **purposev; const char **rejectv; CK_ULONG category; unsigned char *ext; size_t ext_len; /* * We look up all this information in advance, since it's used * by the various adapter objects, and we don't have to parse * it multiple times. */ if (!p11_attrs_find_bool (cert, CKA_TRUSTED, &trust)) trust = CK_FALSE; if (!p11_attrs_find_bool (cert, CKA_X_DISTRUSTED, &distrust)) distrust = CK_FALSE; if (p11_attrs_find_ulong (cert, CKA_CERTIFICATE_CATEGORY, &category) && category == 2) authority = CK_TRUE; if (!distrust) { ext = lookup_extension (builder, index, cert, NULL, P11_OID_EXTENDED_KEY_USAGE, &ext_len); if (ext != NULL) { purposes = p11_x509_parse_extended_key_usage (builder->asn1_defs, ext, ext_len); if (purposes == NULL) p11_message ("invalid extended key usage certificate extension"); free (ext); } ext = lookup_extension (builder, index, cert, NULL, P11_OID_OPENSSL_REJECT, &ext_len); if (ext != NULL) { rejects = p11_x509_parse_extended_key_usage (builder->asn1_defs, ext, ext_len); if (rejects == NULL) p11_message ("invalid reject key usage certificate extension"); free (ext); } } /* null-terminate these arrays and use as strv's */ purposev = rejectv = NULL; if (rejects) { if (!p11_array_push (rejects, NULL)) return_if_reached (); rejectv = (const char **)rejects->elem; } if (purposes) { if (!p11_array_push (purposes, NULL)) return_if_reached (); purposev = (const char **)purposes->elem; } replace_nss_trust_object (builder, index, cert, trust, distrust, authority, purposev, rejectv); replace_trust_assertions (builder, index, cert, trust, distrust, authority, purposev, rejectv); p11_array_free (purposes); p11_array_free (rejects); } static void replace_compat_for_cert (p11_builder *builder, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs) { static const CK_OBJECT_CLASS certificate = CKO_CERTIFICATE; static const CK_CERTIFICATE_TYPE x509 = CKC_X_509; CK_ATTRIBUTE *value; CK_ATTRIBUTE match[] = { { CKA_VALUE, }, { CKA_CLASS, (void *)&certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, (void *)&x509, sizeof (x509) }, { CKA_INVALID } }; /* * If this certificate is going away, then find duplicate. In this * case all the trust assertions are recalculated with this new * certificate in mind. */ if (handle == 0) { value = p11_attrs_find_valid (attrs, CKA_VALUE); if (value != NULL) { match[0].pValue = value->pValue; match[0].ulValueLen = value->ulValueLen; handle = p11_index_find (index, match, -1); } if (handle != 0) attrs = p11_index_lookup (index, handle); } if (handle == 0) remove_trust_and_assertions (builder, index, attrs); else replace_trust_and_assertions (builder, index, attrs); } static void replace_compat_for_ext (p11_builder *builder, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs) { CK_OBJECT_HANDLE *handles; CK_ATTRIBUTE *public_key; int i; public_key = p11_attrs_find_valid (attrs, CKA_X_PUBLIC_KEY_INFO); if (public_key == NULL) return; handles = lookup_related (index, CKO_CERTIFICATE, public_key); for (i = 0; handles && handles[i] != 0; i++) { attrs = p11_index_lookup (index, handles[i]); replace_trust_and_assertions (builder, index, attrs); } free (handles); } static void update_related_category (p11_builder *builder, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs) { CK_OBJECT_HANDLE *handles; CK_ULONG categoryv = 0UL; CK_ATTRIBUTE *update; CK_ATTRIBUTE *cert; CK_ATTRIBUTE *public_key; CK_RV rv; int i; CK_ATTRIBUTE category[] = { { CKA_CERTIFICATE_CATEGORY, &categoryv, sizeof (categoryv) }, { CKA_INVALID, }, }; public_key = p11_attrs_find_valid (attrs, CKA_X_PUBLIC_KEY_INFO); if (public_key == NULL) return; /* Find all other objects with this handle */ handles = lookup_related (index, CKO_CERTIFICATE, public_key); for (i = 0; handles && handles[i] != 0; i++) { cert = p11_index_lookup (index, handle); if (calc_certificate_category (builder, index, cert, public_key, &categoryv)) { update = p11_attrs_build (NULL, &category, NULL); rv = p11_index_update (index, handles[i], update); return_if_fail (rv == CKR_OK); } } free (handles); } void p11_builder_changed (void *bilder, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs) { static const CK_OBJECT_CLASS certificate = CKO_CERTIFICATE; static const CK_OBJECT_CLASS extension = CKO_X_CERTIFICATE_EXTENSION; static const CK_CERTIFICATE_TYPE x509 = CKC_X_509; static const CK_ATTRIBUTE match_cert[] = { { CKA_CLASS, (void *)&certificate, sizeof (certificate) }, { CKA_CERTIFICATE_TYPE, (void *)&x509, sizeof (x509) }, { CKA_INVALID } }; static const CK_ATTRIBUTE match_eku[] = { { CKA_CLASS, (void *)&extension, sizeof (extension) }, { CKA_OBJECT_ID, (void *)P11_OID_EXTENDED_KEY_USAGE, sizeof (P11_OID_EXTENDED_KEY_USAGE) }, { CKA_INVALID } }; static const CK_ATTRIBUTE match_ku[] = { { CKA_CLASS, (void *)&extension, sizeof (extension) }, { CKA_OBJECT_ID, (void *)P11_OID_KEY_USAGE, sizeof (P11_OID_KEY_USAGE) }, { CKA_INVALID } }; static const CK_ATTRIBUTE match_bc[] = { { CKA_CLASS, (void *)&extension, sizeof (extension) }, { CKA_OBJECT_ID, (void *)P11_OID_BASIC_CONSTRAINTS, sizeof (P11_OID_BASIC_CONSTRAINTS) }, { CKA_INVALID } }; p11_builder *builder = bilder; return_if_fail (builder != NULL); return_if_fail (index != NULL); return_if_fail (attrs != NULL); /* * Treat these operations as loading, not modifying/creating, so we get * around many of the rules that govern object creation */ p11_index_load (index); /* A certificate */ if (p11_attrs_match (attrs, match_cert)) { replace_compat_for_cert (builder, index, handle, attrs); /* An ExtendedKeyUsage extension */ } else if (p11_attrs_match (attrs, match_eku) || p11_attrs_match (attrs, match_ku)) { replace_compat_for_ext (builder, index, handle, attrs); /* A BasicConstraints extension */ } else if (p11_attrs_match (attrs, match_bc)) { update_related_category (builder, index, handle, attrs); } p11_index_finish (index); } p11-kit-0.20.2/trust/pem.h0000664000175000017500000000453012226763526012034 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_PEM_H_ #define P11_PEM_H_ #include "buffer.h" #include "compat.h" #include typedef void (*p11_pem_sink) (const char *type, const unsigned char *contents, size_t length, void *user_data); unsigned int p11_pem_parse (const char *input, size_t length, p11_pem_sink sink, void *user_data); bool p11_pem_write (const unsigned char *contents, size_t length, const char *type, p11_buffer *buf); #endif /* P11_PEM_H_ */ p11-kit-0.20.2/trust/digest.c0000664000175000017500000004207612226763526012534 00000000000000/* * Copyright (C) 2004, 2005, 2007, 2011 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /*! \file * SHA-1 in C * \author By Steve Reid * 100% Public Domain * \verbatim * Test Vectors * "abc" * A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D * "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" * 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 * A million repetitions of "a" * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F * \endverbatim */ #include "config.h" #include "digest.h" #include #include #include #include #ifdef WITH_FREEBL /* * NSS freebl3 has awkward headers not provided by appropriate packages * in many cases. So put these defines here inline. freebl3 seems completely * undocumented anyway. If you think this is a hack, then you guessed right. * * If you want a stable p11-kit without worries, use the builtin SHA1 and MD5 * implementations. They're not used for crypto anyway. If you need p11-kit to * tick the "doesn't implement own crypto" checkbox, then the you're signing * up for this hack. */ typedef enum { HASH_AlgMD5 = 2, HASH_AlgSHA1 = 3, } HASH_HashType; typedef struct NSSLOWInitContextStr NSSLOWInitContext; typedef struct NSSLOWHASHContextStr NSSLOWHASHContext; NSSLOWInitContext *NSSLOW_Init(void); NSSLOWHASHContext *NSSLOWHASH_NewContext( NSSLOWInitContext *initContext, HASH_HashType hashType); void NSSLOWHASH_Begin(NSSLOWHASHContext *context); void NSSLOWHASH_Update(NSSLOWHASHContext *context, const unsigned char *buf, unsigned int len); void NSSLOWHASH_End(NSSLOWHASHContext *context, unsigned char *buf, unsigned int *ret, unsigned int len); void NSSLOWHASH_Destroy(NSSLOWHASHContext *context); #endif /* WITH_FREEBL3 */ #define SHA1_BLOCK_LENGTH 64U typedef struct { uint32_t state[5]; uint32_t count[2]; unsigned char buffer[SHA1_BLOCK_LENGTH]; } sha1_t; #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) /*@{*/ /*! * blk0() and blk() perform the initial expand. * I got the idea of expanding during the round function from SSLeay */ #if !defined(WORDS_BIGENDIAN) # define blk0(i) \ (block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) \ | (rol(block->l[i], 8) & 0x00FF00FF)) #else # define blk0(i) block->l[i] #endif #define blk(i) \ (block->l[i & 15] = rol(block->l[(i + 13) & 15] \ ^ block->l[(i + 8) & 15] \ ^ block->l[(i + 2) & 15] \ ^ block->l[i & 15], 1)) /*@}*/ /*@{*/ /*! * (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1 */ #define R0(v,w,x,y,z,i) \ z += ((w & (x ^ y)) ^ y) + blk0(i) + 0x5A827999 + rol(v, 5); \ w = rol(w, 30); #define R1(v,w,x,y,z,i) \ z += ((w & (x ^ y)) ^ y) + blk(i) + 0x5A827999 + rol(v, 5); \ w = rol(w, 30); #define R2(v,w,x,y,z,i) \ z += (w ^ x ^ y) + blk(i) + 0x6ED9EBA1 + rol(v, 5); \ w = rol(w, 30); #define R3(v,w,x,y,z,i) \ z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + rol(v, 5); \ w = rol(w, 30); #define R4(v,w,x,y,z,i) \ z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \ w = rol(w, 30); /*@}*/ typedef union { unsigned char c[64]; unsigned int l[16]; } CHAR64LONG16; /*! * Hash a single 512-bit block. This is the core of the algorithm. */ static void transform_sha1 (uint32_t state[5], const unsigned char buffer[64]) { uint32_t a, b, c, d, e; CHAR64LONG16 *block; CHAR64LONG16 workspace; assert (buffer != NULL); assert (state != NULL); block = &workspace; (void)memcpy(block, buffer, 64); /* Copy context->state[] to working vars */ a = state[0]; b = state[1]; c = state[2]; d = state[3]; e = state[4]; /* 4 rounds of 20 operations each. Loop unrolled. */ R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); /* Add the working vars back into context.state[] */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; state[4] += e; /* Wipe variables */ a = b = c = d = e = 0; /* Avoid compiler warnings POST(a); POST(b); POST(c); POST(d); POST(e); */ } /*! * isc_sha1_init - Initialize new context */ static void sha1_init (sha1_t *context) { assert (context != NULL); /* SHA1 initialization constants */ context->state[0] = 0x67452301; context->state[1] = 0xEFCDAB89; context->state[2] = 0x98BADCFE; context->state[3] = 0x10325476; context->state[4] = 0xC3D2E1F0; context->count[0] = 0; context->count[1] = 0; } static void sha1_invalidate (sha1_t *context) { memset (context, 0, sizeof (sha1_t)); } /*! * Run your data through this. */ static void sha1_update(sha1_t *context, const unsigned char *data, unsigned int len) { unsigned int i, j; assert (context != 0); assert (data != 0); j = context->count[0]; if ((context->count[0] += len << 3) < j) context->count[1] += (len >> 29) + 1; j = (j >> 3) & 63; if ((j + len) > 63) { (void)memcpy(&context->buffer[j], data, (i = 64 - j)); transform_sha1 (context->state, context->buffer); for (; i + 63 < len; i += 64) transform_sha1 (context->state, &data[i]); j = 0; } else { i = 0; } (void)memcpy(&context->buffer[j], &data[i], len - i); } /*! * Add padding and return the message digest. */ static const unsigned char final_200 = 128; static const unsigned char final_0 = 0; static void sha1_final (sha1_t *context, unsigned char *digest) { unsigned int i; unsigned char finalcount[8]; assert (digest != 0); assert (context != 0); for (i = 0; i < 8; i++) { /* Endian independent */ finalcount[i] = (unsigned char) ((context->count[(i >= 4 ? 0 : 1)] >> ((3 - (i & 3)) * 8)) & 255); } sha1_update(context, &final_200, 1); while ((context->count[0] & 504) != 448) sha1_update(context, &final_0, 1); /* The next Update should cause a transform_sha1() */ sha1_update(context, finalcount, 8); if (digest) { for (i = 0; i < 20; i++) digest[i] = (unsigned char) ((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); } memset (context, 0, sizeof (sha1_t)); } #ifdef WITH_FREEBL static bool nss_slow_hash (HASH_HashType type, unsigned char *hash, unsigned int hash_len, const void *input, size_t length, va_list va) { NSSLOWHASHContext *ctx; unsigned int len; ctx = NSSLOWHASH_NewContext(NSSLOW_Init (), type); if (ctx == NULL) return false; NSSLOWHASH_Begin (ctx); while (input != NULL) { NSSLOWHASH_Update (ctx, input, length); input = va_arg (va, const void *); if (input) length = va_arg (va, size_t); } NSSLOWHASH_End (ctx, hash, &len, hash_len); assert (len == hash_len); NSSLOWHASH_Destroy (ctx); return true; } #endif /* WITH_FREEBL */ void p11_digest_sha1 (unsigned char *hash, const void *input, size_t length, ...) { va_list va; sha1_t sha1; #ifdef WITH_FREEBL bool ret; va_start (va, length); ret = nss_slow_hash (HASH_AlgSHA1, hash, P11_DIGEST_SHA1_LEN, input, length, va); va_end (va); if (ret) return; #endif sha1_init (&sha1); va_start (va, length); while (input != NULL) { sha1_update (&sha1, input, length); input = va_arg (va, const void *); if (input) length = va_arg (va, size_t); } va_end (va); sha1_final (&sha1, hash); sha1_invalidate (&sha1); } /*! \file * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to MD5Init, call MD5Update as * needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. */ typedef struct { uint32_t buf[4]; uint32_t bytes[2]; uint32_t in[16]; } md5_t; static void byteSwap (uint32_t *buf, unsigned words) { unsigned char *p = (unsigned char *)buf; do { *buf++ = (uint32_t)((unsigned)p[3] << 8 | p[2]) << 16 | ((unsigned)p[1] << 8 | p[0]); p += 4; } while (--words); } /*! * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants. */ static void md5_init(md5_t *ctx) { ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; ctx->buf[3] = 0x10325476; ctx->bytes[0] = 0; ctx->bytes[1] = 0; } static void md5_invalidate(md5_t *ctx) { memset(ctx, 0, sizeof(md5_t)); } /*@{*/ /*! The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /*@}*/ /*! This is the central step in the MD5 algorithm. */ #define MD5STEP(f,w,x,y,z,in,s) \ (w += f(x,y,z) + in, w = (w<>(32-s)) + x) /*! * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ static void transform_md5 (uint32_t buf[4], uint32_t const in[16]) { register uint32_t a, b, c, d; a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); buf[0] += a; buf[1] += b; buf[2] += c; buf[3] += d; } /*! * Update context to reflect the concatenation of another buffer full * of bytes. */ static void md5_update (md5_t *ctx, const unsigned char *buf, unsigned int len) { uint32_t t; /* Update byte count */ t = ctx->bytes[0]; if ((ctx->bytes[0] = t + len) < t) ctx->bytes[1]++; /* Carry from low to high */ t = 64 - (t & 0x3f); /* Space available in ctx->in (at least 1) */ if (t > len) { memcpy((unsigned char *)ctx->in + 64 - t, buf, len); return; } /* First chunk is an odd size */ memcpy((unsigned char *)ctx->in + 64 - t, buf, t); byteSwap(ctx->in, 16); transform_md5 (ctx->buf, ctx->in); buf += t; len -= t; /* Process data in 64-byte chunks */ while (len >= 64) { memcpy(ctx->in, buf, 64); byteSwap(ctx->in, 16); transform_md5(ctx->buf, ctx->in); buf += 64; len -= 64; } /* Handle any remaining bytes of data. */ memcpy(ctx->in, buf, len); } /*! * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ static void md5_final(md5_t *ctx, unsigned char *digest) { int count = ctx->bytes[0] & 0x3f; /* Number of bytes in ctx->in */ unsigned char *p = (unsigned char *)ctx->in + count; /* Set the first char of padding to 0x80. There is always room. */ *p++ = 0x80; /* Bytes of padding needed to make 56 bytes (-8..55) */ count = 56 - 1 - count; if (count < 0) { /* Padding forces an extra block */ memset(p, 0, count + 8); byteSwap(ctx->in, 16); transform_md5(ctx->buf, ctx->in); p = (unsigned char *)ctx->in; count = 56; } memset(p, 0, count); byteSwap(ctx->in, 14); /* Append length in bits and transform */ ctx->in[14] = ctx->bytes[0] << 3; ctx->in[15] = ctx->bytes[1] << 3 | ctx->bytes[0] >> 29; transform_md5(ctx->buf, ctx->in); byteSwap(ctx->buf, 4); memcpy(digest, ctx->buf, 16); memset(ctx, 0, sizeof(md5_t)); /* In case it's sensitive */ } void p11_digest_md5 (unsigned char *hash, const void *input, size_t length, ...) { va_list va; md5_t md5; #ifdef WITH_FREEBL bool ret; va_start (va, length); ret = nss_slow_hash (HASH_AlgMD5, hash, P11_DIGEST_MD5_LEN, input, length, va); va_end (va); if (ret) return; #endif md5_init (&md5); va_start (va, length); while (input) { md5_update (&md5, input, length); input = va_arg (va, const void *); if (input) length = va_arg (va, size_t); } va_end (va); md5_final (&md5, hash); md5_invalidate (&md5); } p11-kit-0.20.2/trust/extract-jks.c0000664000175000017500000002041512226763526013505 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "attrs.h" #include "buffer.h" #include "compat.h" #include "debug.h" #include "extract.h" #include "digest.h" #include "message.h" #include "save.h" #include #include #include #include #include static void encode_msb_short (unsigned char *data, int16_t value) { uint16_t v; /* At this point we only support positive numbers */ assert (value >= 0); assert (value < INT16_MAX); v = (uint16_t)value; data[0] = (v >> 8) & 0xff; data[1] = (v >> 0) & 0xff; } static void encode_msb_int (unsigned char *data, int32_t value) { uint32_t v; /* At this point we only support positive numbers */ assert (value >= 0); assert (value < INT32_MAX); v = (uint32_t)value; data[0] = (v >> 24) & 0xff; data[1] = (v >> 16) & 0xff; data[2] = (v >> 8) & 0xff; data[3] = (v >> 0) & 0xff; } static void encode_msb_long (unsigned char *data, int64_t value) { uint64_t v; /* At this point we only support positive numbers */ assert (value >= 0); assert (value < INT64_MAX); v = (uint64_t)value; data[0] = (v >> 56) & 0xff; data[1] = (v >> 48) & 0xff; data[2] = (v >> 40) & 0xff; data[3] = (v >> 32) & 0xff; data[4] = (v >> 24) & 0xff; data[5] = (v >> 16) & 0xff; data[6] = (v >> 8) & 0xff; data[7] = (v >> 0) & 0xff; } static void add_msb_int (p11_buffer *buffer, int32_t value) { unsigned char *data = p11_buffer_append (buffer, 4); return_if_fail (data != NULL); encode_msb_int (data, value); } static void add_msb_long (p11_buffer *buffer, int64_t value) { unsigned char *data = p11_buffer_append (buffer, 8); return_if_fail (data != NULL); encode_msb_long (data, value); } static void add_string (p11_buffer *buffer, const char *string, size_t length) { unsigned char *data; if (length > INT16_MAX) { p11_message ("truncating long string"); length = INT16_MAX; } data = p11_buffer_append (buffer, 2); return_if_fail (data != NULL); encode_msb_short (data, length); p11_buffer_add (buffer, string, length); } static void convert_alias (const char *input, size_t length, p11_buffer *buf) { char ch; size_t i; /* * Java requires that the aliases are 'converted'. For the basic java * cacerts key store this is lower case. We just do this for ASCII, since * we don't want to have to bring in unicode case rules. Since we're * screwing around, we also take out spaces, to make these look like * java aliases. */ for (i = 0; i < length; i++) { ch = input[i]; if (!isspace (ch) && (ch & 0x80) == 0) { ch = tolower (ch); p11_buffer_add (buf, &ch, 1); } } } static bool add_alias (p11_buffer *buffer, p11_dict *aliases, CK_ATTRIBUTE *label) { const char *input; size_t input_len; size_t length; p11_buffer buf; char num[32]; char *alias; int i; p11_buffer_init_null (&buf, 64); if (label && label->pValue) { input = label->pValue; input_len = label->ulValueLen; } else { input = "unlabeled"; input_len = strlen (input); } convert_alias (input, input_len, &buf); for (i = 0; i < INT32_MAX; i++) { if (i > 0) { snprintf (num, sizeof (num), "-%d", i); p11_buffer_add (&buf, num, -1); } return_val_if_fail (p11_buffer_ok (&buf), false); if (!p11_dict_get (aliases, buf.data)) { alias = p11_buffer_steal (&buf, &length); if (!p11_dict_set (aliases, alias, alias)) return_val_if_reached (false); add_string (buffer, alias, length); return true; } p11_buffer_reset (&buf, 0); } return false; } static bool prepare_jks_buffer (p11_enumerate *ex, p11_buffer *buffer) { const unsigned char magic[] = { 0xfe, 0xed, 0xfe, 0xed }; const int version = 2; size_t count_at; unsigned char *digest; CK_ATTRIBUTE *label; p11_dict *aliases; size_t length; int64_t now; int count; CK_RV rv; enum { private_key = 1, trusted_cert = 2, }; /* * Documented in the java sources in the file: * src/share/classes/sun/security/provider/JavaKeyStore.java */ p11_buffer_add (buffer, magic, sizeof (magic)); add_msb_int (buffer, version); count_at = buffer->len; p11_buffer_append (buffer, 4); count = 0; /* * We use the current time for each entry. Java expects the time * when this was this certificate was added to the keystore, however * we don't have that information. Java uses time in milliseconds */ now = time (NULL); return_val_if_fail (now > 0, false); now *= 1000; /* seconds to milliseconds */ /* * The aliases in the output file need to be unique. We use a hash * table to guarantee this. */ aliases = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, NULL); return_val_if_fail (aliases != NULL, false); /* For every certificate */ while ((rv = p11_kit_iter_next (ex->iter)) == CKR_OK) { count++; /* The type of entry */ add_msb_int (buffer, trusted_cert); /* The alias */ label = p11_attrs_find_valid (ex->attrs, CKA_LABEL); if (!add_alias (buffer, aliases, label)) { p11_message ("could not generate a certificate alias name"); p11_dict_free (aliases); return false; } /* The creation date: current time */ add_msb_long (buffer, now); /* The type of the certificate */ add_string (buffer, "X.509", 5); /* The DER encoding of the certificate */ add_msb_int (buffer, ex->cert_len); p11_buffer_add (buffer, ex->cert_der, ex->cert_len); } p11_dict_free (aliases); if (rv != CKR_OK && rv != CKR_CANCEL) { p11_message ("failed to find certificates: %s", p11_kit_strerror (rv)); return false; } /* Place the count in the right place */ encode_msb_int ((unsigned char *)buffer->data + count_at, count); /* * Java keystore reinvents HMAC and uses it to try and "secure" the * cacerts. We fill this in and use the default "changeit" string * as the password for this keyed digest. */ length = buffer->len; digest = p11_buffer_append (buffer, P11_DIGEST_SHA1_LEN); return_val_if_fail (digest != NULL, false); p11_digest_sha1 (digest, "\000c\000h\000a\000n\000g\000e\000i\000t", (size_t)16, /* default password */ "Mighty Aphrodite", (size_t)16, /* go figure */ buffer->data, length, NULL); return_val_if_fail (p11_buffer_ok (buffer), false); return true; } bool p11_extract_jks_cacerts (p11_enumerate *ex, const char *destination) { p11_buffer buffer; p11_save_file *file; bool ret; p11_buffer_init (&buffer, 1024 * 10); ret = prepare_jks_buffer (ex, &buffer); if (ret) { file = p11_save_open_file (destination, NULL, ex->flags); ret = p11_save_write_and_finish (file, buffer.data, buffer.len); } p11_buffer_uninit (&buffer); return ret; } p11-kit-0.20.2/trust/x509.c0000664000175000017500000002176312226763526011762 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "asn1.h" #define P11_DEBUG_FLAG P11_DEBUG_TRUST #include "debug.h" #include "digest.h" #include "oid.h" #include "utf8.h" #include "x509.h" #include #include unsigned char * p11_x509_find_extension (node_asn *cert, const unsigned char *oid, const unsigned char *der, size_t der_len, size_t *ext_len) { char field[128]; int start; int end; int ret; int i; return_val_if_fail (cert != NULL, NULL); return_val_if_fail (oid != NULL, NULL); return_val_if_fail (ext_len != NULL, NULL); for (i = 1; ; i++) { if (snprintf (field, sizeof (field), "tbsCertificate.extensions.?%u.extnID", i) < 0) return_val_if_reached (NULL); ret = asn1_der_decoding_startEnd (cert, der, der_len, field, &start, &end); /* No more extensions */ if (ret == ASN1_ELEMENT_NOT_FOUND) break; return_val_if_fail (ret == ASN1_SUCCESS, NULL); /* Make sure it's a straightforward oid with certain assumptions */ if (!p11_oid_simple (der + start, (end - start) + 1)) continue; /* The one we're lookin for? */ if (!p11_oid_equal (der + start, oid)) continue; if (snprintf (field, sizeof (field), "tbsCertificate.extensions.?%u.extnValue", i) < 0) return_val_if_reached (NULL); return p11_asn1_read (cert, field, ext_len); } return NULL; } bool p11_x509_calc_keyid (node_asn *cert, const unsigned char *der, size_t der_len, unsigned char *keyid) { int start, end; size_t len; int ret; return_val_if_fail (cert != NULL, NULL); return_val_if_fail (der != NULL, NULL); return_val_if_fail (keyid != NULL, NULL); ret = asn1_der_decoding_startEnd (cert, der, der_len, "tbsCertificate.subjectPublicKeyInfo", &start, &end); return_val_if_fail (ret == ASN1_SUCCESS, false); return_val_if_fail (end >= start, false); len = (end - start) + 1; p11_digest_sha1 (keyid, (der + start), len, NULL); return true; } bool p11_x509_parse_basic_constraints (p11_dict *asn1_defs, const unsigned char *ext_der, size_t ext_len, bool *is_ca) { char buffer[8]; node_asn *ext; int ret; int len; return_val_if_fail (is_ca != NULL, false); ext = p11_asn1_decode (asn1_defs, "PKIX1.BasicConstraints", ext_der, ext_len, NULL); if (ext == NULL) return false; len = sizeof (buffer); ret = asn1_read_value (ext, "cA", buffer, &len); /* Default value for cA is FALSE */ if (ret == ASN1_ELEMENT_NOT_FOUND) { *is_ca = false; } else { return_val_if_fail (ret == ASN1_SUCCESS, false); *is_ca = (strcmp (buffer, "TRUE") == 0); } asn1_delete_structure (&ext); return true; } bool p11_x509_parse_key_usage (p11_dict *asn1_defs, const unsigned char *ext_der, size_t ext_len, unsigned int *ku) { char message[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = { 0, }; unsigned char buf[2]; node_asn *ext; int len; int ret; ext = p11_asn1_decode (asn1_defs, "PKIX1.KeyUsage", ext_der, ext_len, message); if (ext == NULL) return false; len = sizeof (buf); ret = asn1_read_value (ext, "", buf, &len); return_val_if_fail (ret == ASN1_SUCCESS, false); /* A bit string, so combine into one set of flags */ *ku = buf[0] | (buf[1] << 8); asn1_delete_structure (&ext); return true; } p11_array * p11_x509_parse_extended_key_usage (p11_dict *asn1_defs, const unsigned char *ext_der, size_t ext_len) { node_asn *asn; char field[128]; p11_array *ekus; size_t len; char *eku; int i; asn = p11_asn1_decode (asn1_defs, "PKIX1.ExtKeyUsageSyntax", ext_der, ext_len, NULL); if (asn == NULL) return NULL; ekus = p11_array_new (free); for (i = 1; ; i++) { if (snprintf (field, sizeof (field), "?%u", i) < 0) return_val_if_reached (NULL); eku = p11_asn1_read (asn, field, &len); if (eku == NULL) break; eku[len] = 0; /* If it's our reserved OID, then skip */ if (strcmp (eku, P11_OID_RESERVED_PURPOSE_STR) == 0) { free (eku); continue; } if (!p11_array_push (ekus, eku)) return_val_if_reached (NULL); } asn1_delete_structure (&asn); return ekus; } char * p11_x509_parse_directory_string (const unsigned char *input, size_t input_len, bool *unknown_string, size_t *string_len) { unsigned long tag; unsigned char cls; int tag_len; int len_len; const void *octets; long octet_len; int ret; ret = asn1_get_tag_der (input, input_len, &cls, &tag_len, &tag); return_val_if_fail (ret == ASN1_SUCCESS, NULL); octet_len = asn1_get_length_der (input + tag_len, input_len - tag_len, &len_len); return_val_if_fail (octet_len >= 0, false); return_val_if_fail (tag_len + len_len + octet_len == input_len, NULL); octets = input + tag_len + len_len; if (unknown_string) *unknown_string = false; /* The following strings are the ones we normalize */ switch (tag) { case 12: /* UTF8String */ case 18: /* NumericString */ case 22: /* IA5String */ case 20: /* TeletexString */ case 19: /* PrintableString */ if (!p11_utf8_validate (octets, octet_len)) return NULL; if (string_len) *string_len = octet_len; return strndup (octets, octet_len); case 28: /* UniversalString */ return p11_utf8_for_ucs4be (octets, octet_len, string_len); case 30: /* BMPString */ return p11_utf8_for_ucs2be (octets, octet_len, string_len); /* Just pass through all the non-string types */ default: if (unknown_string) *unknown_string = true; return NULL; } } char * p11_x509_parse_dn_name (p11_dict *asn_defs, const unsigned char *der, size_t der_len, const unsigned char *oid) { node_asn *asn; char *part; asn = p11_asn1_decode (asn_defs, "PKIX1.Name", der, der_len, NULL); if (asn == NULL) return NULL; part = p11_x509_lookup_dn_name (asn, NULL, der, der_len, oid); asn1_delete_structure (&asn); return part; } char * p11_x509_lookup_dn_name (node_asn *asn, const char *dn_field, const unsigned char *der, size_t der_len, const unsigned char *oid) { unsigned char *value; char field[128]; size_t value_len; char *part; int i, j; int start; int end; int ret; for (i = 1; true; i++) { for (j = 1; true; j++) { snprintf (field, sizeof (field), "%s%srdnSequence.?%d.?%d.type", dn_field, dn_field ? "." : "", i, j); ret = asn1_der_decoding_startEnd (asn, der, der_len, field, &start, &end); /* No more dns */ if (ret == ASN1_ELEMENT_NOT_FOUND) break; return_val_if_fail (ret == ASN1_SUCCESS, NULL); /* Make sure it's a straightforward oid with certain assumptions */ if (!p11_oid_simple (der + start, (end - start) + 1)) continue; /* The one we're lookin for? */ if (!p11_oid_equal (der + start, oid)) continue; snprintf (field, sizeof (field), "%s%srdnSequence.?%d.?%d.value", dn_field, dn_field ? "." : "", i, j); value = p11_asn1_read (asn, field, &value_len); return_val_if_fail (value != NULL, NULL); part = p11_x509_parse_directory_string (value, value_len, NULL, NULL); free (value); return part; } if (j == 1) break; } return NULL; } p11-kit-0.20.2/trust/p11-kit-trust.module0000664000175000017500000000126512161102014014631 00000000000000# See pkcs11.conf(5) to understand this file # This is a module config for the 'included' p11-kit trust module module: p11-kit-trust.so # This setting affects the order that trust policy and other information # is looked up when going across various modules. Other trust policy modules # need to specify the priority where they slot into things. priority: 1 # Mark this module as a viable source of trust policy information trust-policy: yes # This is for drop-in compatibilty with glib-networking and gcr. Those # projects used this non-standard attribute to denote slots to use to # retrieve trust information. x-trust-lookup: pkcs11:library-description=PKCS%2311%20Kit%20Trust%20Module p11-kit-0.20.2/trust/list.h0000664000175000017500000000344312226763526012230 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #ifndef P11_LIST_H_ #define P11_LIST_H_ int p11_trust_list (int argc, char **argv); #endif /* P11_LIST_H_ */ p11-kit-0.20.2/trust/token.c0000664000175000017500000005303512226763526012372 00000000000000/* * Copyright (C) 2012-2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "asn1.h" #include "attrs.h" #include "builder.h" #include "compat.h" #include "constants.h" #define P11_DEBUG_FLAG P11_DEBUG_TRUST #include "debug.h" #include "errno.h" #include "message.h" #include "module.h" #include "parser.h" #include "path.h" #include "persist.h" #include "pkcs11.h" #include "pkcs11x.h" #include "save.h" #include "token.h" #include #include #include #include #include #include #include struct _p11_token { p11_parser *parser; /* Parser we use to load files */ p11_index *index; /* Index we load objects into */ p11_builder *builder; /* Expands objects and applies policy */ p11_dict *loaded; /* stat structs for loaded files, track reloads */ char *path; /* Main path to load from */ char *anchors; /* Path to load anchors from */ char *blacklist; /* Path to load blacklist from */ char *label; /* The token label */ CK_SLOT_ID slot; /* The slot id */ bool checked_path; bool is_writable; bool make_directory; }; static bool loader_is_necessary (p11_token *token, const char *filename, struct stat *sb) { struct stat *last; last = p11_dict_get (token->loaded, filename); /* Never seen this before, load it */ if (last == NULL) return true; /* * If any of these are different assume that the file * needs to be reloaded */ return (sb->st_mode != last->st_mode || sb->st_mtime != last->st_mtime || sb->st_size != last->st_size); } static void loader_was_loaded (p11_token *token, const char *filename, struct stat *sb) { char *key; key = strdup (filename); return_if_fail (key != NULL); sb = memdup (sb, sizeof (struct stat)); return_if_fail (sb != NULL); /* Track the info about this file, so we don't reload unnecessarily */ if (!p11_dict_set (token->loaded, key, sb)) return_if_reached (); } static bool loader_not_loaded (p11_token *token, const char *filename) { /* No longer track info about this file */ return p11_dict_remove (token->loaded, filename); } static void loader_gone_file (p11_token *token, const char *filename) { CK_ATTRIBUTE origin[] = { { CKA_X_ORIGIN, (void *)filename, strlen (filename) }, { CKA_INVALID }, }; CK_RV rv; p11_index_load (token->index); /* Remove everything at this origin */ rv = p11_index_replace_all (token->index, origin, CKA_INVALID, NULL); return_if_fail (rv == CKR_OK); p11_index_finish (token->index); /* No longer track info about this file */ loader_not_loaded (token, filename); } static int loader_load_file (p11_token *token, const char *filename, struct stat *sb) { CK_ATTRIBUTE origin[] = { { CKA_X_ORIGIN, (void *)filename, strlen (filename) }, { CKA_INVALID }, }; p11_array *parsed; CK_RV rv; int flags; int ret; int i; /* Check if this file is already loaded */ if (!loader_is_necessary (token, filename, sb)) return 0; flags = P11_PARSE_FLAG_NONE; /* If it's in the anchors subdirectory, treat as an anchor */ if (p11_path_prefix (filename, token->anchors)) flags = P11_PARSE_FLAG_ANCHOR; /* If it's in the blacklist subdirectory, treat as a blacklist */ else if (p11_path_prefix (filename, token->blacklist)) flags = P11_PARSE_FLAG_BLACKLIST; /* If the token is just one path, then assume they are anchors */ else if (strcmp (filename, token->path) == 0 && !S_ISDIR (sb->st_mode)) flags = P11_PARSE_FLAG_ANCHOR; ret = p11_parse_file (token->parser, filename, sb, flags); switch (ret) { case P11_PARSE_SUCCESS: p11_debug ("loaded: %s", filename); break; case P11_PARSE_UNRECOGNIZED: p11_debug ("skipped: %s", filename); loader_gone_file (token, filename); return 0; default: p11_debug ("failed to parse: %s", filename); loader_gone_file (token, filename); return 0; } /* Update each parsed object with the origin */ parsed = p11_parser_parsed (token->parser); for (i = 0; i < parsed->num; i++) { parsed->elem[i] = p11_attrs_build (parsed->elem[i], origin, NULL); return_val_if_fail (parsed->elem[i] != NULL, 0); } p11_index_load (token->index); /* Now place all of these in the index */ rv = p11_index_replace_all (token->index, origin, CKA_CLASS, parsed); p11_index_finish (token->index); if (rv != CKR_OK) { p11_message ("couldn't load file into objects: %s", filename); return 0; } loader_was_loaded (token, filename, sb); return 1; } static int loader_load_if_file (p11_token *token, const char *path) { struct stat sb; if (stat (path, &sb) < 0) { if (errno != ENOENT) p11_message_err (errno, "couldn't stat path: %d: %s", errno, path); } else if (!S_ISDIR (sb.st_mode)) { return loader_load_file (token, path, &sb); } /* Perhaps the file became unloadable, so track properly */ loader_gone_file (token, path); return 0; } static int loader_load_directory (p11_token *token, const char *directory, p11_dict *present) { p11_dictiter iter; struct dirent *dp; char *path; int total = 0; int ret; DIR *dir; /* First we load all the modules */ dir = opendir (directory); if (!dir) { p11_message_err (errno, "couldn't list directory: %s", directory); loader_not_loaded (token, directory); return 0; } while ((dp = readdir (dir)) != NULL) { path = p11_path_build (directory, dp->d_name, NULL); return_val_if_fail (path != NULL, -1); ret = loader_load_if_file (token, path); return_val_if_fail (ret >=0, -1); total += ret; /* Make note that this file was seen */ p11_dict_remove (present, path); free (path); } closedir (dir); /* All other files that were present, not here now */ p11_dict_iterate (present, &iter); while (p11_dict_next (&iter, (void **)&path, NULL)) loader_gone_file (token, path); return total; } static int loader_load_path (p11_token *token, const char *path, bool *is_dir) { p11_dictiter iter; p11_dict *present; char *filename; struct stat sb; int total; int ret; if (stat (path, &sb) < 0) { if (errno != ENOENT) p11_message_err (errno, "cannot access trust certificate path: %s", path); loader_gone_file (token, path); return 0; } if (S_ISDIR (sb.st_mode)) { *is_dir = true; ret = 0; /* All the files we know about at this path */ present = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, NULL, NULL); p11_dict_iterate (token->loaded, &iter); while (p11_dict_next (&iter, (void **)&filename, NULL)) { if (p11_path_prefix (filename, path)) { if (!p11_dict_set (present, filename, filename)) return_val_if_reached (-1); } } /* If the directory has changed, reload it */ if (loader_is_necessary (token, path, &sb)) { ret = loader_load_directory (token, path, present); /* Directory didn't change, but maybe files changed? */ } else { total = 0; p11_dict_iterate (present, &iter); while (p11_dict_next (&iter, (void **)&filename, NULL)) { ret = loader_load_if_file (token, filename); return_val_if_fail (ret >= 0, ret); total += ret; } } p11_dict_free (present); loader_was_loaded (token, path, &sb); } else { *is_dir = false; ret = loader_load_file (token, path, &sb); } return ret; } static int load_builtin_objects (p11_token *token) { CK_OBJECT_CLASS builtin = CKO_NSS_BUILTIN_ROOT_LIST; CK_BBOOL vtrue = CK_TRUE; CK_BBOOL vfalse = CK_FALSE; CK_RV rv; const char *trust_anchor_roots = "Trust Anchor Roots"; CK_ATTRIBUTE builtin_root_list[] = { { CKA_CLASS, &builtin, sizeof (builtin) }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, { CKA_PRIVATE, &vfalse, sizeof (vfalse) }, { CKA_MODIFIABLE, &vfalse, sizeof (vfalse) }, { CKA_LABEL, (void *)trust_anchor_roots, strlen (trust_anchor_roots) }, { CKA_INVALID }, }; p11_index_load (token->index); rv = p11_index_take (token->index, p11_attrs_dup (builtin_root_list), NULL); return_val_if_fail (rv == CKR_OK, 0); p11_index_finish (token->index); return 1; } int p11_token_load (p11_token *token) { int total = 0; bool is_dir; int ret; ret = loader_load_path (token, token->path, &is_dir); return_val_if_fail (ret >= 0, -1); total += ret; if (is_dir) { ret = loader_load_path (token, token->anchors, &is_dir); return_val_if_fail (ret >= 0, -1); total += ret; ret = loader_load_path (token, token->blacklist, &is_dir); return_val_if_fail (ret >= 0, -1); total += ret; } return total; } bool p11_token_reload (p11_token *token, CK_ATTRIBUTE *attrs) { CK_ATTRIBUTE *attr; struct stat sb; char *origin; bool ret; attr = p11_attrs_find (attrs, CKA_X_ORIGIN); if (attr == NULL) return false; origin = strndup (attr->pValue, attr->ulValueLen); return_val_if_fail (origin != NULL, false); if (stat (origin, &sb) < 0) { if (errno == ENOENT) { loader_gone_file (token, origin); } else { p11_message_err (errno, "cannot access trust file: %s", origin); } ret = false; } else { ret = loader_load_file (token, origin, &sb) > 0; } free (origin); return ret; } static bool check_directory (const char *path, bool *make_directory, bool *is_writable) { struct stat sb; char *parent; bool dummy; bool ret; /* * This function attempts to determine whether a later write * to this token will succeed so we can setup the appropriate * token flags. Yes, it is racy, but that's inherent to the problem. */ if (stat (path, &sb) == 0) { *make_directory = false; *is_writable = S_ISDIR (sb.st_mode) && access (path, W_OK) == 0; return true; } switch (errno) { case EACCES: *is_writable = false; *make_directory = false; return true; case ENOENT: *make_directory = true; parent = p11_path_parent (path); if (parent == NULL) ret = false; else ret = check_directory (parent, &dummy, is_writable); free (parent); return ret; default: p11_message_err (errno, "couldn't access: %s", path); return false; } } static bool check_token_directory (p11_token *token) { if (!token->checked_path) { token->checked_path = check_directory (token->path, &token->make_directory, &token->is_writable); } return token->checked_path; } static bool writer_remove_origin (p11_token *token, CK_ATTRIBUTE *origin) { bool ret = true; char *path; path = strndup (origin->pValue, origin->ulValueLen); return_val_if_fail (path != NULL, false); if (unlink (path) < 0) { p11_message_err (errno, "couldn't remove file: %s", path); ret = false; } free (path); return ret; } static p11_save_file * writer_overwrite_origin (p11_token *token, CK_ATTRIBUTE *origin) { p11_save_file *file; char *path; path = strndup (origin->pValue, origin->ulValueLen); return_val_if_fail (path != NULL, NULL); file = p11_save_open_file (path, NULL, P11_SAVE_OVERWRITE); free (path); return file; } static char * writer_suggest_name (CK_ATTRIBUTE *attrs) { CK_ATTRIBUTE *label; CK_OBJECT_CLASS klass; const char *nick; label = p11_attrs_find (attrs, CKA_LABEL); if (label && label->ulValueLen) return strndup (label->pValue, label->ulValueLen); nick = NULL; if (p11_attrs_find_ulong (attrs, CKA_CLASS, &klass)) nick = p11_constant_nick (p11_constant_classes, klass); if (nick == NULL) nick = "object"; return strdup (nick); } static p11_save_file * writer_create_origin (p11_token *token, CK_ATTRIBUTE *attrs) { p11_save_file *file; char *name; char *path; name = writer_suggest_name (attrs); return_val_if_fail (name != NULL, NULL); p11_path_canon (name); path = p11_path_build (token->path, name, NULL); free (name); file = p11_save_open_file (path, ".p11-kit", P11_SAVE_UNIQUE); free (path); return file; } static CK_RV writer_put_header (p11_save_file *file) { const char *header = "# This file has been auto-generated and written by p11-kit. Changes will be\n" "# unceremoniously overwritten.\n" "#\n" "# The format is designed to be somewhat human readable and debuggable, and a\n" "# bit transparent but it is not encouraged to read/write this format from other\n" "# applications or tools without first discussing this at the the mailing list:\n" "#\n" "# p11-glue@lists.freedesktop.org\n" "#\n"; if (!p11_save_write (file, header, -1)) return CKR_FUNCTION_FAILED; return CKR_OK; } static CK_RV writer_put_object (p11_save_file *file, p11_persist *persist, p11_buffer *buffer, CK_ATTRIBUTE *attrs) { if (!p11_buffer_reset (buffer, 0)) assert_not_reached (); if (!p11_persist_write (persist, attrs, buffer)) return_val_if_reached (CKR_GENERAL_ERROR); if (!p11_save_write (file, buffer->data, buffer->len)) return CKR_FUNCTION_FAILED; return CKR_OK; } static bool mkdir_with_parents (const char *path) { char *parent; bool ret; #ifdef OS_UNIX int mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; if (mkdir (path, mode) == 0) #else if (mkdir (path) == 0) #endif return true; switch (errno) { case ENOENT: parent = p11_path_parent (path); if (parent != NULL) { ret = mkdir_with_parents (parent); free (parent); if (ret == true) { #ifdef OS_UNIX if (mkdir (path, mode) == 0) #else if (mkdir (path) == 0) #endif return true; } } /* fall through */ default: p11_message_err (errno, "couldn't create directory: %s", path); return false; } } static CK_RV on_index_build (void *data, p11_index *index, CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge, CK_ATTRIBUTE **extra) { p11_token *token = data; return p11_builder_build (token->builder, index, attrs, merge, extra); } static CK_RV on_index_store (void *data, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE **attrs) { p11_token *token = data; CK_OBJECT_HANDLE *other; p11_persist *persist; p11_buffer buffer; CK_ATTRIBUTE *origin; CK_ATTRIBUTE *object; p11_save_file *file; bool creating = false; char *path; CK_RV rv; int i; /* Signifies that data is being loaded, don't write out */ if (p11_index_loading (index)) return CKR_OK; if (!check_token_directory (token)) return CKR_FUNCTION_FAILED; if (token->make_directory) { if (!mkdir_with_parents (token->path)) return CKR_FUNCTION_FAILED; token->make_directory = false; } /* Do we already have a filename? */ origin = p11_attrs_find (*attrs, CKA_X_ORIGIN); if (origin == NULL) { file = writer_create_origin (token, *attrs); creating = true; other = NULL; } else { other = p11_index_find_all (index, origin, 1); file = writer_overwrite_origin (token, origin); creating = false; } if (file == NULL) { free (origin); return CKR_GENERAL_ERROR; } persist = p11_persist_new (); p11_buffer_init (&buffer, 1024); rv = writer_put_header (file); if (rv == CKR_OK) rv = writer_put_object (file, persist, &buffer, *attrs); for (i = 0; rv == CKR_OK && other && other[i] != 0; i++) { if (other[i] != handle) { object = p11_index_lookup (index, other[i]); if (object != NULL) rv = writer_put_object (file, persist, &buffer, object); } } p11_buffer_uninit (&buffer); p11_persist_free (persist); free (other); if (rv == CKR_OK) { if (!p11_save_finish_file (file, &path, true)) rv = CKR_FUNCTION_FAILED; else if (creating) *attrs = p11_attrs_take (*attrs, CKA_X_ORIGIN, path, strlen (path)); else free (path); } else { p11_save_finish_file (file, NULL, false); } return rv; } static CK_RV on_index_remove (void *data, p11_index *index, CK_ATTRIBUTE *attrs) { p11_token *token = data; CK_OBJECT_HANDLE *other; p11_persist *persist; p11_buffer buffer; CK_ATTRIBUTE *origin; CK_ATTRIBUTE *object; p11_save_file *file; CK_RV rv = CKR_OK; int i; /* Signifies that data is being loaded, don't write out */ if (p11_index_loading (index)) return CKR_OK; if (!check_token_directory (token)) return CKR_FUNCTION_FAILED; /* We should have a file name */ origin = p11_attrs_find (attrs, CKA_X_ORIGIN); return_val_if_fail (origin != NULL, CKR_GENERAL_ERROR); /* If there are other objects in this file, then rewrite it */ other = p11_index_find_all (index, origin, 1); if (other && other[0]) { file = writer_overwrite_origin (token, origin); if (file == NULL) { free (other); return CKR_GENERAL_ERROR; } persist = p11_persist_new (); p11_buffer_init (&buffer, 1024); rv = writer_put_header (file); for (i = 0; rv == CKR_OK && other && other[i] != 0; i++) { object = p11_index_lookup (index, other[i]); if (object != NULL) rv = writer_put_object (file, persist, &buffer, object); } if (rv == CKR_OK) { if (!p11_save_finish_file (file, NULL, true)) rv = CKR_FUNCTION_FAILED; } else { p11_save_finish_file (file, NULL, false); } p11_persist_free (persist); p11_buffer_uninit (&buffer); /* Otherwise just remove the file */ } else { if (!writer_remove_origin (token, origin)) rv = CKR_FUNCTION_FAILED; } free (other); return rv; } static void on_index_notify (void *data, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs) { p11_token *token = data; p11_builder_changed (token->builder, index, handle, attrs); } void p11_token_free (p11_token *token) { if (!token) return; p11_index_free (token->index); p11_parser_free (token->parser); p11_builder_free (token->builder); p11_dict_free (token->loaded); free (token->path); free (token->anchors); free (token->blacklist); free (token->label); free (token); } p11_token * p11_token_new (CK_SLOT_ID slot, const char *path, const char *label) { p11_token *token; return_val_if_fail (path != NULL, NULL); return_val_if_fail (label != NULL, NULL); token = calloc (1, sizeof (p11_token)); return_val_if_fail (token != NULL, NULL); token->builder = p11_builder_new (P11_BUILDER_FLAG_TOKEN); return_val_if_fail (token->builder != NULL, NULL); token->index = p11_index_new (on_index_build, on_index_store, on_index_remove, on_index_notify, token); return_val_if_fail (token->index != NULL, NULL); token->parser = p11_parser_new (p11_builder_get_cache (token->builder)); return_val_if_fail (token->parser != NULL, NULL); p11_parser_formats (token->parser, p11_parser_format_persist, p11_parser_format_pem, p11_parser_format_x509, NULL); token->loaded = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, free); return_val_if_fail (token->loaded != NULL, NULL); token->path = p11_path_expand (path); return_val_if_fail (token->path != NULL, NULL); token->anchors = p11_path_build (token->path, "anchors", NULL); return_val_if_fail (token->anchors != NULL, NULL); token->blacklist = p11_path_build (token->path, "blacklist", NULL); return_val_if_fail (token->blacklist != NULL, NULL); token->label = strdup (label); return_val_if_fail (token->label != NULL, NULL); token->slot = slot; load_builtin_objects (token); p11_debug ("token: %s: %s", token->label, token->path); return token; } const char * p11_token_get_label (p11_token *token) { return_val_if_fail (token != NULL, NULL); return token->label; } const char * p11_token_get_path (p11_token *token) { return_val_if_fail (token != NULL, NULL); return token->path; } CK_SLOT_ID p11_token_get_slot (p11_token *token) { return_val_if_fail (token != NULL, 0); return token->slot; } p11_index * p11_token_index (p11_token *token) { return_val_if_fail (token != NULL, NULL); return token->index; } p11_parser * p11_token_parser (p11_token *token) { return_val_if_fail (token != NULL, NULL); return token->parser; } bool p11_token_is_writable (p11_token *token) { if (!check_token_directory (token)) return false; return token->is_writable; } p11-kit-0.20.2/trust/index.c0000664000175000017500000005074612226763526012367 00000000000000/* * Copyright (C) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "compat.h" #define P11_DEBUG_FLAG P11_DEBUG_TRUST #include "attrs.h" #include "debug.h" #include "dict.h" #include "index.h" #include "module.h" #include #include #include /* * The number of buckets we use for indexing, should end up as roughly * equal to the expected number of unique attribute values * 0.75, * prime if possible. Currently we don't expand the index, so this is * just a good guess for general usage. */ #define NUM_BUCKETS 7919 /* * The number of indexes to use when trying to find a matching object. */ #define MAX_SELECT 3 typedef struct { CK_OBJECT_HANDLE *elem; int num; } index_bucket; struct _p11_index { /* The list of objects by handle */ p11_dict *objects; /* Used for indexing */ index_bucket *buckets; /* Data passed to callbacks */ void *data; /* Called to build an new/modified object */ p11_index_build_cb build; /* Called after each object ready to be stored */ p11_index_store_cb store; /* Called after an object has been removed */ p11_index_remove_cb remove; /* Called after objects change */ p11_index_notify_cb notify; /* Used for queueing changes, when in a batch */ p11_dict *changes; bool notifying; }; typedef struct { CK_OBJECT_HANDLE handle; CK_ATTRIBUTE *attrs; } index_object; static void free_object (void *data) { index_object *obj = data; p11_attrs_free (obj->attrs); free (obj); } static CK_RV default_build (void *data, p11_index *index, CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge, CK_ATTRIBUTE **populate) { return CKR_OK; } static CK_RV default_store (void *data, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE **attrs) { return CKR_OK; } static void default_notify (void *data, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs) { } static CK_RV default_remove (void *data, p11_index *index, CK_ATTRIBUTE *attrs) { return CKR_OK; } p11_index * p11_index_new (p11_index_build_cb build, p11_index_store_cb store, p11_index_remove_cb remove, p11_index_notify_cb notify, void *data) { p11_index *index; index = calloc (1, sizeof (p11_index)); return_val_if_fail (index != NULL, NULL); if (build == NULL) build = default_build; if (store == NULL) store = default_store; if (notify == NULL) notify = default_notify; if (remove == NULL) remove = default_remove; index->build = build; index->store = store; index->notify = notify; index->remove = remove; index->data = data; index->objects = p11_dict_new (p11_dict_ulongptr_hash, p11_dict_ulongptr_equal, NULL, free_object); return_val_if_fail (index->objects != NULL, NULL); index->buckets = calloc (NUM_BUCKETS, sizeof (index_bucket)); return_val_if_fail (index->buckets != NULL, NULL); return index; } void p11_index_free (p11_index *index) { int i; return_if_fail (index != NULL); p11_dict_free (index->objects); p11_dict_free (index->changes); for (i = 0; i < NUM_BUCKETS; i++) free (index->buckets[i].elem); free (index->buckets); free (index); } int p11_index_size (p11_index *index) { return_val_if_fail (index != NULL, -1); return p11_dict_size (index->objects); } static bool is_indexable (p11_index *index, CK_ATTRIBUTE_TYPE type) { switch (type) { case CKA_CLASS: case CKA_VALUE: case CKA_OBJECT_ID: case CKA_ID: case CKA_X_ORIGIN: return true; } return false; } static unsigned int alloc_size (int num) { unsigned int n = num ? 1 : 0; while (n < num && n > 0) n <<= 1; return n; } static int binary_search (CK_OBJECT_HANDLE *elem, int low, int high, CK_OBJECT_HANDLE handle) { int mid; if (low == high) return low; mid = low + ((high - low) / 2); if (handle > elem[mid]) return binary_search (elem, mid + 1, high, handle); else if (handle < elem[mid]) return binary_search (elem, low, mid, handle); return mid; } static void bucket_insert (index_bucket *bucket, CK_OBJECT_HANDLE handle) { unsigned int alloc; int at = 0; if (bucket->elem) { at = binary_search (bucket->elem, 0, bucket->num, handle); if (at < bucket->num && bucket->elem[at] == handle) return; } alloc = alloc_size (bucket->num); if (bucket->num + 1 > alloc) { alloc = alloc ? alloc * 2 : 1; return_if_fail (alloc != 0); bucket->elem = realloc (bucket->elem, alloc * sizeof (CK_OBJECT_HANDLE)); return_if_fail (bucket->elem != NULL); } memmove (bucket->elem + at + 1, bucket->elem + at, (bucket->num - at) * sizeof (CK_OBJECT_HANDLE)); bucket->elem[at] = handle; bucket->num++; } static bool bucket_push (index_bucket *bucket, CK_OBJECT_HANDLE handle) { unsigned int alloc; alloc = alloc_size (bucket->num); if (bucket->num + 1 > alloc) { alloc = alloc ? alloc * 2 : 1; return_val_if_fail (alloc != 0, false); bucket->elem = realloc (bucket->elem, alloc * sizeof (CK_OBJECT_HANDLE)); return_val_if_fail (bucket->elem != NULL, false); } bucket->elem[bucket->num++] = handle; return true; } static void index_hash (p11_index *index, index_object *obj) { unsigned int hash; int i; for (i = 0; !p11_attrs_terminator (obj->attrs + i); i++) { if (is_indexable (index, obj->attrs[i].type)) { hash = p11_attr_hash (obj->attrs + i); bucket_insert (index->buckets + (hash % NUM_BUCKETS), obj->handle); } } } static void merge_attrs (CK_ATTRIBUTE *output, CK_ULONG *noutput, CK_ATTRIBUTE *merge, CK_ULONG nmerge, p11_array *to_free) { CK_ULONG i; for (i = 0; i < nmerge; i++) { /* Already have this attribute? */ if (p11_attrs_findn (output, *noutput, merge[i].type)) { p11_array_push (to_free, merge[i].pValue); } else { memcpy (output + *noutput, merge + i, sizeof (CK_ATTRIBUTE)); (*noutput)++; } } /* Freeing the array itself */ p11_array_push (to_free, merge); } static CK_RV index_build (p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE **attrs, CK_ATTRIBUTE *merge) { CK_ATTRIBUTE *extra = NULL; CK_ATTRIBUTE *built; p11_array *stack = NULL; CK_ULONG count; CK_ULONG nattrs; CK_ULONG nmerge; CK_ULONG nextra; CK_RV rv; int i; rv = index->build (index->data, index, *attrs, merge, &extra); if (rv != CKR_OK) return rv; /* Short circuit when nothing to merge */ if (*attrs == NULL && extra == NULL) { built = merge; stack = NULL; } else { stack = p11_array_new (NULL); nattrs = p11_attrs_count (*attrs); nmerge = p11_attrs_count (merge); nextra = p11_attrs_count (extra); /* Make a shallow copy of the combined attributes for validation */ built = calloc (nmerge + nattrs + nextra + 1, sizeof (CK_ATTRIBUTE)); return_val_if_fail (built != NULL, CKR_GENERAL_ERROR); count = nmerge; memcpy (built, merge, sizeof (CK_ATTRIBUTE) * nmerge); p11_array_push (stack, merge); merge_attrs (built, &count, *attrs, nattrs, stack); merge_attrs (built, &count, extra, nextra, stack); /* The terminator attribute */ built[count].type = CKA_INVALID; assert (p11_attrs_terminator (built + count)); } rv = index->store (index->data, index, handle, &built); if (rv == CKR_OK) { for (i = 0; stack && i < stack->num; i++) free (stack->elem[i]); *attrs = built; } else { p11_attrs_free (extra); free (built); } p11_array_free (stack); return rv; } static void call_notify (p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs) { assert (index->notify); /* When attrs is NULL, means this is a modify */ if (attrs == NULL) { attrs = p11_index_lookup (index, handle); if (attrs == NULL) return; /* Otherwise a remove operation, handle not valid anymore */ } else { handle = 0; } index->notifying = true; index->notify (index->data, index, handle, attrs); index->notifying = false; } static void index_notify (p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *removed) { index_object *obj; if (!index->notify || index->notifying) { p11_attrs_free (removed); } else if (!index->changes) { call_notify (index, handle, removed); p11_attrs_free (removed); } else { obj = calloc (1, sizeof (index_object)); return_if_fail (obj != NULL); obj->handle = handle; obj->attrs = removed; if (!p11_dict_set (index->changes, &obj->handle, obj)) return_if_reached (); } } void p11_index_load (p11_index *index) { return_if_fail (index != NULL); if (index->changes) return; index->changes = p11_dict_new (p11_dict_ulongptr_hash, p11_dict_ulongptr_equal, NULL, free_object); return_if_fail (index->changes != NULL); } void p11_index_finish (p11_index *index) { p11_dict *changes; index_object *obj; p11_dictiter iter; return_if_fail (index != NULL); if (!index->changes) return; changes = index->changes; index->changes = NULL; p11_dict_iterate (changes, &iter); while (p11_dict_next (&iter, NULL, (void **)&obj)) { index_notify (index, obj->handle, obj->attrs); obj->attrs = NULL; } p11_dict_free (changes); } bool p11_index_loading (p11_index *index) { return_val_if_fail (index != NULL, false); return index->changes ? true : false; } CK_RV p11_index_take (p11_index *index, CK_ATTRIBUTE *attrs, CK_OBJECT_HANDLE *handle) { index_object *obj; CK_RV rv; return_val_if_fail (index != NULL, CKR_GENERAL_ERROR); return_val_if_fail (attrs != NULL, CKR_GENERAL_ERROR); obj = calloc (1, sizeof (index_object)); return_val_if_fail (obj != NULL, CKR_HOST_MEMORY); obj->handle = p11_module_next_id (); rv = index_build (index, obj->handle, &obj->attrs, attrs); if (rv != CKR_OK) { p11_attrs_free (attrs); free (obj); return rv; } return_val_if_fail (obj->attrs != NULL, CKR_GENERAL_ERROR); if (!p11_dict_set (index->objects, &obj->handle, obj)) return_val_if_reached (CKR_HOST_MEMORY); index_hash (index, obj); if (handle) *handle = obj->handle; index_notify (index, obj->handle, NULL); return CKR_OK; } CK_RV p11_index_add (p11_index *index, CK_ATTRIBUTE *attrs, CK_ULONG count, CK_OBJECT_HANDLE *handle) { CK_ATTRIBUTE *copy; return_val_if_fail (index != NULL, CKR_GENERAL_ERROR); return_val_if_fail (attrs == NULL || count > 0, CKR_ARGUMENTS_BAD); copy = p11_attrs_buildn (NULL, attrs, count); return_val_if_fail (copy != NULL, CKR_HOST_MEMORY); return p11_index_take (index, copy, handle); } CK_RV p11_index_update (p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *update) { index_object *obj; CK_RV rv; return_val_if_fail (index != NULL, CKR_GENERAL_ERROR); return_val_if_fail (update != NULL, CKR_GENERAL_ERROR); obj = p11_dict_get (index->objects, &handle); if (obj == NULL) { p11_attrs_free (update); return CKR_OBJECT_HANDLE_INVALID; } rv = index_build (index, obj->handle, &obj->attrs, update); if (rv != CKR_OK) { p11_attrs_free (update); return rv; } index_hash (index, obj); index_notify (index, obj->handle, NULL); return CKR_OK; } CK_RV p11_index_set (p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs, CK_ULONG count) { CK_ATTRIBUTE *update; index_object *obj; return_val_if_fail (index != NULL, CKR_GENERAL_ERROR); obj = p11_dict_get (index->objects, &handle); if (obj == NULL) return CKR_OBJECT_HANDLE_INVALID; update = p11_attrs_buildn (NULL, attrs, count); return_val_if_fail (update != NULL, CKR_HOST_MEMORY); return p11_index_update (index, handle, update); } CK_RV p11_index_remove (p11_index *index, CK_OBJECT_HANDLE handle) { index_object *obj; CK_RV rv; return_val_if_fail (index != NULL, CKR_GENERAL_ERROR); if (!p11_dict_steal (index->objects, &handle, NULL, (void **)&obj)) return CKR_OBJECT_HANDLE_INVALID; rv = (index->remove) (index->data, index, obj->attrs); /* If the writer failed the remove, then add it back */ if (rv != CKR_OK) { if (!p11_dict_set (index->objects, &obj->handle, obj)) return_val_if_reached (CKR_HOST_MEMORY); return rv; } /* This takes ownership of the attributes */ index_notify (index, handle, obj->attrs); obj->attrs = NULL; free_object (obj); return CKR_OK; } static CK_RV index_replacev (p11_index *index, CK_OBJECT_HANDLE *handles, CK_ATTRIBUTE_TYPE key, CK_ATTRIBUTE **replace, CK_ULONG replacen) { index_object *obj; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *attr; bool handled = false; CK_RV rv; int i, j; for (i = 0; handles && handles[i] != 0; i++) { obj = p11_dict_get (index->objects, handles + i); if (obj == NULL) continue; handled = false; attr = p11_attrs_find (obj->attrs, key); /* The match doesn't have the key, so remove it */ if (attr != NULL) { for (j = 0; j < replacen; j++) { if (!replace[j]) continue; if (p11_attrs_matchn (replace[j], attr, 1)) { attrs = NULL; rv = index_build (index, obj->handle, &attrs, replace[j]); if (rv != CKR_OK) return rv; p11_attrs_free (obj->attrs); obj->attrs = attrs; replace[j] = NULL; handled = true; index_hash (index, obj); index_notify (index, obj->handle, NULL); break; } } } if (!handled) { rv = p11_index_remove (index, handles[i]); if (rv != CKR_OK) return rv; } } for (j = 0; j < replacen; j++) { if (!replace[j]) continue; attrs = replace[j]; replace[j] = NULL; rv = p11_index_take (index, attrs, NULL); if (rv != CKR_OK) return rv; } return CKR_OK; } CK_RV p11_index_replace (p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *replace) { CK_OBJECT_HANDLE handles[] = { handle, 0 }; return_val_if_fail (index != NULL, CKR_GENERAL_ERROR); return index_replacev (index, handles, CKA_INVALID, &replace, replace ? 1 : 0); } CK_RV p11_index_replace_all (p11_index *index, CK_ATTRIBUTE *match, CK_ATTRIBUTE_TYPE key, p11_array *replace) { CK_OBJECT_HANDLE *handles; CK_RV rv; int i; return_val_if_fail (index != NULL, CKR_GENERAL_ERROR); handles = p11_index_find_all (index, match, -1); rv = index_replacev (index, handles, key, replace ? (CK_ATTRIBUTE **)replace->elem : NULL, replace ? replace->num : 0); if (rv == CKR_OK) { if (replace) p11_array_clear (replace); } else { for (i = 0; replace && i < replace->num; i++) { if (!replace->elem[i]) { p11_array_remove (replace, i); i--; } } } free (handles); return rv; } CK_ATTRIBUTE * p11_index_lookup (p11_index *index, CK_OBJECT_HANDLE handle) { index_object *obj; return_val_if_fail (index != NULL, NULL); if (handle == CK_INVALID_HANDLE) return NULL; obj = p11_dict_get (index->objects, &handle); return obj ? obj->attrs : NULL; } typedef bool (* index_sink) (p11_index *index, index_object *obj, CK_ATTRIBUTE *match, CK_ULONG count, void *data); static void index_select (p11_index *index, CK_ATTRIBUTE *match, CK_ULONG count, index_sink sink, void *data) { index_bucket *selected[MAX_SELECT]; CK_OBJECT_HANDLE handle; index_object *obj; unsigned int hash; p11_dictiter iter; CK_ULONG n; int num, at; int i, j; /* First look for any matching buckets */ for (n = 0, num = 0; n < count && num < MAX_SELECT; n++) { if (is_indexable (index, match[n].type)) { hash = p11_attr_hash (match + n); selected[num] = index->buckets + (hash % NUM_BUCKETS); /* If any index is empty, then obviously no match */ if (!selected[num]->num) return; num++; } } /* Fall back on selecting all the items, if no index */ if (num == 0) { p11_dict_iterate (index->objects, &iter); while (p11_dict_next (&iter, NULL, (void *)&obj)) { if (!sink (index, obj, match, count, data)) return; } return; } for (i = 0; i < selected[0]->num; i++) { /* A candidate match from first bucket */ handle = selected[0]->elem[i]; /* Check if the candidate is in other buckets */ for (j = 1; j < num; j++) { assert (selected[j]->elem); /* checked above */ at = binary_search (selected[j]->elem, 0, selected[j]->num, handle); if (at >= selected[j]->num || selected[j]->elem[at] != handle) { handle = 0; break; } } /* Matched all the buckets, now actually match attrs */ if (handle != 0) { obj = p11_dict_get (index->objects, &handle); if (obj != NULL) { if (!sink (index, obj, match, count, data)) return; } } } } static bool sink_one_match (p11_index *index, index_object *obj, CK_ATTRIBUTE *match, CK_ULONG count, void *data) { CK_OBJECT_HANDLE *result = data; if (p11_attrs_matchn (obj->attrs, match, count)) { *result = obj->handle; return false; } return true; } CK_OBJECT_HANDLE p11_index_find (p11_index *index, CK_ATTRIBUTE *match, int count) { CK_OBJECT_HANDLE handle = 0UL; return_val_if_fail (index != NULL, 0UL); if (count < 0) count = p11_attrs_count (match); index_select (index, match, count, sink_one_match, &handle); return handle; } static bool sink_if_match (p11_index *index, index_object *obj, CK_ATTRIBUTE *match, CK_ULONG count, void *data) { index_bucket *handles = data; if (p11_attrs_matchn (obj->attrs, match, count)) bucket_push (handles, obj->handle); return true; } CK_OBJECT_HANDLE * p11_index_find_all (p11_index *index, CK_ATTRIBUTE *match, int count) { index_bucket handles = { NULL, 0 }; return_val_if_fail (index != NULL, NULL); if (count < 0) count = p11_attrs_count (match); index_select (index, match, count, sink_if_match, &handles); /* Null terminate */ bucket_push (&handles, 0UL); return handles.elem; } static bool sink_any (p11_index *index, index_object *obj, CK_ATTRIBUTE *match, CK_ULONG count, void *data) { index_bucket *handles = data; bucket_push (handles, obj->handle); return true; } CK_OBJECT_HANDLE * p11_index_snapshot (p11_index *index, p11_index *base, CK_ATTRIBUTE *attrs, CK_ULONG count) { index_bucket handles = { NULL, 0 }; return_val_if_fail (index != NULL, NULL); if (count < (CK_ULONG)0UL) count = p11_attrs_count (attrs); index_select (index, attrs, count, sink_any, &handles); if (base) index_select (base, attrs, count, sink_any, &handles); /* Null terminate */ bucket_push (&handles, 0UL); return handles.elem; } p11-kit-0.20.2/trust/parser.h0000664000175000017500000000651212226763526012551 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "asn1.h" #include "array.h" #include "compat.h" #include "dict.h" #ifndef P11_PARSER_H_ #define P11_PARSER_H_ enum { P11_PARSE_FLAG_NONE = 0, P11_PARSE_FLAG_ANCHOR = 1 << 0, P11_PARSE_FLAG_BLACKLIST = 1 << 1, }; enum { P11_PARSE_FAILURE = -1, P11_PARSE_UNRECOGNIZED = 0, P11_PARSE_SUCCESS = 1, }; typedef struct _p11_parser p11_parser; p11_parser * p11_parser_new (p11_asn1_cache *asn1_cache); void p11_parser_free (p11_parser *parser); int p11_parse_memory (p11_parser *parser, const char *filename, int flags, const unsigned char *data, size_t length); int p11_parse_file (p11_parser *parser, const char *filename, struct stat *sb, int flags); p11_array * p11_parser_parsed (p11_parser *parser); void p11_parser_formats (p11_parser *parser, ...) GNUC_NULL_TERMINATED; int p11_parser_format_persist (p11_parser *parser, const unsigned char *data, size_t length); int p11_parser_format_pem (p11_parser *parser, const unsigned char *data, size_t length); int p11_parser_format_x509 (p11_parser *parser, const unsigned char *data, size_t length); #endif /* P11_PARSER_H_ */ p11-kit-0.20.2/trust/pkix.asn0000664000175000017500000004134112226763526012561 00000000000000 PKIX1 { } DEFINITIONS IMPLICIT TAGS ::= BEGIN -- This contains both PKIX1Implicit88 and RFC2630 ASN.1 modules. id-pkix OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) } -- ISO arc for standard certificate and CRL extensions -- authority key identifier OID and syntax AuthorityKeyIdentifier ::= SEQUENCE { keyIdentifier [0] KeyIdentifier OPTIONAL, authorityCertIssuer [1] GeneralNames OPTIONAL, authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL } -- authorityCertIssuer and authorityCertSerialNumber shall both -- be present or both be absgent KeyIdentifier ::= OCTET STRING -- subject key identifier OID and syntax SubjectKeyIdentifier ::= KeyIdentifier -- key usage extension OID and syntax KeyUsage ::= BIT STRING -- Directory string type -- DirectoryString ::= CHOICE { teletexString TeletexString (SIZE (1..MAX)), printableString PrintableString (SIZE (1..MAX)), universalString UniversalString (SIZE (1..MAX)), utf8String UTF8String (SIZE (1..MAX)), bmpString BMPString (SIZE(1..MAX)), -- IA5String is added here to handle old UID encoded as ia5String -- -- See tests/userid/ for more information. It shouldn't be here, -- -- so if it causes problems, considering dropping it. -- ia5String IA5String (SIZE(1..MAX)) } SubjectAltName ::= GeneralNames GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName GeneralName ::= CHOICE { otherName [0] AnotherName, rfc822Name [1] IA5String, dNSName [2] IA5String, x400Address [3] ANY, -- Changed to work with the libtasn1 parser. directoryName [4] EXPLICIT RDNSequence, --Name, ediPartyName [5] ANY, --EDIPartyName replaced by ANY to save memory uniformResourceIdentifier [6] IA5String, iPAddress [7] OCTET STRING, registeredID [8] OBJECT IDENTIFIER } -- AnotherName replaces OTHER-NAME ::= TYPE-IDENTIFIER, as -- TYPE-IDENTIFIER is not supported in the '88 ASN.1 syntax AnotherName ::= SEQUENCE { type-id OBJECT IDENTIFIER, value [0] EXPLICIT ANY DEFINED BY type-id } -- issuer alternative name extension OID and syntax IssuerAltName ::= GeneralNames -- basic constraints extension OID and syntax BasicConstraints ::= SEQUENCE { cA BOOLEAN DEFAULT FALSE, pathLenConstraint INTEGER (0..MAX) OPTIONAL } -- CRL distribution points extension OID and syntax CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint DistributionPoint ::= SEQUENCE { distributionPoint [0] EXPLICIT DistributionPointName OPTIONAL, reasons [1] ReasonFlags OPTIONAL, cRLIssuer [2] GeneralNames OPTIONAL } DistributionPointName ::= CHOICE { fullName [0] GeneralNames, nameRelativeToCRLIssuer [1] RelativeDistinguishedName } ReasonFlags ::= BIT STRING -- extended key usage extension OID and syntax ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId KeyPurposeId ::= OBJECT IDENTIFIER -- CRL number extension OID and syntax CRLNumber ::= INTEGER (0..MAX) -- certificate issuer CRL entry extension OID and syntax CertificateIssuer ::= GeneralNames -- -------------------------------------- -- EXPLICIT -- -------------------------------------- -- UNIVERSAL Types defined in '93 and '98 ASN.1 -- but required by this specification NumericString ::= [UNIVERSAL 18] IMPLICIT OCTET STRING IA5String ::= [UNIVERSAL 22] IMPLICIT OCTET STRING TeletexString ::= [UNIVERSAL 20] IMPLICIT OCTET STRING PrintableString ::= [UNIVERSAL 19] IMPLICIT OCTET STRING UniversalString ::= [UNIVERSAL 28] IMPLICIT OCTET STRING -- UniversalString is defined in ASN.1:1993 BMPString ::= [UNIVERSAL 30] IMPLICIT OCTET STRING -- BMPString is the subtype of UniversalString and models -- the Basic Multilingual Plane of ISO/IEC/ITU 10646-1 UTF8String ::= [UNIVERSAL 12] IMPLICIT OCTET STRING -- The content of this type conforms to RFC 2279. -- attribute data types -- Attribute ::= SEQUENCE { type AttributeType, values SET OF AttributeValue -- at least one value is required -- } AttributeType ::= OBJECT IDENTIFIER AttributeValue ::= ANY DEFINED BY type AttributeTypeAndValue ::= SEQUENCE { type AttributeType, value AttributeValue } -- suggested naming attributes: Definition of the following -- information object set may be augmented to meet local -- requirements. Note that deleting members of the set may -- prevent interoperability with conforming implementations. -- presented in pairs: the AttributeType followed by the -- type definition for the corresponding AttributeValue -- Arc for standard naming attributes id-at OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 4} -- Attributes of type NameDirectoryString -- gnutls: Note that the Object ID (id-at*) is being set just before the -- actual definition. This is done in order for asn1_find_structure_from_oid -- to work (locate structure from OID). -- Maybe this is inefficient and memory consuming. Should we replace with -- a table that maps OIDs to structures? PostalAddress ::= SEQUENCE OF DirectoryString -- Legacy attributes emailAddress AttributeType ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 1 } Pkcs9email ::= IA5String (SIZE (1..ub-emailaddress-length)) -- naming data types -- Name ::= CHOICE { -- only one possibility for now -- rdnSequence RDNSequence } RDNSequence ::= SEQUENCE OF RelativeDistinguishedName DistinguishedName ::= RDNSequence RelativeDistinguishedName ::= SET SIZE (1 .. MAX) OF AttributeTypeAndValue -- -------------------------------------------------------- -- certificate and CRL specific structures begin here -- -------------------------------------------------------- Certificate ::= SEQUENCE { tbsCertificate TBSCertificate, signatureAlgorithm AlgorithmIdentifier, signature BIT STRING } TBSCertificate ::= SEQUENCE { version [0] EXPLICIT Version DEFAULT v1, serialNumber CertificateSerialNumber, signature AlgorithmIdentifier, issuer Name, validity Validity, subject Name, subjectPublicKeyInfo SubjectPublicKeyInfo, issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL, -- If present, version shall be v2 or v3 subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL, -- If present, version shall be v2 or v3 extensions [3] EXPLICIT Extensions OPTIONAL -- If present, version shall be v3 -- } Version ::= INTEGER { v1(0), v2(1), v3(2) } CertificateSerialNumber ::= INTEGER Validity ::= SEQUENCE { notBefore Time, notAfter Time } Time ::= CHOICE { utcTime UTCTime, generalTime GeneralizedTime } UniqueIdentifier ::= BIT STRING SubjectPublicKeyInfo ::= SEQUENCE { algorithm AlgorithmIdentifier, subjectPublicKey BIT STRING } Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension Extension ::= SEQUENCE { extnID OBJECT IDENTIFIER, critical BOOLEAN DEFAULT FALSE, extnValue OCTET STRING } -- ------------------------------------------ -- CRL structures -- ------------------------------------------ CertificateList ::= SEQUENCE { tbsCertList TBSCertList, signatureAlgorithm AlgorithmIdentifier, signature BIT STRING } TBSCertList ::= SEQUENCE { version Version OPTIONAL, -- if present, shall be v2 signature AlgorithmIdentifier, issuer Name, thisUpdate Time, nextUpdate Time OPTIONAL, revokedCertificates SEQUENCE OF SEQUENCE { userCertificate CertificateSerialNumber, revocationDate Time, crlEntryExtensions Extensions OPTIONAL -- if present, shall be v2 } OPTIONAL, crlExtensions [0] EXPLICIT Extensions OPTIONAL -- if present, shall be v2 -- } -- Version, Time, CertificateSerialNumber, and Extensions were -- defined earlier for use in the certificate structure AlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters ANY DEFINED BY algorithm OPTIONAL } -- contains a value of the type -- registered for use with the -- algorithm object identifier value -- Algorithm OIDs and parameter structures Dss-Sig-Value ::= SEQUENCE { r INTEGER, s INTEGER } DomainParameters ::= SEQUENCE { p INTEGER, -- odd prime, p=jq +1 g INTEGER, -- generator, g q INTEGER, -- factor of p-1 j INTEGER OPTIONAL, -- subgroup factor, j>= 2 validationParms ValidationParms OPTIONAL } ValidationParms ::= SEQUENCE { seed BIT STRING, pgenCounter INTEGER } Dss-Parms ::= SEQUENCE { p INTEGER, q INTEGER, g INTEGER } -- x400 address syntax starts here -- OR Names CountryName ::= [APPLICATION 1] CHOICE { x121-dcc-code NumericString (SIZE (ub-country-name-numeric-length)), iso-3166-alpha2-code PrintableString (SIZE (ub-country-name-alpha-length)) } OrganizationName ::= PrintableString (SIZE (1..ub-organization-name-length)) -- see also teletex-organization-name NumericUserIdentifier ::= NumericString (SIZE (1..ub-numeric-user-id-length)) -- see also teletex-personal-name OrganizationalUnitNames ::= SEQUENCE SIZE (1..ub-organizational-units) OF OrganizationalUnitName -- see also teletex-organizational-unit-names OrganizationalUnitName ::= PrintableString (SIZE (1..ub-organizational-unit-name-length)) -- Extension types and attribute values -- CommonName ::= PrintableString -- END of PKIX1Implicit88 -- BEGIN of RFC2630 -- Cryptographic Message Syntax pkcs-7-ContentInfo ::= SEQUENCE { contentType pkcs-7-ContentType, content [0] EXPLICIT ANY DEFINED BY contentType } pkcs-7-DigestInfo ::= SEQUENCE { digestAlgorithm pkcs-7-DigestAlgorithmIdentifier, digest pkcs-7-Digest } pkcs-7-Digest ::= OCTET STRING pkcs-7-ContentType ::= OBJECT IDENTIFIER pkcs-7-SignedData ::= SEQUENCE { version pkcs-7-CMSVersion, digestAlgorithms pkcs-7-DigestAlgorithmIdentifiers, encapContentInfo pkcs-7-EncapsulatedContentInfo, certificates [0] IMPLICIT pkcs-7-CertificateSet OPTIONAL, crls [1] IMPLICIT pkcs-7-CertificateRevocationLists OPTIONAL, signerInfos pkcs-7-SignerInfos } pkcs-7-CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4) } pkcs-7-DigestAlgorithmIdentifiers ::= SET OF pkcs-7-DigestAlgorithmIdentifier pkcs-7-DigestAlgorithmIdentifier ::= AlgorithmIdentifier pkcs-7-EncapsulatedContentInfo ::= SEQUENCE { eContentType pkcs-7-ContentType, eContent [0] EXPLICIT OCTET STRING OPTIONAL } -- We don't use CertificateList here since we only want -- to read the raw data. pkcs-7-CertificateRevocationLists ::= SET OF ANY pkcs-7-CertificateChoices ::= CHOICE { -- Although the paper uses Certificate type, we -- don't use it since, we don't need to parse it. -- We only need to read and store it. certificate ANY } pkcs-7-CertificateSet ::= SET OF pkcs-7-CertificateChoices pkcs-7-SignerInfos ::= SET OF ANY -- this is not correct but we don't use it -- anyway -- BEGIN of RFC2986 -- Certificate requests pkcs-10-CertificationRequestInfo ::= SEQUENCE { version INTEGER { v1(0) }, subject Name, subjectPKInfo SubjectPublicKeyInfo, attributes [0] Attributes } Attributes ::= SET OF Attribute pkcs-10-CertificationRequest ::= SEQUENCE { certificationRequestInfo pkcs-10-CertificationRequestInfo, signatureAlgorithm AlgorithmIdentifier, signature BIT STRING } -- stuff from PKCS#9 pkcs-9-at-challengePassword OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 7} pkcs-9-challengePassword ::= CHOICE { printableString PrintableString, utf8String UTF8String } pkcs-9-localKeyId ::= OCTET STRING -- PKCS #8 stuff -- Private-key information syntax pkcs-8-PrivateKeyInfo ::= SEQUENCE { version pkcs-8-Version, privateKeyAlgorithm AlgorithmIdentifier, privateKey pkcs-8-PrivateKey, attributes [0] Attributes OPTIONAL } pkcs-8-Version ::= INTEGER {v1(0)} pkcs-8-PrivateKey ::= OCTET STRING pkcs-8-Attributes ::= SET OF Attribute -- Encrypted private-key information syntax pkcs-8-EncryptedPrivateKeyInfo ::= SEQUENCE { encryptionAlgorithm AlgorithmIdentifier, encryptedData pkcs-8-EncryptedData } pkcs-8-EncryptedData ::= OCTET STRING -- PKCS #5 stuff pkcs-5-des-EDE3-CBC-params ::= OCTET STRING (SIZE(8)) pkcs-5-aes128-CBC-params ::= OCTET STRING (SIZE(16)) pkcs-5-aes192-CBC-params ::= OCTET STRING (SIZE(16)) pkcs-5-aes256-CBC-params ::= OCTET STRING (SIZE(16)) pkcs-5-PBES2-params ::= SEQUENCE { keyDerivationFunc AlgorithmIdentifier, encryptionScheme AlgorithmIdentifier } -- PBKDF2 -- pkcs-5-algid-hmacWithSHA1 AlgorithmIdentifier ::= -- {algorithm pkcs-5-id-hmacWithSHA1, parameters NULL : NULL} pkcs-5-PBKDF2-params ::= SEQUENCE { salt CHOICE { specified OCTET STRING, otherSource AlgorithmIdentifier }, iterationCount INTEGER (1..MAX), keyLength INTEGER (1..MAX) OPTIONAL, prf AlgorithmIdentifier OPTIONAL -- DEFAULT pkcs-5-id-hmacWithSHA1 } -- PKCS #12 stuff pkcs-12-PFX ::= SEQUENCE { version INTEGER {v3(3)}, authSafe pkcs-7-ContentInfo, macData pkcs-12-MacData OPTIONAL } pkcs-12-PbeParams ::= SEQUENCE { salt OCTET STRING, iterations INTEGER } pkcs-12-MacData ::= SEQUENCE { mac pkcs-7-DigestInfo, macSalt OCTET STRING, iterations INTEGER DEFAULT 1 -- Note: The default is for historical reasons and its use is -- deprecated. A higher value, like 1024 is recommended. } pkcs-12-AuthenticatedSafe ::= SEQUENCE OF pkcs-7-ContentInfo -- Data if unencrypted -- EncryptedData if password-encrypted -- EnvelopedData if public key-encrypted pkcs-12-SafeContents ::= SEQUENCE OF pkcs-12-SafeBag pkcs-12-SafeBag ::= SEQUENCE { bagId OBJECT IDENTIFIER, bagValue [0] EXPLICIT ANY DEFINED BY badId, bagAttributes SET OF pkcs-12-PKCS12Attribute OPTIONAL } -- Bag types pkcs-12-KeyBag ::= pkcs-8-PrivateKeyInfo -- Shrouded KeyBag pkcs-12-PKCS8ShroudedKeyBag ::= pkcs-8-EncryptedPrivateKeyInfo -- CertBag pkcs-12-CertBag ::= SEQUENCE { certId OBJECT IDENTIFIER, certValue [0] EXPLICIT ANY DEFINED BY certId } -- x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-certTypes 1}} -- DER-encoded X.509 certificate stored in OCTET STRING pkcs-12-CRLBag ::= SEQUENCE { crlId OBJECT IDENTIFIER, crlValue [0] EXPLICIT ANY DEFINED BY crlId } pkcs-12-SecretBag ::= SEQUENCE { secretTypeId OBJECT IDENTIFIER, secretValue [0] EXPLICIT ANY DEFINED BY secretTypeId } -- x509CRL BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {pkcs-9-crlTypes 1}} -- DER-encoded X.509 CRL stored in OCTET STRING pkcs-12-PKCS12Attribute ::= Attribute -- PKCS #7 stuff (needed in PKCS 12) pkcs-7-Data ::= OCTET STRING pkcs-7-EncryptedData ::= SEQUENCE { version pkcs-7-CMSVersion, encryptedContentInfo pkcs-7-EncryptedContentInfo, unprotectedAttrs [1] IMPLICIT pkcs-7-UnprotectedAttributes OPTIONAL } pkcs-7-EncryptedContentInfo ::= SEQUENCE { contentType pkcs-7-ContentType, contentEncryptionAlgorithm pkcs-7-ContentEncryptionAlgorithmIdentifier, encryptedContent [0] IMPLICIT pkcs-7-EncryptedContent OPTIONAL } pkcs-7-ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier pkcs-7-EncryptedContent ::= OCTET STRING pkcs-7-UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute -- rfc3820 ProxyCertInfo ::= SEQUENCE { pCPathLenConstraint INTEGER (0..MAX) OPTIONAL, proxyPolicy ProxyPolicy } ProxyPolicy ::= SEQUENCE { policyLanguage OBJECT IDENTIFIER, policy OCTET STRING OPTIONAL } END p11-kit-0.20.2/trust/basic.asn.h0000664000175000017500000000041112226763526013106 00000000000000#if HAVE_CONFIG_H # include "config.h" #endif #include const ASN1_ARRAY_TYPE basic_asn1_tab[] = { { "BASIC", 536872976, NULL }, { NULL, 1073741836, NULL }, { "Any", 1073741837, NULL }, { "ObjectIdentifier", 12, NULL }, { NULL, 0, NULL } }; p11-kit-0.20.2/trust/trust.c0000664000175000017500000000453412264723070012423 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "anchor.h" #include "extract.h" #include "list.h" #include "buffer.h" #include "compat.h" #include "debug.h" #include "message.h" #include "path.h" #include "tool.h" #include #include #include #include #include #include #include static const p11_tool_command commands[] = { { "list", p11_trust_list, "List trust or certificates" }, { "extract", p11_trust_extract, "Extract certificates and trust" }, { "extract-compat", p11_trust_extract_compat, "Extract trust compatibility bundles" }, { "anchor", p11_trust_anchor, "Add, remove, change trust anchors" }, { 0, } }; int main (int argc, char *argv[]) { return p11_tool_main (argc, argv, commands); } p11-kit-0.20.2/trust/base64.c0000664000175000017500000001563012226763526012335 00000000000000/* * Copyright (c) 1996, 1998 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * Portions Copyright (c) 1995 by International Business Machines, Inc. * * International Business Machines, Inc. (hereinafter called IBM) grants * permission under its copyrights to use, copy, modify, and distribute this * Software with or without fee, provided that the above copyright notice and * all paragraphs of this notice appear in all copies, and that the name of IBM * not be used in connection with the marketing of any product incorporating * the Software or modifications thereof, without specific, written prior * permission. * * To the extent it has a right to do so, IBM grants an immunity from suit * under its patents, if any, for the use, sale or manufacture of products to * the extent that such products are used for performing Domain Name System * dynamic updates in TCP/IP networks by means of the Software. No immunity is * granted for any product per se or for any other function of any product. * * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #include "config.h" #include "base64.h" #include #include #include #include static const char Base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char Pad64 = '='; /* skips all whitespace anywhere. converts characters, four at a time, starting at (or after) src from base - 64 numbers into three 8 bit bytes in the target area. it returns the number of data bytes stored at the target, or -1 on error. */ int p11_b64_pton (const char *src, size_t length, unsigned char *target, size_t targsize) { int tarindex, state, ch; char *pos; const char *end; state = 0; tarindex = 0; end = src + length; /* We can't rely on the null terminator */ #define next_char(src, end) \ (((src) == (end)) ? '\0': *(src)++) while ((ch = next_char (src, end)) != '\0') { if (isspace ((unsigned char) ch)) /* Skip whitespace anywhere. */ continue; if (ch == Pad64) break; pos = strchr (Base64, ch); if (pos == 0) /* A non-base64 character. */ return (-1); switch (state) { case 0: if (target) { if ((size_t)tarindex >= targsize) return (-1); target[tarindex] = (pos - Base64) << 2; } state = 1; break; case 1: if (target) { if ((size_t) tarindex + 1 >= targsize) return (-1); target[tarindex] |= (pos - Base64) >> 4; target[tarindex + 1] = ((pos - Base64) & 0x0f) << 4; } tarindex++; state = 2; break; case 2: if (target) { if ((size_t) tarindex + 1 >= targsize) return (-1); target[tarindex] |= (pos - Base64) >> 2; target[tarindex + 1] = ((pos - Base64) & 0x03) << 6; } tarindex++; state = 3; break; case 3: if (target) { if ((size_t) tarindex >= targsize) return (-1); target[tarindex] |= (pos - Base64); } tarindex++; state = 0; break; default: abort(); } } /* * We are done decoding Base-64 chars. Let's see if we ended * on a byte boundary, and/or with erroneous trailing characters. */ if (ch == Pad64) { /* We got a pad char. */ ch = next_char (src, end); /* Skip it, get next. */ switch (state) { case 0: /* Invalid = in first position */ case 1: /* Invalid = in second position */ return (-1); case 2: /* Valid, means one byte of info */ /* Skip any number of spaces. */ for ((void) NULL; ch != '\0'; ch = next_char (src, end)) if (!isspace((unsigned char) ch)) break; /* Make sure there is another trailing = sign. */ if (ch != Pad64) return (-1); ch = next_char (src, end); /* Skip the = */ /* Fall through to "single trailing =" case. */ /* FALLTHROUGH */ case 3: /* Valid, means two bytes of info */ /* * We know this char is an =. Is there anything but * whitespace after it? */ for ((void)NULL; src != end; ch = next_char (src, end)) if (!isspace((unsigned char) ch)) return (-1); /* * Now make sure for cases 2 and 3 that the "extra" * bits that slopped past the last full byte were * zeros. If we don't check them, they become a * subliminal channel. */ if (target && target[tarindex] != 0) return (-1); } } else { /* * We ended by seeing the end of the string. Make sure we * have no partial bytes lying around. */ if (state != 0) return (-1); } return (tarindex); } int p11_b64_ntop (const unsigned char *src, size_t srclength, char *target, size_t targsize, int breakl) { size_t len = 0; unsigned char input[3]; unsigned char output[4]; size_t i; while (srclength > 0) { if (2 < srclength) { input[0] = *src++; input[1] = *src++; input[2] = *src++; srclength -= 3; output[0] = input[0] >> 2; output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); output[3] = input[2] & 0x3f; } else if (0 != srclength) { /* Get what's left. */ input[0] = input[1] = input[2] = '\0'; for (i = 0; i < srclength; i++) input[i] = *src++; output[0] = input[0] >> 2; output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); if (srclength == 1) output[2] = 255; else output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); output[3] = 255; srclength = 0; } for (i = 0; i < 4; i++) { if (breakl && len % (breakl + 1) == 0) { assert (len + 1 < targsize); target[len++] = '\n'; } assert(output[i] == 255 || output[i] < 64); assert (len + 1 < targsize); if (output[i] == 255) target[len++] = Pad64; else target[len++] = Base64[output[i]]; } } assert (len < targsize); target[len] = '\0'; /* Returned value doesn't count \0. */ return len; } p11-kit-0.20.2/trust/oid.h0000664000175000017500000001662412226763526012035 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_OIDS_H_ #define P11_OIDS_H_ #include "compat.h" bool p11_oid_simple (const unsigned char *oid, int len); unsigned int p11_oid_hash (const void *oid); bool p11_oid_equal (const void *oid_one, const void *oid_two); int p11_oid_length (const unsigned char *oid); /* * 2.5.4.3: CN or commonName */ static const unsigned char P11_OID_CN[] = { 0x06, 0x03, 0x55, 0x04, 0x03, }; /* * 2.5.4.10: O or organization */ static const unsigned char P11_OID_O[] = { 0x06, 0x03, 0x55, 0x04, 0x0a, }; /* * 2.5.4.11: OU or organizationalUnit */ static const unsigned char P11_OID_OU[] = { 0x06, 0x03, 0x55, 0x04, 0x0b, }; /* * Our support of certificate extensions and so on is not limited to what is * listed here. This is simply the OIDs used by the parsing code that generates * backwards compatible PKCS#11 objects for NSS and the like. */ /* * 2.5.29.14: SubjectKeyIdentifier */ static const unsigned char P11_OID_SUBJECT_KEY_IDENTIFIER[] = { 0x06, 0x03, 0x55, 0x1d, 0x0e }; static const char P11_OID_SUBJECT_KEY_IDENTIFIER_STR[] = "2.5.29.14"; /* * 2.5.29.15: KeyUsage * * Defined in RFC 5280 */ static const unsigned char P11_OID_KEY_USAGE[] = { 0x06, 0x03, 0x55, 0x1d, 0x0f }; static const char P11_OID_KEY_USAGE_STR[] = { "2.5.29.15" }; enum { P11_KU_DIGITAL_SIGNATURE = 128, P11_KU_NON_REPUDIATION = 64, P11_KU_KEY_ENCIPHERMENT = 32, P11_KU_DATA_ENCIPHERMENT = 16, P11_KU_KEY_AGREEMENT = 8, P11_KU_KEY_CERT_SIGN = 4, P11_KU_CRL_SIGN = 2, P11_KU_ENCIPHER_ONLY = 1, P11_KU_DECIPHER_ONLY = 32768, }; /* * 2.5.29.19: BasicConstraints * * Defined in RFC 5280 */ static const unsigned char P11_OID_BASIC_CONSTRAINTS[] = { 0x06, 0x03, 0x55, 0x1d, 0x13 }; static const char P11_OID_BASIC_CONSTRAINTS_STR[] = "2.5.29.19"; /* * 2.5.29.37: ExtendedKeyUsage * * Defined in RFC 5280 */ static const unsigned char P11_OID_EXTENDED_KEY_USAGE[] = { 0x06, 0x03, 0x55, 0x1d, 0x25 }; static const char P11_OID_EXTENDED_KEY_USAGE_STR[] = "2.5.29.37"; /* * 1.3.6.1.4.1.3319.6.10.1: OpenSSL reject extension * * An internally defined certificate extension. * * OpenSSL contains a list of OID extended key usages to reject. * The normal X.509 model is to only *include* the extended key * usages that are to be allowed (ie: a whitelist). It's not clear * exactly how valid and useful the reject per extended key usage * model is. * * However in order to parse openssl trust policy information and * be able to write it back out in the same way, we define a custom * certificate extension to store it. * * It is not expected (or supported) for others outside of p11-kit * to read this information at this point. * * This extension is never marked critical. It is not necessary to * respect information in this certificate extension given that the * ExtendedKeyUsage extension carries the same information as a * whitelist. */ static const unsigned char P11_OID_OPENSSL_REJECT[] = { 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x99, 0x77, 0x06, 0x0a, 0x01 }; static const char P11_OID_OPENSSL_REJECT_STR[] = "1.3.6.1.4.1.3319.6.10.1"; /* * 1.3.6.1.5.5.7.3.1: Server Auth * * Defined in RFC 5280 */ static const unsigned char P11_OID_SERVER_AUTH[] = { 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01 }; static const char P11_OID_SERVER_AUTH_STR[] = "1.3.6.1.5.5.7.3.1"; /* * 1.3.6.1.5.5.7.3.2: Client Auth * * Defined in RFC 5280 */ static const unsigned char P11_OID_CLIENT_AUTH[] = { 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02 }; static const char P11_OID_CLIENT_AUTH_STR[] = "1.3.6.1.5.5.7.3.2"; /* * 1.3.6.1.5.5.7.3.3: Code Signing * * Defined in RFC 5280 */ static const unsigned char P11_OID_CODE_SIGNING[] = { 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03 }; static const char P11_OID_CODE_SIGNING_STR[] = "1.3.6.1.5.5.7.3.3"; /* * 1.3.6.1.5.5.7.3.4: Email Protection * * Defined in RFC 5280 */ static const unsigned char P11_OID_EMAIL_PROTECTION[] = { 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04 }; static const char P11_OID_EMAIL_PROTECTION_STR[] = "1.3.6.1.5.5.7.3.4"; /* * 1.3.6.1.5.5.7.3.5: IPSec End System * * Defined in RFC 2459 */ static const unsigned char P11_OID_IPSEC_END_SYSTEM[] = { 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x05 }; static const char P11_OID_IPSEC_END_SYSTEM_STR[] = "1.3.6.1.5.5.7.3.5"; /* * 1.3.6.1.5.5.7.3.6: IPSec Tunnel * * Defined in RFC 2459 */ static const unsigned char P11_OID_IPSEC_TUNNEL[] = { 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x06 }; static const char P11_OID_IPSEC_TUNNEL_STR[] = "1.3.6.1.5.5.7.3.6"; /* * 1.3.6.1.5.5.7.3.7: IPSec User * * Defined in RFC 2459 */ static const unsigned char P11_OID_IPSEC_USER[] = { 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x07 }; static const char P11_OID_IPSEC_USER_STR[] = "1.3.6.1.5.5.7.3.7"; /* * 1.3.6.1.5.5.7.3.8: Time Stamping * * Defined in RFC 2459 */ static const unsigned char P11_OID_TIME_STAMPING[] = { 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08 }; static const char P11_OID_TIME_STAMPING_STR[] = "1.3.6.1.5.5.7.3.8"; /* * 1.3.6.1.4.1.3319.6.10.16: Reserved key purpose * * An internally defined reserved/dummy key purpose * * This is used with ExtendedKeyUsage certificate extensions to * be a place holder when no other purposes are defined. * * In theory such a certificate should be blacklisted. But in reality * many implementations use such empty sets of purposes. RFC 5280 requires * at least one purpose in an ExtendedKeyUsage. * * Obviously this purpose should never be checked against. */ static const unsigned char P11_OID_RESERVED_PURPOSE[] = { 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x99, 0x77, 0x06, 0x0a, 0x10 }; static const char P11_OID_RESERVED_PURPOSE_STR[] = "1.3.6.1.4.1.3319.6.10.16"; #endif p11-kit-0.20.2/trust/module.h0000664000175000017500000000334412161102014012513 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "pkcs11.h" #ifndef P11_MODULE_H_ #define P11_MODULE_H_ CK_ULONG p11_module_next_id (void); #endif /* P11_MODULE_H_ */ p11-kit-0.20.2/trust/Makefile.in0000664000175000017500000021505412265245664013155 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/build/Makefile.decl $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/trust-extract-compat.in \ $(top_srcdir)/build/aux/depcomp bin_PROGRAMS = trust$(EXEEXT) subdir = trust ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/gettext.m4 \ $(top_srcdir)/build/m4/iconv.m4 \ $(top_srcdir)/build/m4/lib-ld.m4 \ $(top_srcdir)/build/m4/lib-link.m4 \ $(top_srcdir)/build/m4/lib-prefix.m4 \ $(top_srcdir)/build/m4/libtool.m4 \ $(top_srcdir)/build/m4/ltoptions.m4 \ $(top_srcdir)/build/m4/ltsugar.m4 \ $(top_srcdir)/build/m4/ltversion.m4 \ $(top_srcdir)/build/m4/lt~obsolete.m4 \ $(top_srcdir)/build/m4/nls.m4 $(top_srcdir)/build/m4/po.m4 \ $(top_srcdir)/build/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = trust-extract-compat CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(externaldir)" "$(DESTDIR)$(configdir)" LTLIBRARIES = $(module_LTLIBRARIES) $(noinst_LTLIBRARIES) libtrust_data_la_LIBADD = am__objects_1 = am_libtrust_data_la_OBJECTS = asn1.lo base64.lo pem.lo oid.lo utf8.lo \ x509.lo $(am__objects_1) libtrust_data_la_OBJECTS = $(am_libtrust_data_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libtrust_testable_la_LIBADD = am__objects_2 = builder.lo digest.lo index.lo parser.lo persist.lo \ module.lo save.lo session.lo token.lo $(am__objects_1) am_libtrust_testable_la_OBJECTS = $(am__objects_2) libtrust_testable_la_OBJECTS = $(am_libtrust_testable_la_OBJECTS) libtrust_testable_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libtrust_testable_la_LDFLAGS) \ $(LDFLAGS) -o $@ am__DEPENDENCIES_1 = p11_kit_trust_la_DEPENDENCIES = libtrust-data.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__objects_3 = p11_kit_trust_la-builder.lo p11_kit_trust_la-digest.lo \ p11_kit_trust_la-index.lo p11_kit_trust_la-parser.lo \ p11_kit_trust_la-persist.lo p11_kit_trust_la-module.lo \ p11_kit_trust_la-save.lo p11_kit_trust_la-session.lo \ p11_kit_trust_la-token.lo $(am__objects_1) am_p11_kit_trust_la_OBJECTS = $(am__objects_3) p11_kit_trust_la_OBJECTS = $(am_p11_kit_trust_la_OBJECTS) p11_kit_trust_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(p11_kit_trust_la_CFLAGS) $(CFLAGS) \ $(p11_kit_trust_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) am_trust_OBJECTS = trust-anchor.$(OBJEXT) trust-parser.$(OBJEXT) \ trust-persist.$(OBJEXT) trust-digest.$(OBJEXT) \ trust-enumerate.$(OBJEXT) trust-extract.$(OBJEXT) \ trust-extract-jks.$(OBJEXT) trust-extract-openssl.$(OBJEXT) \ trust-extract-pem.$(OBJEXT) trust-extract-cer.$(OBJEXT) \ trust-list.$(OBJEXT) trust-save.$(OBJEXT) \ trust-trust.$(OBJEXT) $(am__objects_1) trust_OBJECTS = $(am_trust_OBJECTS) trust_DEPENDENCIES = libtrust-data.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-common.la \ $(top_builddir)/common/libp11-tool.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) trust_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(trust_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SCRIPTS = $(external_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtrust_data_la_SOURCES) $(libtrust_testable_la_SOURCES) \ $(p11_kit_trust_la_SOURCES) $(trust_SOURCES) DIST_SOURCES = $(libtrust_data_la_SOURCES) \ $(libtrust_testable_la_SOURCES) $(p11_kit_trust_la_SOURCES) \ $(trust_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(config_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTKDOC_SCAN = @GTKDOC_SCAN@ HASH_LIBS = @HASH_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_CFLAGS = @LIBFFI_CFLAGS@ LIBFFI_LIBS = @LIBFFI_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTASN1_CFLAGS = @LIBTASN1_CFLAGS@ LIBTASN1_LIBS = @LIBTASN1_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P11KIT_LT_RELEASE = @P11KIT_LT_RELEASE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLEXT = @SHLEXT@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ p11_module_path = @p11_module_path@ p11_package_config_modules = @p11_package_config_modules@ p11_system_config = @p11_system_config@ p11_system_config_file = @p11_system_config_file@ p11_system_config_modules = @p11_system_config_modules@ p11_user_config = @p11_user_config@ p11_user_config_file = @p11_user_config_file@ p11_user_config_modules = @p11_user_config_modules@ pdfdir = @pdfdir@ prefix = @prefix@ privatedir = @privatedir@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_trust_paths = @with_trust_paths@ NULL = SUBDIRS = . tests COMMON = $(top_srcdir)/common AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/common \ -DDATADIR=\"$(datadir)\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -DPRIVATEDIR=\"$(privatedir)\" \ $(LIBTASN1_CFLAGS) \ $(NULL) noinst_LTLIBRARIES = \ libtrust-testable.la \ libtrust-data.la libtrust_data_la_SOURCES = \ asn1.c asn1.h \ basic.asn basic.asn.h \ base64.c base64.h \ pem.c pem.h \ pkix.asn pkix.asn.h \ oid.c oid.h \ openssl.asn openssl.asn.h \ utf8.c utf8.h \ x509.c x509.h \ $(NULL) MODULE_SRCS = \ builder.c builder.h \ digest.c digest.h \ index.c index.h \ parser.c parser.h \ persist.c persist.h \ module.c module.h \ save.c save.h \ session.c session.h \ token.c token.h \ types.h \ $(NULL) configdir = $(p11_package_config_modules) config_DATA = p11-kit-trust.module moduledir = $(p11_module_path) module_LTLIBRARIES = \ p11-kit-trust.la p11_kit_trust_la_CFLAGS = \ $(LIBTASN1_CFLAGS) p11_kit_trust_la_LIBADD = \ libtrust-data.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-common.la \ $(LIBTASN1_LIBS) \ $(HASH_LIBS) \ $(NULL) p11_kit_trust_la_LDFLAGS = \ -no-undefined -module -avoid-version \ -version-info $(P11KIT_LT_RELEASE) \ -export-symbols-regex 'C_GetFunctionList' \ $(NULL) p11_kit_trust_la_SOURCES = $(MODULE_SRCS) libtrust_testable_la_LDFLAGS = \ -no-undefined libtrust_testable_la_SOURCES = $(MODULE_SRCS) trust_LDADD = \ libtrust-data.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-common.la \ $(top_builddir)/common/libp11-tool.la \ $(LTLIBINTL) \ $(LIBTASN1_LIBS) \ $(HASH_LIBS) \ $(NULL) trust_CFLAGS = \ -I$(top_srcdir)/p11-kit \ -DP11_KIT_FUTURE_UNSTABLE_API \ $(LIBTASN1_CFLAGS) \ $(NULL) trust_SOURCES = \ anchor.c anchor.h \ parser.c parser.h \ persist.c persist.h \ digest.c digest.h \ enumerate.c enumerate.h \ extract.c extract.h \ extract-jks.c \ extract-openssl.c \ extract-pem.c \ extract-cer.c \ list.c list.h \ openssl.asn openssl.asn.h \ save.c save.h \ trust.c \ $(NULL) externaldir = $(privatedir) external_SCRIPTS = \ trust-extract-compat EXTRA_DIST = \ p11-kit-trust.module all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/build/Makefile.decl $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign trust/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign trust/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/build/Makefile.decl: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): trust-extract-compat: $(top_builddir)/config.status $(srcdir)/trust-extract-compat.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libtrust-data.la: $(libtrust_data_la_OBJECTS) $(libtrust_data_la_DEPENDENCIES) $(EXTRA_libtrust_data_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libtrust_data_la_OBJECTS) $(libtrust_data_la_LIBADD) $(LIBS) libtrust-testable.la: $(libtrust_testable_la_OBJECTS) $(libtrust_testable_la_DEPENDENCIES) $(EXTRA_libtrust_testable_la_DEPENDENCIES) $(AM_V_CCLD)$(libtrust_testable_la_LINK) $(libtrust_testable_la_OBJECTS) $(libtrust_testable_la_LIBADD) $(LIBS) p11-kit-trust.la: $(p11_kit_trust_la_OBJECTS) $(p11_kit_trust_la_DEPENDENCIES) $(EXTRA_p11_kit_trust_la_DEPENDENCIES) $(AM_V_CCLD)$(p11_kit_trust_la_LINK) -rpath $(moduledir) $(p11_kit_trust_la_OBJECTS) $(p11_kit_trust_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list trust$(EXEEXT): $(trust_OBJECTS) $(trust_DEPENDENCIES) $(EXTRA_trust_DEPENDENCIES) @rm -f trust$(EXEEXT) $(AM_V_CCLD)$(trust_LINK) $(trust_OBJECTS) $(trust_LDADD) $(LIBS) install-externalSCRIPTS: $(external_SCRIPTS) @$(NORMAL_INSTALL) @list='$(external_SCRIPTS)'; test -n "$(externaldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(externaldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(externaldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(externaldir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(externaldir)$$dir" || exit $$?; \ } \ ; done uninstall-externalSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(external_SCRIPTS)'; test -n "$(externaldir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(externaldir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asn1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/builder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/digest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p11_kit_trust_la-builder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p11_kit_trust_la-digest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p11_kit_trust_la-index.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p11_kit_trust_la-module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p11_kit_trust_la-parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p11_kit_trust_la-persist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p11_kit_trust_la-save.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p11_kit_trust_la-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p11_kit_trust_la-token.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/persist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/save.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/token.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-anchor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-digest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-enumerate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-extract-cer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-extract-jks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-extract-openssl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-extract-pem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-extract.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-persist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-save.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trust-trust.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x509.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< p11_kit_trust_la-builder.lo: builder.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -MT p11_kit_trust_la-builder.lo -MD -MP -MF $(DEPDIR)/p11_kit_trust_la-builder.Tpo -c -o p11_kit_trust_la-builder.lo `test -f 'builder.c' || echo '$(srcdir)/'`builder.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit_trust_la-builder.Tpo $(DEPDIR)/p11_kit_trust_la-builder.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='builder.c' object='p11_kit_trust_la-builder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -c -o p11_kit_trust_la-builder.lo `test -f 'builder.c' || echo '$(srcdir)/'`builder.c p11_kit_trust_la-digest.lo: digest.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -MT p11_kit_trust_la-digest.lo -MD -MP -MF $(DEPDIR)/p11_kit_trust_la-digest.Tpo -c -o p11_kit_trust_la-digest.lo `test -f 'digest.c' || echo '$(srcdir)/'`digest.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit_trust_la-digest.Tpo $(DEPDIR)/p11_kit_trust_la-digest.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='digest.c' object='p11_kit_trust_la-digest.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -c -o p11_kit_trust_la-digest.lo `test -f 'digest.c' || echo '$(srcdir)/'`digest.c p11_kit_trust_la-index.lo: index.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -MT p11_kit_trust_la-index.lo -MD -MP -MF $(DEPDIR)/p11_kit_trust_la-index.Tpo -c -o p11_kit_trust_la-index.lo `test -f 'index.c' || echo '$(srcdir)/'`index.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit_trust_la-index.Tpo $(DEPDIR)/p11_kit_trust_la-index.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='index.c' object='p11_kit_trust_la-index.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -c -o p11_kit_trust_la-index.lo `test -f 'index.c' || echo '$(srcdir)/'`index.c p11_kit_trust_la-parser.lo: parser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -MT p11_kit_trust_la-parser.lo -MD -MP -MF $(DEPDIR)/p11_kit_trust_la-parser.Tpo -c -o p11_kit_trust_la-parser.lo `test -f 'parser.c' || echo '$(srcdir)/'`parser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit_trust_la-parser.Tpo $(DEPDIR)/p11_kit_trust_la-parser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser.c' object='p11_kit_trust_la-parser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -c -o p11_kit_trust_la-parser.lo `test -f 'parser.c' || echo '$(srcdir)/'`parser.c p11_kit_trust_la-persist.lo: persist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -MT p11_kit_trust_la-persist.lo -MD -MP -MF $(DEPDIR)/p11_kit_trust_la-persist.Tpo -c -o p11_kit_trust_la-persist.lo `test -f 'persist.c' || echo '$(srcdir)/'`persist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit_trust_la-persist.Tpo $(DEPDIR)/p11_kit_trust_la-persist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='persist.c' object='p11_kit_trust_la-persist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -c -o p11_kit_trust_la-persist.lo `test -f 'persist.c' || echo '$(srcdir)/'`persist.c p11_kit_trust_la-module.lo: module.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -MT p11_kit_trust_la-module.lo -MD -MP -MF $(DEPDIR)/p11_kit_trust_la-module.Tpo -c -o p11_kit_trust_la-module.lo `test -f 'module.c' || echo '$(srcdir)/'`module.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit_trust_la-module.Tpo $(DEPDIR)/p11_kit_trust_la-module.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='module.c' object='p11_kit_trust_la-module.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -c -o p11_kit_trust_la-module.lo `test -f 'module.c' || echo '$(srcdir)/'`module.c p11_kit_trust_la-save.lo: save.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -MT p11_kit_trust_la-save.lo -MD -MP -MF $(DEPDIR)/p11_kit_trust_la-save.Tpo -c -o p11_kit_trust_la-save.lo `test -f 'save.c' || echo '$(srcdir)/'`save.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit_trust_la-save.Tpo $(DEPDIR)/p11_kit_trust_la-save.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='save.c' object='p11_kit_trust_la-save.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -c -o p11_kit_trust_la-save.lo `test -f 'save.c' || echo '$(srcdir)/'`save.c p11_kit_trust_la-session.lo: session.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -MT p11_kit_trust_la-session.lo -MD -MP -MF $(DEPDIR)/p11_kit_trust_la-session.Tpo -c -o p11_kit_trust_la-session.lo `test -f 'session.c' || echo '$(srcdir)/'`session.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit_trust_la-session.Tpo $(DEPDIR)/p11_kit_trust_la-session.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='session.c' object='p11_kit_trust_la-session.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -c -o p11_kit_trust_la-session.lo `test -f 'session.c' || echo '$(srcdir)/'`session.c p11_kit_trust_la-token.lo: token.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -MT p11_kit_trust_la-token.lo -MD -MP -MF $(DEPDIR)/p11_kit_trust_la-token.Tpo -c -o p11_kit_trust_la-token.lo `test -f 'token.c' || echo '$(srcdir)/'`token.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit_trust_la-token.Tpo $(DEPDIR)/p11_kit_trust_la-token.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='token.c' object='p11_kit_trust_la-token.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_trust_la_CFLAGS) $(CFLAGS) -c -o p11_kit_trust_la-token.lo `test -f 'token.c' || echo '$(srcdir)/'`token.c trust-anchor.o: anchor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-anchor.o -MD -MP -MF $(DEPDIR)/trust-anchor.Tpo -c -o trust-anchor.o `test -f 'anchor.c' || echo '$(srcdir)/'`anchor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-anchor.Tpo $(DEPDIR)/trust-anchor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='anchor.c' object='trust-anchor.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-anchor.o `test -f 'anchor.c' || echo '$(srcdir)/'`anchor.c trust-anchor.obj: anchor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-anchor.obj -MD -MP -MF $(DEPDIR)/trust-anchor.Tpo -c -o trust-anchor.obj `if test -f 'anchor.c'; then $(CYGPATH_W) 'anchor.c'; else $(CYGPATH_W) '$(srcdir)/anchor.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-anchor.Tpo $(DEPDIR)/trust-anchor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='anchor.c' object='trust-anchor.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-anchor.obj `if test -f 'anchor.c'; then $(CYGPATH_W) 'anchor.c'; else $(CYGPATH_W) '$(srcdir)/anchor.c'; fi` trust-parser.o: parser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-parser.o -MD -MP -MF $(DEPDIR)/trust-parser.Tpo -c -o trust-parser.o `test -f 'parser.c' || echo '$(srcdir)/'`parser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-parser.Tpo $(DEPDIR)/trust-parser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser.c' object='trust-parser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-parser.o `test -f 'parser.c' || echo '$(srcdir)/'`parser.c trust-parser.obj: parser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-parser.obj -MD -MP -MF $(DEPDIR)/trust-parser.Tpo -c -o trust-parser.obj `if test -f 'parser.c'; then $(CYGPATH_W) 'parser.c'; else $(CYGPATH_W) '$(srcdir)/parser.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-parser.Tpo $(DEPDIR)/trust-parser.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parser.c' object='trust-parser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-parser.obj `if test -f 'parser.c'; then $(CYGPATH_W) 'parser.c'; else $(CYGPATH_W) '$(srcdir)/parser.c'; fi` trust-persist.o: persist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-persist.o -MD -MP -MF $(DEPDIR)/trust-persist.Tpo -c -o trust-persist.o `test -f 'persist.c' || echo '$(srcdir)/'`persist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-persist.Tpo $(DEPDIR)/trust-persist.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='persist.c' object='trust-persist.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-persist.o `test -f 'persist.c' || echo '$(srcdir)/'`persist.c trust-persist.obj: persist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-persist.obj -MD -MP -MF $(DEPDIR)/trust-persist.Tpo -c -o trust-persist.obj `if test -f 'persist.c'; then $(CYGPATH_W) 'persist.c'; else $(CYGPATH_W) '$(srcdir)/persist.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-persist.Tpo $(DEPDIR)/trust-persist.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='persist.c' object='trust-persist.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-persist.obj `if test -f 'persist.c'; then $(CYGPATH_W) 'persist.c'; else $(CYGPATH_W) '$(srcdir)/persist.c'; fi` trust-digest.o: digest.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-digest.o -MD -MP -MF $(DEPDIR)/trust-digest.Tpo -c -o trust-digest.o `test -f 'digest.c' || echo '$(srcdir)/'`digest.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-digest.Tpo $(DEPDIR)/trust-digest.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='digest.c' object='trust-digest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-digest.o `test -f 'digest.c' || echo '$(srcdir)/'`digest.c trust-digest.obj: digest.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-digest.obj -MD -MP -MF $(DEPDIR)/trust-digest.Tpo -c -o trust-digest.obj `if test -f 'digest.c'; then $(CYGPATH_W) 'digest.c'; else $(CYGPATH_W) '$(srcdir)/digest.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-digest.Tpo $(DEPDIR)/trust-digest.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='digest.c' object='trust-digest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-digest.obj `if test -f 'digest.c'; then $(CYGPATH_W) 'digest.c'; else $(CYGPATH_W) '$(srcdir)/digest.c'; fi` trust-enumerate.o: enumerate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-enumerate.o -MD -MP -MF $(DEPDIR)/trust-enumerate.Tpo -c -o trust-enumerate.o `test -f 'enumerate.c' || echo '$(srcdir)/'`enumerate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-enumerate.Tpo $(DEPDIR)/trust-enumerate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='enumerate.c' object='trust-enumerate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-enumerate.o `test -f 'enumerate.c' || echo '$(srcdir)/'`enumerate.c trust-enumerate.obj: enumerate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-enumerate.obj -MD -MP -MF $(DEPDIR)/trust-enumerate.Tpo -c -o trust-enumerate.obj `if test -f 'enumerate.c'; then $(CYGPATH_W) 'enumerate.c'; else $(CYGPATH_W) '$(srcdir)/enumerate.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-enumerate.Tpo $(DEPDIR)/trust-enumerate.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='enumerate.c' object='trust-enumerate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-enumerate.obj `if test -f 'enumerate.c'; then $(CYGPATH_W) 'enumerate.c'; else $(CYGPATH_W) '$(srcdir)/enumerate.c'; fi` trust-extract.o: extract.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-extract.o -MD -MP -MF $(DEPDIR)/trust-extract.Tpo -c -o trust-extract.o `test -f 'extract.c' || echo '$(srcdir)/'`extract.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-extract.Tpo $(DEPDIR)/trust-extract.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extract.c' object='trust-extract.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-extract.o `test -f 'extract.c' || echo '$(srcdir)/'`extract.c trust-extract.obj: extract.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-extract.obj -MD -MP -MF $(DEPDIR)/trust-extract.Tpo -c -o trust-extract.obj `if test -f 'extract.c'; then $(CYGPATH_W) 'extract.c'; else $(CYGPATH_W) '$(srcdir)/extract.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-extract.Tpo $(DEPDIR)/trust-extract.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extract.c' object='trust-extract.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-extract.obj `if test -f 'extract.c'; then $(CYGPATH_W) 'extract.c'; else $(CYGPATH_W) '$(srcdir)/extract.c'; fi` trust-extract-jks.o: extract-jks.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-extract-jks.o -MD -MP -MF $(DEPDIR)/trust-extract-jks.Tpo -c -o trust-extract-jks.o `test -f 'extract-jks.c' || echo '$(srcdir)/'`extract-jks.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-extract-jks.Tpo $(DEPDIR)/trust-extract-jks.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extract-jks.c' object='trust-extract-jks.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-extract-jks.o `test -f 'extract-jks.c' || echo '$(srcdir)/'`extract-jks.c trust-extract-jks.obj: extract-jks.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-extract-jks.obj -MD -MP -MF $(DEPDIR)/trust-extract-jks.Tpo -c -o trust-extract-jks.obj `if test -f 'extract-jks.c'; then $(CYGPATH_W) 'extract-jks.c'; else $(CYGPATH_W) '$(srcdir)/extract-jks.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-extract-jks.Tpo $(DEPDIR)/trust-extract-jks.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extract-jks.c' object='trust-extract-jks.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-extract-jks.obj `if test -f 'extract-jks.c'; then $(CYGPATH_W) 'extract-jks.c'; else $(CYGPATH_W) '$(srcdir)/extract-jks.c'; fi` trust-extract-openssl.o: extract-openssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-extract-openssl.o -MD -MP -MF $(DEPDIR)/trust-extract-openssl.Tpo -c -o trust-extract-openssl.o `test -f 'extract-openssl.c' || echo '$(srcdir)/'`extract-openssl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-extract-openssl.Tpo $(DEPDIR)/trust-extract-openssl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extract-openssl.c' object='trust-extract-openssl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-extract-openssl.o `test -f 'extract-openssl.c' || echo '$(srcdir)/'`extract-openssl.c trust-extract-openssl.obj: extract-openssl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-extract-openssl.obj -MD -MP -MF $(DEPDIR)/trust-extract-openssl.Tpo -c -o trust-extract-openssl.obj `if test -f 'extract-openssl.c'; then $(CYGPATH_W) 'extract-openssl.c'; else $(CYGPATH_W) '$(srcdir)/extract-openssl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-extract-openssl.Tpo $(DEPDIR)/trust-extract-openssl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extract-openssl.c' object='trust-extract-openssl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-extract-openssl.obj `if test -f 'extract-openssl.c'; then $(CYGPATH_W) 'extract-openssl.c'; else $(CYGPATH_W) '$(srcdir)/extract-openssl.c'; fi` trust-extract-pem.o: extract-pem.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-extract-pem.o -MD -MP -MF $(DEPDIR)/trust-extract-pem.Tpo -c -o trust-extract-pem.o `test -f 'extract-pem.c' || echo '$(srcdir)/'`extract-pem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-extract-pem.Tpo $(DEPDIR)/trust-extract-pem.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extract-pem.c' object='trust-extract-pem.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-extract-pem.o `test -f 'extract-pem.c' || echo '$(srcdir)/'`extract-pem.c trust-extract-pem.obj: extract-pem.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-extract-pem.obj -MD -MP -MF $(DEPDIR)/trust-extract-pem.Tpo -c -o trust-extract-pem.obj `if test -f 'extract-pem.c'; then $(CYGPATH_W) 'extract-pem.c'; else $(CYGPATH_W) '$(srcdir)/extract-pem.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-extract-pem.Tpo $(DEPDIR)/trust-extract-pem.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extract-pem.c' object='trust-extract-pem.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-extract-pem.obj `if test -f 'extract-pem.c'; then $(CYGPATH_W) 'extract-pem.c'; else $(CYGPATH_W) '$(srcdir)/extract-pem.c'; fi` trust-extract-cer.o: extract-cer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-extract-cer.o -MD -MP -MF $(DEPDIR)/trust-extract-cer.Tpo -c -o trust-extract-cer.o `test -f 'extract-cer.c' || echo '$(srcdir)/'`extract-cer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-extract-cer.Tpo $(DEPDIR)/trust-extract-cer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extract-cer.c' object='trust-extract-cer.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-extract-cer.o `test -f 'extract-cer.c' || echo '$(srcdir)/'`extract-cer.c trust-extract-cer.obj: extract-cer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-extract-cer.obj -MD -MP -MF $(DEPDIR)/trust-extract-cer.Tpo -c -o trust-extract-cer.obj `if test -f 'extract-cer.c'; then $(CYGPATH_W) 'extract-cer.c'; else $(CYGPATH_W) '$(srcdir)/extract-cer.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-extract-cer.Tpo $(DEPDIR)/trust-extract-cer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='extract-cer.c' object='trust-extract-cer.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-extract-cer.obj `if test -f 'extract-cer.c'; then $(CYGPATH_W) 'extract-cer.c'; else $(CYGPATH_W) '$(srcdir)/extract-cer.c'; fi` trust-list.o: list.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-list.o -MD -MP -MF $(DEPDIR)/trust-list.Tpo -c -o trust-list.o `test -f 'list.c' || echo '$(srcdir)/'`list.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-list.Tpo $(DEPDIR)/trust-list.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='list.c' object='trust-list.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-list.o `test -f 'list.c' || echo '$(srcdir)/'`list.c trust-list.obj: list.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-list.obj -MD -MP -MF $(DEPDIR)/trust-list.Tpo -c -o trust-list.obj `if test -f 'list.c'; then $(CYGPATH_W) 'list.c'; else $(CYGPATH_W) '$(srcdir)/list.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-list.Tpo $(DEPDIR)/trust-list.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='list.c' object='trust-list.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-list.obj `if test -f 'list.c'; then $(CYGPATH_W) 'list.c'; else $(CYGPATH_W) '$(srcdir)/list.c'; fi` trust-save.o: save.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-save.o -MD -MP -MF $(DEPDIR)/trust-save.Tpo -c -o trust-save.o `test -f 'save.c' || echo '$(srcdir)/'`save.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-save.Tpo $(DEPDIR)/trust-save.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='save.c' object='trust-save.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-save.o `test -f 'save.c' || echo '$(srcdir)/'`save.c trust-save.obj: save.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-save.obj -MD -MP -MF $(DEPDIR)/trust-save.Tpo -c -o trust-save.obj `if test -f 'save.c'; then $(CYGPATH_W) 'save.c'; else $(CYGPATH_W) '$(srcdir)/save.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-save.Tpo $(DEPDIR)/trust-save.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='save.c' object='trust-save.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-save.obj `if test -f 'save.c'; then $(CYGPATH_W) 'save.c'; else $(CYGPATH_W) '$(srcdir)/save.c'; fi` trust-trust.o: trust.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-trust.o -MD -MP -MF $(DEPDIR)/trust-trust.Tpo -c -o trust-trust.o `test -f 'trust.c' || echo '$(srcdir)/'`trust.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-trust.Tpo $(DEPDIR)/trust-trust.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trust.c' object='trust-trust.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-trust.o `test -f 'trust.c' || echo '$(srcdir)/'`trust.c trust-trust.obj: trust.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -MT trust-trust.obj -MD -MP -MF $(DEPDIR)/trust-trust.Tpo -c -o trust-trust.obj `if test -f 'trust.c'; then $(CYGPATH_W) 'trust.c'; else $(CYGPATH_W) '$(srcdir)/trust.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/trust-trust.Tpo $(DEPDIR)/trust-trust.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='trust.c' object='trust-trust.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(trust_CFLAGS) $(CFLAGS) -c -o trust-trust.obj `if test -f 'trust.c'; then $(CYGPATH_W) 'trust.c'; else $(CYGPATH_W) '$(srcdir)/trust.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-configDATA: $(config_DATA) @$(NORMAL_INSTALL) @list='$(config_DATA)'; test -n "$(configdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(configdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(configdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(configdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(configdir)" || exit $$?; \ done uninstall-configDATA: @$(NORMAL_UNINSTALL) @list='$(config_DATA)'; test -n "$(configdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(configdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(externaldir)" "$(DESTDIR)$(configdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-moduleLTLIBRARIES clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-configDATA install-externalSCRIPTS \ install-moduleLTLIBRARIES install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-configDATA \ uninstall-externalSCRIPTS uninstall-moduleLTLIBRARIES .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic clean-libtool \ clean-moduleLTLIBRARIES clean-noinstLTLIBRARIES cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-configDATA install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am \ install-externalSCRIPTS install-html install-html-am \ install-info install-info-am install-man \ install-moduleLTLIBRARIES install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-configDATA uninstall-externalSCRIPTS \ uninstall-moduleLTLIBRARIES memcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir memcheck; \ done leakcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir leakcheck; \ done hellcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir hellcheck; \ done asn: asn1Parser -o pkix.asn.h pkix.asn asn1Parser -o openssl.asn.h openssl.asn asn1Parser -o basic.asn.h basic.asn # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: p11-kit-0.20.2/trust/utf8.h0000664000175000017500000000423012226763526012136 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_UTF8_H_ #define P11_UTF8_H_ #include "compat.h" #include bool p11_utf8_validate (const char *str, ssize_t len); char * p11_utf8_for_ucs2be (const unsigned char *str, size_t num_bytes, size_t *ret_len); char * p11_utf8_for_ucs4be (const unsigned char *str, size_t num_bytes, size_t *ret_len); #endif /* P11_UTF8_H_ */ p11-kit-0.20.2/trust/Makefile.am0000664000175000017500000000450012226763526013133 00000000000000 include $(top_srcdir)/build/Makefile.decl SUBDIRS = . tests COMMON = $(top_srcdir)/common AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/common \ -DDATADIR=\"$(datadir)\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \ -DPRIVATEDIR=\"$(privatedir)\" \ $(LIBTASN1_CFLAGS) \ $(NULL) noinst_LTLIBRARIES = \ libtrust-testable.la \ libtrust-data.la libtrust_data_la_SOURCES = \ asn1.c asn1.h \ basic.asn basic.asn.h \ base64.c base64.h \ pem.c pem.h \ pkix.asn pkix.asn.h \ oid.c oid.h \ openssl.asn openssl.asn.h \ utf8.c utf8.h \ x509.c x509.h \ $(NULL) MODULE_SRCS = \ builder.c builder.h \ digest.c digest.h \ index.c index.h \ parser.c parser.h \ persist.c persist.h \ module.c module.h \ save.c save.h \ session.c session.h \ token.c token.h \ types.h \ $(NULL) configdir = $(p11_package_config_modules) config_DATA = p11-kit-trust.module moduledir = $(p11_module_path) module_LTLIBRARIES = \ p11-kit-trust.la p11_kit_trust_la_CFLAGS = \ $(LIBTASN1_CFLAGS) p11_kit_trust_la_LIBADD = \ libtrust-data.la \ $(top_builddir)/common/libp11-library.la \ $(top_builddir)/common/libp11-common.la \ $(LIBTASN1_LIBS) \ $(HASH_LIBS) \ $(NULL) p11_kit_trust_la_LDFLAGS = \ -no-undefined -module -avoid-version \ -version-info $(P11KIT_LT_RELEASE) \ -export-symbols-regex 'C_GetFunctionList' \ $(NULL) p11_kit_trust_la_SOURCES = $(MODULE_SRCS) libtrust_testable_la_LDFLAGS = \ -no-undefined libtrust_testable_la_SOURCES = $(MODULE_SRCS) bin_PROGRAMS = \ trust trust_LDADD = \ libtrust-data.la \ $(top_builddir)/p11-kit/libp11-kit.la \ $(top_builddir)/common/libp11-common.la \ $(top_builddir)/common/libp11-tool.la \ $(LTLIBINTL) \ $(LIBTASN1_LIBS) \ $(HASH_LIBS) \ $(NULL) trust_CFLAGS = \ -I$(top_srcdir)/p11-kit \ -DP11_KIT_FUTURE_UNSTABLE_API \ $(LIBTASN1_CFLAGS) \ $(NULL) trust_SOURCES = \ anchor.c anchor.h \ parser.c parser.h \ persist.c persist.h \ digest.c digest.h \ enumerate.c enumerate.h \ extract.c extract.h \ extract-jks.c \ extract-openssl.c \ extract-pem.c \ extract-cer.c \ list.c list.h \ openssl.asn openssl.asn.h \ save.c save.h \ trust.c \ $(NULL) externaldir = $(privatedir) external_SCRIPTS = \ trust-extract-compat EXTRA_DIST = \ p11-kit-trust.module asn: asn1Parser -o pkix.asn.h pkix.asn asn1Parser -o openssl.asn.h openssl.asn asn1Parser -o basic.asn.h basic.asn p11-kit-0.20.2/trust/index.h0000664000175000017500000001275712226763526012374 00000000000000/* * Copyright (C) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_INDEX_H_ #define P11_INDEX_H_ #include "array.h" #include "compat.h" #include "pkcs11.h" #include "types.h" typedef struct _p11_index p11_index; typedef CK_RV (* p11_index_build_cb) (void *data, p11_index *index, CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge, CK_ATTRIBUTE **populate); typedef CK_RV (* p11_index_store_cb) (void *data, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE **attrs); typedef CK_RV (* p11_index_remove_cb) (void *data, p11_index *index, CK_ATTRIBUTE *attrs); typedef void (* p11_index_notify_cb) (void *data, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs); p11_index * p11_index_new (p11_index_build_cb build, p11_index_store_cb store, p11_index_remove_cb remove, p11_index_notify_cb notify, void *data); void p11_index_free (p11_index *index); int p11_index_size (p11_index *index); void p11_index_load (p11_index *index); void p11_index_finish (p11_index *index); bool p11_index_loading (p11_index *index); CK_RV p11_index_take (p11_index *index, CK_ATTRIBUTE *attrs, CK_OBJECT_HANDLE *handle); CK_RV p11_index_add (p11_index *index, CK_ATTRIBUTE *attrs, CK_ULONG count, CK_OBJECT_HANDLE *handle); CK_RV p11_index_set (p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs, CK_ULONG count); CK_RV p11_index_update (p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs); CK_RV p11_index_replace (p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *replace); CK_RV p11_index_replace_all (p11_index *index, CK_ATTRIBUTE *match, CK_ATTRIBUTE_TYPE key, p11_array *replace); CK_RV p11_index_remove (p11_index *index, CK_OBJECT_HANDLE handle); CK_ATTRIBUTE * p11_index_lookup (p11_index *index, CK_OBJECT_HANDLE handle); CK_OBJECT_HANDLE p11_index_find (p11_index *index, CK_ATTRIBUTE *match, int count); CK_OBJECT_HANDLE * p11_index_find_all (p11_index *index, CK_ATTRIBUTE *match, int count); CK_OBJECT_HANDLE * p11_index_snapshot (p11_index *index, p11_index *base, CK_ATTRIBUTE *attrs, CK_ULONG count); #endif /* P11_INDEX_H_ */ p11-kit-0.20.2/trust/token.h0000664000175000017500000000500712226763526012373 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_TOKEN_H_ #define P11_TOKEN_H_ #include "dict.h" #include "index.h" #include "parser.h" #include "pkcs11.h" typedef struct _p11_token p11_token; p11_token * p11_token_new (CK_SLOT_ID slot, const char *path, const char *label); void p11_token_free (p11_token *token); int p11_token_load (p11_token *token); bool p11_token_reload (p11_token *token, CK_ATTRIBUTE *attrs); p11_index * p11_token_index (p11_token *token); p11_parser * p11_token_parser (p11_token *token); const char * p11_token_get_path (p11_token *token); const char * p11_token_get_label (p11_token *token); CK_SLOT_ID p11_token_get_slot (p11_token *token); bool p11_token_is_writable (p11_token *token); #endif /* P11_TOKEN_H_ */ p11-kit-0.20.2/trust/basic.asn0000664000175000017500000000015212226763526012662 00000000000000 BASIC { } DEFINITIONS EXPLICIT TAGS ::= BEGIN Any ::= ANY ObjectIdentifier ::= OBJECT IDENTIFIER ENDp11-kit-0.20.2/trust/base64.h0000664000175000017500000000542512226763526012343 00000000000000/* * Copyright (c) 1996, 1998 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * Portions Copyright (c) 1995 by International Business Machines, Inc. * * International Business Machines, Inc. (hereinafter called IBM) grants * permission under its copyrights to use, copy, modify, and distribute this * Software with or without fee, provided that the above copyright notice and * all paragraphs of this notice appear in all copies, and that the name of IBM * not be used in connection with the marketing of any product incorporating * the Software or modifications thereof, without specific, written prior * permission. * * To the extent it has a right to do so, IBM grants an immunity from suit * under its patents, if any, for the use, sale or manufacture of products to * the extent that such products are used for performing Domain Name System * dynamic updates in TCP/IP networks by means of the Software. No immunity is * granted for any product per se or for any other function of any product. * * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef P11_BASE64_H_ #define P11_BASE64_H_ #include int p11_b64_pton (const char *src, size_t length, unsigned char *target, size_t targsize); int p11_b64_ntop (const unsigned char *src, size_t srclength, char *target, size_t targsize, int breakl); #endif /* P11_BASE64_H_ */ p11-kit-0.20.2/trust/enumerate.h0000664000175000017500000000653712265242533013242 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #ifndef P11_ENUMERATE_H_ #define P11_ENUMERATE_H_ #include "array.h" #include "asn1.h" #include "dict.h" #include "iter.h" #include "pkcs11.h" enum { /* These overlap with the flags in save.h, so start higher */ P11_ENUMERATE_ANCHORS = 1 << 21, P11_ENUMERATE_BLACKLIST = 1 << 22, P11_ENUMERATE_COLLAPSE = 1 << 23, }; typedef struct { CK_FUNCTION_LIST **modules; p11_kit_iter *iter; p11_kit_uri *uri; p11_dict *asn1_defs; p11_dict *limit_to_purposes; p11_dict *already_seen; int num_filters; int flags; p11_dict *blacklist_issuer_serial; p11_dict *blacklist_public_key; /* * Stuff below is parsed info for the current iteration. * Currently this information is generally all relevant * just for certificates. */ CK_OBJECT_CLASS klass; CK_ATTRIBUTE *attrs; /* Pre-parsed data for certificates */ node_asn *cert_asn; const unsigned char *cert_der; size_t cert_len; /* DER OID -> CK_ATTRIBUTE list */ p11_dict *stapled; /* Set of OID purposes as strings */ p11_array *purposes; } p11_enumerate; char * p11_enumerate_filename (p11_enumerate *ex); char * p11_enumerate_comment (p11_enumerate *ex, bool first); void p11_enumerate_init (p11_enumerate *ex); bool p11_enumerate_opt_filter (p11_enumerate *ex, const char *option); bool p11_enumerate_opt_purpose (p11_enumerate *ex, const char *option); bool p11_enumerate_ready (p11_enumerate *ex, const char *def_filter); void p11_enumerate_cleanup (p11_enumerate *ex); #endif /* P11_ENUMERATE_H_ */ p11-kit-0.20.2/trust/builder.h0000664000175000017500000000520412226763526012700 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_BUILDER_H_ #define P11_BUILDER_H_ #include "asn1.h" #include "dict.h" #include "index.h" #include "pkcs11.h" enum { P11_BUILDER_FLAG_NONE = 0, P11_BUILDER_FLAG_TOKEN = 1 << 1, }; typedef struct _p11_builder p11_builder; p11_builder * p11_builder_new (int flags); void p11_builder_free (p11_builder *builder); CK_RV p11_builder_build (void *builder, p11_index *index, CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge, CK_ATTRIBUTE **populate); void p11_builder_changed (void *builder, p11_index *index, CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs); p11_asn1_cache * p11_builder_get_cache (p11_builder *builder); #endif /* P11_BUILDER_H_ */ p11-kit-0.20.2/HACKING0000664000175000017500000000050112144374545010700 00000000000000HACKING p11-kit * Documentation on developing p11-kit: http://p11-glue.freedesktop.org/doc/p11-kit/devel.html * General Website: http://p11-glue.freedesktop.org/p11-kit.html * Mailing list: p11-glue@lists.freedesktop.org * Report bugs here: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue p11-kit-0.20.2/common/0000775000175000017500000000000012265245671011266 500000000000000p11-kit-0.20.2/common/mock.h0000664000175000017500000021144412226763526012317 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef __MOCK_H__ #define __MOCK_H__ #include "compat.h" #include "pkcs11.h" #include "pkcs11x.h" enum { MOCK_DATA_OBJECT = 2, MOCK_PRIVATE_KEY_CAPITALIZE = 3, MOCK_PUBLIC_KEY_CAPITALIZE = 4, MOCK_PRIVATE_KEY_PREFIX = 5, MOCK_PUBLIC_KEY_PREFIX = 6, /* * CKM_MOCK_CAPITALIZE (encrypt/decrypt) * - Capitalizes to encrypt * - Lowercase to decrypt */ CKM_MOCK_CAPITALIZE = (CKM_VENDOR_DEFINED | 1), /* * CKM_MOCK_PREFIX (sign/verify) * - Sign prefixes the data with a key label * - Verify unprefixes data using key label */ CKM_MOCK_PREFIX = (CKM_VENDOR_DEFINED | 2), /* * CKM_MOCK_GENERATE (generate-pair) * - Generates a pair of keys, mechanism parameter should be 'generate' */ CKM_MOCK_GENERATE = (CKM_VENDOR_DEFINED | 3), /* * CKM_MOCK_WRAP (wrap key) * - Wraps key by returning value, mechanism parameter should be 'wrap' */ CKM_MOCK_WRAP = (CKM_VENDOR_DEFINED | 4), /* * CKM_MOCK_DERIVE (derive-key) * - Derives key by setting value to 'derived' * - Mechanism param should be 'derive' */ CKM_MOCK_DERIVE = (CKM_VENDOR_DEFINED | 5), /* * CKM_MOCK_COUNT (digest) * - Counts the number of bytes, and returns a CK_ULONG 'hash' value */ CKM_MOCK_COUNT = (CKM_VENDOR_DEFINED | 6), MOCK_SLOT_ONE_ID = 52, MOCK_SLOT_TWO_ID = 134, MOCK_SLOTS_PRESENT = 1, MOCK_SLOTS_ALL = 2, }; static const CK_INFO MOCK_INFO = { { CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, "MOCK MANUFACTURER ", 0, "MOCK LIBRARY ", { 45, 145 } }; extern CK_FUNCTION_LIST mock_module; extern CK_FUNCTION_LIST mock_module_no_slots; extern CK_X_FUNCTION_LIST mock_x_module_no_slots; void mock_module_init (void); typedef bool (* mock_enumerator) (CK_OBJECT_HANDLE handle, CK_ATTRIBUTE *attrs, void *user_data); void mock_module_enumerate_objects (CK_SESSION_HANDLE session, mock_enumerator func, void *user_data); void mock_module_add_object (CK_SLOT_ID slot_id, const CK_ATTRIBUTE *attrs); void mock_module_reset (void); bool mock_module_initialized (void); void mock_module_take_object (CK_SLOT_ID slot_id, CK_ATTRIBUTE *attrs); CK_RV mock_C_Initialize (CK_VOID_PTR init_args); CK_RV mock_C_Initialize__fails (CK_VOID_PTR init_args); CK_RV mock_X_Initialize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR init_args); CK_RV mock_C_Finalize (CK_VOID_PTR reserved); CK_RV mock_X_Finalize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR reserved); CK_RV mock_C_GetInfo (CK_INFO_PTR info); CK_RV mock_X_GetInfo (CK_X_FUNCTION_LIST *self, CK_INFO_PTR info); CK_RV mock_C_GetFunctionList_not_supported (CK_FUNCTION_LIST_PTR_PTR list); CK_RV mock_C_GetSlotList (CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count); CK_RV mock_C_GetSlotList__no_tokens (CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count); CK_RV mock_C_GetSlotList__fail_first (CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count); CK_RV mock_C_GetSlotList__fail_late (CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count); CK_RV mock_C_GetSlotInfo (CK_SLOT_ID slot_id, CK_SLOT_INFO_PTR info); CK_RV mock_X_GetSlotList__no_tokens (CK_X_FUNCTION_LIST *self, CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count); CK_RV mock_C_GetSlotInfo__invalid_slotid (CK_SLOT_ID slot_id, CK_SLOT_INFO_PTR info); CK_RV mock_X_GetSlotInfo__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_SLOT_INFO_PTR info); CK_RV mock_C_GetTokenInfo (CK_SLOT_ID slot_id, CK_TOKEN_INFO_PTR info); CK_RV mock_C_GetTokenInfo__invalid_slotid (CK_SLOT_ID slot_id, CK_TOKEN_INFO_PTR info); CK_RV mock_X_GetTokenInfo__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_TOKEN_INFO_PTR info); CK_RV mock_C_GetTokenInfo__not_initialized (CK_SLOT_ID slot_id, CK_TOKEN_INFO_PTR info); CK_RV mock_C_GetMechanismList (CK_SLOT_ID slot_id, CK_MECHANISM_TYPE_PTR mechanism_list, CK_ULONG_PTR count); CK_RV mock_C_GetMechanismList__invalid_slotid (CK_SLOT_ID slot_id, CK_MECHANISM_TYPE_PTR mechanism_list, CK_ULONG_PTR count); CK_RV mock_X_GetMechanismList__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_MECHANISM_TYPE_PTR mechanism_list, CK_ULONG_PTR count); CK_RV mock_C_GetMechanismInfo (CK_SLOT_ID slot_id, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR info); CK_RV mock_C_GetMechanismInfo__invalid_slotid (CK_SLOT_ID slot_id, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR info); CK_RV mock_X_GetMechanismInfo__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR info); CK_RV mock_C_InitToken__specific_args (CK_SLOT_ID slot_id, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len, CK_UTF8CHAR_PTR label); CK_RV mock_C_InitToken__invalid_slotid (CK_SLOT_ID slot_id, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len, CK_UTF8CHAR_PTR label); CK_RV mock_X_InitToken__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len, CK_UTF8CHAR_PTR label); CK_RV mock_C_WaitForSlotEvent (CK_FLAGS flags, CK_SLOT_ID_PTR slot, CK_VOID_PTR reserved); CK_RV mock_C_WaitForSlotEvent__no_event (CK_FLAGS flags, CK_SLOT_ID_PTR slot, CK_VOID_PTR reserved); CK_RV mock_X_WaitForSlotEvent__no_event (CK_X_FUNCTION_LIST *self, CK_FLAGS flags, CK_SLOT_ID_PTR slot, CK_VOID_PTR reserved); CK_RV mock_C_OpenSession__invalid_slotid (CK_SLOT_ID slot_id, CK_FLAGS flags, CK_VOID_PTR user_data, CK_NOTIFY callback, CK_SESSION_HANDLE_PTR session); CK_RV mock_X_OpenSession__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_FLAGS flags, CK_VOID_PTR user_data, CK_NOTIFY callback, CK_SESSION_HANDLE_PTR session); CK_RV mock_C_OpenSession__fails (CK_SLOT_ID slot_id, CK_FLAGS flags, CK_VOID_PTR user_data, CK_NOTIFY callback, CK_SESSION_HANDLE_PTR session); CK_RV mock_C_OpenSession (CK_SLOT_ID slot_id, CK_FLAGS flags, CK_VOID_PTR user_data, CK_NOTIFY callback, CK_SESSION_HANDLE_PTR session); CK_RV mock_C_CloseSession (CK_SESSION_HANDLE session); CK_RV mock_C_CloseSession__invalid_handle (CK_SESSION_HANDLE session); CK_RV mock_X_CloseSession__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session); CK_RV mock_C_CloseAllSessions (CK_SLOT_ID slot_id); CK_RV mock_C_CloseAllSessions__invalid_slotid (CK_SLOT_ID slot_id); CK_RV mock_X_CloseAllSessions__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id); CK_RV mock_C_GetFunctionStatus (CK_SESSION_HANDLE session); CK_RV mock_C_GetFunctionStatus__not_parallel (CK_SESSION_HANDLE session); CK_RV mock_C_CancelFunction (CK_SESSION_HANDLE session); CK_RV mock_C_CancelFunction__not_parallel (CK_SESSION_HANDLE session); CK_RV mock_C_GetSessionInfo (CK_SESSION_HANDLE session, CK_SESSION_INFO_PTR info); CK_RV mock_C_GetSessionInfo__invalid_handle (CK_SESSION_HANDLE session, CK_SESSION_INFO_PTR info); CK_RV mock_X_GetSessionInfo__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_SESSION_INFO_PTR info); CK_RV mock_C_InitPIN__specific_args (CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len); CK_RV mock_C_InitPIN__invalid_handle (CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len); CK_RV mock_X_InitPIN__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len); CK_RV mock_C_SetPIN__specific_args (CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR old_pin, CK_ULONG old_pin_len, CK_UTF8CHAR_PTR new_pin, CK_ULONG new_pin_len); CK_RV mock_C_SetPIN__invalid_handle (CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR old_pin, CK_ULONG old_pin_len, CK_UTF8CHAR_PTR new_pin, CK_ULONG new_pin_len); CK_RV mock_X_SetPIN__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR old_pin, CK_ULONG old_pin_len, CK_UTF8CHAR_PTR new_pin, CK_ULONG new_pin_len); CK_RV mock_C_GetOperationState (CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG_PTR operation_state_len); CK_RV mock_C_GetOperationState__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG_PTR operation_state_len); CK_RV mock_X_GetOperationState__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG_PTR operation_state_len); CK_RV mock_C_SetOperationState (CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key, CK_OBJECT_HANDLE authentication_key); CK_RV mock_C_SetOperationState__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key, CK_OBJECT_HANDLE authentication_key); CK_RV mock_X_SetOperationState__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key, CK_OBJECT_HANDLE authentication_key); CK_RV mock_C_Login (CK_SESSION_HANDLE session, CK_USER_TYPE user_type, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len); CK_RV mock_C_Login__invalid_handle (CK_SESSION_HANDLE session, CK_USER_TYPE user_type, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len); CK_RV mock_X_Login__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_USER_TYPE user_type, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len); CK_RV mock_C_Logout (CK_SESSION_HANDLE session); CK_RV mock_C_Logout__invalid_handle (CK_SESSION_HANDLE session); CK_RV mock_X_Logout__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session); CK_RV mock_C_CreateObject (CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR object); CK_RV mock_C_CreateObject__invalid_handle (CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object); CK_RV mock_X_CreateObject__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object); CK_RV mock_C_CopyObject (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object); CK_RV mock_C_CopyObject__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object); CK_RV mock_X_CopyObject__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object); CK_RV mock_C_DestroyObject (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object); CK_RV mock_C_DestroyObject__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object); CK_RV mock_X_DestroyObject__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object); CK_RV mock_C_GetObjectSize (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ULONG_PTR size); CK_RV mock_C_GetObjectSize__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ULONG_PTR size); CK_RV mock_X_GetObjectSize__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ULONG_PTR size); CK_RV mock_C_GetAttributeValue (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_C_GetAttributeValue__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_X_GetAttributeValue__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_C_GetAttributeValue__fail_first (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_C_GetAttributeValue__fail_late (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_C_SetAttributeValue (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_C_SetAttributeValue__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_X_SetAttributeValue__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_C_FindObjectsInit (CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_C_FindObjectsInit__invalid_handle (CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_X_FindObjectsInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_C_FindObjectsInit__fails (CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count); CK_RV mock_C_FindObjects (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE_PTR objects, CK_ULONG max_object_count, CK_ULONG_PTR object_count); CK_RV mock_C_FindObjects__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE_PTR objects, CK_ULONG max_count, CK_ULONG_PTR count); CK_RV mock_X_FindObjects__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE_PTR objects, CK_ULONG max_count, CK_ULONG_PTR count); CK_RV mock_C_FindObjects__fails (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE_PTR objects, CK_ULONG max_count, CK_ULONG_PTR count); CK_RV mock_C_FindObjectsFinal (CK_SESSION_HANDLE session); CK_RV mock_C_FindObjectsFinal__invalid_handle (CK_SESSION_HANDLE session); CK_RV mock_X_FindObjectsFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session); CK_RV mock_C_EncryptInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_EncryptInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_X_EncryptInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_Encrypt (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR encrypted_data, CK_ULONG_PTR encrypted_data_len); CK_RV mock_C_Encrypt__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR encrypted_data, CK_ULONG_PTR encrypted_data_len); CK_RV mock_X_Encrypt__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR encrypted_data, CK_ULONG_PTR encrypted_data_len); CK_RV mock_C_EncryptUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len); CK_RV mock_C_EncryptUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len); CK_RV mock_X_EncryptUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len); CK_RV mock_C_EncryptFinal (CK_SESSION_HANDLE session, CK_BYTE_PTR last_encrypted_part, CK_ULONG_PTR last_encrypted_part_len); CK_RV mock_C_EncryptFinal__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len); CK_RV mock_X_EncryptFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len); CK_RV mock_C_DecryptInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_DecryptInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_X_DecryptInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_Decrypt (CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_data, CK_ULONG encrypted_data_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len); CK_RV mock_C_Decrypt__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR enc_data, CK_ULONG enc_data_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len); CK_RV mock_X_Decrypt__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR enc_data, CK_ULONG enc_data_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len); CK_RV mock_C_DecryptUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len); CK_RV mock_C_DecryptUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len); CK_RV mock_X_DecryptUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len); CK_RV mock_C_DecryptFinal (CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len); CK_RV mock_C_DecryptFinal__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len); CK_RV mock_X_DecryptFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len); CK_RV mock_C_DigestInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism); CK_RV mock_C_DigestInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism); CK_RV mock_X_DigestInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism); CK_RV mock_C_Digest (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len); CK_RV mock_C_Digest__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len); CK_RV mock_X_Digest__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len); CK_RV mock_C_DigestUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len); CK_RV mock_C_DigestUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len); CK_RV mock_X_DigestUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len); CK_RV mock_C_DigestKey (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key); CK_RV mock_C_DigestKey__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key); CK_RV mock_X_DigestKey__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key); CK_RV mock_C_DigestFinal (CK_SESSION_HANDLE session, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len); CK_RV mock_C_DigestFinal__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len); CK_RV mock_X_DigestFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len); CK_RV mock_C_SignInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_SignInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_X_SignInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_Sign (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len); CK_RV mock_C_Sign__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len); CK_RV mock_X_Sign__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len); CK_RV mock_C_SignUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len); CK_RV mock_C_SignUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len); CK_RV mock_X_SignUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len); CK_RV mock_C_SignFinal (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len); CK_RV mock_C_SignFinal__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len); CK_RV mock_X_SignFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len); CK_RV mock_C_SignRecoverInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_SignRecoverInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_X_SignRecoverInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_SignRecover (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len); CK_RV mock_C_SignRecover__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len); CK_RV mock_X_SignRecover__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len); CK_RV mock_C_VerifyInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_VerifyInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_X_VerifyInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_Verify (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG signature_len); CK_RV mock_C_Verify__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG signature_len); CK_RV mock_X_Verify__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG signature_len); CK_RV mock_C_VerifyUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len); CK_RV mock_C_VerifyUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len); CK_RV mock_X_VerifyUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len); CK_RV mock_C_VerifyFinal (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len); CK_RV mock_C_VerifyFinal__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len); CK_RV mock_X_VerifyFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len); CK_RV mock_C_VerifyRecoverInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_VerifyRecoverInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_X_VerifyRecoverInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key); CK_RV mock_C_VerifyRecover (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len); CK_RV mock_C_VerifyRecover__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len); CK_RV mock_X_VerifyRecover__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len); CK_RV mock_C_DigestEncryptUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len); CK_RV mock_C_DigestEncryptUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len); CK_RV mock_X_DigestEncryptUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len); CK_RV mock_C_DecryptDigestUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len); CK_RV mock_C_DecryptDigestUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len); CK_RV mock_X_DecryptDigestUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len); CK_RV mock_C_SignEncryptUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len); CK_RV mock_C_SignEncryptUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len); CK_RV mock_X_SignEncryptUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len); CK_RV mock_C_DecryptVerifyUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len); CK_RV mock_C_DecryptVerifyUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len); CK_RV mock_X_DecryptVerifyUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len); CK_RV mock_C_GenerateKey (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key); CK_RV mock_C_GenerateKey__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key); CK_RV mock_X_GenerateKey__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key); CK_RV mock_C_GenerateKeyPair (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR public_key_template, CK_ULONG public_key_count, CK_ATTRIBUTE_PTR private_key_template, CK_ULONG private_key_count, CK_OBJECT_HANDLE_PTR public_key, CK_OBJECT_HANDLE_PTR private_key); CK_RV mock_C_GenerateKeyPair__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR pub_template, CK_ULONG pub_count, CK_ATTRIBUTE_PTR priv_template, CK_ULONG priv_count, CK_OBJECT_HANDLE_PTR pub_key, CK_OBJECT_HANDLE_PTR priv_key); CK_RV mock_X_GenerateKeyPair__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR pub_template, CK_ULONG pub_count, CK_ATTRIBUTE_PTR priv_template, CK_ULONG priv_count, CK_OBJECT_HANDLE_PTR pub_key, CK_OBJECT_HANDLE_PTR priv_key); CK_RV mock_C_WrapKey (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key, CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len); CK_RV mock_C_WrapKey__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key, CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len); CK_RV mock_X_WrapKey__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key, CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len); CK_RV mock_C_UnwrapKey (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key, CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key); CK_RV mock_C_UnwrapKey__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key, CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key); CK_RV mock_X_UnwrapKey__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key, CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key); CK_RV mock_C_DeriveKey (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key); CK_RV mock_C_DeriveKey__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key); CK_RV mock_X_DeriveKey__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key); CK_RV mock_C_SeedRandom (CK_SESSION_HANDLE session, CK_BYTE_PTR seed, CK_ULONG seed_len); CK_RV mock_C_SeedRandom__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR seed, CK_ULONG seed_len); CK_RV mock_X_SeedRandom__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR seed, CK_ULONG seed_len); CK_RV mock_C_GenerateRandom (CK_SESSION_HANDLE session, CK_BYTE_PTR random_data, CK_ULONG random_len); CK_RV mock_C_GenerateRandom__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR random_data, CK_ULONG random_len); CK_RV mock_X_GenerateRandom__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR random_data, CK_ULONG random_len); #endif /* __MOCK_H__ */ p11-kit-0.20.2/common/argv.h0000664000175000017500000000361512226763526012324 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_ARGV_H_ #define P11_ARGV_H_ #include "compat.h" bool p11_argv_parse (const char *string, void (*sink) (char *, void *), void *argument); #endif /* P11_ARGV_H_ */ p11-kit-0.20.2/common/url.c0000664000175000017500000000713012226763526012156 00000000000000/* * Copyright (C) 2011 Collabora Ltd. * Copyright (C) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "debug.h" #include "url.h" #include #include #include #include #include const static char HEX_CHARS[] = "0123456789abcdef"; unsigned char * p11_url_decode (const char *value, const char *end, const char *skip, size_t *length) { char *a, *b; unsigned char *result, *p; assert (value <= end); assert (skip != NULL); /* String can only get shorter */ result = malloc ((end - value) + 1); return_val_if_fail (result != NULL, NULL); /* Now loop through looking for escapes */ p = result; while (value != end) { /* * A percent sign followed by two hex digits means * that the digits represent an escaped character. */ if (*value == '%') { value++; if (value + 2 > end) { free (result); return NULL; } a = strchr (HEX_CHARS, tolower (value[0])); b = strchr (HEX_CHARS, tolower (value[1])); if (!a || !b) { free (result); return NULL; } *p = (a - HEX_CHARS) << 4; *(p++) |= (b - HEX_CHARS); value += 2; /* Ignore whitespace characters */ } else if (strchr (skip, *value)) { value++; /* A different character */ } else { *(p++) = *(value++); } } /* Null terminate string, in case its a string */ *p = 0; if (length) *length = p - result; return result; } void p11_url_encode (const unsigned char *value, const unsigned char *end, const char *verbatim, p11_buffer *buf) { char hex[3]; assert (value <= end); /* Now loop through looking for escapes */ while (value != end) { /* These characters we let through verbatim */ if (*value && strchr (verbatim, *value) != NULL) { p11_buffer_add (buf, value, 1); /* All others get encoded */ } else { hex[0] = '%'; hex[1] = HEX_CHARS[((unsigned char)*value) >> 4]; hex[2] = HEX_CHARS[((unsigned char)*value) & 0x0F]; p11_buffer_add (buf, hex, 3); } ++value; } } p11-kit-0.20.2/common/compat.c0000664000175000017500000004157612226763526012653 00000000000000/* * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include #include #include #include /*- * Portions of this file are covered by the following copyright: * * Copyright (c) 2001 Mike Barcroft * Copyright (c) 1990, 1993 * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef HAVE_GETPROGNAME #ifdef OS_UNIX #if defined (HAVE_PROGRAM_INVOCATION_SHORT_NAME) && !HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME extern char *program_invocation_short_name; #endif #if defined (HAVE___PROGNAME) && !HAVE_DECL___PROGNAME extern char *__progname; #endif const char * getprogname (void) { const char *name; #if defined (HAVE_GETEXECNAME) const char *p; name = getexecname(); p = strrchr (name ? name : "", '/'); if (p != NULL) name = p + 1; #elif defined (HAVE_PROGRAM_INVOCATION_SHORT_NAME) name = program_invocation_short_name; #elif defined (HAVE___PROGNAME) name = __progname; #else #error No way to retrieve short program name #endif return name; } #else /* OS_WIN32 */ extern char **__argv; static char prognamebuf[256]; const char * getprogname (void) { const char *name; const char *p, *p2; size_t length; name = __argv[0]; if (name == NULL) return NULL; p = strrchr (name, '\\'); p2 = strrchr (name, '/'); if (p2 > p) p = p2; if (p != NULL) name = p + 1; length = sizeof (prognamebuf) - 1; strncpy (prognamebuf, name, length); prognamebuf[length] = 0; length = strlen (prognamebuf); if (length > 4 && _stricmp (prognamebuf + (length - 4), ".exe") == 0) prognamebuf[length - 4] = '\0'; return prognamebuf; } #endif /* OS_WIN32 */ #endif /* HAVE_GETPROGNAME */ #ifdef OS_UNIX #include #include #include #include void p11_mutex_init (p11_mutex_t *mutex) { pthread_mutexattr_t attr; int ret; pthread_mutexattr_init (&attr); pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_DEFAULT); ret = pthread_mutex_init (mutex, &attr); assert (ret == 0); pthread_mutexattr_destroy (&attr); } char * p11_dl_error (void) { const char *msg = dlerror (); return msg ? strdup (msg) : NULL; } struct _p11_mmap { int fd; void *data; size_t size; }; p11_mmap * p11_mmap_open (const char *path, struct stat *sb, void **data, size_t *size) { struct stat stb; p11_mmap *map; map = calloc (1, sizeof (p11_mmap)); if (map == NULL) return NULL; map->fd = open (path, O_RDONLY | O_CLOEXEC); if (map->fd == -1) { free (map); return NULL; } if (sb == NULL) { sb = &stb; if (fstat (map->fd, &stb) < 0) { close (map->fd); free (map); return NULL; } } /* Workaround for broken ZFS on Linux */ if (S_ISDIR (sb->st_mode)) { errno = EISDIR; close (map->fd); free (map); return NULL; } map->size = sb->st_size; map->data = mmap (NULL, map->size, PROT_READ, MAP_PRIVATE, map->fd, 0); if (map->data == NULL) { close (map->fd); free (map); return NULL; } *data = map->data; *size = map->size; return map; } void p11_mmap_close (p11_mmap *map) { munmap (map->data, map->size); close (map->fd); free (map); } #endif /* OS_UNIX */ #ifdef OS_WIN32 char * p11_dl_error (void) { DWORD code = GetLastError(); LPVOID msg_buf; FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, code, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&msg_buf, 0, NULL); return msg_buf; } void p11_dl_close (void *dl) { FreeLibrary (dl); } int p11_thread_create (p11_thread_t *thread, p11_thread_routine routine, void *arg) { assert (thread); *thread = CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE)routine, arg, 0, NULL); if (*thread == NULL) return GetLastError (); return 0; } int p11_thread_join (p11_thread_t thread) { DWORD res; res = WaitForSingleObject (thread, INFINITE); if (res == WAIT_FAILED) return GetLastError (); CloseHandle (thread); return 0; } struct _p11_mmap { HANDLE file; HANDLE mapping; void *data; }; p11_mmap * p11_mmap_open (const char *path, struct stat *sb, void **data, size_t *size) { HANDLE mapping; LARGE_INTEGER large; DWORD errn; p11_mmap *map; map = calloc (1, sizeof (p11_mmap)); if (map == NULL) { errno = ENOMEM; return NULL; } map->file = CreateFile (path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, NULL); if (map->file == INVALID_HANDLE_VALUE) { errn = GetLastError (); free (map); SetLastError (errn); if (errn == ERROR_PATH_NOT_FOUND || errn == ERROR_FILE_NOT_FOUND) errno = ENOENT; else if (errn == ERROR_ACCESS_DENIED) errno = EPERM; return NULL; } if (sb == NULL) { if (!GetFileSizeEx (map->file, &large)) { errn = GetLastError (); CloseHandle (map->file); free (map); SetLastError (errn); if (errn == ERROR_ACCESS_DENIED) errno = EPERM; return NULL; } } else { large.QuadPart = sb->st_size; } mapping = CreateFileMapping (map->file, NULL, PAGE_READONLY, 0, 0, NULL); if (!mapping) { errn = GetLastError (); CloseHandle (map->file); free (map); SetLastError (errn); if (errn == ERROR_ACCESS_DENIED) errno = EPERM; return NULL; } map->data = MapViewOfFile (mapping, FILE_MAP_READ, 0, 0, large.QuadPart); CloseHandle (mapping); if (map->data == NULL) { errn = GetLastError (); CloseHandle (map->file); free (map); SetLastError (errn); if (errn == ERROR_ACCESS_DENIED) errno = EPERM; return NULL; } *data = map->data; *size = large.QuadPart; return map; } void p11_mmap_close (p11_mmap *map) { UnmapViewOfFile (map->data); CloseHandle (map->file); free (map); } #endif /* OS_WIN32 */ #ifndef HAVE_STRNSTR #include /* * Find the first occurrence of find in s, where the search is limited to the * first slen characters of s. */ char * strnstr (const char *s, const char *find, size_t slen) { char c, sc; size_t len; if ((c = *find++) != '\0') { len = strlen (find); do { do { if (slen-- < 1 || (sc = *s++) == '\0') return (NULL); } while (sc != c); if (len > slen) return (NULL); } while (strncmp(s, find, len) != 0); s--; } return ((char *)s); } #endif /* HAVE_STRNSTR */ #ifndef HAVE_MEMDUP void * memdup (const void *data, size_t length) { void *dup; if (!data) return NULL; dup = malloc (length); if (dup != NULL) memcpy (dup, data, length); return dup; } #endif /* HAVE_MEMDUP */ /* * WORKAROUND: So in lots of released builds of firefox a completely broken strndup() * is present. It does not NULL terminate its string output. It is unconditionally * defined, and overrides the libc strndup() function on platforms where it * exists as a function. For this reason we (for now) unconditionally define * strndup(). */ #if 1 /* #ifndef HAVE_STRNDUP */ /* * HAVE_STRNDUP may be undefined if strndup() isn't working. So it may be * present, and yet strndup may still be a defined header macro. */ #ifdef strndup #undef strndup #endif char * strndup (const char *data, size_t length); char * strndup (const char *data, size_t length) { char *ret; ret = malloc (length + 1); if (ret != NULL) { strncpy (ret, data, length); ret[length] = 0; } return ret; } #endif /* HAVE_STRNDUP */ #ifndef HAVE_STRCONCAT #include char * strconcat (const char *first, ...) { size_t length = 0; const char *arg; char *result, *at; va_list va; va_start (va, first); for (arg = first; arg; arg = va_arg (va, const char*)) length += strlen (arg); va_end (va); at = result = malloc (length + 1); if (result == NULL) return NULL; va_start (va, first); for (arg = first; arg; arg = va_arg (va, const char*)) { length = strlen (arg); memcpy (at, arg, length); at += length; } va_end (va); *at = 0; return result; } #endif /* HAVE_STRCONCAT */ #ifndef HAVE_ASPRINTF int asprintf (char **strp, const char *fmt, ...) { va_list va; int ret; va_start (va, fmt); ret = vasprintf (strp, fmt, va); va_end (va); return ret; } #endif /* HAVE_ASPRINTF */ #ifndef HAVE_VASPRINTF #include int vasprintf (char **strp, const char *fmt, va_list ap) { char *buf = NULL; char *nbuf; int guess = 128; int length = 0; int ret; if (fmt == NULL) { errno = EINVAL; return -1; } for (;;) { nbuf = realloc (buf, guess); if (!nbuf) { free (buf); return -1; } buf = nbuf; length = guess; ret = vsnprintf (buf, length, fmt, ap); if (ret < 0) guess *= 2; else if (ret >= length) guess = ret + 1; else break; } *strp = buf; return ret; } #endif /* HAVE_VASPRINTF */ #ifndef HAVE_GMTIME_R struct tm * gmtime_r (const time_t *timep, struct tm *result) { #ifdef OS_WIN32 /* * On win32 gmtime() returns thread local storage, so we can * just copy it out into the buffer without worrying about races. */ struct tm *tg; tg = gmtime (timep); if (!tg) return NULL; memcpy (result, tg, sizeof (struct tm)); return result; #else #error Need either gmtime_r() function on Unix #endif } #endif /* HAVE_GMTIME_R */ #ifndef HAVE_TIMEGM time_t timegm (struct tm *tm) { time_t tl, tb; struct tm tg; tl = mktime (tm); if (tl == -1) { tm->tm_hour--; tl = mktime (tm); if (tl == -1) return -1; tl += 3600; } gmtime_r (&tl, &tg); tg.tm_isdst = 0; tb = mktime (&tg); if (tb == -1) { tg.tm_hour--; tb = mktime (&tg); if (tb == -1) return -1; tb += 3600; } return (tl - (tb - tl)); } #endif /* HAVE_TIMEGM */ #if !defined(HAVE_MKDTEMP) || !defined(HAVE_MKSTEMP) #include #include static int _gettemp (char *path, int *doopen, int domkdir, int slen) { static const char padchar[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static const int maxpathlen = 1024; char *start, *trv, *suffp, *carryp; char *pad; struct stat sbuf; int rval; int rnd; char carrybuf[maxpathlen]; if ((doopen != NULL && domkdir) || slen < 0) { errno = EINVAL; return (0); } for (trv = path; *trv != '\0'; ++trv) ; if (trv - path >= maxpathlen) { errno = ENAMETOOLONG; return (0); } trv -= slen; suffp = trv; --trv; if (trv < path || NULL != strchr (suffp, '/')) { errno = EINVAL; return (0); } /* Fill space with random characters */ while (trv >= path && *trv == 'X') { rnd = rand () % sizeof (padchar) - 1; *trv-- = padchar[rnd]; } start = trv + 1; /* save first combination of random characters */ memcpy (carrybuf, start, suffp - start); /* * check the target directory. */ if (doopen != NULL || domkdir) { for (; trv > path; --trv) { if (*trv == '/') { *trv = '\0'; rval = stat(path, &sbuf); *trv = '/'; if (rval != 0) return (0); if (!S_ISDIR(sbuf.st_mode)) { errno = ENOTDIR; return (0); } break; } } } for (;;) { if (doopen) { if ((*doopen = open (path, O_BINARY | O_CREAT | O_EXCL | O_RDWR | O_CLOEXEC, 0600)) >= 0) return (1); if (errno != EEXIST) return (0); } else if (domkdir) { #ifdef OS_UNIX if (mkdir (path, 0700) == 0) #else if (mkdir (path) == 0) #endif return (1); if (errno != EEXIST) return (0); #ifdef OS_UNIX } else if (lstat (path, &sbuf)) #else } else if (stat (path, &sbuf)) #endif return (errno == ENOENT); /* If we have a collision, cycle through the space of filenames */ for (trv = start, carryp = carrybuf;;) { /* have we tried all possible permutations? */ if (trv == suffp) return (0); /* yes - exit with EEXIST */ pad = strchr(padchar, *trv); if (pad == NULL) { /* this should never happen */ errno = EIO; return (0); } /* increment character */ *trv = (*++pad == '\0') ? padchar[0] : *pad; /* carry to next position? */ if (*trv == *carryp) { /* increment position and loop */ ++trv; ++carryp; } else { /* try with new name */ break; } } } /*NOTREACHED*/ } #endif /* !HAVE_MKDTEMP || !HAVE_MKSTEMP */ #ifndef HAVE_MKSTEMP int mkstemp (char *template) { int fd; return (_gettemp (template, &fd, 0, 0) ? fd : -1); } #endif /* HAVE_MKSTEMP */ #ifndef HAVE_MKDTEMP char * mkdtemp (char *template) { return (_gettemp (template, (int *)NULL, 1, 0) ? template : (char *)NULL); } #endif /* HAVE_MKDTEMP */ #ifndef HAVE_GETAUXVAL unsigned long getauxval (unsigned long type) { static unsigned long secure = 0UL; static bool check_secure_initialized = false; /* * This is the only one our stand-in impl supports and is * also the only type we define in compat.h header */ assert (type == AT_SECURE); if (!check_secure_initialized) { #if defined(HAVE___LIBC_ENABLE_SECURE) extern int __libc_enable_secure; secure = __libc_enable_secure; #elif defined(HAVE_ISSETUGID) secure = issetugid (); #elif defined(OS_UNIX) uid_t ruid, euid, suid; /* Real, effective and saved user ID's */ gid_t rgid, egid, sgid; /* Real, effective and saved group ID's */ #ifdef HAVE_GETRESUID if (getresuid (&ruid, &euid, &suid) != 0 || getresgid (&rgid, &egid, &sgid) != 0) #endif /* HAVE_GETRESUID */ { suid = ruid = getuid (); sgid = rgid = getgid (); euid = geteuid (); egid = getegid (); } secure = (ruid != euid || ruid != suid || rgid != egid || rgid != sgid); #endif /* OS_UNIX */ check_secure_initialized = true; } return secure; } #endif /* HAVE_GETAUXVAL */ #ifndef HAVE_STRERROR_R int strerror_r (int errnum, char *buf, size_t buflen) { #ifdef OS_WIN32 return strerror_s (buf, buflen, errnum); #else #error no strerror_r implementation #endif } #endif /* HAVE_STRERROR_R */ p11-kit-0.20.2/common/constants.h0000664000175000017500000000557012226763526013403 00000000000000/* * Copyright (C) 2012, Redhat Inc. * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_CONSTANTS_H_ #define P11_CONSTANTS_H_ #include "compat.h" #include "dict.h" #include "pkcs11.h" typedef struct { CK_ULONG value; const char *name; const char *nick; } p11_constant; const char * p11_constant_name (const p11_constant *constants, CK_ULONG value); const char * p11_constant_nick (const p11_constant *constants, CK_ULONG type); p11_dict * p11_constant_reverse (bool nick); CK_ULONG p11_constant_resolve (p11_dict *table, const char *string); extern const p11_constant p11_constant_types[]; extern const p11_constant p11_constant_classes[]; extern const p11_constant p11_constant_trusts[]; extern const p11_constant p11_constant_certs[]; extern const p11_constant p11_constant_keys[]; extern const p11_constant p11_constant_asserts[]; extern const p11_constant p11_constant_categories[]; extern const p11_constant p11_constant_mechanisms[]; extern const p11_constant p11_constant_states[]; extern const p11_constant p11_constant_users[]; extern const p11_constant p11_constant_returns[]; #endif /* P11_CONSTANTS_H_ */ p11-kit-0.20.2/common/path.c0000664000175000017500000001535612226763526012321 00000000000000/* * Copyright (c) 2005 Stefan Walter * Copyright (c) 2011 Collabora Ltd. * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * CONTRIBUTORS * Stef Walter */ #include "config.h" #include "debug.h" #include "message.h" #include "path.h" #include #include #include #include #include #ifdef OS_UNIX #include #include #endif #ifdef OS_WIN32 #include #endif char * p11_path_base (const char *path) { #ifdef OS_WIN32 const char *delims = "/\\"; #else const char *delims = "/"; #endif const char *end; const char *beg; return_val_if_fail (path != NULL, NULL); /* Any trailing slashes */ end = path + strlen (path); while (end != path) { if (!strchr (delims, *(end - 1))) break; end--; } /* Find the last slash after those */ beg = end; while (beg != path) { if (strchr (delims, *(beg - 1))) break; beg--; } return strndup (beg, end - beg); } static inline bool is_path_component_or_null (char ch) { return (ch == '\0' || ch == '/' #ifdef OS_WIN32 || ch == '\\' #endif ); } static char * expand_homedir (const char *remainder) { const char *env; if (getauxval (AT_SECURE)) { errno = EPERM; return NULL; } while (remainder[0] && is_path_component_or_null (remainder[0])) remainder++; if (remainder[0] == '\0') remainder = NULL; /* Expand $XDG_CONFIG_HOME */ if (remainder != NULL && strncmp (remainder, ".config", 7) == 0 && is_path_component_or_null (remainder[7])) { env = getenv ("XDG_CONFIG_HOME"); if (env && env[0]) return p11_path_build (env, remainder + 8, NULL); } env = getenv ("HOME"); if (env && env[0]) { return p11_path_build (env, remainder, NULL); } else { #ifdef OS_UNIX char buf[1024]; struct passwd pws; struct passwd *pwd; int error = 0; int ret; ret = getpwuid_r (getuid (), &pws, buf, sizeof (buf), &pwd); if (ret == 0 && !pwd) { ret = -1; errno = ESRCH; } if (ret < 0) { error = errno; p11_message_err (errno, "couldn't lookup home directory for user %d", getuid ()); errno = error; return NULL; } return p11_path_build (pwd->pw_dir, remainder, NULL); #else /* OS_WIN32 */ char directory[MAX_PATH + 1]; if (!SHGetSpecialFolderPathA (NULL, directory, CSIDL_PROFILE, TRUE)) { p11_message ("couldn't lookup home directory for user"); errno = ENOTDIR; return NULL; } return p11_path_build (directory, remainder, NULL); #endif /* OS_WIN32 */ } } char * p11_path_expand (const char *path) { return_val_if_fail (path != NULL, NULL); if (strncmp (path, "~", 1) == 0 && is_path_component_or_null (path[1])) { return expand_homedir (path + 1); } else { return strdup (path); } } bool p11_path_absolute (const char *path) { return_val_if_fail (path != NULL, false); return (path[0] == '/') #ifdef OS_WIN32 || (path[0] != '\0' && path[1] == ':' && path[2] == '\\') #endif ; } char * p11_path_build (const char *path, ...) { #ifdef OS_WIN32 const char delim = '\\'; #else const char delim = '/'; #endif const char *first = path; char *built; size_t len; size_t at; size_t num; size_t until; va_list va; return_val_if_fail (path != NULL, NULL); len = 1; va_start (va, path); while (path != NULL) { len += strlen (path) + 1; path = va_arg (va, const char *); } va_end (va); built = malloc (len + 1); return_val_if_fail (built != NULL, NULL); at = 0; path = first; va_start (va, path); while (path != NULL) { num = strlen (path); /* Trim end of the path */ until = (at > 0) ? 0 : 1; while (num > until && is_path_component_or_null (path[num - 1])) num--; if (at != 0) { if (num == 0) continue; built[at++] = delim; } assert (at + num < len); memcpy (built + at, path, num); at += num; path = va_arg (va, const char *); /* Trim beginning of path */ while (path && path[0] && is_path_component_or_null (path[0])) path++; } va_end (va); assert (at < len); built[at] = '\0'; return built; } char * p11_path_parent (const char *path) { const char *e; char *parent; bool had = false; return_val_if_fail (path != NULL, NULL); /* Find the end of the last component */ e = path + strlen (path); while (e != path && is_path_component_or_null (*e)) e--; /* Find the beginning of the last component */ while (e != path && !is_path_component_or_null (*e)) { had = true; e--; } /* Find the end of the last component */ while (e != path && is_path_component_or_null (*e)) e--; if (e == path) { if (!had) return NULL; parent = strdup ("/"); } else { parent = strndup (path, (e - path) + 1); } return_val_if_fail (parent != NULL, NULL); return parent; } bool p11_path_prefix (const char *string, const char *prefix) { int a, b; return_val_if_fail (string != NULL, false); return_val_if_fail (prefix != NULL, false); a = strlen (string); b = strlen (prefix); return a > b && strncmp (string, prefix, b) == 0 && is_path_component_or_null (string[b]); } void p11_path_canon (char *name) { static const char *VALID = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_"; int i; return_if_fail (name != NULL); for (i = 0; name[i] != '\0'; i++) { if (strchr (VALID, name[i]) == NULL) name[i] = '_'; } } p11-kit-0.20.2/common/array.c0000664000175000017500000000626612161102013012453 00000000000000/* * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ #include "config.h" #include "array.h" #include "debug.h" #include #include static bool maybe_expand_array (p11_array *array, unsigned int length) { unsigned int new_allocated; void **new_memory; if (length <= array->allocated) return true; new_allocated = array->allocated + 16; if (new_allocated < length) new_allocated = length; new_memory = realloc (array->elem, new_allocated * sizeof (void*)); return_val_if_fail (new_memory != NULL, false); array->elem = new_memory; array->allocated = new_allocated; return true; } p11_array * p11_array_new (p11_destroyer destroyer) { p11_array *array; array = calloc (1, sizeof (p11_array)); if (array == NULL) return NULL; if (!maybe_expand_array (array, 2)) { p11_array_free (array); return NULL; } array->destroyer = destroyer; return array; } void p11_array_free (p11_array *array) { if (array == NULL) return; p11_array_clear (array); free (array->elem); free (array); } bool p11_array_push (p11_array *array, void *value) { if (!maybe_expand_array (array, array->num + 1)) return_val_if_reached (false); array->elem[array->num] = value; array->num++; return true; } void p11_array_remove (p11_array *array, unsigned int index) { if (array->destroyer) (array->destroyer) (array->elem[index]); memmove (array->elem + index, array->elem + index + 1, (array->num - (index + 1)) * sizeof (void*)); array->num--; } void p11_array_clear (p11_array *array) { int i; if (array->destroyer) { for (i = 0; i < array->num; i++) (array->destroyer) (array->elem[i]); } array->num = 0; } p11-kit-0.20.2/common/pkcs11x.h0000664000175000017500000006452112226763526012662 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef PKCS11_X_H_ #define PKCS11_X_H_ 1 #if defined(__cplusplus) extern "C" { #endif /* ------------------------------------------------------------------- * NSS TRUST OBJECTS * * And related, non-standard */ /* Define this if you want the NSS specific symbols */ #define CRYPTOKI_NSS_VENDOR_DEFINED 1 #ifdef CRYPTOKI_NSS_VENDOR_DEFINED /* Various NSS objects */ #define CKO_NSS_CRL 0xce534351UL #define CKO_NSS_SMIME 0xce534352UL #define CKO_NSS_TRUST 0xce534353UL #define CKO_NSS_BUILTIN_ROOT_LIST 0xce534354UL #define CKO_NSS_NEWSLOT 0xce534355UL #define CKO_NSS_DELSLOT 0xce534356UL /* Various NSS key types */ #define CKK_NSS_PKCS8 0xce534351UL /* Various NSS attributes */ #define CKA_NSS_URL 0xce534351UL #define CKA_NSS_EMAIL 0xce534352UL #define CKA_NSS_SMIME_INFO 0xce534353UL #define CKA_NSS_SMIME_TIMESTAMP 0xce534354UL #define CKA_NSS_PKCS8_SALT 0xce534355UL #define CKA_NSS_PASSWORD_CHECK 0xce534356UL #define CKA_NSS_EXPIRES 0xce534357UL #define CKA_NSS_KRL 0xce534358UL #define CKA_NSS_PQG_COUNTER 0xce534364UL #define CKA_NSS_PQG_SEED 0xce534365UL #define CKA_NSS_PQG_H 0xce534366UL #define CKA_NSS_PQG_SEED_BITS 0xce534367UL #define CKA_NSS_MODULE_SPEC 0xce534368UL /* NSS trust attributes */ #define CKA_TRUST_DIGITAL_SIGNATURE 0xce536351UL #define CKA_TRUST_NON_REPUDIATION 0xce536352UL #define CKA_TRUST_KEY_ENCIPHERMENT 0xce536353UL #define CKA_TRUST_DATA_ENCIPHERMENT 0xce536354UL #define CKA_TRUST_KEY_AGREEMENT 0xce536355UL #define CKA_TRUST_KEY_CERT_SIGN 0xce536356UL #define CKA_TRUST_CRL_SIGN 0xce536357UL #define CKA_TRUST_SERVER_AUTH 0xce536358UL #define CKA_TRUST_CLIENT_AUTH 0xce536359UL #define CKA_TRUST_CODE_SIGNING 0xce53635aUL #define CKA_TRUST_EMAIL_PROTECTION 0xce53635bUL #define CKA_TRUST_IPSEC_END_SYSTEM 0xce53635cUL #define CKA_TRUST_IPSEC_TUNNEL 0xce53635dUL #define CKA_TRUST_IPSEC_USER 0xce53635eUL #define CKA_TRUST_TIME_STAMPING 0xce53635fUL #define CKA_TRUST_STEP_UP_APPROVED 0xce536360UL #define CKA_CERT_SHA1_HASH 0xce5363b4UL #define CKA_CERT_MD5_HASH 0xce5363b5UL /* NSS trust values */ typedef CK_ULONG CK_TRUST; #define CKT_NSS_TRUSTED 0xce534351UL #define CKT_NSS_TRUSTED_DELEGATOR 0xce534352UL #define CKT_NSS_MUST_VERIFY_TRUST 0xce534353UL #define CKT_NSS_NOT_TRUSTED 0xce53435AUL #define CKT_NSS_TRUST_UNKNOWN 0xce534355UL #define CKT_NSS_VALID_DELEGATOR 0xce53435BUL /* NSS specific mechanisms */ #define CKM_NSS_AES_KEY_WRAP 0xce534351UL #define CKM_NSS_AES_KEY_WRAP_PAD 0xce534352UL /* NSS specific return values */ #define CKR_NSS_CERTDB_FAILED 0xce534351UL #define CKR_NSS_KEYDB_FAILED 0xce534352UL #endif /* CRYPTOKI_NSS_VENDOR_DEFINED */ /* Define this if you want the vendor specific symbols */ #define CRYPTOKI_X_VENDOR_DEFINED 1 #ifdef CRYPTOKI_X_VENDOR_DEFINED #define CKA_X_VENDOR (CKA_VENDOR_DEFINED | 0x58444700UL) #define CKO_X_VENDOR (CKA_VENDOR_DEFINED | 0x58444700UL) /* ------------------------------------------------------------------- * TRUST ASSERTIONS * * These are retired and should not be used in new code */ #define CKO_X_TRUST_ASSERTION (CKO_X_VENDOR + 100) #define CKA_X_ASSERTION_TYPE (CKA_X_VENDOR + 1) #define CKA_X_CERTIFICATE_VALUE (CKA_X_VENDOR + 2) #define CKA_X_PURPOSE (CKA_X_VENDOR + 3) #define CKA_X_PEER (CKA_X_VENDOR + 4) typedef CK_ULONG CK_X_ASSERTION_TYPE; #define CKT_X_DISTRUSTED_CERTIFICATE 1UL #define CKT_X_PINNED_CERTIFICATE 2UL #define CKT_X_ANCHORED_CERTIFICATE 3UL /* ------------------------------------------------------------------- * STAPLED CERTIFICATES * * Not yet final */ #define CKO_X_CERTIFICATE_EXTENSION (CKO_X_VENDOR + 200) #define CKA_X_DISTRUSTED (CKA_X_VENDOR + 100) #define CKA_X_CRITICAL (CKA_X_VENDOR + 101) #define CKA_X_PUBLIC_KEY_INFO (CKA_X_VENDOR + 102) #endif /* CRYPTOKI_X_VENDOR_DEFINED */ /* ------------------------------------------------------------------- * SUBCLASSABLE PKCS#11 FUNCTIONS */ typedef struct _CK_X_FUNCTION_LIST CK_X_FUNCTION_LIST; typedef CK_RV (* CK_X_Initialize) (CK_X_FUNCTION_LIST *, CK_VOID_PTR); typedef CK_RV (* CK_X_Finalize) (CK_X_FUNCTION_LIST *, CK_VOID_PTR); typedef CK_RV (* CK_X_GetInfo) (CK_X_FUNCTION_LIST *, CK_INFO_PTR); typedef CK_RV (* CK_X_GetSlotList) (CK_X_FUNCTION_LIST *, CK_BBOOL, CK_SLOT_ID_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_GetSlotInfo) (CK_X_FUNCTION_LIST *, CK_SLOT_ID, CK_SLOT_INFO_PTR); typedef CK_RV (* CK_X_GetTokenInfo) (CK_X_FUNCTION_LIST *, CK_SLOT_ID, CK_TOKEN_INFO_PTR); typedef CK_RV (* CK_X_GetMechanismList) (CK_X_FUNCTION_LIST *, CK_SLOT_ID, CK_MECHANISM_TYPE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_GetMechanismInfo) (CK_X_FUNCTION_LIST *, CK_SLOT_ID, CK_MECHANISM_TYPE, CK_MECHANISM_INFO_PTR); typedef CK_RV (* CK_X_InitToken) (CK_X_FUNCTION_LIST *, CK_SLOT_ID, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR); typedef CK_RV (* CK_X_InitPIN) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_SetPIN) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_OpenSession) (CK_X_FUNCTION_LIST *, CK_SLOT_ID, CK_FLAGS, CK_VOID_PTR, CK_NOTIFY, CK_SESSION_HANDLE_PTR); typedef CK_RV (* CK_X_CloseSession) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE); typedef CK_RV (* CK_X_CloseAllSessions) (CK_X_FUNCTION_LIST *, CK_SLOT_ID); typedef CK_RV (* CK_X_GetSessionInfo) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_SESSION_INFO_PTR); typedef CK_RV (* CK_X_GetOperationState) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_SetOperationState) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_OBJECT_HANDLE, CK_OBJECT_HANDLE); typedef CK_RV (* CK_X_Login) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_USER_TYPE, CK_BYTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_Logout) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE); typedef CK_RV (* CK_X_CreateObject) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_ATTRIBUTE_PTR, CK_ULONG, CK_OBJECT_HANDLE_PTR); typedef CK_RV (* CK_X_CopyObject) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_OBJECT_HANDLE, CK_ATTRIBUTE_PTR, CK_ULONG, CK_OBJECT_HANDLE_PTR); typedef CK_RV (* CK_X_DestroyObject) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_OBJECT_HANDLE); typedef CK_RV (* CK_X_GetObjectSize) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_OBJECT_HANDLE, CK_ULONG_PTR); typedef CK_RV (* CK_X_GetAttributeValue) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_OBJECT_HANDLE, CK_ATTRIBUTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_SetAttributeValue) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_OBJECT_HANDLE, CK_ATTRIBUTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_FindObjectsInit) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_ATTRIBUTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_FindObjects) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_OBJECT_HANDLE_PTR, CK_ULONG, CK_ULONG_PTR); typedef CK_RV (* CK_X_FindObjectsFinal) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE); typedef CK_RV (* CK_X_EncryptInit) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR, CK_OBJECT_HANDLE); typedef CK_RV (* CK_X_Encrypt) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_EncryptUpdate) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_EncryptFinal) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_DecryptInit) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR, CK_OBJECT_HANDLE); typedef CK_RV (* CK_X_Decrypt) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_DecryptUpdate) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_DecryptFinal) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_DigestInit) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR); typedef CK_RV (* CK_X_Digest) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_DigestUpdate) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_DigestKey) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_OBJECT_HANDLE); typedef CK_RV (* CK_X_DigestFinal) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_SignInit) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR, CK_OBJECT_HANDLE); typedef CK_RV (* CK_X_Sign) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_SignUpdate) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_SignFinal) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_SignRecoverInit) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR, CK_OBJECT_HANDLE); typedef CK_RV (* CK_X_SignRecover) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_VerifyInit) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR, CK_OBJECT_HANDLE); typedef CK_RV (* CK_X_Verify) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_VerifyUpdate) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_VerifyFinal) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_VerifyRecoverInit) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR, CK_OBJECT_HANDLE); typedef CK_RV (* CK_X_VerifyRecover) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_DigestEncryptUpdate) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_DecryptDigestUpdate) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_SignEncryptUpdate) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_DecryptVerifyUpdate) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_GenerateKey) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR, CK_ATTRIBUTE_PTR, CK_ULONG, CK_OBJECT_HANDLE_PTR); typedef CK_RV (* CK_X_GenerateKeyPair) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR, CK_ATTRIBUTE_PTR, CK_ULONG, CK_ATTRIBUTE_PTR, CK_ULONG, CK_OBJECT_HANDLE_PTR, CK_OBJECT_HANDLE_PTR); typedef CK_RV (* CK_X_WrapKey) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR, CK_OBJECT_HANDLE, CK_OBJECT_HANDLE, CK_BYTE_PTR, CK_ULONG_PTR); typedef CK_RV (* CK_X_UnwrapKey) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR, CK_OBJECT_HANDLE, CK_BYTE_PTR, CK_ULONG, CK_ATTRIBUTE_PTR, CK_ULONG, CK_OBJECT_HANDLE_PTR); typedef CK_RV (* CK_X_DeriveKey) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_MECHANISM_PTR, CK_OBJECT_HANDLE, CK_ATTRIBUTE_PTR, CK_ULONG, CK_OBJECT_HANDLE_PTR); typedef CK_RV (* CK_X_SeedRandom) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_GenerateRandom) (CK_X_FUNCTION_LIST *, CK_SESSION_HANDLE, CK_BYTE_PTR, CK_ULONG); typedef CK_RV (* CK_X_WaitForSlotEvent) (CK_X_FUNCTION_LIST *, CK_FLAGS, CK_SLOT_ID_PTR, CK_VOID_PTR); struct _CK_X_FUNCTION_LIST { CK_VERSION version; CK_X_Initialize C_Initialize; CK_X_Finalize C_Finalize; CK_X_GetInfo C_GetInfo; CK_X_GetSlotList C_GetSlotList; CK_X_GetSlotInfo C_GetSlotInfo; CK_X_GetTokenInfo C_GetTokenInfo; CK_X_GetMechanismList C_GetMechanismList; CK_X_GetMechanismInfo C_GetMechanismInfo; CK_X_InitToken C_InitToken; CK_X_InitPIN C_InitPIN; CK_X_SetPIN C_SetPIN; CK_X_OpenSession C_OpenSession; CK_X_CloseSession C_CloseSession; CK_X_CloseAllSessions C_CloseAllSessions; CK_X_GetSessionInfo C_GetSessionInfo; CK_X_GetOperationState C_GetOperationState; CK_X_SetOperationState C_SetOperationState; CK_X_Login C_Login; CK_X_Logout C_Logout; CK_X_CreateObject C_CreateObject; CK_X_CopyObject C_CopyObject; CK_X_DestroyObject C_DestroyObject; CK_X_GetObjectSize C_GetObjectSize; CK_X_GetAttributeValue C_GetAttributeValue; CK_X_SetAttributeValue C_SetAttributeValue; CK_X_FindObjectsInit C_FindObjectsInit; CK_X_FindObjects C_FindObjects; CK_X_FindObjectsFinal C_FindObjectsFinal; CK_X_EncryptInit C_EncryptInit; CK_X_Encrypt C_Encrypt; CK_X_EncryptUpdate C_EncryptUpdate; CK_X_EncryptFinal C_EncryptFinal; CK_X_DecryptInit C_DecryptInit; CK_X_Decrypt C_Decrypt; CK_X_DecryptUpdate C_DecryptUpdate; CK_X_DecryptFinal C_DecryptFinal; CK_X_DigestInit C_DigestInit; CK_X_Digest C_Digest; CK_X_DigestUpdate C_DigestUpdate; CK_X_DigestKey C_DigestKey; CK_X_DigestFinal C_DigestFinal; CK_X_SignInit C_SignInit; CK_X_Sign C_Sign; CK_X_SignUpdate C_SignUpdate; CK_X_SignFinal C_SignFinal; CK_X_SignRecoverInit C_SignRecoverInit; CK_X_SignRecover C_SignRecover; CK_X_VerifyInit C_VerifyInit; CK_X_Verify C_Verify; CK_X_VerifyUpdate C_VerifyUpdate; CK_X_VerifyFinal C_VerifyFinal; CK_X_VerifyRecoverInit C_VerifyRecoverInit; CK_X_VerifyRecover C_VerifyRecover; CK_X_DigestEncryptUpdate C_DigestEncryptUpdate; CK_X_DecryptDigestUpdate C_DecryptDigestUpdate; CK_X_SignEncryptUpdate C_SignEncryptUpdate; CK_X_DecryptVerifyUpdate C_DecryptVerifyUpdate; CK_X_GenerateKey C_GenerateKey; CK_X_GenerateKeyPair C_GenerateKeyPair; CK_X_WrapKey C_WrapKey; CK_X_UnwrapKey C_UnwrapKey; CK_X_DeriveKey C_DeriveKey; CK_X_SeedRandom C_SeedRandom; CK_X_GenerateRandom C_GenerateRandom; CK_X_WaitForSlotEvent C_WaitForSlotEvent; }; #if defined(__cplusplus) } #endif #endif /* PKCS11_X_H_ */ p11-kit-0.20.2/common/hash.c0000664000175000017500000000675112226763526012307 00000000000000/* * Copyright (C) 2004, 2005, 2007, 2011 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ /*! \file * SHA-1 in C * \author By Steve Reid * 100% Public Domain * \verbatim * Test Vectors * "abc" * A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D * "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" * 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 * A million repetitions of "a" * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F * \endverbatim */ #include "config.h" #include "hash.h" #include #include #include #include /* This code is based on the public domain MurmurHash3 from Austin Appleby: * http://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp * * We use only the 32 bit variant, and slow it down a bit to support unaligned * reads. */ #if !defined(__cplusplus) && (__GNUC__ > 2) #define GNUC_INLINE __attribute__((always_inline)) #else #define GNUC_INLINE #endif GNUC_INLINE static inline uint32_t rotl (uint32_t x, int8_t r) { return (x << r) | (x >> (32 - r)); } /* * Finalization mix - force all bits of a hash block to avalanche */ GNUC_INLINE static inline uint32_t fmix (uint32_t h) { h ^= h >> 16; h *= 0x85ebca6b; h ^= h >> 13; h *= 0xc2b2ae35; h ^= h >> 16; return h; } void p11_hash_murmur3 (void *hash, const void *input, size_t len, ...) { uint8_t overflow[4]; const uint8_t *data; va_list va; uint32_t h1; uint32_t k1; uint32_t c1; uint32_t c2; h1 = 42; /* arbitrary choice of seed */ c1 = 0xcc9e2d51; c2 = 0x1b873593; data = input; /* body */ /* Mix 4 bytes at a time into the hash */ va_start (va, len); for (;;) { if (len >= 4) { memcpy (&k1, data, 4); data += 4; len -= 4; } else { size_t num = len; memcpy (overflow, data, len); while (num < 4) { size_t part; data = va_arg (va, const void *); if (!data) break; /* Combine uint32 from old and new */ len = va_arg (va, size_t); part = 4 - num; if (part > len) part = len; memcpy (overflow + num, data, part); data += part; len -= part; num += part; } if (num < 4) { len = num; break; } memcpy (&k1, overflow, 4); } k1 *= c1; k1 = rotl (k1, 15); k1 *= c2; h1 ^= k1; h1 = rotl (h1, 13); h1 = h1 * 5 + 0xe6546b64; } va_end (va); /* tail */ k1 = 0; switch (len) { case 3: k1 ^= overflow[2] << 16; case 2: k1 ^= overflow[1] << 8; case 1: k1 ^= overflow[0]; k1 *= c1; k1 = rotl (k1, 15); k1 *= c2; h1 ^= k1; default: break; } /* finalization */ h1 ^= len; h1 = fmix(h1); assert (sizeof (h1) == P11_HASH_MURMUR3_LEN); memcpy (hash, &h1, sizeof (h1)); } p11-kit-0.20.2/common/test.h0000664000175000017500000001237612226763526012350 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "compat.h" #ifndef P11_TEST_H_ #define P11_TEST_H_ #ifndef P11_TEST_SOURCE #include #ifdef assert_not_reached #undef assert_not_reached #endif #ifdef assert #undef assert #endif #define assert(expr) \ assert_true(expr) #define assert_true(expr) \ do { if (expr) ; else \ p11_test_fail (__FILE__, __LINE__, __FUNCTION__, "assertion failed (%s)", #expr); \ } while (0) #define assert_false(expr) \ do { if (expr) \ p11_test_fail (__FILE__, __LINE__, __FUNCTION__, "assertion failed (!(%s))", #expr); \ } while (0) #define assert_fail(msg, detail) \ do { const char *__s = (detail); \ p11_test_fail (__FILE__, __LINE__, __FUNCTION__, "%s%s%s", (msg), __s ? ": ": "", __s ? __s : ""); \ } while (0) #define assert_not_reached(msg) \ do { \ p11_test_fail (__FILE__, __LINE__, __FUNCTION__, "code should not be reached"); \ } while (0) #define assert_ptr_not_null(ptr) \ do { if ((ptr) != NULL) ; else \ p11_test_fail (__FILE__, __LINE__, __FUNCTION__, "assertion failed (%s != NULL)", #ptr); \ } while (0) #define assert_num_cmp(a1, cmp, a2) \ do { unsigned long __n1 = (a1); \ unsigned long __n2 = (a2); \ if (__n1 cmp __n2) ; else \ p11_test_fail (__FILE__, __LINE__, __FUNCTION__, "assertion failed (%s %s %s): (%lu %s %lu)", \ #a1, #cmp, #a2, __n1, #cmp, __n2); \ } while (0) #define assert_num_eq(a1, a2) \ assert_num_cmp(a1, ==, a2) #define assert_str_cmp(a1, cmp, a2) \ do { const char *__s1 = (a1); \ const char *__s2 = (a2); \ if (__s1 && __s2 && strcmp (__s1, __s2) cmp 0) ; else \ p11_test_fail (__FILE__, __LINE__, __FUNCTION__, "assertion failed (%s %s %s): (%s %s %s)", \ #a1, #cmp, #a2, __s1 ? __s1 : "(null)", #cmp, __s2 ? __s2 : "(null)"); \ } while (0) #define assert_str_eq(a1, a2) \ assert_str_cmp(a1, ==, a2) #define assert_ptr_eq(a1, a2) \ do { const void *__p1 = (a1); \ const void *__p2 = (a2); \ if (__p1 == __p2) ; else \ p11_test_fail (__FILE__, __LINE__, __FUNCTION__, "assertion failed (%s == %s): (0x%08lx == 0x%08lx)", \ #a1, #a2, (unsigned long)(size_t)__p1, (unsigned long)(size_t)__p2); \ } while (0) #define assert_str_contains(expr, needle) \ do { const char *__str = (expr); \ if (__str && strstr (__str, needle)) ; else \ p1_test_fail (__FILE__, __LINE__, __FUNCTION__, "assertion failed (%s): '%s' does not contain '%s'", \ #expr, __str, needle); \ } while (0) #endif /* !P11_TEST_SOURCE */ void p11_test_fail (const char *filename, int line, const char *function, const char *message, ...) GNUC_PRINTF(4, 5); void p11_test (void (* function) (void), const char *name, ...) GNUC_PRINTF(2, 3); void p11_testx (void (* function) (void *), void *argument, const char *name, ...) GNUC_PRINTF(3, 4); void p11_fixture (void (* setup) (void *), void (* teardown) (void *)); int p11_test_run (int argc, char **argv); char * p11_test_directory (const char *prefix); #ifdef OS_UNIX char * p11_test_copy_setgid (const char *path); int p11_test_run_child (const char **argv, bool quiet_out); #endif #endif /* P11_TEST_H_ */ p11-kit-0.20.2/common/tests/0000775000175000017500000000000012265245671012430 500000000000000p11-kit-0.20.2/common/tests/test-dict.c0000664000175000017500000002720512226763526014423 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include #include "dict.h" static void test_create (void) { p11_dict *map; map = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, NULL); assert_ptr_not_null (map); p11_dict_free (map); } static void test_free_null (void) { p11_dict_free (NULL); } typedef struct { int value; bool freed; } Key; static unsigned int key_hash (const void *ptr) { const Key *k = ptr; assert (!k->freed); return p11_dict_intptr_hash (&k->value); } static bool key_equal (const void *one, const void *two) { const Key *k1 = one; const Key *k2 = two; assert (!k1->freed); assert (!k2->freed); return p11_dict_intptr_equal (&k1->value, &k2->value); } static void key_destroy (void *data) { Key *k = data; assert (!k->freed); k->freed = true; } static void value_destroy (void *data) { int *value = data; *value = 2; } static void test_free_destroys (void) { p11_dict *map; Key key = { 8, 0 }; int value = 0; map = p11_dict_new (key_hash, key_equal, key_destroy, value_destroy); assert_ptr_not_null (map); if (!p11_dict_set (map, &key, &value)) assert_not_reached (); p11_dict_free (map); assert_num_eq (true, key.freed); assert_num_eq (2, value); } static void test_iterate (void) { p11_dict *map; p11_dictiter iter; int key = 1; int value = 2; void *pkey; void *pvalue; int ret; map = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, NULL); assert_ptr_not_null (map); if (!p11_dict_set (map, &key, &value)) assert_not_reached (); p11_dict_iterate (map, &iter); ret = p11_dict_next (&iter, &pkey, &pvalue); assert_num_eq (1, ret); assert_ptr_eq (pkey, &key); assert_ptr_eq (pvalue, &value); ret = p11_dict_next (&iter, &pkey, &pvalue); assert_num_eq (0, ret); p11_dict_free (map); } static int compar_strings (const void *one, const void *two) { char **p1 = (char **)one; char **p2 = (char **)two; return strcmp (*p1, *p2); } static void test_iterate_remove (void) { p11_dict *map; p11_dictiter iter; char *keys[] = { "111", "222", "333" }; char *values[] = { "444", "555", "666" }; void *okeys[3]; void *ovalues[3]; bool ret; int i; map = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, NULL, NULL); assert_ptr_not_null (map); for (i = 0; i < 3; i++) { if (!p11_dict_set (map, keys[i], values[i])) assert_not_reached (); } p11_dict_iterate (map, &iter); ret = p11_dict_next (&iter, &okeys[0], &ovalues[0]); assert_num_eq (true, ret); ret = p11_dict_next (&iter, &okeys[1], &ovalues[1]); assert_num_eq (true, ret); if (!p11_dict_remove (map, okeys[1])) assert_not_reached (); ret = p11_dict_next (&iter, &okeys[2], &ovalues[2]); assert_num_eq (true, ret); ret = p11_dict_next (&iter, NULL, NULL); assert_num_eq (false, ret); assert_num_eq (2, p11_dict_size (map)); p11_dict_free (map); qsort (okeys, 3, sizeof (void *), compar_strings); qsort (ovalues, 3, sizeof (void *), compar_strings); for (i = 0; i < 3; i++) { assert_str_eq (keys[i], okeys[i]); assert_ptr_eq (keys[i], okeys[i]); assert_str_eq (values[i], ovalues[i]); assert_ptr_eq (values[i], ovalues[i]); } } static void test_set_get (void) { char *key = "KEY"; char *value = "VALUE"; char *check; p11_dict *map; map = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, NULL, NULL); p11_dict_set (map, key, value); check = p11_dict_get (map, key); assert_ptr_eq (check, value); p11_dict_free (map); } static void test_set_get_remove (void) { char *key = "KEY"; char *value = "VALUE"; char *check; p11_dict *map; bool ret; map = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, NULL, NULL); if (!p11_dict_set (map, key, value)) assert_not_reached (); check = p11_dict_get (map, key); assert_ptr_eq (check, value); ret = p11_dict_remove (map, key); assert_num_eq (true, ret); ret = p11_dict_remove (map, key); assert_num_eq (false, ret); check = p11_dict_get (map, key); assert (check == NULL); p11_dict_free (map); } static void test_set_clear (void) { char *key = "KEY"; char *value = "VALUE"; char *check; p11_dict *map; map = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, NULL); if (!p11_dict_set (map, key, value)) assert_not_reached (); p11_dict_clear (map); check = p11_dict_get (map, key); assert (check == NULL); p11_dict_free (map); } static void test_remove_destroys (void) { p11_dict *map; Key key = { 8, 0 }; int value = 0; bool ret; map = p11_dict_new (key_hash, key_equal, key_destroy, value_destroy); assert_ptr_not_null (map); if (!p11_dict_set (map, &key, &value)) assert_not_reached (); ret = p11_dict_remove (map, &key); assert_num_eq (true, ret); assert_num_eq (true, key.freed); assert_num_eq (2, value); /* should not be destroyed again */ key.freed = false; value = 0; ret = p11_dict_remove (map, &key); assert_num_eq (false, ret); assert_num_eq (false, key.freed); assert_num_eq (0, value); /* should not be destroyed again */ key.freed = false; value = 0; p11_dict_free (map); assert_num_eq (false, key.freed); assert_num_eq (0, value); } static void test_set_destroys (void) { p11_dict *map; Key key = { 8, 0 }; Key key2 = { 8, 0 }; int value, value2; bool ret; map = p11_dict_new (key_hash, key_equal, key_destroy, value_destroy); assert_ptr_not_null (map); if (!p11_dict_set (map, &key, &value)) assert_not_reached (); key.freed = key2.freed = false; value = value2 = 0; /* Setting same key and value, should not be destroyed */ ret = p11_dict_set (map, &key, &value); assert_num_eq (true, ret); assert_num_eq (false, key.freed); assert_num_eq (false, key2.freed); assert_num_eq (0, value); assert_num_eq (0, value2); key.freed = key2.freed = false; value = value2 = 0; /* Setting a new key same value, key should be destroyed */ ret = p11_dict_set (map, &key2, &value); assert_num_eq (true, ret); assert_num_eq (true, key.freed); assert_num_eq (false, key2.freed); assert_num_eq (0, value); assert_num_eq (0, value2); key.freed = key2.freed = false; value = value2 = 0; /* Setting same key, new value, value should be destroyed */ ret = p11_dict_set (map, &key2, &value2); assert_num_eq (true, ret); assert_num_eq (false, key.freed); assert_num_eq (false, key2.freed); assert_num_eq (2, value); assert_num_eq (0, value2); key.freed = key2.freed = false; value = value2 = 0; /* Setting new key new value, both should be destroyed */ ret = p11_dict_set (map, &key, &value); assert_num_eq (true, ret); assert_num_eq (false, key.freed); assert_num_eq (true, key2.freed); assert_num_eq (0, value); assert_num_eq (2, value2); key.freed = key2.freed = false; value = value2 = 0; p11_dict_free (map); assert_num_eq (true, key.freed); assert_num_eq (2, value); assert_num_eq (false, key2.freed); assert_num_eq (0, value2); } static void test_clear_destroys (void) { p11_dict *map; Key key = { 18, 0 }; int value = 0; map = p11_dict_new (key_hash, key_equal, key_destroy, value_destroy); assert_ptr_not_null (map); if (!p11_dict_set (map, &key, &value)) assert_not_reached (); p11_dict_clear (map); assert_num_eq (true, key.freed); assert_num_eq (2, value); /* should not be destroyed again */ key.freed = false; value = 0; p11_dict_clear (map); assert_num_eq (false, key.freed); assert_num_eq (0, value); /* should not be destroyed again */ key.freed = false; value = 0; p11_dict_free (map); assert_num_eq (false, key.freed); assert_num_eq (0, value); } static unsigned int test_hash_intptr_with_collisions (const void *data) { /* lots and lots of collisions, only returns 100 values */ return (unsigned int)(*((int*)data) % 100); } static void test_hash_add_check_lots_and_collisions (void) { p11_dict *map; int *value; int i; map = p11_dict_new (test_hash_intptr_with_collisions, p11_dict_intptr_equal, NULL, free); for (i = 0; i < 20000; ++i) { value = malloc (sizeof (int)); *value = i; if (!p11_dict_set (map, value, value)) assert_not_reached (); } for (i = 0; i < 20000; ++i) { value = p11_dict_get (map, &i); assert_ptr_not_null (value); assert_num_eq (i, *value); } p11_dict_free (map); } static void test_hash_count (void) { p11_dict *map; int *value; int i; bool ret; map = p11_dict_new (p11_dict_intptr_hash, p11_dict_intptr_equal, NULL, free); assert_num_eq (0, p11_dict_size (map)); for (i = 0; i < 20000; ++i) { value = malloc (sizeof (int)); *value = i; if (!p11_dict_set (map, value, value)) assert_not_reached (); assert_num_eq (i + 1, p11_dict_size (map)); } for (i = 0; i < 20000; ++i) { ret = p11_dict_remove (map, &i); assert_num_eq (true, ret); assert_num_eq (20000 - (i + 1), p11_dict_size (map)); } p11_dict_clear (map); assert_num_eq (0, p11_dict_size (map)); p11_dict_free (map); } static void test_hash_ulongptr (void) { p11_dict *map; unsigned long *value; unsigned long i; map = p11_dict_new (p11_dict_ulongptr_hash, p11_dict_ulongptr_equal, NULL, free); for (i = 0; i < 20000; ++i) { value = malloc (sizeof (unsigned long)); *value = i; if (!p11_dict_set (map, value, value)) assert_not_reached (); } for (i = 0; i < 20000; ++i) { value = p11_dict_get (map, &i); assert_ptr_not_null (value); assert_num_eq (i, *value); } p11_dict_free (map); } int main (int argc, char *argv[]) { p11_test (test_create, "/dict/create"); p11_test (test_set_get, "/dict/set-get"); p11_test (test_set_get_remove, "/dict/set-get-remove"); p11_test (test_remove_destroys, "/dict/remove-destroys"); p11_test (test_set_clear, "/dict/set-clear"); p11_test (test_set_destroys, "/dict/set-destroys"); p11_test (test_clear_destroys, "/dict/clear-destroys"); p11_test (test_free_null, "/dict/free-null"); p11_test (test_free_destroys, "/dict/free-destroys"); p11_test (test_iterate, "/dict/iterate"); p11_test (test_iterate_remove, "/dict/iterate-remove"); p11_test (test_hash_add_check_lots_and_collisions, "/dict/add-check-lots-and-collisions"); p11_test (test_hash_count, "/dict/count"); p11_test (test_hash_ulongptr, "/dict/ulongptr"); return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tests/test-attrs.c0000664000175000017500000004453712265017105014630 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include "attrs.h" #include "debug.h" static void test_terminator (void) { CK_ATTRIBUTE attrs[] = { { CKA_LABEL, "label", 5 }, { CKA_LABEL, NULL, 0 }, { CKA_INVALID }, }; assert_num_eq (true, p11_attrs_terminator (attrs + 2)); assert_num_eq (true, p11_attrs_terminator (NULL)); assert_num_eq (false, p11_attrs_terminator (attrs)); assert_num_eq (false, p11_attrs_terminator (attrs + 1)); } static void test_count (void) { CK_BBOOL vtrue = CK_TRUE; CK_ATTRIBUTE attrs[] = { { CKA_LABEL, "label", 5 }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, { CKA_INVALID }, }; CK_ATTRIBUTE empty[] = { { CKA_INVALID }, }; assert_num_eq (2, p11_attrs_count (attrs)); assert_num_eq (0, p11_attrs_count (NULL)); assert_num_eq (0, p11_attrs_count (empty)); } static void test_build_one (void) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE add = { CKA_LABEL, "yay", 3 }; attrs = p11_attrs_build (NULL, &add, NULL); /* Test the first attribute */ assert_ptr_not_null (attrs); assert (attrs->type == CKA_LABEL); assert_num_eq (3, attrs->ulValueLen); assert (memcmp (attrs->pValue, "yay", 3) == 0); assert (attrs[1].type == CKA_INVALID); p11_attrs_free (attrs); } static void test_build_two (void) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE one = { CKA_LABEL, "yay", 3 }; CK_ATTRIBUTE two = { CKA_VALUE, "eight", 5 }; attrs = p11_attrs_build (NULL, &one, &two, NULL); assert_ptr_not_null (attrs); assert (attrs[0].type == CKA_LABEL); assert_num_eq (3, attrs[0].ulValueLen); assert (memcmp (attrs[0].pValue, "yay", 3) == 0); assert_ptr_not_null (attrs); assert (attrs[1].type == CKA_VALUE); assert_num_eq (5, attrs[1].ulValueLen); assert (memcmp (attrs[1].pValue, "eight", 5) == 0); assert (attrs[2].type == CKA_INVALID); p11_attrs_free (attrs); } static void test_build_invalid (void) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE one = { CKA_LABEL, "yay", 3 }; CK_ATTRIBUTE invalid = { CKA_INVALID }; CK_ATTRIBUTE two = { CKA_VALUE, "eight", 5 }; attrs = p11_attrs_build (NULL, &one, &invalid, &two, NULL); assert_ptr_not_null (attrs); assert (attrs[0].type == CKA_LABEL); assert_num_eq (3, attrs[0].ulValueLen); assert (memcmp (attrs[0].pValue, "yay", 3) == 0); assert_ptr_not_null (attrs); assert (attrs[1].type == CKA_VALUE); assert_num_eq (5, attrs[1].ulValueLen); assert (memcmp (attrs[1].pValue, "eight", 5) == 0); assert (attrs[2].type == CKA_INVALID); p11_attrs_free (attrs); } static void test_buildn_two (void) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE add[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 } }; attrs = p11_attrs_buildn (NULL, add, 2); /* Test the first attribute */ assert_ptr_not_null (attrs); assert (attrs->type == CKA_LABEL); assert_num_eq (3, attrs->ulValueLen); assert (memcmp (attrs->pValue, "yay", 3) == 0); assert_ptr_not_null (attrs); assert (attrs[1].type == CKA_VALUE); assert_num_eq (5, attrs[1].ulValueLen); assert (memcmp (attrs[1].pValue, "eight", 5) == 0); assert (attrs[2].type == CKA_INVALID); p11_attrs_free (attrs); } static void test_buildn_one (void) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE add = { CKA_LABEL, "yay", 3 }; attrs = p11_attrs_buildn (NULL, &add, 1); /* Test the first attribute */ assert_ptr_not_null (attrs); assert (attrs->type == CKA_LABEL); assert_num_eq (3, attrs->ulValueLen); assert (memcmp (attrs->pValue, "yay", 3) == 0); assert (attrs[1].type == CKA_INVALID); p11_attrs_free (attrs); } static void test_build_add (void) { CK_ATTRIBUTE initial[] = { { CKA_LABEL, "label", 5 }, { CKA_VALUE, "nine", 4 }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE one = { CKA_LABEL, "yay", 3 }; CK_ATTRIBUTE two = { CKA_TOKEN, "\x01", 1 }; attrs = p11_attrs_buildn (NULL, initial, 2); attrs = p11_attrs_build (attrs, &one, &two, NULL); assert_ptr_not_null (attrs); assert (attrs[0].type == CKA_LABEL); assert_num_eq (3, attrs[0].ulValueLen); assert (memcmp (attrs[0].pValue, "yay", 3) == 0); assert_ptr_not_null (attrs); assert (attrs[1].type == CKA_VALUE); assert_num_eq (4, attrs[1].ulValueLen); assert (memcmp (attrs[1].pValue, "nine", 4) == 0); assert_ptr_not_null (attrs); assert (attrs[2].type == CKA_TOKEN); assert_num_eq (1, attrs[2].ulValueLen); assert (memcmp (attrs[2].pValue, "\x01", 1) == 0); assert (attrs[3].type == CKA_INVALID); p11_attrs_free (attrs); } static void test_build_null (void) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE add = { CKA_LABEL, NULL, (CK_ULONG)-1 }; attrs = p11_attrs_build (NULL, &add, NULL); /* Test the first attribute */ assert_ptr_not_null (attrs); assert (attrs->type == CKA_LABEL); assert (attrs->ulValueLen == (CK_ULONG)-1); assert_ptr_eq (NULL, attrs->pValue); p11_attrs_free (attrs); } static void test_dup (void) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE original[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, "eight", 5 }, { CKA_INVALID } }; attrs = p11_attrs_dup (original); /* Test the first attribute */ assert_ptr_not_null (attrs); assert (attrs->type == CKA_LABEL); assert_num_eq (3, attrs->ulValueLen); assert (memcmp (attrs->pValue, "yay", 3) == 0); assert_ptr_not_null (attrs); assert (attrs[1].type == CKA_VALUE); assert_num_eq (5, attrs[1].ulValueLen); assert (memcmp (attrs[1].pValue, "eight", 5) == 0); assert (attrs[2].type == CKA_INVALID); p11_attrs_free (attrs); } static void test_take (void) { CK_ATTRIBUTE initial[] = { { CKA_LABEL, "label", 5 }, { CKA_VALUE, "nine", 4 }, }; CK_ATTRIBUTE *attrs; attrs = p11_attrs_buildn (NULL, initial, 2); attrs = p11_attrs_take (attrs, CKA_LABEL, strdup ("boooyah"), 7); attrs = p11_attrs_take (attrs, CKA_TOKEN, strdup ("\x01"), 1); assert_ptr_not_null (attrs); assert (attrs[0].type == CKA_LABEL); assert_num_eq (7, attrs[0].ulValueLen); assert (memcmp (attrs[0].pValue, "boooyah", 7) == 0); assert_ptr_not_null (attrs); assert (attrs[1].type == CKA_VALUE); assert_num_eq (4, attrs[1].ulValueLen); assert (memcmp (attrs[1].pValue, "nine", 4) == 0); assert_ptr_not_null (attrs); assert (attrs[2].type == CKA_TOKEN); assert_num_eq (1, attrs[2].ulValueLen); assert (memcmp (attrs[2].pValue, "\x01", 1) == 0); assert (attrs[3].type == CKA_INVALID); p11_attrs_free (attrs); } static void test_merge_replace (void) { CK_ATTRIBUTE initial[] = { { CKA_LABEL, "label", 5 }, { CKA_VALUE, "nine", 4 }, }; CK_ATTRIBUTE extra[] = { { CKA_LABEL, "boooyah", 7 }, { CKA_APPLICATION, "disco", 5 }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; attrs = p11_attrs_buildn (NULL, initial, 2); merge = p11_attrs_buildn (NULL, extra, 2); attrs = p11_attrs_merge (attrs, merge, true); assert_ptr_not_null (attrs); assert (attrs[0].type == CKA_LABEL); assert_num_eq (7, attrs[0].ulValueLen); assert (memcmp (attrs[0].pValue, "boooyah", 7) == 0); assert_ptr_not_null (attrs); assert (attrs[1].type == CKA_VALUE); assert_num_eq (4, attrs[1].ulValueLen); assert (memcmp (attrs[1].pValue, "nine", 4) == 0); assert_ptr_not_null (attrs); assert (attrs[2].type == CKA_APPLICATION); assert_num_eq (5, attrs[2].ulValueLen); assert (memcmp (attrs[2].pValue, "disco", 5) == 0); assert (attrs[3].type == CKA_INVALID); p11_attrs_free (attrs); } static void test_merge_empty (void) { CK_ATTRIBUTE extra[] = { { CKA_LABEL, "boooyah", 7 }, { CKA_APPLICATION, "disco", 5 }, }; CK_ATTRIBUTE *attrs = NULL; CK_ATTRIBUTE *merge; merge = p11_attrs_buildn (NULL, extra, 2); attrs = p11_attrs_merge (attrs, merge, true); assert_ptr_not_null (attrs); assert_ptr_eq (merge, attrs); p11_attrs_free (attrs); } static void test_merge_augment (void) { CK_ATTRIBUTE initial[] = { { CKA_LABEL, "label", 5 }, { CKA_VALUE, "nine", 4 }, }; CK_ATTRIBUTE extra[] = { { CKA_LABEL, "boooyah", 7 }, { CKA_APPLICATION, "disco", 5 }, }; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *merge; attrs = p11_attrs_buildn (NULL, initial, 2); merge = p11_attrs_buildn (NULL, extra, 2); attrs = p11_attrs_merge (attrs, merge, false); assert_ptr_not_null (attrs); assert (attrs[0].type == CKA_LABEL); assert_num_eq (5, attrs[0].ulValueLen); assert (memcmp (attrs[0].pValue, "label", 5) == 0); assert_ptr_not_null (attrs); assert (attrs[1].type == CKA_VALUE); assert_num_eq (4, attrs[1].ulValueLen); assert (memcmp (attrs[1].pValue, "nine", 4) == 0); assert_ptr_not_null (attrs); assert (attrs[2].type == CKA_APPLICATION); assert_num_eq (5, attrs[2].ulValueLen); assert (memcmp (attrs[2].pValue, "disco", 5) == 0); assert (attrs[3].type == CKA_INVALID); p11_attrs_free (attrs); } static void test_free_null (void) { p11_attrs_free (NULL); } static void test_equal (void) { char *data = "extra attribute"; CK_ATTRIBUTE one = { CKA_LABEL, "yay", 3 }; CK_ATTRIBUTE null = { CKA_LABEL, NULL, 3 }; CK_ATTRIBUTE two = { CKA_VALUE, "yay", 3 }; CK_ATTRIBUTE other = { CKA_VALUE, data, 5 }; CK_ATTRIBUTE overflow = { CKA_VALUE, data, 5 }; CK_ATTRIBUTE content = { CKA_VALUE, "conte", 5 }; assert (p11_attr_equal (&one, &one)); assert (!p11_attr_equal (&one, NULL)); assert (!p11_attr_equal (NULL, &one)); assert (!p11_attr_equal (&one, &two)); assert (!p11_attr_equal (&two, &other)); assert (p11_attr_equal (&other, &overflow)); assert (!p11_attr_equal (&one, &null)); assert (!p11_attr_equal (&one, &null)); assert (!p11_attr_equal (&other, &content)); } static void test_hash (void) { char *data = "extra attribute"; CK_ATTRIBUTE one = { CKA_LABEL, "yay", 3 }; CK_ATTRIBUTE null = { CKA_LABEL, NULL, 3 }; CK_ATTRIBUTE two = { CKA_VALUE, "yay", 3 }; CK_ATTRIBUTE other = { CKA_VALUE, data, 5 }; CK_ATTRIBUTE overflow = { CKA_VALUE, data, 5 }; CK_ATTRIBUTE content = { CKA_VALUE, "conte", 5 }; unsigned int hash; hash = p11_attr_hash (&one); assert (hash != 0); assert (p11_attr_hash (&one) == hash); assert (p11_attr_hash (&two) != hash); assert (p11_attr_hash (&other) != hash); assert (p11_attr_hash (&overflow) != hash); assert (p11_attr_hash (&null) != hash); assert (p11_attr_hash (&content) != hash); hash = p11_attr_hash (NULL); assert (hash == 0); } static void test_to_string (void) { char *data = "extra attribute"; CK_ATTRIBUTE one = { CKA_LABEL, "yay", 3 }; CK_ATTRIBUTE attrs[] = { { CKA_LABEL, "yay", 3 }, { CKA_VALUE, data, 5 }, { CKA_INVALID }, }; char *string; string = p11_attr_to_string (&one, CKA_INVALID); assert_str_eq ("{ CKA_LABEL = (3) \"yay\" }", string); free (string); string = p11_attrs_to_string (attrs, -1); assert_str_eq ("(2) [ { CKA_LABEL = (3) \"yay\" }, { CKA_VALUE = (5) NOT-PRINTED } ]", string); free (string); string = p11_attrs_to_string (attrs, 1); assert_str_eq ("(1) [ { CKA_LABEL = (3) \"yay\" } ]", string); free (string); } static void test_find (void) { CK_BBOOL vtrue = CK_TRUE; CK_ATTRIBUTE *attr; CK_ATTRIBUTE attrs[] = { { CKA_LABEL, "label", 5 }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, { CKA_INVALID }, }; attr = p11_attrs_find (attrs, CKA_LABEL); assert_ptr_eq (attrs + 0, attr); attr = p11_attrs_find (attrs, CKA_TOKEN); assert_ptr_eq (attrs + 1, attr); attr = p11_attrs_find (attrs, CKA_VALUE); assert_ptr_eq (NULL, attr); } static void test_findn (void) { CK_BBOOL vtrue = CK_TRUE; CK_ATTRIBUTE *attr; CK_ATTRIBUTE attrs[] = { { CKA_LABEL, "label", 5 }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, }; attr = p11_attrs_findn (attrs, 2, CKA_LABEL); assert_ptr_eq (attrs + 0, attr); attr = p11_attrs_findn (attrs, 2, CKA_TOKEN); assert_ptr_eq (attrs + 1, attr); attr = p11_attrs_findn (attrs, 2, CKA_VALUE); assert_ptr_eq (NULL, attr); attr = p11_attrs_findn (attrs, 1, CKA_TOKEN); assert_ptr_eq (NULL, attr); } static void test_remove (void) { CK_BBOOL vtrue = CK_TRUE; CK_ATTRIBUTE *attr; CK_ATTRIBUTE *attrs; CK_BBOOL ret; CK_ATTRIBUTE initial[] = { { CKA_LABEL, "label", 5 }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, }; attrs = p11_attrs_buildn (NULL, initial, 2); assert_ptr_not_null (attrs); attr = p11_attrs_find (attrs, CKA_LABEL); assert_ptr_eq (attrs + 0, attr); ret = p11_attrs_remove (attrs, CKA_LABEL); assert_num_eq (CK_TRUE, ret); attr = p11_attrs_find (attrs, CKA_LABEL); assert_ptr_eq (NULL, attr); ret = p11_attrs_remove (attrs, CKA_LABEL); assert_num_eq (CK_FALSE, ret); p11_attrs_free (attrs); } static void test_match (void) { CK_BBOOL vtrue = CK_TRUE; CK_ATTRIBUTE attrs[] = { { CKA_LABEL, "label", 5 }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, { CKA_INVALID }, }; CK_ATTRIBUTE subset[] = { { CKA_LABEL, "label", 5 }, { CKA_INVALID }, }; CK_ATTRIBUTE different[] = { { CKA_LABEL, "other", 5 }, { CKA_INVALID }, }; CK_ATTRIBUTE extra[] = { { CKA_VALUE, "the value", 9 }, { CKA_LABEL, "other", 5 }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, { CKA_INVALID }, }; assert (p11_attrs_match (attrs, attrs)); assert (p11_attrs_match (attrs, subset)); assert (!p11_attrs_match (attrs, different)); assert (!p11_attrs_match (attrs, extra)); } static void test_matchn (void) { CK_BBOOL vtrue = CK_TRUE; CK_ATTRIBUTE attrs[] = { { CKA_LABEL, "label", 5 }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, { CKA_INVALID }, }; CK_ATTRIBUTE subset[] = { { CKA_LABEL, "label", 5 }, }; CK_ATTRIBUTE different[] = { { CKA_TOKEN, &vtrue, sizeof (vtrue) }, { CKA_LABEL, "other", 5 }, }; CK_ATTRIBUTE extra[] = { { CKA_VALUE, "the value", 9 }, { CKA_LABEL, "other", 5 }, { CKA_TOKEN, &vtrue, sizeof (vtrue) }, }; assert (p11_attrs_matchn (attrs, subset, 1)); assert (!p11_attrs_matchn (attrs, different, 2)); assert (!p11_attrs_matchn (attrs, extra, 3)); } static void test_find_bool (void) { CK_BBOOL vtrue = CK_TRUE; CK_BBOOL vfalse = CK_FALSE; CK_BBOOL value; CK_ATTRIBUTE attrs[] = { { CKA_LABEL, "\x01yy", 3 }, { CKA_VALUE, &vtrue, (CK_ULONG)-1 }, { CKA_TOKEN, &vtrue, sizeof (CK_BBOOL) }, { CKA_TOKEN, &vfalse, sizeof (CK_BBOOL) }, { CKA_INVALID }, }; assert (p11_attrs_find_bool (attrs, CKA_TOKEN, &value) && value == CK_TRUE); assert (!p11_attrs_find_bool (attrs, CKA_LABEL, &value)); assert (!p11_attrs_find_bool (attrs, CKA_VALUE, &value)); } static void test_find_ulong (void) { CK_ULONG v33 = 33UL; CK_ULONG v45 = 45UL; CK_ULONG value; CK_ATTRIBUTE attrs[] = { { CKA_LABEL, &v33, 2 }, { CKA_VALUE, &v45, (CK_ULONG)-1 }, { CKA_BITS_PER_PIXEL, &v33, sizeof (CK_ULONG) }, { CKA_BITS_PER_PIXEL, &v45, sizeof (CK_ULONG) }, { CKA_INVALID }, }; assert (p11_attrs_find_ulong (attrs, CKA_BITS_PER_PIXEL, &value) && value == v33); assert (!p11_attrs_find_ulong (attrs, CKA_LABEL, &value)); assert (!p11_attrs_find_ulong (attrs, CKA_VALUE, &value)); } static void test_find_value (void) { void *value; size_t length; CK_ATTRIBUTE attrs[] = { { CKA_LABEL, "", (CK_ULONG)-1 }, { CKA_LABEL, NULL, 5 }, { CKA_LABEL, "", 0 }, { CKA_LABEL, "test", 4 }, { CKA_VALUE, NULL, 0 }, { CKA_INVALID }, }; value = p11_attrs_find_value (attrs, CKA_LABEL, &length); assert_ptr_eq (attrs[3].pValue, value); assert_num_eq (4, length); value = p11_attrs_find_value (attrs, CKA_LABEL, NULL); assert_ptr_eq (attrs[3].pValue, value); value = p11_attrs_find_value (attrs, CKA_VALUE, &length); assert_ptr_eq (NULL, value); value = p11_attrs_find_value (attrs, CKA_TOKEN, &length); assert_ptr_eq (NULL, value); } static void test_find_valid (void) { CK_ATTRIBUTE *attr; CK_ATTRIBUTE attrs[] = { { CKA_LABEL, "", (CK_ULONG)-1 }, { CKA_LABEL, NULL, 5 }, { CKA_LABEL, "", 0 }, { CKA_LABEL, "test", 4 }, { CKA_VALUE, "value", 5 }, { CKA_INVALID }, }; attr = p11_attrs_find_valid (attrs, CKA_LABEL); assert_ptr_eq (attrs + 3, attr); attr = p11_attrs_find_valid (attrs, CKA_VALUE); assert_ptr_eq (attrs + 4, attr); attr = p11_attrs_find_valid (attrs, CKA_TOKEN); assert_ptr_eq (NULL, attr); } int main (int argc, char *argv[]) { p11_test (test_equal, "/attrs/equal"); p11_test (test_hash, "/attrs/hash"); p11_test (test_to_string, "/attrs/to-string"); p11_test (test_terminator, "/attrs/terminator"); p11_test (test_count, "/attrs/count"); p11_test (test_build_one, "/attrs/build-one"); p11_test (test_build_two, "/attrs/build-two"); p11_test (test_build_invalid, "/attrs/build-invalid"); p11_test (test_buildn_one, "/attrs/buildn-one"); p11_test (test_buildn_two, "/attrs/buildn-two"); p11_test (test_build_add, "/attrs/build-add"); p11_test (test_build_null, "/attrs/build-null"); p11_test (test_dup, "/attrs/dup"); p11_test (test_take, "/attrs/take"); p11_test (test_merge_replace, "/attrs/merge-replace"); p11_test (test_merge_augment, "/attrs/merge-augment"); p11_test (test_merge_empty, "/attrs/merge-empty"); p11_test (test_free_null, "/attrs/free-null"); p11_test (test_match, "/attrs/match"); p11_test (test_matchn, "/attrs/matchn"); p11_test (test_find, "/attrs/find"); p11_test (test_findn, "/attrs/findn"); p11_test (test_find_bool, "/attrs/find-bool"); p11_test (test_find_ulong, "/attrs/find-ulong"); p11_test (test_find_value, "/attrs/find-value"); p11_test (test_find_valid, "/attrs/find-valid"); p11_test (test_remove, "/attrs/remove"); return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tests/test-compat.c0000664000175000017500000000537712226767342014771 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include #include "compat.h" static void test_strndup (void) { char unterminated[] = { 't', 'e', 's', 't', 'e', 'r', 'o', 'n', 'i', 'o' }; char *res; res = strndup (unterminated, 6); assert_str_eq (res, "tester"); free (res); res = strndup ("test", 6); assert_str_eq (res, "test"); free (res); } #ifdef OS_UNIX static void test_getauxval (void) { /* 23 is AT_SECURE */ const char *args[] = { BUILDDIR "/frob-getauxval", "23", NULL }; char *path; int ret; ret = p11_test_run_child (args, true); assert_num_eq (ret, 0); path = p11_test_copy_setgid (args[0]); if (path == NULL) return; args[0] = path; ret = p11_test_run_child (args, true); assert_num_cmp (ret, !=, 0); if (unlink (path) < 0) assert_fail ("unlink failed", strerror (errno)); free (path); } #endif /* OS_UNIX */ int main (int argc, char *argv[]) { p11_test (test_strndup, "/compat/strndup"); #ifdef OS_UNIX /* Don't run this test when under fakeroot */ if (!getenv ("FAKED_MODE")) { p11_test (test_getauxval, "/compat/getauxval"); } #endif return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tests/test-url.c0000664000175000017500000001136612226763526014303 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "debug.h" #include "message.h" #include #include #include #include #include "url.h" static void check_decode_msg (const char *file, int line, const char *function, const char *input, ssize_t input_len, const char *expected, size_t expected_len) { unsigned char *decoded; size_t length; if (input_len < 0) input_len = strlen (input); decoded = p11_url_decode (input, input + input_len, "", &length); if (expected == NULL) { if (decoded != NULL) p11_test_fail (file, line, function, "decoding should have failed"); } else { if (decoded == NULL) p11_test_fail (file, line, function, "decoding failed"); if (expected_len != length) p11_test_fail (file, line, function, "wrong length: (%lu != %lu)", (unsigned long)expected_len, (unsigned long)length); if (memcmp (decoded, expected, length) != 0) p11_test_fail (file, line, function, "decoding wrong"); free (decoded); } } #define check_decode_success(input, input_len, expected, expected_len) \ check_decode_msg (__FILE__, __LINE__, __FUNCTION__, input, input_len, expected, expected_len) #define check_decode_failure(input, input_len) \ check_decode_msg (__FILE__, __LINE__, __FUNCTION__, input, input_len, NULL, 0) static void test_decode_success (void) { check_decode_success ("%54%45%53%54%00", -1, "TEST", 5); check_decode_success ("%54%45%53%54%00", 6, "TE", 2); check_decode_success ("%54est%00", -1, "Test", 5); } static void test_decode_skip (void) { const char *input = "%54 %45 %53 %54 %00"; unsigned char *decoded; size_t length; decoded = p11_url_decode (input, input + strlen (input), P11_URL_WHITESPACE, &length); assert_str_eq ("TEST", (char *)decoded); assert_num_eq (5, length); free (decoded); } static void test_decode_failure (void) { /* Early termination */ check_decode_failure ("%54%45%53%5", -1); check_decode_failure ("%54%45%53%", -1); /* Not hex characters */ check_decode_failure ("%54%XX%53%54%00", -1); } static void test_encode (void) { const unsigned char *input = (unsigned char *)"TEST"; p11_buffer buf; if (!p11_buffer_init_null (&buf, 5)) assert_not_reached (); p11_url_encode (input, input + 5, "", &buf); assert (p11_buffer_ok (&buf)); assert_str_eq ("%54%45%53%54%00", (char *)buf.data); assert_num_eq (15, buf.len); p11_buffer_uninit (&buf); } static void test_encode_verbatim (void) { const unsigned char *input = (unsigned char *)"TEST"; p11_buffer buf; if (!p11_buffer_init_null (&buf, 5)) assert_not_reached (); p11_url_encode (input, input + 5, "ES", &buf); assert (p11_buffer_ok (&buf)); assert_str_eq ("%54ES%54%00", (char *)buf.data); assert_num_eq (11, buf.len); p11_buffer_uninit (&buf); } int main (int argc, char *argv[]) { p11_test (test_decode_success, "/url/decode-success"); p11_test (test_decode_skip, "/url/decode-skip"); p11_test (test_decode_failure, "/url/decode-failure"); p11_test (test_encode, "/url/encode"); p11_test (test_encode_verbatim, "/url/encode-verbatim"); return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tests/test-buffer.c0000664000175000017500000001165712226763526014755 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include "debug.h" #include "buffer.h" static void test_init_uninit (void) { p11_buffer buffer; p11_buffer_init (&buffer, 10); assert_ptr_not_null (buffer.data); assert_num_eq (0, buffer.len); assert_num_eq (0, buffer.flags); assert (buffer.size >= 10); assert_ptr_not_null (buffer.ffree); assert_ptr_not_null (buffer.frealloc); p11_buffer_uninit (&buffer); } static void test_append (void) { p11_buffer buffer; p11_buffer_init (&buffer, 10); buffer.len = 5; p11_buffer_append (&buffer, 35); assert_num_eq (5 + 35, buffer.len); assert (buffer.size >= 35 + 5); p11_buffer_append (&buffer, 15); assert_num_eq (5 + 35 + 15, buffer.len); assert (buffer.size >= 5 + 35 + 15); p11_buffer_uninit (&buffer); } static void test_null (void) { p11_buffer buffer; p11_buffer_init_null (&buffer, 10); p11_buffer_add (&buffer, "Blah", -1); p11_buffer_add (&buffer, " blah", -1); assert_str_eq ("Blah blah", buffer.data); p11_buffer_uninit (&buffer); } static int mock_realloced = 0; static int mock_freed = 0; static void * mock_realloc (void *data, size_t size) { mock_realloced++; return realloc (data, size); } static void mock_free (void *data) { mock_freed++; free (data); } static void test_init_for_data (void) { p11_buffer buffer; unsigned char *ret; size_t len; mock_realloced = 0; mock_freed = 0; p11_buffer_init_full (&buffer, (unsigned char *)strdup ("blah"), 4, 0, mock_realloc, mock_free); assert_ptr_not_null (buffer.data); assert_str_eq ("blah", (char *)buffer.data); assert_num_eq (4, buffer.len); assert_num_eq (0, buffer.flags); assert_num_eq (4, buffer.size); assert_ptr_eq (mock_free, buffer.ffree); assert_ptr_eq (mock_realloc, buffer.frealloc); assert_num_eq (0, mock_realloced); assert_num_eq (0, mock_freed); len = buffer.len; ret = p11_buffer_append (&buffer, 1024); assert_ptr_eq ((char *)buffer.data + len, ret); assert_num_eq (1, mock_realloced); p11_buffer_uninit (&buffer); assert_num_eq (1, mock_realloced); assert_num_eq (1, mock_freed); } static void test_steal (void) { p11_buffer buffer; char *string; size_t length; mock_freed = 0; p11_buffer_init_full (&buffer, (unsigned char *)strdup ("blah"), 4, P11_BUFFER_NULL, mock_realloc, mock_free); assert_ptr_not_null (buffer.data); assert_str_eq ("blah", buffer.data); p11_buffer_add (&buffer, " yada", -1); assert_str_eq ("blah yada", buffer.data); string = p11_buffer_steal (&buffer, &length); p11_buffer_uninit (&buffer); assert_str_eq ("blah yada", string); assert_num_eq (9, length); assert_num_eq (0, mock_freed); free (string); } static void test_add (void) { p11_buffer buffer; p11_buffer_init (&buffer, 10); p11_buffer_add (&buffer, (unsigned char *)"Planet Express", 15); assert_num_eq (15, buffer.len); assert_str_eq ("Planet Express", (char *)buffer.data); assert (p11_buffer_ok (&buffer)); p11_buffer_uninit (&buffer); } int main (int argc, char *argv[]) { p11_test (test_init_uninit, "/buffer/init-uninit"); p11_test (test_init_for_data, "/buffer/init-for-data"); p11_test (test_append, "/buffer/append"); p11_test (test_null, "/buffer/null"); p11_test (test_add, "/buffer/add"); p11_test (test_steal, "/buffer/steal"); return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tests/test-hash.c0000664000175000017500000000641512226763526014423 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include #include #include "hash.h" static void test_murmur3 (void) { uint32_t one, two, four, seven, eleven, split; assert (sizeof (one) == P11_HASH_MURMUR3_LEN); p11_hash_murmur3 ((unsigned char *)&one, "one", 3, NULL); p11_hash_murmur3 ((unsigned char *)&two, "two", 3, NULL); p11_hash_murmur3 ((unsigned char *)&four, "four", 4, NULL); p11_hash_murmur3 ((unsigned char *)&seven, "seven", 5, NULL); p11_hash_murmur3 ((unsigned char *)&eleven, "eleven", 6, NULL); p11_hash_murmur3 ((unsigned char *)&split, "ele", 3, "ven", 3, NULL); assert (one != two); assert (one != four); assert (one != seven); assert (one != eleven); assert (two != four); assert (two != seven); assert (two != eleven); assert (four != seven); assert (four != eleven); assert (split == eleven); } static void test_murmur3_incr (void) { uint32_t first, second; p11_hash_murmur3 ((unsigned char *)&first, "this is the long input!", (size_t)23, NULL); p11_hash_murmur3 ((unsigned char *)&second, "this", (size_t)4, " ", (size_t)1, "is ", (size_t)3, "the long ", (size_t)9, "in", (size_t)2, "p", (size_t)1, "u", (size_t)1, "t", (size_t)1, "!", (size_t)1, NULL); assert_num_eq (first, second); } int main (int argc, char *argv[]) { p11_test (test_murmur3, "/hash/murmur3"); p11_test (test_murmur3_incr, "/hash/murmur3-incr"); return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tests/test-message.c0000664000175000017500000000416612226763526015125 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "message.h" #include #include static void test_with_err (void) { const char *last; char *expected; errno = E2BIG; p11_message_err (ENOENT, "Details: %s", "value"); last = p11_message_last (); if (asprintf (&expected, "Details: value: %s", strerror (ENOENT)) < 0) assert_not_reached (); assert_str_eq (expected, last); free (expected); } int main (int argc, char *argv[]) { p11_test (test_with_err, "/message/with-err"); return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tests/frob-getauxval.c0000664000175000017500000000377312237121340015435 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include #include #include #include int main (int argc, char *argv[]) { unsigned long type = 0; unsigned long ret; if (argc == 2) type = atoi (argv[1]); if (type == 0) { fprintf (stderr, "usage: frob-getauxval 23"); abort (); } ret = getauxval (type); printf ("getauxval(%lu) == %lu\n", type, ret); return (int)ret; } p11-kit-0.20.2/common/tests/test-tests.c0000664000175000017500000000463512226763526014644 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include static void test_success (void) { /* Yup, nothing */ } static void test_failure (void) { if (getenv ("TEST_FAIL")) { p11_test_fail (__FILE__, __LINE__, __FUNCTION__, "Unconditional test failure due to TEST_FAIL environment variable"); } } static void test_memory (void) { char *mem; if (getenv ("TEST_FAIL")) { mem = malloc (1); free (mem); *mem = 1; } } static void test_leak (void) { char *mem; if (getenv ("TEST_FAIL")) { mem = malloc (1); *mem = 1; } } int main (int argc, char *argv[]) { p11_test (test_success, "/test/success"); if (getenv ("TEST_FAIL")) { p11_test (test_failure, "/test/failure"); p11_test (test_memory, "/test/memory"); p11_test (test_leak, "/test/leak"); } return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tests/test-path.c0000664000175000017500000001541312226763526014432 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include "compat.h" #include "path.h" static void test_base (void) { struct { const char *in; const char *out; } fixtures[] = { { "/this/is/a/path", "path" }, { "/this/is/a/folder/", "folder" }, { "folder/", "folder" }, { "/", "" }, { "this", "this" }, #ifdef OS_WIN32 { "\\this\\is\\a\\path", "path" }, { "\\this\\is\\a\\folder\\", "folder" }, { "C:\\this\\is\\a\\path", "path" }, { "D:\\this\\is\\a\\folder\\", "folder" }, { "folder\\", "folder" }, { "\\", "" }, #endif { NULL }, }; char *out; int i; for (i = 0; fixtures[i].in != NULL; i++) { out = p11_path_base (fixtures[i].in); assert_str_eq (fixtures[i].out, out); free (out); } } #define assert_str_eq_free(ex, ac) \ do { const char *__s1 = (ex); \ char *__s2 = (ac); \ if (__s1 && __s2 && strcmp (__s1, __s2) == 0) ; else \ p11_test_fail (__FILE__, __LINE__, __FUNCTION__, "assertion failed (%s == %s): (%s == %s)", \ #ex, #ac, __s1 ? __s1 : "(null)", __s2 ? __s2 : "(null)"); \ free (__s2); \ } while (0) static void test_build (void) { #ifdef OS_UNIX assert_str_eq_free ("/root/second", p11_path_build ("/root", "second", NULL)); assert_str_eq_free ("/root/second", p11_path_build ("/root", "/second", NULL)); assert_str_eq_free ("/root/second", p11_path_build ("/root/", "second", NULL)); assert_str_eq_free ("/root/second/third", p11_path_build ("/root", "second", "third", NULL)); assert_str_eq_free ("/root/second/third", p11_path_build ("/root", "/second/third", NULL)); #else /* OS_WIN32 */ assert_str_eq_free ("C:\\root\\second", p11_path_build ("C:\\root", "second", NULL)); assert_str_eq_free ("C:\\root\\second", p11_path_build ("C:\\root", "\\second", NULL)); assert_str_eq_free ("C:\\root\\second", p11_path_build ("C:\\root\\", "second", NULL)); assert_str_eq_free ("C:\\root\\second\\third", p11_path_build ("C:\\root", "second", "third", NULL)); assert_str_eq_free ("C:\\root\\second/third", p11_path_build ("C:\\root", "second/third", NULL)); #endif } static void test_expand (void) { char *path; #ifdef OS_UNIX putenv ("HOME=/home/blah"); assert_str_eq_free ("/home/blah/my/path", p11_path_expand ("~/my/path")); assert_str_eq_free ("/home/blah", p11_path_expand ("~")); putenv ("XDG_CONFIG_HOME=/my"); assert_str_eq_free ("/my/path", p11_path_expand ("~/.config/path")); putenv ("XDG_CONFIG_HOME="); assert_str_eq_free ("/home/blah/.config/path", p11_path_expand ("~/.config/path")); #else /* OS_WIN32 */ putenv ("HOME=C:\\Users\\blah"); assert_str_eq_free ("C:\\Users\\blah\\path", p11_path_expand ("~/my/path")); assert_str_eq_free ("C:\\Users\\blah\\path", p11_path_expand ("~\\path")); #endif putenv("HOME="); path = p11_path_expand ("~/this/is/my/path"); assert (strstr (path, "this/is/my/path") != NULL); free (path); } static void test_absolute (void) { #ifdef OS_UNIX assert (p11_path_absolute ("/home")); assert (!p11_path_absolute ("home")); #else /* OS_WIN32 */ assert (p11_path_absolute ("C:\\home")); assert (!p11_path_absolute ("home")); assert (p11_path_absolute ("/home")); #endif } static void test_parent (void) { assert_str_eq_free ("/", p11_path_parent ("/root")); assert_str_eq_free ("/", p11_path_parent ("/root/")); assert_str_eq_free ("/", p11_path_parent ("/root//")); assert_str_eq_free ("/root", p11_path_parent ("/root/second")); assert_str_eq_free ("/root", p11_path_parent ("/root//second")); assert_str_eq_free ("/root", p11_path_parent ("/root//second//")); assert_str_eq_free ("/root", p11_path_parent ("/root///second")); assert_str_eq_free ("/root/second", p11_path_parent ("/root/second/test.file")); assert_ptr_eq (NULL, p11_path_parent ("/")); assert_ptr_eq (NULL, p11_path_parent ("//")); assert_ptr_eq (NULL, p11_path_parent ("")); } static void test_prefix (void) { assert (p11_path_prefix ("/test/second", "/test")); assert (!p11_path_prefix ("/test", "/test")); assert (!p11_path_prefix ("/different/prefix", "/test")); assert (!p11_path_prefix ("/te", "/test")); assert (!p11_path_prefix ("/test", "/test/blah")); assert (p11_path_prefix ("/test/other/second", "/test")); assert (p11_path_prefix ("/test//other//second", "/test")); } static void test_canon (void) { char *test; test = strdup ("2309haonutb;AOE@#$O "); p11_path_canon (test); assert_str_eq (test, "2309haonutb_AOE___O_"); free (test); test = strdup ("22@# %ATI@#$onot"); p11_path_canon (test); assert_str_eq (test, "22____ATI___onot"); free (test); } int main (int argc, char *argv[]) { p11_test (test_base, "/path/base"); p11_test (test_build, "/path/build"); p11_test (test_expand, "/path/expand"); p11_test (test_absolute, "/path/absolute"); p11_test (test_parent, "/path/parent"); p11_test (test_prefix, "/path/prefix"); p11_test (test_canon, "/path/canon"); return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tests/Makefile.in0000664000175000017500000007366112265245664014434 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/build/Makefile.tests $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/build/aux/depcomp noinst_PROGRAMS = frob-getauxval$(EXEEXT) $(am__EXEEXT_2) TESTS = $(am__EXEEXT_2) subdir = common/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/gettext.m4 \ $(top_srcdir)/build/m4/iconv.m4 \ $(top_srcdir)/build/m4/lib-ld.m4 \ $(top_srcdir)/build/m4/lib-link.m4 \ $(top_srcdir)/build/m4/lib-prefix.m4 \ $(top_srcdir)/build/m4/libtool.m4 \ $(top_srcdir)/build/m4/ltoptions.m4 \ $(top_srcdir)/build/m4/ltsugar.m4 \ $(top_srcdir)/build/m4/ltversion.m4 \ $(top_srcdir)/build/m4/lt~obsolete.m4 \ $(top_srcdir)/build/m4/nls.m4 $(top_srcdir)/build/m4/po.m4 \ $(top_srcdir)/build/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = am__EXEEXT_2 = test-tests$(EXEEXT) test-compat$(EXEEXT) \ test-hash$(EXEEXT) test-dict$(EXEEXT) test-array$(EXEEXT) \ test-constants$(EXEEXT) test-attrs$(EXEEXT) \ test-buffer$(EXEEXT) test-url$(EXEEXT) test-path$(EXEEXT) \ test-lexer$(EXEEXT) test-message$(EXEEXT) $(am__EXEEXT_1) PROGRAMS = $(noinst_PROGRAMS) frob_getauxval_SOURCES = frob-getauxval.c frob_getauxval_OBJECTS = frob-getauxval.$(OBJEXT) frob_getauxval_LDADD = $(LDADD) am__DEPENDENCIES_1 = frob_getauxval_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = test_array_SOURCES = test-array.c test_array_OBJECTS = test-array.$(OBJEXT) test_array_LDADD = $(LDADD) test_array_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la test_attrs_SOURCES = test-attrs.c test_attrs_OBJECTS = test-attrs.$(OBJEXT) test_attrs_LDADD = $(LDADD) test_attrs_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la test_buffer_SOURCES = test-buffer.c test_buffer_OBJECTS = test-buffer.$(OBJEXT) test_buffer_LDADD = $(LDADD) test_buffer_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la test_compat_SOURCES = test-compat.c test_compat_OBJECTS = test-compat.$(OBJEXT) test_compat_LDADD = $(LDADD) test_compat_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la test_constants_SOURCES = test-constants.c test_constants_OBJECTS = test-constants.$(OBJEXT) test_constants_LDADD = $(LDADD) test_constants_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la test_dict_SOURCES = test-dict.c test_dict_OBJECTS = test-dict.$(OBJEXT) test_dict_LDADD = $(LDADD) test_dict_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la test_hash_SOURCES = test-hash.c test_hash_OBJECTS = test-hash.$(OBJEXT) test_hash_LDADD = $(LDADD) test_hash_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la test_lexer_SOURCES = test-lexer.c test_lexer_OBJECTS = test-lexer.$(OBJEXT) test_lexer_LDADD = $(LDADD) test_lexer_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la test_message_SOURCES = test-message.c test_message_OBJECTS = test-message.$(OBJEXT) test_message_LDADD = $(LDADD) test_message_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la test_path_SOURCES = test-path.c test_path_OBJECTS = test-path.$(OBJEXT) test_path_LDADD = $(LDADD) test_path_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la test_tests_SOURCES = test-tests.c test_tests_OBJECTS = test-tests.$(OBJEXT) test_tests_LDADD = $(LDADD) test_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la test_url_SOURCES = test-url.c test_url_OBJECTS = test-url.$(OBJEXT) test_url_LDADD = $(LDADD) test_url_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = frob-getauxval.c test-array.c test-attrs.c test-buffer.c \ test-compat.c test-constants.c test-dict.c test-hash.c \ test-lexer.c test-message.c test-path.c test-tests.c \ test-url.c DIST_SOURCES = frob-getauxval.c test-array.c test-attrs.c \ test-buffer.c test-compat.c test-constants.c test-dict.c \ test-hash.c test-lexer.c test-message.c test-path.c \ test-tests.c test-url.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTKDOC_SCAN = @GTKDOC_SCAN@ HASH_LIBS = @HASH_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_CFLAGS = @LIBFFI_CFLAGS@ LIBFFI_LIBS = @LIBFFI_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTASN1_CFLAGS = @LIBTASN1_CFLAGS@ LIBTASN1_LIBS = @LIBTASN1_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P11KIT_LT_RELEASE = @P11KIT_LT_RELEASE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLEXT = @SHLEXT@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ p11_module_path = @p11_module_path@ p11_package_config_modules = @p11_package_config_modules@ p11_system_config = @p11_system_config@ p11_system_config_file = @p11_system_config_file@ p11_system_config_modules = @p11_system_config_modules@ p11_user_config = @p11_user_config@ p11_user_config_file = @p11_user_config_file@ p11_user_config_modules = @p11_user_config_modules@ pdfdir = @pdfdir@ prefix = @prefix@ privatedir = @privatedir@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_trust_paths = @with_trust_paths@ NULL = TEST_CFLAGS = \ -DSRCDIR=\"$(abs_srcdir)\" \ -DBUILDDIR=\"$(abs_builddir)\" \ -DP11_KIT_FUTURE_UNSTABLE_API MEMCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=80 --quiet LEAKCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=81 --quiet --leak-check=yes HELLCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=82 --quiet --tool=helgrind COMMON = $(top_srcdir)/common AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(srcdir)/.. \ -I$(COMMON) \ -DBUILDDIR=\"$(abs_builddir)\" \ $(TEST_CFLAGS) LDADD = $(NULL) $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la CHECK_PROGS = \ test-tests \ test-compat \ test-hash \ test-dict \ test-array \ test-constants \ test-attrs \ test-buffer \ test-url \ test-path \ test-lexer \ test-message \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/build/Makefile.tests $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/build/Makefile.tests: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list frob-getauxval$(EXEEXT): $(frob_getauxval_OBJECTS) $(frob_getauxval_DEPENDENCIES) $(EXTRA_frob_getauxval_DEPENDENCIES) @rm -f frob-getauxval$(EXEEXT) $(AM_V_CCLD)$(LINK) $(frob_getauxval_OBJECTS) $(frob_getauxval_LDADD) $(LIBS) test-array$(EXEEXT): $(test_array_OBJECTS) $(test_array_DEPENDENCIES) $(EXTRA_test_array_DEPENDENCIES) @rm -f test-array$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_array_OBJECTS) $(test_array_LDADD) $(LIBS) test-attrs$(EXEEXT): $(test_attrs_OBJECTS) $(test_attrs_DEPENDENCIES) $(EXTRA_test_attrs_DEPENDENCIES) @rm -f test-attrs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_attrs_OBJECTS) $(test_attrs_LDADD) $(LIBS) test-buffer$(EXEEXT): $(test_buffer_OBJECTS) $(test_buffer_DEPENDENCIES) $(EXTRA_test_buffer_DEPENDENCIES) @rm -f test-buffer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_buffer_OBJECTS) $(test_buffer_LDADD) $(LIBS) test-compat$(EXEEXT): $(test_compat_OBJECTS) $(test_compat_DEPENDENCIES) $(EXTRA_test_compat_DEPENDENCIES) @rm -f test-compat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_compat_OBJECTS) $(test_compat_LDADD) $(LIBS) test-constants$(EXEEXT): $(test_constants_OBJECTS) $(test_constants_DEPENDENCIES) $(EXTRA_test_constants_DEPENDENCIES) @rm -f test-constants$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_constants_OBJECTS) $(test_constants_LDADD) $(LIBS) test-dict$(EXEEXT): $(test_dict_OBJECTS) $(test_dict_DEPENDENCIES) $(EXTRA_test_dict_DEPENDENCIES) @rm -f test-dict$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_dict_OBJECTS) $(test_dict_LDADD) $(LIBS) test-hash$(EXEEXT): $(test_hash_OBJECTS) $(test_hash_DEPENDENCIES) $(EXTRA_test_hash_DEPENDENCIES) @rm -f test-hash$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_hash_OBJECTS) $(test_hash_LDADD) $(LIBS) test-lexer$(EXEEXT): $(test_lexer_OBJECTS) $(test_lexer_DEPENDENCIES) $(EXTRA_test_lexer_DEPENDENCIES) @rm -f test-lexer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_lexer_OBJECTS) $(test_lexer_LDADD) $(LIBS) test-message$(EXEEXT): $(test_message_OBJECTS) $(test_message_DEPENDENCIES) $(EXTRA_test_message_DEPENDENCIES) @rm -f test-message$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_message_OBJECTS) $(test_message_LDADD) $(LIBS) test-path$(EXEEXT): $(test_path_OBJECTS) $(test_path_DEPENDENCIES) $(EXTRA_test_path_DEPENDENCIES) @rm -f test-path$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_path_OBJECTS) $(test_path_LDADD) $(LIBS) test-tests$(EXEEXT): $(test_tests_OBJECTS) $(test_tests_DEPENDENCIES) $(EXTRA_test_tests_DEPENDENCIES) @rm -f test-tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_tests_OBJECTS) $(test_tests_LDADD) $(LIBS) test-url$(EXEEXT): $(test_url_OBJECTS) $(test_url_DEPENDENCIES) $(EXTRA_test_url_DEPENDENCIES) @rm -f test-url$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_url_OBJECTS) $(test_url_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob-getauxval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-array.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-attrs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-buffer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-compat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-constants.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dict.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lexer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-message.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-path.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-url.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am memcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(MEMCHECK_ENV)" check-TESTS leakcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(LEAKCHECK_ENV)" check-TESTS hellcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(HELLCHECK_ENV)" check-TESTS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: p11-kit-0.20.2/common/tests/test-lexer.c0000664000175000017500000001642012226763526014614 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include "compat.h" #include "debug.h" #include "lexer.h" #include "message.h" typedef struct { int tok_type; const char *name; const char *value; } expected_tok; static void check_lex_msg (const char *file, int line, const char *function, const expected_tok *expected, const char *input, bool failure) { p11_lexer lexer; size_t len; bool failed; int i; p11_lexer_init (&lexer, "test", input, strlen (input)); for (i = 0; p11_lexer_next (&lexer, &failed); i++) { if (expected[i].tok_type != lexer.tok_type) p11_test_fail (file, line, function, "lexer token type does not match: (%d != %d)", expected[i].tok_type, lexer.tok_type); switch (lexer.tok_type) { case TOK_FIELD: if (strcmp (expected[i].name, lexer.tok.field.name) != 0) p11_test_fail (file, line, function, "field name doesn't match: (%s != %s)", expected[i].name, lexer.tok.field.name); if (strcmp (expected[i].value, lexer.tok.field.value) != 0) p11_test_fail (file, line, function, "field value doesn't match: (%s != %s)", expected[i].value, lexer.tok.field.value); break; case TOK_SECTION: if (strcmp (expected[i].name, lexer.tok.field.name) != 0) p11_test_fail (file, line, function, "section name doesn't match: (%s != %s)", expected[i].name, lexer.tok.field.name); break; case TOK_PEM: len = strlen (expected[i].name); if (lexer.tok.pem.length < len || strncmp (lexer.tok.pem.begin, expected[i].name, len) != 0) { p11_test_fail (file, line, function, "wrong type of PEM block: %s", expected[i].name); } break; case TOK_EOF: p11_test_fail (file, line, function, "eof should not be recieved"); break; } } if (failure && !failed) p11_test_fail (file, line, function, "lexing didn't fail"); else if (!failure && failed) p11_test_fail (file, line, function, "lexing failed"); if (TOK_EOF != expected[i].tok_type) p11_test_fail (file, line, function, "premature end of lexing"); p11_lexer_done (&lexer); } #define check_lex_success(expected, input) \ check_lex_msg (__FILE__, __LINE__, __FUNCTION__, expected, input, false) #define check_lex_failure(expected, input) \ check_lex_msg (__FILE__, __LINE__, __FUNCTION__, expected, input, true) static void test_basic (void) { const char *input = "[the header]\n" "field: value\n" "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1-----\n"; const expected_tok expected[] = { { TOK_SECTION, "the header" }, { TOK_FIELD, "field", "value" }, { TOK_PEM, "-----BEGIN BLOCK1-----\n", }, { TOK_EOF } }; check_lex_success (expected, input); } static void test_corners (void) { const char *input = "\r\n" /* blankline */ " [the header]\r\n" /* bad line endings */ " field: value \r\n" /* whitespace */ "number: 2\n" /* extra space*/ "number :3\n" /* extra space*/ "number : 4\n" /* extra space*/ "\n" " # A comment \n" "not-a-comment: # value\n" "-----BEGIN BLOCK1-----\r\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\r\n" "-----END BLOCK1-----"; /* no new line */ const expected_tok expected[] = { { TOK_SECTION, "the header" }, { TOK_FIELD, "field", "value" }, { TOK_FIELD, "number", "2" }, { TOK_FIELD, "number", "3" }, { TOK_FIELD, "number", "4" }, { TOK_FIELD, "not-a-comment", "# value" }, { TOK_PEM, "-----BEGIN BLOCK1-----\r\n", }, { TOK_EOF } }; check_lex_success (expected, input); } static void test_following (void) { const char *input = "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n" "-----END BLOCK1-----\n" "field: value"; const expected_tok expected[] = { { TOK_PEM, "-----BEGIN BLOCK1-----\n", }, { TOK_FIELD, "field", "value" }, { TOK_EOF } }; check_lex_success (expected, input); } static void test_bad_pem (void) { const char *input = "field: value\n" "-----BEGIN BLOCK1-----\n" "aYNNXqshlVxCdo8QfKeXh3GUzd/yn4LYIVgQrx4a\n"; const expected_tok expected[] = { { TOK_FIELD, "field", "value" }, { TOK_EOF } }; p11_message_quiet (); check_lex_failure (expected, input); p11_message_loud (); } static void test_bad_section (void) { const char *input = "field: value\n" "[section\n" "bad]\n"; const expected_tok expected[] = { { TOK_FIELD, "field", "value" }, { TOK_EOF } }; p11_message_quiet (); check_lex_failure (expected, input); p11_message_loud (); } static void test_bad_value (void) { const char *input = "field_value\n" "[section\n" "bad]\n"; const expected_tok expected[] = { { TOK_EOF } }; p11_message_quiet (); check_lex_failure (expected, input); p11_message_loud (); } int main (int argc, char *argv[]) { p11_test (test_basic, "/lexer/basic"); p11_test (test_corners, "/lexer/corners"); p11_test (test_following, "/lexer/following"); p11_test (test_bad_pem, "/lexer/bad-pem"); p11_test (test_bad_section, "/lexer/bad-section"); p11_test (test_bad_value, "/lexer/bad-value"); return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tests/Makefile.am0000664000175000017500000000111012226763526014376 00000000000000 include $(top_srcdir)/build/Makefile.tests COMMON = $(top_srcdir)/common AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(srcdir)/.. \ -I$(COMMON) \ -DBUILDDIR=\"$(abs_builddir)\" \ $(TEST_CFLAGS) LDADD = \ $(NULL) CHECK_PROGS = \ test-tests \ test-compat \ test-hash \ test-dict \ test-array \ test-constants \ test-attrs \ test-buffer \ test-url \ test-path \ test-lexer \ test-message \ $(NULL) noinst_PROGRAMS = \ frob-getauxval \ $(CHECK_PROGS) TESTS = $(CHECK_PROGS) LDADD += \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la p11-kit-0.20.2/common/tests/test-array.c0000664000175000017500000001106012226763526014606 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include #include #include #include "array.h" #include "test.h" static void test_create (void) { p11_array *array; array = p11_array_new (NULL); assert_ptr_not_null (array); p11_array_free (array); } static void test_free_null (void) { p11_array_free (NULL); } static void destroy_value (void *data) { int *value = data; *value = 2; } static void test_free_destroys (void) { p11_array *array; int value = 0; array = p11_array_new (destroy_value); assert_ptr_not_null (array); if (!p11_array_push (array, &value)) assert_not_reached (); p11_array_free (array); assert_num_eq (2, value); } static void test_add (void) { char *value = "VALUE"; p11_array *array; array = p11_array_new (NULL); if (!p11_array_push (array, value)) assert_not_reached (); assert_num_eq (1, array->num); assert_ptr_eq (array->elem[0], value); p11_array_free (array); } static void test_add_remove (void) { char *value = "VALUE"; p11_array *array; array = p11_array_new (NULL); if (!p11_array_push (array, value)) assert_not_reached (); assert_num_eq (1, array->num); assert_ptr_eq (array->elem[0], value); p11_array_remove (array, 0); assert_num_eq (0, array->num); p11_array_free (array); } static void test_remove_destroys (void) { p11_array *array; int value = 0; array = p11_array_new (destroy_value); if (!p11_array_push (array, &value)) assert_not_reached (); p11_array_remove (array, 0); assert_num_eq (2, value); /* should not be destroyed again */ value = 0; p11_array_free (array); assert_num_eq (0, value); } static void test_remove_and_count (void) { p11_array *array; int *value; int i; array = p11_array_new (free); assert_num_eq (0, array->num); for (i = 0; i < 20000; ++i) { value = malloc (sizeof (int)); *value = i; if (!p11_array_push (array, value)) assert_not_reached (); assert_num_eq (i + 1, array->num); } for (i = 10; i < 20000; ++i) { p11_array_remove (array, 10); assert_num_eq (20010 - (i + 1), array->num); } assert_num_eq (10, array->num); p11_array_free (array); } static void test_clear_destroys (void) { p11_array *array; int value = 0; array = p11_array_new (destroy_value); if (!p11_array_push (array, &value)) assert_not_reached (); assert_num_eq (1, array->num); p11_array_clear (array); assert_num_eq (2, value); assert_num_eq (0, array->num); /* should not be destroyed again */ value = 0; p11_array_free (array); assert_num_eq (0, value); } int main (int argc, char *argv[]) { p11_test (test_create, "/array/create"); p11_test (test_add, "/array/add"); p11_test (test_add_remove, "/array/add-remove"); p11_test (test_remove_destroys, "/array/remove-destroys"); p11_test (test_remove_and_count, "/array/remove-and-count"); p11_test (test_free_null, "/array/free-null"); p11_test (test_free_destroys, "/array/free-destroys"); p11_test (test_clear_destroys, "/array/clear-destroys"); return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tests/test-constants.c0000664000175000017500000000722312226763526015512 00000000000000/* * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include "attrs.h" #include "constants.h" #include "debug.h" static void test_constants (void *arg) { const p11_constant *constant = arg; p11_dict *nicks, *names; CK_ULONG check; int i; nicks = p11_constant_reverse (true); names = p11_constant_reverse (false); for (i = 1; constant[i].value != CKA_INVALID; i++) { if (constant[i].value < constant[i - 1].value) assert_fail ("attr constant out of order", constant[i].name); } for (i = 0; constant[i].value != CKA_INVALID; i++) { assert_ptr_not_null (constant[i].name); if (constant[i].nick) { assert_str_eq (constant[i].nick, p11_constant_nick (constant, constant[i].value)); } assert_str_eq (constant[i].name, p11_constant_name (constant, constant[i].value)); if (constant[i].nick) { check = p11_constant_resolve (nicks, constant[i].nick); assert_num_eq (constant[i].value, check); } check = p11_constant_resolve (names, constant[i].name); assert_num_eq (constant[i].value, check); } p11_dict_free (names); p11_dict_free (nicks); } int main (int argc, char *argv[]) { p11_testx (test_constants, (void *)p11_constant_types, "/constants/types"); p11_testx (test_constants, (void *)p11_constant_classes, "/constants/classes"); p11_testx (test_constants, (void *)p11_constant_trusts, "/constants/trusts"); p11_testx (test_constants, (void *)p11_constant_certs, "/constants/certs"); p11_testx (test_constants, (void *)p11_constant_keys, "/constants/keys"); p11_testx (test_constants, (void *)p11_constant_asserts, "/constants/asserts"); p11_testx (test_constants, (void *)p11_constant_categories, "/constants/categories"); p11_testx (test_constants, (void *)p11_constant_mechanisms, "/constants/mechanisms"); p11_testx (test_constants, (void *)p11_constant_users, "/constants/users"); p11_testx (test_constants, (void *)p11_constant_states, "/constants/states"); p11_testx (test_constants, (void *)p11_constant_returns, "/constants/returns"); return p11_test_run (argc, argv); } p11-kit-0.20.2/common/tool.c0000664000175000017500000001713612226763526012340 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "buffer.h" #include "compat.h" #include "debug.h" #include "message.h" #include "path.h" #include #include #include #include #include #include #include #include "tool.h" static char short_option (int opt) { if (isalpha (opt) || isdigit (opt)) return (char)opt; return 0; } static const struct option * find_option (const struct option *longopts, int opt) { int i; for (i = 0; longopts[i].name != NULL; i++) { if (longopts[i].val == opt) return longopts + i; } return NULL; } void p11_tool_usage (const p11_tool_desc *usages, const struct option *longopts) { const struct option *longopt; const int indent = 22; const char *long_name; const char *description; const char *next; char short_name; int spaces; int len; int i; for (i = 0; usages[i].text != NULL; i++) { /* If no option, then this is a heading */ if (!usages[i].option) { printf ("%s\n\n", usages[i].text); continue; } longopt = find_option (longopts, usages[i].option); long_name = longopt ? longopt->name : NULL; short_name = short_option (usages[i].option); description = usages[i].text; if (short_name && long_name) len = printf (" -%c, --%s", (int)short_name, long_name); else if (long_name) len = printf (" --%s", long_name); else len = printf (" -%c", (int)short_name); if (longopt && longopt->has_arg) len += printf ("%s<%s>", long_name ? "=" : " ", usages[i].arg ? usages[i].arg : "..."); if (len < indent) { spaces = indent - len; } else { printf ("\n"); spaces = indent; } while (description) { while (spaces-- > 0) fputc (' ', stdout); next = strchr (description, '\n'); if (next) { next += 1; printf ("%.*s", (int)(next - description), description); description = next; spaces = indent; } else { printf ("%s\n", description); break; } } } } int p11_tool_getopt (int argc, char *argv[], const struct option *longopts) { p11_buffer buf; int ret; char opt; int i; if (!p11_buffer_init_null (&buf, 64)) return_val_if_reached (-1); for (i = 0; longopts[i].name != NULL; i++) { opt = short_option (longopts[i].val); if (opt != 0) { p11_buffer_add (&buf, &opt, 1); assert (longopts[i].has_arg != optional_argument); if (longopts[i].has_arg == required_argument) p11_buffer_add (&buf, ":", 1); } } ret = getopt_long (argc, argv, buf.data, longopts, NULL); p11_buffer_uninit (&buf); return ret; } static void command_usage (const p11_tool_command *commands) { const char *progname; int i; progname = getprogname (); printf ("usage: %s command ...\n", progname); printf ("\nCommon %s commands are:\n", progname); for (i = 0; commands[i].name != NULL; i++) { if (strcmp (commands[i].name, P11_TOOL_FALLBACK) != 0) printf (" %-15s %s\n", commands[i].name, commands[i].text); } printf ("\nSee '%s --help' for more information\n", progname); } static void verbose_arg (void) { putenv ("P11_KIT_DEBUG=tool"); p11_message_loud (); p11_debug_init (); } static void quiet_arg (void) { putenv ("P11_KIT_DEBUG="); p11_message_quiet (); p11_debug_init (); } int p11_tool_main (int argc, char *argv[], const p11_tool_command *commands) { const p11_tool_command *fallback = NULL; char *command = NULL; bool want_help = false; bool skip; int in, out; int i; /* * Parse the global options. We rearrange the options as * necessary, in order to pass relevant options through * to the commands, but also have them take effect globally. */ for (in = 1, out = 1; in < argc; in++, out++) { /* The non-option is the command, take it out of the arguments */ if (argv[in][0] != '-') { if (!command) { skip = true; command = argv[in]; } else { skip = false; } /* The global long options */ } else if (argv[in][1] == '-') { skip = false; if (strcmp (argv[in], "--") == 0) { if (!command) { p11_message ("no command specified"); return 2; } else { break; } } else if (strcmp (argv[in], "--verbose") == 0) { verbose_arg (); } else if (strcmp (argv[in], "--quiet") == 0) { quiet_arg (); } else if (strcmp (argv[in], "--help") == 0) { want_help = true; } else if (!command) { p11_message ("unknown global option: %s", argv[in]); return 2; } /* The global short options */ } else { skip = false; for (i = 1; argv[in][i] != '\0'; i++) { switch (argv[in][i]) { case 'h': want_help = true; break; /* Compatibility option */ case 'l': command = "list-modules"; break; case 'v': verbose_arg (); break; case 'q': quiet_arg (); break; default: if (!command) { p11_message ("unknown global option: -%c", (int)argv[in][i]); return 2; } break; } } } /* Skipping this argument? */ if (skip) out--; else argv[out] = argv[in]; } /* Initialize tool's debugging after setting env vars above */ p11_debug_init (); if (command == NULL) { /* As a special favor if someone just typed the command, help them out */ if (argc == 1) { command_usage (commands); return 2; } else if (want_help) { command_usage (commands); return 0; } else { p11_message ("no command specified"); return 2; } } argc = out; /* Look for the command */ for (i = 0; commands[i].name != NULL; i++) { if (strcmp (commands[i].name, P11_TOOL_FALLBACK) == 0) { fallback = commands + i; } else if (strcmp (commands[i].name, command) == 0) { argv[0] = command; return (commands[i].function) (argc, argv); } } /* Got here because no command matched */ if (fallback != NULL) { argv[0] = command; return (fallback->function) (argc, argv); } /* At this point we have no command */ p11_message ("'%s' is not a valid command. See '%s --help'", command, getprogname ()); return 2; } p11-kit-0.20.2/common/buffer.h0000664000175000017500000000671312225221115012616 00000000000000/* * Copyright (C) 2007, 2012 Stefan Walter * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_BUFFER_H_ #define P11_BUFFER_H_ #include "compat.h" enum { P11_BUFFER_FAILED = 1 << 0, P11_BUFFER_NULL = 1 << 1, }; typedef struct { void *data; size_t len; int flags; size_t size; void * (* frealloc) (void *, size_t); void (* ffree) (void *); } p11_buffer; bool p11_buffer_init (p11_buffer *buffer, size_t size); bool p11_buffer_init_null (p11_buffer *buffer, size_t size); void p11_buffer_init_full (p11_buffer *buffer, void *data, size_t len, int flags, void * (* frealloc) (void *, size_t), void (* ffree) (void *)); void p11_buffer_uninit (p11_buffer *buffer); void * p11_buffer_steal (p11_buffer *buffer, size_t *length); bool p11_buffer_reset (p11_buffer *buffer, size_t size); void * p11_buffer_append (p11_buffer *buffer, size_t length); void p11_buffer_add (p11_buffer *buffer, const void *data, ssize_t length); #define p11_buffer_fail(buf) \ ((buf)->flags |= P11_BUFFER_FAILED) #define p11_buffer_ok(buf) \ (((buf)->flags & P11_BUFFER_FAILED) ? false : true) #define p11_buffer_failed(buf) \ (((buf)->flags & P11_BUFFER_FAILED) ? true : false) #endif /* BUFFER_H */ p11-kit-0.20.2/common/array.h0000664000175000017500000000467612161102013012463 00000000000000/* * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Waler */ #ifndef __P11_ARRAY_H__ #define __P11_ARRAY_H__ #include "compat.h" #ifndef P11_DESTROYER_DEFINED #define P11_DESTROYER_DEFINED typedef void (*p11_destroyer) (void *data); #endif typedef struct _p11_array { void **elem; unsigned int num; /* private */ unsigned int allocated; p11_destroyer destroyer; } p11_array; p11_array * p11_array_new (p11_destroyer destroyer); void p11_array_free (p11_array *array); bool p11_array_push (p11_array *array, void *value); void p11_array_remove (p11_array *array, unsigned int index); void p11_array_clear (p11_array *array); #endif /* __P11_ARRAY_H__ */ p11-kit-0.20.2/common/attrs.c0000664000175000017500000005113712265017105012503 00000000000000/* * Copyright (C) 2012, Redhat Inc. * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "attrs.h" #include "buffer.h" #include "compat.h" #include "constants.h" #include "debug.h" #include "hash.h" #include "pkcs11.h" #include "pkcs11x.h" #include #include #include #include #include #include #define ELEMS(x) (sizeof (x) / sizeof (x[0])) bool p11_attrs_terminator (const CK_ATTRIBUTE *attrs) { return (attrs == NULL || attrs->type == CKA_INVALID); } CK_ULONG p11_attrs_count (const CK_ATTRIBUTE *attrs) { CK_ULONG count; if (attrs == NULL) return 0UL; for (count = 0; !p11_attrs_terminator (attrs); count++, attrs++); return count; } void p11_attrs_free (void *attrs) { CK_ATTRIBUTE *ats = attrs; int i; if (!attrs) return; for (i = 0; !p11_attrs_terminator (ats + i); i++) free (ats[i].pValue); free (ats); } static CK_ATTRIBUTE * attrs_build (CK_ATTRIBUTE *attrs, CK_ULONG count_to_add, bool take_values, bool override, CK_ATTRIBUTE * (*generator) (void *), void *state) { CK_ATTRIBUTE *attr; CK_ATTRIBUTE *add; CK_ULONG current; CK_ULONG at; CK_ULONG j; CK_ULONG i; /* How many attributes we already have */ current = p11_attrs_count (attrs); /* Reallocate for how many we need */ attrs = realloc (attrs, (current + count_to_add + 1) * sizeof (CK_ATTRIBUTE)); return_val_if_fail (attrs != NULL, NULL); at = current; for (i = 0; i < count_to_add; i++) { add = (generator) (state); /* Skip with invalid type */ if (!add || add->type == CKA_INVALID) continue; attr = NULL; /* Do we have this attribute? */ for (j = 0; attr == NULL && j < current; j++) { if (attrs[j].type == add->type) { attr = attrs + j; break; } } /* The attribute doesn't exist */ if (attr == NULL) { attr = attrs + at; at++; /* The attribute exists and we're not overriding */ } else if (!override) { if (take_values) free (add->pValue); continue; /* The attribute exitss, and we're overriding */ } else { free (attr->pValue); } memcpy (attr, add, sizeof (CK_ATTRIBUTE)); if (!take_values && attr->pValue != NULL) { if (attr->ulValueLen == 0) attr->pValue = malloc (1); else attr->pValue = memdup (attr->pValue, attr->ulValueLen); return_val_if_fail (attr->pValue != NULL, NULL); } } /* Mark this as the end */ (attrs + at)->type = CKA_INVALID; assert (p11_attrs_terminator (attrs + at)); return attrs; } static CK_ATTRIBUTE * vararg_generator (void *state) { va_list *va = state; return va_arg (*va, CK_ATTRIBUTE *); } CK_ATTRIBUTE * p11_attrs_build (CK_ATTRIBUTE *attrs, ...) { CK_ULONG count; va_list va; count = 0UL; va_start (va, attrs); while (va_arg (va, CK_ATTRIBUTE *)) count++; va_end (va); va_start (va, attrs); attrs = attrs_build (attrs, count, false, true, vararg_generator, &va); va_end (va); return attrs; } static CK_ATTRIBUTE * template_generator (void *state) { CK_ATTRIBUTE **template = state; return (*template)++; } CK_ATTRIBUTE * p11_attrs_buildn (CK_ATTRIBUTE *attrs, const CK_ATTRIBUTE *add, CK_ULONG count) { return attrs_build (attrs, count, false, true, template_generator, &add); } CK_ATTRIBUTE * p11_attrs_take (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type, CK_VOID_PTR value, CK_ULONG length) { CK_ATTRIBUTE attr = { type, value, length }; CK_ATTRIBUTE *add = &attr; return attrs_build (attrs, 1, true, true, template_generator, &add); } CK_ATTRIBUTE * p11_attrs_merge (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge, bool replace) { CK_ATTRIBUTE *ptr; CK_ULONG count; if (attrs == NULL) return merge; ptr = merge; count = p11_attrs_count (merge); attrs = attrs_build (attrs, count, true, replace, template_generator, &ptr); /* * Since we're supposed to own the merge attributes, * free the container array. */ free (merge); return attrs; } CK_ATTRIBUTE * p11_attrs_dup (const CK_ATTRIBUTE *attrs) { CK_ULONG count; count = p11_attrs_count (attrs); return p11_attrs_buildn (NULL, attrs, count); } CK_ATTRIBUTE * p11_attrs_find (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type) { CK_ULONG i; for (i = 0; !p11_attrs_terminator (attrs + i); i++) { if (attrs[i].type == type) return attrs + i; } return NULL; } CK_ATTRIBUTE * p11_attrs_findn (CK_ATTRIBUTE *attrs, CK_ULONG count, CK_ATTRIBUTE_TYPE type) { CK_ULONG i; for (i = 0; i < count; i++) { if (attrs[i].type == type) return attrs + i; } return NULL; } bool p11_attrs_find_bool (const CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type, CK_BBOOL *value) { CK_ULONG i; for (i = 0; !p11_attrs_terminator (attrs + i); i++) { if (attrs[i].type == type && attrs[i].ulValueLen == sizeof (CK_BBOOL) && attrs[i].pValue != NULL) { *value = *((CK_BBOOL *)attrs[i].pValue); return true; } } return false; } bool p11_attrs_findn_bool (const CK_ATTRIBUTE *attrs, CK_ULONG count, CK_ATTRIBUTE_TYPE type, CK_BBOOL *value) { CK_ULONG i; for (i = 0; i < count; i++) { if (attrs[i].type == type && attrs[i].ulValueLen == sizeof (CK_BBOOL) && attrs[i].pValue != NULL) { *value = *((CK_BBOOL *)attrs[i].pValue); return true; } } return false; } bool p11_attrs_find_ulong (const CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type, CK_ULONG *value) { CK_ULONG i; for (i = 0; !p11_attrs_terminator (attrs + i); i++) { if (attrs[i].type == type && attrs[i].ulValueLen == sizeof (CK_ULONG) && attrs[i].pValue != NULL) { *value = *((CK_ULONG *)attrs[i].pValue); return true; } } return false; } bool p11_attrs_findn_ulong (const CK_ATTRIBUTE *attrs, CK_ULONG count, CK_ATTRIBUTE_TYPE type, CK_ULONG *value) { CK_ULONG i; for (i = 0; i < count; i++) { if (attrs[i].type == type && attrs[i].ulValueLen == sizeof (CK_ULONG) && attrs[i].pValue != NULL) { *value = *((CK_ULONG *)attrs[i].pValue); return true; } } return false; } void * p11_attrs_find_value (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type, size_t *length) { CK_ULONG i; for (i = 0; !p11_attrs_terminator (attrs + i); i++) { if (attrs[i].type == type && attrs[i].ulValueLen != 0 && attrs[i].ulValueLen != (CK_ULONG)-1 && attrs[i].pValue != NULL) { if (length) *length = attrs[i].ulValueLen; return attrs[i].pValue; } } return NULL; } CK_ATTRIBUTE * p11_attrs_find_valid (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type) { CK_ULONG i; for (i = 0; !p11_attrs_terminator (attrs + i); i++) { if (attrs[i].type == type && attrs[i].pValue != NULL && attrs[i].ulValueLen != 0 && attrs[i].ulValueLen != (CK_ULONG)-1) return attrs + i; } return NULL; } bool p11_attrs_remove (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type) { CK_ULONG count; CK_ULONG i; count = p11_attrs_count (attrs); for (i = 0; i < count; i++) { if (attrs[i].type == type) break; } if (i == count) return false; if (attrs[i].pValue) free (attrs[i].pValue); memmove (attrs + i, attrs + i + 1, (count - (i + 1)) * sizeof (CK_ATTRIBUTE)); attrs[count - 1].type = CKA_INVALID; return true; } void p11_attrs_purge (CK_ATTRIBUTE *attrs) { int in, out; for (in = 0, out = 0; !p11_attrs_terminator (attrs + in); in++) { if (attrs[in].ulValueLen == (CK_ULONG)-1) { free (attrs[in].pValue); attrs[in].pValue = NULL; attrs[in].ulValueLen = 0; } else { if (in != out) memcpy (attrs + out, attrs + in, sizeof (CK_ATTRIBUTE)); out++; } } attrs[out].type = CKA_INVALID; assert (p11_attrs_terminator (attrs + out)); } bool p11_attrs_match (const CK_ATTRIBUTE *attrs, const CK_ATTRIBUTE *match) { CK_ATTRIBUTE *attr; for (; !p11_attrs_terminator (match); match++) { attr = p11_attrs_find ((CK_ATTRIBUTE *)attrs, match->type); if (!attr) return false; if (!p11_attr_equal (attr, match)) return false; } return true; } bool p11_attrs_matchn (const CK_ATTRIBUTE *attrs, const CK_ATTRIBUTE *match, CK_ULONG count) { CK_ATTRIBUTE *attr; CK_ULONG i; for (i = 0; i < count; i++) { attr = p11_attrs_find ((CK_ATTRIBUTE *)attrs, match[i].type); if (!attr) return false; if (!p11_attr_equal (attr, match + i)) return false; } return true; } bool p11_attr_match_value (const CK_ATTRIBUTE *attr, const void *value, ssize_t length) { if (length < 0) length = strlen (value); return (attr != NULL && attr->ulValueLen == length && (attr->pValue == value || (attr->pValue && value && memcmp (attr->pValue, value, attr->ulValueLen) == 0))); } bool p11_attr_equal (const void *v1, const void *v2) { const CK_ATTRIBUTE *one = v1; const CK_ATTRIBUTE *two = v2; return (one == two || (one && two && one->type == two->type && p11_attr_match_value (one, two->pValue, two->ulValueLen))); } unsigned int p11_attr_hash (const void *data) { const CK_ATTRIBUTE *attr = data; uint32_t hash = 0; if (attr != NULL) { p11_hash_murmur3 (&hash, &attr->type, sizeof (attr->type), attr->pValue, (size_t)attr->ulValueLen, NULL); } return hash; } static void buffer_append_printf (p11_buffer *buffer, const char *format, ...) GNUC_PRINTF(2, 3); static void buffer_append_printf (p11_buffer *buffer, const char *format, ...) { char *string; va_list va; va_start (va, format); if (vasprintf (&string, format, va) < 0) return_if_reached (); va_end (va); p11_buffer_add (buffer, string, -1); free (string); } static bool attribute_is_ulong_of_type (const CK_ATTRIBUTE *attr, CK_ULONG type) { if (attr->type != type) return false; if (attr->ulValueLen != sizeof (CK_ULONG)) return false; if (!attr->pValue) return false; return true; } static bool attribute_is_trust_value (const CK_ATTRIBUTE *attr) { switch (attr->type) { case CKA_TRUST_DIGITAL_SIGNATURE: case CKA_TRUST_NON_REPUDIATION: case CKA_TRUST_KEY_ENCIPHERMENT: case CKA_TRUST_DATA_ENCIPHERMENT: case CKA_TRUST_KEY_AGREEMENT: case CKA_TRUST_KEY_CERT_SIGN: case CKA_TRUST_CRL_SIGN: case CKA_TRUST_SERVER_AUTH: case CKA_TRUST_CLIENT_AUTH: case CKA_TRUST_CODE_SIGNING: case CKA_TRUST_EMAIL_PROTECTION: case CKA_TRUST_IPSEC_END_SYSTEM: case CKA_TRUST_IPSEC_TUNNEL: case CKA_TRUST_IPSEC_USER: case CKA_TRUST_TIME_STAMPING: break; default: return false; } return attribute_is_ulong_of_type (attr, attr->type); } static bool attribute_is_sensitive (const CK_ATTRIBUTE *attr, CK_OBJECT_CLASS klass) { /* * Don't print any just attribute, since they may contain * sensitive data */ switch (attr->type) { #define X(x) case x: return false; X (CKA_CLASS) X (CKA_TOKEN) X (CKA_PRIVATE) X (CKA_LABEL) X (CKA_APPLICATION) X (CKA_OBJECT_ID) X (CKA_CERTIFICATE_TYPE) X (CKA_ISSUER) X (CKA_SERIAL_NUMBER) X (CKA_AC_ISSUER) X (CKA_OWNER) X (CKA_ATTR_TYPES) X (CKA_TRUSTED) X (CKA_CERTIFICATE_CATEGORY) X (CKA_JAVA_MIDP_SECURITY_DOMAIN) X (CKA_URL) X (CKA_HASH_OF_SUBJECT_PUBLIC_KEY) X (CKA_HASH_OF_ISSUER_PUBLIC_KEY) X (CKA_CHECK_VALUE) X (CKA_KEY_TYPE) X (CKA_SUBJECT) X (CKA_ID) X (CKA_SENSITIVE) X (CKA_ENCRYPT) X (CKA_DECRYPT) X (CKA_WRAP) X (CKA_UNWRAP) X (CKA_SIGN) X (CKA_SIGN_RECOVER) X (CKA_VERIFY) X (CKA_VERIFY_RECOVER) X (CKA_DERIVE) X (CKA_START_DATE) X (CKA_END_DATE) X (CKA_MODULUS_BITS) X (CKA_PRIME_BITS) /* X (CKA_SUBPRIME_BITS) */ /* X (CKA_SUB_PRIME_BITS) */ X (CKA_VALUE_BITS) X (CKA_VALUE_LEN) X (CKA_EXTRACTABLE) X (CKA_LOCAL) X (CKA_NEVER_EXTRACTABLE) X (CKA_ALWAYS_SENSITIVE) X (CKA_KEY_GEN_MECHANISM) X (CKA_MODIFIABLE) X (CKA_SECONDARY_AUTH) X (CKA_AUTH_PIN_FLAGS) X (CKA_ALWAYS_AUTHENTICATE) X (CKA_WRAP_WITH_TRUSTED) X (CKA_WRAP_TEMPLATE) X (CKA_UNWRAP_TEMPLATE) X (CKA_HW_FEATURE_TYPE) X (CKA_RESET_ON_INIT) X (CKA_HAS_RESET) X (CKA_PIXEL_X) X (CKA_PIXEL_Y) X (CKA_RESOLUTION) X (CKA_CHAR_ROWS) X (CKA_CHAR_COLUMNS) X (CKA_COLOR) X (CKA_BITS_PER_PIXEL) X (CKA_CHAR_SETS) X (CKA_ENCODING_METHODS) X (CKA_MIME_TYPES) X (CKA_MECHANISM_TYPE) X (CKA_REQUIRED_CMS_ATTRIBUTES) X (CKA_DEFAULT_CMS_ATTRIBUTES) X (CKA_SUPPORTED_CMS_ATTRIBUTES) X (CKA_ALLOWED_MECHANISMS) X (CKA_X_ASSERTION_TYPE) X (CKA_X_CERTIFICATE_VALUE) X (CKA_X_PURPOSE) X (CKA_X_PEER) X (CKA_X_DISTRUSTED) X (CKA_X_CRITICAL) X (CKA_X_PUBLIC_KEY_INFO) X (CKA_NSS_URL) X (CKA_NSS_EMAIL) X (CKA_NSS_SMIME_INFO) X (CKA_NSS_SMIME_TIMESTAMP) X (CKA_NSS_PKCS8_SALT) X (CKA_NSS_PASSWORD_CHECK) X (CKA_NSS_EXPIRES) X (CKA_NSS_KRL) X (CKA_NSS_PQG_COUNTER) X (CKA_NSS_PQG_SEED) X (CKA_NSS_PQG_H) X (CKA_NSS_PQG_SEED_BITS) X (CKA_NSS_MODULE_SPEC) X (CKA_TRUST_DIGITAL_SIGNATURE) X (CKA_TRUST_NON_REPUDIATION) X (CKA_TRUST_KEY_ENCIPHERMENT) X (CKA_TRUST_DATA_ENCIPHERMENT) X (CKA_TRUST_KEY_AGREEMENT) X (CKA_TRUST_KEY_CERT_SIGN) X (CKA_TRUST_CRL_SIGN) X (CKA_TRUST_SERVER_AUTH) X (CKA_TRUST_CLIENT_AUTH) X (CKA_TRUST_CODE_SIGNING) X (CKA_TRUST_EMAIL_PROTECTION) X (CKA_TRUST_IPSEC_END_SYSTEM) X (CKA_TRUST_IPSEC_TUNNEL) X (CKA_TRUST_IPSEC_USER) X (CKA_TRUST_TIME_STAMPING) X (CKA_TRUST_STEP_UP_APPROVED) X (CKA_CERT_SHA1_HASH) X (CKA_CERT_MD5_HASH) case CKA_VALUE: return (klass != CKO_CERTIFICATE && klass != CKO_X_CERTIFICATE_EXTENSION); #undef X } return true; } static void format_class (p11_buffer *buffer, CK_OBJECT_CLASS klass) { const char *string = p11_constant_name (p11_constant_classes, klass); if (string != NULL) p11_buffer_add (buffer, string, -1); else buffer_append_printf (buffer, "0x%08lX", klass); } static void format_assertion_type (p11_buffer *buffer, CK_X_ASSERTION_TYPE type) { const char *string = p11_constant_name (p11_constant_asserts, type); if (string != NULL) p11_buffer_add (buffer, string, -1); else buffer_append_printf (buffer, "0x%08lX", type); } static void format_key_type (p11_buffer *buffer, CK_KEY_TYPE type) { const char *string = p11_constant_name (p11_constant_keys, type); if (string != NULL) p11_buffer_add (buffer, string, -1); else buffer_append_printf (buffer, "0x%08lX", type); } static void format_certificate_type (p11_buffer *buffer, CK_CERTIFICATE_TYPE type) { const char *string = p11_constant_name (p11_constant_certs, type); if (string != NULL) p11_buffer_add (buffer, string, -1); else buffer_append_printf (buffer, "0x%08lX", type); } static void format_trust_value (p11_buffer *buffer, CK_TRUST trust) { const char *string = p11_constant_name (p11_constant_trusts, trust); if (string != NULL) p11_buffer_add (buffer, string, -1); else buffer_append_printf (buffer, "0x%08lX", trust); } static void format_certificate_category (p11_buffer *buffer, CK_ULONG category) { const char *string = p11_constant_name (p11_constant_categories, category); if (string != NULL) buffer_append_printf (buffer, "%lu (%s)", category, string); else buffer_append_printf (buffer, "%lu", category); } static void format_attribute_type (p11_buffer *buffer, CK_ULONG type) { const char *string = p11_constant_name (p11_constant_types, type); if (string != NULL) p11_buffer_add (buffer, string, -1); else buffer_append_printf (buffer, "CKA_0x%08lX", type); } static void format_some_bytes (p11_buffer *buffer, void *bytes, CK_ULONG length) { unsigned char ch; const unsigned char *data = bytes; CK_ULONG i; if (bytes == NULL) { p11_buffer_add (buffer, "NULL", -1); return; } p11_buffer_add (buffer, "\"", 1); for (i = 0; i < length && i < 128; i++) { ch = data[i]; if (ch == '\t') p11_buffer_add (buffer, "\\t", -1); else if (ch == '\n') p11_buffer_add (buffer, "\\n", -1); else if (ch == '\r') p11_buffer_add (buffer, "\\r", -1); else if (ch >= 32 && ch < 127) p11_buffer_add (buffer, &ch, 1); else buffer_append_printf (buffer, "\\x%02x", ch); } if (i < length) buffer_append_printf (buffer, "..."); p11_buffer_add (buffer, "\"", 1); } void p11_attr_format (p11_buffer *buffer, const CK_ATTRIBUTE *attr, CK_OBJECT_CLASS klass) { p11_buffer_add (buffer, "{ ", -1); format_attribute_type (buffer, attr->type); p11_buffer_add (buffer, " = ", -1); if (attr->ulValueLen == CKA_INVALID) { buffer_append_printf (buffer, "(-1) INVALID"); } else if (attribute_is_ulong_of_type (attr, CKA_CLASS)) { format_class (buffer, *((CK_OBJECT_CLASS *)attr->pValue)); } else if (attribute_is_ulong_of_type (attr, CKA_X_ASSERTION_TYPE)) { format_assertion_type (buffer, *((CK_X_ASSERTION_TYPE *)attr->pValue)); } else if (attribute_is_ulong_of_type (attr, CKA_CERTIFICATE_TYPE)) { format_certificate_type (buffer, *((CK_CERTIFICATE_TYPE *)attr->pValue)); } else if (attribute_is_ulong_of_type (attr, CKA_CERTIFICATE_CATEGORY)) { format_certificate_category (buffer, *((CK_ULONG *)attr->pValue)); } else if (attribute_is_ulong_of_type (attr, CKA_KEY_TYPE)) { format_key_type (buffer, *((CK_KEY_TYPE *)attr->pValue)); } else if (attribute_is_trust_value (attr)) { format_trust_value (buffer, *((CK_TRUST *)attr->pValue)); } else if (attribute_is_sensitive (attr, klass)) { buffer_append_printf (buffer, "(%lu) NOT-PRINTED", attr->ulValueLen); } else { buffer_append_printf (buffer, "(%lu) ", attr->ulValueLen); format_some_bytes (buffer, attr->pValue, attr->ulValueLen); } p11_buffer_add (buffer, " }", -1); } void p11_attrs_format (p11_buffer *buffer, const CK_ATTRIBUTE *attrs, int count) { CK_BBOOL first = CK_TRUE; CK_OBJECT_CLASS klass; int i; if (count < 0) count = p11_attrs_count (attrs); if (!p11_attrs_findn_ulong (attrs, CKA_CLASS, count, &klass)) klass = CKA_INVALID; buffer_append_printf (buffer, "(%d) [", count); for (i = 0; i < count; i++) { if (first) p11_buffer_add (buffer, " ", 1); else p11_buffer_add (buffer, ", ", 2); first = CK_FALSE; p11_attr_format (buffer, attrs + i, klass); } p11_buffer_add (buffer, " ]", -1); } char * p11_attrs_to_string (const CK_ATTRIBUTE *attrs, int count) { p11_buffer buffer; if (!p11_buffer_init_null (&buffer, 128)) return_val_if_reached (NULL); p11_attrs_format (&buffer, attrs, count); return p11_buffer_steal (&buffer, NULL); } char * p11_attr_to_string (const CK_ATTRIBUTE *attr, CK_OBJECT_CLASS klass) { p11_buffer buffer; if (!p11_buffer_init_null (&buffer, 32)) return_val_if_reached (NULL); p11_attr_format (&buffer, attr, klass); return p11_buffer_steal (&buffer, NULL); } p11-kit-0.20.2/common/url.h0000664000175000017500000000501712226763526012165 00000000000000/* * Copyright (c) 2011 Collabora Ltd. * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_URL_H #define P11_URL_H #include "buffer.h" #include "compat.h" #include #define P11_URL_WHITESPACE " \n\r\v" #define P11_URL_VERBATIM "abcdefghijklmnopqrstuvwxyz" \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "0123456789_-." unsigned char * p11_url_decode (const char *value, const char *end, const char *skip, size_t *length); void p11_url_encode (const unsigned char *value, const unsigned char *end, const char *verbatim, p11_buffer *buf); #endif /* P11_URL_H */ p11-kit-0.20.2/common/argv.c0000664000175000017500000000556012226763526012320 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "argv.h" #include "debug.h" #include #include #include bool p11_argv_parse (const char *string, void (*sink) (char *, void *), void *argument) { char quote = '\0'; char *src, *dup, *at, *arg; bool ret = true; return_val_if_fail (string != NULL, false); return_val_if_fail (sink != NULL, false); src = dup = strdup (string); return_val_if_fail (dup != NULL, false); arg = at = src; for (src = dup; *src; src++) { /* Matching quote */ if (quote == *src) { quote = '\0'; /* Inside of quotes */ } else if (quote != '\0') { if (*src == '\\') { *at++ = *src++; if (!*src) { ret = false; goto done; } if (*src != quote) *at++ = '\\'; } *at++ = *src; /* Space, not inside of quotes */ } else if (isspace (*src)) { *at = 0; sink (arg, argument); arg = at; /* Other character outside of quotes */ } else { switch (*src) { case '\'': case '"': quote = *src; break; case '\\': *at++ = *src++; if (!*src) { ret = false; goto done; } /* fall through */ default: *at++ = *src; break; } } } if (at != arg) { *at = 0; sink (arg, argument); } done: free (dup); return ret; } p11-kit-0.20.2/common/path.h0000664000175000017500000000475312226763526012325 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_PATH_H__ #define P11_PATH_H__ #include "compat.h" #ifdef OS_WIN32 #define P11_PATH_SEP ";" #define P11_PATH_SEP_C ';' #else #define P11_PATH_SEP ":" #define P11_PATH_SEP_C ':' #endif /* * The semantics of both POSIX basename() and GNU asename() are so crappy that * we just don't even bother. And what's worse is how it completely changes * behavior if _GNU_SOURCE is defined. Nasty stuff. */ char * p11_path_base (const char *name); char * p11_path_expand (const char *path); char * p11_path_build (const char *path, ...) GNUC_NULL_TERMINATED; bool p11_path_absolute (const char *path); char * p11_path_parent (const char *path); bool p11_path_prefix (const char *string, const char *prefix); void p11_path_canon (char *name); #endif /* P11_PATH_H__ */ p11-kit-0.20.2/common/lexer.h0000664000175000017500000000524112161102013012451 00000000000000/* * Copyright (c) 2005 Stefan Walter * Copyright (c) 2011 Collabora Ltd. * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_LEXER_H__ #define P11_LEXER_H__ #include "compat.h" enum { TOK_EOF = 0, TOK_SECTION = 1, TOK_FIELD, TOK_PEM, }; typedef struct { char *filename; const char *at; int remaining; int complained; int tok_type; union { struct { char *name; } section; struct { char *name; char *value; } field; struct { const char *begin; size_t length; } pem; } tok; } p11_lexer; void p11_lexer_init (p11_lexer *lexer, const char *filename, const char *data, size_t length); bool p11_lexer_next (p11_lexer *lexer, bool *failed); void p11_lexer_done (p11_lexer *lexer); void p11_lexer_msg (p11_lexer *lexer, const char *msg); #endif /* P11_LEXER_H__ */ p11-kit-0.20.2/common/test.c0000664000175000017500000002045612226763526012341 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #define P11_TEST_SOURCE 1 #include "compat.h" #include "test.h" #include "debug.h" #include "path.h" #include #include #include #include #include #include #include #ifdef OS_UNIX #include #include #include #endif enum { FIXTURE, TEST, }; typedef void (*func_with_arg) (void *); typedef struct _test_item { int type; union { struct { char name[1024]; func_with_arg func; void *argument; int failed; } test; struct { func_with_arg setup; func_with_arg teardown; } fix; } x; struct _test_item *next; } test_item; struct { test_item *suite; test_item *last; int number; jmp_buf jump; } gl = { NULL, NULL, 0, }; void p11_test_fail (const char *filename, int line, const char *function, const char *message, ...) { const char *pos; char *output; char *from; char *next; va_list va; assert (gl.last != NULL); assert (gl.last->type == TEST); gl.last->x.test.failed = 1; printf ("not ok %d %s\n", gl.number, gl.last->x.test.name); va_start (va, message); if (vasprintf (&output, message, va) < 0) assert (0 && "vasprintf() failed"); va_end (va); for (from = output; from != NULL; ) { next = strchr (from, '\n'); if (next) { next[0] = '\0'; next += 1; } printf ("# %s\n", from); from = next; } pos = strrchr (filename, '/'); if (pos != NULL && pos[1] != '\0') filename = pos + 1; printf ("# in %s() at %s:%d\n", function, filename, line); free (output); /* Let coverity know we're not supposed to return from here */ #ifdef __COVERITY__ abort(); #endif longjmp (gl.jump, 1); } static void test_push (test_item *it) { test_item *item; item = calloc (1, sizeof (test_item)); assert (item != NULL); memcpy (item, it, sizeof (test_item)); if (!gl.suite) gl.suite = item; if (gl.last) gl.last->next = item; gl.last = item; } void p11_test (void (* function) (void), const char *name, ...) { test_item item = { TEST, }; va_list va; item.x.test.func = (func_with_arg)function; va_start (va, name); vsnprintf (item.x.test.name, sizeof (item.x.test.name), name, va); va_end (va); test_push (&item); } void p11_testx (void (* function) (void *), void *argument, const char *name, ...) { test_item item = { TEST, }; va_list va; item.type = TEST; item.x.test.func = function; item.x.test.argument = argument; va_start (va, name); vsnprintf (item.x.test.name, sizeof (item.x.test.name), name, va); va_end (va); test_push (&item); } void p11_fixture (void (* setup) (void *), void (* teardown) (void *)) { test_item item; item.type = FIXTURE; item.x.fix.setup = setup; item.x.fix.teardown = teardown; test_push (&item); } int p11_test_run (int argc, char **argv) { test_item *fixture = NULL; test_item *item; test_item *next; int count; int ret = 0; int setup; /* p11-kit specific stuff */ putenv ("P11_KIT_STRICT=1"); p11_debug_init (); assert (gl.number == 0); gl.last = NULL; for (item = gl.suite, count = 0; item != NULL; item = item->next) { if (item->type == TEST) count++; } if (count == 0) { printf ("1..0 # No tests\n"); return 0; } printf ("1..%d\n", count); for (item = gl.suite, gl.number = 0; item != NULL; item = item->next) { if (item->type == FIXTURE) { fixture = item; continue; } assert (item->type == TEST); gl.last = item; gl.number++; setup = 0; if (setjmp (gl.jump) == 0) { if (fixture && fixture->x.fix.setup) (fixture->x.fix.setup) (item->x.test.argument); setup = 1; assert (item->x.test.func); (item->x.test.func)(item->x.test.argument); printf ("ok %d %s\n", gl.number, item->x.test.name); } if (setup) { if (setjmp (gl.jump) == 0) { if (fixture && fixture->x.fix.teardown) (fixture->x.fix.teardown) (item->x.test.argument); } } gl.last = NULL; } for (item = gl.suite; item != NULL; item = next) { if (item->type == TEST) { if (item->x.test.failed) ret++; } next = item->next; free (item); } gl.suite = NULL; gl.last = 0; gl.number = 0; return ret; } static char * expand_tempdir (const char *name) { const char *env; env = getenv ("TMPDIR"); if (env && env[0]) { return p11_path_build (env, name, NULL); } else { #ifdef OS_UNIX #ifdef _PATH_TMP return p11_path_build (_PATH_TMP, name, NULL); #else return p11_path_build ("/tmp", name, NULL); #endif #else /* OS_WIN32 */ char directory[MAX_PATH + 1]; if (!GetTempPathA (MAX_PATH + 1, directory)) { printf ("# couldn't lookup temp directory\n"); errno = ENOTDIR; return NULL; } return p11_path_build (directory, name, NULL); #endif /* OS_WIN32 */ } } char * p11_test_directory (const char *prefix) { char *templ; char *directory; if (asprintf (&templ, "%s.XXXXXX", prefix) < 0) assert_not_reached (); directory = expand_tempdir (templ); assert (directory != NULL); if (!mkdtemp (directory)) { printf ("# couldn't create temp directory: %s: %s\n", directory, strerror (errno)); free (directory); assert_not_reached (); } free (templ); return directory; } #ifdef OS_UNIX static void copy_file (const char *input, int fd) { p11_mmap *mmap; const char *data; ssize_t written; size_t size; mmap = p11_mmap_open (input, NULL, (void **)&data, &size); assert (mmap != NULL); while (size > 0) { written = write (fd, data, size); assert (written >= 0); data += written; size -= written; } p11_mmap_close (mmap); } char * p11_test_copy_setgid (const char *input) { gid_t groups[128]; char *path; gid_t group = 0; int ret; int fd; int i; ret = getgroups (128, groups); for (i = 0; i < ret; ++i) { if (groups[i] != getgid ()) { group = groups[i]; break; } } if (i == ret) { fprintf (stderr, "# no suitable group, skipping test\n"); return NULL; } path = strdup ("/tmp/test-setgid.XXXXXX"); assert (path != NULL); fd = mkstemp (path); assert (fd >= 0); copy_file (input, fd); if (fchown (fd, getuid (), group) < 0) assert_not_reached (); if (fchmod (fd, 02750) < 0) assert_not_reached (); if (close (fd) < 0) assert_not_reached (); return path; } int p11_test_run_child (const char **argv, bool quiet_out) { pid_t child; int status; child = fork (); assert (child >= 0); /* In the child process? */ if (child == 0) { if (quiet_out) close (1); /* stdout */ execve (argv[0], (char **)argv, NULL); assert_not_reached (); } if (waitpid (child, &status, 0) < 0) assert_not_reached (); assert (!WIFSIGNALED (status)); assert (WIFEXITED (status)); return WEXITSTATUS (status); } #endif /* OS_UNIX */ p11-kit-0.20.2/common/buffer.c0000664000175000017500000001166312226763526012633 00000000000000/* * Copyright (C) 2007, 2012 Stefan Walter * Copyright (C) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "buffer.h" #include "debug.h" #include #include #include #include #include static bool buffer_realloc (p11_buffer *buffer, size_t size) { void *data; /* Memory owned elsewhere can't be reallocated */ return_val_if_fail (buffer->frealloc != NULL, false); /* Reallocate built in buffer using allocator */ data = (buffer->frealloc) (buffer->data, size); if (!data && size > 0) { p11_buffer_fail (buffer); return_val_if_reached (false); } buffer->data = data; buffer->size = size; return true; } bool p11_buffer_init (p11_buffer *buffer, size_t reserve) { p11_buffer_init_full (buffer, NULL, 0, 0, realloc, free); return buffer_realloc (buffer, reserve); } bool p11_buffer_init_null (p11_buffer *buffer, size_t reserve) { p11_buffer_init_full (buffer, NULL, 0, P11_BUFFER_NULL, realloc, free); return buffer_realloc (buffer, reserve); } void p11_buffer_init_full (p11_buffer *buffer, void *data, size_t len, int flags, void * (* frealloc) (void *, size_t), void (* ffree) (void *)) { memset (buffer, 0, sizeof (*buffer)); buffer->data = data; buffer->len = len; buffer->size = len; buffer->flags = flags; buffer->frealloc = frealloc; buffer->ffree = ffree; return_if_fail (!(flags & P11_BUFFER_FAILED)); } void p11_buffer_uninit (p11_buffer *buffer) { return_if_fail (buffer != NULL); if (buffer->ffree && buffer->data) (buffer->ffree) (buffer->data); memset (buffer, 0, sizeof (*buffer)); } void * p11_buffer_steal (p11_buffer *buffer, size_t *length) { void *data; return_val_if_fail (p11_buffer_ok (buffer), NULL); if (length) *length = buffer->len; data = buffer->data; buffer->data = NULL; buffer->size = 0; buffer->len = 0; return data; } bool p11_buffer_reset (p11_buffer *buffer, size_t reserve) { buffer->flags &= ~P11_BUFFER_FAILED; buffer->len = 0; if (reserve < buffer->size) return true; return buffer_realloc (buffer, reserve); } void * p11_buffer_append (p11_buffer *buffer, size_t length) { unsigned char *data; size_t terminator; size_t newlen; size_t reserve; return_val_if_fail (p11_buffer_ok (buffer), NULL); terminator = (buffer->flags & P11_BUFFER_NULL) ? 1 : 0; /* Check for unlikely and unrecoverable integer overflow */ return_val_if_fail (SIZE_MAX - (terminator + length) > buffer->len, NULL); reserve = terminator + length + buffer->len; if (reserve > buffer->size) { /* Calculate a new length, minimize number of buffer allocations */ return_val_if_fail (buffer->size < SIZE_MAX / 2, NULL); newlen = buffer->size * 2; if (!newlen) newlen = 16; if (reserve > newlen) newlen = reserve; if (!buffer_realloc (buffer, newlen)) return_val_if_reached (NULL); } data = buffer->data; data += buffer->len; buffer->len += length; if (terminator) data[length] = '\0'; return data; } void p11_buffer_add (p11_buffer *buffer, const void *data, ssize_t length) { void *at; if (length < 0) length = strlen (data); at = p11_buffer_append (buffer, length); return_if_fail (at != NULL); memcpy (at, data, length); } p11-kit-0.20.2/common/tool.h0000664000175000017500000000457212226763526012345 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_TOOL_H_ #define P11_TOOL_H_ #include #define P11_TOOL_FALLBACK "" typedef struct { const char *name; int (*function) (int, char*[]); const char *text; } p11_tool_command; typedef struct { int option; const char *text; const char *arg; } p11_tool_desc; int p11_tool_main (int argc, char *argv[], const p11_tool_command *commands); int p11_tool_getopt (int argc, char *argv[], const struct option *longopts); void p11_tool_usage (const p11_tool_desc *usages, const struct option *longopts); #endif /* P11_TOOL_H_ */ p11-kit-0.20.2/common/message.c0000664000175000017500000001045512226736752013005 00000000000000/* * Copyright (c) 2011 Collabora Ltd * Copyright (c) 2012 Stef Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * CONTRIBUTORS * Stef Walter */ #include "config.h" /* * Oh god. glibc is nasty. Changes behavior and definitions of POSIX * functions to completely different signatures depending on defines */ #define _POSIX_C_SOURCE 200112L #include "compat.h" #define P11_DEBUG_FLAG P11_DEBUG_LIB #include "debug.h" #include "message.h" #include #include #include #include #include static bool print_messages = true; static char * default_message_storage (void) { static char message[P11_MESSAGE_MAX] = { 0, }; return message; } /* Function pointer declared in message.h as extern */ char * (* p11_message_storage) (void) = default_message_storage; void p11_message_store (const char* msg, size_t length) { char *buffer; /* * p11_message_storage() is called to get a storage location for * the last message. It defaults to a globally allocated buffer * but is overridden in library.c with a function that returns * per thread buffers. * * The returned value is P11_MESSAGE_MAX bytes long */ buffer = p11_message_storage (); if (length > P11_MESSAGE_MAX - 1) length = P11_MESSAGE_MAX - 1; if (buffer != NULL) { memcpy (buffer, msg, length); buffer[length] = 0; } } void p11_message_err (int errnum, const char* msg, ...) { char buffer[P11_MESSAGE_MAX]; char strerr[P11_MESSAGE_MAX]; va_list va; size_t length; va_start (va, msg); length = vsnprintf (buffer, P11_MESSAGE_MAX - 1, msg, va); va_end (va); /* Was it truncated? */ if (length > P11_MESSAGE_MAX - 1) length = P11_MESSAGE_MAX - 1; buffer[length] = 0; strncpy (strerr, "Unknown error", sizeof (strerr)); strerror_r (errnum, strerr, sizeof (strerr)); strerr[P11_MESSAGE_MAX - 1] = 0; p11_message ("%s: %s", buffer, strerr); } void p11_message (const char* msg, ...) { char buffer[P11_MESSAGE_MAX]; va_list va; size_t length; va_start (va, msg); length = vsnprintf (buffer, P11_MESSAGE_MAX - 1, msg, va); va_end (va); /* Was it truncated? */ if (length > P11_MESSAGE_MAX - 1) length = P11_MESSAGE_MAX - 1; buffer[length] = 0; /* If printing is not disabled, just print out */ if (print_messages) fprintf (stderr, "p11-kit: %s\n", buffer); else p11_debug_message (P11_DEBUG_LIB, "message: %s", buffer); p11_message_store (buffer, length); } void p11_message_quiet (void) { print_messages = false; } void p11_message_loud (void) { print_messages = true; } const char * p11_message_last (void) { char *buffer; buffer = p11_message_storage (); return buffer && buffer[0] ? buffer : NULL; } void p11_message_clear (void) { char *buffer; buffer = p11_message_storage (); if (buffer != NULL) buffer[0] = 0; } p11-kit-0.20.2/common/compat.h0000664000175000017500000001703312226763526012647 00000000000000/* * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef __COMPAT_H__ #define __COMPAT_H__ #include "config.h" #include #include #ifdef _GNU_SOURCE #error Make the crap stop. _GNU_SOURCE is completely unportable and breaks all sorts of behavior #endif #if !defined(__cplusplus) && (__GNUC__ > 2) #define GNUC_PRINTF(x, y) __attribute__((__format__(__printf__, x, y))) #else #define GNUC_PRINTF(x, y) #endif #if __GNUC__ >= 4 #define GNUC_NULL_TERMINATED __attribute__((__sentinel__)) #else #define GNUC_NULL_TERMINATED #endif /* For detecting clang features */ #ifndef __has_feature #define __has_feature(x) 0 #endif #ifndef CLANG_ANALYZER_NORETURN #if __has_feature(attribute_analyzer_noreturn) #define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn)) #else #define CLANG_ANALYZER_NORETURN #endif #endif #ifndef O_BINARY #define O_BINARY 0 #endif #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif #ifndef HAVE_GETPROGNAME const char * getprogname (void); #endif #ifndef HAVE_MKSTEMP int mkstemp (char *template); #endif /* HAVE_MKSTEMP */ #ifndef HAVE_MKDTEMP char * mkdtemp (char *template); #endif /* HAVE_MKDTEMP */ char * strdup_path_mangle (const char *template); /* ----------------------------------------------------------------------------- * WIN32 */ #ifdef OS_WIN32 #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x500 #endif #ifndef _WIN32_IE #define _WIN32_IE 0x500 #endif #define WIN32_LEAN_AND_MEAN 1 #include #include /* Oh ... my ... god */ #undef CreateMutex typedef CRITICAL_SECTION p11_mutex_t; typedef HANDLE p11_thread_t; typedef DWORD p11_thread_id_t; #define p11_mutex_init(m) \ (InitializeCriticalSection (m)) #define p11_mutex_lock(m) \ (EnterCriticalSection (m)) #define p11_mutex_unlock(m) \ (LeaveCriticalSection (m)) #define p11_mutex_uninit(m) \ (DeleteCriticalSection (m)) typedef void * (*p11_thread_routine) (void *arg); int p11_thread_create (p11_thread_t *thread, p11_thread_routine, void *arg); int p11_thread_join (p11_thread_t thread); /* Returns a thread_id_t */ #define p11_thread_id_self() \ (GetCurrentThreadId ()) typedef HMODULE dl_module_t; #define p11_dl_open(f) \ (LoadLibrary (f)) #define p11_dl_symbol(d, s) \ ((void *)GetProcAddress ((d), (s))) char * p11_dl_error (void); void p11_dl_close (void * dl); #define p11_sleep_ms(ms) \ (Sleep (ms)) typedef struct _p11_mmap p11_mmap; p11_mmap * p11_mmap_open (const char *path, struct stat *sb, void **data, size_t *size); void p11_mmap_close (p11_mmap *map); #endif /* OS_WIN32 */ /* ---------------------------------------------------------------------------- * UNIX */ #ifdef OS_UNIX #include #include #include #include typedef pthread_mutex_t p11_mutex_t; void p11_mutex_init (p11_mutex_t *mutex); #define p11_mutex_lock(m) \ (pthread_mutex_lock (m)) #define p11_mutex_unlock(m) \ (pthread_mutex_unlock (m)) #define p11_mutex_uninit(m) \ (pthread_mutex_destroy(m)) typedef pthread_t p11_thread_t; typedef pthread_t p11_thread_id_t; typedef void * (*p11_thread_routine) (void *arg); #define p11_thread_create(t, r, a) \ (pthread_create ((t), NULL, (r), (a))) #define p11_thread_join(t) \ (pthread_join ((t), NULL)) #define p11_thread_id_self(m) \ (pthread_self ()) typedef void * dl_module_t; #define p11_dl_open(f) \ (dlopen ((f), RTLD_LOCAL | RTLD_NOW)) #define p11_dl_close \ dlclose #define p11_dl_symbol(d, s) \ (dlsym ((d), (s))) char * p11_dl_error (void); #define p11_sleep_ms(ms) \ do { int _ms = (ms); \ struct timespec _ts = { _ms / 1000, (_ms % 1000) * 1000 * 1000 }; \ nanosleep (&_ts, NULL); \ } while(0) typedef struct _p11_mmap p11_mmap; p11_mmap * p11_mmap_open (const char *path, struct stat *sb, void **data, size_t *size); void p11_mmap_close (p11_mmap *map); #endif /* OS_UNIX */ /* ---------------------------------------------------------------------------- * MORE COMPAT */ #ifdef HAVE_ERRNO_H #include #endif /* HAVE_ERRNO_H */ #ifndef HAVE_STRNSTR char * strnstr (const char *s, const char *find, size_t slen); #endif /* HAVE_STRNSTR */ #ifndef HAVE_MEMDUP void * memdup (const void *data, size_t length); #endif /* HAVE_MEMDUP */ #ifndef HAVE_STRNDUP char * strndup (const char *data, size_t length); #endif /* HAVE_STRDUP */ #ifdef HAVE_STDBOOL_H #include #else typedef enum { false, true } bool; #endif #ifndef HAVE_STRCONCAT char * strconcat (const char *first, ...) GNUC_NULL_TERMINATED; #endif /* HAVE_STRCONCAT */ #if defined HAVE_DECL_ASPRINTF && !HAVE_DECL_ASPRINTF int asprintf (char **strp, const char *fmt, ...); #endif /* HAVE_ASPRINTF */ #if defined HAVE_DECL_VASPRINTF && !HAVE_DECL_VASPRINTF #include int vasprintf (char **strp, const char *fmt, va_list ap); #endif /* HAVE_DECL_VASPRINTF */ #ifndef HAVE_GMTIME_R #include struct tm * gmtime_r (const time_t *timep, struct tm *result); #endif /* HAVE_GMTIME_R */ #ifndef HAVE_TIMEGM #include time_t timegm (struct tm *tm); #endif /* HAVE_TIMEGM */ #ifdef HAVE_GETAUXVAL #include #else /* !HAVE_GETAUXVAL */ unsigned long getauxval (unsigned long type); #define AT_SECURE 23 #endif /* !HAVE_GETAUXVAL */ #ifndef HAVE_STRERROR_R int strerror_r (int errnum, char *buf, size_t buflen); #endif /* HAVE_STRERROR_R */ #endif /* __COMPAT_H__ */ p11-kit-0.20.2/common/debug.h0000664000175000017500000001067512226763526012457 00000000000000/* * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_DEBUG_H #define P11_DEBUG_H #include "compat.h" /* Please keep this enum in sync with keys in debug.c */ enum { P11_DEBUG_LIB = 1 << 1, P11_DEBUG_CONF = 1 << 2, P11_DEBUG_URI = 1 << 3, P11_DEBUG_PROXY = 1 << 4, P11_DEBUG_TRUST = 1 << 5, P11_DEBUG_TOOL = 1 << 6, }; extern int p11_debug_current_flags; void p11_debug_init (void); void p11_debug_message (int flag, const char *format, ...) GNUC_PRINTF (2, 3); void p11_debug_precond (const char *format, ...) GNUC_PRINTF (1, 2) CLANG_ANALYZER_NORETURN; #ifndef assert_not_reached #define assert_not_reached() \ (assert (false && "this code should not be reached")) #endif #define return_val_if_fail(x, v) \ do { if (!(x)) { \ p11_debug_precond ("p11-kit: '%s' not true at %s\n", #x, __func__); \ return v; \ } } while (false) #define return_if_fail(x) \ do { if (!(x)) { \ p11_debug_precond ("p11-kit: '%s' not true at %s\n", #x, __func__); \ return; \ } } while (false) #define return_if_reached() \ do { \ p11_debug_precond ("p11-kit: shouldn't be reached at %s\n", __func__); \ return; \ } while (false) #define return_val_if_reached(v) \ do { \ p11_debug_precond ("p11-kit: shouldn't be reached at %s\n", __func__); \ return v; \ } while (false) #define warn_if_reached(v) \ do { \ p11_debug_precond ("p11-kit: shouldn't be reached at %s\n", __func__); \ } while (false) #define warn_if_fail(x) \ do { if (!(x)) { \ p11_debug_precond ("p11-kit: '%s' not true at %s\n", #x, __func__); \ } } while (false) #endif /* DEBUG_H */ /* ----------------------------------------------------------------------------- * Below this point is outside the DEBUG_H guard - so it can take effect * more than once. So you can do: * * #define P11_DEBUG_FLAG P11_DEBUG_ONE_THING * #include "debug.h" * ... * p11_debug ("if we're debugging one thing"); * ... * #undef P11_DEBUG_FLAG * #define P11_DEBUG_FLAG DEBUG_OTHER_THING * #include "debug.h" * ... * p11_debug ("if we're debugging the other thing"); * ... */ #ifdef P11_DEBUG_FLAG #ifdef WITH_DEBUG #undef p11_debug #define p11_debug(format, ...) do { \ if (P11_DEBUG_FLAG & p11_debug_current_flags) \ p11_debug_message (P11_DEBUG_FLAG, "%s: " format, __PRETTY_FUNCTION__, ##__VA_ARGS__); \ } while (0) #undef p11_debugging #define p11_debugging \ (P11_DEBUG_FLAG & p11_debug_current_flags) #else /* !defined (WITH_DEBUG) */ #undef p11_debug #define p11_debug(format, ...) \ do {} while (false) #undef p11_debugging #define p11_debugging (0) #endif /* !defined (WITH_DEBUG) */ #endif /* defined (P11_DEBUG_FLAG) */ p11-kit-0.20.2/common/pkcs11.h0000664000175000017500000012765212161102013012447 00000000000000/* pkcs11.h Copyright 2006, 2007 g10 Code GmbH Copyright 2006 Andreas Jellinghaus This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /* Please submit changes back to the Scute project at http://www.scute.org/ (or send them to marcus@g10code.com), so that they can be picked up by other projects from there as well. */ /* This file is a modified implementation of the PKCS #11 standard by RSA Security Inc. It is mostly a drop-in replacement, with the following change: This header file does not require any macro definitions by the user (like CK_DEFINE_FUNCTION etc). In fact, it defines those macros for you (if useful, some are missing, let me know if you need more). There is an additional API available that does comply better to the GNU coding standard. It can be switched on by defining CRYPTOKI_GNU before including this header file. For this, the following changes are made to the specification: All structure types are changed to a "struct ck_foo" where CK_FOO is the type name in PKCS #11. All non-structure types are changed to ck_foo_t where CK_FOO is the lowercase version of the type name in PKCS #11. The basic types (CK_ULONG et al.) are removed without substitute. All members of structures are modified in the following way: Type indication prefixes are removed, and underscore characters are inserted before words. Then the result is lowercased. Note that function names are still in the original case, as they need for ABI compatibility. CK_FALSE, CK_TRUE and NULL_PTR are removed without substitute. Use . If CRYPTOKI_COMPAT is defined before including this header file, then none of the API changes above take place, and the API is the one defined by the PKCS #11 standard. */ #ifndef PKCS11_H #define PKCS11_H 1 #if defined(__cplusplus) extern "C" { #endif /* The version of cryptoki we implement. The revision is changed with each modification of this file. If you do not use the "official" version of this file, please consider deleting the revision macro (you may use a macro with a different name to keep track of your versions). */ #define CRYPTOKI_VERSION_MAJOR 2 #define CRYPTOKI_VERSION_MINOR 20 #define CRYPTOKI_VERSION_REVISION 6 /* Compatibility interface is default, unless CRYPTOKI_GNU is given. */ #ifndef CRYPTOKI_GNU #ifndef CRYPTOKI_COMPAT #define CRYPTOKI_COMPAT 1 #endif #endif /* System dependencies. */ #if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) /* There is a matching pop below. */ #pragma pack(push, cryptoki, 1) #ifdef CRYPTOKI_EXPORTS #define CK_SPEC __declspec(dllexport) #else #define CK_SPEC __declspec(dllimport) #endif #else #define CK_SPEC #endif #ifdef CRYPTOKI_COMPAT /* If we are in compatibility mode, switch all exposed names to the PKCS #11 variant. There are corresponding #undefs below. */ #define ck_flags_t CK_FLAGS #define ck_version _CK_VERSION #define ck_info _CK_INFO #define cryptoki_version cryptokiVersion #define manufacturer_id manufacturerID #define library_description libraryDescription #define library_version libraryVersion #define ck_notification_t CK_NOTIFICATION #define ck_slot_id_t CK_SLOT_ID #define ck_slot_info _CK_SLOT_INFO #define slot_description slotDescription #define hardware_version hardwareVersion #define firmware_version firmwareVersion #define ck_token_info _CK_TOKEN_INFO #define serial_number serialNumber #define max_session_count ulMaxSessionCount #define session_count ulSessionCount #define max_rw_session_count ulMaxRwSessionCount #define rw_session_count ulRwSessionCount #define max_pin_len ulMaxPinLen #define min_pin_len ulMinPinLen #define total_public_memory ulTotalPublicMemory #define free_public_memory ulFreePublicMemory #define total_private_memory ulTotalPrivateMemory #define free_private_memory ulFreePrivateMemory #define utc_time utcTime #define ck_session_handle_t CK_SESSION_HANDLE #define ck_user_type_t CK_USER_TYPE #define ck_state_t CK_STATE #define ck_session_info _CK_SESSION_INFO #define slot_id slotID #define device_error ulDeviceError #define ck_object_handle_t CK_OBJECT_HANDLE #define ck_object_class_t CK_OBJECT_CLASS #define ck_hw_feature_type_t CK_HW_FEATURE_TYPE #define ck_key_type_t CK_KEY_TYPE #define ck_certificate_type_t CK_CERTIFICATE_TYPE #define ck_attribute_type_t CK_ATTRIBUTE_TYPE #define ck_attribute _CK_ATTRIBUTE #define value pValue #define value_len ulValueLen #define ck_date _CK_DATE #define ck_mechanism_type_t CK_MECHANISM_TYPE #define ck_mechanism _CK_MECHANISM #define parameter pParameter #define parameter_len ulParameterLen #define ck_mechanism_info _CK_MECHANISM_INFO #define min_key_size ulMinKeySize #define max_key_size ulMaxKeySize #define ck_rv_t CK_RV #define ck_notify_t CK_NOTIFY #define ck_function_list _CK_FUNCTION_LIST #define ck_createmutex_t CK_CREATEMUTEX #define ck_destroymutex_t CK_DESTROYMUTEX #define ck_lockmutex_t CK_LOCKMUTEX #define ck_unlockmutex_t CK_UNLOCKMUTEX #define ck_c_initialize_args _CK_C_INITIALIZE_ARGS #define create_mutex CreateMutex #define destroy_mutex DestroyMutex #define lock_mutex LockMutex #define unlock_mutex UnlockMutex #define reserved pReserved #endif /* CRYPTOKI_COMPAT */ typedef unsigned long ck_flags_t; struct ck_version { unsigned char major; unsigned char minor; }; struct ck_info { struct ck_version cryptoki_version; unsigned char manufacturer_id[32]; ck_flags_t flags; unsigned char library_description[32]; struct ck_version library_version; }; typedef unsigned long ck_notification_t; #define CKN_SURRENDER (0UL) typedef unsigned long ck_slot_id_t; struct ck_slot_info { unsigned char slot_description[64]; unsigned char manufacturer_id[32]; ck_flags_t flags; struct ck_version hardware_version; struct ck_version firmware_version; }; #define CKF_TOKEN_PRESENT (1UL << 0) #define CKF_REMOVABLE_DEVICE (1UL << 1) #define CKF_HW_SLOT (1UL << 2) #define CKF_ARRAY_ATTRIBUTE (1UL << 30) struct ck_token_info { unsigned char label[32]; unsigned char manufacturer_id[32]; unsigned char model[16]; unsigned char serial_number[16]; ck_flags_t flags; unsigned long max_session_count; unsigned long session_count; unsigned long max_rw_session_count; unsigned long rw_session_count; unsigned long max_pin_len; unsigned long min_pin_len; unsigned long total_public_memory; unsigned long free_public_memory; unsigned long total_private_memory; unsigned long free_private_memory; struct ck_version hardware_version; struct ck_version firmware_version; unsigned char utc_time[16]; }; #define CKF_RNG (1UL << 0) #define CKF_WRITE_PROTECTED (1UL << 1) #define CKF_LOGIN_REQUIRED (1UL << 2) #define CKF_USER_PIN_INITIALIZED (1UL << 3) #define CKF_RESTORE_KEY_NOT_NEEDED (1UL << 5) #define CKF_CLOCK_ON_TOKEN (1UL << 6) #define CKF_PROTECTED_AUTHENTICATION_PATH (1UL << 8) #define CKF_DUAL_CRYPTO_OPERATIONS (1UL << 9) #define CKF_TOKEN_INITIALIZED (1UL << 10) #define CKF_SECONDARY_AUTHENTICATION (1UL << 11) #define CKF_USER_PIN_COUNT_LOW (1UL << 16) #define CKF_USER_PIN_FINAL_TRY (1UL << 17) #define CKF_USER_PIN_LOCKED (1UL << 18) #define CKF_USER_PIN_TO_BE_CHANGED (1UL << 19) #define CKF_SO_PIN_COUNT_LOW (1UL << 20) #define CKF_SO_PIN_FINAL_TRY (1UL << 21) #define CKF_SO_PIN_LOCKED (1UL << 22) #define CKF_SO_PIN_TO_BE_CHANGED (1UL << 23) #define CK_UNAVAILABLE_INFORMATION ((unsigned long)-1L) #define CK_EFFECTIVELY_INFINITE (0UL) typedef unsigned long ck_session_handle_t; #define CK_INVALID_HANDLE (0UL) typedef unsigned long ck_user_type_t; #define CKU_SO (0UL) #define CKU_USER (1UL) #define CKU_CONTEXT_SPECIFIC (2UL) typedef unsigned long ck_state_t; #define CKS_RO_PUBLIC_SESSION (0UL) #define CKS_RO_USER_FUNCTIONS (1UL) #define CKS_RW_PUBLIC_SESSION (2UL) #define CKS_RW_USER_FUNCTIONS (3UL) #define CKS_RW_SO_FUNCTIONS (4UL) struct ck_session_info { ck_slot_id_t slot_id; ck_state_t state; ck_flags_t flags; unsigned long device_error; }; #define CKF_RW_SESSION (1UL << 1) #define CKF_SERIAL_SESSION (1UL << 2) typedef unsigned long ck_object_handle_t; typedef unsigned long ck_object_class_t; #define CKO_DATA (0UL) #define CKO_CERTIFICATE (1UL) #define CKO_PUBLIC_KEY (2UL) #define CKO_PRIVATE_KEY (3UL) #define CKO_SECRET_KEY (4UL) #define CKO_HW_FEATURE (5UL) #define CKO_DOMAIN_PARAMETERS (6UL) #define CKO_MECHANISM (7UL) #define CKO_VENDOR_DEFINED ((unsigned long) (1UL << 31)) typedef unsigned long ck_hw_feature_type_t; #define CKH_MONOTONIC_COUNTER (1UL) #define CKH_CLOCK (2UL) #define CKH_USER_INTERFACE (3UL) #define CKH_VENDOR_DEFINED ((unsigned long) (1UL << 31)) typedef unsigned long ck_key_type_t; #define CKK_RSA (0UL) #define CKK_DSA (1UL) #define CKK_DH (2UL) #define CKK_ECDSA (3UL) #define CKK_EC (3UL) #define CKK_X9_42_DH (4UL) #define CKK_KEA (5UL) #define CKK_GENERIC_SECRET (0x10UL) #define CKK_RC2 (0x11UL) #define CKK_RC4 (0x12UL) #define CKK_DES (0x13UL) #define CKK_DES2 (0x14UL) #define CKK_DES3 (0x15UL) #define CKK_CAST (0x16UL) #define CKK_CAST3 (0x17UL) #define CKK_CAST128 (0x18UL) #define CKK_RC5 (0x19UL) #define CKK_IDEA (0x1aUL) #define CKK_SKIPJACK (0x1bUL) #define CKK_BATON (0x1cUL) #define CKK_JUNIPER (0x1dUL) #define CKK_CDMF (0x1eUL) #define CKK_AES (0x1fUL) #define CKK_BLOWFISH (0x20UL) #define CKK_TWOFISH (0x21UL) #define CKK_VENDOR_DEFINED ((unsigned long) (1UL << 31)) typedef unsigned long ck_certificate_type_t; #define CKC_X_509 (0UL) #define CKC_X_509_ATTR_CERT (1UL) #define CKC_WTLS (2UL) #define CKC_VENDOR_DEFINED ((unsigned long) (1UL << 31)) typedef unsigned long ck_attribute_type_t; #define CKA_CLASS (0UL) #define CKA_TOKEN (1UL) #define CKA_PRIVATE (2UL) #define CKA_LABEL (3UL) #define CKA_APPLICATION (0x10UL) #define CKA_VALUE (0x11UL) #define CKA_OBJECT_ID (0x12UL) #define CKA_CERTIFICATE_TYPE (0x80UL) #define CKA_ISSUER (0x81UL) #define CKA_SERIAL_NUMBER (0x82UL) #define CKA_AC_ISSUER (0x83UL) #define CKA_OWNER (0x84UL) #define CKA_ATTR_TYPES (0x85UL) #define CKA_TRUSTED (0x86UL) #define CKA_CERTIFICATE_CATEGORY (0x87UL) #define CKA_JAVA_MIDP_SECURITY_DOMAIN (0x88UL) #define CKA_URL (0x89UL) #define CKA_HASH_OF_SUBJECT_PUBLIC_KEY (0x8aUL) #define CKA_HASH_OF_ISSUER_PUBLIC_KEY (0x8bUL) #define CKA_CHECK_VALUE (0x90UL) #define CKA_KEY_TYPE (0x100UL) #define CKA_SUBJECT (0x101UL) #define CKA_ID (0x102UL) #define CKA_SENSITIVE (0x103UL) #define CKA_ENCRYPT (0x104UL) #define CKA_DECRYPT (0x105UL) #define CKA_WRAP (0x106UL) #define CKA_UNWRAP (0x107UL) #define CKA_SIGN (0x108UL) #define CKA_SIGN_RECOVER (0x109UL) #define CKA_VERIFY (0x10aUL) #define CKA_VERIFY_RECOVER (0x10bUL) #define CKA_DERIVE (0x10cUL) #define CKA_START_DATE (0x110UL) #define CKA_END_DATE (0x111UL) #define CKA_MODULUS (0x120UL) #define CKA_MODULUS_BITS (0x121UL) #define CKA_PUBLIC_EXPONENT (0x122UL) #define CKA_PRIVATE_EXPONENT (0x123UL) #define CKA_PRIME_1 (0x124UL) #define CKA_PRIME_2 (0x125UL) #define CKA_EXPONENT_1 (0x126UL) #define CKA_EXPONENT_2 (0x127UL) #define CKA_COEFFICIENT (0x128UL) #define CKA_PRIME (0x130UL) #define CKA_SUBPRIME (0x131UL) #define CKA_BASE (0x132UL) #define CKA_PRIME_BITS (0x133UL) #define CKA_SUB_PRIME_BITS (0x134UL) #define CKA_VALUE_BITS (0x160UL) #define CKA_VALUE_LEN (0x161UL) #define CKA_EXTRACTABLE (0x162UL) #define CKA_LOCAL (0x163UL) #define CKA_NEVER_EXTRACTABLE (0x164UL) #define CKA_ALWAYS_SENSITIVE (0x165UL) #define CKA_KEY_GEN_MECHANISM (0x166UL) #define CKA_MODIFIABLE (0x170UL) #define CKA_ECDSA_PARAMS (0x180UL) #define CKA_EC_PARAMS (0x180UL) #define CKA_EC_POINT (0x181UL) #define CKA_SECONDARY_AUTH (0x200UL) #define CKA_AUTH_PIN_FLAGS (0x201UL) #define CKA_ALWAYS_AUTHENTICATE (0x202UL) #define CKA_WRAP_WITH_TRUSTED (0x210UL) #define CKA_HW_FEATURE_TYPE (0x300UL) #define CKA_RESET_ON_INIT (0x301UL) #define CKA_HAS_RESET (0x302UL) #define CKA_PIXEL_X (0x400UL) #define CKA_PIXEL_Y (0x401UL) #define CKA_RESOLUTION (0x402UL) #define CKA_CHAR_ROWS (0x403UL) #define CKA_CHAR_COLUMNS (0x404UL) #define CKA_COLOR (0x405UL) #define CKA_BITS_PER_PIXEL (0x406UL) #define CKA_CHAR_SETS (0x480UL) #define CKA_ENCODING_METHODS (0x481UL) #define CKA_MIME_TYPES (0x482UL) #define CKA_MECHANISM_TYPE (0x500UL) #define CKA_REQUIRED_CMS_ATTRIBUTES (0x501UL) #define CKA_DEFAULT_CMS_ATTRIBUTES (0x502UL) #define CKA_SUPPORTED_CMS_ATTRIBUTES (0x503UL) #define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x211UL) #define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x212UL) #define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE | 0x600UL) #define CKA_VENDOR_DEFINED ((unsigned long) (1UL << 31)) struct ck_attribute { ck_attribute_type_t type; void *value; unsigned long value_len; }; struct ck_date { unsigned char year[4]; unsigned char month[2]; unsigned char day[2]; }; typedef unsigned long ck_mechanism_type_t; #define CKM_RSA_PKCS_KEY_PAIR_GEN (0UL) #define CKM_RSA_PKCS (1UL) #define CKM_RSA_9796 (2UL) #define CKM_RSA_X_509 (3UL) #define CKM_MD2_RSA_PKCS (4UL) #define CKM_MD5_RSA_PKCS (5UL) #define CKM_SHA1_RSA_PKCS (6UL) #define CKM_RIPEMD128_RSA_PKCS (7UL) #define CKM_RIPEMD160_RSA_PKCS (8UL) #define CKM_RSA_PKCS_OAEP (9UL) #define CKM_RSA_X9_31_KEY_PAIR_GEN (0xaUL) #define CKM_RSA_X9_31 (0xbUL) #define CKM_SHA1_RSA_X9_31 (0xcUL) #define CKM_RSA_PKCS_PSS (0xdUL) #define CKM_SHA1_RSA_PKCS_PSS (0xeUL) #define CKM_DSA_KEY_PAIR_GEN (0x10UL) #define CKM_DSA (0x11UL) #define CKM_DSA_SHA1 (0x12UL) #define CKM_DH_PKCS_KEY_PAIR_GEN (0x20UL) #define CKM_DH_PKCS_DERIVE (0x21UL) #define CKM_X9_42_DH_KEY_PAIR_GEN (0x30UL) #define CKM_X9_42_DH_DERIVE (0x31UL) #define CKM_X9_42_DH_HYBRID_DERIVE (0x32UL) #define CKM_X9_42_MQV_DERIVE (0x33UL) #define CKM_SHA256_RSA_PKCS (0x40UL) #define CKM_SHA384_RSA_PKCS (0x41UL) #define CKM_SHA512_RSA_PKCS (0x42UL) #define CKM_SHA256_RSA_PKCS_PSS (0x43UL) #define CKM_SHA384_RSA_PKCS_PSS (0x44UL) #define CKM_SHA512_RSA_PKCS_PSS (0x45UL) #define CKM_RC2_KEY_GEN (0x100UL) #define CKM_RC2_ECB (0x101UL) #define CKM_RC2_CBC (0x102UL) #define CKM_RC2_MAC (0x103UL) #define CKM_RC2_MAC_GENERAL (0x104UL) #define CKM_RC2_CBC_PAD (0x105UL) #define CKM_RC4_KEY_GEN (0x110UL) #define CKM_RC4 (0x111UL) #define CKM_DES_KEY_GEN (0x120UL) #define CKM_DES_ECB (0x121UL) #define CKM_DES_CBC (0x122UL) #define CKM_DES_MAC (0x123UL) #define CKM_DES_MAC_GENERAL (0x124UL) #define CKM_DES_CBC_PAD (0x125UL) #define CKM_DES2_KEY_GEN (0x130UL) #define CKM_DES3_KEY_GEN (0x131UL) #define CKM_DES3_ECB (0x132UL) #define CKM_DES3_CBC (0x133UL) #define CKM_DES3_MAC (0x134UL) #define CKM_DES3_MAC_GENERAL (0x135UL) #define CKM_DES3_CBC_PAD (0x136UL) #define CKM_CDMF_KEY_GEN (0x140UL) #define CKM_CDMF_ECB (0x141UL) #define CKM_CDMF_CBC (0x142UL) #define CKM_CDMF_MAC (0x143UL) #define CKM_CDMF_MAC_GENERAL (0x144UL) #define CKM_CDMF_CBC_PAD (0x145UL) #define CKM_DES_OFB64 (0x150UL) #define CKM_DES_OFB8 (0x151UL) #define CKM_DES_CFB64 (0x152UL) #define CKM_DES_CFB8 (0x153UL) #define CKM_MD2 (0x200UL) #define CKM_MD2_HMAC (0x201UL) #define CKM_MD2_HMAC_GENERAL (0x202UL) #define CKM_MD5 (0x210UL) #define CKM_MD5_HMAC (0x211UL) #define CKM_MD5_HMAC_GENERAL (0x212UL) #define CKM_SHA_1 (0x220UL) #define CKM_SHA_1_HMAC (0x221UL) #define CKM_SHA_1_HMAC_GENERAL (0x222UL) #define CKM_RIPEMD128 (0x230UL) #define CKM_RIPEMD128_HMAC (0x231UL) #define CKM_RIPEMD128_HMAC_GENERAL (0x232UL) #define CKM_RIPEMD160 (0x240UL) #define CKM_RIPEMD160_HMAC (0x241UL) #define CKM_RIPEMD160_HMAC_GENERAL (0x242UL) #define CKM_SHA256 (0x250UL) #define CKM_SHA256_HMAC (0x251UL) #define CKM_SHA256_HMAC_GENERAL (0x252UL) #define CKM_SHA384 (0x260UL) #define CKM_SHA384_HMAC (0x261UL) #define CKM_SHA384_HMAC_GENERAL (0x262UL) #define CKM_SHA512 (0x270UL) #define CKM_SHA512_HMAC (0x271UL) #define CKM_SHA512_HMAC_GENERAL (0x272UL) #define CKM_CAST_KEY_GEN (0x300UL) #define CKM_CAST_ECB (0x301UL) #define CKM_CAST_CBC (0x302UL) #define CKM_CAST_MAC (0x303UL) #define CKM_CAST_MAC_GENERAL (0x304UL) #define CKM_CAST_CBC_PAD (0x305UL) #define CKM_CAST3_KEY_GEN (0x310UL) #define CKM_CAST3_ECB (0x311UL) #define CKM_CAST3_CBC (0x312UL) #define CKM_CAST3_MAC (0x313UL) #define CKM_CAST3_MAC_GENERAL (0x314UL) #define CKM_CAST3_CBC_PAD (0x315UL) #define CKM_CAST5_KEY_GEN (0x320UL) #define CKM_CAST128_KEY_GEN (0x320UL) #define CKM_CAST5_ECB (0x321UL) #define CKM_CAST128_ECB (0x321UL) #define CKM_CAST5_CBC (0x322UL) #define CKM_CAST128_CBC (0x322UL) #define CKM_CAST5_MAC (0x323UL) #define CKM_CAST128_MAC (0x323UL) #define CKM_CAST5_MAC_GENERAL (0x324UL) #define CKM_CAST128_MAC_GENERAL (0x324UL) #define CKM_CAST5_CBC_PAD (0x325UL) #define CKM_CAST128_CBC_PAD (0x325UL) #define CKM_RC5_KEY_GEN (0x330UL) #define CKM_RC5_ECB (0x331UL) #define CKM_RC5_CBC (0x332UL) #define CKM_RC5_MAC (0x333UL) #define CKM_RC5_MAC_GENERAL (0x334UL) #define CKM_RC5_CBC_PAD (0x335UL) #define CKM_IDEA_KEY_GEN (0x340UL) #define CKM_IDEA_ECB (0x341UL) #define CKM_IDEA_CBC (0x342UL) #define CKM_IDEA_MAC (0x343UL) #define CKM_IDEA_MAC_GENERAL (0x344UL) #define CKM_IDEA_CBC_PAD (0x345UL) #define CKM_GENERIC_SECRET_KEY_GEN (0x350UL) #define CKM_CONCATENATE_BASE_AND_KEY (0x360UL) #define CKM_CONCATENATE_BASE_AND_DATA (0x362UL) #define CKM_CONCATENATE_DATA_AND_BASE (0x363UL) #define CKM_XOR_BASE_AND_DATA (0x364UL) #define CKM_EXTRACT_KEY_FROM_KEY (0x365UL) #define CKM_SSL3_PRE_MASTER_KEY_GEN (0x370UL) #define CKM_SSL3_MASTER_KEY_DERIVE (0x371UL) #define CKM_SSL3_KEY_AND_MAC_DERIVE (0x372UL) #define CKM_SSL3_MASTER_KEY_DERIVE_DH (0x373UL) #define CKM_TLS_PRE_MASTER_KEY_GEN (0x374UL) #define CKM_TLS_MASTER_KEY_DERIVE (0x375UL) #define CKM_TLS_KEY_AND_MAC_DERIVE (0x376UL) #define CKM_TLS_MASTER_KEY_DERIVE_DH (0x377UL) #define CKM_TLS_PRF (0x378UL) #define CKM_SSL3_MD5_MAC (0x380UL) #define CKM_SSL3_SHA1_MAC (0x381UL) #define CKM_MD5_KEY_DERIVATION (0x390UL) #define CKM_MD2_KEY_DERIVATION (0x391UL) #define CKM_SHA1_KEY_DERIVATION (0x392UL) #define CKM_SHA256_KEY_DERIVATION (0x393UL) #define CKM_SHA384_KEY_DERIVATION (0x394UL) #define CKM_SHA512_KEY_DERIVATION (0x395UL) #define CKM_PBE_MD2_DES_CBC (0x3a0UL) #define CKM_PBE_MD5_DES_CBC (0x3a1UL) #define CKM_PBE_MD5_CAST_CBC (0x3a2UL) #define CKM_PBE_MD5_CAST3_CBC (0x3a3UL) #define CKM_PBE_MD5_CAST5_CBC (0x3a4UL) #define CKM_PBE_MD5_CAST128_CBC (0x3a4UL) #define CKM_PBE_SHA1_CAST5_CBC (0x3a5UL) #define CKM_PBE_SHA1_CAST128_CBC (0x3a5UL) #define CKM_PBE_SHA1_RC4_128 (0x3a6UL) #define CKM_PBE_SHA1_RC4_40 (0x3a7UL) #define CKM_PBE_SHA1_DES3_EDE_CBC (0x3a8UL) #define CKM_PBE_SHA1_DES2_EDE_CBC (0x3a9UL) #define CKM_PBE_SHA1_RC2_128_CBC (0x3aaUL) #define CKM_PBE_SHA1_RC2_40_CBC (0x3abUL) #define CKM_PKCS5_PBKD2 (0x3b0UL) #define CKM_PBA_SHA1_WITH_SHA1_HMAC (0x3c0UL) #define CKM_WTLS_PRE_MASTER_KEY_GEN (0x3d0UL) #define CKM_WTLS_MASTER_KEY_DERIVE (0x3d1UL) #define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC (0x3d2UL) #define CKM_WTLS_PRF (0x3d3UL) #define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE (0x3d4UL) #define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE (0x3d5UL) #define CKM_KEY_WRAP_LYNKS (0x400UL) #define CKM_KEY_WRAP_SET_OAEP (0x401UL) #define CKM_CMS_SIG (0x500UL) #define CKM_SKIPJACK_KEY_GEN (0x1000UL) #define CKM_SKIPJACK_ECB64 (0x1001UL) #define CKM_SKIPJACK_CBC64 (0x1002UL) #define CKM_SKIPJACK_OFB64 (0x1003UL) #define CKM_SKIPJACK_CFB64 (0x1004UL) #define CKM_SKIPJACK_CFB32 (0x1005UL) #define CKM_SKIPJACK_CFB16 (0x1006UL) #define CKM_SKIPJACK_CFB8 (0x1007UL) #define CKM_SKIPJACK_WRAP (0x1008UL) #define CKM_SKIPJACK_PRIVATE_WRAP (0x1009UL) #define CKM_SKIPJACK_RELAYX (0x100aUL) #define CKM_KEA_KEY_PAIR_GEN (0x1010UL) #define CKM_KEA_KEY_DERIVE (0x1011UL) #define CKM_FORTEZZA_TIMESTAMP (0x1020UL) #define CKM_BATON_KEY_GEN (0x1030UL) #define CKM_BATON_ECB128 (0x1031UL) #define CKM_BATON_ECB96 (0x1032UL) #define CKM_BATON_CBC128 (0x1033UL) #define CKM_BATON_COUNTER (0x1034UL) #define CKM_BATON_SHUFFLE (0x1035UL) #define CKM_BATON_WRAP (0x1036UL) #define CKM_ECDSA_KEY_PAIR_GEN (0x1040UL) #define CKM_EC_KEY_PAIR_GEN (0x1040UL) #define CKM_ECDSA (0x1041UL) #define CKM_ECDSA_SHA1 (0x1042UL) #define CKM_ECDH1_DERIVE (0x1050UL) #define CKM_ECDH1_COFACTOR_DERIVE (0x1051UL) #define CKM_ECMQV_DERIVE (0x1052UL) #define CKM_JUNIPER_KEY_GEN (0x1060UL) #define CKM_JUNIPER_ECB128 (0x1061UL) #define CKM_JUNIPER_CBC128 (0x1062UL) #define CKM_JUNIPER_COUNTER (0x1063UL) #define CKM_JUNIPER_SHUFFLE (0x1064UL) #define CKM_JUNIPER_WRAP (0x1065UL) #define CKM_FASTHASH (0x1070UL) #define CKM_AES_KEY_GEN (0x1080UL) #define CKM_AES_ECB (0x1081UL) #define CKM_AES_CBC (0x1082UL) #define CKM_AES_MAC (0x1083UL) #define CKM_AES_MAC_GENERAL (0x1084UL) #define CKM_AES_CBC_PAD (0x1085UL) #define CKM_BLOWFISH_KEY_GEN (0x1090UL) #define CKM_BLOWFISH_CBC (0x1091UL) #define CKM_TWOFISH_KEY_GEN (0x1092UL) #define CKM_TWOFISH_CBC (0x1093UL) #define CKM_DES_ECB_ENCRYPT_DATA (0x1100UL) #define CKM_DES_CBC_ENCRYPT_DATA (0x1101UL) #define CKM_DES3_ECB_ENCRYPT_DATA (0x1102UL) #define CKM_DES3_CBC_ENCRYPT_DATA (0x1103UL) #define CKM_AES_ECB_ENCRYPT_DATA (0x1104UL) #define CKM_AES_CBC_ENCRYPT_DATA (0x1105UL) #define CKM_DSA_PARAMETER_GEN (0x2000UL) #define CKM_DH_PKCS_PARAMETER_GEN (0x2001UL) #define CKM_X9_42_DH_PARAMETER_GEN (0x2002UL) #define CKM_VENDOR_DEFINED ((unsigned long) (1UL << 31)) /* Ammendments */ #define CKM_SHA224 (0x255UL) #define CKM_SHA224_HMAC (0x256UL) #define CKM_SHA224_HMAC_GENERAL (0x257UL) #define CKM_SHA224_RSA_PKCS (0x46UL) #define CKM_SHA224_RSA_PKCS_PSS (0x47UL) #define CKM_SHA224_KEY_DERIVATION (0x396UL) #define CKM_CAMELLIA_KEY_GEN (0x550UL) #define CKM_CAMELLIA_ECB (0x551UL) #define CKM_CAMELLIA_CBC (0x552UL) #define CKM_CAMELLIA_MAC (0x553UL) #define CKM_CAMELLIA_MAC_GENERAL (0x554UL) #define CKM_CAMELLIA_CBC_PAD (0x555UL) #define CKM_CAMELLIA_ECB_ENCRYPT_DATA (0x556UL) #define CKM_CAMELLIA_CBC_ENCRYPT_DATA (0x557UL) struct ck_mechanism { ck_mechanism_type_t mechanism; void *parameter; unsigned long parameter_len; }; struct ck_mechanism_info { unsigned long min_key_size; unsigned long max_key_size; ck_flags_t flags; }; #define CKF_HW (1UL << 0) #define CKF_ENCRYPT (1UL << 8) #define CKF_DECRYPT (1UL << 9) #define CKF_DIGEST (1UL << 10) #define CKF_SIGN (1UL << 11) #define CKF_SIGN_RECOVER (1UL << 12) #define CKF_VERIFY (1UL << 13) #define CKF_VERIFY_RECOVER (1UL << 14) #define CKF_GENERATE (1UL << 15) #define CKF_GENERATE_KEY_PAIR (1UL << 16) #define CKF_WRAP (1UL << 17) #define CKF_UNWRAP (1UL << 18) #define CKF_DERIVE (1UL << 19) #define CKF_EXTENSION ((unsigned long) (1UL << 31)) /* Flags for C_WaitForSlotEvent. */ #define CKF_DONT_BLOCK (1UL) typedef unsigned long ck_rv_t; typedef ck_rv_t (*ck_notify_t) (ck_session_handle_t session, ck_notification_t event, void *application); /* Forward reference. */ struct ck_function_list; #define _CK_DECLARE_FUNCTION(name, args) \ typedef ck_rv_t (*CK_ ## name) args; \ ck_rv_t CK_SPEC name args _CK_DECLARE_FUNCTION (C_Initialize, (void *init_args)); _CK_DECLARE_FUNCTION (C_Finalize, (void *reserved)); _CK_DECLARE_FUNCTION (C_GetInfo, (struct ck_info *info)); _CK_DECLARE_FUNCTION (C_GetFunctionList, (struct ck_function_list **function_list)); _CK_DECLARE_FUNCTION (C_GetSlotList, (unsigned char token_present, ck_slot_id_t *slot_list, unsigned long *count)); _CK_DECLARE_FUNCTION (C_GetSlotInfo, (ck_slot_id_t slot_id, struct ck_slot_info *info)); _CK_DECLARE_FUNCTION (C_GetTokenInfo, (ck_slot_id_t slot_id, struct ck_token_info *info)); _CK_DECLARE_FUNCTION (C_WaitForSlotEvent, (ck_flags_t flags, ck_slot_id_t *slot, void *reserved)); _CK_DECLARE_FUNCTION (C_GetMechanismList, (ck_slot_id_t slot_id, ck_mechanism_type_t *mechanism_list, unsigned long *count)); _CK_DECLARE_FUNCTION (C_GetMechanismInfo, (ck_slot_id_t slot_id, ck_mechanism_type_t type, struct ck_mechanism_info *info)); _CK_DECLARE_FUNCTION (C_InitToken, (ck_slot_id_t slot_id, unsigned char *pin, unsigned long pin_len, unsigned char *label)); _CK_DECLARE_FUNCTION (C_InitPIN, (ck_session_handle_t session, unsigned char *pin, unsigned long pin_len)); _CK_DECLARE_FUNCTION (C_SetPIN, (ck_session_handle_t session, unsigned char *old_pin, unsigned long old_len, unsigned char *new_pin, unsigned long new_len)); _CK_DECLARE_FUNCTION (C_OpenSession, (ck_slot_id_t slot_id, ck_flags_t flags, void *application, ck_notify_t notify, ck_session_handle_t *session)); _CK_DECLARE_FUNCTION (C_CloseSession, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CloseAllSessions, (ck_slot_id_t slot_id)); _CK_DECLARE_FUNCTION (C_GetSessionInfo, (ck_session_handle_t session, struct ck_session_info *info)); _CK_DECLARE_FUNCTION (C_GetOperationState, (ck_session_handle_t session, unsigned char *operation_state, unsigned long *operation_state_len)); _CK_DECLARE_FUNCTION (C_SetOperationState, (ck_session_handle_t session, unsigned char *operation_state, unsigned long operation_state_len, ck_object_handle_t encryption_key, ck_object_handle_t authentiation_key)); _CK_DECLARE_FUNCTION (C_Login, (ck_session_handle_t session, ck_user_type_t user_type, unsigned char *pin, unsigned long pin_len)); _CK_DECLARE_FUNCTION (C_Logout, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CreateObject, (ck_session_handle_t session, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *object)); _CK_DECLARE_FUNCTION (C_CopyObject, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *new_object)); _CK_DECLARE_FUNCTION (C_DestroyObject, (ck_session_handle_t session, ck_object_handle_t object)); _CK_DECLARE_FUNCTION (C_GetObjectSize, (ck_session_handle_t session, ck_object_handle_t object, unsigned long *size)); _CK_DECLARE_FUNCTION (C_GetAttributeValue, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_SetAttributeValue, (ck_session_handle_t session, ck_object_handle_t object, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_FindObjectsInit, (ck_session_handle_t session, struct ck_attribute *templ, unsigned long count)); _CK_DECLARE_FUNCTION (C_FindObjects, (ck_session_handle_t session, ck_object_handle_t *object, unsigned long max_object_count, unsigned long *object_count)); _CK_DECLARE_FUNCTION (C_FindObjectsFinal, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_EncryptInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Encrypt, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *encrypted_data, unsigned long *encrypted_data_len)); _CK_DECLARE_FUNCTION (C_EncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_EncryptFinal, (ck_session_handle_t session, unsigned char *last_encrypted_part, unsigned long *last_encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Decrypt, (ck_session_handle_t session, unsigned char *encrypted_data, unsigned long encrypted_data_len, unsigned char *data, unsigned long *data_len)); _CK_DECLARE_FUNCTION (C_DecryptUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_DecryptFinal, (ck_session_handle_t session, unsigned char *last_part, unsigned long *last_part_len)); _CK_DECLARE_FUNCTION (C_DigestInit, (ck_session_handle_t session, struct ck_mechanism *mechanism)); _CK_DECLARE_FUNCTION (C_Digest, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *digest, unsigned long *digest_len)); _CK_DECLARE_FUNCTION (C_DigestUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_DigestKey, (ck_session_handle_t session, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_DigestFinal, (ck_session_handle_t session, unsigned char *digest, unsigned long *digest_len)); _CK_DECLARE_FUNCTION (C_SignInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Sign, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_SignUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_SignFinal, (ck_session_handle_t session, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_SignRecoverInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_SignRecover, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long *signature_len)); _CK_DECLARE_FUNCTION (C_VerifyInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_Verify, (ck_session_handle_t session, unsigned char *data, unsigned long data_len, unsigned char *signature, unsigned long signature_len)); _CK_DECLARE_FUNCTION (C_VerifyUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len)); _CK_DECLARE_FUNCTION (C_VerifyFinal, (ck_session_handle_t session, unsigned char *signature, unsigned long signature_len)); _CK_DECLARE_FUNCTION (C_VerifyRecoverInit, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t key)); _CK_DECLARE_FUNCTION (C_VerifyRecover, (ck_session_handle_t session, unsigned char *signature, unsigned long signature_len, unsigned char *data, unsigned long *data_len)); _CK_DECLARE_FUNCTION (C_DigestEncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptDigestUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_SignEncryptUpdate, (ck_session_handle_t session, unsigned char *part, unsigned long part_len, unsigned char *encrypted_part, unsigned long *encrypted_part_len)); _CK_DECLARE_FUNCTION (C_DecryptVerifyUpdate, (ck_session_handle_t session, unsigned char *encrypted_part, unsigned long encrypted_part_len, unsigned char *part, unsigned long *part_len)); _CK_DECLARE_FUNCTION (C_GenerateKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, struct ck_attribute *templ, unsigned long count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_GenerateKeyPair, (ck_session_handle_t session, struct ck_mechanism *mechanism, struct ck_attribute *public_key_template, unsigned long public_key_attribute_count, struct ck_attribute *private_key_template, unsigned long private_key_attribute_count, ck_object_handle_t *public_key, ck_object_handle_t *private_key)); _CK_DECLARE_FUNCTION (C_WrapKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t wrapping_key, ck_object_handle_t key, unsigned char *wrapped_key, unsigned long *wrapped_key_len)); _CK_DECLARE_FUNCTION (C_UnwrapKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t unwrapping_key, unsigned char *wrapped_key, unsigned long wrapped_key_len, struct ck_attribute *templ, unsigned long attribute_count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_DeriveKey, (ck_session_handle_t session, struct ck_mechanism *mechanism, ck_object_handle_t base_key, struct ck_attribute *templ, unsigned long attribute_count, ck_object_handle_t *key)); _CK_DECLARE_FUNCTION (C_SeedRandom, (ck_session_handle_t session, unsigned char *seed, unsigned long seed_len)); _CK_DECLARE_FUNCTION (C_GenerateRandom, (ck_session_handle_t session, unsigned char *random_data, unsigned long random_len)); _CK_DECLARE_FUNCTION (C_GetFunctionStatus, (ck_session_handle_t session)); _CK_DECLARE_FUNCTION (C_CancelFunction, (ck_session_handle_t session)); struct ck_function_list { struct ck_version version; CK_C_Initialize C_Initialize; CK_C_Finalize C_Finalize; CK_C_GetInfo C_GetInfo; CK_C_GetFunctionList C_GetFunctionList; CK_C_GetSlotList C_GetSlotList; CK_C_GetSlotInfo C_GetSlotInfo; CK_C_GetTokenInfo C_GetTokenInfo; CK_C_GetMechanismList C_GetMechanismList; CK_C_GetMechanismInfo C_GetMechanismInfo; CK_C_InitToken C_InitToken; CK_C_InitPIN C_InitPIN; CK_C_SetPIN C_SetPIN; CK_C_OpenSession C_OpenSession; CK_C_CloseSession C_CloseSession; CK_C_CloseAllSessions C_CloseAllSessions; CK_C_GetSessionInfo C_GetSessionInfo; CK_C_GetOperationState C_GetOperationState; CK_C_SetOperationState C_SetOperationState; CK_C_Login C_Login; CK_C_Logout C_Logout; CK_C_CreateObject C_CreateObject; CK_C_CopyObject C_CopyObject; CK_C_DestroyObject C_DestroyObject; CK_C_GetObjectSize C_GetObjectSize; CK_C_GetAttributeValue C_GetAttributeValue; CK_C_SetAttributeValue C_SetAttributeValue; CK_C_FindObjectsInit C_FindObjectsInit; CK_C_FindObjects C_FindObjects; CK_C_FindObjectsFinal C_FindObjectsFinal; CK_C_EncryptInit C_EncryptInit; CK_C_Encrypt C_Encrypt; CK_C_EncryptUpdate C_EncryptUpdate; CK_C_EncryptFinal C_EncryptFinal; CK_C_DecryptInit C_DecryptInit; CK_C_Decrypt C_Decrypt; CK_C_DecryptUpdate C_DecryptUpdate; CK_C_DecryptFinal C_DecryptFinal; CK_C_DigestInit C_DigestInit; CK_C_Digest C_Digest; CK_C_DigestUpdate C_DigestUpdate; CK_C_DigestKey C_DigestKey; CK_C_DigestFinal C_DigestFinal; CK_C_SignInit C_SignInit; CK_C_Sign C_Sign; CK_C_SignUpdate C_SignUpdate; CK_C_SignFinal C_SignFinal; CK_C_SignRecoverInit C_SignRecoverInit; CK_C_SignRecover C_SignRecover; CK_C_VerifyInit C_VerifyInit; CK_C_Verify C_Verify; CK_C_VerifyUpdate C_VerifyUpdate; CK_C_VerifyFinal C_VerifyFinal; CK_C_VerifyRecoverInit C_VerifyRecoverInit; CK_C_VerifyRecover C_VerifyRecover; CK_C_DigestEncryptUpdate C_DigestEncryptUpdate; CK_C_DecryptDigestUpdate C_DecryptDigestUpdate; CK_C_SignEncryptUpdate C_SignEncryptUpdate; CK_C_DecryptVerifyUpdate C_DecryptVerifyUpdate; CK_C_GenerateKey C_GenerateKey; CK_C_GenerateKeyPair C_GenerateKeyPair; CK_C_WrapKey C_WrapKey; CK_C_UnwrapKey C_UnwrapKey; CK_C_DeriveKey C_DeriveKey; CK_C_SeedRandom C_SeedRandom; CK_C_GenerateRandom C_GenerateRandom; CK_C_GetFunctionStatus C_GetFunctionStatus; CK_C_CancelFunction C_CancelFunction; CK_C_WaitForSlotEvent C_WaitForSlotEvent; }; typedef ck_rv_t (*ck_createmutex_t) (void **mutex); typedef ck_rv_t (*ck_destroymutex_t) (void *mutex); typedef ck_rv_t (*ck_lockmutex_t) (void *mutex); typedef ck_rv_t (*ck_unlockmutex_t) (void *mutex); struct ck_c_initialize_args { ck_createmutex_t create_mutex; ck_destroymutex_t destroy_mutex; ck_lockmutex_t lock_mutex; ck_unlockmutex_t unlock_mutex; ck_flags_t flags; void *reserved; }; #define CKF_LIBRARY_CANT_CREATE_OS_THREADS (1UL << 0) #define CKF_OS_LOCKING_OK (1UL << 1) #define CKR_OK (0UL) #define CKR_CANCEL (1UL) #define CKR_HOST_MEMORY (2UL) #define CKR_SLOT_ID_INVALID (3UL) #define CKR_GENERAL_ERROR (5UL) #define CKR_FUNCTION_FAILED (6UL) #define CKR_ARGUMENTS_BAD (7UL) #define CKR_NO_EVENT (8UL) #define CKR_NEED_TO_CREATE_THREADS (9UL) #define CKR_CANT_LOCK (0xaUL) #define CKR_ATTRIBUTE_READ_ONLY (0x10UL) #define CKR_ATTRIBUTE_SENSITIVE (0x11UL) #define CKR_ATTRIBUTE_TYPE_INVALID (0x12UL) #define CKR_ATTRIBUTE_VALUE_INVALID (0x13UL) #define CKR_DATA_INVALID (0x20UL) #define CKR_DATA_LEN_RANGE (0x21UL) #define CKR_DEVICE_ERROR (0x30UL) #define CKR_DEVICE_MEMORY (0x31UL) #define CKR_DEVICE_REMOVED (0x32UL) #define CKR_ENCRYPTED_DATA_INVALID (0x40UL) #define CKR_ENCRYPTED_DATA_LEN_RANGE (0x41UL) #define CKR_FUNCTION_CANCELED (0x50UL) #define CKR_FUNCTION_NOT_PARALLEL (0x51UL) #define CKR_FUNCTION_NOT_SUPPORTED (0x54UL) #define CKR_KEY_HANDLE_INVALID (0x60UL) #define CKR_KEY_SIZE_RANGE (0x62UL) #define CKR_KEY_TYPE_INCONSISTENT (0x63UL) #define CKR_KEY_NOT_NEEDED (0x64UL) #define CKR_KEY_CHANGED (0x65UL) #define CKR_KEY_NEEDED (0x66UL) #define CKR_KEY_INDIGESTIBLE (0x67UL) #define CKR_KEY_FUNCTION_NOT_PERMITTED (0x68UL) #define CKR_KEY_NOT_WRAPPABLE (0x69UL) #define CKR_KEY_UNEXTRACTABLE (0x6aUL) #define CKR_MECHANISM_INVALID (0x70UL) #define CKR_MECHANISM_PARAM_INVALID (0x71UL) #define CKR_OBJECT_HANDLE_INVALID (0x82UL) #define CKR_OPERATION_ACTIVE (0x90UL) #define CKR_OPERATION_NOT_INITIALIZED (0x91UL) #define CKR_PIN_INCORRECT (0xa0UL) #define CKR_PIN_INVALID (0xa1UL) #define CKR_PIN_LEN_RANGE (0xa2UL) #define CKR_PIN_EXPIRED (0xa3UL) #define CKR_PIN_LOCKED (0xa4UL) #define CKR_SESSION_CLOSED (0xb0UL) #define CKR_SESSION_COUNT (0xb1UL) #define CKR_SESSION_HANDLE_INVALID (0xb3UL) #define CKR_SESSION_PARALLEL_NOT_SUPPORTED (0xb4UL) #define CKR_SESSION_READ_ONLY (0xb5UL) #define CKR_SESSION_EXISTS (0xb6UL) #define CKR_SESSION_READ_ONLY_EXISTS (0xb7UL) #define CKR_SESSION_READ_WRITE_SO_EXISTS (0xb8UL) #define CKR_SIGNATURE_INVALID (0xc0UL) #define CKR_SIGNATURE_LEN_RANGE (0xc1UL) #define CKR_TEMPLATE_INCOMPLETE (0xd0UL) #define CKR_TEMPLATE_INCONSISTENT (0xd1UL) #define CKR_TOKEN_NOT_PRESENT (0xe0UL) #define CKR_TOKEN_NOT_RECOGNIZED (0xe1UL) #define CKR_TOKEN_WRITE_PROTECTED (0xe2UL) #define CKR_UNWRAPPING_KEY_HANDLE_INVALID (0xf0UL) #define CKR_UNWRAPPING_KEY_SIZE_RANGE (0xf1UL) #define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT (0xf2UL) #define CKR_USER_ALREADY_LOGGED_IN (0x100UL) #define CKR_USER_NOT_LOGGED_IN (0x101UL) #define CKR_USER_PIN_NOT_INITIALIZED (0x102UL) #define CKR_USER_TYPE_INVALID (0x103UL) #define CKR_USER_ANOTHER_ALREADY_LOGGED_IN (0x104UL) #define CKR_USER_TOO_MANY_TYPES (0x105UL) #define CKR_WRAPPED_KEY_INVALID (0x110UL) #define CKR_WRAPPED_KEY_LEN_RANGE (0x112UL) #define CKR_WRAPPING_KEY_HANDLE_INVALID (0x113UL) #define CKR_WRAPPING_KEY_SIZE_RANGE (0x114UL) #define CKR_WRAPPING_KEY_TYPE_INCONSISTENT (0x115UL) #define CKR_RANDOM_SEED_NOT_SUPPORTED (0x120UL) #define CKR_RANDOM_NO_RNG (0x121UL) #define CKR_DOMAIN_PARAMS_INVALID (0x130UL) #define CKR_BUFFER_TOO_SMALL (0x150UL) #define CKR_SAVED_STATE_INVALID (0x160UL) #define CKR_INFORMATION_SENSITIVE (0x170UL) #define CKR_STATE_UNSAVEABLE (0x180UL) #define CKR_CRYPTOKI_NOT_INITIALIZED (0x190UL) #define CKR_CRYPTOKI_ALREADY_INITIALIZED (0x191UL) #define CKR_MUTEX_BAD (0x1a0UL) #define CKR_MUTEX_NOT_LOCKED (0x1a1UL) #define CKR_FUNCTION_REJECTED (0x200UL) #define CKR_VENDOR_DEFINED ((unsigned long) (1UL << 31)) /* Compatibility layer. */ #ifdef CRYPTOKI_COMPAT #undef CK_DEFINE_FUNCTION #define CK_DEFINE_FUNCTION(retval, name) retval CK_SPEC name /* For NULL. */ #include typedef unsigned char CK_BYTE; typedef unsigned char CK_CHAR; typedef unsigned char CK_UTF8CHAR; typedef unsigned char CK_BBOOL; typedef unsigned long int CK_ULONG; typedef long int CK_LONG; typedef CK_BYTE *CK_BYTE_PTR; typedef CK_CHAR *CK_CHAR_PTR; typedef CK_UTF8CHAR *CK_UTF8CHAR_PTR; typedef CK_ULONG *CK_ULONG_PTR; typedef void *CK_VOID_PTR; typedef void **CK_VOID_PTR_PTR; #define CK_FALSE 0 #define CK_TRUE 1 #ifndef CK_DISABLE_TRUE_FALSE #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif #endif typedef struct ck_version CK_VERSION; typedef struct ck_version *CK_VERSION_PTR; typedef struct ck_info CK_INFO; typedef struct ck_info *CK_INFO_PTR; typedef ck_slot_id_t *CK_SLOT_ID_PTR; typedef struct ck_slot_info CK_SLOT_INFO; typedef struct ck_slot_info *CK_SLOT_INFO_PTR; typedef struct ck_token_info CK_TOKEN_INFO; typedef struct ck_token_info *CK_TOKEN_INFO_PTR; typedef ck_session_handle_t *CK_SESSION_HANDLE_PTR; typedef struct ck_session_info CK_SESSION_INFO; typedef struct ck_session_info *CK_SESSION_INFO_PTR; typedef ck_object_handle_t *CK_OBJECT_HANDLE_PTR; typedef ck_object_class_t *CK_OBJECT_CLASS_PTR; typedef struct ck_attribute CK_ATTRIBUTE; typedef struct ck_attribute *CK_ATTRIBUTE_PTR; typedef struct ck_date CK_DATE; typedef struct ck_date *CK_DATE_PTR; typedef ck_mechanism_type_t *CK_MECHANISM_TYPE_PTR; typedef struct ck_mechanism CK_MECHANISM; typedef struct ck_mechanism *CK_MECHANISM_PTR; typedef struct ck_mechanism_info CK_MECHANISM_INFO; typedef struct ck_mechanism_info *CK_MECHANISM_INFO_PTR; typedef struct ck_function_list CK_FUNCTION_LIST; typedef struct ck_function_list *CK_FUNCTION_LIST_PTR; typedef struct ck_function_list **CK_FUNCTION_LIST_PTR_PTR; typedef struct ck_c_initialize_args CK_C_INITIALIZE_ARGS; typedef struct ck_c_initialize_args *CK_C_INITIALIZE_ARGS_PTR; #define NULL_PTR NULL /* Delete the helper macros defined at the top of the file. */ #undef ck_flags_t #undef ck_version #undef ck_info #undef cryptoki_version #undef manufacturer_id #undef library_description #undef library_version #undef ck_notification_t #undef ck_slot_id_t #undef ck_slot_info #undef slot_description #undef hardware_version #undef firmware_version #undef ck_token_info #undef serial_number #undef max_session_count #undef session_count #undef max_rw_session_count #undef rw_session_count #undef max_pin_len #undef min_pin_len #undef total_public_memory #undef free_public_memory #undef total_private_memory #undef free_private_memory #undef utc_time #undef ck_session_handle_t #undef ck_user_type_t #undef ck_state_t #undef ck_session_info #undef slot_id #undef device_error #undef ck_object_handle_t #undef ck_object_class_t #undef ck_hw_feature_type_t #undef ck_key_type_t #undef ck_certificate_type_t #undef ck_attribute_type_t #undef ck_attribute #undef value #undef value_len #undef ck_date #undef ck_mechanism_type_t #undef ck_mechanism #undef parameter #undef parameter_len #undef ck_mechanism_info #undef min_key_size #undef max_key_size #undef ck_rv_t #undef ck_notify_t #undef ck_function_list #undef ck_createmutex_t #undef ck_destroymutex_t #undef ck_lockmutex_t #undef ck_unlockmutex_t #undef ck_c_initialize_args #undef create_mutex #undef destroy_mutex #undef lock_mutex #undef unlock_mutex #undef reserved #endif /* CRYPTOKI_COMPAT */ /* System dependencies. */ #if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) #pragma pack(pop, cryptoki) #endif #if defined(__cplusplus) } #endif #endif /* PKCS11_H */ p11-kit-0.20.2/common/message.h0000664000175000017500000000466312225535713013007 00000000000000/* * Copyright (c) 2011 Collabora Ltd * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * CONTRIBUTORS * Stef Walter */ #ifndef P11_MESSAGE_H_ #define P11_MESSAGE_H_ #include "compat.h" #include #define P11_MESSAGE_MAX 512 extern char * (* p11_message_storage) (void); void p11_message (const char* msg, ...) GNUC_PRINTF (1, 2); void p11_message_err (int errnum, const char* msg, ...) GNUC_PRINTF (2, 3); void p11_message_store (const char* msg, size_t length); const char * p11_message_last (void); void p11_message_clear (void); void p11_message_quiet (void); void p11_message_loud (void); #endif /* P11_MESSAGE_H_ */ p11-kit-0.20.2/common/mock.c0000664000175000017500000033235012263255461012305 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "debug.h" #define CRYPTOKI_EXPORTS #include "pkcs11.h" #include "message.h" #include "mock.h" #include "attrs.h" #define P11_DEBUG_FLAG P11_DEBUG_LIB #include "debug.h" #include "dict.h" #include "array.h" #include #include #include #include #include #include #include /* ------------------------------------------------------------------- * GLOBALS and SUPPORT STUFF */ /* Various mutexes */ static p11_mutex_t init_mutex; /* Whether we've been initialized, and on what process id it happened */ static bool pkcs11_initialized = false; static pid_t pkcs11_initialized_pid = 0; static CK_UTF8CHAR *the_pin = NULL; static CK_ULONG n_the_pin = 0; static bool logged_in = false; static CK_USER_TYPE the_user_type = 0; typedef struct _Session { CK_SESSION_HANDLE handle; p11_dict *objects; CK_SESSION_INFO info; /* For find operations */ bool finding; p11_array *matches; bool want_context_login; /* For encrypt, decrypt operations */ CK_OBJECT_HANDLE crypto_key; CK_ATTRIBUTE_TYPE crypto_method; CK_MECHANISM_TYPE crypto_mechanism; /* For sign, verify, digest, CKM_MOCK_COUNT */ CK_MECHANISM_TYPE hash_mechanism; CK_ATTRIBUTE_TYPE hash_method; CK_OBJECT_HANDLE hash_key; CK_ULONG hash_count; /* For 'signing' with CKM_MOCK_PREFIX */ CK_BYTE sign_prefix[128]; CK_ULONG n_sign_prefix; /* The random seed */ CK_BYTE random_seed[128]; CK_ULONG random_seed_len; } Session; static unsigned int unique_identifier = 100; static p11_dict *the_sessions = NULL; static p11_dict *the_objects = NULL; #define SIGNED_PREFIX "signed-prefix:" #define handle_to_pointer(handle) \ ((void *)(size_t)(handle)) #define pointer_to_handle(pointer) \ ((CK_ULONG)(size_t)(pointer)) static void free_session (void *data) { Session *sess = (Session *)data; if (sess) { p11_dict_free (sess->objects); p11_array_free (sess->matches); } free (sess); } static CK_RV lookup_object (Session *sess, CK_OBJECT_HANDLE object, CK_ATTRIBUTE **attrs, p11_dict **table) { CK_BBOOL priv; *attrs = p11_dict_get (the_objects, handle_to_pointer (object)); if (*attrs) { if (table) *table = the_objects; } else { *attrs = p11_dict_get (sess->objects, handle_to_pointer (object)); if (*attrs) { if (table) *table = sess->objects; } } if (!*attrs) return CKR_OBJECT_HANDLE_INVALID; else if (!logged_in && p11_attrs_find_bool (*attrs, CKA_PRIVATE, &priv) && priv) return CKR_USER_NOT_LOGGED_IN; return CKR_OK; } void mock_module_add_object (CK_SLOT_ID slot_id, const CK_ATTRIBUTE *attrs) { CK_ATTRIBUTE *copy; return_if_fail (slot_id == MOCK_SLOT_ONE_ID); return_if_fail (attrs != NULL); copy = p11_attrs_dup (attrs); return_if_fail (copy != NULL); mock_module_take_object (slot_id, copy); } void mock_module_take_object (CK_SLOT_ID slot_id, CK_ATTRIBUTE *attrs) { CK_OBJECT_HANDLE object; return_if_fail (slot_id == MOCK_SLOT_ONE_ID); return_if_fail (attrs != NULL); object = ++unique_identifier; if (!p11_dict_set (the_objects, handle_to_pointer (object), attrs)) return_if_reached (); } static void module_reset_objects (CK_SLOT_ID slot_id) { return_if_fail (slot_id == MOCK_SLOT_ONE_ID); if (!the_objects) { the_objects = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, p11_attrs_free); } p11_dict_clear (the_objects); /* Our token object */ { CK_OBJECT_CLASS klass = CKO_DATA; char *label = "TEST LABEL"; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_LABEL, label, strlen (label) }, { CKA_INVALID, NULL, 0 }, }; p11_dict_set (the_objects, handle_to_pointer (MOCK_DATA_OBJECT), p11_attrs_dup (attrs)); } /* Private capitalize key */ { CK_OBJECT_CLASS klass = CKO_PRIVATE_KEY; char *label = "Private Capitalize Key"; char *value = "value"; CK_MECHANISM_TYPE type = CKM_MOCK_CAPITALIZE; CK_BBOOL btrue = CK_TRUE; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_LABEL, label, strlen (label) }, { CKA_ALLOWED_MECHANISMS, &type, sizeof (type) }, { CKA_DECRYPT, &btrue, sizeof (btrue) }, { CKA_PRIVATE, &btrue, sizeof (btrue) }, { CKA_WRAP, &btrue, sizeof (btrue) }, { CKA_UNWRAP, &btrue, sizeof (btrue) }, { CKA_DERIVE, &btrue, sizeof (btrue) }, { CKA_VALUE, value, strlen (value) }, { CKA_INVALID, NULL, 0 }, }; p11_dict_set (the_objects, handle_to_pointer (MOCK_PRIVATE_KEY_CAPITALIZE), p11_attrs_dup (attrs)); } { CK_OBJECT_CLASS klass = CKO_PUBLIC_KEY; char *label = "Public Capitalize Key"; char *value = "value"; CK_MECHANISM_TYPE type = CKM_MOCK_CAPITALIZE; CK_BBOOL btrue = CK_TRUE; CK_BBOOL bfalse = CK_FALSE; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_LABEL, label, strlen (label) }, { CKA_ALLOWED_MECHANISMS, &type, sizeof (type) }, { CKA_ENCRYPT, &btrue, sizeof (btrue) }, { CKA_PRIVATE, &bfalse, sizeof (bfalse) }, { CKA_VALUE, value, strlen (value) }, { CKA_INVALID, NULL, 0 }, }; p11_dict_set (the_objects, handle_to_pointer (MOCK_PUBLIC_KEY_CAPITALIZE), p11_attrs_dup (attrs)); } { CK_OBJECT_CLASS klass = CKO_PRIVATE_KEY; char *label = "Private prefix key"; char *value = "value"; CK_MECHANISM_TYPE type = CKM_MOCK_PREFIX; CK_BBOOL btrue = CK_TRUE; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_LABEL, label, strlen (label) }, { CKA_ALLOWED_MECHANISMS, &type, sizeof (type) }, { CKA_SIGN, &btrue, sizeof (btrue) }, { CKA_PRIVATE, &btrue, sizeof (btrue) }, { CKA_ALWAYS_AUTHENTICATE, &btrue, sizeof (btrue) }, { CKA_VALUE, value, strlen (value) }, { CKA_INVALID, NULL, 0 }, }; p11_dict_set (the_objects, handle_to_pointer (MOCK_PRIVATE_KEY_PREFIX), p11_attrs_dup (attrs)); } { CK_OBJECT_CLASS klass = CKO_PUBLIC_KEY; char *label = "Public prefix key"; char *value = "value"; CK_MECHANISM_TYPE type = CKM_MOCK_PREFIX; CK_BBOOL btrue = CK_TRUE; CK_BBOOL bfalse = CK_FALSE; CK_ATTRIBUTE attrs[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_LABEL, label, strlen (label) }, { CKA_ALLOWED_MECHANISMS, &type, sizeof (type) }, { CKA_VERIFY, &btrue, sizeof (btrue) }, { CKA_PRIVATE, &bfalse, sizeof (bfalse) }, { CKA_ALWAYS_AUTHENTICATE, &btrue, sizeof (btrue) }, { CKA_VALUE, value, strlen (value) }, { CKA_INVALID, NULL, 0 }, }; p11_dict_set (the_objects, handle_to_pointer (MOCK_PUBLIC_KEY_PREFIX), p11_attrs_dup (attrs)); } } static void module_finalize (void) { p11_mutex_lock (&init_mutex); /* This should stop all other calls in */ pkcs11_initialized = false; pkcs11_initialized_pid = 0; if (the_objects) p11_dict_free (the_objects); the_objects = NULL; if (the_sessions) p11_dict_free (the_sessions); the_sessions = NULL; logged_in = false; the_user_type = 0; free (the_pin); the_pin = NULL; n_the_pin = 0; p11_mutex_unlock (&init_mutex); } bool mock_module_initialized (void) { return pkcs11_initialized; } void mock_module_reset (void) { module_finalize (); module_reset_objects (MOCK_SLOT_ONE_ID); } void mock_module_enumerate_objects (CK_SESSION_HANDLE handle, mock_enumerator func, void *user_data) { p11_dictiter iter; void *key; void *value; Session *sess; assert (the_objects != NULL); assert (func != NULL); /* Token objects */ p11_dict_iterate (the_objects, &iter); while (p11_dict_next (&iter, &key, &value)) { if (!(func) (pointer_to_handle (key), value, user_data)) return; } /* session objects */ if (handle) { sess = p11_dict_get (the_sessions, handle_to_pointer (handle)); if (sess) { p11_dict_iterate (sess->objects, &iter); while (p11_dict_next (&iter, &key, &value)) { if (!(func) (pointer_to_handle (key), value, user_data)) return; } } } } /* ------------------------------------------------------------------- * INITIALIZATION and 'GLOBAL' CALLS */ CK_RV mock_C_Initialize (CK_VOID_PTR init_args) { CK_C_INITIALIZE_ARGS_PTR args = NULL; CK_RV ret = CKR_OK; pid_t pid; p11_mutex_lock (&init_mutex); if (init_args != NULL) { int supplied_ok; /* pReserved must be NULL */ args = init_args; /* ALL supplied function pointers need to have the value either NULL or non-NULL. */ supplied_ok = (args->CreateMutex == NULL && args->DestroyMutex == NULL && args->LockMutex == NULL && args->UnlockMutex == NULL) || (args->CreateMutex != NULL && args->DestroyMutex != NULL && args->LockMutex != NULL && args->UnlockMutex != NULL); if (!supplied_ok) { p11_debug_precond ("invalid set of mutex calls supplied\n"); ret = CKR_ARGUMENTS_BAD; goto done; } /* * When the CKF_OS_LOCKING_OK flag isn't set return an error. * We must be able to use our pthread functionality. */ if (!(args->flags & CKF_OS_LOCKING_OK)) { p11_debug_precond ("can't do without os locking\n"); ret = CKR_CANT_LOCK; goto done; } } pid = getpid (); if (pkcs11_initialized) { /* This process has called C_Initialize already */ if (pid == pkcs11_initialized_pid) { p11_debug_precond ("p11-kit: C_Initialize called twice for same process\n"); ret = CKR_CRYPTOKI_ALREADY_INITIALIZED; goto done; } } /* We store CK_ULONG as pointers here, so verify that they fit */ assert (sizeof (CK_ULONG) <= sizeof (void *)); the_pin = (CK_UTF8CHAR_PTR)strdup ("booo"); n_the_pin = 4; the_sessions = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, free_session); module_reset_objects (MOCK_SLOT_ONE_ID); done: /* Mark us as officially initialized */ if (ret == CKR_OK) { pkcs11_initialized = true; pkcs11_initialized_pid = pid; } else if (ret != CKR_CRYPTOKI_ALREADY_INITIALIZED) { pkcs11_initialized = false; pkcs11_initialized_pid = 0; } p11_mutex_unlock (&init_mutex); return ret; } CK_RV mock_X_Initialize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR init_args) { return mock_C_Initialize (init_args); } CK_RV mock_C_Initialize__fails (CK_VOID_PTR init_args) { return CKR_FUNCTION_FAILED; } CK_RV mock_C_Finalize (CK_VOID_PTR reserved) { return_val_if_fail (pkcs11_initialized, CKR_CRYPTOKI_NOT_INITIALIZED); return_val_if_fail (reserved == NULL, CKR_ARGUMENTS_BAD); module_finalize (); return CKR_OK; } CK_RV mock_X_Finalize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR reserved) { return mock_C_Finalize (reserved); } CK_RV mock_C_GetInfo (CK_INFO_PTR info) { return_val_if_fail (info, CKR_ARGUMENTS_BAD); memcpy (info, &MOCK_INFO, sizeof (*info)); return CKR_OK; } CK_RV mock_X_GetInfo (CK_X_FUNCTION_LIST *self, CK_INFO_PTR info) { return mock_C_GetInfo (info); } CK_RV mock_C_GetFunctionList_not_supported (CK_FUNCTION_LIST_PTR_PTR list) { /* This would be a strange call to receive, should be overridden */ return_val_if_reached (CKR_FUNCTION_NOT_SUPPORTED); } CK_RV mock_C_GetSlotList (CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count) { CK_ULONG num; return_val_if_fail (count, CKR_ARGUMENTS_BAD); num = token_present ? 1 : 2; /* Application only wants to know the number of slots. */ if (slot_list == NULL) { *count = num; return CKR_OK; } if (*count < num) return_val_if_reached (CKR_BUFFER_TOO_SMALL); *count = num; slot_list[0] = MOCK_SLOT_ONE_ID; if (!token_present) slot_list[1] = MOCK_SLOT_TWO_ID; return CKR_OK; } CK_RV mock_C_GetSlotList__no_tokens (CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count) { return_val_if_fail (count, CKR_ARGUMENTS_BAD); /* No tokens */ *count = 0; return CKR_OK; } CK_RV mock_X_GetSlotList__no_tokens (CK_X_FUNCTION_LIST *self, CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count) { return mock_C_GetSlotList__no_tokens (token_present, slot_list, count); ; } /* Update mock-module.h URIs when updating this */ static const CK_SLOT_INFO MOCK_INFO_ONE = { "TEST SLOT ", "TEST MANUFACTURER ", CKF_TOKEN_PRESENT | CKF_REMOVABLE_DEVICE, { 55, 155 }, { 65, 165 }, }; /* Update mock-module.h URIs when updating this */ static const CK_SLOT_INFO MOCK_INFO_TWO = { "TEST SLOT ", "TEST MANUFACTURER ", CKF_REMOVABLE_DEVICE, { 55, 155 }, { 65, 165 }, }; CK_RV mock_C_GetSlotInfo (CK_SLOT_ID slot_id, CK_SLOT_INFO_PTR info) { return_val_if_fail (info, CKR_ARGUMENTS_BAD); if (slot_id == MOCK_SLOT_ONE_ID) { memcpy (info, &MOCK_INFO_ONE, sizeof (*info)); return CKR_OK; } else if (slot_id == MOCK_SLOT_TWO_ID) { memcpy (info, &MOCK_INFO_TWO, sizeof (*info)); return CKR_OK; } else { return CKR_SLOT_ID_INVALID; } } CK_RV mock_C_GetSlotList__fail_first (CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count) { return CKR_VENDOR_DEFINED; } CK_RV mock_C_GetSlotList__fail_late (CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count) { if (!slot_list) return mock_C_GetSlotList (token_present, slot_list, count); return CKR_VENDOR_DEFINED; } CK_RV mock_C_GetSlotInfo__invalid_slotid (CK_SLOT_ID id, CK_SLOT_INFO_PTR info) { return_val_if_fail (info, CKR_ARGUMENTS_BAD); return CKR_SLOT_ID_INVALID; } CK_RV mock_X_GetSlotInfo__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID id, CK_SLOT_INFO_PTR info) { return_val_if_fail (info, CKR_ARGUMENTS_BAD); return CKR_SLOT_ID_INVALID; } /* Update gck-mock.h URIs when updating this */ static const CK_TOKEN_INFO MOCK_TOKEN_ONE = { "TEST LABEL ", "TEST MANUFACTURER ", "TEST MODEL ", "TEST SERIAL ", CKF_LOGIN_REQUIRED | CKF_USER_PIN_INITIALIZED | CKF_CLOCK_ON_TOKEN | CKF_TOKEN_INITIALIZED, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, { 75, 175 }, { 85, 185 }, { '1', '9', '9', '9', '0', '5', '2', '5', '0', '9', '1', '9', '5', '9', '0', '0' } }; CK_RV mock_C_GetTokenInfo (CK_SLOT_ID slot_id, CK_TOKEN_INFO_PTR info) { return_val_if_fail (info != NULL, CKR_ARGUMENTS_BAD); if (slot_id == MOCK_SLOT_ONE_ID) { memcpy (info, &MOCK_TOKEN_ONE, sizeof (*info)); return CKR_OK; } else if (slot_id == MOCK_SLOT_TWO_ID) { return CKR_TOKEN_NOT_PRESENT; } else { return CKR_SLOT_ID_INVALID; } } CK_RV mock_C_GetTokenInfo__invalid_slotid (CK_SLOT_ID slot_id, CK_TOKEN_INFO_PTR info) { return_val_if_fail (info, CKR_ARGUMENTS_BAD); return CKR_SLOT_ID_INVALID; } CK_RV mock_X_GetTokenInfo__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_TOKEN_INFO_PTR info) { return_val_if_fail (info, CKR_ARGUMENTS_BAD); return CKR_SLOT_ID_INVALID; } /* * TWO mechanisms: * CKM_MOCK_CAPITALIZE * CKM_MOCK_PREFIX */ CK_RV mock_C_GetMechanismList (CK_SLOT_ID slot_id, CK_MECHANISM_TYPE_PTR mechanism_list, CK_ULONG_PTR count) { return_val_if_fail (count != NULL, CKR_ARGUMENTS_BAD); if (slot_id == MOCK_SLOT_TWO_ID) return CKR_TOKEN_NOT_PRESENT; else if (slot_id != MOCK_SLOT_ONE_ID) return CKR_SLOT_ID_INVALID; /* Application only wants to know the number of slots. */ if (mechanism_list == NULL) { *count = 2; return CKR_OK; } if (*count < 2) return_val_if_reached (CKR_BUFFER_TOO_SMALL); mechanism_list[0] = CKM_MOCK_CAPITALIZE; mechanism_list[1] = CKM_MOCK_PREFIX; *count = 2; return CKR_OK; } CK_RV mock_C_GetTokenInfo__not_initialized (CK_SLOT_ID slot_id, CK_TOKEN_INFO_PTR info) { CK_RV rv; rv = mock_C_GetTokenInfo (slot_id, info); if (rv == CKR_OK) info->flags &= ~ CKF_TOKEN_INITIALIZED; return rv; } /* * TWO mechanisms: * CKM_MOCK_CAPITALIZE * CKM_MOCK_PREFIX */ CK_RV mock_C_GetMechanismList__invalid_slotid (CK_SLOT_ID id, CK_MECHANISM_TYPE_PTR mechanism_list, CK_ULONG_PTR count) { return_val_if_fail (count, CKR_ARGUMENTS_BAD); return CKR_SLOT_ID_INVALID; } CK_RV mock_X_GetMechanismList__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID id, CK_MECHANISM_TYPE_PTR mechanism_list, CK_ULONG_PTR count) { return_val_if_fail (count, CKR_ARGUMENTS_BAD); return CKR_SLOT_ID_INVALID; } static const CK_MECHANISM_INFO MOCK_MECH_CAPITALIZE = { 512, 4096, CKF_ENCRYPT | CKF_DECRYPT }; static const CK_MECHANISM_INFO MOCK_MECH_PREFIX = { 2048, 2048, CKF_SIGN | CKF_VERIFY }; CK_RV mock_C_GetMechanismInfo (CK_SLOT_ID slot_id, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR info) { return_val_if_fail (info, CKR_ARGUMENTS_BAD); if (slot_id == MOCK_SLOT_TWO_ID) return CKR_TOKEN_NOT_PRESENT; else if (slot_id != MOCK_SLOT_ONE_ID) return CKR_SLOT_ID_INVALID; if (type == CKM_MOCK_CAPITALIZE) { memcpy (info, &MOCK_MECH_CAPITALIZE, sizeof (*info)); return CKR_OK; } else if (type == CKM_MOCK_PREFIX) { memcpy (info, &MOCK_MECH_PREFIX, sizeof (*info)); return CKR_OK; } else { return CKR_MECHANISM_INVALID; } } CK_RV mock_C_GetMechanismInfo__invalid_slotid (CK_SLOT_ID slot_id, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR info) { return_val_if_fail (info, CKR_ARGUMENTS_BAD); return CKR_SLOT_ID_INVALID; } CK_RV mock_X_GetMechanismInfo__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR info) { return_val_if_fail (info, CKR_ARGUMENTS_BAD); return CKR_SLOT_ID_INVALID; } CK_RV mock_C_InitToken__specific_args (CK_SLOT_ID slot_id, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len, CK_UTF8CHAR_PTR label) { return_val_if_fail (pin != NULL, CKR_ARGUMENTS_BAD); return_val_if_fail (label != NULL, CKR_ARGUMENTS_BAD); if (slot_id == MOCK_SLOT_TWO_ID) return CKR_TOKEN_NOT_PRESENT; else if (slot_id != MOCK_SLOT_ONE_ID) return CKR_SLOT_ID_INVALID; if (strlen ("TEST PIN") != pin_len || strncmp ((char *)pin, "TEST PIN", pin_len) != 0) return CKR_PIN_INVALID; if (strcmp ((char *)label, "TEST LABEL") != 0) return CKR_ARGUMENTS_BAD; free (the_pin); the_pin = memdup (pin, pin_len); return_val_if_fail (the_pin != NULL, CKR_HOST_MEMORY); n_the_pin = pin_len; return CKR_OK; } CK_RV mock_C_InitToken__invalid_slotid (CK_SLOT_ID slot_id, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len, CK_UTF8CHAR_PTR label) { return CKR_SLOT_ID_INVALID; } CK_RV mock_X_InitToken__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len, CK_UTF8CHAR_PTR label) { return CKR_SLOT_ID_INVALID; } CK_RV mock_C_WaitForSlotEvent (CK_FLAGS flags, CK_SLOT_ID_PTR slot, CK_VOID_PTR reserved) { return_val_if_fail (slot, CKR_ARGUMENTS_BAD); if (flags & CKF_DONT_BLOCK) return CKR_NO_EVENT; *slot = MOCK_SLOT_TWO_ID; return CKR_OK; } CK_RV mock_C_WaitForSlotEvent__no_event (CK_FLAGS flags, CK_SLOT_ID_PTR slot, CK_VOID_PTR reserved) { return_val_if_fail (slot, CKR_ARGUMENTS_BAD); return CKR_NO_EVENT; } CK_RV mock_X_WaitForSlotEvent__no_event (CK_X_FUNCTION_LIST *self, CK_FLAGS flags, CK_SLOT_ID_PTR slot, CK_VOID_PTR reserved) { return_val_if_fail (slot, CKR_ARGUMENTS_BAD); return CKR_NO_EVENT; } CK_RV mock_C_OpenSession (CK_SLOT_ID slot_id, CK_FLAGS flags, CK_VOID_PTR user_data, CK_NOTIFY callback, CK_SESSION_HANDLE_PTR session) { Session *sess; return_val_if_fail (session, CKR_ARGUMENTS_BAD); if (slot_id == MOCK_SLOT_TWO_ID) return CKR_TOKEN_NOT_PRESENT; else if (slot_id != MOCK_SLOT_ONE_ID) return CKR_SLOT_ID_INVALID; if ((flags & CKF_SERIAL_SESSION) != CKF_SERIAL_SESSION) return CKR_SESSION_PARALLEL_NOT_SUPPORTED; sess = calloc (1, sizeof (Session)); sess->handle = ++unique_identifier; sess->info.flags = flags; sess->info.slotID = slot_id; sess->info.state = 0; sess->info.ulDeviceError = 1414; sess->objects = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, p11_attrs_free); *session = sess->handle; memcpy (sess->random_seed, "random", 6); sess->random_seed_len = 6; p11_dict_set (the_sessions, handle_to_pointer (sess->handle), sess); return CKR_OK; } CK_RV mock_C_OpenSession__invalid_slotid (CK_SLOT_ID slot_id, CK_FLAGS flags, CK_VOID_PTR user_data, CK_NOTIFY callback, CK_SESSION_HANDLE_PTR session) { return_val_if_fail (session, CKR_ARGUMENTS_BAD); return CKR_SLOT_ID_INVALID; } CK_RV mock_X_OpenSession__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_FLAGS flags, CK_VOID_PTR user_data, CK_NOTIFY callback, CK_SESSION_HANDLE_PTR session) { return_val_if_fail (session, CKR_ARGUMENTS_BAD); return CKR_SLOT_ID_INVALID; } CK_RV mock_C_OpenSession__fails (CK_SLOT_ID slot_id, CK_FLAGS flags, CK_VOID_PTR user_data, CK_NOTIFY callback, CK_SESSION_HANDLE_PTR session) { return_val_if_fail (session, CKR_ARGUMENTS_BAD); return CKR_DEVICE_ERROR; } CK_RV mock_C_CloseSession (CK_SESSION_HANDLE session) { Session *sess; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; p11_dict_remove (the_sessions, handle_to_pointer (session)); return CKR_OK; } CK_RV mock_C_CloseSession__invalid_handle (CK_SESSION_HANDLE session) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_CloseSession__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_CloseAllSessions (CK_SLOT_ID slot_id) { if (slot_id == MOCK_SLOT_TWO_ID) return CKR_TOKEN_NOT_PRESENT; else if (slot_id != MOCK_SLOT_ONE_ID) return CKR_SLOT_ID_INVALID; p11_dict_clear (the_sessions); return CKR_OK; } CK_RV mock_C_CloseAllSessions__invalid_slotid (CK_SLOT_ID slot_id) { return CKR_SLOT_ID_INVALID; } CK_RV mock_X_CloseAllSessions__invalid_slotid (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id) { return CKR_SLOT_ID_INVALID; } CK_RV mock_C_GetFunctionStatus (CK_SESSION_HANDLE session) { if (!p11_dict_get (the_sessions, handle_to_pointer (session))) return CKR_SESSION_HANDLE_INVALID; return CKR_FUNCTION_NOT_PARALLEL; } CK_RV mock_C_GetFunctionStatus__not_parallel (CK_SESSION_HANDLE session) { return CKR_FUNCTION_NOT_PARALLEL; } CK_RV mock_C_CancelFunction (CK_SESSION_HANDLE session) { if (!p11_dict_get (the_sessions, handle_to_pointer (session))) return CKR_SESSION_HANDLE_INVALID; return CKR_FUNCTION_NOT_PARALLEL; } CK_RV mock_C_CancelFunction__not_parallel (CK_SESSION_HANDLE session) { return CKR_FUNCTION_NOT_PARALLEL; } CK_RV mock_C_GetSessionInfo (CK_SESSION_HANDLE session, CK_SESSION_INFO_PTR info) { Session *sess; return_val_if_fail (info != NULL, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (logged_in) { if (sess->info.flags & CKF_RW_SESSION) sess->info.state = CKS_RW_USER_FUNCTIONS; else sess->info.state = CKS_RO_USER_FUNCTIONS; } else { if (sess->info.flags & CKF_RW_SESSION) sess->info.state = CKS_RW_PUBLIC_SESSION; else sess->info.state = CKS_RO_PUBLIC_SESSION; } memcpy (info, &sess->info, sizeof (*info)); return CKR_OK; } CK_RV mock_C_GetSessionInfo__invalid_handle (CK_SESSION_HANDLE session, CK_SESSION_INFO_PTR info) { return_val_if_fail (info, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_GetSessionInfo__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_SESSION_INFO_PTR info) { return_val_if_fail (info, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_InitPIN__specific_args (CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { Session *sess; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (sess == NULL) return CKR_SESSION_HANDLE_INVALID; if (strlen ("TEST PIN") != pin_len || strncmp ((char *)pin, "TEST PIN", pin_len) != 0) return CKR_PIN_INVALID; free (the_pin); the_pin = memdup (pin, pin_len); return_val_if_fail (the_pin != NULL, CKR_HOST_MEMORY); n_the_pin = pin_len; return CKR_OK; } CK_RV mock_C_InitPIN__invalid_handle (CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_InitPIN__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_SetPIN__specific_args (CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR old_pin, CK_ULONG old_pin_len, CK_UTF8CHAR_PTR new_pin, CK_ULONG new_pin_len) { Session *sess; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (sess == NULL) return CKR_SESSION_HANDLE_INVALID; if (old_pin_len != n_the_pin) return CKR_PIN_INCORRECT; if (memcmp (old_pin, the_pin, n_the_pin) != 0) return CKR_PIN_INCORRECT; if (strlen ("TEST PIN") != new_pin_len || strncmp ((char *)new_pin, "TEST PIN", new_pin_len) != 0) return CKR_PIN_INVALID; free (the_pin); the_pin = memdup (new_pin, new_pin_len); return_val_if_fail (the_pin != NULL, CKR_HOST_MEMORY); n_the_pin = new_pin_len; return CKR_OK; } CK_RV mock_C_SetPIN__invalid_handle (CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR old_pin, CK_ULONG old_pin_len, CK_UTF8CHAR_PTR new_pin, CK_ULONG new_pin_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_SetPIN__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR old_pin, CK_ULONG old_pin_len, CK_UTF8CHAR_PTR new_pin, CK_ULONG new_pin_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_GetOperationState (CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG_PTR operation_state_len) { Session *sess; return_val_if_fail (operation_state_len, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (sess == NULL) return CKR_SESSION_HANDLE_INVALID; if (!operation_state) { *operation_state_len = sizeof (sess); return CKR_OK; } if (*operation_state_len < sizeof (sess)) return CKR_BUFFER_TOO_SMALL; memcpy (operation_state, &sess, sizeof (sess)); *operation_state_len = sizeof (sess); return CKR_OK; } CK_RV mock_C_GetOperationState__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG_PTR operation_state_len) { return CKR_FUNCTION_NOT_SUPPORTED; } CK_RV mock_X_GetOperationState__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG_PTR operation_state_len) { return CKR_FUNCTION_NOT_SUPPORTED; } CK_RV mock_C_SetOperationState (CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key, CK_OBJECT_HANDLE authentication_key) { Session *sess; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (sess == NULL) return CKR_SESSION_HANDLE_INVALID; if (!operation_state || operation_state_len != sizeof (sess)) return CKR_ARGUMENTS_BAD; /* Yes, just arbitrary numbers, to make sure they got through */ if (encryption_key != 355 || authentication_key != 455) return CKR_KEY_HANDLE_INVALID; if (memcmp (operation_state, &sess, sizeof (sess)) != 0) return CKR_SAVED_STATE_INVALID; return CKR_OK; } CK_RV mock_C_SetOperationState__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key, CK_OBJECT_HANDLE authentication_key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_SetOperationState__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key, CK_OBJECT_HANDLE authentication_key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_Login (CK_SESSION_HANDLE session, CK_USER_TYPE user_type, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { Session *sess; return_val_if_fail (user_type == CKU_SO || user_type == CKU_USER || user_type == CKU_CONTEXT_SPECIFIC, CKR_USER_TYPE_INVALID); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (sess == NULL) return CKR_SESSION_HANDLE_INVALID; if (logged_in && user_type != CKU_CONTEXT_SPECIFIC) return CKR_USER_ALREADY_LOGGED_IN; if (!pin) return CKR_PIN_INCORRECT; if (pin_len != n_the_pin) return CKR_PIN_INCORRECT; if (strncmp ((char *)pin, (char *)the_pin, pin_len) != 0) return CKR_PIN_INCORRECT; if (user_type == CKU_CONTEXT_SPECIFIC) { return_val_if_fail (sess->want_context_login, CKR_OPERATION_NOT_INITIALIZED); sess->want_context_login = false; } else { logged_in = true; the_user_type = user_type; } return CKR_OK; } CK_RV mock_C_Login__invalid_handle (CK_SESSION_HANDLE session, CK_USER_TYPE user_type, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_Login__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_USER_TYPE user_type, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_Logout (CK_SESSION_HANDLE session) { Session *sess; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (!logged_in) return CKR_USER_NOT_LOGGED_IN; logged_in = false; the_user_type = 0; return CKR_OK; } CK_RV mock_C_Logout__invalid_handle (CK_SESSION_HANDLE session) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_Logout__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_CreateObject (CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR object) { CK_ATTRIBUTE *attrs; Session *sess; CK_BBOOL token, priv; return_val_if_fail (object, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; attrs = p11_attrs_buildn (NULL, template, count); if (p11_attrs_find_bool (attrs, CKA_PRIVATE, &priv) && priv) { if (!logged_in) { p11_attrs_free (attrs); return CKR_USER_NOT_LOGGED_IN; } } *object = ++unique_identifier; if (p11_attrs_find_bool (attrs, CKA_TOKEN, &token) && token) p11_dict_set (the_objects, handle_to_pointer (*object), attrs); else p11_dict_set (sess->objects, handle_to_pointer (*object), attrs); return CKR_OK; } CK_RV mock_C_CreateObject__invalid_handle (CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { return_val_if_fail (new_object, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_CreateObject__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { return_val_if_fail (new_object, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_CopyObject (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { CK_ATTRIBUTE *attrs; Session *sess; CK_BBOOL token, priv; CK_RV rv; return_val_if_fail (object, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; rv = lookup_object (sess, object, &attrs, NULL); if (rv != CKR_OK) return rv; if (p11_attrs_find_bool (attrs, CKA_PRIVATE, &priv) && priv) { if (!logged_in) return CKR_USER_NOT_LOGGED_IN; } attrs = p11_attrs_buildn (p11_attrs_dup (attrs), template, count); *new_object = ++unique_identifier; if (p11_attrs_find_bool (attrs, CKA_TOKEN, &token) && token) p11_dict_set (the_objects, handle_to_pointer (*new_object), attrs); else p11_dict_set (sess->objects, handle_to_pointer (*new_object), attrs); return CKR_OK; } CK_RV mock_C_CopyObject__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { return_val_if_fail (new_object, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_CopyObject__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { return_val_if_fail (new_object, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DestroyObject (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object) { CK_ATTRIBUTE *attrs; Session *sess; p11_dict *table; CK_RV rv; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; rv = lookup_object (sess, object, &attrs, &table); if (rv != CKR_OK) return rv; p11_dict_remove (table, handle_to_pointer (object)); return CKR_OK; } CK_RV mock_C_DestroyObject__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DestroyObject__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_GetObjectSize (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ULONG_PTR size) { CK_ATTRIBUTE *attrs; Session *sess; CK_RV rv; CK_ULONG i; return_val_if_fail (size != NULL, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; rv = lookup_object (sess, object, &attrs, NULL); if (rv != CKR_OK) return rv; *size = 0; for (i = 0; !p11_attrs_terminator (attrs + i); i++) { if (attrs[i].ulValueLen != (CK_ULONG)-1) *size += attrs[i].ulValueLen; } return CKR_OK; } CK_RV mock_C_GetObjectSize__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ULONG_PTR size) { return_val_if_fail (size, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_GetObjectSize__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ULONG_PTR size) { return_val_if_fail (size, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_GetAttributeValue (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { CK_ATTRIBUTE *result; CK_RV ret = CKR_OK; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *attr; Session *sess; CK_ULONG i; CK_RV rv; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (sess == NULL) return CKR_SESSION_HANDLE_INVALID; rv = lookup_object (sess, object, &attrs, NULL); if (rv != CKR_OK) return rv; for (i = 0; i < count; ++i) { result = template + i; attr = p11_attrs_find (attrs, result->type); if (!attr) { result->ulValueLen = (CK_ULONG)-1; ret = CKR_ATTRIBUTE_TYPE_INVALID; continue; } if (!result->pValue) { result->ulValueLen = attr->ulValueLen; continue; } if (result->ulValueLen >= attr->ulValueLen) { memcpy (result->pValue, attr->pValue, attr->ulValueLen); result->ulValueLen = attr->ulValueLen; continue; } result->ulValueLen = (CK_ULONG)-1; ret = CKR_BUFFER_TOO_SMALL; } return ret; } CK_RV mock_C_GetAttributeValue__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_GetAttributeValue__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_GetAttributeValue__fail_first (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { return CKR_FUNCTION_REJECTED; } CK_RV mock_C_GetAttributeValue__fail_late (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { CK_ULONG i; for (i = 0; i < count; i++) { if (template[i].pValue) return CKR_FUNCTION_FAILED; } return mock_C_GetAttributeValue (session, object, template, count); } CK_RV mock_C_SetAttributeValue (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { Session *sess; CK_ATTRIBUTE *attrs; p11_dict *table; CK_RV rv; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; rv = lookup_object (sess, object, &attrs, &table); if (rv != CKR_OK) return rv; p11_dict_steal (table, handle_to_pointer (object), NULL, (void **)&attrs); attrs = p11_attrs_buildn (attrs, template, count); p11_dict_set (table, handle_to_pointer (object), attrs); return CKR_OK; } CK_RV mock_C_SetAttributeValue__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_SetAttributeValue__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { return CKR_SESSION_HANDLE_INVALID; } typedef struct _FindObjects { CK_ATTRIBUTE *template; CK_ULONG count; Session *sess; } FindObjects; static bool enumerate_and_find_objects (CK_OBJECT_HANDLE object, CK_ATTRIBUTE *attrs, void *user_data) { FindObjects *ctx = user_data; CK_ATTRIBUTE *match; CK_ATTRIBUTE *attr; CK_BBOOL private; CK_ULONG i; if (!logged_in) { if (p11_attrs_find_bool (attrs, CKA_PRIVATE, &private) && private) return 1; /* Continue */ } for (i = 0; i < ctx->count; ++i) { match = ctx->template + i; attr = p11_attrs_find (attrs, match->type); if (!attr) return true; /* Continue */ if (attr->ulValueLen != match->ulValueLen || memcmp (attr->pValue, match->pValue, attr->ulValueLen) != 0) return true; /* Continue */ } p11_array_push (ctx->sess->matches, handle_to_pointer (object)); return true; /* Continue */ } static int compar_handles (const void *one, const void *two) { void **p1 = (void **)one; void **p2 = (void **)two; return pointer_to_handle (*p2) - pointer_to_handle (*p1); } CK_RV mock_C_FindObjectsInit (CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count) { Session *sess; FindObjects ctx; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; /* Starting an operation, cancels any previous one */ sess->crypto_mechanism = 0; sess->hash_mechanism = 0; sess->finding = true; p11_array_free (sess->matches); sess->matches = p11_array_new (NULL); ctx.template = template; ctx.count = count; ctx.sess = sess; mock_module_enumerate_objects (session, enumerate_and_find_objects, &ctx); qsort (sess->matches->elem, sess->matches->num, sizeof (void *), compar_handles); return CKR_OK; } CK_RV mock_C_FindObjectsInit__invalid_handle (CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_FindObjectsInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_FindObjectsInit__fails (CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count) { return CKR_DEVICE_MEMORY; } CK_RV mock_C_FindObjects (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE_PTR objects, CK_ULONG max_object_count, CK_ULONG_PTR object_count) { Session *sess; return_val_if_fail (objects, CKR_ARGUMENTS_BAD); return_val_if_fail (object_count, CKR_ARGUMENTS_BAD); return_val_if_fail (max_object_count != 0, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (sess == NULL) return CKR_SESSION_HANDLE_INVALID; if (!sess->finding) return CKR_OPERATION_NOT_INITIALIZED; *object_count = 0; while (max_object_count > 0) { if (sess->matches->num == 0) break; *objects = pointer_to_handle (sess->matches->elem[sess->matches->num - 1]); ++objects; --max_object_count; ++(*object_count); p11_array_remove (sess->matches, sess->matches->num - 1); } return CKR_OK; } CK_RV mock_C_FindObjects__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE_PTR objects, CK_ULONG max_count, CK_ULONG_PTR count) { return_val_if_fail (count, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_FindObjects__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE_PTR objects, CK_ULONG max_count, CK_ULONG_PTR count) { return_val_if_fail (count, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_FindObjects__fails (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE_PTR objects, CK_ULONG max_count, CK_ULONG_PTR count) { return_val_if_fail (count, CKR_ARGUMENTS_BAD); return CKR_DEVICE_REMOVED; } CK_RV mock_C_FindObjectsFinal (CK_SESSION_HANDLE session) { Session *sess; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (sess == NULL) return CKR_SESSION_HANDLE_INVALID; if (!sess->finding) return CKR_OPERATION_NOT_INITIALIZED; sess->finding = false; p11_array_free (sess->matches); sess->matches = NULL; return CKR_OK; } CK_RV mock_C_FindObjectsFinal__invalid_handle (CK_SESSION_HANDLE session) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_FindObjectsFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_EncryptInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { Session *sess; return_val_if_fail (mechanism != NULL, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; /* Starting an operation, cancels any previous one */ sess->finding = CK_FALSE; if (mechanism->mechanism != CKM_MOCK_CAPITALIZE) return CKR_MECHANISM_INVALID; if (key != MOCK_PUBLIC_KEY_CAPITALIZE) return CKR_KEY_HANDLE_INVALID; sess->crypto_method = CKA_ENCRYPT; sess->crypto_mechanism = CKM_MOCK_CAPITALIZE; sess->crypto_key = key; return CKR_OK; } CK_RV mock_C_EncryptInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_EncryptInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_Encrypt (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR encrypted_data, CK_ULONG_PTR encrypted_data_len) { CK_ULONG last = 0; CK_RV rv; rv = mock_C_EncryptUpdate (session, data, data_len, encrypted_data, encrypted_data_len); if (rv == CKR_OK) rv = mock_C_EncryptFinal (session, encrypted_data, &last); return rv; } CK_RV mock_C_Encrypt__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR encrypted_data, CK_ULONG_PTR encrypted_data_len) { return_val_if_fail (encrypted_data_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_Encrypt__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR encrypted_data, CK_ULONG_PTR encrypted_data_len) { return_val_if_fail (encrypted_data_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_EncryptUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { Session *sess; CK_ULONG i; return_val_if_fail (part != NULL, CKR_DATA_INVALID); return_val_if_fail (encrypted_part_len != NULL, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (!sess->crypto_mechanism) return CKR_OPERATION_NOT_INITIALIZED; if (sess->crypto_method != CKA_ENCRYPT) return CKR_OPERATION_NOT_INITIALIZED; assert (sess->crypto_mechanism == CKM_MOCK_CAPITALIZE); assert (sess->crypto_key == MOCK_PUBLIC_KEY_CAPITALIZE); if (!encrypted_part) { *encrypted_part_len = part_len; return CKR_OK; } if (*encrypted_part_len < part_len) { *encrypted_part_len = part_len; return CKR_BUFFER_TOO_SMALL; } for (i = 0; i < part_len; ++i) encrypted_part[i] = toupper (part[i]); *encrypted_part_len = part_len; return CKR_OK; } CK_RV mock_C_EncryptUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { return_val_if_fail (encrypted_part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_EncryptUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { return_val_if_fail (encrypted_part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_EncryptFinal (CK_SESSION_HANDLE session, CK_BYTE_PTR last_encrypted_part, CK_ULONG_PTR last_encrypted_part_len) { Session *sess; return_val_if_fail (last_encrypted_part_len != NULL, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (!sess->crypto_mechanism) return CKR_OPERATION_NOT_INITIALIZED; if (sess->crypto_method != CKA_ENCRYPT) return CKR_OPERATION_NOT_INITIALIZED; *last_encrypted_part_len = 0; sess->crypto_method = 0; sess->crypto_mechanism = 0; sess->crypto_key = 0; return CKR_OK; } CK_RV mock_C_EncryptFinal__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { return_val_if_fail (last_part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_EncryptFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { return_val_if_fail (last_part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DecryptInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { Session *sess; return_val_if_fail (mechanism != NULL, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; /* Starting an operation, cancels any previous one */ sess->finding = false; if (mechanism->mechanism != CKM_MOCK_CAPITALIZE) return CKR_MECHANISM_INVALID; if (key != MOCK_PRIVATE_KEY_CAPITALIZE) return CKR_KEY_HANDLE_INVALID; sess->crypto_method = CKA_DECRYPT; sess->crypto_mechanism = CKM_MOCK_CAPITALIZE; sess->crypto_key = key; return CKR_OK; } CK_RV mock_C_DecryptInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DecryptInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_Decrypt (CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_data, CK_ULONG encrypted_data_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len) { CK_ULONG last = 0; CK_RV rv; rv = mock_C_DecryptUpdate (session, encrypted_data, encrypted_data_len, data, data_len); if (rv == CKR_OK) rv = mock_C_DecryptFinal (session, data, &last); return rv; } CK_RV mock_C_Decrypt__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR enc_data, CK_ULONG enc_data_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len) { return_val_if_fail (data_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_Decrypt__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR enc_data, CK_ULONG enc_data_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len) { return_val_if_fail (data_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DecryptUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { Session *sess; CK_ULONG i; return_val_if_fail (encrypted_part, CKR_ENCRYPTED_DATA_INVALID); return_val_if_fail (part_len, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (!sess->crypto_mechanism) return CKR_OPERATION_NOT_INITIALIZED; if (sess->crypto_method != CKA_DECRYPT) return CKR_OPERATION_NOT_INITIALIZED; assert (sess->crypto_mechanism == CKM_MOCK_CAPITALIZE); assert (sess->crypto_key == MOCK_PRIVATE_KEY_CAPITALIZE); if (!part) { *part_len = encrypted_part_len; return CKR_OK; } if (*part_len < encrypted_part_len) { *part_len = encrypted_part_len; return CKR_BUFFER_TOO_SMALL; } for (i = 0; i < encrypted_part_len; ++i) part[i] = tolower (encrypted_part[i]); *part_len = encrypted_part_len; return CKR_OK; } CK_RV mock_C_DecryptUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return_val_if_fail (part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DecryptUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return_val_if_fail (part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DecryptFinal (CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { Session *sess; return_val_if_fail (last_part_len != NULL, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (!sess->crypto_mechanism) return CKR_OPERATION_NOT_INITIALIZED; if (sess->crypto_method != CKA_DECRYPT) return CKR_OPERATION_NOT_INITIALIZED; *last_part_len = 0; sess->crypto_method = 0; sess->crypto_mechanism = 0; sess->crypto_key = 0; return CKR_OK; } CK_RV mock_C_DecryptFinal__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { return_val_if_fail (last_part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DecryptFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { return_val_if_fail (last_part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DigestInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism) { Session *sess; return_val_if_fail (mechanism != NULL, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; /* Starting an operation, cancels any previous one */ sess->finding = false; if (mechanism->mechanism != CKM_MOCK_COUNT) return CKR_MECHANISM_INVALID; sess->hash_mechanism = CKM_MOCK_COUNT; sess->hash_method = (CK_ULONG)-1; sess->hash_count = 0; sess->hash_key = 0; return CKR_OK; } CK_RV mock_C_DigestInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DigestInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_Digest (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { CK_RV rv; return_val_if_fail (digest_len, CKR_ARGUMENTS_BAD); rv = mock_C_DigestUpdate (session, data, data_len); if (rv == CKR_OK) rv = mock_C_DigestFinal (session, digest, digest_len); return rv; } CK_RV mock_C_Digest__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { return_val_if_fail (digest_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_Digest__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { return_val_if_fail (digest_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DigestUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { Session *sess; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (!sess->hash_mechanism) return CKR_OPERATION_NOT_INITIALIZED; if (sess->hash_method != (CK_ULONG)-1) return CKR_OPERATION_NOT_INITIALIZED; assert (sess->hash_mechanism == CKM_MOCK_COUNT); sess->hash_count += part_len; return CKR_OK; } CK_RV mock_C_DigestUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DigestUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DigestKey (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key) { Session *sess; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (!sess->hash_mechanism) return CKR_OPERATION_NOT_INITIALIZED; if (sess->hash_method != (CK_ULONG)-1) return CKR_OPERATION_NOT_INITIALIZED; assert (sess->hash_mechanism == CKM_MOCK_COUNT); sess->hash_count += key; return CKR_OK; } CK_RV mock_C_DigestKey__invalid_handle (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DigestKey__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DigestFinal (CK_SESSION_HANDLE session, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { char buffer[32]; Session *sess; int len; return_val_if_fail (digest_len != NULL, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (!sess->hash_mechanism) return CKR_OPERATION_NOT_INITIALIZED; if (sess->hash_method != (CK_ULONG)-1) return CKR_OPERATION_NOT_INITIALIZED; assert (sess->hash_mechanism == CKM_MOCK_COUNT); len = snprintf (buffer, sizeof (buffer), "%lu", sess->hash_count); if (!digest) { *digest_len = len; return CKR_OK; } else if (*digest_len < len) { *digest_len = len; return CKR_BUFFER_TOO_SMALL; } memcpy (digest, &buffer, len); *digest_len = len; sess->hash_count = 0; sess->hash_mechanism = 0; sess->hash_key = 0; sess->hash_method = 0; return CKR_OK; } CK_RV mock_C_DigestFinal__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { return_val_if_fail (digest_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DigestFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { return_val_if_fail (digest_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } static CK_RV prefix_mechanism_init (CK_SESSION_HANDLE session, CK_ATTRIBUTE_TYPE method, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { Session *sess; CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *value; CK_BYTE_PTR param; CK_ULONG n_param; CK_ULONG length; CK_RV rv; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (mechanism->mechanism != CKM_MOCK_PREFIX) return CKR_MECHANISM_INVALID; if (method == CKA_SIGN || method == CKA_SIGN_RECOVER) { if (key != MOCK_PRIVATE_KEY_PREFIX) return CKR_KEY_HANDLE_INVALID; } else if (method == CKA_VERIFY || method == CKA_VERIFY_RECOVER) { if (key != MOCK_PUBLIC_KEY_PREFIX) return CKR_KEY_HANDLE_INVALID; } else { assert_not_reached (); } rv = lookup_object (sess, key, &attrs, NULL); if (rv != CKR_OK) return rv; value = p11_attrs_find_valid (attrs, CKA_VALUE); if (value == NULL) return CKR_KEY_TYPE_INCONSISTENT; if (mechanism->pParameter) { param = mechanism->pParameter; n_param = mechanism->ulParameterLen; } else { param = (CK_BYTE_PTR)SIGNED_PREFIX; n_param = strlen (SIGNED_PREFIX) + 1; } length = value->ulValueLen + n_param; if (length > sizeof (sess->sign_prefix)) return CKR_KEY_SIZE_RANGE; /* Starting an operation, cancels any finding */ sess->finding = false; sess->hash_mechanism = CKM_MOCK_PREFIX; sess->hash_method = method; sess->hash_key = key; sess->hash_count = 0; memcpy (sess->sign_prefix, param, n_param); memcpy (sess->sign_prefix + n_param, value->pValue, value->ulValueLen); sess->n_sign_prefix = length; /* The private key has CKA_ALWAYS_AUTHENTICATE above */ if (method == CKA_SIGN || method == CKA_SIGN_RECOVER) sess->want_context_login = true; return CKR_OK; } CK_RV mock_C_SignInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return_val_if_fail (mechanism != NULL, CKR_ARGUMENTS_BAD); return prefix_mechanism_init (session, CKA_SIGN, mechanism, key); } CK_RV mock_C_SignInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_SignInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_Sign (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { CK_RV rv; rv = mock_C_SignUpdate (session, data, data_len); if (rv == CKR_OK) rv = mock_C_SignFinal (session, signature, signature_len); return rv; } CK_RV mock_C_Sign__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return_val_if_fail (signature_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_Sign__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return_val_if_fail (signature_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_SignUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { Session *sess; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (sess->hash_mechanism != CKM_MOCK_PREFIX || sess->hash_method != CKA_SIGN) return CKR_OPERATION_NOT_INITIALIZED; if (sess->want_context_login) return CKR_USER_NOT_LOGGED_IN; sess->hash_count += part_len; return CKR_OK; } CK_RV mock_C_SignUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { return_val_if_fail (part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_SignUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { return_val_if_fail (part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_SignFinal (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { char buffer[32]; Session *sess; CK_ULONG length; int len; return_val_if_fail (signature_len, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (sess->hash_mechanism != CKM_MOCK_PREFIX || sess->hash_method != CKA_SIGN) return CKR_OPERATION_NOT_INITIALIZED; if (sess->want_context_login) return CKR_USER_NOT_LOGGED_IN; len = snprintf (buffer, sizeof (buffer), "%lu", sess->hash_count); length = sess->n_sign_prefix + len; if (!signature) { *signature_len = length; return CKR_OK; } if (*signature_len < length) { *signature_len = length; return CKR_BUFFER_TOO_SMALL; } memcpy (signature, sess->sign_prefix, sess->n_sign_prefix); memcpy (signature + sess->n_sign_prefix, buffer, len); *signature_len = length; sess->hash_mechanism = 0; sess->hash_method = 0; sess->hash_count = 0; sess->hash_key = 0; return CKR_OK; } CK_RV mock_C_SignFinal__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return_val_if_fail (signature_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_SignFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return_val_if_fail (signature_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_SignRecoverInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return_val_if_fail (mechanism != NULL, CKR_ARGUMENTS_BAD); return prefix_mechanism_init (session, CKA_SIGN_RECOVER, mechanism, key); } CK_RV mock_C_SignRecoverInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_SignRecoverInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_SignRecover (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { Session *sess; CK_ULONG length; return_val_if_fail (data, CKR_DATA_INVALID); return_val_if_fail (signature_len, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (sess->hash_method != CKA_SIGN_RECOVER || sess->hash_mechanism != CKM_MOCK_PREFIX) return CKR_OPERATION_NOT_INITIALIZED; if (sess->want_context_login) return CKR_USER_NOT_LOGGED_IN; length = sess->n_sign_prefix + data_len; if (!signature) { *signature_len = length; return CKR_OK; } if (*signature_len < length) { *signature_len = length; return CKR_BUFFER_TOO_SMALL; } memcpy (signature, sess->sign_prefix, sess->n_sign_prefix); memcpy (signature + sess->n_sign_prefix, data, data_len); *signature_len = length; sess->hash_method = 0; sess->hash_mechanism = 0; sess->hash_key = 0; sess->hash_count = 0; return CKR_OK; } CK_RV mock_C_SignRecover__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return_val_if_fail (signature_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_SignRecover__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return_val_if_fail (signature_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_VerifyInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return_val_if_fail (mechanism != NULL, CKR_ARGUMENTS_BAD); return prefix_mechanism_init (session, CKA_VERIFY, mechanism, key); } CK_RV mock_C_VerifyInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_VerifyInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_Verify (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG signature_len) { CK_RV rv; rv = mock_C_VerifyUpdate (session, data, data_len); if (rv == CKR_OK) rv = mock_C_VerifyFinal (session, signature, signature_len); return rv; } CK_RV mock_C_Verify__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG signature_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_Verify__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG signature_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_VerifyUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { Session *sess; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (sess->hash_mechanism != CKM_MOCK_PREFIX || sess->hash_method != CKA_VERIFY) return CKR_OPERATION_NOT_INITIALIZED; if (sess->want_context_login) return CKR_USER_NOT_LOGGED_IN; sess->hash_count += part_len; return CKR_OK; } CK_RV mock_C_VerifyUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_VerifyUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_VerifyFinal (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len) { char buffer[32]; Session *sess; CK_ULONG length; int len; return_val_if_fail (signature, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (sess->hash_mechanism != CKM_MOCK_PREFIX || sess->hash_method != CKA_VERIFY) return CKR_OPERATION_NOT_INITIALIZED; if (sess->want_context_login) return CKR_USER_NOT_LOGGED_IN; len = snprintf (buffer, sizeof (buffer), "%lu", sess->hash_count); length = sess->n_sign_prefix + len; if (!signature || signature_len != length) return CKR_SIGNATURE_LEN_RANGE; if (memcmp (signature, sess->sign_prefix, sess->n_sign_prefix) != 0 || memcmp (signature + sess->n_sign_prefix, buffer, len) != 0) return CKR_SIGNATURE_INVALID; sess->hash_mechanism = 0; sess->hash_method = 0; sess->hash_count = 0; sess->hash_key = 0; return CKR_OK; } CK_RV mock_C_VerifyFinal__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_VerifyFinal__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_VerifyRecoverInit (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return_val_if_fail (mechanism != NULL, CKR_ARGUMENTS_BAD); return prefix_mechanism_init (session, CKA_VERIFY_RECOVER, mechanism, key); } CK_RV mock_C_VerifyRecoverInit__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_VerifyRecoverInit__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_VerifyRecover (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len) { Session *sess; CK_ULONG length; return_val_if_fail (signature, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (sess->hash_mechanism != CKM_MOCK_PREFIX || sess->hash_method != CKA_VERIFY_RECOVER) return CKR_OPERATION_NOT_INITIALIZED; if (sess->want_context_login) return CKR_USER_NOT_LOGGED_IN; if (signature_len < sess->n_sign_prefix) return CKR_SIGNATURE_LEN_RANGE; if (memcmp (signature, sess->sign_prefix, sess->n_sign_prefix) != 0) return CKR_SIGNATURE_INVALID; length = signature_len - sess->n_sign_prefix; if (!data) { *data_len = length; return CKR_OK; } if (*data_len < length) { *data_len = length; return CKR_BUFFER_TOO_SMALL; } *data_len = length; memcpy (data, signature + sess->n_sign_prefix, length); return CKR_OK; } CK_RV mock_C_VerifyRecover__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len) { return_val_if_fail (data_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_VerifyRecover__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len) { return_val_if_fail (data_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DigestEncryptUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { CK_RV rv; rv = mock_C_EncryptUpdate (session, part, part_len, encrypted_part, encrypted_part_len); if (rv == CKR_OK) rv = mock_C_DigestUpdate (session, part, part_len); return rv; } CK_RV mock_C_DigestEncryptUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len) { return_val_if_fail (enc_part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DigestEncryptUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len) { return_val_if_fail (enc_part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DecryptDigestUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { CK_RV rv; rv = mock_C_DecryptUpdate (session, encrypted_part, encrypted_part_len, part, part_len); if (rv == CKR_OK) rv = mock_C_DigestUpdate (session, part, *part_len); return rv; } CK_RV mock_C_DecryptDigestUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return_val_if_fail (part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DecryptDigestUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return_val_if_fail (part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_SignEncryptUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { CK_RV rv; rv = mock_C_EncryptUpdate (session, part, part_len, encrypted_part, encrypted_part_len); if (rv == CKR_OK) rv = mock_C_SignUpdate (session, part, part_len); return rv; } CK_RV mock_C_SignEncryptUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len) { return_val_if_fail (enc_part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_SignEncryptUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len) { return_val_if_fail (enc_part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DecryptVerifyUpdate (CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { CK_RV rv; rv = mock_C_DecryptUpdate (session, encrypted_part, encrypted_part_len, part, part_len); if (rv == CKR_OK) rv = mock_C_VerifyUpdate (session, part, *part_len); return rv; } CK_RV mock_C_DecryptVerifyUpdate__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return_val_if_fail (part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DecryptVerifyUpdate__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return_val_if_fail (part_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_GenerateKey (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE value; Session *sess; CK_BBOOL token; return_val_if_fail (mechanism, CKR_MECHANISM_INVALID); return_val_if_fail (template, CKR_TEMPLATE_INCOMPLETE); return_val_if_fail (count, CKR_TEMPLATE_INCOMPLETE); return_val_if_fail (key, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (mechanism->mechanism != CKM_MOCK_GENERATE) return CKR_MECHANISM_INVALID; if (!mechanism->pParameter || mechanism->ulParameterLen != 9 || memcmp (mechanism->pParameter, "generate", 9) != 0) return CKR_MECHANISM_PARAM_INVALID; value.type = CKA_VALUE; value.pValue = "generated"; value.ulValueLen = strlen (value.pValue); attrs = p11_attrs_buildn (NULL, template, count); attrs = p11_attrs_buildn (attrs, &value, 1); *key = ++unique_identifier; if (p11_attrs_find_bool (attrs, CKA_TOKEN, &token) && token) p11_dict_set (the_objects, handle_to_pointer (*key), attrs); else p11_dict_set (sess->objects, handle_to_pointer (*key), attrs); return CKR_OK; } CK_RV mock_C_GenerateKey__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_GenerateKey__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_GenerateKeyPair (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR public_key_template, CK_ULONG public_key_count, CK_ATTRIBUTE_PTR private_key_template, CK_ULONG private_key_count, CK_OBJECT_HANDLE_PTR public_key, CK_OBJECT_HANDLE_PTR private_key) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE value; Session *sess; CK_BBOOL token; return_val_if_fail (mechanism, CKR_MECHANISM_INVALID); return_val_if_fail (public_key_template, CKR_TEMPLATE_INCOMPLETE); return_val_if_fail (public_key_count, CKR_TEMPLATE_INCOMPLETE); return_val_if_fail (private_key_template, CKR_TEMPLATE_INCOMPLETE); return_val_if_fail (private_key_count, CKR_TEMPLATE_INCOMPLETE); return_val_if_fail (public_key, CKR_ARGUMENTS_BAD); return_val_if_fail (private_key, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (mechanism->mechanism != CKM_MOCK_GENERATE) return CKR_MECHANISM_INVALID; if (!mechanism->pParameter || mechanism->ulParameterLen != 9 || memcmp (mechanism->pParameter, "generate", 9) != 0) return CKR_MECHANISM_PARAM_INVALID; value.type = CKA_VALUE; value.pValue = "generated"; value.ulValueLen = strlen (value.pValue); attrs = p11_attrs_buildn (NULL, public_key_template, public_key_count); attrs = p11_attrs_buildn (attrs, &value, 1); *public_key = ++unique_identifier; if (p11_attrs_find_bool (attrs, CKA_TOKEN, &token) && token) p11_dict_set (the_objects, handle_to_pointer (*public_key), attrs); else p11_dict_set (sess->objects, handle_to_pointer (*public_key), attrs); attrs = p11_attrs_buildn (NULL, private_key_template, private_key_count); attrs = p11_attrs_buildn (attrs, &value, 1); *private_key = ++unique_identifier; if (p11_attrs_find_bool (attrs, CKA_TOKEN, &token) && token) p11_dict_set (the_objects, handle_to_pointer (*private_key), attrs); else p11_dict_set (sess->objects, handle_to_pointer (*private_key), attrs); return CKR_OK; } CK_RV mock_C_GenerateKeyPair__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR pub_template, CK_ULONG pub_count, CK_ATTRIBUTE_PTR priv_template, CK_ULONG priv_count, CK_OBJECT_HANDLE_PTR pub_key, CK_OBJECT_HANDLE_PTR priv_key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_GenerateKeyPair__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR pub_template, CK_ULONG pub_count, CK_ATTRIBUTE_PTR priv_template, CK_ULONG priv_count, CK_OBJECT_HANDLE_PTR pub_key, CK_OBJECT_HANDLE_PTR priv_key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_WrapKey (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key, CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE *attr; Session *sess; CK_RV rv; return_val_if_fail (mechanism, CKR_MECHANISM_INVALID); return_val_if_fail (wrapping_key, CKR_OBJECT_HANDLE_INVALID); return_val_if_fail (key, CKR_OBJECT_HANDLE_INVALID); return_val_if_fail (wrapped_key_len, CKR_WRAPPED_KEY_LEN_RANGE); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; rv = lookup_object (sess, wrapping_key, &attrs, NULL); if (rv == CKR_OBJECT_HANDLE_INVALID) return CKR_WRAPPING_KEY_HANDLE_INVALID; else if (rv != CKR_OK) return rv; rv = lookup_object (sess, key, &attrs, NULL); if (rv == CKR_OBJECT_HANDLE_INVALID) return CKR_WRAPPING_KEY_HANDLE_INVALID; else if (rv != CKR_OK) return rv; if (mechanism->mechanism != CKM_MOCK_WRAP) return CKR_MECHANISM_INVALID; if (mechanism->pParameter == NULL || mechanism->ulParameterLen != 4 || memcmp (mechanism->pParameter, "wrap", 4) != 0) { return CKR_MECHANISM_PARAM_INVALID; } attr = p11_attrs_find_valid (attrs, CKA_VALUE); if (attr == NULL) return CKR_WRAPPED_KEY_INVALID; if (!wrapped_key) { *wrapped_key_len = attr->ulValueLen; return CKR_OK; } if (*wrapped_key_len < attr->ulValueLen) { *wrapped_key_len = attr->ulValueLen; return CKR_BUFFER_TOO_SMALL; } memcpy (wrapped_key, attr->pValue, attr->ulValueLen); *wrapped_key_len = attr->ulValueLen; return CKR_OK; } CK_RV mock_C_WrapKey__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key, CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len) { return_val_if_fail (wrapped_key_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_WrapKey__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key, CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len) { return_val_if_fail (wrapped_key_len, CKR_ARGUMENTS_BAD); return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_UnwrapKey (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key, CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { CK_ATTRIBUTE *attrs; CK_ATTRIBUTE value; Session *sess; CK_BBOOL token; CK_RV rv; return_val_if_fail (mechanism, CKR_MECHANISM_INVALID); return_val_if_fail (unwrapping_key, CKR_WRAPPING_KEY_HANDLE_INVALID); return_val_if_fail (wrapped_key, CKR_WRAPPED_KEY_INVALID); return_val_if_fail (wrapped_key_len, CKR_WRAPPED_KEY_LEN_RANGE); return_val_if_fail (key, CKR_ARGUMENTS_BAD); return_val_if_fail (template, CKR_TEMPLATE_INCOMPLETE); return_val_if_fail (count, CKR_TEMPLATE_INCONSISTENT); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; rv = lookup_object (sess, unwrapping_key, &attrs, NULL); if (rv == CKR_OBJECT_HANDLE_INVALID) return CKR_WRAPPING_KEY_HANDLE_INVALID; else if (rv != CKR_OK) return rv; if (mechanism->mechanism != CKM_MOCK_WRAP) return CKR_MECHANISM_INVALID; if (mechanism->pParameter == NULL || mechanism->ulParameterLen != 4 || memcmp (mechanism->pParameter, "wrap", 4) != 0) { return CKR_MECHANISM_PARAM_INVALID; } value.type = CKA_VALUE; value.pValue = wrapped_key; value.ulValueLen = wrapped_key_len; attrs = p11_attrs_buildn (NULL, template, count); attrs = p11_attrs_buildn (attrs, &value, 1); *key = ++unique_identifier; if (p11_attrs_find_bool (attrs, CKA_TOKEN, &token) && token) p11_dict_set (the_objects, handle_to_pointer (*key), attrs); else p11_dict_set (sess->objects, handle_to_pointer (*key), attrs); return CKR_OK; } CK_RV mock_C_UnwrapKey__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key, CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_UnwrapKey__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key, CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_DeriveKey (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { CK_ATTRIBUTE *attrs, *copy; CK_ATTRIBUTE value; Session *sess; CK_BBOOL token; CK_RV rv; return_val_if_fail (mechanism, CKR_MECHANISM_INVALID); return_val_if_fail (count, CKR_TEMPLATE_INCOMPLETE); return_val_if_fail (template, CKR_TEMPLATE_INCOMPLETE); return_val_if_fail (key, CKR_ARGUMENTS_BAD); sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; rv = lookup_object (sess, base_key, &attrs, NULL); if (rv == CKR_OBJECT_HANDLE_INVALID) return CKR_KEY_HANDLE_INVALID; else if (rv != CKR_OK) return rv; if (mechanism->mechanism != CKM_MOCK_DERIVE) return CKR_MECHANISM_INVALID; if (mechanism->pParameter == NULL || mechanism->ulParameterLen != 6 || memcmp (mechanism->pParameter, "derive", 6) != 0) { return CKR_MECHANISM_PARAM_INVALID; } value.type = CKA_VALUE; value.pValue = "derived"; value.ulValueLen = strlen (value.pValue); copy = p11_attrs_buildn (NULL, template, count); copy = p11_attrs_buildn (copy, &value, 1); *key = ++unique_identifier; if (p11_attrs_find_bool (copy, CKA_TOKEN, &token) && token) p11_dict_set (the_objects, handle_to_pointer (*key), copy); else p11_dict_set (sess->objects, handle_to_pointer (*key), copy); return CKR_OK; } CK_RV mock_C_DeriveKey__invalid_handle (CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_DeriveKey__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_SeedRandom (CK_SESSION_HANDLE session, CK_BYTE_PTR seed, CK_ULONG seed_len) { Session *sess; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; if (seed_len > sizeof (sess->random_seed)) return CKR_RANDOM_SEED_NOT_SUPPORTED; memcpy (sess->random_seed, seed, seed_len); sess->random_seed_len = seed_len; return CKR_OK; } CK_RV mock_C_SeedRandom__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR seed, CK_ULONG seed_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_SeedRandom__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR seed, CK_ULONG seed_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_C_GenerateRandom (CK_SESSION_HANDLE session, CK_BYTE_PTR random_data, CK_ULONG random_len) { Session *sess; CK_ULONG block; sess = p11_dict_get (the_sessions, handle_to_pointer (session)); if (!sess) return CKR_SESSION_HANDLE_INVALID; while (random_len > 0) { block = sess->random_seed_len; if (block > random_len) block = random_len; memcpy (random_data, sess->random_seed, block); random_data += block; random_len -= block; } return CKR_OK; } CK_RV mock_C_GenerateRandom__invalid_handle (CK_SESSION_HANDLE session, CK_BYTE_PTR random_data, CK_ULONG random_len) { return CKR_SESSION_HANDLE_INVALID; } CK_RV mock_X_GenerateRandom__invalid_handle (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR random_data, CK_ULONG random_len) { return CKR_SESSION_HANDLE_INVALID; } CK_FUNCTION_LIST mock_module_no_slots = { { CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, /* version */ mock_C_Initialize, mock_C_Finalize, mock_C_GetInfo, mock_C_GetFunctionList_not_supported, mock_C_GetSlotList__no_tokens, mock_C_GetSlotInfo__invalid_slotid, mock_C_GetTokenInfo__invalid_slotid, mock_C_GetMechanismList__invalid_slotid, mock_C_GetMechanismInfo__invalid_slotid, mock_C_InitToken__invalid_slotid, mock_C_InitPIN__invalid_handle, mock_C_SetPIN__invalid_handle, mock_C_OpenSession__invalid_slotid, mock_C_CloseSession__invalid_handle, mock_C_CloseAllSessions__invalid_slotid, mock_C_GetSessionInfo__invalid_handle, mock_C_GetOperationState__invalid_handle, mock_C_SetOperationState__invalid_handle, mock_C_Login__invalid_handle, mock_C_Logout__invalid_handle, mock_C_CreateObject__invalid_handle, mock_C_CopyObject__invalid_handle, mock_C_DestroyObject__invalid_handle, mock_C_GetObjectSize__invalid_handle, mock_C_GetAttributeValue__invalid_handle, mock_C_SetAttributeValue__invalid_handle, mock_C_FindObjectsInit__invalid_handle, mock_C_FindObjects__invalid_handle, mock_C_FindObjectsFinal__invalid_handle, mock_C_EncryptInit__invalid_handle, mock_C_Encrypt__invalid_handle, mock_C_EncryptUpdate__invalid_handle, mock_C_EncryptFinal__invalid_handle, mock_C_DecryptInit__invalid_handle, mock_C_Decrypt__invalid_handle, mock_C_DecryptUpdate__invalid_handle, mock_C_DecryptFinal__invalid_handle, mock_C_DigestInit__invalid_handle, mock_C_Digest__invalid_handle, mock_C_DigestUpdate__invalid_handle, mock_C_DigestKey__invalid_handle, mock_C_DigestFinal__invalid_handle, mock_C_SignInit__invalid_handle, mock_C_Sign__invalid_handle, mock_C_SignUpdate__invalid_handle, mock_C_SignFinal__invalid_handle, mock_C_SignRecoverInit__invalid_handle, mock_C_SignRecover__invalid_handle, mock_C_VerifyInit__invalid_handle, mock_C_Verify__invalid_handle, mock_C_VerifyUpdate__invalid_handle, mock_C_VerifyFinal__invalid_handle, mock_C_VerifyRecoverInit__invalid_handle, mock_C_VerifyRecover__invalid_handle, mock_C_DigestEncryptUpdate__invalid_handle, mock_C_DecryptDigestUpdate__invalid_handle, mock_C_SignEncryptUpdate__invalid_handle, mock_C_DecryptVerifyUpdate__invalid_handle, mock_C_GenerateKey__invalid_handle, mock_C_GenerateKeyPair__invalid_handle, mock_C_WrapKey__invalid_handle, mock_C_UnwrapKey__invalid_handle, mock_C_DeriveKey__invalid_handle, mock_C_SeedRandom__invalid_handle, mock_C_GenerateRandom__invalid_handle, mock_C_GetFunctionStatus__not_parallel, mock_C_CancelFunction__not_parallel, mock_C_WaitForSlotEvent__no_event, }; CK_X_FUNCTION_LIST mock_x_module_no_slots = { { CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, /* version */ mock_X_Initialize, mock_X_Finalize, mock_X_GetInfo, mock_X_GetSlotList__no_tokens, mock_X_GetSlotInfo__invalid_slotid, mock_X_GetTokenInfo__invalid_slotid, mock_X_GetMechanismList__invalid_slotid, mock_X_GetMechanismInfo__invalid_slotid, mock_X_InitToken__invalid_slotid, mock_X_InitPIN__invalid_handle, mock_X_SetPIN__invalid_handle, mock_X_OpenSession__invalid_slotid, mock_X_CloseSession__invalid_handle, mock_X_CloseAllSessions__invalid_slotid, mock_X_GetSessionInfo__invalid_handle, mock_X_GetOperationState__invalid_handle, mock_X_SetOperationState__invalid_handle, mock_X_Login__invalid_handle, mock_X_Logout__invalid_handle, mock_X_CreateObject__invalid_handle, mock_X_CopyObject__invalid_handle, mock_X_DestroyObject__invalid_handle, mock_X_GetObjectSize__invalid_handle, mock_X_GetAttributeValue__invalid_handle, mock_X_SetAttributeValue__invalid_handle, mock_X_FindObjectsInit__invalid_handle, mock_X_FindObjects__invalid_handle, mock_X_FindObjectsFinal__invalid_handle, mock_X_EncryptInit__invalid_handle, mock_X_Encrypt__invalid_handle, mock_X_EncryptUpdate__invalid_handle, mock_X_EncryptFinal__invalid_handle, mock_X_DecryptInit__invalid_handle, mock_X_Decrypt__invalid_handle, mock_X_DecryptUpdate__invalid_handle, mock_X_DecryptFinal__invalid_handle, mock_X_DigestInit__invalid_handle, mock_X_Digest__invalid_handle, mock_X_DigestUpdate__invalid_handle, mock_X_DigestKey__invalid_handle, mock_X_DigestFinal__invalid_handle, mock_X_SignInit__invalid_handle, mock_X_Sign__invalid_handle, mock_X_SignUpdate__invalid_handle, mock_X_SignFinal__invalid_handle, mock_X_SignRecoverInit__invalid_handle, mock_X_SignRecover__invalid_handle, mock_X_VerifyInit__invalid_handle, mock_X_Verify__invalid_handle, mock_X_VerifyUpdate__invalid_handle, mock_X_VerifyFinal__invalid_handle, mock_X_VerifyRecoverInit__invalid_handle, mock_X_VerifyRecover__invalid_handle, mock_X_DigestEncryptUpdate__invalid_handle, mock_X_DecryptDigestUpdate__invalid_handle, mock_X_SignEncryptUpdate__invalid_handle, mock_X_DecryptVerifyUpdate__invalid_handle, mock_X_GenerateKey__invalid_handle, mock_X_GenerateKeyPair__invalid_handle, mock_X_WrapKey__invalid_handle, mock_X_UnwrapKey__invalid_handle, mock_X_DeriveKey__invalid_handle, mock_X_SeedRandom__invalid_handle, mock_X_GenerateRandom__invalid_handle, mock_X_WaitForSlotEvent__no_event, }; CK_FUNCTION_LIST mock_module = { { CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, /* version */ mock_C_Initialize, mock_C_Finalize, mock_C_GetInfo, mock_C_GetFunctionList_not_supported, mock_C_GetSlotList, mock_C_GetSlotInfo, mock_C_GetTokenInfo, mock_C_GetMechanismList, mock_C_GetMechanismInfo, mock_C_InitToken__specific_args, mock_C_InitPIN__specific_args, mock_C_SetPIN__specific_args, mock_C_OpenSession, mock_C_CloseSession, mock_C_CloseAllSessions, mock_C_GetSessionInfo, mock_C_GetOperationState, mock_C_SetOperationState, mock_C_Login, mock_C_Logout, mock_C_CreateObject, mock_C_CopyObject, mock_C_DestroyObject, mock_C_GetObjectSize, mock_C_GetAttributeValue, mock_C_SetAttributeValue, mock_C_FindObjectsInit, mock_C_FindObjects, mock_C_FindObjectsFinal, mock_C_EncryptInit, mock_C_Encrypt, mock_C_EncryptUpdate, mock_C_EncryptFinal, mock_C_DecryptInit, mock_C_Decrypt, mock_C_DecryptUpdate, mock_C_DecryptFinal, mock_C_DigestInit, mock_C_Digest, mock_C_DigestUpdate, mock_C_DigestKey, mock_C_DigestFinal, mock_C_SignInit, mock_C_Sign, mock_C_SignUpdate, mock_C_SignFinal, mock_C_SignRecoverInit, mock_C_SignRecover, mock_C_VerifyInit, mock_C_Verify, mock_C_VerifyUpdate, mock_C_VerifyFinal, mock_C_VerifyRecoverInit, mock_C_VerifyRecover, mock_C_DigestEncryptUpdate, mock_C_DecryptDigestUpdate, mock_C_SignEncryptUpdate, mock_C_DecryptVerifyUpdate, mock_C_GenerateKey, mock_C_GenerateKeyPair, mock_C_WrapKey, mock_C_UnwrapKey, mock_C_DeriveKey, mock_C_SeedRandom, mock_C_GenerateRandom, mock_C_GetFunctionStatus, mock_C_CancelFunction, mock_C_WaitForSlotEvent, }; void mock_module_init (void) { static bool initialized = false; if (!initialized) { p11_mutex_init (&init_mutex); initialized = true; } } p11-kit-0.20.2/common/hash.h0000664000175000017500000000360712226763526012311 00000000000000/* * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_HASH_H_ #define P11_HASH_H_ #include "compat.h" #define P11_HASH_MURMUR3_LEN 4 void p11_hash_murmur3 (void *hash, const void *input, size_t length, ...) GNUC_NULL_TERMINATED; #endif /* P11_HASH_H_ */ p11-kit-0.20.2/common/Makefile.in0000664000175000017500000007063112265245664013264 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/build/Makefile.decl $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/build/aux/depcomp \ $(inc_HEADERS) subdir = common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/gettext.m4 \ $(top_srcdir)/build/m4/iconv.m4 \ $(top_srcdir)/build/m4/lib-ld.m4 \ $(top_srcdir)/build/m4/lib-link.m4 \ $(top_srcdir)/build/m4/lib-prefix.m4 \ $(top_srcdir)/build/m4/libtool.m4 \ $(top_srcdir)/build/m4/ltoptions.m4 \ $(top_srcdir)/build/m4/ltsugar.m4 \ $(top_srcdir)/build/m4/ltversion.m4 \ $(top_srcdir)/build/m4/lt~obsolete.m4 \ $(top_srcdir)/build/m4/nls.m4 $(top_srcdir)/build/m4/po.m4 \ $(top_srcdir)/build/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libp11_common_la_LIBADD = am__objects_1 = am_libp11_common_la_OBJECTS = argv.lo attrs.lo array.lo buffer.lo \ compat.lo constants.lo debug.lo dict.lo hash.lo lexer.lo \ message.lo path.lo url.lo $(am__objects_1) libp11_common_la_OBJECTS = $(am_libp11_common_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libp11_library_la_LIBADD = am_libp11_library_la_OBJECTS = library.lo $(am__objects_1) libp11_library_la_OBJECTS = $(am_libp11_library_la_OBJECTS) libp11_test_la_LIBADD = am_libp11_test_la_OBJECTS = mock.lo test.lo $(am__objects_1) libp11_test_la_OBJECTS = $(am_libp11_test_la_OBJECTS) libp11_tool_la_LIBADD = am_libp11_tool_la_OBJECTS = tool.lo $(am__objects_1) libp11_tool_la_OBJECTS = $(am_libp11_tool_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libp11_common_la_SOURCES) $(libp11_library_la_SOURCES) \ $(libp11_test_la_SOURCES) $(libp11_tool_la_SOURCES) DIST_SOURCES = $(libp11_common_la_SOURCES) \ $(libp11_library_la_SOURCES) $(libp11_test_la_SOURCES) \ $(libp11_tool_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(incdir)" HEADERS = $(inc_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTKDOC_SCAN = @GTKDOC_SCAN@ HASH_LIBS = @HASH_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_CFLAGS = @LIBFFI_CFLAGS@ LIBFFI_LIBS = @LIBFFI_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTASN1_CFLAGS = @LIBTASN1_CFLAGS@ LIBTASN1_LIBS = @LIBTASN1_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P11KIT_LT_RELEASE = @P11KIT_LT_RELEASE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLEXT = @SHLEXT@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ p11_module_path = @p11_module_path@ p11_package_config_modules = @p11_package_config_modules@ p11_system_config = @p11_system_config@ p11_system_config_file = @p11_system_config_file@ p11_system_config_modules = @p11_system_config_modules@ p11_user_config = @p11_user_config@ p11_user_config_file = @p11_user_config_file@ p11_user_config_modules = @p11_user_config_modules@ pdfdir = @pdfdir@ prefix = @prefix@ privatedir = @privatedir@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_trust_paths = @with_trust_paths@ NULL = SUBDIRS = . tests incdir = $(includedir)/p11-kit-1/p11-kit inc_HEADERS = \ pkcs11.h \ $(NULL) noinst_LTLIBRARIES = \ libp11-common.la \ libp11-library.la \ libp11-test.la \ libp11-tool.la \ $(NULL) libp11_common_la_SOURCES = \ argv.c argv.h \ attrs.c attrs.h \ array.c array.h \ buffer.c buffer.h \ compat.c compat.h \ constants.c constants.h \ debug.c debug.h \ dict.c dict.h \ hash.c hash.h \ lexer.c lexer.h \ message.c message.h \ path.c path.h \ pkcs11.h pkcs11x.h \ url.c url.h \ $(NULL) libp11_library_la_SOURCES = \ library.c library.h \ $(NULL) libp11_test_la_SOURCES = \ mock.c mock.h \ test.c test.h \ $(NULL) libp11_tool_la_SOURCES = \ tool.c tool.h \ $(NULL) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/build/Makefile.decl $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign common/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/build/Makefile.decl: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libp11-common.la: $(libp11_common_la_OBJECTS) $(libp11_common_la_DEPENDENCIES) $(EXTRA_libp11_common_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libp11_common_la_OBJECTS) $(libp11_common_la_LIBADD) $(LIBS) libp11-library.la: $(libp11_library_la_OBJECTS) $(libp11_library_la_DEPENDENCIES) $(EXTRA_libp11_library_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libp11_library_la_OBJECTS) $(libp11_library_la_LIBADD) $(LIBS) libp11-test.la: $(libp11_test_la_OBJECTS) $(libp11_test_la_DEPENDENCIES) $(EXTRA_libp11_test_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libp11_test_la_OBJECTS) $(libp11_test_la_LIBADD) $(LIBS) libp11-tool.la: $(libp11_tool_la_OBJECTS) $(libp11_tool_la_DEPENDENCIES) $(EXTRA_libp11_tool_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libp11_tool_la_OBJECTS) $(libp11_tool_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attrs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constants.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dict.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lexer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/library.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/url.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-incHEADERS: $(inc_HEADERS) @$(NORMAL_INSTALL) @list='$(inc_HEADERS)'; test -n "$(incdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(incdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(incdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(incdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(incdir)" || exit $$?; \ done uninstall-incHEADERS: @$(NORMAL_UNINSTALL) @list='$(inc_HEADERS)'; test -n "$(incdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(incdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(incdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-incHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-incHEADERS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-incHEADERS install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-incHEADERS memcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir memcheck; \ done leakcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir leakcheck; \ done hellcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir hellcheck; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: p11-kit-0.20.2/common/constants.c0000664000175000017500000006111112226763526013367 00000000000000/* * Copyright (C) 2013, Redhat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "attrs.h" #include "constants.h" #include "debug.h" #include "pkcs11.h" #include "pkcs11x.h" #include #define ELEMS(x) (sizeof (x) / sizeof (x[0])) /* * These are in numeric order of their type for easy lookup * After changing something make sure to run the test-attrs * test to verify everything is in order. */ #define CT(x, n) { x, #x, n }, const p11_constant p11_constant_types[] = { CT (CKA_CLASS, "class") CT (CKA_TOKEN, "token") CT (CKA_PRIVATE, "private") CT (CKA_LABEL, "label") CT (CKA_APPLICATION, "application") CT (CKA_VALUE, "value") CT (CKA_OBJECT_ID, "object-id") CT (CKA_CERTIFICATE_TYPE, "certificate-type") CT (CKA_ISSUER, "issuer") CT (CKA_SERIAL_NUMBER, "serial-number") CT (CKA_AC_ISSUER, "ac-issuer") CT (CKA_OWNER, "owner") CT (CKA_ATTR_TYPES, "attr-types") CT (CKA_TRUSTED, "trusted") CT (CKA_CERTIFICATE_CATEGORY, "certificate-category") CT (CKA_JAVA_MIDP_SECURITY_DOMAIN, "java-midp-security-domain") CT (CKA_URL, "url") CT (CKA_HASH_OF_SUBJECT_PUBLIC_KEY, "hash-of-subject-public-key") CT (CKA_HASH_OF_ISSUER_PUBLIC_KEY, "hash-of-issuer-public-key") CT (CKA_CHECK_VALUE, "check-value") CT (CKA_KEY_TYPE, "key-type") CT (CKA_SUBJECT, "subject") CT (CKA_ID, "id") CT (CKA_SENSITIVE, "sensitive") CT (CKA_ENCRYPT, "encrypt") CT (CKA_DECRYPT, "decrypt") CT (CKA_WRAP, "wrap") CT (CKA_UNWRAP, "unwrap") CT (CKA_SIGN, "sign") CT (CKA_SIGN_RECOVER, "sign-recover") CT (CKA_VERIFY, "verify") CT (CKA_VERIFY_RECOVER, "recover") CT (CKA_DERIVE, "derive") CT (CKA_START_DATE, "start-date") CT (CKA_END_DATE, "end-date") CT (CKA_MODULUS, "modulus") CT (CKA_MODULUS_BITS, "modulus-bits") CT (CKA_PUBLIC_EXPONENT, "public-exponent") CT (CKA_PRIVATE_EXPONENT, "private-exponent") CT (CKA_PRIME_1, "prime-1") CT (CKA_PRIME_2, "prime-2") CT (CKA_EXPONENT_1, "exponent-1") CT (CKA_EXPONENT_2, "exponent-2") CT (CKA_COEFFICIENT, "coefficient") CT (CKA_PRIME, "prime") CT (CKA_SUBPRIME, "subprime") CT (CKA_BASE, "base") CT (CKA_PRIME_BITS, "prime-bits") /* CT (CKA_SUBPRIME_BITS) */ CT (CKA_SUB_PRIME_BITS, "subprime-bits") CT (CKA_VALUE_BITS, "value-bits") CT (CKA_VALUE_LEN, "value-len") CT (CKA_EXTRACTABLE, "extractable") CT (CKA_LOCAL, "local") CT (CKA_NEVER_EXTRACTABLE, "never-extractable") CT (CKA_ALWAYS_SENSITIVE, "always-sensitive") CT (CKA_KEY_GEN_MECHANISM, "key-gen-mechanism") CT (CKA_MODIFIABLE, "modifiable") CT (CKA_ECDSA_PARAMS, "ecdsa-params") /* CT (CKA_EC_PARAMS) */ CT (CKA_EC_POINT, "ec-point") CT (CKA_SECONDARY_AUTH, "secondary-auth") CT (CKA_AUTH_PIN_FLAGS, "auth-pin-flags") CT (CKA_ALWAYS_AUTHENTICATE, "always-authenticate") CT (CKA_WRAP_WITH_TRUSTED, "wrap-with-trusted") CT (CKA_HW_FEATURE_TYPE, "hw-feature-type") CT (CKA_RESET_ON_INIT, "reset-on-init") CT (CKA_HAS_RESET, "has-reset") CT (CKA_PIXEL_X, "pixel-x") CT (CKA_PIXEL_Y, "pixel-y") CT (CKA_RESOLUTION, "resolution") CT (CKA_CHAR_ROWS, "char-rows") CT (CKA_CHAR_COLUMNS, "char-columns") CT (CKA_COLOR, "color") CT (CKA_BITS_PER_PIXEL, "bits-per-pixel") CT (CKA_CHAR_SETS, "char-sets") CT (CKA_ENCODING_METHODS, "encoding-methods") CT (CKA_MIME_TYPES, "mime-types") CT (CKA_MECHANISM_TYPE, "mechanism-type") CT (CKA_REQUIRED_CMS_ATTRIBUTES, "required-cms-attributes") CT (CKA_DEFAULT_CMS_ATTRIBUTES, "default-cms-attributes") CT (CKA_SUPPORTED_CMS_ATTRIBUTES, "supported-cms-attributes") CT (CKA_WRAP_TEMPLATE, "wrap-template") CT (CKA_UNWRAP_TEMPLATE, "unwrap-template") CT (CKA_ALLOWED_MECHANISMS, "allowed-mechanisms") CT (CKA_NSS_URL, "nss-url") CT (CKA_NSS_EMAIL, "nss-email") CT (CKA_NSS_SMIME_INFO, "nss-smime-constant") CT (CKA_NSS_SMIME_TIMESTAMP, "nss-smime-timestamp") CT (CKA_NSS_PKCS8_SALT, "nss-pkcs8-salt") CT (CKA_NSS_PASSWORD_CHECK, "nss-password-check") CT (CKA_NSS_EXPIRES, "nss-expires") CT (CKA_NSS_KRL, "nss-krl") CT (CKA_NSS_PQG_COUNTER, "nss-pqg-counter") CT (CKA_NSS_PQG_SEED, "nss-pqg-seed") CT (CKA_NSS_PQG_H, "nss-pqg-h") CT (CKA_NSS_PQG_SEED_BITS, "nss-pqg-seed-bits") CT (CKA_NSS_MODULE_SPEC, "nss-module-spec") CT (CKA_TRUST_DIGITAL_SIGNATURE, "trust-digital-signature") CT (CKA_TRUST_NON_REPUDIATION, "trust-non-repudiation") CT (CKA_TRUST_KEY_ENCIPHERMENT, "trust-key-encipherment") CT (CKA_TRUST_DATA_ENCIPHERMENT, "trust-data-encipherment") CT (CKA_TRUST_KEY_AGREEMENT, "trust-key-agreement") CT (CKA_TRUST_KEY_CERT_SIGN, "trust-key-cert-sign") CT (CKA_TRUST_CRL_SIGN, "trust-crl-sign") CT (CKA_TRUST_SERVER_AUTH, "trust-server-auth") CT (CKA_TRUST_CLIENT_AUTH, "trust-client-auth") CT (CKA_TRUST_CODE_SIGNING, "trust-code-signing") CT (CKA_TRUST_EMAIL_PROTECTION, "trust-email-protection") CT (CKA_TRUST_IPSEC_END_SYSTEM, "trust-ipsec-end-system") CT (CKA_TRUST_IPSEC_TUNNEL, "trust-ipsec-tunnel") CT (CKA_TRUST_IPSEC_USER, "trust-ipsec-user") CT (CKA_TRUST_TIME_STAMPING, "trust-time-stamping") CT (CKA_TRUST_STEP_UP_APPROVED, "trust-step-up-approved") CT (CKA_CERT_SHA1_HASH, "cert-sha1-hash") CT (CKA_CERT_MD5_HASH, "cert-md5-hash") CT (CKA_X_ASSERTION_TYPE, "x-assertion-type") CT (CKA_X_CERTIFICATE_VALUE, "x-cetrificate-value") CT (CKA_X_PURPOSE, "x-purpose") CT (CKA_X_PEER, "x-peer") CT (CKA_X_DISTRUSTED, "x-distrusted") CT (CKA_X_CRITICAL, "x-critical") CT (CKA_X_PUBLIC_KEY_INFO, "x-public-key-info") { CKA_INVALID }, }; const p11_constant p11_constant_classes[] = { CT (CKO_DATA, "data") CT (CKO_CERTIFICATE, "certificate") CT (CKO_PUBLIC_KEY, "public-key") CT (CKO_PRIVATE_KEY, "private-key") CT (CKO_SECRET_KEY, "secret-key") CT (CKO_HW_FEATURE, "hw-feature") CT (CKO_DOMAIN_PARAMETERS, "domain-parameters") CT (CKO_MECHANISM, "mechanism") CT (CKO_NSS_CRL, "nss-crl") CT (CKO_NSS_SMIME, "nss-smime") CT (CKO_NSS_TRUST, "nss-trust") CT (CKO_NSS_BUILTIN_ROOT_LIST, "nss-builtin-root-list") CT (CKO_NSS_NEWSLOT, "nss-newslot") CT (CKO_NSS_DELSLOT, "nss-delslot") CT (CKO_X_TRUST_ASSERTION, "x-trust-assertion") CT (CKO_X_CERTIFICATE_EXTENSION, "x-certificate-extension") { CKA_INVALID }, }; const p11_constant p11_constant_trusts[] = { CT (CKT_NSS_TRUSTED, "nss-trusted") CT (CKT_NSS_TRUSTED_DELEGATOR, "nss-trusted-delegator") CT (CKT_NSS_MUST_VERIFY_TRUST, "nss-must-verify-trust") CT (CKT_NSS_TRUST_UNKNOWN, "nss-trust-unknown") CT (CKT_NSS_NOT_TRUSTED, "nss-not-trusted") CT (CKT_NSS_VALID_DELEGATOR, "nss-valid-delegator") { CKA_INVALID }, }; const p11_constant p11_constant_certs[] = { CT (CKC_X_509, "x-509") CT (CKC_X_509_ATTR_CERT, "x-509-attr-cert") CT (CKC_WTLS, "wtls") { CKA_INVALID }, }; const p11_constant p11_constant_keys[] = { CT (CKK_RSA, "rsa") CT (CKK_DSA, "dsa") CT (CKK_DH, "dh") /* CT (CKK_ECDSA) */ CT (CKK_EC, "ec") CT (CKK_X9_42_DH, "x9-42-dh") CT (CKK_KEA, "kea") CT (CKK_GENERIC_SECRET, "generic-secret") CT (CKK_RC2, "rc2") CT (CKK_RC4, "rc4") CT (CKK_DES, "des") CT (CKK_DES2, "des2") CT (CKK_DES3, "des3") CT (CKK_CAST, "cast") CT (CKK_CAST3, "cast3") CT (CKK_CAST128, "cast128") CT (CKK_RC5, "rc5") CT (CKK_IDEA, "idea") CT (CKK_SKIPJACK, "skipjack") CT (CKK_BATON, "baton") CT (CKK_JUNIPER, "juniper") CT (CKK_CDMF, "cdmf") CT (CKK_AES, "aes") CT (CKK_BLOWFISH, "blowfish") CT (CKK_TWOFISH, "twofish") CT (CKK_NSS_PKCS8, "nss-pkcs8") { CKA_INVALID }, }; const p11_constant p11_constant_asserts[] = { CT (CKT_X_DISTRUSTED_CERTIFICATE, "x-distrusted-certificate") CT (CKT_X_PINNED_CERTIFICATE, "x-pinned-certificate") CT (CKT_X_ANCHORED_CERTIFICATE, "x-anchored-certificate") { CKA_INVALID }, }; const p11_constant p11_constant_categories[] = { { 0, "unspecified", "unspecified" }, { 1, "token-user", "token-user" }, { 2, "authority", "authority" }, { 3, "other-entry", "other-entry" }, { CKA_INVALID }, }; const p11_constant p11_constant_users[] = { CT (CKU_SO, NULL) CT (CKU_USER, NULL) CT (CKU_CONTEXT_SPECIFIC, NULL) { CKA_INVALID }, }; const p11_constant p11_constant_states[] = { CT (CKS_RO_PUBLIC_SESSION, NULL) CT (CKS_RO_USER_FUNCTIONS, NULL) CT (CKS_RW_PUBLIC_SESSION, NULL) CT (CKS_RW_USER_FUNCTIONS, NULL) CT (CKS_RW_SO_FUNCTIONS, NULL) { CKA_INVALID }, }; const p11_constant p11_constant_returns[] = { CT (CKR_OK, NULL) CT (CKR_CANCEL, NULL) CT (CKR_HOST_MEMORY, NULL) CT (CKR_SLOT_ID_INVALID, NULL) CT (CKR_GENERAL_ERROR, NULL) CT (CKR_FUNCTION_FAILED, NULL) CT (CKR_ARGUMENTS_BAD, NULL) CT (CKR_NO_EVENT, NULL) CT (CKR_NEED_TO_CREATE_THREADS, NULL) CT (CKR_CANT_LOCK, NULL) CT (CKR_ATTRIBUTE_READ_ONLY, NULL) CT (CKR_ATTRIBUTE_SENSITIVE, NULL) CT (CKR_ATTRIBUTE_TYPE_INVALID, NULL) CT (CKR_ATTRIBUTE_VALUE_INVALID, NULL) CT (CKR_DATA_INVALID, NULL) CT (CKR_DATA_LEN_RANGE, NULL) CT (CKR_DEVICE_ERROR, NULL) CT (CKR_DEVICE_MEMORY, NULL) CT (CKR_DEVICE_REMOVED, NULL) CT (CKR_ENCRYPTED_DATA_INVALID, NULL) CT (CKR_ENCRYPTED_DATA_LEN_RANGE, NULL) CT (CKR_FUNCTION_CANCELED, NULL) CT (CKR_FUNCTION_NOT_PARALLEL, NULL) CT (CKR_FUNCTION_NOT_SUPPORTED, NULL) CT (CKR_KEY_HANDLE_INVALID, NULL) CT (CKR_KEY_SIZE_RANGE, NULL) CT (CKR_KEY_TYPE_INCONSISTENT, NULL) CT (CKR_KEY_NOT_NEEDED, NULL) CT (CKR_KEY_CHANGED, NULL) CT (CKR_KEY_NEEDED, NULL) CT (CKR_KEY_INDIGESTIBLE, NULL) CT (CKR_KEY_FUNCTION_NOT_PERMITTED, NULL) CT (CKR_KEY_NOT_WRAPPABLE, NULL) CT (CKR_KEY_UNEXTRACTABLE, NULL) CT (CKR_MECHANISM_INVALID, NULL) CT (CKR_MECHANISM_PARAM_INVALID, NULL) CT (CKR_OBJECT_HANDLE_INVALID, NULL) CT (CKR_OPERATION_ACTIVE, NULL) CT (CKR_OPERATION_NOT_INITIALIZED, NULL) CT (CKR_PIN_INCORRECT, NULL) CT (CKR_PIN_INVALID, NULL) CT (CKR_PIN_LEN_RANGE, NULL) CT (CKR_PIN_EXPIRED, NULL) CT (CKR_PIN_LOCKED, NULL) CT (CKR_SESSION_CLOSED, NULL) CT (CKR_SESSION_COUNT, NULL) CT (CKR_SESSION_HANDLE_INVALID, NULL) CT (CKR_SESSION_PARALLEL_NOT_SUPPORTED, NULL) CT (CKR_SESSION_READ_ONLY, NULL) CT (CKR_SESSION_EXISTS, NULL) CT (CKR_SESSION_READ_ONLY_EXISTS, NULL) CT (CKR_SESSION_READ_WRITE_SO_EXISTS, NULL) CT (CKR_SIGNATURE_INVALID, NULL) CT (CKR_SIGNATURE_LEN_RANGE, NULL) CT (CKR_TEMPLATE_INCOMPLETE, NULL) CT (CKR_TEMPLATE_INCONSISTENT, NULL) CT (CKR_TOKEN_NOT_PRESENT, NULL) CT (CKR_TOKEN_NOT_RECOGNIZED, NULL) CT (CKR_TOKEN_WRITE_PROTECTED, NULL) CT (CKR_UNWRAPPING_KEY_HANDLE_INVALID, NULL) CT (CKR_UNWRAPPING_KEY_SIZE_RANGE, NULL) CT (CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT, NULL) CT (CKR_USER_ALREADY_LOGGED_IN, NULL) CT (CKR_USER_NOT_LOGGED_IN, NULL) CT (CKR_USER_PIN_NOT_INITIALIZED, NULL) CT (CKR_USER_TYPE_INVALID, NULL) CT (CKR_USER_ANOTHER_ALREADY_LOGGED_IN, NULL) CT (CKR_USER_TOO_MANY_TYPES, NULL) CT (CKR_WRAPPED_KEY_INVALID, NULL) CT (CKR_WRAPPED_KEY_LEN_RANGE, NULL) CT (CKR_WRAPPING_KEY_HANDLE_INVALID, NULL) CT (CKR_WRAPPING_KEY_SIZE_RANGE, NULL) CT (CKR_WRAPPING_KEY_TYPE_INCONSISTENT, NULL) CT (CKR_RANDOM_SEED_NOT_SUPPORTED, NULL) CT (CKR_RANDOM_NO_RNG, NULL) CT (CKR_DOMAIN_PARAMS_INVALID, NULL) CT (CKR_BUFFER_TOO_SMALL, NULL) CT (CKR_SAVED_STATE_INVALID, NULL) CT (CKR_INFORMATION_SENSITIVE, NULL) CT (CKR_STATE_UNSAVEABLE, NULL) CT (CKR_CRYPTOKI_NOT_INITIALIZED, NULL) CT (CKR_CRYPTOKI_ALREADY_INITIALIZED, NULL) CT (CKR_MUTEX_BAD, NULL) CT (CKR_MUTEX_NOT_LOCKED, NULL) CT (CKR_FUNCTION_REJECTED, NULL) { CKA_INVALID }, }; const p11_constant p11_constant_mechanisms[] = { CT (CKM_RSA_PKCS_KEY_PAIR_GEN, "rsa-pkcs-key-pair-gen") CT (CKM_RSA_PKCS, "rsa-pkcs") CT (CKM_RSA_9796, "rsa-9796") CT (CKM_RSA_X_509, "rsa-x-509") CT (CKM_MD2_RSA_PKCS, "md2-rsa-pkcs") CT (CKM_MD5_RSA_PKCS, "md5-rsa-pkcs") CT (CKM_SHA1_RSA_PKCS, "sha1-rsa-pkcs") CT (CKM_RIPEMD128_RSA_PKCS, "ripemd128-rsa-pkcs") CT (CKM_RIPEMD160_RSA_PKCS, "ripemd160-rsa-pkcs") CT (CKM_RSA_PKCS_OAEP, "rsa-pkcs-oaep") CT (CKM_RSA_X9_31_KEY_PAIR_GEN, "rsa-x9-31-key-pair-gen") CT (CKM_RSA_X9_31, "rsa-x9-31") CT (CKM_SHA1_RSA_X9_31, "sha1-rsa-x9-31") CT (CKM_RSA_PKCS_PSS, "rsa-pkcs-pss") CT (CKM_SHA1_RSA_PKCS_PSS, "sha1-rsa-pkcs-pss") CT (CKM_DSA_KEY_PAIR_GEN, "dsa-key-pair-gen") CT (CKM_DSA, NULL) /* "dsa" */ CT (CKM_DSA_SHA1, "dsa-sha1") CT (CKM_DH_PKCS_KEY_PAIR_GEN, "dh-pkcs-key-pair-gen") CT (CKM_DH_PKCS_DERIVE, "dh-pkcs-derive") CT (CKM_X9_42_DH_KEY_PAIR_GEN, "x9-42-dh-key-pair-gen") CT (CKM_X9_42_DH_DERIVE, "x9-42-dh-derive") CT (CKM_X9_42_DH_HYBRID_DERIVE, "x9-42-dh-hybrid-derive") CT (CKM_X9_42_MQV_DERIVE, "x9-42-mqv-derive") CT (CKM_SHA256_RSA_PKCS, "sha256-rsa-pkcs") CT (CKM_SHA384_RSA_PKCS, "sha384-rsa-pkcs") CT (CKM_SHA512_RSA_PKCS, "sha512-rsa-pkcs") CT (CKM_SHA256_RSA_PKCS_PSS, "sha256-rsa-pkcs-pss") CT (CKM_SHA384_RSA_PKCS_PSS, "sha384-rsa-pkcs-pss") CT (CKM_SHA512_RSA_PKCS_PSS, "sha512-rsa-pkcs-pss") CT (CKM_RC2_KEY_GEN, "rc2-key-gen") CT (CKM_RC2_ECB, "rc2-ecb") CT (CKM_RC2_CBC, "rc2-cbc") CT (CKM_RC2_MAC, "rc2-mac") CT (CKM_RC2_MAC_GENERAL, "rc2-mac-general") CT (CKM_RC2_CBC_PAD, "rc2-cbc-pad") CT (CKM_RC4_KEY_GEN, "rc4-key-gen") CT (CKM_RC4, NULL) /* "rc4" */ CT (CKM_DES_KEY_GEN, "des-key-gen") CT (CKM_DES_ECB, "des-ecb") CT (CKM_DES_CBC, "des-cbc") CT (CKM_DES_MAC, "des-mac") CT (CKM_DES_MAC_GENERAL, "des-mac-general") CT (CKM_DES_CBC_PAD, "des-cbc-pad") CT (CKM_DES2_KEY_GEN, "des2-key-gen") CT (CKM_DES3_KEY_GEN, "des3-key-gen") CT (CKM_DES3_ECB, "des3-ecb") CT (CKM_DES3_CBC, "des3-cbc") CT (CKM_DES3_MAC, "des3-mac") CT (CKM_DES3_MAC_GENERAL, "des3-mac-general") CT (CKM_DES3_CBC_PAD, "des3-cbc-pad") CT (CKM_CDMF_KEY_GEN, "cdmf-key-gen") CT (CKM_CDMF_ECB, "cdmf-ecb") CT (CKM_CDMF_CBC, "cdmf-cbc") CT (CKM_CDMF_MAC, "cdmf-mac") CT (CKM_CDMF_MAC_GENERAL, "cdmf-mac-general") CT (CKM_CDMF_CBC_PAD, "cdmf-cbc-pad") CT (CKM_DES_OFB64, "des-ofb64") CT (CKM_DES_OFB8, "des-ofb8") CT (CKM_DES_CFB64, "des-cfb64") CT (CKM_DES_CFB8, "des-cfb8") CT (CKM_MD2, "md2") CT (CKM_MD2_HMAC, "md2-hmac") CT (CKM_MD2_HMAC_GENERAL, "md2-hmac-general") CT (CKM_MD5, "md5") CT (CKM_MD5_HMAC, "md5-hmac") CT (CKM_MD5_HMAC_GENERAL, "md5-hmac-general") CT (CKM_SHA_1, "sha-1") CT (CKM_SHA_1_HMAC, "sha-1-hmac") CT (CKM_SHA_1_HMAC_GENERAL, "sha-1-hmac-general") CT (CKM_RIPEMD128, "ripemd128") CT (CKM_RIPEMD128_HMAC, "ripemd128-hmac") CT (CKM_RIPEMD128_HMAC_GENERAL, "ripemd128-hmac-general") CT (CKM_RIPEMD160, "ripemd160") CT (CKM_RIPEMD160_HMAC, "ripemd160-hmac") CT (CKM_RIPEMD160_HMAC_GENERAL, "ripemd160-hmac-general") CT (CKM_SHA256, "sha256") CT (CKM_SHA256_HMAC, "sha256-hmac") CT (CKM_SHA256_HMAC_GENERAL, "sha256-hmac-general") CT (CKM_SHA384, "sha384") CT (CKM_SHA384_HMAC, "sha384-hmac") CT (CKM_SHA384_HMAC_GENERAL, "sha384-hmac-general") CT (CKM_SHA512, "sha512") CT (CKM_SHA512_HMAC, "sha512-hmac") CT (CKM_SHA512_HMAC_GENERAL, "sha512-hmac-general") CT (CKM_CAST_KEY_GEN, "cast-key-gen") CT (CKM_CAST_ECB, "cast-ecb") CT (CKM_CAST_CBC, "cast-cbc") CT (CKM_CAST_MAC, "cast-mac") CT (CKM_CAST_MAC_GENERAL, "cast-mac-general") CT (CKM_CAST_CBC_PAD, "cast-cbc-pad") CT (CKM_CAST3_KEY_GEN, "cast3-key-gen") CT (CKM_CAST3_ECB, "cast3-ecb") CT (CKM_CAST3_CBC, "cast3-cbc") CT (CKM_CAST3_MAC, "cast3-mac") CT (CKM_CAST3_MAC_GENERAL, "cast3-mac-general") CT (CKM_CAST3_CBC_PAD, "cast3-cbc-pad") CT (CKM_CAST5_KEY_GEN, "cast5-key-gen") /* CT (CKM_CAST128_KEY_GEN) */ CT (CKM_CAST5_ECB, "cast5-ecb") /* CT (CKM_CAST128_ECB) */ CT (CKM_CAST5_CBC, "cast5-cbc") /* CT (CKM_CAST128_CBC) */ CT (CKM_CAST5_MAC, "cast5-mac") /* CT (CKM_CAST128_MAC) */ CT (CKM_CAST5_MAC_GENERAL, "cast5-mac-general") /* CT (CKM_CAST128_MAC_GENERAL) */ CT (CKM_CAST5_CBC_PAD, "cast5-cbc-pad") /* CT (CKM_CAST128_CBC_PAD) */ CT (CKM_RC5_KEY_GEN, "rc5-key-gen") CT (CKM_RC5_ECB, "rc5-ecb") CT (CKM_RC5_CBC, "rc5-cbc") CT (CKM_RC5_MAC, "rc5-mac") CT (CKM_RC5_MAC_GENERAL, "rc5-mac-general") CT (CKM_RC5_CBC_PAD, "rc5-cbc-pad") CT (CKM_IDEA_KEY_GEN, "idea-key-gen") CT (CKM_IDEA_ECB, "idea-ecb") CT (CKM_IDEA_CBC, "idea-cbc") CT (CKM_IDEA_MAC, "idea-mac") CT (CKM_IDEA_MAC_GENERAL, "idea-mac-general") CT (CKM_IDEA_CBC_PAD, "idea-cbc-pad") CT (CKM_GENERIC_SECRET_KEY_GEN, "generic-secret-key-gen") CT (CKM_CONCATENATE_BASE_AND_KEY, "concatenate-base-and-key") CT (CKM_CONCATENATE_BASE_AND_DATA, "concatenate-base-and-data") CT (CKM_CONCATENATE_DATA_AND_BASE, "concatenate-data-and-base") CT (CKM_XOR_BASE_AND_DATA, "xor-base-and-data") CT (CKM_EXTRACT_KEY_FROM_KEY, "extract-key-from-key") CT (CKM_SSL3_PRE_MASTER_KEY_GEN, "ssl3-pre-master-key-gen") CT (CKM_SSL3_MASTER_KEY_DERIVE, "ssl3-master-key-derive") CT (CKM_SSL3_KEY_AND_MAC_DERIVE, "ssl3-key-and-mac-derive") CT (CKM_SSL3_MASTER_KEY_DERIVE_DH, "ssl3-master-key-derive-dh") CT (CKM_TLS_PRE_MASTER_KEY_GEN, "tls-pre-master-key-gen") CT (CKM_TLS_MASTER_KEY_DERIVE, "tls-master-key-derive") CT (CKM_TLS_KEY_AND_MAC_DERIVE, "tls-key-and-mac-derive") CT (CKM_TLS_MASTER_KEY_DERIVE_DH, "tls-master-key-derive-dh") /* CT (CKM_TLS_PRF) */ CT (CKM_SSL3_MD5_MAC, "ssl3-md5-mac") CT (CKM_SSL3_SHA1_MAC, "ssl3-sha1-mac") CT (CKM_MD5_KEY_DERIVATION, "md5-key-derivation") CT (CKM_MD2_KEY_DERIVATION, "md2-key-derivation") CT (CKM_SHA1_KEY_DERIVATION, "sha1-key-derivation") CT (CKM_SHA256_KEY_DERIVATION, "sha256-key-derivation") CT (CKM_SHA384_KEY_DERIVATION, "sha384-key-derivation") CT (CKM_SHA512_KEY_DERIVATION, "sha512-key-derivation") CT (CKM_PBE_MD2_DES_CBC, "pbe-md2-des-cbc") CT (CKM_PBE_MD5_DES_CBC, "pbe-md5-des-cbc") CT (CKM_PBE_MD5_CAST_CBC, "pbe-md5-cast-cbc") CT (CKM_PBE_MD5_CAST3_CBC, "pbe-md5-cast3-cbc") CT (CKM_PBE_MD5_CAST5_CBC, "pbe-md5-cast5-cbc") /* CT (CKM_PBE_MD5_CAST128_CBC) */ CT (CKM_PBE_SHA1_CAST5_CBC, "pbe-sha1-cast5-cbc") /* CT (CKM_PBE_SHA1_CAST128_CBC) */ CT (CKM_PBE_SHA1_RC4_128, "pbe-sha1-rc4-128") CT (CKM_PBE_SHA1_RC4_40, "pbe-sha1-rc4-40") CT (CKM_PBE_SHA1_DES3_EDE_CBC, "pbe-sha1-des3-ede-cbc") CT (CKM_PBE_SHA1_DES2_EDE_CBC, "pbe-sha1-des2-ede-cbc") CT (CKM_PBE_SHA1_RC2_128_CBC, "pbe-sha1-rc2-128-cbc") CT (CKM_PBE_SHA1_RC2_40_CBC, "pbe-sha1-rc2-40-cbc") CT (CKM_PKCS5_PBKD2, "pkcs5-pbkd2") CT (CKM_PBA_SHA1_WITH_SHA1_HMAC, "pba-sha1-with-sha1-hmac") CT (CKM_WTLS_PRE_MASTER_KEY_GEN, "wtls-pre-master-key-gen") CT (CKM_WTLS_MASTER_KEY_DERIVE, "wtls-master-key-derive") CT (CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC, "wtls-master-key-derive-dh-ecc") CT (CKM_WTLS_PRF, "wtls-prf") CT (CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE, "wtls-server-key-and-mac-derive") CT (CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE, "wtls-client-key-and-mac-derive") CT (CKM_KEY_WRAP_LYNKS, "key-wrap-lynks") CT (CKM_KEY_WRAP_SET_OAEP, "key-wrap-set-oaep") CT (CKM_CMS_SIG, "cms-sig") CT (CKM_SKIPJACK_KEY_GEN, "skipjack-key-gen") CT (CKM_SKIPJACK_ECB64, "skipjack-ecb64") CT (CKM_SKIPJACK_CBC64, "skipjack-cbc64") CT (CKM_SKIPJACK_OFB64, "skipjack-ofb64") CT (CKM_SKIPJACK_CFB64, "skipjack-cfb64") CT (CKM_SKIPJACK_CFB32, "skipjack-cfb32") CT (CKM_SKIPJACK_CFB16, "skipjack-cfb16") CT (CKM_SKIPJACK_CFB8, "skipjack-cfb8") CT (CKM_SKIPJACK_WRAP, "skipjack-wrap") CT (CKM_SKIPJACK_PRIVATE_WRAP, "skipjack-private-wrap") CT (CKM_SKIPJACK_RELAYX, "skipjack-relayx") CT (CKM_KEA_KEY_PAIR_GEN, "kea-key-pair-gen") CT (CKM_KEA_KEY_DERIVE, "kea-key-derive") CT (CKM_FORTEZZA_TIMESTAMP, "fortezza-timestamp") CT (CKM_BATON_KEY_GEN, "baton-key-gen") CT (CKM_BATON_ECB128, "baton-ecb128") CT (CKM_BATON_ECB96, "baton-ecb96") CT (CKM_BATON_CBC128, "baton-cbc128") CT (CKM_BATON_COUNTER, "baton-counter") CT (CKM_BATON_SHUFFLE, "baton-shuffle") CT (CKM_BATON_WRAP, "baton-wrap") CT (CKM_ECDSA_KEY_PAIR_GEN, "ecdsa-key-pair-gen") /* CT (CKM_EC_KEY_PAIR_GEN) */ CT (CKM_ECDSA, "ecdsa") CT (CKM_ECDSA_SHA1, "ecdsa-sha1") CT (CKM_ECDH1_DERIVE, "ecdh1-derive") CT (CKM_ECDH1_COFACTOR_DERIVE, "ecdh1-cofactor-derive") CT (CKM_ECMQV_DERIVE, "ecmqv-derive") CT (CKM_JUNIPER_KEY_GEN, "juniper-key-gen") CT (CKM_JUNIPER_ECB128, "juniper-ecb128") CT (CKM_JUNIPER_CBC128, "juniper-cbc128") CT (CKM_JUNIPER_COUNTER, "juniper-counter") CT (CKM_JUNIPER_SHUFFLE, "juniper-shuffle") CT (CKM_JUNIPER_WRAP, "juniper-wrap") CT (CKM_FASTHASH, "fasthash") CT (CKM_AES_KEY_GEN, "aes-key-gen") CT (CKM_AES_ECB, "aes-ecb") CT (CKM_AES_CBC, "aes-cbc") CT (CKM_AES_MAC, "aes-mac") CT (CKM_AES_MAC_GENERAL, "aes-mac-general") CT (CKM_AES_CBC_PAD, "aes-cbc-pad") CT (CKM_BLOWFISH_KEY_GEN, "blowfish-key-gen") CT (CKM_BLOWFISH_CBC, "blowfish-cbc") CT (CKM_TWOFISH_KEY_GEN, "twofish-key-gen") CT (CKM_TWOFISH_CBC, "twofish-cbc") CT (CKM_DES_ECB_ENCRYPT_DATA, "des-ecb-encrypt-data") CT (CKM_DES_CBC_ENCRYPT_DATA, "des-cbc-encrypt-data") CT (CKM_DES3_ECB_ENCRYPT_DATA, "des3-ecb-encrypt-data") CT (CKM_DES3_CBC_ENCRYPT_DATA, "des3-cbc-encrypt-data") CT (CKM_AES_ECB_ENCRYPT_DATA, "aes-ecb-encrypt-data") CT (CKM_AES_CBC_ENCRYPT_DATA, "aes-cbc-encrypt-data") CT (CKM_DSA_PARAMETER_GEN, "dsa-parameter-gen") CT (CKM_DH_PKCS_PARAMETER_GEN, "dh-pkcs-parameter-gen") CT (CKM_X9_42_DH_PARAMETER_GEN, "x9-42-dh-parameter-gen") { CKA_INVALID }, }; #undef CT struct { const p11_constant *table; int length; } tables[] = { { p11_constant_types, ELEMS (p11_constant_types) - 1 }, { p11_constant_classes, ELEMS (p11_constant_classes) - 1 }, { p11_constant_trusts, ELEMS (p11_constant_trusts) - 1 }, { p11_constant_certs, ELEMS (p11_constant_certs) - 1 }, { p11_constant_keys, ELEMS (p11_constant_keys) - 1 }, { p11_constant_asserts, ELEMS (p11_constant_asserts) - 1 }, { p11_constant_categories, ELEMS (p11_constant_categories) - 1 }, { p11_constant_mechanisms, ELEMS (p11_constant_mechanisms) - 1 }, { p11_constant_states, ELEMS (p11_constant_states) - 1 }, { p11_constant_users, ELEMS (p11_constant_users) - 1 }, { p11_constant_returns, ELEMS (p11_constant_returns) - 1 }, }; static int compar_attr_info (const void *one, const void *two) { const p11_constant *a1 = one; const p11_constant *a2 = two; if (a1->value == a2->value) return 0; if (a1->value < a2->value) return -1; return 1; } static const p11_constant * lookup_info (const p11_constant *table, CK_ATTRIBUTE_TYPE type) { p11_constant match = { type, NULL, NULL }; int length = -1; int i; for (i = 0; i < ELEMS (tables); i++) { if (table == tables[i].table) { length = tables[i].length; break; } } return_val_if_fail (length != -1, NULL); return bsearch (&match, table, length, sizeof (p11_constant), compar_attr_info); } const char * p11_constant_name (const p11_constant *constants, CK_ULONG type) { const p11_constant *constant = lookup_info (constants, type); return constant ? constant->name : NULL; } const char * p11_constant_nick (const p11_constant *constants, CK_ULONG type) { const p11_constant *constant = lookup_info (constants, type); return constant ? constant->nick : NULL; } p11_dict * p11_constant_reverse (bool nick) { const p11_constant *table; p11_dict *lookups; void *string; int length = -1; int i, j; lookups = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, NULL, NULL); return_val_if_fail (lookups != NULL, NULL); for (i = 0; i < ELEMS (tables); i++) { table = tables[i].table; length = tables[i].length; for (j = 0; j < length; j++) { if (nick) { if (!table[j].nick) continue; string = (void *)table[j].nick; } else { string = (void *)table[j].name; } if (!p11_dict_set (lookups, string, (void *)&table[j].value)) return_val_if_reached (NULL); } } return lookups; } CK_ULONG p11_constant_resolve (p11_dict *reversed, const char *string) { CK_ULONG *ptr; return_val_if_fail (reversed != NULL, CKA_INVALID); return_val_if_fail (string != NULL, CKA_INVALID); ptr = p11_dict_get (reversed, string); return ptr ? *ptr : CKA_INVALID; } p11-kit-0.20.2/common/Makefile.am0000664000175000017500000000135712226763526013251 00000000000000 include $(top_srcdir)/build/Makefile.decl SUBDIRS = . tests incdir = $(includedir)/p11-kit-1/p11-kit inc_HEADERS = \ pkcs11.h \ $(NULL) noinst_LTLIBRARIES = \ libp11-common.la \ libp11-library.la \ libp11-test.la \ libp11-tool.la \ $(NULL) libp11_common_la_SOURCES = \ argv.c argv.h \ attrs.c attrs.h \ array.c array.h \ buffer.c buffer.h \ compat.c compat.h \ constants.c constants.h \ debug.c debug.h \ dict.c dict.h \ hash.c hash.h \ lexer.c lexer.h \ message.c message.h \ path.c path.h \ pkcs11.h pkcs11x.h \ url.c url.h \ $(NULL) libp11_library_la_SOURCES = \ library.c library.h \ $(NULL) libp11_test_la_SOURCES = \ mock.c mock.h \ test.c test.h \ $(NULL) libp11_tool_la_SOURCES = \ tool.c tool.h \ $(NULL)p11-kit-0.20.2/common/library.h0000664000175000017500000000470112161102013012776 00000000000000/* * Copyright (c) 2011 Collabora Ltd * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * CONTRIBUTORS * Stef Walter */ #ifndef P11_LIBRARY_H_ #define P11_LIBRARY_H_ #include "config.h" #include "compat.h" #include extern p11_mutex_t p11_library_mutex; #define p11_lock() p11_mutex_lock (&p11_library_mutex); #define p11_unlock() p11_mutex_unlock (&p11_library_mutex); #ifdef OS_WIN32 /* No implementation, because done by DllMain */ #define p11_library_init_once() #else /* !OS_WIN32 */ extern pthread_once_t p11_library_once; #define p11_library_init_once() \ pthread_once (&p11_library_once, p11_library_init_impl); void p11_library_init_impl (void); #endif /* !OS_WIN32 */ void p11_library_init (void); void p11_library_thread_cleanup (void); void p11_library_uninit (void); #endif /* P11_LIBRARY_H_ */ p11-kit-0.20.2/common/lexer.c0000664000175000017500000001423412225010113012446 00000000000000/* * Copyright (c) 2005 Stefan Walter * Copyright (c) 2011 Collabora Ltd. * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * CONTRIBUTORS * Stef Walter */ #include "config.h" #define P11_DEBUG_FLAG P11_DEBUG_CONF #include "debug.h" #include "lexer.h" #include "message.h" #include #include #include #include #include #include void p11_lexer_init (p11_lexer *lexer, const char *filename, const char *data, size_t length) { return_if_fail (lexer != NULL); memset (lexer, 0, sizeof (p11_lexer)); lexer->at = data; lexer->remaining = length; return_if_fail (filename != NULL); lexer->filename = strdup (filename); return_if_fail (lexer->filename != NULL); } static void clear_state (p11_lexer *lexer) { switch (lexer->tok_type) { case TOK_FIELD: free (lexer->tok.field.name); free (lexer->tok.field.value); break; case TOK_SECTION: free (lexer->tok.section.name); break; case TOK_PEM: case TOK_EOF: break; } memset (&lexer->tok, 0, sizeof (lexer->tok)); lexer->tok_type = TOK_EOF; lexer->complained = false; } bool p11_lexer_next (p11_lexer *lexer, bool *failed) { const char *colon; const char *value; const char *line; const char *end; const char *pos; char *part; return_val_if_fail (lexer != NULL, false); clear_state (lexer); if (failed) *failed = false; /* Go through lines and process them */ while (lexer->remaining != 0) { assert (lexer->remaining > 0); /* Is this line the start of a PEM block? */ if (strncmp (lexer->at, "-----BEGIN ", 11) == 0) { pos = strnstr (lexer->at, "\n-----END ", lexer->remaining); if (pos != NULL) { end = memchr (pos + 1, '\n', lexer->remaining - (pos - lexer->at) - 1); if (end) end += 1; else end = lexer->at + lexer->remaining; lexer->tok_type = TOK_PEM; lexer->tok.pem.begin = lexer->at; lexer->tok.pem.length = end - lexer->at; assert (end - lexer->at <= lexer->remaining); lexer->remaining -= (end - lexer->at); lexer->at = end; return true; } p11_lexer_msg (lexer, "invalid pem block: no ending line"); if (failed) *failed = true; return false; } line = lexer->at; end = memchr (lexer->at, '\n', lexer->remaining); if (end == NULL) { end = lexer->at + lexer->remaining; lexer->remaining = 0; lexer->at = end; } else { assert ((end - lexer->at) + 1 <= lexer->remaining); lexer->remaining -= (end - lexer->at) + 1; lexer->at = end + 1; } /* Strip whitespace from line */ while (line != end && isspace (line[0])) ++line; while (line != end && isspace (*(end - 1))) --end; /* Empty lines / comments at start */ if (line == end || line[0] == '#') continue; /* Is the the a section ? */ if (line[0] == '[') { if (*(end - 1) != ']') { part = strndup (line, end - line); p11_lexer_msg (lexer, "invalid section header: missing braces"); free (part); if (failed) *failed = true; return false; } lexer->tok_type = TOK_SECTION; lexer->tok.section.name = strndup (line + 1, (end - line) - 2); return_val_if_fail (lexer->tok.section.name != NULL, false); return true; } /* Look for the break between name: value on the same line */ colon = memchr (line, ':', end - line); if (!colon) { part = strndup (line, end - line); p11_lexer_msg (lexer, "invalid field line: no colon"); free (part); if (failed) *failed = true; return false; } /* Strip whitespace from name and value */ value = colon + 1; while (value != end && isspace (value[0])) ++value; while (line != colon && isspace (*(colon - 1))) --colon; lexer->tok_type = TOK_FIELD; lexer->tok.field.name = strndup (line, colon - line); lexer->tok.field.value = strndup (value, end - value); return_val_if_fail (lexer->tok.field.name && lexer->tok.field.value, false); return true; } return false; } void p11_lexer_done (p11_lexer *lexer) { return_if_fail (lexer != NULL); clear_state (lexer); free (lexer->filename); memset (lexer, 0, sizeof (p11_lexer)); } void p11_lexer_msg (p11_lexer *lexer, const char *msg) { return_if_fail (lexer != NULL); if (lexer->complained) return; switch (lexer->tok_type) { case TOK_FIELD: p11_message ("%s: %s: %s", lexer->filename, lexer->tok.field.name, msg); break; case TOK_SECTION: p11_message ("%s: [%s]: %s", lexer->filename, lexer->tok.section.name, msg); break; case TOK_PEM: p11_message ("%s: BEGIN ...: %s", lexer->filename, msg); break; default: p11_message ("%s: %s", lexer->filename, msg); break; } lexer->complained = true; } p11-kit-0.20.2/common/debug.c0000664000175000017500000000737612226763526012456 00000000000000/* * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * CONTRIBUTORS * Stef Walter */ #include "config.h" #include "debug.h" #include #include #include #include #include #include struct DebugKey { const char *name; int value; }; static struct DebugKey debug_keys[] = { { "lib", P11_DEBUG_LIB }, { "conf", P11_DEBUG_CONF }, { "uri", P11_DEBUG_URI }, { "proxy", P11_DEBUG_PROXY }, { "trust", P11_DEBUG_TRUST }, { "tool", P11_DEBUG_TOOL }, { 0, } }; static bool debug_inited = false; static bool debug_strict = false; /* global variable exported in debug.h */ int p11_debug_current_flags = ~0; static int parse_environ_flags (void) { const char *env; int result = 0; const char *p; const char *q; int i; env = getenv ("P11_KIT_STRICT"); if (env && env[0] != '\0') debug_strict = true; env = getenv ("P11_KIT_DEBUG"); if (!env) return 0; if (strcmp (env, "all") == 0) { for (i = 0; debug_keys[i].name; i++) result |= debug_keys[i].value; } else if (strcmp (env, "help") == 0) { fprintf (stderr, "Supported debug values:"); for (i = 0; debug_keys[i].name; i++) fprintf (stderr, " %s", debug_keys[i].name); fprintf (stderr, "\n"); } else { p = env; while (*p) { q = strpbrk (p, ":;, \t"); if (!q) q = p + strlen (p); for (i = 0; debug_keys[i].name; i++) { if (q - p == strlen (debug_keys[i].name) && strncmp (debug_keys[i].name, p, q - p) == 0) result |= debug_keys[i].value; } p = q; if (*p) p++; } } return result; } void p11_debug_init (void) { p11_debug_current_flags = parse_environ_flags (); debug_inited = true; } void p11_debug_message (int flag, const char *format, ...) { va_list args; if (flag & p11_debug_current_flags) { fprintf (stderr, "(p11-kit:%d) ", getpid()); va_start (args, format); vfprintf (stderr, format, args); va_end (args); fprintf (stderr, "\n"); } } void p11_debug_precond (const char *format, ...) { va_list va; va_start (va, format); vfprintf (stderr, format, va); va_end (va); #ifdef __COVERITY__ fprintf (stderr, "ignoring P11_KIT_STRICT under coverity: %d", (int)debug_strict); #else if (debug_strict) #endif abort (); } p11-kit-0.20.2/common/dict.c0000664000175000017500000002124712264771641012303 00000000000000/* * Copyright (c) 2004 Stefan Walter * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ #include "config.h" #include "debug.h" #include "dict.h" #include "hash.h" #include #include #include #include #include struct _p11_dict { p11_dict_hasher hash_func; p11_dict_equals equal_func; p11_destroyer key_destroy_func; p11_destroyer value_destroy_func; struct _p11_dictbucket **buckets; unsigned int num_items; unsigned int num_buckets; }; typedef struct _p11_dictbucket { void *key; unsigned int hashed; void *value; struct _p11_dictbucket *next; } dictbucket; static dictbucket * next_entry (p11_dictiter *iter) { dictbucket *bucket = iter->next; while (!bucket) { if (iter->index >= iter->dict->num_buckets) return NULL; bucket = iter->dict->buckets[iter->index++]; } iter->next = bucket->next; return bucket; } bool p11_dict_next (p11_dictiter *iter, void **key, void **value) { dictbucket *bucket = next_entry (iter); if (bucket == NULL) return false; if (key) *key = bucket->key; if (value) *value = bucket->value; return true; } void p11_dict_iterate (p11_dict *dict, p11_dictiter *iter) { iter->dict = dict; iter->index = 0; iter->next = NULL; } static dictbucket ** lookup_or_create_bucket (p11_dict *dict, const void *key, bool create) { dictbucket **bucketp; unsigned int hash; /* Perform the hashing */ hash = dict->hash_func (key); /* scan linked list */ for (bucketp = &dict->buckets[hash % dict->num_buckets]; *bucketp != NULL; bucketp = &(*bucketp)->next) { if((*bucketp)->hashed == hash && dict->equal_func ((*bucketp)->key, key)) break; } if ((*bucketp) != NULL || !create) return bucketp; /* add a new entry for non-NULL val */ (*bucketp) = calloc (sizeof (dictbucket), 1); if (*bucketp != NULL) { (*bucketp)->key = (void*)key; (*bucketp)->hashed = hash; dict->num_items++; } return bucketp; } void * p11_dict_get (p11_dict *dict, const void *key) { dictbucket **bucketp; bucketp = lookup_or_create_bucket (dict, key, false); if (bucketp && *bucketp) return (void*)((*bucketp)->value); else return NULL; } bool p11_dict_set (p11_dict *dict, void *key, void *val) { dictbucket **bucketp; p11_dictiter iter; dictbucket *bucket; dictbucket **new_buckets; unsigned int num_buckets; bucketp = lookup_or_create_bucket (dict, key, true); if(bucketp && *bucketp) { /* Destroy the previous key */ if ((*bucketp)->key && (*bucketp)->key != key && dict->key_destroy_func) dict->key_destroy_func ((*bucketp)->key); /* Destroy the previous value */ if ((*bucketp)->value && (*bucketp)->value != val && dict->value_destroy_func) dict->value_destroy_func ((*bucketp)->value); /* replace entry */ (*bucketp)->key = key; (*bucketp)->value = val; /* check that the collision rate isn't too high */ if (dict->num_items > dict->num_buckets) { num_buckets = dict->num_buckets * 2 + 1; new_buckets = (dictbucket **)calloc (sizeof (dictbucket *), num_buckets); /* Ignore failures, maybe we can expand later */ if(new_buckets) { p11_dict_iterate (dict, &iter); while ((bucket = next_entry (&iter)) != NULL) { unsigned int i = bucket->hashed % num_buckets; bucket->next = new_buckets[i]; new_buckets[i] = bucket; } free (dict->buckets); dict->buckets = new_buckets; dict->num_buckets = num_buckets; } } return true; } return_val_if_reached (false); } bool p11_dict_steal (p11_dict *dict, const void *key, void **stolen_key, void **stolen_value) { dictbucket **bucketp; bucketp = lookup_or_create_bucket (dict, key, false); if (bucketp && *bucketp) { dictbucket *old = *bucketp; *bucketp = (*bucketp)->next; --dict->num_items; if (stolen_key) *stolen_key = old->key; if (stolen_value) *stolen_value = old->value; free (old); return true; } return false; } bool p11_dict_remove (p11_dict *dict, const void *key) { void *old_key; void *old_value; if (!p11_dict_steal (dict, key, &old_key, &old_value)) return false; if (dict->key_destroy_func) dict->key_destroy_func (old_key); if (dict->value_destroy_func) dict->value_destroy_func (old_value); return true; } void p11_dict_clear (p11_dict *dict) { dictbucket *bucket, *next; int i; /* Free all entries in the array */ for (i = 0; i < dict->num_buckets; ++i) { bucket = dict->buckets[i]; while (bucket != NULL) { next = bucket->next; if (dict->key_destroy_func) dict->key_destroy_func (bucket->key); if (dict->value_destroy_func) dict->value_destroy_func (bucket->value); free (bucket); bucket = next; } } memset (dict->buckets, 0, dict->num_buckets * sizeof (dictbucket *)); dict->num_items = 0; } p11_dict * p11_dict_new (p11_dict_hasher hash_func, p11_dict_equals equal_func, p11_destroyer key_destroy_func, p11_destroyer value_destroy_func) { p11_dict *dict; assert (hash_func); assert (equal_func); dict = malloc (sizeof (p11_dict)); if (dict) { dict->hash_func = hash_func; dict->equal_func = equal_func; dict->key_destroy_func = key_destroy_func; dict->value_destroy_func = value_destroy_func; dict->num_buckets = 9; dict->buckets = (dictbucket **)calloc (sizeof (dictbucket *), dict->num_buckets); if (!dict->buckets) { free (dict); return NULL; } dict->num_items = 0; } return dict; } void p11_dict_free (p11_dict *dict) { dictbucket *bucket; p11_dictiter iter; if (!dict) return; p11_dict_iterate (dict, &iter); while ((bucket = next_entry (&iter)) != NULL) { if (dict->key_destroy_func) dict->key_destroy_func (bucket->key); if (dict->value_destroy_func) dict->value_destroy_func (bucket->value); free (bucket); } if (dict->buckets) free (dict->buckets); free (dict); } unsigned int p11_dict_size (p11_dict *dict) { return dict->num_items; } unsigned int p11_dict_str_hash (const void *string) { uint32_t hash; p11_hash_murmur3 (&hash, string, strlen (string), NULL); return hash; } bool p11_dict_str_equal (const void *string_one, const void *string_two) { assert (string_one); assert (string_two); return strcmp (string_one, string_two) == 0; } unsigned int p11_dict_ulongptr_hash (const void *to_ulong) { assert (to_ulong); return (unsigned int)*((unsigned long*)to_ulong); } bool p11_dict_ulongptr_equal (const void *ulong_one, const void *ulong_two) { assert (ulong_one); assert (ulong_two); return *((unsigned long*)ulong_one) == *((unsigned long*)ulong_two); } unsigned int p11_dict_intptr_hash (const void *to_int) { assert (to_int); return (unsigned int)*((int*)to_int); } bool p11_dict_intptr_equal (const void *int_one, const void *int_two) { assert (int_one); assert (int_two); return *((int*)int_one) == *((int*)int_two); } unsigned int p11_dict_direct_hash (const void *ptr) { return (unsigned int)(size_t)ptr; } bool p11_dict_direct_equal (const void *ptr_one, const void *ptr_two) { return ptr_one == ptr_two; } p11-kit-0.20.2/common/dict.h0000664000175000017500000001406312265015624012277 00000000000000/* * Copyright (c) 2004 Stefan Walter * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Waler */ #ifndef P11_DICT_H_ #define P11_DICT_H_ #include "compat.h" /* * ARGUMENT DOCUMENTATION * * dict: The dict * key: Pointer to the key value * val: Pointer to the value * iter: A dict iterator */ /* ---------------------------------------------------------------------------------- * TYPES */ /* Abstract type for dicts. */ typedef struct _p11_dict p11_dict; /* Type for scanning hash tables. */ typedef struct _p11_dictiter { p11_dict *dict; struct _p11_dictbucket *next; unsigned int index; } p11_dictiter; typedef unsigned int (*p11_dict_hasher) (const void *data); typedef bool (*p11_dict_equals) (const void *one, const void *two); #ifndef P11_DESTROYER_DEFINED #define P11_DESTROYER_DEFINED typedef void (*p11_destroyer) (void *data); #endif /* ----------------------------------------------------------------------------- * MAIN */ /* * p11_dict_create : Create a hash table * - returns an allocated hashtable */ p11_dict * p11_dict_new (p11_dict_hasher hasher, p11_dict_equals equals, p11_destroyer key_destroyer, p11_destroyer value_destroyer); /* * p11_dict_free : Free a hash table */ void p11_dict_free (p11_dict *dict); /* * p11_dict_size: Number of values in hash table * - returns the number of entries in hash table */ unsigned int p11_dict_size (p11_dict *dict); /* * p11_dict_get: Retrieves a value from the hash table * - returns the value of the entry */ void* p11_dict_get (p11_dict *dict, const void *key); /* * p11_dict_set: Set a value in the hash table * - returns true if the entry was added properly */ bool p11_dict_set (p11_dict *dict, void *key, void *value); /* * p11_dict_remove: Remove a value from the hash table * - returns true if the entry was found */ bool p11_dict_remove (p11_dict *dict, const void *key); /* * p11_dict_steal: Remove a value from the hash table without calling * destroy funcs * - returns true if the entry was found */ bool p11_dict_steal (p11_dict *dict, const void *key, void **stolen_key, void **stolen_value); /* * p11_dict_iterate: Start enumerating through the hash table * - returns a hash iterator */ void p11_dict_iterate (p11_dict *dict, p11_dictiter *iter); /* * p11_dict_next: Enumerate through hash table * - sets key and value to key and/or value * - returns whether there was another entry * - p11_dict_remove or p11_dict_steal is safe to use on * the current key. */ bool p11_dict_next (p11_dictiter *iter, void **key, void **value); /* * p11_dict_clear: Clear all values from has htable. */ void p11_dict_clear (p11_dict *dict); /* ----------------------------------------------------------------------------- * KEY FUNCTIONS */ unsigned int p11_dict_str_hash (const void *string); bool p11_dict_str_equal (const void *string_one, const void *string_two); unsigned int p11_dict_ulongptr_hash (const void *to_ulong); bool p11_dict_ulongptr_equal (const void *ulong_one, const void *ulong_two); unsigned int p11_dict_intptr_hash (const void *to_int); bool p11_dict_intptr_equal (const void *int_one, const void *int_two); unsigned int p11_dict_direct_hash (const void *ptr); bool p11_dict_direct_equal (const void *ptr_one, const void *ptr_two); #endif /* __P11_DICT_H__ */ p11-kit-0.20.2/common/attrs.h0000664000175000017500000001374112264774153012523 00000000000000/* * Copyright (C) 2012, Redhat Inc. * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_ATTRS_H_ #define P11_ATTRS_H_ #include "buffer.h" #include "compat.h" #include "pkcs11.h" #define CKA_INVALID ((CK_ULONG)-1) CK_ATTRIBUTE * p11_attrs_dup (const CK_ATTRIBUTE *attrs); CK_ATTRIBUTE * p11_attrs_build (CK_ATTRIBUTE *attrs, ...); CK_ATTRIBUTE * p11_attrs_buildn (CK_ATTRIBUTE *attrs, const CK_ATTRIBUTE *add, CK_ULONG count); CK_ATTRIBUTE * p11_attrs_take (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type, CK_VOID_PTR value, CK_ULONG length); CK_ATTRIBUTE * p11_attrs_merge (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE *merge, bool replace); void p11_attrs_purge (CK_ATTRIBUTE *attrs); bool p11_attrs_terminator (const CK_ATTRIBUTE *attrs); CK_ULONG p11_attrs_count (const CK_ATTRIBUTE *attrs); void p11_attrs_free (void *attrs); CK_ATTRIBUTE * p11_attrs_find (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type); CK_ATTRIBUTE * p11_attrs_findn (CK_ATTRIBUTE *attrs, CK_ULONG count, CK_ATTRIBUTE_TYPE type); bool p11_attrs_find_bool (const CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type, CK_BBOOL *value); bool p11_attrs_findn_bool (const CK_ATTRIBUTE *attrs, CK_ULONG count, CK_ATTRIBUTE_TYPE type, CK_BBOOL *value); bool p11_attrs_find_ulong (const CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type, CK_ULONG *value); bool p11_attrs_findn_ulong (const CK_ATTRIBUTE *attrs, CK_ULONG count, CK_ATTRIBUTE_TYPE type, CK_ULONG *value); void * p11_attrs_find_value (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type, size_t *length); CK_ATTRIBUTE * p11_attrs_find_valid (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type); bool p11_attrs_remove (CK_ATTRIBUTE *attrs, CK_ATTRIBUTE_TYPE type); bool p11_attrs_match (const CK_ATTRIBUTE *attrs, const CK_ATTRIBUTE *match); bool p11_attrs_matchn (const CK_ATTRIBUTE *attrs, const CK_ATTRIBUTE *match, CK_ULONG count); char * p11_attrs_to_string (const CK_ATTRIBUTE *attrs, int count); void p11_attrs_format (p11_buffer *buffer, const CK_ATTRIBUTE *attrs, int count); char * p11_attr_to_string (const CK_ATTRIBUTE *attr, CK_OBJECT_CLASS klass); void p11_attr_format (p11_buffer *buffer, const CK_ATTRIBUTE *attr, CK_OBJECT_CLASS klass); bool p11_attr_equal (const void *one, const void *two); unsigned int p11_attr_hash (const void *data); bool p11_attr_match_value (const CK_ATTRIBUTE *attr, const void *value, ssize_t length); #endif /* P11_ATTRS_H_ */ p11-kit-0.20.2/common/library.c0000664000175000017500000001101412225010113012764 00000000000000/* * Copyright (c) 2011 Collabora Ltd * Copyright (c) 2012 Stef Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * CONTRIBUTORS * Stef Walter */ #include "config.h" #include "compat.h" #define P11_DEBUG_FLAG P11_DEBUG_LIB #include "debug.h" #include "library.h" #include "message.h" #include #include #include #include #include #define P11_MESSAGE_MAX 512 typedef struct { char message[P11_MESSAGE_MAX]; } p11_local; static p11_local * _p11_library_get_thread_local (void); p11_mutex_t p11_library_mutex; #ifdef OS_UNIX pthread_once_t p11_library_once = PTHREAD_ONCE_INIT; #endif static char * thread_local_message (void) { p11_local *local; local = _p11_library_get_thread_local (); return local ? local->message : NULL; } static char * dont_store_message (void) { return NULL; } static void uninit_common (void) { p11_debug ("uninitializing library"); } #ifdef OS_UNIX static pthread_key_t thread_local = 0; static p11_local * _p11_library_get_thread_local (void) { p11_local *local; p11_library_init_once (); local = pthread_getspecific (thread_local); if (local == NULL) { local = calloc (1, sizeof (p11_local)); pthread_setspecific (thread_local, local); } return local; } void p11_library_init_impl (void) { p11_debug_init (); p11_debug ("initializing library"); p11_mutex_init (&p11_library_mutex); pthread_key_create (&thread_local, free); p11_message_storage = thread_local_message; } void p11_library_init (void) { p11_library_init_once (); } void p11_library_uninit (void) { uninit_common (); /* Some cleanup to pacify valgrind */ free (pthread_getspecific (thread_local)); pthread_setspecific (thread_local, NULL); p11_message_storage = dont_store_message; pthread_key_delete (thread_local); p11_mutex_uninit (&p11_library_mutex); } #endif /* OS_UNIX */ #ifdef OS_WIN32 static DWORD thread_local = TLS_OUT_OF_INDEXES; BOOL WINAPI DllMain (HINSTANCE, DWORD, LPVOID); static p11_local * _p11_library_get_thread_local (void) { LPVOID data; if (thread_local == TLS_OUT_OF_INDEXES) return NULL; data = TlsGetValue (thread_local); if (data == NULL) { data = LocalAlloc (LPTR, sizeof (p11_local)); TlsSetValue (thread_local, data); } return (p11_local *)data; } void p11_library_init (void) { p11_debug_init (); p11_debug ("initializing library"); p11_mutex_init (&p11_library_mutex); thread_local = TlsAlloc (); if (thread_local == TLS_OUT_OF_INDEXES) p11_debug ("couldn't setup tls"); else p11_message_storage = thread_local_message; } void p11_library_thread_cleanup (void) { p11_local *local; if (thread_local != TLS_OUT_OF_INDEXES) { p11_debug ("thread stopped, freeing tls"); local = TlsGetValue (thread_local); LocalFree (local); } } void p11_library_uninit (void) { LPVOID data; uninit_common (); if (thread_local != TLS_OUT_OF_INDEXES) { p11_message_storage = dont_store_message; data = TlsGetValue (thread_local); LocalFree (data); TlsFree (thread_local); } p11_mutex_uninit (&p11_library_mutex); } #endif /* OS_WIN32 */ p11-kit-0.20.2/ABOUT-NLS0000644000175000017500000026713312265207774011161 000000000000001 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. 1.1 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. Installers may use special options at configuration time for changing the default behaviour. The command: ./configure --disable-nls will _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl' library and will decide to use it. If not, you may have to to use the `--with-libintl-prefix' option to tell `configure' where to look for it. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.2 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. If you happen to have the `LC_ALL' or some other `LC_xxx' environment variables set, you should unset them before setting `LANG', otherwise the setting of `LANG' will not have the desired effect. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.3 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.4 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of June 2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca +--------------------------------------------------+ a2ps | [] [] | aegis | | ant-phone | | anubis | | aspell | [] [] | bash | | bfd | | bibshelf | [] | binutils | | bison | | bison-runtime | [] | bluez-pin | [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] [] | cpio | | cppi | | cpplib | [] | cryptsetup | | dfarc | | dialog | [] [] | dico | | diffutils | [] | dink | | doodle | | e2fsprogs | [] | enscript | [] | exif | | fetchmail | [] | findutils | [] | flex | [] | freedink | | gas | | gawk | [] [] | gcal | [] | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] [] | gettext-tools | [] [] | gip | [] | gjay | | gliv | [] | glunarclock | [] [] | gnubiff | | gnucash | [] | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | | gold | | gpe-aerial | | gpe-beam | | gpe-bluetooth | | gpe-calendar | | gpe-clock | [] | gpe-conf | | gpe-contacts | | gpe-edit | | gpe-filemanager | | gpe-go | | gpe-login | | gpe-ownerinfo | [] | gpe-package | | gpe-sketchbook | | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] | gpe-today | [] | gpe-todo | | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | [] [] | gsasl | | gss | | gst-plugins-bad | [] | gst-plugins-base | [] | gst-plugins-good | [] | gst-plugins-ugly | [] | gstreamer | [] [] [] | gtick | | gtkam | [] | gtkorphan | [] | gtkspell | [] [] [] | gutenprint | | hello | [] | help2man | | hylafax | | idutils | | indent | [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | | iso_639 | [] [] [] [] | iso_639_3 | | jwhois | | kbd | | keytouch | [] | keytouch-editor | | keytouch-keyboa... | [] | klavaro | [] | latrine | | ld | [] | leafpad | [] [] | libc | [] [] | libexif | () | libextractor | | libgnutls | | libgpewidget | | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | [] | libidn | | lifelines | | liferea | [] [] | lilypond | | linkdr | [] | lordsawar | | lprng | | lynx | [] | m4 | | mailfromd | | mailutils | | make | | man-db | | man-db-manpages | | minicom | | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | | psmisc | | pspp | [] | pwdutils | | radius | [] | recode | [] [] | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] [] | sed | [] [] | sharutils | [] [] | shishi | | skencil | | solfege | | solfege-manual | | soundtracker | | sp | | sysstat | | tar | [] | texinfo | | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] [] | wyslij-po | | xchat | [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] | +--------------------------------------------------+ af am an ar as ast az be be@latin bg bn_IN bs ca 6 0 1 2 3 19 1 10 3 28 3 1 38 crh cs da de el en en_GB en_ZA eo es et eu fa +-------------------------------------------------+ a2ps | [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] () | anubis | [] [] | aspell | [] [] [] [] [] | bash | [] [] [] | bfd | [] | bibshelf | [] [] [] | binutils | [] | bison | [] [] | bison-runtime | [] [] [] [] | bluez-pin | [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] [] [] | cflow | [] [] | clisp | [] [] [] [] | coreutils | [] [] [] [] | cpio | | cppi | | cpplib | [] [] [] | cryptsetup | [] | dfarc | [] [] [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] | dink | [] [] [] | doodle | [] | e2fsprogs | [] [] [] | enscript | [] [] [] | exif | () [] [] | fetchmail | [] [] () [] [] [] | findutils | [] [] [] | flex | [] [] | freedink | [] [] [] | gas | [] | gawk | [] [] [] | gcal | [] | gcc | [] [] | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] [] | gip | [] [] [] [] | gjay | [] | gliv | [] [] [] | glunarclock | [] [] | gnubiff | () | gnucash | [] () () () () | gnuedu | [] [] | gnulib | [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] | gpe-aerial | [] [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] () [] [] [] | gprof | [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] | grub | [] [] | gsasl | [] | gss | | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] () [] | gtkam | [] [] () [] [] | gtkorphan | [] [] [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | [] [] [] | hello | [] [] [] [] | help2man | [] | hylafax | [] [] | idutils | [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] [] [] [] () [] [] [] () | iso_3166_2 | () | iso_4217 | [] [] [] () [] [] | iso_639 | [] [] [] [] () [] [] | iso_639_3 | [] | jwhois | [] | kbd | [] [] [] [] [] | keytouch | [] [] | keytouch-editor | [] [] | keytouch-keyboa... | [] | klavaro | [] [] [] [] | latrine | [] () | ld | [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | [] [] | libgphoto2 | [] () | libgphoto2_port | [] () [] | libgsasl | | libiconv | [] [] [] [] [] | libidn | [] [] [] | lifelines | [] () | liferea | [] [] [] [] [] | lilypond | [] [] [] | linkdr | [] [] [] | lordsawar | [] | lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailfromd | | mailutils | [] | make | [] [] [] | man-db | | man-db-manpages | | minicom | [] [] [] [] | mkisofs | | myserver | | nano | [] [] [] | opcodes | [] [] | parted | [] [] | pies | | popt | [] [] [] [] [] | psmisc | [] [] [] | pspp | [] | pwdutils | [] | radius | [] | recode | [] [] [] [] [] [] | rosegarden | () () () | rpm | [] [] [] | rush | | sarg | | screem | | scrollkeeper | [] [] [] [] [] | sed | [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | | skencil | [] () [] | solfege | [] [] [] | solfege-manual | [] [] | soundtracker | [] [] [] | sp | [] | sysstat | [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] | tin | [] [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] | vice | () () | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] | wyslij-po | | xchat | [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] | +-------------------------------------------------+ crh cs da de el en en_GB en_ZA eo es et eu fa 5 64 105 117 18 1 8 0 28 89 18 19 0 fi fr ga gl gu he hi hr hu hy id is it ja ka kn +----------------------------------------------------+ a2ps | [] [] [] [] | aegis | [] [] | ant-phone | [] [] | anubis | [] [] [] [] | aspell | [] [] [] [] | bash | [] [] [] [] | bfd | [] [] [] | bibshelf | [] [] [] [] [] | binutils | [] [] [] | bison | [] [] [] [] | bison-runtime | [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] | cflow | [] [] [] | clisp | [] | coreutils | [] [] [] [] [] | cpio | [] [] [] [] | cppi | [] [] | cpplib | [] [] [] | cryptsetup | [] [] [] | dfarc | [] [] [] | dialog | [] [] [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] [] [] | dink | [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | exif | [] [] [] [] [] [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] | freedink | [] [] [] | gas | [] [] | gawk | [] [] [] [] () [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | gettext-tools | [] [] [] [] | gip | [] [] [] [] [] [] | gjay | [] | gliv | [] () | glunarclock | [] [] [] [] | gnubiff | () [] () | gnucash | () () () () () [] | gnuedu | [] [] | gnulib | [] [] [] [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] [] | gpe-aerial | [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] [] [] | gpe-calendar | [] [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] [] | gpe-go | [] [] [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] [] [] [] [] | gprof | [] [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] [] | grub | [] [] [] [] | gsasl | [] [] [] [] [] | gss | [] [] [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] [] [] | gtkam | [] [] [] [] [] | gtkorphan | [] [] [] | gtkspell | [] [] [] [] [] [] [] [] [] | gutenprint | [] [] [] [] | hello | [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] [] | indent | [] [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | () [] [] [] | iso_4217 | [] () [] [] [] [] | iso_639 | [] () [] [] [] [] [] [] [] | iso_639_3 | () [] [] | jwhois | [] [] [] [] [] | kbd | [] [] | keytouch | [] [] [] [] [] [] | keytouch-editor | [] [] [] [] [] | keytouch-keyboa... | [] [] [] [] [] | klavaro | [] [] | latrine | [] [] [] | ld | [] [] [] [] | leafpad | [] [] [] [] [] [] [] () | libc | [] [] [] [] [] | libexif | [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] [] | libidn | [] [] [] [] | lifelines | () | liferea | [] [] [] [] | lilypond | [] [] | linkdr | [] [] [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] [] [] | m4 | [] [] [] [] [] [] | mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] [] | man-db | [] [] | man-db-manpages | [] | minicom | [] [] [] [] [] | mkisofs | [] [] [] [] | myserver | | nano | [] [] [] [] [] [] | opcodes | [] [] [] [] | parted | [] [] [] [] | pies | | popt | [] [] [] [] [] [] [] [] [] | psmisc | [] [] [] | pspp | | pwdutils | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () () () () | rpm | [] [] | rush | | sarg | [] | screem | [] [] | scrollkeeper | [] [] [] [] | sed | [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] | shishi | [] | skencil | [] | solfege | [] [] [] [] | solfege-manual | [] [] | soundtracker | [] [] | sp | [] () | sysstat | [] [] [] [] [] | tar | [] [] [] [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux-ng | [] [] [] [] [] [] | vice | () () () | vmm | [] | vorbis-tools | [] | wastesedge | () () | wdiff | [] | wget | [] [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] | +----------------------------------------------------+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne +-----------------------------------------------+ a2ps | [] | aegis | | ant-phone | | anubis | [] [] | aspell | [] | bash | | bfd | | bibshelf | [] [] | binutils | | bison | [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] | cpio | | cppi | | cpplib | | cryptsetup | | dfarc | [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] | dink | | doodle | | e2fsprogs | | enscript | | exif | [] | fetchmail | | findutils | | flex | | freedink | [] | gas | | gawk | | gcal | | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] | gettext-tools | [] | gip | [] [] | gjay | | gliv | | glunarclock | [] | gnubiff | | gnucash | () () () () | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | [] | gold | | gpe-aerial | [] | gpe-beam | [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] | gpe-timesheet | [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | | gsasl | | gss | | gst-plugins-bad | [] [] [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | | gtick | | gtkam | [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | | hello | [] [] [] | help2man | | hylafax | | idutils | | indent | | iso_15924 | [] [] | iso_3166 | [] [] () [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] | iso_639 | [] [] | iso_639_3 | [] | jwhois | [] | kbd | | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | klavaro | [] | latrine | [] | ld | | leafpad | [] [] [] | libc | [] | libexif | | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | | libidn | | lifelines | | liferea | | lilypond | | linkdr | | lordsawar | | lprng | | lynx | | m4 | | mailfromd | | mailutils | | make | [] | man-db | | man-db-manpages | | minicom | [] | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | [] [] [] | psmisc | | pspp | | pwdutils | | radius | | recode | | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] | sed | | sharutils | | shishi | | skencil | | solfege | [] | solfege-manual | | soundtracker | | sp | | sysstat | [] | tar | [] | texinfo | [] | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] | wyslij-po | | xchat | [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +-----------------------------------------------+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +---------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] | bfd | [] | bibshelf | [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] () | buzztard | [] [] | cflow | [] | clisp | [] [] | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] | cryptsetup | [] | dfarc | [] | dialog | [] [] [] [] | dico | [] | diffutils | [] [] [] [] [] [] | dink | () | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | exif | [] [] [] () [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] [] | freedink | [] [] | gas | | gawk | [] [] [] [] | gcal | | gcc | [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | [] [] [] [] [] [] | glunarclock | [] [] [] [] [] | gnubiff | [] () | gnucash | [] () () () | gnuedu | [] | gnulib | [] [] [] [] | gnunet | | gnunet-gtk | | gnutls | [] [] | gold | | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] [] | gphoto2 | [] [] [] [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] [] | grep | [] [] [] [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] [] [] | gutenprint | [] [] | hello | [] [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] [] [] [] | iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | iso_3166_2 | [] [] [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] [] | klavaro | [] [] | latrine | [] [] | ld | | leafpad | [] [] [] [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] | libgphoto2_port | [] [] [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] | lifelines | [] [] | liferea | [] [] [] [] [] () () [] | lilypond | [] | linkdr | [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] | make | [] [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | pies | [] | popt | [] [] [] [] | psmisc | [] [] [] | pspp | [] [] | pwdutils | [] | radius | [] [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () | rpm | [] [] [] | rush | [] [] | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | skencil | [] [] | solfege | [] [] [] [] | solfege-manual | [] [] [] | soundtracker | [] | sp | | sysstat | [] [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | [] | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +---------------------------------------------------+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW +---------------------------------------------------+ a2ps | [] [] [] [] [] | 27 aegis | [] | 9 ant-phone | [] [] [] [] | 9 anubis | [] [] [] [] | 15 aspell | [] [] [] | 20 bash | [] [] [] | 12 bfd | [] | 6 bibshelf | [] [] [] | 16 binutils | [] [] | 8 bison | [] [] | 12 bison-runtime | [] [] [] [] [] [] | 29 bluez-pin | [] [] [] [] [] [] [] [] | 37 bombono-dvd | [] | 4 buzztard | [] | 7 cflow | [] [] [] | 9 clisp | | 10 coreutils | [] [] [] [] | 22 cpio | [] [] [] [] [] [] | 13 cppi | [] [] | 5 cpplib | [] [] [] [] [] [] | 14 cryptsetup | [] [] | 7 dfarc | [] | 9 dialog | [] [] [] [] [] [] [] | 30 dico | [] | 2 diffutils | [] [] [] [] [] [] | 30 dink | | 4 doodle | [] [] | 7 e2fsprogs | [] [] [] | 11 enscript | [] [] [] [] | 17 exif | [] [] [] | 16 fetchmail | [] [] [] | 17 findutils | [] [] [] [] [] | 20 flex | [] [] [] [] | 15 freedink | [] | 10 gas | [] | 4 gawk | [] [] [] [] | 18 gcal | [] [] | 5 gcc | [] [] [] | 7 gettext-examples | [] [] [] [] [] [] [] | 34 gettext-runtime | [] [] [] [] [] [] [] | 29 gettext-tools | [] [] [] [] [] [] | 22 gip | [] [] [] [] | 22 gjay | [] | 3 gliv | [] [] [] | 14 glunarclock | [] [] [] [] [] | 19 gnubiff | [] [] | 4 gnucash | () [] () [] () | 10 gnuedu | [] [] | 7 gnulib | [] [] [] [] | 16 gnunet | [] | 1 gnunet-gtk | [] [] [] | 5 gnutls | [] [] [] | 10 gold | [] | 4 gpe-aerial | [] [] [] | 18 gpe-beam | [] [] [] | 19 gpe-bluetooth | [] [] [] | 13 gpe-calendar | [] [] [] [] | 12 gpe-clock | [] [] [] [] [] | 28 gpe-conf | [] [] [] [] | 20 gpe-contacts | [] [] [] | 17 gpe-edit | [] [] [] | 12 gpe-filemanager | [] [] [] [] | 16 gpe-go | [] [] [] [] [] | 25 gpe-login | [] [] [] | 11 gpe-ownerinfo | [] [] [] [] [] | 25 gpe-package | [] [] [] | 13 gpe-sketchbook | [] [] [] | 20 gpe-su | [] [] [] [] [] | 30 gpe-taskmanager | [] [] [] [] [] | 29 gpe-timesheet | [] [] [] [] [] | 25 gpe-today | [] [] [] [] [] [] | 30 gpe-todo | [] [] [] [] | 17 gphoto2 | [] [] [] [] [] | 24 gprof | [] [] [] | 15 gpsdrive | [] [] [] | 11 gramadoir | [] [] [] | 11 grep | [] [] [] | 10 grub | [] [] [] | 14 gsasl | [] [] [] [] | 14 gss | [] [] [] | 11 gst-plugins-bad | [] [] [] [] | 26 gst-plugins-base | [] [] [] [] [] | 24 gst-plugins-good | [] [] [] [] | 24 gst-plugins-ugly | [] [] [] [] [] | 29 gstreamer | [] [] [] [] | 22 gtick | [] [] [] | 13 gtkam | [] [] [] | 20 gtkorphan | [] [] [] | 14 gtkspell | [] [] [] [] [] [] [] [] [] | 45 gutenprint | [] | 10 hello | [] [] [] [] [] [] | 21 help2man | [] [] | 7 hylafax | [] | 5 idutils | [] [] [] [] | 17 indent | [] [] [] [] [] [] | 30 iso_15924 | () [] () [] [] | 16 iso_3166 | [] [] () [] [] () [] [] [] () | 53 iso_3166_2 | () [] () [] | 9 iso_4217 | [] () [] [] () [] [] | 26 iso_639 | [] [] [] () [] () [] [] [] [] | 38 iso_639_3 | [] () | 8 jwhois | [] [] [] [] [] | 16 kbd | [] [] [] [] [] | 15 keytouch | [] [] [] | 16 keytouch-editor | [] [] [] | 14 keytouch-keyboa... | [] [] [] | 14 klavaro | [] | 11 latrine | [] [] [] | 10 ld | [] [] [] [] | 11 leafpad | [] [] [] [] [] [] | 33 libc | [] [] [] [] [] | 21 libexif | [] () | 7 libextractor | [] | 1 libgnutls | [] [] [] | 9 libgpewidget | [] [] [] | 14 libgpg-error | [] [] [] | 9 libgphoto2 | [] [] | 8 libgphoto2_port | [] [] [] [] | 14 libgsasl | [] [] [] | 13 libiconv | [] [] [] [] | 21 libidn | () [] [] | 11 lifelines | [] | 4 liferea | [] [] [] | 21 lilypond | [] | 7 linkdr | [] [] [] [] [] | 17 lordsawar | | 1 lprng | [] | 3 lynx | [] [] [] [] | 17 m4 | [] [] [] [] | 19 mailfromd | [] [] | 3 mailutils | [] | 5 make | [] [] [] [] | 21 man-db | [] [] [] | 8 man-db-manpages | | 4 minicom | [] [] | 16 mkisofs | [] [] | 9 myserver | | 0 nano | [] [] [] [] | 21 opcodes | [] [] [] | 11 parted | [] [] [] [] [] | 15 pies | [] [] | 3 popt | [] [] [] [] [] [] | 27 psmisc | [] [] | 11 pspp | | 4 pwdutils | [] [] | 6 radius | [] [] | 9 recode | [] [] [] [] | 28 rosegarden | () | 0 rpm | [] [] [] | 11 rush | [] [] | 4 sarg | | 1 screem | [] | 3 scrollkeeper | [] [] [] [] [] | 27 sed | [] [] [] [] [] | 30 sharutils | [] [] [] [] [] | 22 shishi | [] | 3 skencil | [] [] | 7 solfege | [] [] [] [] | 16 solfege-manual | [] | 8 soundtracker | [] [] [] | 9 sp | [] | 3 sysstat | [] [] | 15 tar | [] [] [] [] [] [] | 23 texinfo | [] [] [] [] [] | 17 tin | | 4 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux-ng | [] [] [] [] | 20 vice | () () | 1 vmm | [] | 4 vorbis-tools | [] | 6 wastesedge | | 2 wdiff | [] [] | 7 wget | [] [] [] [] [] | 26 wyslij-po | [] [] | 8 xchat | [] [] [] [] [] [] | 36 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 xkeyboard-config | [] [] [] | 22 +---------------------------------------------------+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If June 2010 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. 1.5 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `coordinator@translationproject.org' to make the `.pot' files available to the translation teams. p11-kit-0.20.2/p11-kit/0000775000175000017500000000000012265245672011165 500000000000000p11-kit-0.20.2/p11-kit/lists.c0000664000175000017500000001705112226763526012413 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include "debug.h" #include #include #include #include #include #include #include "message.h" #include "p11-kit.h" #include "tool.h" #include "uri.h" int p11_kit_list_modules (int argc, char *argv[]); bool verbose = false; static const char HEXC_LOWER[] = "0123456789abcdef"; static char * hex_encode (const unsigned char *data, size_t n_data) { char *result; size_t i; size_t o; result = malloc (n_data * 3 + 1); if (result == NULL) return NULL; for (i = 0, o = 0; i < n_data; i++) { if (i > 0) result[o++] = ':'; result[o++] = HEXC_LOWER[data[i] >> 4 & 0xf]; result[o++] = HEXC_LOWER[data[i] & 0xf]; } result[o] = 0; return result; } static bool is_ascii_string (const unsigned char *data, size_t n_data) { size_t i; for (i = 0; i < n_data; i++) { if (!isascii (data[i]) && (data[i] < 0x20 && !isspace (data[i]))) return false; } return true; } static void print_token_info (CK_FUNCTION_LIST_PTR module, CK_SLOT_ID slot_id) { CK_TOKEN_INFO info; char *value; CK_RV rv; rv = (module->C_GetTokenInfo) (slot_id, &info); if (rv != CKR_OK) { p11_message ("couldn't load module info: %s", p11_kit_strerror (rv)); return; } value = p11_kit_space_strdup (info.label, sizeof (info.label)); printf (" token: %s\n", value); free (value); value = p11_kit_space_strdup (info.manufacturerID, sizeof (info.manufacturerID)); printf (" manufacturer: %s\n", value); free (value); value = p11_kit_space_strdup (info.model, sizeof (info.model)); printf (" model: %s\n", value); free (value); if (is_ascii_string (info.serialNumber, sizeof (info.serialNumber))) value = p11_kit_space_strdup (info.serialNumber, sizeof (info.serialNumber)); else value = hex_encode (info.serialNumber, sizeof (info.serialNumber)); printf (" serial-number: %s\n", value); free (value); if (info.hardwareVersion.major || info.hardwareVersion.minor) printf (" hardware-version: %d.%d\n", info.hardwareVersion.major, info.hardwareVersion.minor); if (info.firmwareVersion.major || info.firmwareVersion.minor) printf (" firmware-version: %d.%d\n", info.firmwareVersion.major, info.firmwareVersion.minor); printf (" flags:\n"); #define X(x, y) if (info.flags & (x)) printf (" %s\n", (y)) X(CKF_RNG, "rng"); X(CKF_WRITE_PROTECTED, "write-protected"); X(CKF_LOGIN_REQUIRED, "login-required"); X(CKF_USER_PIN_INITIALIZED, "user-pin-initialized"); X(CKF_RESTORE_KEY_NOT_NEEDED, "restore-key-not-needed"); X(CKF_CLOCK_ON_TOKEN, "clock-on-token"); X(CKF_PROTECTED_AUTHENTICATION_PATH, "protected-authentication-path"); X(CKF_DUAL_CRYPTO_OPERATIONS, "dual-crypto-operations"); X(CKF_TOKEN_INITIALIZED, "token-initialized"); X(CKF_SECONDARY_AUTHENTICATION, "secondary-authentication"); X(CKF_USER_PIN_COUNT_LOW, "user-pin-count-low"); X(CKF_USER_PIN_FINAL_TRY, "user-pin-final-try"); X(CKF_USER_PIN_LOCKED, "user-pin-locked"); X(CKF_USER_PIN_TO_BE_CHANGED, "user-pin-to-be-changed"); X(CKF_SO_PIN_COUNT_LOW, "so-pin-count-low"); X(CKF_SO_PIN_FINAL_TRY, "so-pin-final-try"); X(CKF_SO_PIN_LOCKED, "so-pin-locked"); X(CKF_SO_PIN_TO_BE_CHANGED, "so-pin-to-be-changed"); #undef X } static void print_module_info (CK_FUNCTION_LIST_PTR module) { CK_SLOT_ID slot_list[256]; CK_ULONG i, count; CK_INFO info; char *value; CK_RV rv; rv = (module->C_GetInfo) (&info); if (rv != CKR_OK) { p11_message ("couldn't load module info: %s", p11_kit_strerror (rv)); return; } value = p11_kit_space_strdup (info.libraryDescription, sizeof (info.libraryDescription)); printf (" library-description: %s\n", value); free (value); value = p11_kit_space_strdup (info.manufacturerID, sizeof (info.manufacturerID)); printf (" library-manufacturer: %s\n", value); free (value); printf (" library-version: %d.%d\n", info.libraryVersion.major, info.libraryVersion.minor); count = sizeof (slot_list) / sizeof (slot_list[0]); rv = (module->C_GetSlotList) (CK_TRUE, slot_list, &count); if (rv != CKR_OK) { p11_message ("couldn't load module info: %s", p11_kit_strerror (rv)); return; } for (i = 0; i < count; i++) print_token_info (module, slot_list[i]); } static int print_modules (void) { CK_FUNCTION_LIST_PTR *module_list; char *name; char *path; int i; module_list = p11_kit_modules_load_and_initialize (0); if (!module_list) return 1; for (i = 0; module_list[i]; i++) { name = p11_kit_module_get_name (module_list[i]); path = p11_kit_config_option (module_list[i], "module"); printf ("%s: %s\n", name ? name : "(null)", path ? path : "(null)"); print_module_info (module_list[i]); free (name); free (path); } p11_kit_modules_finalize_and_release (module_list); return 0; } int p11_kit_list_modules (int argc, char *argv[]) { int opt; enum { opt_verbose = 'v', opt_quiet = 'q', opt_list = 'l', opt_help = 'h', }; struct option options[] = { { "verbose", no_argument, NULL, opt_verbose }, { "quiet", no_argument, NULL, opt_quiet }, { "list", no_argument, NULL, opt_list }, { "help", no_argument, NULL, opt_help }, { 0 }, }; p11_tool_desc usages[] = { { 0, "usage: p11-kit list" }, { opt_verbose, "show verbose debug output", }, { opt_quiet, "supress command output", }, { 0 }, }; while ((opt = p11_tool_getopt (argc, argv, options)) != -1) { switch (opt) { case opt_verbose: p11_kit_be_loud (); break; case opt_quiet: p11_kit_be_quiet (); break; case opt_list: break; case opt_help: p11_tool_usage (usages, options); return 0; case '?': return 2; default: assert_not_reached (); break; } } argc -= optind; argv += optind; if (argc != 0) { p11_message ("extra arguments specified"); return 2; } return print_modules (); } p11-kit-0.20.2/p11-kit/iter.h0000664000175000017500000001162212265017050012206 00000000000000/* * Copyright (c) 2013 Red Hat, Inc * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_KIT_ITER_H #define P11_KIT_ITER_H #include "p11-kit/p11-kit.h" #include "p11-kit/pkcs11.h" #include "p11-kit/uri.h" #ifdef __cplusplus extern "C" { #endif #ifdef P11_KIT_FUTURE_UNSTABLE_API typedef struct p11_kit_iter P11KitIter; typedef P11KitIter p11_kit_iter; typedef enum { P11_KIT_ITER_BUSY_SESSIONS = 1 << 1, P11_KIT_ITER_WANT_WRITABLE = 1 << 2, } P11KitIterBehavior; typedef CK_RV (* p11_kit_iter_callback) (P11KitIter *iter, CK_BBOOL *matches, void *data); P11KitIter * p11_kit_iter_new (P11KitUri *uri, P11KitIterBehavior behavior); void p11_kit_iter_free (P11KitIter *iter); void p11_kit_iter_add_callback (P11KitIter *iter, p11_kit_iter_callback callback, void *callback_data, p11_kit_destroyer callback_destroy); void p11_kit_iter_add_filter (P11KitIter *iter, CK_ATTRIBUTE *matching, CK_ULONG count); void p11_kit_iter_set_uri (P11KitIter *iter, P11KitUri *uri); void p11_kit_iter_begin (P11KitIter *iter, CK_FUNCTION_LIST_PTR *modules); void p11_kit_iter_begin_with (P11KitIter *iter, CK_FUNCTION_LIST_PTR module, CK_SLOT_ID slot, CK_SESSION_HANDLE session); CK_RV p11_kit_iter_next (P11KitIter *iter); CK_FUNCTION_LIST_PTR p11_kit_iter_get_module (P11KitIter *iter); CK_SLOT_ID p11_kit_iter_get_slot (P11KitIter *iter); CK_TOKEN_INFO * p11_kit_iter_get_token (P11KitIter *iter); CK_SESSION_HANDLE p11_kit_iter_get_session (P11KitIter *iter); CK_OBJECT_HANDLE p11_kit_iter_get_object (P11KitIter *iter); CK_RV p11_kit_iter_get_attributes (P11KitIter *iter, CK_ATTRIBUTE *template, CK_ULONG count); CK_RV p11_kit_iter_load_attributes (P11KitIter *iter, CK_ATTRIBUTE *template, CK_ULONG count); CK_SESSION_HANDLE p11_kit_iter_keep_session (P11KitIter *iter); CK_RV p11_kit_iter_destroy_object (P11KitIter *iter); #endif /* P11_KIT_FUTURE_UNSTABLE_API */ #ifdef __cplusplus } /* extern "C" */ #endif #endif /* P11_KIT_ITER_H */ p11-kit-0.20.2/p11-kit/messages.c0000664000175000017500000002120712226763526013062 00000000000000/* * Copyright (C) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "pkcs11.h" #include "p11-kit.h" /** * SECTION:p11-kit-util * @title: Utilities * @short_description: PKCS\#11 utilities * * Utility functions for working with PKCS\#11. */ #ifdef ENABLE_NLS #include #define _(x) dgettext(PACKAGE_NAME, x) #else #define _(x) x #endif /** * p11_kit_strerror: * @rv: The code to get a message for. * * Get a message for a PKCS\#11 return value or error code. Do not * pass CKR_OK or other such non errors to this function. * * Returns: The user readable and localized message. **/ const char* p11_kit_strerror (CK_RV rv) { switch (rv) { /* These are not really errors, or not current */ case CKR_OK: case CKR_NO_EVENT: case CKR_FUNCTION_NOT_PARALLEL: case CKR_SESSION_PARALLEL_NOT_SUPPORTED: return ""; case CKR_CANCEL: case CKR_FUNCTION_CANCELED: return _("The operation was cancelled"); case CKR_HOST_MEMORY: return _("Insufficient memory available"); case CKR_SLOT_ID_INVALID: return _("The specified slot ID is not valid"); case CKR_GENERAL_ERROR: return _("Internal error"); case CKR_FUNCTION_FAILED: return _("The operation failed"); case CKR_ARGUMENTS_BAD: return _("Invalid arguments"); case CKR_NEED_TO_CREATE_THREADS: return _("The module cannot create needed threads"); case CKR_CANT_LOCK: return _("The module cannot lock data properly"); case CKR_ATTRIBUTE_READ_ONLY: return _("The field is read-only"); case CKR_ATTRIBUTE_SENSITIVE: return _("The field is sensitive and cannot be revealed"); case CKR_ATTRIBUTE_TYPE_INVALID: return _("The field is invalid or does not exist"); case CKR_ATTRIBUTE_VALUE_INVALID: return _("Invalid value for field"); case CKR_DATA_INVALID: return _("The data is not valid or unrecognized"); case CKR_DATA_LEN_RANGE: return _("The data is too long"); case CKR_DEVICE_ERROR: return _("An error occurred on the device"); case CKR_DEVICE_MEMORY: return _("Insufficient memory available on the device"); case CKR_DEVICE_REMOVED: return _("The device was removed or unplugged"); case CKR_ENCRYPTED_DATA_INVALID: return _("The encrypted data is not valid or unrecognized"); case CKR_ENCRYPTED_DATA_LEN_RANGE: return _("The encrypted data is too long"); case CKR_FUNCTION_NOT_SUPPORTED: return _("This operation is not supported"); case CKR_KEY_HANDLE_INVALID: return _("The key is missing or invalid"); case CKR_KEY_SIZE_RANGE: return _("The key is the wrong size"); case CKR_KEY_TYPE_INCONSISTENT: return _("The key is of the wrong type"); case CKR_KEY_NOT_NEEDED: return _("No key is needed"); case CKR_KEY_CHANGED: return _("The key is different than before"); case CKR_KEY_NEEDED: return _("A key is needed"); case CKR_KEY_INDIGESTIBLE: return _("Cannot include the key in the digest"); case CKR_KEY_FUNCTION_NOT_PERMITTED: return _("This operation cannot be done with this key"); case CKR_KEY_NOT_WRAPPABLE: return _("The key cannot be wrapped"); case CKR_KEY_UNEXTRACTABLE: return _("Cannot export this key"); case CKR_MECHANISM_INVALID: return _("The crypto mechanism is invalid or unrecognized"); case CKR_MECHANISM_PARAM_INVALID: return _("The crypto mechanism has an invalid argument"); case CKR_OBJECT_HANDLE_INVALID: return _("The object is missing or invalid"); case CKR_OPERATION_ACTIVE: return _("Another operation is already taking place"); case CKR_OPERATION_NOT_INITIALIZED: return _("No operation is taking place"); case CKR_PIN_INCORRECT: return _("The password or PIN is incorrect"); case CKR_PIN_INVALID: return _("The password or PIN is invalid"); case CKR_PIN_LEN_RANGE: return _("The password or PIN is of an invalid length"); case CKR_PIN_EXPIRED: return _("The password or PIN has expired"); case CKR_PIN_LOCKED: return _("The password or PIN is locked"); case CKR_SESSION_CLOSED: return _("The session is closed"); case CKR_SESSION_COUNT: return _("Too many sessions are active"); case CKR_SESSION_HANDLE_INVALID: return _("The session is invalid"); case CKR_SESSION_READ_ONLY: return _("The session is read-only"); case CKR_SESSION_EXISTS: return _("An open session exists"); case CKR_SESSION_READ_ONLY_EXISTS: return _("A read-only session exists"); case CKR_SESSION_READ_WRITE_SO_EXISTS: return _("An administrator session exists"); case CKR_SIGNATURE_INVALID: return _("The signature is bad or corrupted"); case CKR_SIGNATURE_LEN_RANGE: return _("The signature is unrecognized or corrupted"); case CKR_TEMPLATE_INCOMPLETE: return _("Certain required fields are missing"); case CKR_TEMPLATE_INCONSISTENT: return _("Certain fields have invalid values"); case CKR_TOKEN_NOT_PRESENT: return _("The device is not present or unplugged"); case CKR_TOKEN_NOT_RECOGNIZED: return _("The device is invalid or unrecognizable"); case CKR_TOKEN_WRITE_PROTECTED: return _("The device is write protected"); case CKR_UNWRAPPING_KEY_HANDLE_INVALID: return _("Cannot import because the key is invalid"); case CKR_UNWRAPPING_KEY_SIZE_RANGE: return _("Cannot import because the key is of the wrong size"); case CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT: return _("Cannot import because the key is of the wrong type"); case CKR_USER_ALREADY_LOGGED_IN: return _("You are already logged in"); case CKR_USER_NOT_LOGGED_IN: return _("No user has logged in"); case CKR_USER_PIN_NOT_INITIALIZED: return _("The user's password or PIN is not set"); case CKR_USER_TYPE_INVALID: return _("The user is of an invalid type"); case CKR_USER_ANOTHER_ALREADY_LOGGED_IN: return _("Another user is already logged in"); case CKR_USER_TOO_MANY_TYPES: return _("Too many users of different types are logged in"); case CKR_WRAPPED_KEY_INVALID: return _("Cannot import an invalid key"); case CKR_WRAPPED_KEY_LEN_RANGE: return _("Cannot import a key of the wrong size"); case CKR_WRAPPING_KEY_HANDLE_INVALID: return _("Cannot export because the key is invalid"); case CKR_WRAPPING_KEY_SIZE_RANGE: return _("Cannot export because the key is of the wrong size"); case CKR_WRAPPING_KEY_TYPE_INCONSISTENT: return _("Cannot export because the key is of the wrong type"); case CKR_RANDOM_SEED_NOT_SUPPORTED: return _("Unable to initialize the random number generator"); case CKR_RANDOM_NO_RNG: return _("No random number generator available"); case CKR_DOMAIN_PARAMS_INVALID: return _("The crypto mechanism has an invalid parameter"); case CKR_BUFFER_TOO_SMALL: return _("Not enough space to store the result"); case CKR_SAVED_STATE_INVALID: return _("The saved state is invalid"); case CKR_INFORMATION_SENSITIVE: return _("The information is sensitive and cannot be revealed"); case CKR_STATE_UNSAVEABLE: return _("The state cannot be saved"); case CKR_CRYPTOKI_NOT_INITIALIZED: return _("The module has not been initialized"); case CKR_CRYPTOKI_ALREADY_INITIALIZED: return _("The module has already been initialized"); case CKR_MUTEX_BAD: return _("Cannot lock data"); case CKR_MUTEX_NOT_LOCKED: return _("The data cannot be locked"); case CKR_FUNCTION_REJECTED: return _("The request was rejected by the user"); default: return _("Unknown error"); } } p11-kit-0.20.2/p11-kit/iter.c0000664000175000017500000006204412265017050012205 00000000000000/* * Copyright (C) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "array.h" #include "attrs.h" #include "debug.h" #include "iter.h" #include "pin.h" #include "private.h" #include #include #include typedef struct _Callback { p11_kit_iter_callback func; void *callback_data; p11_kit_destroyer destroyer; struct _Callback *next; } Callback; /** * P11KitIter: * * Used to iterate over PKCS\#11 objects. */ struct p11_kit_iter { /* Iterator matching data */ CK_INFO match_module; CK_TOKEN_INFO match_token; CK_ATTRIBUTE *match_attrs; Callback *callbacks; /* The input modules */ p11_array *modules; /* The results of C_GetSlotList */ CK_SLOT_ID *slots; CK_ULONG num_slots; CK_ULONG saw_slots; /* The results of C_FindObjects */ CK_OBJECT_HANDLE *objects; CK_ULONG max_objects; CK_ULONG num_objects; CK_ULONG saw_objects; /* The current iteration */ CK_FUNCTION_LIST_PTR module; CK_SLOT_ID slot; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE object; CK_TOKEN_INFO token_info; /* And various flags */ unsigned int searching : 1; unsigned int searched : 1; unsigned int iterating : 1; unsigned int match_nothing : 1; unsigned int keep_session : 1; unsigned int preload_results : 1; unsigned int want_writable : 1; }; /** * P11KitIterBehavior: * @P11_KIT_ITER_BUSY_SESSIONS: Allow the iterator's sessions to be * in a busy state when the iterator returns an object. * @P11_KIT_ITER_WANT_WRITABLE: Try to open read-write sessions when * iterating over obojects. * * Various flags controling the behavior of the iterator. */ /** * p11_kit_iter_new: * @uri: (allow-none): a PKCS\#11 URI to filter on, or %NULL * @behavior: various behavior flags for iterator * * Create a new PKCS\#11 iterator for iterating over objects. Only * objects that match the @uri will be returned by the iterator. * Relevant information in @uri is copied, and you need not keep * @uri around. * * If no @uri is specified then the iterator will iterate over all * objects, unless otherwise filtered. * * Returns: (transfer full): a new iterator, which should be freed * with p11_kit_iter_free() */ P11KitIter * p11_kit_iter_new (P11KitUri *uri, P11KitIterBehavior behavior) { P11KitIter *iter; iter = calloc (1, sizeof (P11KitIter)); return_val_if_fail (iter != NULL, NULL); iter->modules = p11_array_new (NULL); return_val_if_fail (iter->modules != NULL, NULL); iter->want_writable = !!(behavior & P11_KIT_ITER_WANT_WRITABLE); iter->preload_results = !(behavior & P11_KIT_ITER_BUSY_SESSIONS); p11_kit_iter_set_uri (iter, uri); return iter; } /** * p11_kit_iter_set_uri: * @iter: the iterator * @uri: (allow-none): a PKCS\#11 URI to filter on, or %NULL * * Set the PKCS\#11 uri for iterator. Only * objects that match the @uri will be returned by the iterator. * Relevant information in @uri is copied, and you need not keep * @uri around. * * If no @uri is specified then the iterator will iterate over all * objects, unless otherwise filtered. * * This function should be called at most once, and should be * called before iterating begins. * */ void p11_kit_iter_set_uri (P11KitIter *iter, P11KitUri *uri) { CK_ATTRIBUTE *attrs; CK_TOKEN_INFO *tinfo; CK_INFO *minfo; CK_ULONG count; return_if_fail (iter != NULL); if (uri != NULL) { if (p11_kit_uri_any_unrecognized (uri)) { iter->match_nothing = 1; } else { attrs = p11_kit_uri_get_attributes (uri, &count); iter->match_attrs = p11_attrs_buildn (NULL, attrs, count); minfo = p11_kit_uri_get_module_info (uri); if (minfo != NULL) memcpy (&iter->match_module, minfo, sizeof (CK_INFO)); tinfo = p11_kit_uri_get_token_info (uri); if (tinfo != NULL) memcpy (&iter->match_token, tinfo, sizeof (CK_TOKEN_INFO)); } } else { /* Match any module version number*/ memset (&iter->match_module, 0, sizeof (iter->match_module)); iter->match_module.libraryVersion.major = (CK_BYTE)-1; iter->match_module.libraryVersion.minor = (CK_BYTE)-1; } } /** * p11_kit_destroyer: * @data: data to destroy * * A callback called to free a resource. */ /** * p11_kit_iter_callback: * @iter: the iterator * @matches: (out): whether to match the current object * @data: callback data * * A callback setup with p11_kit_iter_add_callback(). This callback is * called for each object iterated. * * If the callback sets @matches to CK_FALSE, then this object is * skipped and not matched by p11_kit_iter_next(). If you return * anything but CKR_OK, then the iteration is stopped, and * p11_kit_iter_next() returns the result code. * * Returns: CKR_OK to continue iterating, CKR_CANCEL to stop, or * anything else to fail */ /** * p11_kit_iter_add_callback: * @iter: the iterator * @callback: a function to call for each iteration * @callback_data: (allow-none): data to pass to the function * @callback_destroy: (allow-none): used to cleanup the data * * Adds a callback to the iterator which will be called each time * that an object is iterated. * * These callbacks can also perform filtering. If any callback * indicates through it's matches argument that * the object should not match, then that object will not be iterated * as far as p11_kit_iter_next() is concerned. * * The callbacks will be called with the matches * set to CK_TRUE and it's up to filters to change * it to CK_FALSE when necessary. */ void p11_kit_iter_add_callback (P11KitIter *iter, p11_kit_iter_callback callback, void *callback_data, p11_kit_destroyer callback_destroy) { Callback *cb; return_if_fail (iter != NULL); return_if_fail (callback != NULL); cb = calloc (1, sizeof (Callback)); return_if_fail (cb != NULL); cb->func = callback; cb->destroyer = callback_destroy; cb->callback_data = callback_data; cb->next = iter->callbacks; iter->callbacks = cb; } /** * p11_kit_iter_add_filter: * @iter: the iterator * @matching: (array length=count): the attributes that the objects should match * @count: the number of attributes * * Add a filter to limit the objects that the iterator iterates over. * * Only objects matching the passed in attributes will be iterated. * This function can be called multiple times. * * The @matching attributes are copied. */ void p11_kit_iter_add_filter (P11KitIter *iter, CK_ATTRIBUTE *matching, CK_ULONG count) { return_if_fail (iter != NULL); return_if_fail (!iter->iterating); iter->match_attrs = p11_attrs_buildn (iter->match_attrs, matching, count); return_if_fail (iter->match_attrs != NULL); } static void finish_object (P11KitIter *iter) { iter->object = 0; } static void finish_slot (P11KitIter *iter) { if (iter->session && !iter->keep_session) { assert (iter->module != NULL); (iter->module->C_CloseSession) (iter->session); } iter->keep_session = 0; iter->session = 0; iter->searched = 0; iter->searching = 0; iter->slot = 0; } static void finish_module (P11KitIter *iter) { iter->num_slots = 0; iter->saw_slots = 0; iter->module = NULL; } static CK_RV finish_iterating (P11KitIter *iter, CK_RV rv) { finish_object (iter); finish_slot (iter); finish_module (iter); p11_array_clear (iter->modules); iter->iterating = 0; return rv; } /** * p11_kit_iter_begin: * @iter: the iterator * @modules: (array zero-terminated=1): null-terminated list of * modules to iterate over * * Begin iterating PKCS\#11 objects in the given @modules. * * The @modules arguments should be a null-terminated list of * pointers to the modules' PKCS\#11 function pointers. * * For each module, all initialized slots will be iterated over, * having sessions opened for each of them in turn, and searched * for objects matching the search criteria. */ void p11_kit_iter_begin (P11KitIter *iter, CK_FUNCTION_LIST_PTR *modules) { int i; return_if_fail (modules != NULL); finish_iterating (iter, CKR_OK); /* Use this module */ for (i = 0; modules[i] != NULL; i++) { if (!p11_array_push (iter->modules, modules[i])) return_if_reached (); } iter->iterating = 1; iter->searched = 1; } /** * p11_kit_iter_begin_with: * @iter: the iterator * @module: the module to iterate over * @slot: (allow-none): the slot to iterate objects in, or zero * @session: (allow-none): the session to search for objects on, or zero * * Begin iterating PKCS\#11 objects in the given @module. * * If @slot is non-zero then the iteration will be limited to that * slot. * * If @session is non-zero then the iteration will be limited to * objects visible through that session, which implies that they * are also limited to the slot which the session was opened for. */ void p11_kit_iter_begin_with (P11KitIter *iter, CK_FUNCTION_LIST_PTR module, CK_SLOT_ID slot, CK_SESSION_HANDLE session) { CK_SESSION_INFO info; CK_RV rv; finish_iterating (iter, CKR_OK); return_if_fail (module != NULL); if (session != 0) { /* * A currently active session. Initialize as if we're ready * to search using this session. */ /* If we have a session, but no slot, then look it up */ if (slot == 0) { assert (module != NULL); rv = (module->C_GetSessionInfo) (session, &info); if (rv == CKR_OK) slot = info.slotID; } /* So initialize as if we're ready to search */ iter->session = session; iter->slot = slot; iter->module = module; iter->keep_session = 1; } else if (slot != 0) { /* * Limit to this slot. Initialize as if we're ready to use the * slot from the slots list. */ iter->module = module; iter->slots = realloc (iter->slots, sizeof (CK_SLOT_ID)); return_if_fail (iter->slots != NULL); iter->slots[0] = slot; iter->num_slots = 1; iter->searched = 1; } else { /* * Limit to this module. Initialize as if we're ready to use * the module from the modules array. */ assert (module != NULL); p11_array_push (iter->modules, module); iter->session = 0; iter->slot = 0; iter->searched = 1; } iter->iterating = 1; } static CK_RV call_all_filters (P11KitIter *iter, CK_BBOOL *matches) { Callback *cb; CK_RV rv; *matches = CK_TRUE; for (cb = iter->callbacks; cb != NULL; cb = cb->next) { rv = (cb->func) (iter, matches, cb->callback_data); if (rv != CKR_OK || !*matches) return rv; } return CKR_OK; } static CK_RV move_next_session (P11KitIter *iter) { CK_ULONG session_flags; CK_ULONG num_slots; CK_INFO minfo; CK_RV rv; finish_slot (iter); /* If we have no more slots, then move to next module */ while (iter->saw_slots >= iter->num_slots) { finish_module (iter); /* Iter is finished */ if (iter->modules->num == 0) return finish_iterating (iter, CKR_CANCEL); iter->module = iter->modules->elem[0]; p11_array_remove (iter->modules, 0); /* Skip module if it doesn't match uri */ assert (iter->module != NULL); rv = (iter->module->C_GetInfo) (&minfo); if (rv != CKR_OK || !p11_match_uri_module_info (&iter->match_module, &minfo)) continue; rv = (iter->module->C_GetSlotList) (CK_TRUE, NULL, &num_slots); if (rv != CKR_OK) return finish_iterating (iter, rv); iter->slots = realloc (iter->slots, sizeof (CK_SLOT_ID) * (num_slots + 1)); return_val_if_fail (iter->slots != NULL, CKR_HOST_MEMORY); rv = (iter->module->C_GetSlotList) (CK_TRUE, iter->slots, &num_slots); if (rv != CKR_OK) return finish_iterating (iter, rv); iter->num_slots = num_slots; assert (iter->saw_slots == 0); } /* Move to the next slot, and open a session on it */ while (iter->saw_slots < iter->num_slots) { iter->slot = iter->slots[iter->saw_slots++]; assert (iter->module != NULL); rv = (iter->module->C_GetTokenInfo) (iter->slot, &iter->token_info); if (rv != CKR_OK || !p11_match_uri_token_info (&iter->match_token, &iter->token_info)) continue; session_flags = CKF_SERIAL_SESSION; /* Skip if the read/write on a read-only token */ if (iter->want_writable && (iter->token_info.flags & CKF_WRITE_PROTECTED) == 0) session_flags |= CKF_RW_SESSION; rv = (iter->module->C_OpenSession) (iter->slot, session_flags, NULL, NULL, &iter->session); if (rv != CKR_OK) return finish_iterating (iter, rv); if (iter->session != 0) return CKR_OK; } /* Otherwise try again */ return move_next_session (iter); } /** * p11_kit_iter_next: * @iter: the iterator * * Iterate to the next matching object. * * To access the object, session and so on, use the p11_kit_iter_get_object(), * p11_kit_iter_get_session(), and p11_kit_iter_get_module() functions. * * This call must only be called after either p11_kit_iter_begin() * or p11_kit_iter_begin_with() have been called. * * Objects which are skipped by callbacks will not be returned here * as matching objects. * * Returns: CKR_OK if an object matched, CKR_CANCEL if no more objects, or another error */ CK_RV p11_kit_iter_next (P11KitIter *iter) { CK_ULONG batch; CK_ULONG count; CK_BBOOL matches; CK_RV rv; return_val_if_fail (iter->iterating, CKR_OPERATION_NOT_INITIALIZED); iter->object = 0; if (iter->match_nothing) return finish_iterating (iter, CKR_CANCEL); /* * If we have outstanding objects, then iterate one through those * Note that we pass each object through the filters, and only * assume it's iterated if it matches */ while (iter->saw_objects < iter->num_objects) { iter->object = iter->objects[iter->saw_objects++]; rv = call_all_filters (iter, &matches); if (rv != CKR_OK) return finish_iterating (iter, rv); if (matches) return CKR_OK; } /* If we have finished searching then move to next session */ if (iter->searched) { rv = move_next_session (iter); if (rv != CKR_OK) return finish_iterating (iter, rv); } /* Ready to start searching */ if (!iter->searching && !iter->searched) { count = p11_attrs_count (iter->match_attrs); rv = (iter->module->C_FindObjectsInit) (iter->session, iter->match_attrs, count); if (rv != CKR_OK) return finish_iterating (iter, rv); iter->searching = 1; iter->searched = 0; } /* If we have searched on this session then try to continue */ if (iter->searching) { assert (iter->module != NULL); assert (iter->session != 0); iter->num_objects = 0; iter->saw_objects = 0; for (;;) { if (iter->max_objects - iter->num_objects == 0) { iter->max_objects = iter->max_objects ? iter->max_objects * 2 : 64; iter->objects = realloc (iter->objects, iter->max_objects * sizeof (CK_ULONG)); return_val_if_fail (iter->objects != NULL, CKR_HOST_MEMORY); } batch = iter->max_objects - iter->num_objects; rv = (iter->module->C_FindObjects) (iter->session, iter->objects + iter->num_objects, batch, &count); if (rv != CKR_OK) return finish_iterating (iter, rv); iter->num_objects += count; /* * Done searching on this session, although there are still * objects outstanding, which will be returned on next * iterations. */ if (batch != count) { iter->searching = 0; iter->searched = 1; (iter->module->C_FindObjectsFinal) (iter->session); break; } if (!iter->preload_results) break; } } /* Try again */ return p11_kit_iter_next (iter); } /** * p11_kit_iter_get_module: * @iter: the iterator * * Get the module function pointers for the current matching object. * * This can only be called after p11_kit_iter_next() succeeds. * * Returns: the module which the current matching object is in */ CK_FUNCTION_LIST_PTR p11_kit_iter_get_module (P11KitIter *iter) { return_val_if_fail (iter != NULL, NULL); return_val_if_fail (iter->iterating, 0); return iter->module; } /** * p11_kit_iter_get_slot: * @iter: the iterator * * Get the slot which the current matching object is on. * * This can only be called after p11_kit_iter_next() succeeds. * * Returns: the slot of the current matching object */ CK_SLOT_ID p11_kit_iter_get_slot (P11KitIter *iter) { return_val_if_fail (iter != NULL, 0); return_val_if_fail (iter->iterating, 0); return iter->slot; } /** * p11_kit_iter_get_token: * @iter: the iterator * * Get the token info for the token which the current matching object is on. * * This can only be called after p11_kit_iter_next(0 succeeds. * * Returns: the slot of the current matching object. */ CK_TOKEN_INFO * p11_kit_iter_get_token (P11KitIter *iter) { return_val_if_fail (iter != NULL, NULL); return &iter->token_info; } /** * p11_kit_iter_get_session: * @iter: the iterator * * Get the session which the current matching object is acessible * through. * * This can only be called after p11_kit_iter_next() succeeds. * * The session may be closed after the next p11_kit_iter_next() call * unless p11_kit_iter_keep_session() is called. * * Returns: the session used to find the current matching object */ CK_SESSION_HANDLE p11_kit_iter_get_session (P11KitIter *iter) { return_val_if_fail (iter != NULL, 0); return_val_if_fail (iter->iterating, 0); return iter->session; } /** * p11_kit_iter_get_object: * @iter: the iterator * * Get the current matching object. * * This can only be called after p11_kit_iter_next() succeeds. * * Returns: the current matching object */ CK_OBJECT_HANDLE p11_kit_iter_get_object (P11KitIter *iter) { return_val_if_fail (iter != NULL, 0); return iter->object; } /** * p11_kit_iter_destroy_object: * @iter: teh iterator * * Destory the current matching object. * * This can only be called after p11_kit_iter_next() succeeds. * * Returns: CKR_OK or a failure code */ CK_RV p11_kit_iter_destroy_object (P11KitIter *iter) { return_val_if_fail (iter != NULL, CKR_GENERAL_ERROR); return_val_if_fail (iter->iterating, CKR_GENERAL_ERROR); return (iter->module->C_DestroyObject) (iter->session, iter->object); } /** * p11_kit_iter_get_attributes: * @iter: the iterator * @template: (array length=count) (inout): the attributes to get * @count: the number of attributes * * Get attributes for the current matching object. * * This calls C_GetAttributeValue for the object * currently iterated to. Return value and attribute memory behavior * is identical to the PKCS\#11 C_GetAttributeValue * function. * * You might choose to use p11_kit_iter_load_attributes() for a more * helpful variant. * * This can only be called after p11_kit_iter_next() succeeds. * * Returns: The result from C_GetAttributeValue. */ CK_RV p11_kit_iter_get_attributes (P11KitIter *iter, CK_ATTRIBUTE *template, CK_ULONG count) { return_val_if_fail (iter != NULL, CKR_GENERAL_ERROR); return_val_if_fail (iter->iterating, CKR_GENERAL_ERROR); return_val_if_fail (iter->module != NULL, CKR_GENERAL_ERROR); return_val_if_fail (iter->session != 0, CKR_GENERAL_ERROR); return_val_if_fail (iter->object != 0, CKR_GENERAL_ERROR); return (iter->module->C_GetAttributeValue) (iter->session, iter->object, template, count); } /** * p11_kit_iter_load_attributes: * @iter: the iterator * @template: (array length=count) (inout): the attributes to load * @count: the number of attributes * * Retrieve attributes for the current matching object. * * Each attribute in the array will be filled in with the value * of that attribute retrieved from the object. After use the * attribute value memory pointed to by the pValue * of each attribute should be freed with the free() * function. * * If the pValue of an attribute is not %NULL passed * to this function, then it will be passed to * realloc() to allocate the correct amount * of space for the attribute value. * * If any attribute is not present on the object, or is sensitive and * cannot be retrieved, then the pValue will be NULL. * If pValue was not %NULL when passed to this function * then it will be freed with free(). In these * cases CKR_OK is returned. * * This can only be called after p11_kit_iter_next() succeeds. * * Returns: CKR_OK or a failure code */ CK_RV p11_kit_iter_load_attributes (P11KitIter *iter, CK_ATTRIBUTE *template, CK_ULONG count) { CK_ATTRIBUTE *original = NULL; CK_ULONG i; CK_RV rv; return_val_if_fail (iter != NULL, CKR_GENERAL_ERROR); return_val_if_fail (iter->iterating, CKR_GENERAL_ERROR); return_val_if_fail (iter->module != NULL, CKR_GENERAL_ERROR); return_val_if_fail (iter->session != 0, CKR_GENERAL_ERROR); return_val_if_fail (iter->object != 0, CKR_GENERAL_ERROR); if (count == 0) return CKR_OK; original = memdup (template, count * sizeof (CK_ATTRIBUTE)); return_val_if_fail (original != NULL, CKR_HOST_MEMORY); for (i = 0; i < count; i++) template[i].pValue = NULL; rv = (iter->module->C_GetAttributeValue) (iter->session, iter->object, template, count); switch (rv) { case CKR_OK: case CKR_ATTRIBUTE_TYPE_INVALID: case CKR_ATTRIBUTE_SENSITIVE: case CKR_BUFFER_TOO_SMALL: break; default: free (original); return rv; } for (i = 0; i < count; i++) { if (template[i].ulValueLen == (CK_ULONG)-1 || template[i].ulValueLen == 0) { free (original[i].pValue); } else if (original[i].pValue != NULL && template[i].ulValueLen == original[i].ulValueLen) { template[i].pValue = original[i].pValue; } else { template[i].pValue = realloc (original[i].pValue, template[i].ulValueLen); return_val_if_fail (template[i].pValue != NULL, CKR_HOST_MEMORY); } } free (original); rv = (iter->module->C_GetAttributeValue) (iter->session, iter->object, template, count); switch (rv) { case CKR_OK: case CKR_ATTRIBUTE_TYPE_INVALID: case CKR_ATTRIBUTE_SENSITIVE: rv = CKR_OK; break; default: return_val_if_fail (rv != CKR_BUFFER_TOO_SMALL, rv); return rv; } for (i = 0; i < count; i++) { if (template[i].ulValueLen == (CK_ULONG)-1 || template[i].ulValueLen == 0) { free (template[i].pValue); template[i].pValue = NULL; } } return rv; } /** * p11_kit_iter_keep_session: * @iter: the iterator * * After calling this function the session open for iterating * the current object will not be automatically closed by * the iterator after later calls to p11_kit_iter_next() or * p11_kit_iter_free(). * * It is the callers responsibility to close this session, * after the iterator has been freed. The session may still be * used by the iterator if further iterations are performed. * * This can only be called after p11_kit_iter_next() succeeds. * * Returns: the current session */ CK_SESSION_HANDLE p11_kit_iter_keep_session (P11KitIter *iter) { return_val_if_fail (iter != NULL, 0); return_val_if_fail (iter->iterating, 0); return_val_if_fail (iter->session != 0, 0); iter->keep_session = 1; return iter->session; } /** * p11_kit_iter_free: * @iter: the iterator * * Frees the iterator and all resources, such as sessions * or callbacks held by the iterator. */ void p11_kit_iter_free (P11KitIter *iter) { Callback *cb, *next; if (iter == NULL) return; finish_iterating (iter, CKR_OK); p11_array_free (iter->modules); p11_attrs_free (iter->match_attrs); free (iter->objects); free (iter->slots); for (cb = iter->callbacks; cb != NULL; cb = next) { next = cb->next; if (cb->destroyer) (cb->destroyer) (cb->callback_data); free (cb); } free (iter); } p11-kit-0.20.2/p11-kit/proxy.c0000664000175000017500000017515412226763526012447 00000000000000/* * Copyright (C) 2008 Stefan Walter * Copyright (C) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #define P11_DEBUG_FLAG P11_DEBUG_PROXY #define CRYPTOKI_EXPORTS #include "debug.h" #include "dict.h" #include "library.h" #include "message.h" #include "modules.h" #include "pkcs11.h" #include "pkcs11x.h" #include "p11-kit.h" #include "private.h" #include "proxy.h" #include "virtual.h" #include #include #include #include #include #include #include #include /* Start wrap slots slightly higher for testing */ #define MAPPING_OFFSET 0x10 #define FIRST_HANDLE 0x10 typedef struct _Mapping { CK_SLOT_ID wrap_slot; CK_SLOT_ID real_slot; CK_FUNCTION_LIST_PTR funcs; } Mapping; typedef struct _Session { CK_SESSION_HANDLE wrap_session; CK_SESSION_HANDLE real_session; CK_SLOT_ID wrap_slot; } Session; typedef struct { int refs; Mapping *mappings; unsigned int n_mappings; p11_dict *sessions; CK_FUNCTION_LIST **modules; } Proxy; typedef struct _State { p11_virtual virt; struct _State *next; CK_FUNCTION_LIST *wrapped; CK_ULONG last_handle; Proxy *px; } State; static State *all_instances = NULL; static State global = { { { { -1, -1 }, NULL, }, }, NULL, NULL, FIRST_HANDLE, NULL }; #define MANUFACTURER_ID "PKCS#11 Kit " #define LIBRARY_DESCRIPTION "PKCS#11 Kit Proxy Module " #define LIBRARY_VERSION_MAJOR 1 #define LIBRARY_VERSION_MINOR 1 /* ----------------------------------------------------------------------------- * PKCS#11 PROXY MODULE */ static CK_RV map_slot_unlocked (Proxy *px, CK_SLOT_ID slot, Mapping *mapping) { assert (px != NULL); assert (mapping != NULL); if (slot < MAPPING_OFFSET) return CKR_SLOT_ID_INVALID; slot -= MAPPING_OFFSET; if (slot > px->n_mappings) { return CKR_SLOT_ID_INVALID; } else { assert (px->mappings); memcpy (mapping, &px->mappings[slot], sizeof (Mapping)); return CKR_OK; } } static CK_RV map_slot_to_real (Proxy *px, CK_SLOT_ID_PTR slot, Mapping *mapping) { CK_RV rv; assert (px != NULL); assert (mapping != NULL); p11_lock (); if (!px) rv = CKR_CRYPTOKI_NOT_INITIALIZED; else rv = map_slot_unlocked (px, *slot, mapping); if (rv == CKR_OK) *slot = mapping->real_slot; p11_unlock (); return rv; } static CK_RV map_session_to_real (Proxy *px, CK_SESSION_HANDLE_PTR handle, Mapping *mapping, Session *session) { CK_RV rv = CKR_OK; Session *sess; assert (px != NULL); assert (handle != NULL); assert (mapping != NULL); p11_lock (); if (!px) { rv = CKR_CRYPTOKI_NOT_INITIALIZED; } else { assert (px->sessions); sess = p11_dict_get (px->sessions, handle); if (sess != NULL) { *handle = sess->real_session; rv = map_slot_unlocked (px, sess->wrap_slot, mapping); if (session != NULL) memcpy (session, sess, sizeof (Session)); } else { rv = CKR_SESSION_HANDLE_INVALID; } } p11_unlock (); return rv; } static void proxy_free (Proxy *py) { if (py) { p11_kit_modules_finalize_and_release (py->modules); p11_dict_free (py->sessions); free (py->mappings); free (py); } } void p11_proxy_after_fork (void) { p11_array *array; State *state; unsigned int i; /* * After a fork the callers are supposed to call C_Initialize and all. * In addition the underlying libraries may change their state so free * up any mappings and all */ array = p11_array_new (NULL); p11_lock (); if (global.px) p11_array_push (array, global.px); global.px = NULL; for (state = all_instances; state != NULL; state = state->next) { if (state->px) p11_array_push (array, state->px); state->px = NULL; } p11_unlock (); for (i = 0; i < array->num; i++) proxy_free (array->elem[i]); p11_array_free (array); } static CK_RV proxy_C_Finalize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR reserved) { Proxy *py = NULL; State *state = (State *)self; CK_RV rv = CKR_OK; p11_debug ("in"); /* WARNING: This function must be reentrant */ if (reserved) { rv = CKR_ARGUMENTS_BAD; } else { p11_lock (); if (!state->px) { rv = CKR_CRYPTOKI_NOT_INITIALIZED; } else if (state->px->refs-- == 1) { py = state->px; state->px = NULL; } p11_unlock (); proxy_free (py); } p11_debug ("out: %lu", rv); return rv; } static CK_RV proxy_create (Proxy **res) { CK_FUNCTION_LIST_PTR *f; CK_FUNCTION_LIST_PTR funcs; CK_SLOT_ID_PTR slots; CK_ULONG i, count; CK_RV rv = CKR_OK; Proxy *py; py = calloc (1, sizeof (Proxy)); return_val_if_fail (py != NULL, CKR_HOST_MEMORY); p11_lock (); /* WARNING: Reentrancy can occur here */ rv = p11_modules_load_inlock_reentrant (0, &py->modules); p11_unlock (); if (rv != CKR_OK) { proxy_free (py); free (py); return rv; } rv = p11_kit_modules_initialize (py->modules, (p11_destroyer)p11_kit_module_release); if (rv != CKR_OK) { p11_kit_modules_release (py->modules); free (py); return rv; } for (f = py->modules; *f; ++f) { funcs = *f; assert (funcs != NULL); slots = NULL; /* Ask module for its slots */ rv = (funcs->C_GetSlotList) (FALSE, NULL, &count); if (rv == CKR_OK && count) { slots = calloc (sizeof (CK_SLOT_ID), count); rv = (funcs->C_GetSlotList) (FALSE, slots, &count); } if (rv != CKR_OK) { free (slots); break; } return_val_if_fail (count == 0 || slots != NULL, CKR_GENERAL_ERROR); py->mappings = realloc (py->mappings, sizeof (Mapping) * (py->n_mappings + count)); return_val_if_fail (py->mappings != NULL, CKR_HOST_MEMORY); /* And now add a mapping for each of those slots */ for (i = 0; i < count; ++i) { py->mappings[py->n_mappings].funcs = funcs; py->mappings[py->n_mappings].wrap_slot = py->n_mappings + MAPPING_OFFSET; py->mappings[py->n_mappings].real_slot = slots[i]; ++py->n_mappings; } free (slots); } if (rv != CKR_OK) { proxy_free (py); return rv; } py->sessions = p11_dict_new (p11_dict_ulongptr_hash, p11_dict_ulongptr_equal, NULL, free); return_val_if_fail (py->sessions != NULL, CKR_HOST_MEMORY); py->refs = 1; *res = py; return CKR_OK; } static CK_RV proxy_C_Initialize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR init_args) { State *state = (State *)self; bool initialize = false; Proxy *py; CK_RV rv; p11_library_init_once (); /* WARNING: This function must be reentrant */ p11_debug ("in"); p11_lock (); if (state->px == NULL) initialize = true; else state->px->refs++; p11_unlock (); if (!initialize) { p11_debug ("out: already: %lu", CKR_OK); return CKR_OK; } rv = proxy_create (&py); if (rv != CKR_OK) { p11_debug ("out: %lu", rv); return rv; } p11_lock (); if (state->px == NULL) { state->px = py; py = NULL; } p11_unlock (); proxy_free (py); p11_debug ("out: 0"); return rv; } static CK_RV proxy_C_GetInfo (CK_X_FUNCTION_LIST *self, CK_INFO_PTR info) { State *state = (State *)self; CK_RV rv = CKR_OK; p11_library_init_once (); return_val_if_fail (info != NULL, CKR_ARGUMENTS_BAD); p11_lock (); if (!state->px) rv = CKR_CRYPTOKI_NOT_INITIALIZED; p11_unlock (); if (rv != CKR_OK) return rv; memset (info, 0, sizeof (CK_INFO)); info->cryptokiVersion.major = CRYPTOKI_VERSION_MAJOR; info->cryptokiVersion.minor = CRYPTOKI_VERSION_MINOR; info->libraryVersion.major = LIBRARY_VERSION_MAJOR; info->libraryVersion.minor = LIBRARY_VERSION_MINOR; info->flags = 0; strncpy ((char*)info->manufacturerID, MANUFACTURER_ID, 32); strncpy ((char*)info->libraryDescription, LIBRARY_DESCRIPTION, 32); return CKR_OK; } static CK_RV proxy_C_GetSlotList (CK_X_FUNCTION_LIST *self, CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count) { State *state = (State *)self; CK_SLOT_INFO info; Mapping *mapping; CK_ULONG index; CK_RV rv = CKR_OK; int i; return_val_if_fail (count != NULL, CKR_ARGUMENTS_BAD); p11_lock (); if (!state->px) { rv = CKR_CRYPTOKI_NOT_INITIALIZED; } else { index = 0; /* Go through and build up a map */ for (i = 0; i < state->px->n_mappings; ++i) { mapping = &state->px->mappings[i]; /* Skip ones without a token if requested */ if (token_present) { rv = (mapping->funcs->C_GetSlotInfo) (mapping->real_slot, &info); if (rv != CKR_OK) break; if (!(info.flags & CKF_TOKEN_PRESENT)) continue; } /* Fill in the slot if we can */ if (slot_list && *count > index) slot_list[index] = mapping->wrap_slot; ++index; } if (slot_list && *count < index) rv = CKR_BUFFER_TOO_SMALL; *count = index; } p11_unlock (); return rv; } static CK_RV proxy_C_GetSlotInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID id, CK_SLOT_INFO_PTR info) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_slot_to_real (state->px, &id, &map); if (rv != CKR_OK) return rv; return (map.funcs->C_GetSlotInfo) (id, info); } static CK_RV proxy_C_GetTokenInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID id, CK_TOKEN_INFO_PTR info) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_slot_to_real (state->px, &id, &map); if (rv != CKR_OK) return rv; return (map.funcs->C_GetTokenInfo) (id, info); } static CK_RV proxy_C_GetMechanismList (CK_X_FUNCTION_LIST *self, CK_SLOT_ID id, CK_MECHANISM_TYPE_PTR mechanism_list, CK_ULONG_PTR count) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_slot_to_real (state->px, &id, &map); if (rv != CKR_OK) return rv; return (map.funcs->C_GetMechanismList) (id, mechanism_list, count); } static CK_RV proxy_C_GetMechanismInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID id, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR info) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_slot_to_real (state->px, &id, &map); if (rv != CKR_OK) return rv; return (map.funcs->C_GetMechanismInfo) (id, type, info); } static CK_RV proxy_C_InitToken (CK_X_FUNCTION_LIST *self, CK_SLOT_ID id, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len, CK_UTF8CHAR_PTR label) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_slot_to_real (state->px, &id, &map); if (rv != CKR_OK) return rv; return (map.funcs->C_InitToken) (id, pin, pin_len, label); } static CK_RV proxy_C_WaitForSlotEvent (CK_X_FUNCTION_LIST *self, CK_FLAGS flags, CK_SLOT_ID_PTR slot, CK_VOID_PTR reserved) { return CKR_FUNCTION_NOT_SUPPORTED; } static CK_RV proxy_C_OpenSession (CK_X_FUNCTION_LIST *self, CK_SLOT_ID id, CK_FLAGS flags, CK_VOID_PTR user_data, CK_NOTIFY callback, CK_SESSION_HANDLE_PTR handle) { State *state = (State *)self; Session *sess; Mapping map; CK_RV rv; return_val_if_fail (handle != NULL, CKR_ARGUMENTS_BAD); rv = map_slot_to_real (state->px, &id, &map); if (rv != CKR_OK) return rv; rv = (map.funcs->C_OpenSession) (id, flags, user_data, callback, handle); if (rv == CKR_OK) { p11_lock (); if (!state->px) { /* * The underlying module should have returned an error, so this * code should never be reached with properly behaving modules. * That's why we don't cleanup and close the newly opened session here * or anything like that. */ rv = CKR_CRYPTOKI_NOT_INITIALIZED; } else { sess = calloc (1, sizeof (Session)); sess->wrap_slot = map.wrap_slot; sess->real_session = *handle; sess->wrap_session = ++state->last_handle; /* TODO: Handle wrapping, and then collisions */ p11_dict_set (state->px->sessions, &sess->wrap_session, sess); *handle = sess->wrap_session; } p11_unlock (); } return rv; } static CK_RV proxy_C_CloseSession (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle) { State *state = (State *)self; CK_SESSION_HANDLE key; Mapping map; CK_RV rv; key = handle; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; rv = (map.funcs->C_CloseSession) (handle); if (rv == CKR_OK) { p11_lock (); if (state->px) p11_dict_remove (state->px->sessions, &key); p11_unlock (); } return rv; } static CK_RV proxy_C_CloseAllSessions (CK_X_FUNCTION_LIST *self, CK_SLOT_ID id) { State *state = (State *)self; CK_SESSION_HANDLE_PTR to_close; CK_RV rv = CKR_OK; Session *sess; CK_ULONG i, count = 0; p11_dictiter iter; p11_lock (); if (!state->px) { rv = CKR_CRYPTOKI_NOT_INITIALIZED; } else { assert (state->px->sessions != NULL); to_close = calloc (sizeof (CK_SESSION_HANDLE), p11_dict_size (state->px->sessions)); if (!to_close) { rv = CKR_HOST_MEMORY; } else { p11_dict_iterate (state->px->sessions, &iter); count = 0; while (p11_dict_next (&iter, NULL, (void**)&sess)) { if (sess->wrap_slot == id && to_close) to_close[count++] = sess->wrap_session; } } } p11_unlock (); if (rv != CKR_OK) return rv; for (i = 0; i < count; ++i) proxy_C_CloseSession (self, to_close[i]); free (to_close); return CKR_OK; } static CK_RV proxy_C_GetFunctionStatus (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_GetFunctionStatus) (handle); } static CK_RV proxy_C_CancelFunction (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_CancelFunction) (handle); } static CK_RV proxy_C_GetSessionInfo (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_SESSION_INFO_PTR info) { State *state = (State *)self; Mapping map; CK_RV rv; if (info == NULL) return CKR_ARGUMENTS_BAD; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; rv = (map.funcs->C_GetSessionInfo) (handle, info); if (rv == CKR_OK) info->slotID = map.wrap_slot; return rv; } static CK_RV proxy_C_InitPIN (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_InitPIN) (handle, pin, pin_len); } static CK_RV proxy_C_SetPIN (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_UTF8CHAR_PTR old_pin, CK_ULONG old_pin_len, CK_UTF8CHAR_PTR new_pin, CK_ULONG new_pin_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_SetPIN) (handle, old_pin, old_pin_len, new_pin, new_pin_len); } static CK_RV proxy_C_GetOperationState (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR operation_state, CK_ULONG_PTR operation_state_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_GetOperationState) (handle, operation_state, operation_state_len); } static CK_RV proxy_C_SetOperationState (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR operation_state, CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key, CK_OBJECT_HANDLE authentication_key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_SetOperationState) (handle, operation_state, operation_state_len, encryption_key, authentication_key); } static CK_RV proxy_C_Login (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_USER_TYPE user_type, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_Login) (handle, user_type, pin, pin_len); } static CK_RV proxy_C_Logout (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_Logout) (handle); } static CK_RV proxy_C_CreateObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_CreateObject) (handle, template, count, new_object); } static CK_RV proxy_C_CopyObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_CopyObject) (handle, object, template, count, new_object); } static CK_RV proxy_C_DestroyObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DestroyObject) (handle, object); } static CK_RV proxy_C_GetObjectSize (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ULONG_PTR size) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_GetObjectSize) (handle, object, size); } static CK_RV proxy_C_GetAttributeValue (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_GetAttributeValue) (handle, object, template, count); } static CK_RV proxy_C_SetAttributeValue (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_SetAttributeValue) (handle, object, template, count); } static CK_RV proxy_C_FindObjectsInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_ATTRIBUTE_PTR template, CK_ULONG count) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_FindObjectsInit) (handle, template, count); } static CK_RV proxy_C_FindObjects (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE_PTR objects, CK_ULONG max_count, CK_ULONG_PTR count) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_FindObjects) (handle, objects, max_count, count); } static CK_RV proxy_C_FindObjectsFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_FindObjectsFinal) (handle); } static CK_RV proxy_C_EncryptInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_EncryptInit) (handle, mechanism, key); } static CK_RV proxy_C_Encrypt (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR encrypted_data, CK_ULONG_PTR encrypted_data_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_Encrypt) (handle, input, input_len, encrypted_data, encrypted_data_len); } static CK_RV proxy_C_EncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_EncryptUpdate) (handle, part, part_len, encrypted_part, encrypted_part_len); } static CK_RV proxy_C_EncryptFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_EncryptFinal) (handle, last_part, last_part_len); } static CK_RV proxy_C_DecryptInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DecryptInit) (handle, mechanism, key); } static CK_RV proxy_C_Decrypt (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_data, CK_ULONG enc_data_len, CK_BYTE_PTR output, CK_ULONG_PTR output_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_Decrypt) (handle, enc_data, enc_data_len, output, output_len); } static CK_RV proxy_C_DecryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DecryptUpdate) (handle, enc_part, enc_part_len, part, part_len); } static CK_RV proxy_C_DecryptFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DecryptFinal) (handle, last_part, last_part_len); } static CK_RV proxy_C_DigestInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DigestInit) (handle, mechanism); } static CK_RV proxy_C_Digest (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_Digest) (handle, input, input_len, digest, digest_len); } static CK_RV proxy_C_DigestUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DigestUpdate) (handle, part, part_len); } static CK_RV proxy_C_DigestKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DigestKey) (handle, key); } static CK_RV proxy_C_DigestFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DigestFinal) (handle, digest, digest_len); } static CK_RV proxy_C_SignInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_SignInit) (handle, mechanism, key); } static CK_RV proxy_C_Sign (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_Sign) (handle, input, input_len, signature, signature_len); } static CK_RV proxy_C_SignUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_SignUpdate) (handle, part, part_len); } static CK_RV proxy_C_SignFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_SignFinal) (handle, signature, signature_len); } static CK_RV proxy_C_SignRecoverInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_SignRecoverInit) (handle, mechanism, key); } static CK_RV proxy_C_SignRecover (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_SignRecover) (handle, input, input_len, signature, signature_len); } static CK_RV proxy_C_VerifyInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_VerifyInit) (handle, mechanism, key); } static CK_RV proxy_C_Verify (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR signature, CK_ULONG signature_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_Verify) (handle, input, input_len, signature, signature_len); } static CK_RV proxy_C_VerifyUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_VerifyUpdate) (handle, part, part_len); } static CK_RV proxy_C_VerifyFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR signature, CK_ULONG signature_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_VerifyFinal) (handle, signature, signature_len); } static CK_RV proxy_C_VerifyRecoverInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_VerifyRecoverInit) (handle, mechanism, key); } static CK_RV proxy_C_VerifyRecover (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR signature, CK_ULONG signature_len, CK_BYTE_PTR output, CK_ULONG_PTR output_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_VerifyRecover) (handle, signature, signature_len, output, output_len); } static CK_RV proxy_C_DigestEncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DigestEncryptUpdate) (handle, part, part_len, enc_part, enc_part_len); } static CK_RV proxy_C_DecryptDigestUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DecryptDigestUpdate) (handle, enc_part, enc_part_len, part, part_len); } static CK_RV proxy_C_SignEncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_SignEncryptUpdate) (handle, part, part_len, enc_part, enc_part_len); } static CK_RV proxy_C_DecryptVerifyUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DecryptVerifyUpdate) (handle, enc_part, enc_part_len, part, part_len); } static CK_RV proxy_C_GenerateKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_GenerateKey) (handle, mechanism, template, count, key); } static CK_RV proxy_C_GenerateKeyPair (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR pub_template, CK_ULONG pub_count, CK_ATTRIBUTE_PTR priv_template, CK_ULONG priv_count, CK_OBJECT_HANDLE_PTR pub_key, CK_OBJECT_HANDLE_PTR priv_key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_GenerateKeyPair) (handle, mechanism, pub_template, pub_count, priv_template, priv_count, pub_key, priv_key); } static CK_RV proxy_C_WrapKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key, CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_WrapKey) (handle, mechanism, wrapping_key, key, wrapped_key, wrapped_key_len); } static CK_RV proxy_C_UnwrapKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key, CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_UnwrapKey) (handle, mechanism, unwrapping_key, wrapped_key, wrapped_key_len, template, count, key); } static CK_RV proxy_C_DeriveKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_DeriveKey) (handle, mechanism, base_key, template, count, key); } static CK_RV proxy_C_SeedRandom (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR seed, CK_ULONG seed_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_SeedRandom) (handle, seed, seed_len); } static CK_RV proxy_C_GenerateRandom (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE handle, CK_BYTE_PTR random_data, CK_ULONG random_len) { State *state = (State *)self; Mapping map; CK_RV rv; rv = map_session_to_real (state->px, &handle, &map, NULL); if (rv != CKR_OK) return rv; return (map.funcs->C_GenerateRandom) (handle, random_data, random_len); } /* -------------------------------------------------------------------- * Global module functions */ static CK_FUNCTION_LIST module_functions; static CK_RV module_C_Initialize (CK_VOID_PTR init_args) { return proxy_C_Initialize (&global.virt.funcs, init_args); } static CK_RV module_C_Finalize (CK_VOID_PTR reserved) { return proxy_C_Finalize (&global.virt.funcs, reserved); } static CK_RV module_C_GetInfo (CK_INFO_PTR info) { return proxy_C_GetInfo (&global.virt.funcs, info); } static CK_RV module_C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list) { return_val_if_fail (list != NULL, CKR_ARGUMENTS_BAD); *list = &module_functions; return CKR_OK; } static CK_RV module_C_GetSlotList (CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count) { return proxy_C_GetSlotList (&global.virt.funcs, token_present, slot_list, count); } static CK_RV module_C_GetSlotInfo (CK_SLOT_ID id, CK_SLOT_INFO_PTR info) { return proxy_C_GetSlotInfo (&global.virt.funcs, id, info); } static CK_RV module_C_GetTokenInfo (CK_SLOT_ID id, CK_TOKEN_INFO_PTR info) { return proxy_C_GetTokenInfo (&global.virt.funcs, id, info); } static CK_RV module_C_GetMechanismList (CK_SLOT_ID id, CK_MECHANISM_TYPE_PTR mechanism_list, CK_ULONG_PTR count) { return proxy_C_GetMechanismList (&global.virt.funcs, id, mechanism_list, count); } static CK_RV module_C_GetMechanismInfo (CK_SLOT_ID id, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR info) { return proxy_C_GetMechanismInfo (&global.virt.funcs, id, type, info); } static CK_RV module_C_InitToken (CK_SLOT_ID id, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len, CK_UTF8CHAR_PTR label) { return proxy_C_InitToken (&global.virt.funcs, id, pin, pin_len, label); } static CK_RV module_C_WaitForSlotEvent (CK_FLAGS flags, CK_SLOT_ID_PTR slot, CK_VOID_PTR reserved) { return proxy_C_WaitForSlotEvent (&global.virt.funcs, flags, slot, reserved); } static CK_RV module_C_OpenSession (CK_SLOT_ID id, CK_FLAGS flags, CK_VOID_PTR user_data, CK_NOTIFY callback, CK_SESSION_HANDLE_PTR handle) { return proxy_C_OpenSession (&global.virt.funcs, id, flags, user_data, callback, handle); } static CK_RV module_C_CloseSession (CK_SESSION_HANDLE handle) { return proxy_C_CloseSession (&global.virt.funcs, handle); } static CK_RV module_C_CloseAllSessions (CK_SLOT_ID id) { return proxy_C_CloseAllSessions (&global.virt.funcs, id); } static CK_RV module_C_GetFunctionStatus (CK_SESSION_HANDLE handle) { return proxy_C_GetFunctionStatus (&global.virt.funcs, handle); } static CK_RV module_C_CancelFunction (CK_SESSION_HANDLE handle) { return proxy_C_CancelFunction (&global.virt.funcs, handle); } static CK_RV module_C_GetSessionInfo (CK_SESSION_HANDLE handle, CK_SESSION_INFO_PTR info) { return proxy_C_GetSessionInfo (&global.virt.funcs, handle, info); } static CK_RV module_C_InitPIN (CK_SESSION_HANDLE handle, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { return proxy_C_InitPIN (&global.virt.funcs, handle, pin, pin_len); } static CK_RV module_C_SetPIN (CK_SESSION_HANDLE handle, CK_UTF8CHAR_PTR old_pin, CK_ULONG old_pin_len, CK_UTF8CHAR_PTR new_pin, CK_ULONG new_pin_len) { return proxy_C_SetPIN (&global.virt.funcs, handle, old_pin, old_pin_len, new_pin, new_pin_len); } static CK_RV module_C_GetOperationState (CK_SESSION_HANDLE handle, CK_BYTE_PTR operation_state, CK_ULONG_PTR operation_state_len) { return proxy_C_GetOperationState (&global.virt.funcs, handle, operation_state, operation_state_len); } static CK_RV module_C_SetOperationState (CK_SESSION_HANDLE handle, CK_BYTE_PTR operation_state, CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key, CK_OBJECT_HANDLE authentication_key) { return proxy_C_SetOperationState (&global.virt.funcs, handle, operation_state, operation_state_len, encryption_key, authentication_key); } static CK_RV module_C_Login (CK_SESSION_HANDLE handle, CK_USER_TYPE user_type, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { return proxy_C_Login (&global.virt.funcs, handle, user_type, pin, pin_len); } static CK_RV module_C_Logout (CK_SESSION_HANDLE handle) { return proxy_C_Logout (&global.virt.funcs, handle); } static CK_RV module_C_CreateObject (CK_SESSION_HANDLE handle, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { return proxy_C_CreateObject (&global.virt.funcs, handle, template, count, new_object); } static CK_RV module_C_CopyObject (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { return proxy_C_CopyObject (&global.virt.funcs, handle, object, template, count, new_object); } static CK_RV module_C_DestroyObject (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object) { return proxy_C_DestroyObject (&global.virt.funcs, handle, object); } static CK_RV module_C_GetObjectSize (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ULONG_PTR size) { return proxy_C_GetObjectSize (&global.virt.funcs, handle, object, size); } static CK_RV module_C_GetAttributeValue (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { return proxy_C_GetAttributeValue (&global.virt.funcs, handle, object, template, count); } static CK_RV module_C_SetAttributeValue (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { return proxy_C_SetAttributeValue (&global.virt.funcs, handle, object, template, count); } static CK_RV module_C_FindObjectsInit (CK_SESSION_HANDLE handle, CK_ATTRIBUTE_PTR template, CK_ULONG count) { return proxy_C_FindObjectsInit (&global.virt.funcs, handle, template, count); } static CK_RV module_C_FindObjects (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE_PTR objects, CK_ULONG max_count, CK_ULONG_PTR count) { return proxy_C_FindObjects (&global.virt.funcs, handle, objects, max_count, count); } static CK_RV module_C_FindObjectsFinal (CK_SESSION_HANDLE handle) { return proxy_C_FindObjectsFinal (&global.virt.funcs, handle); } static CK_RV module_C_EncryptInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return proxy_C_EncryptInit (&global.virt.funcs, handle, mechanism, key); } static CK_RV module_C_Encrypt (CK_SESSION_HANDLE handle, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR encrypted_data, CK_ULONG_PTR encrypted_data_len) { return proxy_C_Encrypt (&global.virt.funcs, handle, data, data_len, encrypted_data, encrypted_data_len); } static CK_RV module_C_EncryptUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { return proxy_C_EncryptUpdate (&global.virt.funcs, handle, part, part_len, encrypted_part, encrypted_part_len); } static CK_RV module_C_EncryptFinal (CK_SESSION_HANDLE handle, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { return proxy_C_EncryptFinal (&global.virt.funcs, handle, last_part, last_part_len); } static CK_RV module_C_DecryptInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return proxy_C_DecryptInit (&global.virt.funcs, handle, mechanism, key); } static CK_RV module_C_Decrypt (CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_data, CK_ULONG enc_data_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len) { return proxy_C_Decrypt (&global.virt.funcs, handle, enc_data, enc_data_len, data, data_len); } static CK_RV module_C_DecryptUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return proxy_C_DecryptUpdate (&global.virt.funcs, handle, enc_part, enc_part_len, part, part_len); } static CK_RV module_C_DecryptFinal (CK_SESSION_HANDLE handle, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { return proxy_C_DecryptFinal (&global.virt.funcs, handle, last_part, last_part_len); } static CK_RV module_C_DigestInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism) { return proxy_C_DigestInit (&global.virt.funcs, handle, mechanism); } static CK_RV module_C_Digest (CK_SESSION_HANDLE handle, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { return proxy_C_Digest (&global.virt.funcs, handle, data, data_len, digest, digest_len); } static CK_RV module_C_DigestUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len) { return proxy_C_DigestUpdate (&global.virt.funcs, handle, part, part_len); } static CK_RV module_C_DigestKey (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE key) { return proxy_C_DigestKey (&global.virt.funcs, handle, key); } static CK_RV module_C_DigestFinal (CK_SESSION_HANDLE handle, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { return proxy_C_DigestFinal (&global.virt.funcs, handle, digest, digest_len); } static CK_RV module_C_SignInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return proxy_C_SignInit (&global.virt.funcs, handle, mechanism, key); } static CK_RV module_C_Sign (CK_SESSION_HANDLE handle, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return proxy_C_Sign (&global.virt.funcs, handle, data, data_len, signature, signature_len); } static CK_RV module_C_SignUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len) { return proxy_C_SignUpdate (&global.virt.funcs, handle, part, part_len); } static CK_RV module_C_SignFinal (CK_SESSION_HANDLE handle, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return proxy_C_SignFinal (&global.virt.funcs, handle, signature, signature_len); } static CK_RV module_C_SignRecoverInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return proxy_C_SignRecoverInit (&global.virt.funcs, handle, mechanism, key); } static CK_RV module_C_SignRecover (CK_SESSION_HANDLE handle, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { return proxy_C_SignRecover (&global.virt.funcs, handle, data, data_len, signature, signature_len); } static CK_RV module_C_VerifyInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return proxy_C_VerifyInit (&global.virt.funcs, handle, mechanism, key); } static CK_RV module_C_Verify (CK_SESSION_HANDLE handle, CK_BYTE_PTR data, CK_ULONG data_len, CK_BYTE_PTR signature, CK_ULONG signature_len) { return proxy_C_Verify (&global.virt.funcs, handle, data, data_len, signature, signature_len); } static CK_RV module_C_VerifyUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len) { return proxy_C_VerifyUpdate (&global.virt.funcs, handle, part, part_len); } static CK_RV module_C_VerifyFinal (CK_SESSION_HANDLE handle, CK_BYTE_PTR signature, CK_ULONG signature_len) { return proxy_C_VerifyFinal (&global.virt.funcs, handle, signature, signature_len); } static CK_RV module_C_VerifyRecoverInit (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { return proxy_C_VerifyRecoverInit (&global.virt.funcs, handle, mechanism, key); } static CK_RV module_C_VerifyRecover (CK_SESSION_HANDLE handle, CK_BYTE_PTR signature, CK_ULONG signature_len, CK_BYTE_PTR data, CK_ULONG_PTR data_len) { return proxy_C_VerifyRecover (&global.virt.funcs, handle, signature, signature_len, data, data_len); } static CK_RV module_C_DigestEncryptUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len) { return proxy_C_DigestEncryptUpdate (&global.virt.funcs, handle, part, part_len, enc_part, enc_part_len); } static CK_RV module_C_DecryptDigestUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return proxy_C_DecryptDigestUpdate (&global.virt.funcs, handle, enc_part, enc_part_len, part, part_len); } static CK_RV module_C_SignEncryptUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR enc_part, CK_ULONG_PTR enc_part_len) { return proxy_C_SignEncryptUpdate (&global.virt.funcs, handle, part, part_len, enc_part, enc_part_len); } static CK_RV module_C_DecryptVerifyUpdate (CK_SESSION_HANDLE handle, CK_BYTE_PTR enc_part, CK_ULONG enc_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { return proxy_C_DecryptVerifyUpdate (&global.virt.funcs, handle, enc_part, enc_part_len, part, part_len); } static CK_RV module_C_GenerateKey (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return proxy_C_GenerateKey (&global.virt.funcs, handle, mechanism, template, count, key); } static CK_RV module_C_GenerateKeyPair (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR pub_template, CK_ULONG pub_count, CK_ATTRIBUTE_PTR priv_template, CK_ULONG priv_count, CK_OBJECT_HANDLE_PTR pub_key, CK_OBJECT_HANDLE_PTR priv_key) { return proxy_C_GenerateKeyPair (&global.virt.funcs, handle, mechanism, pub_template, pub_count, priv_template, priv_count, pub_key, priv_key); } static CK_RV module_C_WrapKey (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key, CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len) { return proxy_C_WrapKey (&global.virt.funcs, handle, mechanism, wrapping_key, key, wrapped_key, wrapped_key_len); } static CK_RV module_C_UnwrapKey (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key, CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return proxy_C_UnwrapKey (&global.virt.funcs, handle, mechanism, unwrapping_key, wrapped_key, wrapped_key_len, template, count, key); } static CK_RV module_C_DeriveKey (CK_SESSION_HANDLE handle, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { return proxy_C_DeriveKey (&global.virt.funcs, handle, mechanism, base_key, template, count, key); } static CK_RV module_C_SeedRandom (CK_SESSION_HANDLE handle, CK_BYTE_PTR seed, CK_ULONG seed_len) { return proxy_C_SeedRandom (&global.virt.funcs, handle, seed, seed_len); } static CK_RV module_C_GenerateRandom (CK_SESSION_HANDLE handle, CK_BYTE_PTR random_data, CK_ULONG random_len) { return proxy_C_GenerateRandom (&global.virt.funcs, handle, random_data, random_len); } /* -------------------------------------------------------------------- * MODULE ENTRY POINT */ static CK_FUNCTION_LIST module_functions = { { CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, module_C_Initialize, module_C_Finalize, module_C_GetInfo, module_C_GetFunctionList, module_C_GetSlotList, module_C_GetSlotInfo, module_C_GetTokenInfo, module_C_GetMechanismList, module_C_GetMechanismInfo, module_C_InitToken, module_C_InitPIN, module_C_SetPIN, module_C_OpenSession, module_C_CloseSession, module_C_CloseAllSessions, module_C_GetSessionInfo, module_C_GetOperationState, module_C_SetOperationState, module_C_Login, module_C_Logout, module_C_CreateObject, module_C_CopyObject, module_C_DestroyObject, module_C_GetObjectSize, module_C_GetAttributeValue, module_C_SetAttributeValue, module_C_FindObjectsInit, module_C_FindObjects, module_C_FindObjectsFinal, module_C_EncryptInit, module_C_Encrypt, module_C_EncryptUpdate, module_C_EncryptFinal, module_C_DecryptInit, module_C_Decrypt, module_C_DecryptUpdate, module_C_DecryptFinal, module_C_DigestInit, module_C_Digest, module_C_DigestUpdate, module_C_DigestKey, module_C_DigestFinal, module_C_SignInit, module_C_Sign, module_C_SignUpdate, module_C_SignFinal, module_C_SignRecoverInit, module_C_SignRecover, module_C_VerifyInit, module_C_Verify, module_C_VerifyUpdate, module_C_VerifyFinal, module_C_VerifyRecoverInit, module_C_VerifyRecover, module_C_DigestEncryptUpdate, module_C_DecryptDigestUpdate, module_C_SignEncryptUpdate, module_C_DecryptVerifyUpdate, module_C_GenerateKey, module_C_GenerateKeyPair, module_C_WrapKey, module_C_UnwrapKey, module_C_DeriveKey, module_C_SeedRandom, module_C_GenerateRandom, module_C_GetFunctionStatus, module_C_CancelFunction, module_C_WaitForSlotEvent }; static CK_X_FUNCTION_LIST proxy_functions = { { CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, proxy_C_Initialize, proxy_C_Finalize, proxy_C_GetInfo, proxy_C_GetSlotList, proxy_C_GetSlotInfo, proxy_C_GetTokenInfo, proxy_C_GetMechanismList, proxy_C_GetMechanismInfo, proxy_C_InitToken, proxy_C_InitPIN, proxy_C_SetPIN, proxy_C_OpenSession, proxy_C_CloseSession, proxy_C_CloseAllSessions, proxy_C_GetSessionInfo, proxy_C_GetOperationState, proxy_C_SetOperationState, proxy_C_Login, proxy_C_Logout, proxy_C_CreateObject, proxy_C_CopyObject, proxy_C_DestroyObject, proxy_C_GetObjectSize, proxy_C_GetAttributeValue, proxy_C_SetAttributeValue, proxy_C_FindObjectsInit, proxy_C_FindObjects, proxy_C_FindObjectsFinal, proxy_C_EncryptInit, proxy_C_Encrypt, proxy_C_EncryptUpdate, proxy_C_EncryptFinal, proxy_C_DecryptInit, proxy_C_Decrypt, proxy_C_DecryptUpdate, proxy_C_DecryptFinal, proxy_C_DigestInit, proxy_C_Digest, proxy_C_DigestUpdate, proxy_C_DigestKey, proxy_C_DigestFinal, proxy_C_SignInit, proxy_C_Sign, proxy_C_SignUpdate, proxy_C_SignFinal, proxy_C_SignRecoverInit, proxy_C_SignRecover, proxy_C_VerifyInit, proxy_C_Verify, proxy_C_VerifyUpdate, proxy_C_VerifyFinal, proxy_C_VerifyRecoverInit, proxy_C_VerifyRecover, proxy_C_DigestEncryptUpdate, proxy_C_DecryptDigestUpdate, proxy_C_SignEncryptUpdate, proxy_C_DecryptVerifyUpdate, proxy_C_GenerateKey, proxy_C_GenerateKeyPair, proxy_C_WrapKey, proxy_C_UnwrapKey, proxy_C_DeriveKey, proxy_C_SeedRandom, proxy_C_GenerateRandom, proxy_C_WaitForSlotEvent, }; #ifdef OS_WIN32 __declspec(dllexport) #endif CK_RV C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list) { CK_FUNCTION_LIST_PTR module = NULL; State *state; CK_RV rv = CKR_OK; p11_library_init_once (); p11_lock (); if (p11_virtual_can_wrap ()) { state = calloc (1, sizeof (State)); if (!state) { rv = CKR_HOST_MEMORY; } else { p11_virtual_init (&state->virt, &proxy_functions, state, NULL); state->last_handle = FIRST_HANDLE; module = p11_virtual_wrap (&state->virt, free); if (module == NULL) { rv = CKR_GENERAL_ERROR; } else { state->wrapped = module; state->next = all_instances; all_instances = state; } } } if (rv == CKR_OK) { if (module == NULL) module = &module_functions; /* We use this as a check below */ module->C_WaitForSlotEvent = module_C_WaitForSlotEvent; *list = module; } p11_unlock (); return rv; } void p11_proxy_module_cleanup (void) { State *state, *next; state = all_instances; all_instances = NULL; for (; state != NULL; state = next) { next = state->next; p11_virtual_unwrap (state->wrapped); } } bool p11_proxy_module_check (CK_FUNCTION_LIST_PTR module) { return (module->C_WaitForSlotEvent == module_C_WaitForSlotEvent); } p11-kit-0.20.2/p11-kit/tests/0000775000175000017500000000000012265245672012327 500000000000000p11-kit-0.20.2/p11-kit/tests/test-conf.c0000664000175000017500000003246212226767342014324 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include #include "conf.h" #include "debug.h" #include "message.h" #include "p11-kit.h" #include "private.h" #ifdef OS_UNIX #include #include #include #endif static void test_parse_conf_1 (void) { p11_dict *map; const char *value; map = _p11_conf_parse_file (SRCDIR "/files/test-1.conf", NULL, 0); assert_ptr_not_null (map); value = p11_dict_get (map, "key1"); assert_str_eq ("value1", value); value = p11_dict_get (map, "with-colon"); assert_str_eq ("value-of-colon", value); value = p11_dict_get (map, "with-whitespace"); assert_str_eq ("value-with-whitespace", value); value = p11_dict_get (map, "embedded-comment"); assert_str_eq ("this is # not a comment", value); p11_dict_free (map); } static void test_parse_ignore_missing (void) { p11_dict *map; map = _p11_conf_parse_file (SRCDIR "/files/non-existant.conf", NULL, CONF_IGNORE_MISSING); assert_ptr_not_null (map); assert_num_eq (0, p11_dict_size (map)); assert (p11_message_last () == NULL); p11_dict_free (map); } static void test_parse_fail_missing (void) { p11_dict *map; map = _p11_conf_parse_file (SRCDIR "/files/non-existant.conf", NULL, 0); assert (map == NULL); assert_ptr_not_null (p11_message_last ()); } static void test_merge_defaults (void) { p11_dict *values; p11_dict *defaults; values = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, free); defaults = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, free); p11_dict_set (values, strdup ("one"), strdup ("real1")); p11_dict_set (values, strdup ("two"), strdup ("real2")); p11_dict_set (defaults, strdup ("two"), strdup ("default2")); p11_dict_set (defaults, strdup ("three"), strdup ("default3")); if (!_p11_conf_merge_defaults (values, defaults)) assert_not_reached (); p11_dict_free (defaults); assert_str_eq (p11_dict_get (values, "one"), "real1"); assert_str_eq (p11_dict_get (values, "two"), "real2"); assert_str_eq (p11_dict_get (values, "three"), "default3"); p11_dict_free (values); } static void test_load_globals_merge (void) { int user_mode = -1; p11_dict *config; p11_message_clear (); config = _p11_conf_load_globals (SRCDIR "/files/test-system-merge.conf", SRCDIR "/files/test-user.conf", &user_mode); assert_ptr_not_null (config); assert (NULL == p11_message_last ()); assert_num_eq (CONF_USER_MERGE, user_mode); assert_str_eq (p11_dict_get (config, "key1"), "system1"); assert_str_eq (p11_dict_get (config, "key2"), "user2"); assert_str_eq (p11_dict_get (config, "key3"), "user3"); p11_dict_free (config); } static void test_load_globals_no_user (void) { int user_mode = -1; p11_dict *config; p11_message_clear (); config = _p11_conf_load_globals (SRCDIR "/files/test-system-none.conf", SRCDIR "/files/test-user.conf", &user_mode); assert_ptr_not_null (config); assert (NULL == p11_message_last ()); assert_num_eq (CONF_USER_NONE, user_mode); assert_str_eq (p11_dict_get (config, "key1"), "system1"); assert_str_eq (p11_dict_get (config, "key2"), "system2"); assert_str_eq (p11_dict_get (config, "key3"), "system3"); p11_dict_free (config); } static void test_load_globals_user_sets_only (void) { int user_mode = -1; p11_dict *config; p11_message_clear (); config = _p11_conf_load_globals (SRCDIR "/files/test-system-merge.conf", SRCDIR "/files/test-user-only.conf", &user_mode); assert_ptr_not_null (config); assert (NULL == p11_message_last ()); assert_num_eq (CONF_USER_ONLY, user_mode); assert (p11_dict_get (config, "key1") == NULL); assert_str_eq (p11_dict_get (config, "key2"), "user2"); assert_str_eq (p11_dict_get (config, "key3"), "user3"); p11_dict_free (config); } static void test_load_globals_system_sets_only (void) { int user_mode = -1; p11_dict *config; p11_message_clear (); config = _p11_conf_load_globals (SRCDIR "/files/test-system-only.conf", SRCDIR "/files/test-user.conf", &user_mode); assert_ptr_not_null (config); assert (NULL == p11_message_last ()); assert_num_eq (CONF_USER_ONLY, user_mode); assert (p11_dict_get (config, "key1") == NULL); assert_str_eq (p11_dict_get (config, "key2"), "user2"); assert_str_eq (p11_dict_get (config, "key3"), "user3"); p11_dict_free (config); } static void test_load_globals_system_sets_invalid (void) { int user_mode = -1; p11_dict *config; int error; p11_message_clear (); config = _p11_conf_load_globals (SRCDIR "/files/test-system-invalid.conf", SRCDIR "/files/non-existant.conf", &user_mode); error = errno; assert_ptr_eq (NULL, config); assert_num_eq (EINVAL, error); assert_ptr_not_null (p11_message_last ()); p11_dict_free (config); } static void test_load_globals_user_sets_invalid (void) { int user_mode = -1; p11_dict *config; int error; p11_message_clear (); config = _p11_conf_load_globals (SRCDIR "/files/test-system-merge.conf", SRCDIR "/files/test-user-invalid.conf", &user_mode); error = errno; assert_ptr_eq (NULL, config); assert_num_eq (EINVAL, error); assert_ptr_not_null (p11_message_last ()); p11_dict_free (config); } static bool assert_msg_contains (const char *msg, const char *text) { return (msg && strstr (msg, text)) ? true : false; } static void test_load_modules_merge (void) { p11_dict *configs; p11_dict *config; p11_message_clear (); configs = _p11_conf_load_modules (CONF_USER_MERGE, SRCDIR "/files/package-modules", SRCDIR "/files/system-modules", SRCDIR "/files/user-modules"); assert_ptr_not_null (configs); assert (assert_msg_contains (p11_message_last (), "invalid config filename")); config = p11_dict_get (configs, "one"); assert_ptr_not_null (config); assert_str_eq ("mock-one.so", p11_dict_get (config, "module")); assert_str_eq (p11_dict_get (config, "setting"), "user1"); config = p11_dict_get (configs, "two.badname"); assert_ptr_not_null (config); assert_str_eq ("mock-two.so", p11_dict_get (config, "module")); assert_str_eq (p11_dict_get (config, "setting"), "system2"); config = p11_dict_get (configs, "three"); assert_ptr_not_null (config); assert_str_eq ("mock-three.so", p11_dict_get (config, "module")); assert_str_eq (p11_dict_get (config, "setting"), "user3"); p11_dict_free (configs); } static void test_load_modules_user_none (void) { p11_dict *configs; p11_dict *config; p11_message_clear (); configs = _p11_conf_load_modules (CONF_USER_NONE, SRCDIR "/files/package-modules", SRCDIR "/files/system-modules", SRCDIR "/files/user-modules"); assert_ptr_not_null (configs); assert (assert_msg_contains (p11_message_last (), "invalid config filename")); config = p11_dict_get (configs, "one"); assert_ptr_not_null (config); assert_str_eq ("mock-one.so", p11_dict_get (config, "module")); assert_str_eq (p11_dict_get (config, "setting"), "system1"); config = p11_dict_get (configs, "two.badname"); assert_ptr_not_null (config); assert_str_eq ("mock-two.so", p11_dict_get (config, "module")); assert_str_eq (p11_dict_get (config, "setting"), "system2"); config = p11_dict_get (configs, "three"); assert_ptr_eq (NULL, config); p11_dict_free (configs); } static void test_load_modules_user_only (void) { p11_dict *configs; p11_dict *config; p11_message_clear (); configs = _p11_conf_load_modules (CONF_USER_ONLY, SRCDIR "/files/package-modules", SRCDIR "/files/system-modules", SRCDIR "/files/user-modules"); assert_ptr_not_null (configs); assert_ptr_eq (NULL, (void *)p11_message_last ()); config = p11_dict_get (configs, "one"); assert_ptr_not_null (config); assert (p11_dict_get (config, "module") == NULL); assert_str_eq (p11_dict_get (config, "setting"), "user1"); config = p11_dict_get (configs, "two.badname"); assert_ptr_eq (NULL, config); config = p11_dict_get (configs, "three"); assert_ptr_not_null (config); assert_str_eq ("mock-three.so", p11_dict_get (config, "module")); assert_str_eq (p11_dict_get (config, "setting"), "user3"); p11_dict_free (configs); } static void test_load_modules_no_user (void) { p11_dict *configs; p11_dict *config; p11_message_clear (); configs = _p11_conf_load_modules (CONF_USER_MERGE, SRCDIR "/files/package-modules", SRCDIR "/files/system-modules", SRCDIR "/files/non-existant"); assert_ptr_not_null (configs); assert (assert_msg_contains (p11_message_last (), "invalid config filename")); config = p11_dict_get (configs, "one"); assert_ptr_not_null (config); assert_str_eq ("mock-one.so", p11_dict_get (config, "module")); assert_str_eq (p11_dict_get (config, "setting"), "system1"); config = p11_dict_get (configs, "two.badname"); assert_ptr_not_null (config); assert_str_eq ("mock-two.so", p11_dict_get (config, "module")); assert_str_eq (p11_dict_get (config, "setting"), "system2"); config = p11_dict_get (configs, "three"); assert_ptr_eq (NULL, config); p11_dict_free (configs); } static void test_parse_boolean (void) { p11_message_quiet (); assert_num_eq (true, _p11_conf_parse_boolean ("yes", false)); assert_num_eq (false, _p11_conf_parse_boolean ("no", true)); assert_num_eq (true, _p11_conf_parse_boolean ("!!!", true)); } #ifdef OS_UNIX static void test_setuid (void) { const char *args[] = { BUILDDIR "/frob-setuid", NULL, }; char *path; int ret; /* This is the 'number' setting set in one.module user configuration. */ ret = p11_test_run_child (args, true); assert_num_eq (ret, 33); path = p11_test_copy_setgid (args[0]); if (path == NULL) return; args[0] = path; /* This is the 'number' setting set in one.module system configuration. */ ret = p11_test_run_child (args, true); assert_num_eq (ret, 18); if (unlink (path) < 0) assert_fail ("unlink failed", strerror (errno)); free (path); } #endif /* OS_UNIX */ int main (int argc, char *argv[]) { p11_test (test_parse_conf_1, "/conf/test_parse_conf_1"); p11_test (test_parse_ignore_missing, "/conf/test_parse_ignore_missing"); p11_test (test_parse_fail_missing, "/conf/test_parse_fail_missing"); p11_test (test_merge_defaults, "/conf/test_merge_defaults"); p11_test (test_load_globals_merge, "/conf/test_load_globals_merge"); p11_test (test_load_globals_no_user, "/conf/test_load_globals_no_user"); p11_test (test_load_globals_system_sets_only, "/conf/test_load_globals_system_sets_only"); p11_test (test_load_globals_user_sets_only, "/conf/test_load_globals_user_sets_only"); p11_test (test_load_globals_system_sets_invalid, "/conf/test_load_globals_system_sets_invalid"); p11_test (test_load_globals_user_sets_invalid, "/conf/test_load_globals_user_sets_invalid"); p11_test (test_load_modules_merge, "/conf/test_load_modules_merge"); p11_test (test_load_modules_no_user, "/conf/test_load_modules_no_user"); p11_test (test_load_modules_user_only, "/conf/test_load_modules_user_only"); p11_test (test_load_modules_user_none, "/conf/test_load_modules_user_none"); p11_test (test_parse_boolean, "/conf/test_parse_boolean"); #ifdef OS_UNIX /* Don't run this test when under fakeroot */ if (!getenv ("FAKED_MODE")) { p11_test (test_setuid, "/conf/setuid"); } #endif return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/test-uri.c0000664000175000017500000010045412226763526014173 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "debug.h" #include "message.h" #include #include #include #include #include "p11-kit/uri.h" #include "p11-kit/private.h" static int is_module_empty (P11KitUri *uri) { CK_INFO_PTR info = p11_kit_uri_get_module_info (uri); return (info->libraryDescription[0] == 0 && info->manufacturerID[0] == 0 && info->libraryVersion.major == (CK_BYTE)-1 && info->libraryVersion.minor == (CK_BYTE)-1); } static int is_token_empty (P11KitUri *uri) { CK_TOKEN_INFO_PTR token = p11_kit_uri_get_token_info (uri); return (token->serialNumber[0] == 0 && token->manufacturerID[0] == 0 && token->label[0] == 0 && token->model[0] == 0); } static int are_attributes_empty (P11KitUri *uri) { return (p11_kit_uri_get_attribute (uri, CKA_LABEL) == NULL && p11_kit_uri_get_attribute (uri, CKA_ID) == NULL && p11_kit_uri_get_attribute (uri, CKA_CLASS) == NULL); } static void test_uri_parse (void) { P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:", P11_KIT_URI_FOR_MODULE, uri); assert_num_eq (P11_KIT_URI_OK, ret); assert (is_module_empty (uri)); assert (is_token_empty (uri)); assert (are_attributes_empty (uri)); p11_kit_uri_free (uri); } static void test_uri_parse_bad_scheme (void) { P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("http:\\example.com\test", P11_KIT_URI_FOR_ANY, uri); assert_num_eq (P11_KIT_URI_BAD_SCHEME, ret); p11_kit_uri_free (uri); } static void test_uri_parse_with_label (void) { CK_ATTRIBUTE_PTR attr; P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:object=Test%20Label", P11_KIT_URI_FOR_ANY, uri); assert_num_eq (P11_KIT_URI_OK, ret); assert (is_module_empty (uri)); assert (is_token_empty (uri)); attr = p11_kit_uri_get_attribute (uri, CKA_LABEL); assert_ptr_not_null (attr); assert (attr->ulValueLen == strlen ("Test Label")); assert (memcmp (attr->pValue, "Test Label", attr->ulValueLen) == 0); p11_kit_uri_free (uri); } static void test_uri_parse_with_label_and_klass (void) { CK_ATTRIBUTE_PTR attr; P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:object=Test%20Label;object-type=cert", P11_KIT_URI_FOR_ANY, uri); assert_num_eq (P11_KIT_URI_OK, ret); attr = p11_kit_uri_get_attribute (uri, CKA_LABEL); assert_ptr_not_null (attr); assert (attr->ulValueLen == strlen ("Test Label")); assert (memcmp (attr->pValue, "Test Label", attr->ulValueLen) == 0); attr = p11_kit_uri_get_attribute (uri, CKA_CLASS); assert_ptr_not_null (attr); assert (attr->ulValueLen == sizeof (CK_OBJECT_CLASS)); assert (*((CK_OBJECT_CLASS_PTR)attr->pValue) == CKO_CERTIFICATE); p11_kit_uri_free (uri); } static void test_uri_parse_with_id (void) { CK_ATTRIBUTE_PTR attr; P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:id=%54%45%53%54%00", P11_KIT_URI_FOR_OBJECT, uri); assert_num_eq (P11_KIT_URI_OK, ret); /* Note that there's a NULL in the attribute (end) */ attr = p11_kit_uri_get_attribute (uri, CKA_ID); assert_ptr_not_null (attr); assert (attr->ulValueLen == 5); assert (memcmp (attr->pValue, "TEST", 5) == 0); p11_kit_uri_free (uri); } static void test_uri_parse_with_bad_string_encoding (void) { P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:object=Test%", P11_KIT_URI_FOR_OBJECT, uri); assert_num_eq (P11_KIT_URI_BAD_ENCODING, ret); p11_kit_uri_free (uri); } static void test_uri_parse_with_bad_hex_encoding (void) { P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:object=T%xxest", P11_KIT_URI_FOR_OBJECT, uri); assert_num_eq (P11_KIT_URI_BAD_ENCODING, ret); p11_kit_uri_free (uri); } static bool is_space_string (CK_UTF8CHAR_PTR string, CK_ULONG size, const char *check) { size_t i, len = strlen (check); if (len > size) return false; if (memcmp (string, check, len) != 0) return false; for (i = len; i < size; ++i) if (string[i] != ' ') return false; return true; } static void test_uri_parse_with_token (void) { P11KitUri *uri = NULL; CK_TOKEN_INFO_PTR token; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:token=Token%20Label;serial=3333;model=Deluxe;manufacturer=Me", P11_KIT_URI_FOR_TOKEN, uri); assert_num_eq (P11_KIT_URI_OK, ret); token = p11_kit_uri_get_token_info (uri); assert (is_space_string (token->label, sizeof (token->label), "Token Label")); assert (is_space_string (token->serialNumber, sizeof (token->serialNumber), "3333")); assert (is_space_string (token->model, sizeof (token->model), "Deluxe")); assert (is_space_string (token->manufacturerID, sizeof (token->manufacturerID), "Me")); p11_kit_uri_free (uri); } static void test_uri_parse_with_token_bad_encoding (void) { P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:token=Token%", P11_KIT_URI_FOR_TOKEN, uri); assert_num_eq (P11_KIT_URI_BAD_ENCODING, ret); p11_kit_uri_free (uri); } static void test_uri_parse_with_bad_syntax (void) { P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:token", P11_KIT_URI_FOR_ANY, uri); assert_num_eq (P11_KIT_URI_BAD_SYNTAX, ret); p11_kit_uri_free (uri); } static void test_uri_parse_with_spaces (void) { P11KitUri *uri = NULL; CK_INFO_PTR info; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkc\ns11: lib rary-desc\rrip \n tion =The%20Library;\n\n\nlibrary-manufacturer=\rMe", P11_KIT_URI_FOR_MODULE, uri); assert_num_eq (P11_KIT_URI_OK, ret); info = p11_kit_uri_get_module_info (uri); assert (is_space_string (info->manufacturerID, sizeof (info->manufacturerID), "Me")); assert (is_space_string (info->libraryDescription, sizeof (info->libraryDescription), "The Library")); p11_kit_uri_free (uri); } static void test_uri_parse_with_library (void) { P11KitUri *uri = NULL; CK_INFO_PTR info; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:library-description=The%20Library;library-manufacturer=Me", P11_KIT_URI_FOR_MODULE, uri); assert_num_eq (P11_KIT_URI_OK, ret); info = p11_kit_uri_get_module_info (uri); assert (is_space_string (info->manufacturerID, sizeof (info->manufacturerID), "Me")); assert (is_space_string (info->libraryDescription, sizeof (info->libraryDescription), "The Library")); p11_kit_uri_free (uri); } static void test_uri_parse_with_library_bad_encoding (void) { P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:library-description=Library%", P11_KIT_URI_FOR_MODULE, uri); assert_num_eq (P11_KIT_URI_BAD_ENCODING, ret); p11_kit_uri_free (uri); } static void test_uri_build_empty (void) { P11KitUri *uri; char *string; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); assert_str_eq ("pkcs11:", string); free (string); p11_kit_uri_free (uri); } static void set_space_string (CK_BYTE_PTR buffer, CK_ULONG length, const char *string) { size_t len = strlen (string); assert (len <= length); memset (buffer, ' ', length); memcpy (buffer, string, len); } static void test_uri_build_with_token_info (void) { char *string = NULL; P11KitUri *uri; P11KitUri *check; CK_TOKEN_INFO_PTR token; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); token = p11_kit_uri_get_token_info (uri); set_space_string (token->label, sizeof (token->label), "The Label"); set_space_string (token->serialNumber, sizeof (token->serialNumber), "44444"); set_space_string (token->manufacturerID, sizeof (token->manufacturerID), "Me"); set_space_string (token->model, sizeof (token->model), "Deluxe"); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); assert_ptr_not_null (string); check = p11_kit_uri_new (); assert_ptr_not_null (check); ret = p11_kit_uri_parse (string, P11_KIT_URI_FOR_TOKEN, check); assert_num_eq (P11_KIT_URI_OK, ret); p11_kit_uri_match_token_info (check, p11_kit_uri_get_token_info (uri)); p11_kit_uri_free (uri); p11_kit_uri_free (check); assert (strstr (string, "token=The%20Label") != NULL); assert (strstr (string, "serial=44444") != NULL); assert (strstr (string, "manufacturer=Me") != NULL); assert (strstr (string, "model=Deluxe") != NULL); free (string); } static void test_uri_build_with_token_null_info (void) { char *string = NULL; P11KitUri *uri; CK_TOKEN_INFO_PTR token; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); token = p11_kit_uri_get_token_info (uri); set_space_string (token->label, sizeof (token->label), "The Label"); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); assert (strstr (string, "token=The%20Label") != NULL); assert (strstr (string, "serial=") == NULL); free (string); p11_kit_uri_free (uri); } static void test_uri_build_with_token_empty_info (void) { char *string = NULL; P11KitUri *uri; CK_TOKEN_INFO_PTR token; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); token = p11_kit_uri_get_token_info (uri); set_space_string (token->label, sizeof (token->label), ""); set_space_string (token->serialNumber, sizeof (token->serialNumber), ""); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); assert (strstr (string, "token=") != NULL); assert (strstr (string, "serial=") != NULL); free (string); p11_kit_uri_free (uri); } static void test_uri_build_with_attributes (void) { char *string = NULL; P11KitUri *uri; P11KitUri *check; CK_OBJECT_CLASS klass; CK_ATTRIBUTE_PTR attr; CK_ATTRIBUTE at; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); at.type = CKA_LABEL; at.pValue = "The Label"; at.ulValueLen = 9; ret = p11_kit_uri_set_attribute (uri, &at); at.type = CKA_ID; at.pValue = "HELLO"; at.ulValueLen = 5; ret = p11_kit_uri_set_attribute (uri, &at); klass = CKO_DATA; at.type = CKA_CLASS; at.pValue = &klass; at.ulValueLen = sizeof (klass); ret = p11_kit_uri_set_attribute (uri, &at); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); check = p11_kit_uri_new (); assert_ptr_not_null (check); ret = p11_kit_uri_parse (string, P11_KIT_URI_FOR_ANY, check); assert_num_eq (P11_KIT_URI_OK, ret); attr = p11_kit_uri_get_attribute (check, CKA_LABEL); assert_ptr_not_null (attr); assert (attr->ulValueLen == 9); assert (memcmp (attr->pValue, "The Label", attr->ulValueLen) == 0); attr = p11_kit_uri_get_attribute (check, CKA_CLASS); assert_ptr_not_null (attr); assert (attr->ulValueLen == sizeof (klass)); assert (*((CK_OBJECT_CLASS_PTR)attr->pValue) == klass); attr = p11_kit_uri_get_attribute (check, CKA_ID); assert_ptr_not_null (attr); assert (attr->ulValueLen == 5); assert (memcmp (attr->pValue, "HELLO", attr->ulValueLen) == 0); p11_kit_uri_free (check); assert (strstr (string, "object=The%20Label") != NULL); assert (strstr (string, "object-type=data") != NULL); assert (strstr (string, "id=%48%45%4c%4c%4f") != NULL); free (string); p11_kit_uri_free (uri); } static void test_uri_parse_private_key (void) { P11KitUri *uri; CK_ATTRIBUTE_PTR attr; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:object-type=private", P11_KIT_URI_FOR_OBJECT, uri); assert_num_eq (P11_KIT_URI_OK, ret); attr = p11_kit_uri_get_attribute (uri, CKA_CLASS); assert_ptr_not_null (attr); assert (attr->ulValueLen == sizeof (CK_OBJECT_CLASS)); assert (*((CK_OBJECT_CLASS_PTR)attr->pValue) == CKO_PRIVATE_KEY); p11_kit_uri_free (uri); } static void test_uri_parse_secret_key (void) { P11KitUri *uri; CK_ATTRIBUTE_PTR attr; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:object-type=secret-key", P11_KIT_URI_FOR_OBJECT, uri); assert_num_eq (P11_KIT_URI_OK, ret); attr = p11_kit_uri_get_attribute (uri, CKA_CLASS); assert_ptr_not_null (attr); assert (attr->ulValueLen == sizeof (CK_OBJECT_CLASS)); assert (*((CK_OBJECT_CLASS_PTR)attr->pValue) == CKO_SECRET_KEY); p11_kit_uri_free (uri); } static void test_uri_parse_library_version (void) { P11KitUri *uri; CK_INFO_PTR info; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:library-version=2.101", P11_KIT_URI_FOR_MODULE_WITH_VERSION, uri); assert_num_eq (P11_KIT_URI_OK, ret); info = p11_kit_uri_get_module_info (uri); assert_num_eq (2, info->libraryVersion.major); assert_num_eq (101, info->libraryVersion.minor); ret = p11_kit_uri_parse ("pkcs11:library-version=23", P11_KIT_URI_FOR_MODULE_WITH_VERSION, uri); assert_num_eq (P11_KIT_URI_OK, ret); info = p11_kit_uri_get_module_info (uri); assert_num_eq (23, info->libraryVersion.major); assert_num_eq (0, info->libraryVersion.minor); ret = p11_kit_uri_parse ("pkcs11:library-version=23.", P11_KIT_URI_FOR_MODULE_WITH_VERSION, uri); assert_num_eq (P11_KIT_URI_BAD_VERSION, ret); ret = p11_kit_uri_parse ("pkcs11:library-version=a.a", P11_KIT_URI_FOR_MODULE_WITH_VERSION, uri); assert_num_eq (P11_KIT_URI_BAD_VERSION, ret); ret = p11_kit_uri_parse ("pkcs11:library-version=.23", P11_KIT_URI_FOR_MODULE_WITH_VERSION, uri); assert_num_eq (P11_KIT_URI_BAD_VERSION, ret); ret = p11_kit_uri_parse ("pkcs11:library-version=1000", P11_KIT_URI_FOR_MODULE_WITH_VERSION, uri); assert_num_eq (P11_KIT_URI_BAD_VERSION, ret); ret = p11_kit_uri_parse ("pkcs11:library-version=2.1000", P11_KIT_URI_FOR_MODULE_WITH_VERSION, uri); assert_num_eq (P11_KIT_URI_BAD_VERSION, ret); p11_kit_uri_free (uri); } static void test_uri_parse_parse_unknown_object_type (void) { P11KitUri *uri; CK_ATTRIBUTE_PTR attr; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:object-type=unknown", P11_KIT_URI_FOR_OBJECT, uri); assert_num_eq (P11_KIT_URI_OK, ret); attr = p11_kit_uri_get_attribute (uri, CKA_CLASS); assert_ptr_eq (NULL, attr); p11_kit_uri_free (uri); } static void test_uri_parse_unrecognized (void) { P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:x-blah=some-value", P11_KIT_URI_FOR_ANY, uri); assert_num_eq (P11_KIT_URI_OK, ret); ret = p11_kit_uri_any_unrecognized (uri); assert_num_eq (1, ret); p11_kit_uri_free (uri); } static void test_uri_parse_too_long_is_unrecognized (void) { P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:model=a-value-that-is-too-long-for-the-field-that-it-goes-with", P11_KIT_URI_FOR_ANY, uri); assert_num_eq (P11_KIT_URI_OK, ret); ret = p11_kit_uri_any_unrecognized (uri); assert_num_eq (1, ret); p11_kit_uri_free (uri); } static void test_uri_build_object_type_cert (void) { CK_ATTRIBUTE attr; CK_OBJECT_CLASS klass; P11KitUri *uri; char *string; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); klass = CKO_CERTIFICATE; attr.type = CKA_CLASS; attr.pValue = &klass; attr.ulValueLen = sizeof (klass); p11_kit_uri_set_attribute (uri, &attr); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); assert (strstr (string, "object-type=cert") != NULL); p11_kit_uri_free (uri); free (string); } static void test_uri_build_object_type_private (void) { CK_ATTRIBUTE attr; CK_OBJECT_CLASS klass; P11KitUri *uri; char *string; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); klass = CKO_PRIVATE_KEY; attr.type = CKA_CLASS; attr.pValue = &klass; attr.ulValueLen = sizeof (klass); p11_kit_uri_set_attribute (uri, &attr); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); assert (strstr (string, "object-type=private") != NULL); p11_kit_uri_free (uri); free (string); } static void test_uri_build_object_type_public (void) { CK_ATTRIBUTE attr; CK_OBJECT_CLASS klass; P11KitUri *uri; char *string; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); klass = CKO_PUBLIC_KEY; attr.type = CKA_CLASS; attr.pValue = &klass; attr.ulValueLen = sizeof (klass); p11_kit_uri_set_attribute (uri, &attr); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); assert (strstr (string, "object-type=public") != NULL); p11_kit_uri_free (uri); free (string); } static void test_uri_build_object_type_secret (void) { CK_ATTRIBUTE attr; CK_OBJECT_CLASS klass; P11KitUri *uri; char *string; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); klass = CKO_SECRET_KEY; attr.type = CKA_CLASS; attr.pValue = &klass; attr.ulValueLen = sizeof (klass); p11_kit_uri_set_attribute (uri, &attr); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); assert (strstr (string, "object-type=secret-key") != NULL); p11_kit_uri_free (uri); free (string); } static void test_uri_build_with_library (void) { CK_INFO_PTR info; P11KitUri *uri; char *string; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); info = p11_kit_uri_get_module_info (uri); set_space_string (info->libraryDescription, sizeof (info->libraryDescription), "The Description"); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); assert (strstr (string, "library-description=The%20Description") != NULL); p11_kit_uri_free (uri); free (string); } static void test_uri_build_library_version (void) { CK_INFO_PTR info; P11KitUri *uri; char *string; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); info = p11_kit_uri_get_module_info (uri); info->libraryVersion.major = 2; info->libraryVersion.minor = 10; ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); assert (strstr (string, "library-version=2.10") != NULL); p11_kit_uri_free (uri); free (string); } static void test_uri_get_set_unrecognized (void) { P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_any_unrecognized (uri); assert_num_eq (0, ret); p11_kit_uri_set_unrecognized (uri, 1); ret = p11_kit_uri_any_unrecognized (uri); assert_num_eq (1, ret); p11_kit_uri_set_unrecognized (uri, 0); ret = p11_kit_uri_any_unrecognized (uri); assert_num_eq (0, ret); p11_kit_uri_free (uri); } static void test_uri_match_token (void) { CK_TOKEN_INFO token; P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:model=Giselle", P11_KIT_URI_FOR_ANY, uri); assert_num_eq (P11_KIT_URI_OK, ret); set_space_string (token.label, sizeof (token.label), "A label"); set_space_string (token.model, sizeof (token.model), "Giselle"); ret = p11_kit_uri_match_token_info (uri, &token); assert_num_eq (1, ret); set_space_string (token.label, sizeof (token.label), "Another label"); ret = p11_kit_uri_match_token_info (uri, &token); assert_num_eq (1, ret); set_space_string (token.model, sizeof (token.model), "Zoolander"); ret = p11_kit_uri_match_token_info (uri, &token); assert_num_eq (0, ret); p11_kit_uri_set_unrecognized (uri, 1); ret = p11_kit_uri_match_token_info (uri, &token); assert_num_eq (0, ret); p11_kit_uri_free (uri); } static void test_uri_match_module (void) { CK_INFO info; P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:library-description=Quiet", P11_KIT_URI_FOR_ANY, uri); assert_num_eq (P11_KIT_URI_OK, ret); set_space_string (info.libraryDescription, sizeof (info.libraryDescription), "Quiet"); set_space_string (info.manufacturerID, sizeof (info.manufacturerID), "Someone"); ret = p11_kit_uri_match_module_info (uri, &info); assert_num_eq (1, ret); set_space_string (info.manufacturerID, sizeof (info.manufacturerID), "Someone else"); ret = p11_kit_uri_match_module_info (uri, &info); assert_num_eq (1, ret); set_space_string (info.libraryDescription, sizeof (info.libraryDescription), "Leise"); ret = p11_kit_uri_match_module_info (uri, &info); assert_num_eq (0, ret); p11_kit_uri_set_unrecognized (uri, 1); ret = p11_kit_uri_match_module_info (uri, &info); assert_num_eq (0, ret); p11_kit_uri_free (uri); } static void test_uri_match_version (void) { CK_INFO info; P11KitUri *uri; int ret; memset (&info, 0, sizeof (info)); uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:library-version=5.8", P11_KIT_URI_FOR_ANY, uri); assert_num_eq (P11_KIT_URI_OK, ret); info.libraryVersion.major = 5; info.libraryVersion.minor = 8; ret = p11_kit_uri_match_module_info (uri, &info); assert_num_eq (1, ret); info.libraryVersion.major = 2; info.libraryVersion.minor = 3; ret = p11_kit_uri_match_module_info (uri, &info); assert_num_eq (0, ret); p11_kit_uri_free (uri); } static void test_uri_match_attributes (void) { CK_ATTRIBUTE attrs[4]; CK_OBJECT_CLASS klass; P11KitUri *uri; int ret; attrs[0].type = CKA_ID; attrs[0].pValue = "Blah"; attrs[0].ulValueLen = 4; attrs[1].type = CKA_LABEL; attrs[1].pValue = "Junk"; attrs[1].ulValueLen = 4; attrs[2].type = CKA_COLOR; attrs[2].pValue = "blue"; attrs[2].ulValueLen = 4; klass = CKO_DATA; attrs[3].type = CKA_CLASS; attrs[3].pValue = &klass; attrs[3].ulValueLen = sizeof (klass); uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ret = p11_kit_uri_parse ("pkcs11:object=Fancy;id=Blah;object-type=data", P11_KIT_URI_FOR_ANY, uri); assert_num_eq (P11_KIT_URI_OK, ret); ret = p11_kit_uri_match_attributes (uri, attrs, 4); assert_num_eq (0, ret); attrs[1].pValue = "Fancy"; attrs[1].ulValueLen = 5; ret = p11_kit_uri_match_attributes (uri, attrs, 4); assert_num_eq (1, ret); p11_kit_uri_clear_attribute (uri, CKA_CLASS); ret = p11_kit_uri_match_attributes (uri, attrs, 4); assert_num_eq (1, ret); attrs[2].pValue = "pink"; ret = p11_kit_uri_match_attributes (uri, attrs, 4); assert_num_eq (1, ret); p11_kit_uri_set_unrecognized (uri, 1); ret = p11_kit_uri_match_attributes (uri, attrs, 4); assert_num_eq (0, ret); p11_kit_uri_free (uri); } static void test_uri_get_set_attribute (void) { CK_ATTRIBUTE attr; CK_ATTRIBUTE_PTR ptr; P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); ptr = p11_kit_uri_get_attribute (uri, CKA_LABEL); assert_ptr_eq (NULL, ptr); ret = p11_kit_uri_clear_attribute (uri, CKA_LABEL); assert_num_eq (P11_KIT_URI_OK, ret); ret = p11_kit_uri_clear_attribute (uri, CKA_COLOR); assert_num_eq (P11_KIT_URI_NOT_FOUND, ret); attr.type = CKA_LABEL; attr.pValue = "Test"; attr.ulValueLen = 4; ret = p11_kit_uri_set_attribute (uri, &attr); assert_num_eq (P11_KIT_URI_OK, ret); /* We can set other attributes */ attr.type = CKA_COLOR; ret = p11_kit_uri_set_attribute (uri, &attr); assert_num_eq (P11_KIT_URI_OK, ret); /* And get them too */ ptr = p11_kit_uri_get_attribute (uri, CKA_COLOR); assert_ptr_not_null (ptr); ptr = p11_kit_uri_get_attribute (uri, CKA_LABEL); assert_ptr_not_null (ptr); assert (ptr->type == CKA_LABEL); assert (ptr->ulValueLen == 4); assert (memcmp (ptr->pValue, "Test", 4) == 0); ret = p11_kit_uri_clear_attribute (uri, CKA_LABEL); assert_num_eq (P11_KIT_URI_OK, ret); ptr = p11_kit_uri_get_attribute (uri, CKA_LABEL); assert_ptr_eq (NULL, ptr); p11_kit_uri_free (uri); } static void test_uri_get_set_attributes (void) { CK_ATTRIBUTE_PTR attrs; CK_OBJECT_CLASS klass; CK_ATTRIBUTE attr; CK_ULONG n_attrs; P11KitUri *uri; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); attrs = p11_kit_uri_get_attributes (uri, &n_attrs); assert_ptr_not_null (attrs); assert_num_eq (0, n_attrs); attr.type = CKA_LABEL; attr.pValue = "Test"; attr.ulValueLen = 4; ret = p11_kit_uri_set_attribute (uri, &attr); assert_num_eq (P11_KIT_URI_OK, ret); attrs = p11_kit_uri_get_attributes (uri, &n_attrs); assert_ptr_not_null (attrs); assert_num_eq (1, n_attrs); assert (attrs[0].type == CKA_LABEL); assert (attrs[0].ulValueLen == 4); assert (memcmp (attrs[0].pValue, "Test", 4) == 0); attr.type = CKA_LABEL; attr.pValue = "Kablooey"; attr.ulValueLen = 8; ret = p11_kit_uri_set_attribute (uri, &attr); assert_num_eq (P11_KIT_URI_OK, ret); attrs = p11_kit_uri_get_attributes (uri, &n_attrs); assert_ptr_not_null (attrs); assert_num_eq (1, n_attrs); assert (attrs[0].type == CKA_LABEL); assert (attrs[0].ulValueLen == 8); assert (memcmp (attrs[0].pValue, "Kablooey", 8) == 0); klass = CKO_DATA; attr.type = CKA_CLASS; attr.pValue = &klass; attr.ulValueLen = sizeof (klass); ret = p11_kit_uri_set_attribute (uri, &attr); assert_num_eq (P11_KIT_URI_OK, ret); attrs = p11_kit_uri_get_attributes (uri, &n_attrs); assert_ptr_not_null (attrs); assert_num_eq (2, n_attrs); assert (attrs[0].type == CKA_LABEL); assert (attrs[0].ulValueLen == 8); assert (memcmp (attrs[0].pValue, "Kablooey", 8) == 0); assert (attrs[1].type == CKA_CLASS); assert (attrs[1].ulValueLen == sizeof (klass)); assert (memcmp (attrs[1].pValue, &klass, sizeof (klass)) == 0); ret = p11_kit_uri_clear_attribute (uri, CKA_LABEL); assert_num_eq (P11_KIT_URI_OK, ret); attrs = p11_kit_uri_get_attributes (uri, &n_attrs); assert_ptr_not_null (attrs); assert_num_eq (1, n_attrs); assert (attrs[0].type == CKA_CLASS); assert (attrs[0].ulValueLen == sizeof (klass)); assert (memcmp (attrs[0].pValue, &klass, sizeof (klass)) == 0); attr.type = CKA_LABEL; attr.pValue = "Three"; attr.ulValueLen = 5; ret = p11_kit_uri_set_attributes (uri, &attr, 1); assert_num_eq (P11_KIT_URI_OK, ret); attrs = p11_kit_uri_get_attributes (uri, &n_attrs); assert_ptr_not_null (attrs); assert_num_eq (1, n_attrs); assert (attrs[0].type == CKA_LABEL); assert (attrs[0].ulValueLen == 5); assert (memcmp (attrs[0].pValue, "Three", 5) == 0); p11_kit_uri_clear_attributes (uri); attrs = p11_kit_uri_get_attributes (uri, &n_attrs); assert_ptr_not_null (attrs); assert_num_eq (0, n_attrs); p11_kit_uri_free (uri); } static void test_uri_pin_source (void) { P11KitUri *uri; const char *pin_source; char *string; int ret; uri = p11_kit_uri_new (); assert_ptr_not_null (uri); p11_kit_uri_set_pin_source (uri, "|my-pin-source"); pin_source = p11_kit_uri_get_pin_source (uri); assert_str_eq ("|my-pin-source", pin_source); pin_source = p11_kit_uri_get_pinfile (uri); assert_str_eq ("|my-pin-source", pin_source); p11_kit_uri_set_pinfile (uri, "|my-pin-file"); pin_source = p11_kit_uri_get_pin_source (uri); assert_str_eq ("|my-pin-file", pin_source); ret = p11_kit_uri_format (uri, P11_KIT_URI_FOR_ANY, &string); assert_num_eq (P11_KIT_URI_OK, ret); assert (strstr (string, "pin-source=%7cmy-pin-file") != NULL); free (string); ret = p11_kit_uri_parse ("pkcs11:pin-source=blah%2Fblah", P11_KIT_URI_FOR_ANY, uri); assert_num_eq (P11_KIT_URI_OK, ret); pin_source = p11_kit_uri_get_pin_source (uri); assert_str_eq ("blah/blah", pin_source); p11_kit_uri_free (uri); } static void test_uri_free_null (void) { p11_kit_uri_free (NULL); } static void test_uri_message (void) { assert (p11_kit_uri_message (P11_KIT_URI_OK) == NULL); assert_ptr_not_null (p11_kit_uri_message (P11_KIT_URI_UNEXPECTED)); assert_ptr_not_null (p11_kit_uri_message (-555555)); } int main (int argc, char *argv[]) { p11_test (test_uri_parse, "/uri/test_uri_parse"); p11_test (test_uri_parse_bad_scheme, "/uri/test_uri_parse_bad_scheme"); p11_test (test_uri_parse_with_label, "/uri/test_uri_parse_with_label"); p11_test (test_uri_parse_with_label_and_klass, "/uri/test_uri_parse_with_label_and_klass"); p11_test (test_uri_parse_with_id, "/uri/test_uri_parse_with_id"); p11_test (test_uri_parse_with_bad_string_encoding, "/uri/test_uri_parse_with_bad_string_encoding"); p11_test (test_uri_parse_with_bad_hex_encoding, "/uri/test_uri_parse_with_bad_hex_encoding"); p11_test (test_uri_parse_with_token, "/uri/test_uri_parse_with_token"); p11_test (test_uri_parse_with_token_bad_encoding, "/uri/test_uri_parse_with_token_bad_encoding"); p11_test (test_uri_parse_with_bad_syntax, "/uri/test_uri_parse_with_bad_syntax"); p11_test (test_uri_parse_with_spaces, "/uri/test_uri_parse_with_spaces"); p11_test (test_uri_parse_with_library, "/uri/test_uri_parse_with_library"); p11_test (test_uri_parse_with_library_bad_encoding, "/uri/test_uri_parse_with_library_bad_encoding"); p11_test (test_uri_build_empty, "/uri/test_uri_build_empty"); p11_test (test_uri_build_with_token_info, "/uri/test_uri_build_with_token_info"); p11_test (test_uri_build_with_token_null_info, "/uri/test_uri_build_with_token_null_info"); p11_test (test_uri_build_with_token_empty_info, "/uri/test_uri_build_with_token_empty_info"); p11_test (test_uri_build_with_attributes, "/uri/test_uri_build_with_attributes"); p11_test (test_uri_parse_private_key, "/uri/test_uri_parse_private_key"); p11_test (test_uri_parse_secret_key, "/uri/test_uri_parse_secret_key"); p11_test (test_uri_parse_library_version, "/uri/test_uri_parse_library_version"); p11_test (test_uri_parse_parse_unknown_object_type, "/uri/test_uri_parse_parse_unknown_object_type"); p11_test (test_uri_parse_unrecognized, "/uri/test_uri_parse_unrecognized"); p11_test (test_uri_parse_too_long_is_unrecognized, "/uri/test_uri_parse_too_long_is_unrecognized"); p11_test (test_uri_build_object_type_cert, "/uri/test_uri_build_object_type_cert"); p11_test (test_uri_build_object_type_private, "/uri/test_uri_build_object_type_private"); p11_test (test_uri_build_object_type_public, "/uri/test_uri_build_object_type_public"); p11_test (test_uri_build_object_type_secret, "/uri/test_uri_build_object_type_secret"); p11_test (test_uri_build_with_library, "/uri/test_uri_build_with_library"); p11_test (test_uri_build_library_version, "/uri/test_uri_build_library_version"); p11_test (test_uri_get_set_unrecognized, "/uri/test_uri_get_set_unrecognized"); p11_test (test_uri_match_token, "/uri/test_uri_match_token"); p11_test (test_uri_match_module, "/uri/test_uri_match_module"); p11_test (test_uri_match_version, "/uri/test_uri_match_version"); p11_test (test_uri_match_attributes, "/uri/test_uri_match_attributes"); p11_test (test_uri_get_set_attribute, "/uri/test_uri_get_set_attribute"); p11_test (test_uri_get_set_attributes, "/uri/test_uri_get_set_attributes"); p11_test (test_uri_pin_source, "/uri/test_uri_pin_source"); p11_test (test_uri_free_null, "/uri/test_uri_free_null"); p11_test (test_uri_message, "/uri/test_uri_message"); return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/test-virtual.c0000664000175000017500000001122212226763526015054 00000000000000/* * Copyright (c) 2012 Stefan Walter * Copyright (c) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "library.h" #include "p11-kit.h" #include "private.h" #include "virtual.h" #include "test.h" #include "mock.h" #include #include #include #include #include /* * test-managed.c is a pretty good test of the closure code, so we * just test a few things here. */ typedef struct { p11_virtual virt; void *check; } Override; static CK_RV override_initialize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR args) { Override *over = (Override *)self; assert_str_eq ("initialize-arg", args); assert_str_eq ("overide-arg", over->check); /* An arbitrary error code to check */ return CKR_NEED_TO_CREATE_THREADS; } static bool test_destroyed = false; static void test_destroyer (void *data) { assert (data == &mock_x_module_no_slots); assert (test_destroyed == false); test_destroyed = true; } static void test_initialize (void) { CK_FUNCTION_LIST_PTR module; Override over = { }; CK_RV rv; p11_virtual_init (&over.virt, &p11_virtual_stack, &mock_x_module_no_slots, test_destroyer); over.virt.funcs.C_Initialize = override_initialize; over.check = "overide-arg"; test_destroyed = false; module = p11_virtual_wrap (&over.virt, (p11_destroyer)p11_virtual_uninit); assert_ptr_not_null (module); rv = (module->C_Initialize) ("initialize-arg"); assert_num_eq (CKR_NEED_TO_CREATE_THREADS, rv); p11_virtual_unwrap (module); assert_num_eq (true, test_destroyed); } static void test_fall_through (void) { CK_FUNCTION_LIST_PTR module; Override over = { }; p11_virtual base; CK_RV rv; p11_virtual_init (&base, &p11_virtual_base, &mock_module_no_slots, NULL); p11_virtual_init (&over.virt, &p11_virtual_stack, &base, NULL); over.virt.funcs.C_Initialize = override_initialize; over.check = "overide-arg"; module = p11_virtual_wrap (&over.virt, NULL); assert_ptr_not_null (module); rv = (module->C_Initialize) ("initialize-arg"); assert_num_eq (CKR_NEED_TO_CREATE_THREADS, rv); /* All other functiosn should have just fallen through */ assert_ptr_eq (mock_module_no_slots.C_Finalize, module->C_Finalize); p11_virtual_unwrap (module); } static void test_get_function_list (void) { CK_FUNCTION_LIST_PTR module; CK_FUNCTION_LIST_PTR list; p11_virtual virt; CK_RV rv; p11_virtual_init (&virt, &p11_virtual_base, &mock_x_module_no_slots, NULL); module = p11_virtual_wrap (&virt, NULL); assert_ptr_not_null (module); rv = (module->C_GetFunctionList) (&list); assert_num_eq (CKR_OK, rv); assert_ptr_eq (module, list); rv = (module->C_GetFunctionList) (&list); assert_num_eq (CKR_OK, rv); rv = (module->C_GetFunctionList) (NULL); assert_num_eq (CKR_ARGUMENTS_BAD, rv); p11_virtual_unwrap (module); } int main (int argc, char *argv[]) { mock_module_init (); p11_library_init (); assert (p11_virtual_can_wrap ()); p11_test (test_initialize, "/virtual/test_initialize"); p11_test (test_fall_through, "/virtual/test_fall_through"); p11_test (test_get_function_list, "/virtual/test_get_function_list"); return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/frob-setuid.c0000664000175000017500000000553112226763526014642 00000000000000/* * Copyright (c) 2012 Red Hat Inc * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include #include #include #include #include "compat.h" #include "p11-kit.h" int main (void) { CK_FUNCTION_LIST **modules; CK_FUNCTION_LIST *module; char *field; char *name; int ret; int i; /* * Use 'chmod ug+s frob-setuid' to change this program * and test the output with/without setuid or setgid. */ putenv ("P11_KIT_STRICT=1"); modules = p11_kit_modules_load_and_initialize (0); assert (modules != NULL); /* This is a system configured module */ module = p11_kit_module_for_name (modules, "one"); assert (module != NULL); field = p11_kit_config_option (module, "setting"); printf ("'setting' on module 'one': %s\n", field ? field : "(null)"); assert (field != NULL); if (getauxval (AT_SECURE)) assert (strcmp (field, "system1") == 0); else assert (strcmp (field, "user1") == 0); free (field); for (i = 0; modules[i] != NULL; i++) { name = p11_kit_module_get_name (modules[i]); printf ("%s\n", name); free (name); } field = p11_kit_config_option (module, "number"); printf ("'number' on module 'one': %s\n", field ? field : "(null)"); ret = atoi (field ? field : "0"); assert (ret != 0); free (field); p11_kit_modules_finalize_and_release (modules); return ret; } p11-kit-0.20.2/p11-kit/tests/test-modules.c0000664000175000017500000002450412226763526015045 00000000000000/* * Copyright (c) 2012 Red Hat Inc * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include #include #include #include "debug.h" #include "library.h" #include "p11-kit.h" #include "private.h" #include "dict.h" static CK_FUNCTION_LIST_PTR_PTR initialize_and_get_modules (void) { CK_FUNCTION_LIST_PTR_PTR modules; modules = p11_kit_modules_load_and_initialize (0); assert (modules != NULL && modules[0] != NULL); return modules; } static void finalize_and_free_modules (CK_FUNCTION_LIST_PTR_PTR modules) { p11_kit_modules_finalize_and_release (modules); } static void test_no_duplicates (void) { CK_FUNCTION_LIST_PTR_PTR modules; p11_dict *paths; p11_dict *funcs; char *path; int i; modules = initialize_and_get_modules (); paths = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, NULL, NULL); funcs = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, NULL); /* The loaded modules should not contain duplicates */ for (i = 0; modules[i] != NULL; i++) { path = p11_kit_config_option (modules[i], "module"); if (p11_dict_get (funcs, modules[i])) assert_fail ("found duplicate function list pointer", NULL); if (p11_dict_get (paths, path)) assert_fail ("found duplicate path name", NULL); if (!p11_dict_set (funcs, modules[i], "")) assert_not_reached (); if (!p11_dict_set (paths, path, "")) assert_not_reached (); free (path); } p11_dict_free (paths); p11_dict_free (funcs); finalize_and_free_modules (modules); } static CK_FUNCTION_LIST_PTR lookup_module_with_name (CK_FUNCTION_LIST_PTR_PTR modules, const char *name) { CK_FUNCTION_LIST_PTR match = NULL; CK_FUNCTION_LIST_PTR module; char *module_name; int i; for (i = 0; match == NULL && modules[i] != NULL; i++) { module_name = p11_kit_module_get_name (modules[i]); assert_ptr_not_null (module_name); if (strcmp (module_name, name) == 0) match = modules[i]; free (module_name); } /* * As a side effect, we should check that the results of this function * matches the above search. */ module = p11_kit_module_for_name (modules, name); if (module != match) assert_fail ("different result from p11_kit_module_for_name ()", NULL); return match; } static void test_disable (void) { CK_FUNCTION_LIST_PTR_PTR modules; /* * The module four should be present, as we don't match any prognames * that it has disabled. */ modules = initialize_and_get_modules (); assert (lookup_module_with_name (modules, "four") != NULL); finalize_and_free_modules (modules); /* * The module two shouldn't have been loaded, because in its config * file we have: * * disable-in: test-disable */ p11_kit_set_progname ("test-disable"); modules = initialize_and_get_modules (); assert (lookup_module_with_name (modules, "four") == NULL); finalize_and_free_modules (modules); p11_kit_set_progname (NULL); } static void test_disable_later (void) { CK_FUNCTION_LIST_PTR_PTR modules; /* * The module two shouldn't be matched, because in its config * file we have: * * disable-in: test-disable */ p11_kit_set_progname ("test-disable"); modules = p11_kit_modules_load_and_initialize (0); assert (modules != NULL && modules[0] != NULL); assert (lookup_module_with_name (modules, "two") == NULL); finalize_and_free_modules (modules); p11_kit_set_progname (NULL); } static void test_enable (void) { CK_FUNCTION_LIST_PTR_PTR modules; /* * The module three should not be present, as we don't match the current * program. */ modules = initialize_and_get_modules (); assert (lookup_module_with_name (modules, "three") == NULL); finalize_and_free_modules (modules); /* * The module three should be loaded here , because in its config * file we have: * * enable-in: test-enable */ p11_kit_set_progname ("test-enable"); modules = initialize_and_get_modules (); assert (lookup_module_with_name (modules, "three") != NULL); finalize_and_free_modules (modules); p11_kit_set_progname (NULL); } static void test_priority (void) { CK_FUNCTION_LIST_PTR_PTR modules; char *name; int i; /* * The expected order. * - four is marked with a priority of 4, the highest therefore first * - three is marked with a priority of 3, next highest * - one and two do not have priority marked, so they default to zero * and fallback to sorting alphabetically. 'o' comes before 't' */ const char *expected[] = { "four", "three", "one", "two.badname" }; /* This enables module three */ p11_kit_set_progname ("test-enable"); modules = initialize_and_get_modules (); /* The loaded modules should not contain duplicates */ for (i = 0; modules[i] != NULL; i++) { name = p11_kit_module_get_name (modules[i]); assert_ptr_not_null (name); /* Either one of these can be loaded, as this is a duplicate module */ if (strcmp (name, "two-duplicate") == 0) { free (name); name = strdup ("two.badname"); } assert_str_eq (expected[i], name); free (name); } assert_num_eq (4, i); finalize_and_free_modules (modules); } static void test_module_name (void) { CK_FUNCTION_LIST_PTR_PTR modules; CK_FUNCTION_LIST_PTR module; char *name; /* * The module three should not be present, as we don't match the current * program. */ modules = initialize_and_get_modules (); module = p11_kit_module_for_name (modules, "one"); assert_ptr_not_null (module); name = p11_kit_module_get_name (module); assert_str_eq ("one", name); free (name); module = p11_kit_module_for_name (modules, "invalid"); assert_ptr_eq (NULL, module); module = p11_kit_module_for_name (NULL, "one"); assert_ptr_eq (NULL, module); finalize_and_free_modules (modules); } static void test_module_flags (void) { CK_FUNCTION_LIST **modules; CK_FUNCTION_LIST **unmanaged; int flags; /* * The module three should not be present, as we don't match the current * program. */ modules = initialize_and_get_modules (); flags = p11_kit_module_get_flags (modules[0]); assert_num_eq (0, flags); unmanaged = p11_kit_modules_load (NULL, P11_KIT_MODULE_UNMANAGED); assert (unmanaged != NULL && unmanaged[0] != NULL); flags = p11_kit_module_get_flags (unmanaged[0]); assert_num_eq (P11_KIT_MODULE_UNMANAGED, flags); finalize_and_free_modules (modules); p11_kit_modules_release (unmanaged); } static void test_module_trusted_only (void) { CK_FUNCTION_LIST_PTR_PTR modules; char *name; modules = p11_kit_modules_load_and_initialize (P11_KIT_MODULE_TRUSTED); assert_ptr_not_null (modules); assert_ptr_not_null (modules[0]); assert (modules[1] == NULL); name = p11_kit_module_get_name (modules[0]); assert_str_eq (name, "one"); free (name); assert_num_eq (p11_kit_module_get_flags (modules[0]), P11_KIT_MODULE_TRUSTED); finalize_and_free_modules (modules); } static void test_module_trust_flags (void) { CK_FUNCTION_LIST_PTR_PTR modules; char *name; int flags; int i; modules = initialize_and_get_modules (); assert_ptr_not_null (modules); for (i = 0; modules[i] != NULL; i++) { name = p11_kit_module_get_name (modules[i]); assert_ptr_not_null (name); flags = p11_kit_module_get_flags (modules[i]); if (strcmp (name, "one") == 0) { assert_num_eq (flags, P11_KIT_MODULE_TRUSTED); } else { assert_num_eq (flags, 0); } free (name); } finalize_and_free_modules (modules); } static void test_config_option (void) { CK_FUNCTION_LIST_PTR_PTR modules; CK_FUNCTION_LIST_PTR module; char *value; /* * The module three should not be present, as we don't match the current * program. */ modules = initialize_and_get_modules (); value = p11_kit_config_option (NULL, "new"); assert_str_eq ("world", value); free (value); module = p11_kit_module_for_name (modules, "one"); assert_ptr_not_null (module); value = p11_kit_config_option (module, "setting"); assert_str_eq ("user1", value); free (value); value = p11_kit_config_option (NULL, "invalid"); assert_ptr_eq (NULL, value); value = p11_kit_config_option (module, "invalid"); assert_ptr_eq (NULL, value); /* Invalid but non-NULL module pointer */ value = p11_kit_config_option (module + 1, "setting"); assert_ptr_eq (NULL, value); finalize_and_free_modules (modules); } int main (int argc, char *argv[]) { p11_library_init (); p11_test (test_no_duplicates, "/modules/test_no_duplicates"); p11_test (test_disable, "/modules/test_disable"); p11_test (test_disable_later, "/modules/test_disable_later"); p11_test (test_enable, "/modules/test_enable"); p11_test (test_priority, "/modules/test_priority"); p11_test (test_module_name, "/modules/test_module_name"); p11_test (test_module_flags, "/modules/test_module_flags"); p11_test (test_config_option, "/modules/test_config_option"); p11_test (test_module_trusted_only, "/modules/trusted-only"); p11_test (test_module_trust_flags, "/modules/trust-flags"); p11_kit_be_quiet (); return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/test-managed.c0000664000175000017500000001231512226763526014766 00000000000000/* * Copyright (c) 2012 Red Hat Inc * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "dict.h" #include "library.h" #include "mock.h" #include "modules.h" #include "p11-kit.h" #include "virtual.h" #include #include #include #include static CK_FUNCTION_LIST_PTR setup_mock_module (CK_SESSION_HANDLE *session) { CK_FUNCTION_LIST_PTR module; CK_RV rv; p11_lock (); rv = p11_module_load_inlock_reentrant (&mock_module, 0, &module); assert (rv == CKR_OK); assert_ptr_not_null (module); assert (p11_virtual_is_wrapper (module)); p11_unlock (); rv = p11_kit_module_initialize (module); assert (rv == CKR_OK); if (session) { rv = (module->C_OpenSession) (MOCK_SLOT_ONE_ID, CKF_RW_SESSION | CKF_SERIAL_SESSION, NULL, NULL, session); assert (rv == CKR_OK); } return module; } static void teardown_mock_module (CK_FUNCTION_LIST_PTR module) { CK_RV rv; rv = p11_kit_module_finalize (module); assert (rv == CKR_OK); p11_lock (); rv = p11_module_release_inlock_reentrant (module); assert (rv == CKR_OK); p11_unlock (); } static CK_RV fail_C_Initialize (void *init_reserved) { return CKR_FUNCTION_FAILED; } static void test_initialize_finalize (void) { CK_FUNCTION_LIST_PTR module; CK_RV rv; p11_lock (); rv = p11_module_load_inlock_reentrant (&mock_module, 0, &module); assert (rv == CKR_OK); assert_ptr_not_null (module); assert (p11_virtual_is_wrapper (module)); p11_unlock (); rv = module->C_Initialize (NULL); assert (rv == CKR_OK); rv = module->C_Initialize (NULL); assert (rv == CKR_CRYPTOKI_ALREADY_INITIALIZED); rv = module->C_Finalize (NULL); assert (rv == CKR_OK); rv = module->C_Finalize (NULL); assert (rv == CKR_CRYPTOKI_NOT_INITIALIZED); p11_lock (); rv = p11_module_release_inlock_reentrant (module); assert (rv == CKR_OK); p11_unlock (); } static void test_initialize_fail (void) { CK_FUNCTION_LIST_PTR module; CK_FUNCTION_LIST base; CK_RV rv; memcpy (&base, &mock_module, sizeof (CK_FUNCTION_LIST)); base.C_Initialize = fail_C_Initialize; p11_lock (); rv = p11_module_load_inlock_reentrant (&base, 0, &module); assert (rv == CKR_OK); p11_unlock (); rv = p11_kit_module_initialize (module); assert (rv == CKR_FUNCTION_FAILED); } static void test_separate_close_all_sessions (void) { CK_FUNCTION_LIST *first; CK_FUNCTION_LIST *second; CK_SESSION_HANDLE s1; CK_SESSION_HANDLE s2; CK_SESSION_INFO info; CK_RV rv; first = setup_mock_module (&s1); second = setup_mock_module (&s2); rv = first->C_GetSessionInfo (s1, &info); assert (rv == CKR_OK); rv = second->C_GetSessionInfo (s2, &info); assert (rv == CKR_OK); first->C_CloseAllSessions (MOCK_SLOT_ONE_ID); assert (rv == CKR_OK); rv = first->C_GetSessionInfo (s1, &info); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = second->C_GetSessionInfo (s2, &info); assert (rv == CKR_OK); second->C_CloseAllSessions (MOCK_SLOT_ONE_ID); assert (rv == CKR_OK); rv = first->C_GetSessionInfo (s1, &info); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = second->C_GetSessionInfo (s2, &info); assert (rv == CKR_SESSION_HANDLE_INVALID); teardown_mock_module (first); teardown_mock_module (second); } /* Bring in all the mock module tests */ #include "test-mock.c" int main (int argc, char *argv[]) { mock_module_init (); p11_library_init (); p11_test (test_initialize_finalize, "/managed/test_initialize_finalize"); p11_test (test_initialize_fail, "/managed/test_initialize_fail"); p11_test (test_separate_close_all_sessions, "/managed/test_separate_close_all_sessions"); test_mock_add_tests ("/managed"); p11_kit_be_quiet (); return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/print-messages.c0000664000175000017500000001023112144374546015350 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met); * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include #include #include #include #include "p11-kit.h" int main (int argc, char *argv[]) { if (argc != 1) { fprintf (stderr, "usage: print-messages\n"); exit (2); } #define X(x) printf ("%s: %s\n", #x, p11_kit_strerror (x)) X(CKR_CANCEL); X(CKR_FUNCTION_CANCELED); X(CKR_HOST_MEMORY); X(CKR_SLOT_ID_INVALID); X(CKR_GENERAL_ERROR); X(CKR_FUNCTION_FAILED); X(CKR_ARGUMENTS_BAD); X(CKR_NEED_TO_CREATE_THREADS); X(CKR_CANT_LOCK); X(CKR_ATTRIBUTE_READ_ONLY); X(CKR_ATTRIBUTE_SENSITIVE); X(CKR_ATTRIBUTE_TYPE_INVALID); X(CKR_ATTRIBUTE_VALUE_INVALID); X(CKR_DATA_INVALID); X(CKR_DATA_LEN_RANGE); X(CKR_DEVICE_ERROR); X(CKR_DEVICE_MEMORY); X(CKR_DEVICE_REMOVED); X(CKR_ENCRYPTED_DATA_INVALID); X(CKR_ENCRYPTED_DATA_LEN_RANGE); X(CKR_FUNCTION_NOT_SUPPORTED); X(CKR_KEY_HANDLE_INVALID); X(CKR_KEY_SIZE_RANGE); X(CKR_KEY_TYPE_INCONSISTENT); X(CKR_KEY_NOT_NEEDED); X(CKR_KEY_CHANGED); X(CKR_KEY_NEEDED); X(CKR_KEY_INDIGESTIBLE); X(CKR_KEY_FUNCTION_NOT_PERMITTED); X(CKR_KEY_NOT_WRAPPABLE); X(CKR_KEY_UNEXTRACTABLE); X(CKR_MECHANISM_INVALID); X(CKR_MECHANISM_PARAM_INVALID); X(CKR_OBJECT_HANDLE_INVALID); X(CKR_OPERATION_ACTIVE); X(CKR_OPERATION_NOT_INITIALIZED); X(CKR_PIN_INCORRECT); X(CKR_PIN_INVALID); X(CKR_PIN_LEN_RANGE); X(CKR_PIN_EXPIRED); X(CKR_PIN_LOCKED); X(CKR_SESSION_CLOSED); X(CKR_SESSION_COUNT); X(CKR_SESSION_HANDLE_INVALID); X(CKR_SESSION_READ_ONLY); X(CKR_SESSION_EXISTS); X(CKR_SESSION_READ_ONLY_EXISTS); X(CKR_SESSION_READ_WRITE_SO_EXISTS); X(CKR_SIGNATURE_INVALID); X(CKR_SIGNATURE_LEN_RANGE); X(CKR_TEMPLATE_INCOMPLETE); X(CKR_TEMPLATE_INCONSISTENT); X(CKR_TOKEN_NOT_PRESENT); X(CKR_TOKEN_NOT_RECOGNIZED); X(CKR_TOKEN_WRITE_PROTECTED); X(CKR_UNWRAPPING_KEY_HANDLE_INVALID); X(CKR_UNWRAPPING_KEY_SIZE_RANGE); X(CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT); X(CKR_USER_ALREADY_LOGGED_IN); X(CKR_USER_NOT_LOGGED_IN); X(CKR_USER_PIN_NOT_INITIALIZED); X(CKR_USER_TYPE_INVALID); X(CKR_USER_ANOTHER_ALREADY_LOGGED_IN); X(CKR_USER_TOO_MANY_TYPES); X(CKR_WRAPPED_KEY_INVALID); X(CKR_WRAPPED_KEY_LEN_RANGE); X(CKR_WRAPPING_KEY_HANDLE_INVALID); X(CKR_WRAPPING_KEY_SIZE_RANGE); X(CKR_WRAPPING_KEY_TYPE_INCONSISTENT); X(CKR_RANDOM_SEED_NOT_SUPPORTED); X(CKR_RANDOM_NO_RNG); X(CKR_DOMAIN_PARAMS_INVALID); X(CKR_BUFFER_TOO_SMALL); X(CKR_SAVED_STATE_INVALID); X(CKR_INFORMATION_SENSITIVE); X(CKR_STATE_UNSAVEABLE); X(CKR_CRYPTOKI_NOT_INITIALIZED); X(CKR_CRYPTOKI_ALREADY_INITIALIZED); X(CKR_MUTEX_BAD); X(CKR_MUTEX_NOT_LOCKED); X(CKR_FUNCTION_REJECTED); #undef X return 0; } p11-kit-0.20.2/p11-kit/tests/test-log.c0000664000175000017500000000573712226763526014165 00000000000000/* * Copyright (c) 2013 Red Hat Inc * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "dict.h" #include "library.h" #include "log.h" #include "mock.h" #include "modules.h" #include "p11-kit.h" #include "virtual.h" #include #include #include #include static CK_FUNCTION_LIST_PTR setup_mock_module (CK_SESSION_HANDLE *session) { CK_FUNCTION_LIST_PTR module; CK_RV rv; p11_lock (); p11_log_force = true; rv = p11_module_load_inlock_reentrant (&mock_module, 0, &module); assert (rv == CKR_OK); assert_ptr_not_null (module); assert (p11_virtual_is_wrapper (module)); p11_unlock (); rv = p11_kit_module_initialize (module); assert (rv == CKR_OK); if (session) { rv = (module->C_OpenSession) (MOCK_SLOT_ONE_ID, CKF_RW_SESSION | CKF_SERIAL_SESSION, NULL, NULL, session); assert (rv == CKR_OK); } return module; } static void teardown_mock_module (CK_FUNCTION_LIST_PTR module) { CK_RV rv; rv = p11_kit_module_finalize (module); assert (rv == CKR_OK); p11_lock (); rv = p11_module_release_inlock_reentrant (module); assert (rv == CKR_OK); p11_unlock (); } /* Bring in all the mock module tests */ #include "test-mock.c" int main (int argc, char *argv[]) { p11_library_init (); mock_module_init (); test_mock_add_tests ("/log"); p11_kit_be_quiet (); p11_log_output = false; return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/files/0000775000175000017500000000000012226763526013431 500000000000000p11-kit-0.20.2/p11-kit/tests/files/test-pinfile-large0000664000175000017500000001000112144374546016756 00000000000000yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yogabbagabba yop11-kit-0.20.2/p11-kit/tests/files/test-system-only.conf0000664000175000017500000000015512144374546017500 00000000000000 # Only user config user-config: only # This stuff will be ignored key1: system1 key2: system2 key3: system3p11-kit-0.20.2/p11-kit/tests/files/test-user-only.conf0000664000175000017500000000005212144374546017126 00000000000000 user-config: only key2: user2 key3: user3p11-kit-0.20.2/p11-kit/tests/files/package-modules/0000775000175000017500000000000012226763526016472 500000000000000p11-kit-0.20.2/p11-kit/tests/files/package-modules/four.module0000664000175000017500000000012712226763526020574 00000000000000 module: mock-four.so disable-in: test-disable, test-other priority: 4 trust-policy: nop11-kit-0.20.2/p11-kit/tests/files/package-modules/win32/0000775000175000017500000000000012144374546017433 500000000000000p11-kit-0.20.2/p11-kit/tests/files/package-modules/win32/four.module0000664000175000017500000000010712144374546021533 00000000000000 module: mock-four.dll disable-in: test-disable, test-other priority: 4p11-kit-0.20.2/p11-kit/tests/files/test-1.conf0000664000175000017500000000020612144374546015332 00000000000000key1:value1 with-whitespace : value-with-whitespace with-colon: value-of-colon # A comment embedded-comment: this is # not a comment p11-kit-0.20.2/p11-kit/tests/files/test-pinfile0000664000175000017500000000001412144374546015671 00000000000000yogabbagabbap11-kit-0.20.2/p11-kit/tests/files/system-modules/0000775000175000017500000000000012226763526016423 500000000000000p11-kit-0.20.2/p11-kit/tests/files/system-modules/two.badname0000664000175000017500000000030412144374546020461 00000000000000# This module doesn't have a .module extension, but p11-kit doesn't yet # enforce the naming, just warns, so it should still be loaded module: mock-two.so setting: system2 # no priority, use namep11-kit-0.20.2/p11-kit/tests/files/system-modules/two-duplicate.module0000664000175000017500000000012612144374546022331 00000000000000 # This is a duplicate of the 'two' module module: mock-two.so # no priority, use namep11-kit-0.20.2/p11-kit/tests/files/system-modules/one.module0000664000175000017500000000010312226763526020325 00000000000000 module: mock-one.so setting: system1 trust-policy: yes number: 18 p11-kit-0.20.2/p11-kit/tests/files/system-modules/win32/0000775000175000017500000000000012144374546017364 500000000000000p11-kit-0.20.2/p11-kit/tests/files/system-modules/win32/two.badname0000664000175000017500000000030212144374546021421 00000000000000# This module doesn't have a .module extension, but p11-kit doesn't yet # enforce the naming, just warns, so it should still be loaded module: mock-two.dll setting: system2 # no order, use namep11-kit-0.20.2/p11-kit/tests/files/system-modules/win32/two-duplicate.module0000664000175000017500000000012412144374546023271 00000000000000 # This is a duplicate of the 'two' module module: mock-two.dll # no order, use namep11-kit-0.20.2/p11-kit/tests/files/system-modules/win32/one.module0000664000175000017500000000007312144374546021274 00000000000000 module: mock-one.dll setting: system1 # no order, use namep11-kit-0.20.2/p11-kit/tests/files/test-system-invalid.conf0000664000175000017500000000006012144374546020140 00000000000000 # Invalid user-config setting user-config: bad p11-kit-0.20.2/p11-kit/tests/files/test-system-merge.conf0000664000175000017500000000012512144374546017613 00000000000000 # Merge in user config user-config: merge key1: system1 key2: system2 key3: system3p11-kit-0.20.2/p11-kit/tests/files/test-user.conf0000664000175000017500000000003012144374546016143 00000000000000 key2: user2 key3: user3p11-kit-0.20.2/p11-kit/tests/files/test-system-none.conf0000664000175000017500000000016512144374546017457 00000000000000 # Only user config user-config: none # These values will not be overriden key1: system1 key2: system2 key3: system3p11-kit-0.20.2/p11-kit/tests/files/system-pkcs11.conf0000664000175000017500000000010712226763526016642 00000000000000 # Merge in user config user-config: merge # Another option new: worldp11-kit-0.20.2/p11-kit/tests/files/test-user-invalid.conf0000664000175000017500000000006012144374546017572 00000000000000 # Invalid user-config setting user-config: bad p11-kit-0.20.2/p11-kit/tests/files/user-modules/0000775000175000017500000000000012226763526016055 500000000000000p11-kit-0.20.2/p11-kit/tests/files/user-modules/one.module0000664000175000017500000000005012226763526017760 00000000000000 setting: user1 managed: yes number: 33 p11-kit-0.20.2/p11-kit/tests/files/user-modules/win32/0000775000175000017500000000000012144374546017016 500000000000000p11-kit-0.20.2/p11-kit/tests/files/user-modules/win32/one.module0000664000175000017500000000001712144374546020724 00000000000000 setting: user1p11-kit-0.20.2/p11-kit/tests/files/user-modules/win32/three.module0000664000175000017500000000011212144374546021246 00000000000000 module: mock-three.dll setting: user3 enable-in: test-enable priority: 3p11-kit-0.20.2/p11-kit/tests/files/user-modules/three.module0000664000175000017500000000011112165346612020277 00000000000000 module: mock-three.so setting: user3 enable-in: test-enable priority: 3p11-kit-0.20.2/p11-kit/tests/test-iter.c0000664000175000017500000007542212265245657014350 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #define P11_KIT_FUTURE_UNSTABLE_API 1 #include "attrs.h" #include "dict.h" #include "iter.h" #include "library.h" #include "message.h" #include "mock.h" #include #include #include #include static CK_FUNCTION_LIST_PTR_PTR initialize_and_get_modules (void) { CK_FUNCTION_LIST_PTR_PTR modules; p11_message_quiet (); modules = p11_kit_modules_load_and_initialize (0); assert (modules != NULL && modules[0] != NULL); p11_message_loud (); return modules; } static void finalize_and_free_modules (CK_FUNCTION_LIST_PTR_PTR modules) { p11_kit_modules_finalize (modules); p11_kit_modules_release (modules); } static int has_handle (CK_ULONG *objects, int count, CK_ULONG handle) { int i; for (i = 0; i < count; i++) { if (objects[i] == handle) return 1; } return 0; } static void test_all (void) { CK_OBJECT_HANDLE objects[128]; CK_FUNCTION_LIST_PTR *modules; CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session; CK_ULONG size; P11KitIter *iter; CK_RV rv; int at; modules = initialize_and_get_modules (); iter = p11_kit_iter_new (NULL, P11_KIT_ITER_BUSY_SESSIONS); p11_kit_iter_begin (iter, modules); at = 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { assert (at < 128); objects[at] = p11_kit_iter_get_object (iter); module = p11_kit_iter_get_module (iter); assert_ptr_not_null (module); session = p11_kit_iter_get_session (iter); assert (session != 0); /* Do something with the object */ size = 0; rv = (module->C_GetObjectSize) (session, objects[at], &size); assert (rv == CKR_OK); assert (size > 0); at++; } assert (rv == CKR_CANCEL); /* Three modules, each with 1 slot, and 3 public objects */ assert_num_eq (9, at); assert (has_handle (objects, at, MOCK_DATA_OBJECT)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_CAPITALIZE)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_CAPITALIZE)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_PREFIX)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_PREFIX)); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static CK_RV on_iter_callback (P11KitIter *iter, CK_BBOOL *matches, void *data) { CK_OBJECT_HANDLE object; CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session; CK_ULONG size; CK_RV rv; assert_str_eq (data, "callback"); object = p11_kit_iter_get_object (iter); if (object != MOCK_PUBLIC_KEY_CAPITALIZE && object != MOCK_PUBLIC_KEY_PREFIX) { *matches = CK_FALSE; return CKR_OK; } module = p11_kit_iter_get_module (iter); assert_ptr_not_null (module); session = p11_kit_iter_get_session (iter); assert (session != 0); /* Do something with the object */ size = 0; rv = (module->C_GetObjectSize) (session, object, &size); assert (rv == CKR_OK); assert (size > 0); return CKR_OK; } static void test_callback (void) { CK_OBJECT_HANDLE objects[128]; CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; CK_RV rv; int at; modules = initialize_and_get_modules (); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_add_callback (iter, on_iter_callback, "callback", NULL); p11_kit_iter_begin (iter, modules); at= 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { assert (at < 128); objects[at] = p11_kit_iter_get_object (iter); at++; } assert (rv == CKR_CANCEL); /* Three modules, each with 1 slot, and 2 public keys */ assert_num_eq (6, at); assert (!has_handle (objects, at, MOCK_DATA_OBJECT)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_CAPITALIZE)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_CAPITALIZE)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_PREFIX)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_PREFIX)); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static CK_RV on_callback_fail (P11KitIter *iter, CK_BBOOL *matches, void *data) { return CKR_DATA_INVALID; } static void test_callback_fails (void) { CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; CK_RV rv; int at; modules = initialize_and_get_modules (); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_add_callback (iter, on_callback_fail, "callback", NULL); p11_kit_iter_begin (iter, modules); at= 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) at++; assert (rv == CKR_DATA_INVALID); /* Shouldn't have succeeded at all */ assert_num_eq (0, at); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void on_destroy_increment (void *data) { int *value = data; (*value)++; } static void test_callback_destroyer (void) { P11KitIter *iter; int value = 1; iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_add_callback (iter, on_callback_fail, &value, on_destroy_increment); p11_kit_iter_free (iter); assert_num_eq (2, value); } static void test_with_session (void) { CK_OBJECT_HANDLE objects[128]; CK_SESSION_HANDLE session; CK_FUNCTION_LIST_PTR module; CK_SLOT_ID slot; P11KitIter *iter; CK_RV rv; int at; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); rv = mock_C_OpenSession (MOCK_SLOT_ONE_ID, CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &mock_module, 0, session); at= 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { assert (at < 128); objects[at] = p11_kit_iter_get_object (iter); slot = p11_kit_iter_get_slot (iter); assert (slot == MOCK_SLOT_ONE_ID); module = p11_kit_iter_get_module (iter); assert_ptr_eq (module, &mock_module); assert (session == p11_kit_iter_get_session (iter)); at++; } assert (rv == CKR_CANCEL); /* 1 modules, each with 1 slot, and 3 public objects */ assert_num_eq (3, at); assert (has_handle (objects, at, MOCK_DATA_OBJECT)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_CAPITALIZE)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_CAPITALIZE)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_PREFIX)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_PREFIX)); p11_kit_iter_free (iter); /* The session is still valid ... */ rv = mock_module.C_CloseSession (session); assert (rv == CKR_OK); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_with_slot (void) { CK_OBJECT_HANDLE objects[128]; CK_FUNCTION_LIST_PTR module; CK_SLOT_ID slot; P11KitIter *iter; CK_RV rv; int at; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &mock_module, MOCK_SLOT_ONE_ID, 0); at= 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { assert (at < 128); objects[at] = p11_kit_iter_get_object (iter); slot = p11_kit_iter_get_slot (iter); assert (slot == MOCK_SLOT_ONE_ID); module = p11_kit_iter_get_module (iter); assert_ptr_eq (module, &mock_module); at++; } assert (rv == CKR_CANCEL); /* 1 modules, each with 1 slot, and 3 public objects */ assert_num_eq (3, at); assert (has_handle (objects, at, MOCK_DATA_OBJECT)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_CAPITALIZE)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_CAPITALIZE)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_PREFIX)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_PREFIX)); p11_kit_iter_free (iter); rv = (mock_module.C_Finalize) (NULL); assert (rv == CKR_OK); } static void test_with_module (void) { CK_OBJECT_HANDLE objects[128]; CK_FUNCTION_LIST_PTR module; P11KitIter *iter; CK_RV rv; int at; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &mock_module, 0, 0); at= 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { assert (at < 128); objects[at] = p11_kit_iter_get_object (iter); module = p11_kit_iter_get_module (iter); assert_ptr_eq (module, &mock_module); at++; } assert (rv == CKR_CANCEL); /* 1 modules, each with 1 slot, and 3 public objects */ assert_num_eq (3, at); assert (has_handle (objects, at, MOCK_DATA_OBJECT)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_CAPITALIZE)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_CAPITALIZE)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_PREFIX)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_PREFIX)); p11_kit_iter_free (iter); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_keep_session (void) { CK_SESSION_HANDLE session; P11KitIter *iter; CK_RV rv; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &mock_module, 0, 0); rv = p11_kit_iter_next (iter); assert (rv == CKR_OK); session = p11_kit_iter_keep_session (iter); p11_kit_iter_free (iter); /* The session is still valid ... */ rv = mock_module.C_CloseSession (session); assert (rv == CKR_OK); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_unrecognized (void) { CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; P11KitUri *uri; CK_RV rv; int count; modules = initialize_and_get_modules (); uri = p11_kit_uri_new (); p11_kit_uri_set_unrecognized (uri, 1); iter = p11_kit_iter_new (uri, 0); p11_kit_uri_free (uri); p11_kit_iter_begin (iter, modules); count = 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) count++; assert (rv == CKR_CANCEL); /* Nothing should have matched */ assert_num_eq (0, count); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_uri_with_type (void) { CK_OBJECT_HANDLE objects[128]; CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; P11KitUri *uri; CK_RV rv; int at; int ret; modules = initialize_and_get_modules (); uri = p11_kit_uri_new (); ret = p11_kit_uri_parse ("pkcs11:object-type=public", P11_KIT_URI_FOR_OBJECT, uri); assert_num_eq (ret, P11_KIT_URI_OK); iter = p11_kit_iter_new (uri, 0); p11_kit_uri_free (uri); p11_kit_iter_begin (iter, modules); at = 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { assert (at < 128); objects[at] = p11_kit_iter_get_object (iter); at++; } assert (rv == CKR_CANCEL); /* Three modules, each with 1 slot, and 2 public keys */ assert_num_eq (6, at); assert (!has_handle (objects, at, MOCK_DATA_OBJECT)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_CAPITALIZE)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_CAPITALIZE)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_PREFIX)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_PREFIX)); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_set_uri (void) { CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; P11KitUri *uri; CK_RV rv; modules = initialize_and_get_modules (); uri = p11_kit_uri_new (); p11_kit_uri_set_unrecognized (uri, 1); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_set_uri (iter, uri); p11_kit_uri_free (uri); p11_kit_iter_begin (iter, modules); /* Nothing should have matched */ rv = p11_kit_iter_next (iter); assert_num_eq (rv, CKR_CANCEL); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_filter (void) { CK_OBJECT_HANDLE objects[128]; CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; CK_RV rv; int at; CK_BBOOL vfalse = CK_FALSE; CK_OBJECT_CLASS public_key = CKO_PUBLIC_KEY; CK_ATTRIBUTE attrs[] = { { CKA_PRIVATE, &vfalse, sizeof (vfalse) }, { CKA_CLASS, &public_key, sizeof (public_key) }, }; modules = initialize_and_get_modules (); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_add_filter (iter, attrs, 2); p11_kit_iter_begin (iter, modules); at = 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { assert (at < 128); objects[at] = p11_kit_iter_get_object (iter); at++; } assert (rv == CKR_CANCEL); /* Three modules, each with 1 slot, and 2 public keys */ assert_num_eq (6, at); assert (!has_handle (objects, at, MOCK_DATA_OBJECT)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_CAPITALIZE)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_CAPITALIZE)); assert (!has_handle (objects, at, MOCK_PRIVATE_KEY_PREFIX)); assert (has_handle (objects, at, MOCK_PUBLIC_KEY_PREFIX)); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_session_flags (void) { CK_FUNCTION_LIST_PTR *modules; CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session; CK_SESSION_INFO info; P11KitIter *iter; CK_RV rv; modules = initialize_and_get_modules (); iter = p11_kit_iter_new (NULL, P11_KIT_ITER_WANT_WRITABLE); p11_kit_iter_begin (iter, modules); while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { module = p11_kit_iter_get_module (iter); assert_ptr_not_null (module); session = p11_kit_iter_get_session (iter); assert (session != 0); rv = (module->C_GetSessionInfo) (session, &info); assert (rv == CKR_OK); assert_num_eq (CKS_RW_PUBLIC_SESSION, info.state); } assert (rv == CKR_CANCEL); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_module_match (void) { CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; P11KitUri *uri; CK_RV rv; int count; int ret; modules = initialize_and_get_modules (); uri = p11_kit_uri_new (); ret = p11_kit_uri_parse ("pkcs11:library-description=MOCK%20LIBRARY", P11_KIT_URI_FOR_MODULE, uri); assert_num_eq (P11_KIT_URI_OK, ret); iter = p11_kit_iter_new (uri, 0); p11_kit_uri_free (uri); p11_kit_iter_begin (iter, modules); count = 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) count++; assert (rv == CKR_CANCEL); /* Three modules, each with 1 slot, and 3 public objects */ assert_num_eq (9, count); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_module_mismatch (void) { CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; P11KitUri *uri; CK_RV rv; int count; int ret; modules = initialize_and_get_modules (); uri = p11_kit_uri_new (); ret = p11_kit_uri_parse ("pkcs11:library-description=blah", P11_KIT_URI_FOR_MODULE, uri); assert_num_eq (P11_KIT_URI_OK, ret); iter = p11_kit_iter_new (uri, 0); p11_kit_uri_free (uri); p11_kit_iter_begin (iter, modules); count = 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) count++; assert (rv == CKR_CANCEL); /* Nothing should have matched */ assert_num_eq (0, count); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_token_match (void) { CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; P11KitUri *uri; CK_RV rv; int count; int ret; modules = initialize_and_get_modules (); uri = p11_kit_uri_new (); ret = p11_kit_uri_parse ("pkcs11:manufacturer=TEST%20MANUFACTURER", P11_KIT_URI_FOR_TOKEN, uri); assert_num_eq (P11_KIT_URI_OK, ret); iter = p11_kit_iter_new (uri, 0); p11_kit_uri_free (uri); p11_kit_iter_begin (iter, modules); count = 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) count++; assert (rv == CKR_CANCEL); /* Three modules, each with 1 slot, and 3 public objects */ assert_num_eq (9, count); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_token_mismatch (void) { CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; P11KitUri *uri; CK_RV rv; int count; int ret; modules = initialize_and_get_modules (); uri = p11_kit_uri_new (); ret = p11_kit_uri_parse ("pkcs11:manufacturer=blah", P11_KIT_URI_FOR_TOKEN, uri); assert_num_eq (P11_KIT_URI_OK, ret); iter = p11_kit_iter_new (uri, 0); p11_kit_uri_free (uri); p11_kit_iter_begin (iter, modules); count = 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) count++; assert (rv == CKR_CANCEL); /* Nothing should have matched */ assert_num_eq (0, count); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_token_info (void) { CK_FUNCTION_LIST_PTR *modules; CK_TOKEN_INFO *info; P11KitIter *iter; char *string; CK_RV rv; modules = initialize_and_get_modules (); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin (iter, modules); rv = p11_kit_iter_next (iter); assert_num_eq (rv, CKR_OK); info = p11_kit_iter_get_token (iter); assert_ptr_not_null (info); string = p11_kit_space_strdup (info->label, sizeof (info->label)); assert_ptr_not_null (string); assert_str_eq (string, "TEST LABEL"); free (string); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_getslotlist_fail_first (void) { CK_FUNCTION_LIST module; P11KitIter *iter; CK_RV rv; int at; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); memcpy (&module, &mock_module, sizeof (CK_FUNCTION_LIST)); module.C_GetSlotList = mock_C_GetSlotList__fail_first; iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &module, 0, 0); at= 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) at++; assert (rv == CKR_VENDOR_DEFINED); /* Should fail on the first iteration */ assert_num_eq (0, at); p11_kit_iter_free (iter); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_getslotlist_fail_late (void) { CK_FUNCTION_LIST module; P11KitIter *iter; CK_RV rv; int at; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); memcpy (&module, &mock_module, sizeof (CK_FUNCTION_LIST)); module.C_GetSlotList = mock_C_GetSlotList__fail_late; iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &module, 0, 0); at= 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) at++; assert (rv == CKR_VENDOR_DEFINED); /* Should fail on the first iteration */ assert_num_eq (0, at); p11_kit_iter_free (iter); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_open_session_fail (void) { CK_FUNCTION_LIST module; P11KitIter *iter; CK_RV rv; int at; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); memcpy (&module, &mock_module, sizeof (CK_FUNCTION_LIST)); module.C_OpenSession = mock_C_OpenSession__fails; iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &module, 0, 0); at= 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) at++; assert (rv == CKR_DEVICE_ERROR); /* Should fail on the first iteration */ assert_num_eq (0, at); p11_kit_iter_free (iter); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_find_init_fail (void) { CK_FUNCTION_LIST module; P11KitIter *iter; CK_RV rv; int at; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); memcpy (&module, &mock_module, sizeof (CK_FUNCTION_LIST)); module.C_FindObjectsInit = mock_C_FindObjectsInit__fails; iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &module, 0, 0); at= 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) at++; assert (rv == CKR_DEVICE_MEMORY); /* Should fail on the first iteration */ assert_num_eq (0, at); p11_kit_iter_free (iter); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_find_objects_fail (void) { CK_FUNCTION_LIST module; P11KitIter *iter; CK_RV rv; int at; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); memcpy (&module, &mock_module, sizeof (CK_FUNCTION_LIST)); module.C_FindObjects = mock_C_FindObjects__fails; iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &module, 0, 0); at= 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) at++; assert (rv == CKR_DEVICE_REMOVED); /* Should fail on the first iteration */ assert_num_eq (0, at); p11_kit_iter_free (iter); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_get_attributes (void) { CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; CK_OBJECT_HANDLE object; char label[128]; CK_ULONG klass; CK_ULONG ulong; CK_RV rv; int at; CK_ATTRIBUTE template[] = { { CKA_CLASS, &klass, sizeof (klass) }, { CKA_LABEL, label, sizeof (label) }, { CKA_INVALID }, }; CK_ATTRIBUTE attrs[3]; modules = initialize_and_get_modules (); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin (iter, modules); at = 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { assert (sizeof (attrs) == sizeof (template)); memcpy (&attrs, &template, sizeof (attrs)); rv = p11_kit_iter_get_attributes (iter, attrs, 2); assert (rv == CKR_OK); object = p11_kit_iter_get_object (iter); switch (object) { case MOCK_DATA_OBJECT: assert (p11_attrs_find_ulong (attrs, CKA_CLASS, &ulong) && ulong == CKO_DATA); assert (p11_attr_match_value (p11_attrs_find (attrs, CKA_LABEL), "TEST LABEL", -1)); break; case MOCK_PUBLIC_KEY_CAPITALIZE: assert (p11_attrs_find_ulong (attrs, CKA_CLASS, &ulong) && ulong == CKO_PUBLIC_KEY); assert (p11_attr_match_value (p11_attrs_find (attrs, CKA_LABEL), "Public Capitalize Key", -1)); break; case MOCK_PUBLIC_KEY_PREFIX: assert (p11_attrs_find_ulong (attrs, CKA_CLASS, &ulong) && ulong == CKO_PUBLIC_KEY); assert (p11_attr_match_value (p11_attrs_find (attrs, CKA_LABEL), "Public prefix key", -1)); break; default: assert_fail ("Unknown object matched", NULL); break; } at++; } assert (rv == CKR_CANCEL); /* Three modules, each with 1 slot, and 3 public objects */ assert_num_eq (9, at); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_load_attributes (void) { CK_FUNCTION_LIST_PTR *modules; P11KitIter *iter; CK_ATTRIBUTE *attrs; CK_OBJECT_HANDLE object; CK_ULONG ulong; CK_RV rv; int at; CK_ATTRIBUTE types[] = { { CKA_CLASS }, { CKA_LABEL }, }; modules = initialize_and_get_modules (); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin (iter, modules); attrs = p11_attrs_buildn (NULL, types, 2); at = 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { rv = p11_kit_iter_load_attributes (iter, attrs, 2); assert (rv == CKR_OK); object = p11_kit_iter_get_object (iter); switch (object) { case MOCK_DATA_OBJECT: assert (p11_attrs_find_ulong (attrs, CKA_CLASS, &ulong) && ulong == CKO_DATA); assert (p11_attr_match_value (p11_attrs_find (attrs, CKA_LABEL), "TEST LABEL", -1)); break; case MOCK_PUBLIC_KEY_CAPITALIZE: assert (p11_attrs_find_ulong (attrs, CKA_CLASS, &ulong) && ulong == CKO_PUBLIC_KEY); assert (p11_attr_match_value (p11_attrs_find (attrs, CKA_LABEL), "Public Capitalize Key", -1)); break; case MOCK_PUBLIC_KEY_PREFIX: assert (p11_attrs_find_ulong (attrs, CKA_CLASS, &ulong) && ulong == CKO_PUBLIC_KEY); assert (p11_attr_match_value (p11_attrs_find (attrs, CKA_LABEL), "Public prefix key", -1)); break; default: assert_fail ("Unknown object matched", NULL); break; } at++; } p11_attrs_free (attrs); assert (rv == CKR_CANCEL); /* Three modules, each with 1 slot, and 3 public objects */ assert_num_eq (9, at); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } static void test_load_attributes_none (void) { CK_FUNCTION_LIST module; P11KitIter *iter; CK_ATTRIBUTE *attrs; CK_RV rv; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); memcpy (&module, &mock_module, sizeof (CK_FUNCTION_LIST)); iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &module, 0, 0); while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { attrs = p11_attrs_buildn (NULL, NULL, 0); rv = p11_kit_iter_load_attributes (iter, attrs, 0); assert (rv == CKR_OK); p11_attrs_free (attrs); } assert (rv == CKR_CANCEL); p11_kit_iter_free (iter); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_load_attributes_fail_first (void) { CK_ATTRIBUTE label = { CKA_LABEL, }; CK_FUNCTION_LIST module; P11KitIter *iter; CK_ATTRIBUTE *attrs; CK_RV rv; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); memcpy (&module, &mock_module, sizeof (CK_FUNCTION_LIST)); module.C_GetAttributeValue = mock_C_GetAttributeValue__fail_first; iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &module, 0, 0); while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { attrs = p11_attrs_build (NULL, &label, NULL); rv = p11_kit_iter_load_attributes (iter, attrs, 1); assert (rv == CKR_FUNCTION_REJECTED); p11_attrs_free (attrs); } assert (rv == CKR_CANCEL); p11_kit_iter_free (iter); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_load_attributes_fail_late (void) { CK_ATTRIBUTE label = { CKA_LABEL, }; CK_FUNCTION_LIST module; P11KitIter *iter; CK_ATTRIBUTE *attrs; CK_RV rv; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert (rv == CKR_OK); memcpy (&module, &mock_module, sizeof (CK_FUNCTION_LIST)); module.C_GetAttributeValue = mock_C_GetAttributeValue__fail_late; iter = p11_kit_iter_new (NULL, 0); p11_kit_iter_begin_with (iter, &module, 0, 0); while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { attrs = p11_attrs_build (NULL, &label, NULL); rv = p11_kit_iter_load_attributes (iter, attrs, 1); assert (rv == CKR_FUNCTION_FAILED); p11_attrs_free (attrs); } assert (rv == CKR_CANCEL); p11_kit_iter_free (iter); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_many (void *flags) { P11KitIterBehavior behavior; CK_SESSION_HANDLE session; CK_OBJECT_HANDLE handle; p11_dict *seen; P11KitIter *iter; CK_RV rv; int count; int i; static CK_OBJECT_CLASS data = CKO_DATA; static CK_ATTRIBUTE object[] = { { CKA_VALUE, "blah", 4 }, { CKA_CLASS, &data, sizeof (data) }, { CKA_ID, "ID1", 3 }, { CKA_INVALID }, }; behavior = 0; if (strstr (flags, "busy-sessions")) behavior |= P11_KIT_ITER_BUSY_SESSIONS; mock_module_reset (); rv = mock_module.C_Initialize (NULL); assert_num_eq (rv, CKR_OK); rv = mock_C_OpenSession (MOCK_SLOT_ONE_ID, CKF_SERIAL_SESSION, NULL, NULL, &session); assert_num_eq (rv, CKR_OK); for (i = 0; i < 10000; i++) mock_module_add_object (MOCK_SLOT_ONE_ID, object); seen = p11_dict_new (p11_dict_ulongptr_hash, p11_dict_ulongptr_equal, free, NULL); iter = p11_kit_iter_new (NULL, behavior); p11_kit_iter_add_filter (iter, object, 3); p11_kit_iter_begin_with (iter, &mock_module, 0, session); count = 0; while ((rv = p11_kit_iter_next (iter)) == CKR_OK) { handle = p11_kit_iter_get_object (iter); assert (p11_dict_get (seen, &handle) == NULL); if (!p11_dict_set (seen, memdup (&handle, sizeof (handle)), "x")) assert_not_reached (); count++; } assert_num_eq (rv, CKR_CANCEL); assert_num_eq (count, 10000); p11_kit_iter_free (iter); p11_dict_free (seen); rv = mock_module.C_Finalize (NULL); assert (rv == CKR_OK); } static void test_destroy_object (void) { CK_FUNCTION_LIST **modules; P11KitIter *iter; CK_OBJECT_HANDLE object; CK_SESSION_HANDLE session; CK_FUNCTION_LIST *module; CK_ULONG size; CK_RV rv; modules = initialize_and_get_modules (); iter = p11_kit_iter_new (NULL, P11_KIT_ITER_WANT_WRITABLE); p11_kit_iter_begin (iter, modules); /* Should have matched */ rv = p11_kit_iter_next (iter); assert_num_eq (rv, CKR_OK); object = p11_kit_iter_get_object (iter); session = p11_kit_iter_get_session (iter); module = p11_kit_iter_get_module (iter); rv = (module->C_GetObjectSize) (session, object, &size); assert_num_eq (rv, CKR_OK); rv = p11_kit_iter_destroy_object (iter); assert_num_eq (rv, CKR_OK); rv = (module->C_GetObjectSize) (session, object, &size); assert_num_eq (rv, CKR_OBJECT_HANDLE_INVALID); p11_kit_iter_free (iter); finalize_and_free_modules (modules); } int main (int argc, char *argv[]) { p11_library_init (); mock_module_init (); p11_test (test_all, "/iter/test_all"); p11_test (test_unrecognized, "/iter/test_unrecognized"); p11_test (test_uri_with_type, "/iter/test_uri_with_type"); p11_test (test_set_uri, "/iter/set-uri"); p11_test (test_session_flags, "/iter/test_session_flags"); p11_test (test_callback, "/iter/test_callback"); p11_test (test_callback_fails, "/iter/test_callback_fails"); p11_test (test_callback_destroyer, "/iter/test_callback_destroyer"); p11_test (test_filter, "/iter/test_filter"); p11_test (test_with_session, "/iter/test_with_session"); p11_test (test_with_slot, "/iter/test_with_slot"); p11_test (test_with_module, "/iter/test_with_module"); p11_test (test_keep_session, "/iter/test_keep_session"); p11_test (test_token_match, "/iter/test_token_match"); p11_test (test_token_mismatch, "/iter/test_token_mismatch"); p11_test (test_token_info, "/iter/token-info"); p11_test (test_module_match, "/iter/test_module_match"); p11_test (test_module_mismatch, "/iter/test_module_mismatch"); p11_test (test_getslotlist_fail_first, "/iter/test_getslotlist_fail_first"); p11_test (test_getslotlist_fail_late, "/iter/test_getslotlist_fail_late"); p11_test (test_open_session_fail, "/iter/test_open_session_fail"); p11_test (test_find_init_fail, "/iter/test_find_init_fail"); p11_test (test_find_objects_fail, "/iter/test_find_objects_fail"); p11_test (test_get_attributes, "/iter/get-attributes"); p11_test (test_load_attributes, "/iter/test_load_attributes"); p11_test (test_load_attributes_none, "/iter/test_load_attributes_none"); p11_test (test_load_attributes_fail_first, "/iter/test_load_attributes_fail_first"); p11_test (test_load_attributes_fail_late, "/iter/test_load_attributes_fail_late"); p11_testx (test_many, "", "/iter/test-many"); p11_testx (test_many, "busy-sessions", "/iter/test-many-busy"); p11_test (test_destroy_object, "/iter/destroy-object"); return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/test-progname.c0000664000175000017500000000507112226763526015203 00000000000000/* * Copyright (c) 2012 Stefan Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "library.h" #include #include #include #include #include "p11-kit/uri.h" #include "p11-kit/p11-kit.h" #include "p11-kit/private.h" static void test_progname_default (void) { const char *progname; progname = _p11_get_progname_unlocked (); assert_str_eq ("test-progname", progname); } static void test_progname_set (void) { const char *progname; p11_kit_set_progname ("love-generation"); progname = _p11_get_progname_unlocked (); assert_str_eq ("love-generation", progname); _p11_set_progname_unlocked (NULL); progname = _p11_get_progname_unlocked (); assert_str_eq ("test-progname", progname); } /* Defined in util.c */ extern char p11_my_progname[]; int main (int argc, char *argv[]) { p11_library_init (); p11_test (test_progname_default, "/progname/test_progname_default"); p11_test (test_progname_set, "/progname/test_progname_set"); return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/test-init.c0000664000175000017500000002250112226763526014333 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include #include "library.h" #include "mock.h" #include "modules.h" #include "p11-kit.h" #include "private.h" #include "virtual.h" #include #include #include #include #include #include static CK_FUNCTION_LIST module; static p11_mutex_t race_mutex; #ifdef OS_UNIX #include static CK_RV mock_C_Initialize__with_fork (CK_VOID_PTR init_args) { struct timespec ts = { 0, 100 * 1000 * 1000 }; CK_RV rv; pid_t child; pid_t ret; int status; rv = mock_C_Initialize (init_args); assert (rv == CKR_OK); /* Fork during the initialization */ child = fork (); if (child == 0) { close (1); nanosleep (&ts, NULL); exit (66); } ret = waitpid (child, &status, 0); assert (ret == child); assert (WIFEXITED (status)); assert (WEXITSTATUS (status) == 66); return CKR_OK; } static void test_fork_initialization (void) { CK_FUNCTION_LIST_PTR result; CK_RV rv; mock_module_reset (); /* Build up our own function list */ memcpy (&module, &mock_module_no_slots, sizeof (CK_FUNCTION_LIST)); module.C_Initialize = mock_C_Initialize__with_fork; p11_lock (); rv = p11_module_load_inlock_reentrant (&module, 0, &result); assert (rv == CKR_OK); p11_unlock (); rv = p11_kit_module_initialize (result); assert (rv == CKR_OK); rv = p11_kit_module_finalize (result); assert (rv == CKR_OK); p11_lock (); rv = p11_module_release_inlock_reentrant (result); assert (rv == CKR_OK); p11_unlock (); } #endif /* OS_UNIX */ static CK_FUNCTION_LIST *recursive_managed; static CK_RV mock_C_Initialize__with_recursive (CK_VOID_PTR init_args) { CK_RV rv; rv = mock_C_Initialize (init_args); assert (rv == CKR_OK); return p11_kit_module_initialize (recursive_managed); } static void test_recursive_initialization (void) { CK_RV rv; /* Build up our own function list */ memcpy (&module, &mock_module_no_slots, sizeof (CK_FUNCTION_LIST)); module.C_Initialize = mock_C_Initialize__with_recursive; p11_kit_be_quiet (); p11_lock (); rv = p11_module_load_inlock_reentrant (&module, 0, &recursive_managed); assert (rv == CKR_OK); p11_unlock (); rv = p11_kit_module_initialize (recursive_managed); assert_num_eq (CKR_FUNCTION_FAILED, rv); p11_lock (); rv = p11_module_release_inlock_reentrant (recursive_managed); assert (rv == CKR_OK); p11_unlock (); p11_kit_be_loud (); } static int initialization_count = 0; static int finalization_count = 0; static CK_RV mock_C_Initialize__threaded_race (CK_VOID_PTR init_args) { /* Atomically increment value */ p11_mutex_lock (&race_mutex); initialization_count += 1; p11_mutex_unlock (&race_mutex); p11_sleep_ms (100); return CKR_OK; } static CK_RV mock_C_Finalize__threaded_race (CK_VOID_PTR reserved) { /* Atomically increment value */ p11_mutex_lock (&race_mutex); finalization_count += 1; p11_mutex_unlock (&race_mutex); p11_sleep_ms (100); return CKR_OK; } static void * initialization_thread (void *data) { CK_FUNCTION_LIST *module = data; CK_RV rv; assert (module != NULL); rv = p11_kit_module_initialize (module); assert_num_eq (rv, CKR_OK); return module; } static void * finalization_thread (void *data) { CK_FUNCTION_LIST *module = data; CK_RV rv; assert (module != NULL); rv = p11_kit_module_finalize (module); assert_num_eq (rv, CKR_OK); return module; } static void test_threaded_initialization (void) { static const int num_threads = 1; CK_FUNCTION_LIST *data[num_threads]; p11_thread_t threads[num_threads]; CK_RV rv; int ret; int i; /* Build up our own function list */ memcpy (&module, &mock_module_no_slots, sizeof (CK_FUNCTION_LIST)); module.C_Initialize = mock_C_Initialize__threaded_race; module.C_Finalize = mock_C_Finalize__threaded_race; memset (&data, 0, sizeof (data)); p11_mutex_lock (&race_mutex); initialization_count = 0; finalization_count = 0; p11_mutex_unlock (&race_mutex); p11_lock (); for (i = 0; i < num_threads; i++) { assert (data[i] == NULL); rv = p11_module_load_inlock_reentrant (&module, 0, &data[i]); assert (rv == CKR_OK); } p11_unlock (); for (i = 0; i < num_threads; i++) { ret = p11_thread_create (&threads[i], initialization_thread, data[i]); assert_num_eq (0, ret); assert (threads[i] != 0); } for (i = 0; i < num_threads; i++) { ret = p11_thread_join (threads[i]); assert_num_eq (0, ret); threads[i] = 0; } for (i = 0; i < num_threads; i++) { ret = p11_thread_create (&threads[i], finalization_thread, data[i]); assert_num_eq (0, ret); assert (threads[i] != 0); } for (i = 0; i < num_threads; i++) { ret = p11_thread_join (threads[i]); assert_num_eq (0, ret); threads[i] = 0; } p11_lock (); for (i = 0; i < num_threads; i++) { assert (data[i] != NULL); rv = p11_module_release_inlock_reentrant (data[i]); assert (rv == CKR_OK); } p11_unlock (); /* C_Initialize should have been called exactly once */ assert_num_eq (1, initialization_count); assert_num_eq (1, finalization_count); } static CK_RV mock_C_Initialize__test_mutexes (CK_VOID_PTR args) { CK_C_INITIALIZE_ARGS_PTR init_args; void *mutex = NULL; CK_RV rv; assert (args != NULL); init_args = args; rv = (init_args->CreateMutex) (&mutex); assert (rv == CKR_OK); rv = (init_args->LockMutex) (mutex); assert (rv == CKR_OK); rv = (init_args->UnlockMutex) (mutex); assert (rv == CKR_OK); rv = (init_args->DestroyMutex) (mutex); assert (rv == CKR_OK); return CKR_OK; } static void test_mutexes (void) { CK_FUNCTION_LIST_PTR result; CK_RV rv; /* Build up our own function list */ memcpy (&module, &mock_module_no_slots, sizeof (CK_FUNCTION_LIST)); module.C_Initialize = mock_C_Initialize__test_mutexes; p11_lock (); rv = p11_module_load_inlock_reentrant (&module, 0, &result); assert (rv == CKR_OK); rv = p11_module_release_inlock_reentrant (result); assert (rv == CKR_OK); p11_unlock (); } static void test_load_and_initialize (void) { CK_FUNCTION_LIST_PTR module; CK_INFO info; CK_RV rv; int ret; module = p11_kit_module_load (BUILDDIR "/.libs/mock-one" SHLEXT, 0); assert (module != NULL); rv = p11_kit_module_initialize (module); assert (rv == CKR_OK); rv = (module->C_GetInfo) (&info); assert (rv == CKR_OK); ret = memcmp (info.manufacturerID, "MOCK MANUFACTURER ", 32); assert (ret == 0); rv = p11_kit_module_finalize (module); assert (rv == CKR_OK); p11_kit_module_release (module); } static void test_initalize_fail (void) { CK_FUNCTION_LIST failer; CK_FUNCTION_LIST *modules[3] = { &mock_module_no_slots, &failer, NULL }; CK_RV rv; memcpy (&failer, &mock_module, sizeof (CK_FUNCTION_LIST)); failer.C_Initialize = mock_C_Initialize__fails; mock_module_reset (); p11_kit_be_quiet (); rv = p11_kit_modules_initialize (modules, NULL); assert_num_eq (CKR_FUNCTION_FAILED, rv); p11_kit_be_loud (); /* Failed modules get removed from the list */ assert_ptr_eq (&mock_module_no_slots, modules[0]); assert_ptr_eq (NULL, modules[1]); assert_ptr_eq (NULL, modules[2]); p11_kit_modules_finalize (modules); } static void test_finalize_fail (void) { } int main (int argc, char *argv[]) { p11_mutex_init (&race_mutex); mock_module_init (); p11_library_init (); /* These only work when managed */ if (p11_virtual_can_wrap ()) { p11_test (test_recursive_initialization, "/init/test_recursive_initialization"); p11_test (test_threaded_initialization, "/init/test_threaded_initialization"); p11_test (test_mutexes, "/init/test_mutexes"); p11_test (test_load_and_initialize, "/init/test_load_and_initialize"); #ifdef OS_UNIX p11_test (test_fork_initialization, "/init/test_fork_initialization"); #endif } p11_test (test_initalize_fail, "/init/test_initalize_fail"); p11_test (test_finalize_fail, "/init/test_finalize_fail"); return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/test-proxy.c0000664000175000017500000001167112226763526014557 00000000000000/* * Copyright (c) 2013 Red Hat Inc * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #define CRYPTOKI_EXPORTS #include "config.h" #include "test.h" #include "library.h" #include "mock.h" #include "p11-kit.h" #include "pkcs11.h" #include "proxy.h" #include #include #include #include #include #include #include #include /* This is the proxy module entry point in proxy.c, and linked to this test */ CK_RV C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list); static CK_SLOT_ID mock_slot_one_id; static CK_SLOT_ID mock_slot_two_id; static CK_ULONG mock_slots_present; static CK_ULONG mock_slots_all; static void test_initialize_finalize (void) { CK_FUNCTION_LIST_PTR proxy; CK_RV rv; rv = C_GetFunctionList (&proxy); assert (rv == CKR_OK); assert (p11_proxy_module_check (proxy)); rv = proxy->C_Initialize (NULL); assert (rv == CKR_OK); rv = proxy->C_Finalize (NULL); assert (rv == CKR_OK); p11_proxy_module_cleanup (); } static void test_initialize_multiple (void) { CK_FUNCTION_LIST_PTR proxy; CK_RV rv; rv = C_GetFunctionList (&proxy); assert (rv == CKR_OK); assert (p11_proxy_module_check (proxy)); rv = proxy->C_Initialize (NULL); assert (rv == CKR_OK); rv = proxy->C_Initialize (NULL); assert (rv == CKR_OK); rv = proxy->C_Finalize (NULL); assert (rv == CKR_OK); rv = proxy->C_Finalize (NULL); assert (rv == CKR_OK); rv = proxy->C_Finalize (NULL); assert (rv == CKR_CRYPTOKI_NOT_INITIALIZED); p11_proxy_module_cleanup (); } static CK_FUNCTION_LIST_PTR setup_mock_module (CK_SESSION_HANDLE *session) { CK_FUNCTION_LIST_PTR proxy; CK_SLOT_ID slots[32]; CK_RV rv; rv = C_GetFunctionList (&proxy); assert (rv == CKR_OK); assert (p11_proxy_module_check (proxy)); rv = proxy->C_Initialize (NULL); assert (rv == CKR_OK); mock_slots_all = 32; rv = proxy->C_GetSlotList (CK_FALSE, slots, &mock_slots_all); assert (rv == CKR_OK); assert (mock_slots_all >= 2); /* Assume this is the slot we want to deal with */ mock_slot_one_id = slots[0]; mock_slot_two_id = slots[1]; rv = proxy->C_GetSlotList (CK_TRUE, NULL, &mock_slots_present); assert (rv == CKR_OK); assert (mock_slots_present > 1); if (session) { rv = (proxy->C_OpenSession) (mock_slot_one_id, CKF_RW_SESSION | CKF_SERIAL_SESSION, NULL, NULL, session); assert (rv == CKR_OK); } return proxy; } static void teardown_mock_module (CK_FUNCTION_LIST_PTR module) { CK_RV rv; rv = module->C_Finalize (NULL); assert (rv == CKR_OK); } /* * We redefine the mock module slot id so that the tests in test-mock.c * use the proxy mapped slot id rather than the hard coded one */ #define MOCK_SLOT_ONE_ID mock_slot_one_id #define MOCK_SLOT_TWO_ID mock_slot_two_id #define MOCK_SLOTS_PRESENT mock_slots_present #define MOCK_SLOTS_ALL mock_slots_all #define MOCK_INFO mock_info #define MOCK_SKIP_WAIT_TEST static const CK_INFO mock_info = { { CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, "PKCS#11 Kit ", 0, "PKCS#11 Kit Proxy Module ", { 1, 1 } }; /* Bring in all the mock module tests */ #include "test-mock.c" int main (int argc, char *argv[]) { p11_library_init (); p11_kit_be_quiet (); p11_test (test_initialize_finalize, "/proxy/initialize-finalize"); p11_test (test_initialize_multiple, "/proxy/initialize-multiple"); test_mock_add_tests ("/proxy"); return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/mock-module-ep.c0000664000175000017500000000367712144374546015245 00000000000000/* * Copyright (c) 2012 Stefan Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #define CRYPTOKI_EXPORTS 1 #include "pkcs11.h" #include "mock.h" #ifdef OS_WIN32 __declspec(dllexport) #endif CK_RV C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list) { mock_module_init (); mock_module_no_slots.C_GetFunctionList = C_GetFunctionList; if (list == NULL) return CKR_ARGUMENTS_BAD; *list = &mock_module; return CKR_OK; } p11-kit-0.20.2/p11-kit/tests/test-mock.c0000664000175000017500000013501512226763526014326 00000000000000/* * Copyright (c) 2012 Stefan Walter * Copyright (c) 2012-2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "test.h" #include "library.h" #include "mock.h" #include "p11-kit.h" #include #include #include #include #include static void test_get_info (void) { CK_FUNCTION_LIST_PTR module; CK_INFO info; CK_RV rv; module = setup_mock_module (NULL); rv = (module->C_GetInfo) (&info); assert (rv == CKR_OK); assert (memcmp (&info, &MOCK_INFO, sizeof (CK_INFO)) == 0); teardown_mock_module (module); } static void test_get_slot_list (void) { CK_FUNCTION_LIST_PTR module; CK_SLOT_ID slot_list[8]; CK_ULONG count = 0; CK_RV rv; module = setup_mock_module (NULL); /* Normal module has 2 slots, one with token present */ rv = (module->C_GetSlotList) (CK_TRUE, NULL, &count); assert (rv == CKR_OK); assert_num_eq (MOCK_SLOTS_PRESENT, count); rv = (module->C_GetSlotList) (CK_FALSE, NULL, &count); assert (rv == CKR_OK); assert_num_eq (MOCK_SLOTS_ALL, count); count = 8; rv = (module->C_GetSlotList) (CK_TRUE, slot_list, &count); assert (rv == CKR_OK); assert_num_eq (MOCK_SLOTS_PRESENT, count); assert_num_eq (MOCK_SLOT_ONE_ID, slot_list[0]); count = 8; rv = (module->C_GetSlotList) (CK_FALSE, slot_list, &count); assert (rv == CKR_OK); assert_num_eq (MOCK_SLOTS_ALL, count); assert_num_eq (MOCK_SLOT_ONE_ID, slot_list[0]); assert_num_eq (MOCK_SLOT_TWO_ID, slot_list[1]); teardown_mock_module (module); } static void test_get_slot_info (void) { CK_FUNCTION_LIST_PTR module; CK_SLOT_INFO info; char *string; CK_RV rv; module = setup_mock_module (NULL); rv = (module->C_GetSlotInfo) (MOCK_SLOT_ONE_ID, &info); assert (rv == CKR_OK); string = p11_kit_space_strdup (info.slotDescription, sizeof (info.slotDescription)); assert_str_eq ("TEST SLOT", string); free (string); string = p11_kit_space_strdup (info.manufacturerID, sizeof (info.manufacturerID)); assert_str_eq ("TEST MANUFACTURER", string); free (string); assert_num_eq (CKF_TOKEN_PRESENT | CKF_REMOVABLE_DEVICE, info.flags); assert_num_eq (55, info.hardwareVersion.major); assert_num_eq (155, info.hardwareVersion.minor); assert_num_eq (65, info.firmwareVersion.major); assert_num_eq (165, info.firmwareVersion.minor); rv = (module->C_GetSlotInfo) (MOCK_SLOT_TWO_ID, &info); assert (rv == CKR_OK); assert_num_eq (CKF_REMOVABLE_DEVICE, info.flags); rv = (module->C_GetSlotInfo) (0, &info); assert (rv == CKR_SLOT_ID_INVALID); teardown_mock_module (module); } static void test_get_token_info (void) { CK_FUNCTION_LIST_PTR module; CK_TOKEN_INFO info; char *string; CK_RV rv; module = setup_mock_module (NULL); rv = (module->C_GetTokenInfo) (MOCK_SLOT_ONE_ID, &info); assert (rv == CKR_OK); string = p11_kit_space_strdup (info.label, sizeof (info.label)); assert_str_eq ("TEST LABEL", string); free (string); string = p11_kit_space_strdup (info.manufacturerID, sizeof (info.manufacturerID)); assert_str_eq ("TEST MANUFACTURER", string); free (string); string = p11_kit_space_strdup (info.model, sizeof (info.model)); assert_str_eq ("TEST MODEL", string); free (string); string = p11_kit_space_strdup (info.serialNumber, sizeof (info.serialNumber)); assert_str_eq ("TEST SERIAL", string); free (string); assert_num_eq (CKF_LOGIN_REQUIRED | CKF_USER_PIN_INITIALIZED | CKF_CLOCK_ON_TOKEN | CKF_TOKEN_INITIALIZED, info.flags); assert_num_eq (1, info.ulMaxSessionCount); assert_num_eq (2, info.ulSessionCount); assert_num_eq (3, info.ulMaxRwSessionCount); assert_num_eq (4, info.ulRwSessionCount); assert_num_eq (5, info.ulMaxPinLen); assert_num_eq (6, info.ulMinPinLen); assert_num_eq (7, info.ulTotalPublicMemory); assert_num_eq (8, info.ulFreePublicMemory); assert_num_eq (9, info.ulTotalPrivateMemory); assert_num_eq (10, info.ulFreePrivateMemory); assert_num_eq (75, info.hardwareVersion.major); assert_num_eq (175, info.hardwareVersion.minor); assert_num_eq (85, info.firmwareVersion.major); assert_num_eq (185, info.firmwareVersion.minor); assert (memcmp (info.utcTime, "1999052509195900", sizeof (info.utcTime)) == 0); rv = (module->C_GetTokenInfo) (MOCK_SLOT_TWO_ID, &info); assert (rv == CKR_TOKEN_NOT_PRESENT); rv = (module->C_GetTokenInfo) (0, &info); assert (rv == CKR_SLOT_ID_INVALID); teardown_mock_module (module); } static void test_get_mechanism_list (void) { CK_FUNCTION_LIST_PTR module; CK_MECHANISM_TYPE mechs[8]; CK_ULONG count = 0; CK_RV rv; module = setup_mock_module (NULL); rv = (module->C_GetMechanismList) (MOCK_SLOT_ONE_ID, NULL, &count); assert (rv == CKR_OK); assert_num_eq (2, count); rv = (module->C_GetMechanismList) (MOCK_SLOT_TWO_ID, NULL, &count); assert (rv == CKR_TOKEN_NOT_PRESENT); rv = (module->C_GetMechanismList) (0, NULL, &count); assert (rv == CKR_SLOT_ID_INVALID); count = 8; rv = (module->C_GetMechanismList) (MOCK_SLOT_ONE_ID, mechs, &count); assert (rv == CKR_OK); assert_num_eq (2, count); assert_num_eq (mechs[0], CKM_MOCK_CAPITALIZE); assert_num_eq (mechs[1], CKM_MOCK_PREFIX); teardown_mock_module (module); } static void test_get_mechanism_info (void) { CK_FUNCTION_LIST_PTR module; CK_MECHANISM_INFO info; CK_RV rv; module = setup_mock_module (NULL); rv = (module->C_GetMechanismInfo) (MOCK_SLOT_ONE_ID, CKM_MOCK_CAPITALIZE, &info); assert (rv == CKR_OK); assert_num_eq (512, info.ulMinKeySize); assert_num_eq (4096, info.ulMaxKeySize); assert_num_eq (CKF_ENCRYPT | CKF_DECRYPT, info.flags); rv = (module->C_GetMechanismInfo) (MOCK_SLOT_ONE_ID, CKM_MOCK_PREFIX, &info); assert (rv == CKR_OK); assert_num_eq (2048, info.ulMinKeySize); assert_num_eq (2048, info.ulMaxKeySize); assert_num_eq (CKF_SIGN | CKF_VERIFY, info.flags); rv = (module->C_GetMechanismInfo) (MOCK_SLOT_TWO_ID, CKM_MOCK_PREFIX, &info); assert (rv == CKR_TOKEN_NOT_PRESENT); rv = (module->C_GetMechanismInfo) (MOCK_SLOT_ONE_ID, 0, &info); assert (rv == CKR_MECHANISM_INVALID); rv = (module->C_GetMechanismInfo) (0, CKM_MOCK_PREFIX, &info); assert (rv == CKR_SLOT_ID_INVALID); teardown_mock_module (module); } static void test_init_token (void) { CK_FUNCTION_LIST_PTR module; CK_RV rv; module = setup_mock_module (NULL); rv = (module->C_InitToken) (MOCK_SLOT_ONE_ID, (CK_UTF8CHAR_PTR)"TEST PIN", 8, (CK_UTF8CHAR_PTR)"TEST LABEL"); assert (rv == CKR_OK); rv = (module->C_InitToken) (MOCK_SLOT_ONE_ID, (CK_UTF8CHAR_PTR)"OTHER", 5, (CK_UTF8CHAR_PTR)"TEST LABEL"); assert (rv == CKR_PIN_INVALID); rv = (module->C_InitToken) (MOCK_SLOT_TWO_ID, (CK_UTF8CHAR_PTR)"TEST PIN", 8, (CK_UTF8CHAR_PTR)"TEST LABEL"); assert (rv == CKR_TOKEN_NOT_PRESENT); rv = (module->C_InitToken) (0, (CK_UTF8CHAR_PTR)"TEST PIN", 8, (CK_UTF8CHAR_PTR)"TEST LABEL"); assert (rv == CKR_SLOT_ID_INVALID); teardown_mock_module (module); } static void test_wait_for_slot_event (void) { CK_FUNCTION_LIST_PTR module; CK_SLOT_ID slot; CK_RV rv; #ifdef MOCK_SKIP_WAIT_TEST return; #endif module = setup_mock_module (NULL); rv = (module->C_WaitForSlotEvent) (0, &slot, NULL); assert (rv == CKR_OK); assert_num_eq (slot, MOCK_SLOT_TWO_ID); rv = (module->C_WaitForSlotEvent) (CKF_DONT_BLOCK, &slot, NULL); assert (rv == CKR_NO_EVENT); teardown_mock_module (module); } static void test_open_close_session (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_RV rv; module = setup_mock_module (NULL); rv = (module->C_OpenSession) (MOCK_SLOT_TWO_ID, CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_TOKEN_NOT_PRESENT); rv = (module->C_OpenSession) (0, CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_SLOT_ID_INVALID); rv = (module->C_OpenSession) (MOCK_SLOT_ONE_ID, CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); assert (session != 0); rv = (module->C_CloseSession) (session); assert (rv == CKR_OK); rv = (module->C_CloseSession) (session); assert (rv == CKR_SESSION_HANDLE_INVALID); teardown_mock_module (module); } static void test_close_all_sessions (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_RV rv; module = setup_mock_module (NULL); rv = (module->C_OpenSession) (MOCK_SLOT_ONE_ID, CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); assert (session != 0); rv = (module->C_CloseAllSessions) (MOCK_SLOT_ONE_ID); assert (rv == CKR_OK); rv = (module->C_CloseSession) (session); assert (rv == CKR_SESSION_HANDLE_INVALID); teardown_mock_module (module); } static void test_get_function_status (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_GetFunctionStatus) (session); assert (rv == CKR_FUNCTION_NOT_PARALLEL); teardown_mock_module (module); } static void test_cancel_function (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_CancelFunction) (session); assert (rv == CKR_FUNCTION_NOT_PARALLEL); teardown_mock_module (module); } static void test_get_session_info (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_SESSION_INFO info; CK_RV rv; module = setup_mock_module (NULL); rv = (module->C_GetSessionInfo) (0, &info); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_OpenSession) (MOCK_SLOT_ONE_ID, CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); assert (session != 0); rv = (module->C_GetSessionInfo) (session, &info); assert (rv == CKR_OK); assert_num_eq (MOCK_SLOT_ONE_ID, info.slotID); assert_num_eq (CKS_RO_PUBLIC_SESSION, info.state); assert_num_eq (CKF_SERIAL_SESSION, info.flags); assert_num_eq (1414, info.ulDeviceError); rv = (module->C_OpenSession) (MOCK_SLOT_ONE_ID, CKF_RW_SESSION | CKF_SERIAL_SESSION, NULL, NULL, &session); assert (rv == CKR_OK); assert (session != 0); rv = (module->C_GetSessionInfo) (session, &info); assert (rv == CKR_OK); assert_num_eq (MOCK_SLOT_ONE_ID, info.slotID); assert_num_eq (CKS_RW_PUBLIC_SESSION, info.state); assert_num_eq (CKF_SERIAL_SESSION | CKF_RW_SESSION, info.flags); assert_num_eq (1414, info.ulDeviceError); teardown_mock_module (module); } static void test_init_pin (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_InitPIN) (0, (CK_UTF8CHAR_PTR)"TEST PIN", 8); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_InitPIN) (session, (CK_UTF8CHAR_PTR)"TEST PIN", 8); assert (rv == CKR_OK); rv = (module->C_InitPIN) (session, (CK_UTF8CHAR_PTR)"OTHER", 5); assert (rv == CKR_PIN_INVALID); teardown_mock_module (module); } static void test_set_pin (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_SetPIN) (0, (CK_UTF8CHAR_PTR)"booo", 4, (CK_UTF8CHAR_PTR)"TEST PIN", 8); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_SetPIN) (session, (CK_UTF8CHAR_PTR)"booo", 4, (CK_UTF8CHAR_PTR)"TEST PIN", 8); assert (rv == CKR_OK); rv = (module->C_SetPIN) (session, (CK_UTF8CHAR_PTR)"other", 5, (CK_UTF8CHAR_PTR)"OTHER", 5); assert (rv == CKR_PIN_INCORRECT); teardown_mock_module (module); } static void test_operation_state (void) { CK_FUNCTION_LIST_PTR module; CK_BYTE state[128]; CK_ULONG state_len; CK_SESSION_HANDLE session = 0; CK_RV rv; module = setup_mock_module (&session); state_len = sizeof (state); rv = (module->C_GetOperationState) (0, state, &state_len); assert (rv == CKR_SESSION_HANDLE_INVALID); state_len = sizeof (state); rv = (module->C_GetOperationState) (session, state, &state_len); assert (rv == CKR_OK); rv = (module->C_SetOperationState) (session, state, state_len, 355, 455); assert (rv == CKR_OK); rv = (module->C_SetOperationState) (0, state, state_len, 355, 455); assert (rv == CKR_SESSION_HANDLE_INVALID); teardown_mock_module (module); } static void test_login_logout (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_Login) (0, CKU_USER, (CK_UTF8CHAR_PTR)"booo", 4); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_Login) (session, CKU_USER, (CK_UTF8CHAR_PTR)"bo", 2); assert (rv == CKR_PIN_INCORRECT); rv = (module->C_Login) (session, CKU_USER, (CK_UTF8CHAR_PTR)"booo", 4); assert (rv == CKR_OK); rv = (module->C_Logout) (session); assert (rv == CKR_OK); rv = (module->C_Logout) (session); assert (rv == CKR_USER_NOT_LOGGED_IN); teardown_mock_module (module); } static void test_get_attribute_value (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_ATTRIBUTE attrs[8]; char label[32]; CK_OBJECT_CLASS klass; CK_RV rv; module = setup_mock_module (&session); attrs[0].type = CKA_CLASS; attrs[0].pValue = &klass; attrs[0].ulValueLen = sizeof (klass); attrs[1].type = CKA_LABEL; attrs[1].pValue = label; attrs[1].ulValueLen = 2; /* too small */ attrs[2].type = CKA_BITS_PER_PIXEL; attrs[2].pValue = NULL; attrs[2].ulValueLen = 0; rv = (module->C_GetAttributeValue) (session, MOCK_PRIVATE_KEY_CAPITALIZE, attrs, 3); assert (rv == CKR_USER_NOT_LOGGED_IN); rv = (module->C_GetAttributeValue) (session, MOCK_PUBLIC_KEY_CAPITALIZE, attrs, 2); assert (rv == CKR_BUFFER_TOO_SMALL); /* Get right size */ attrs[1].pValue = NULL; attrs[1].ulValueLen = 0; rv = (module->C_GetAttributeValue) (session, MOCK_PUBLIC_KEY_CAPITALIZE, attrs, 2); assert (rv == CKR_OK); rv = (module->C_GetAttributeValue) (session, MOCK_PUBLIC_KEY_CAPITALIZE, attrs, 3); assert (rv == CKR_ATTRIBUTE_TYPE_INVALID); assert_num_eq (CKO_PUBLIC_KEY, klass); assert_num_eq (21, attrs[1].ulValueLen); assert_ptr_eq (NULL, attrs[1].pValue); attrs[1].pValue = label; attrs[1].ulValueLen = sizeof (label); assert ((CK_ULONG)-1 == attrs[2].ulValueLen); assert_ptr_eq (NULL, attrs[2].pValue); rv = (module->C_GetAttributeValue) (session, MOCK_PUBLIC_KEY_CAPITALIZE, attrs, 3); assert (rv == CKR_ATTRIBUTE_TYPE_INVALID); assert_num_eq (CKO_PUBLIC_KEY, klass); assert_num_eq (21, attrs[1].ulValueLen); assert_ptr_eq (label, attrs[1].pValue); assert (memcmp (label, "Public Capitalize Key", attrs[1].ulValueLen) == 0); assert ((CK_ULONG)-1 == attrs[2].ulValueLen); assert_ptr_eq (NULL, attrs[2].pValue); teardown_mock_module (module); } static void test_set_attribute_value (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_ATTRIBUTE attrs[8]; char label[32]; CK_ULONG bits; CK_RV rv; module = setup_mock_module (&session); strcpy (label, "Blahooo"); bits = 1555; attrs[0].type = CKA_LABEL; attrs[0].pValue = label; attrs[0].ulValueLen = strlen (label); attrs[1].type = CKA_BITS_PER_PIXEL; attrs[1].pValue = &bits; attrs[1].ulValueLen = sizeof (bits); rv = (module->C_SetAttributeValue) (session, MOCK_PRIVATE_KEY_CAPITALIZE, attrs, 2); assert (rv == CKR_USER_NOT_LOGGED_IN); rv = (module->C_SetAttributeValue) (session, MOCK_PUBLIC_KEY_CAPITALIZE, attrs, 2); assert (rv == CKR_OK); memset (label, 0, sizeof (label)); bits = 0; rv = (module->C_GetAttributeValue) (session, MOCK_PUBLIC_KEY_CAPITALIZE, attrs, 2); assert (rv == CKR_OK); assert_num_eq (bits, 1555); assert_num_eq (7, attrs[0].ulValueLen); assert (memcmp (label, "Blahooo", attrs[0].ulValueLen) == 0); teardown_mock_module (module); } static void test_create_object (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_OBJECT_HANDLE object; CK_ATTRIBUTE attrs[8]; char label[32]; CK_ULONG bits; CK_RV rv; module = setup_mock_module (&session); strcpy (label, "Blahooo"); bits = 1555; attrs[0].type = CKA_LABEL; attrs[0].pValue = label; attrs[0].ulValueLen = strlen (label); attrs[1].type = CKA_BITS_PER_PIXEL; attrs[1].pValue = &bits; attrs[1].ulValueLen = sizeof (bits); rv = (module->C_CreateObject) (0, attrs, 2, &object); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_CreateObject) (session, attrs, 2, &object); assert (rv == CKR_OK); attrs[0].ulValueLen = sizeof (label); memset (label, 0, sizeof (label)); bits = 0; rv = (module->C_GetAttributeValue) (session, object, attrs, 2); assert (rv == CKR_OK); assert_num_eq (bits, 1555); assert_num_eq (7, attrs[0].ulValueLen); assert (memcmp (label, "Blahooo", attrs[0].ulValueLen) == 0); teardown_mock_module (module); } static void test_copy_object (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_OBJECT_HANDLE object; CK_ATTRIBUTE attrs[8]; char label[32]; CK_ULONG bits; CK_RV rv; module = setup_mock_module (&session); bits = 1555; attrs[0].type = CKA_BITS_PER_PIXEL; attrs[0].pValue = &bits; attrs[0].ulValueLen = sizeof (bits); rv = (module->C_CopyObject) (session, 1333, attrs, 1, &object); assert (rv == CKR_OBJECT_HANDLE_INVALID); rv = (module->C_CopyObject) (session, MOCK_PUBLIC_KEY_CAPITALIZE, attrs, 1, &object); assert (rv == CKR_OK); attrs[1].type = CKA_LABEL; attrs[1].pValue = label; attrs[1].ulValueLen = sizeof (label); bits = 0; rv = (module->C_GetAttributeValue) (session, object, attrs, 2); assert (rv == CKR_OK); assert_num_eq (bits, 1555); assert_num_eq (21, attrs[1].ulValueLen); assert (memcmp (label, "Public Capitalize Key", attrs[1].ulValueLen) == 0); teardown_mock_module (module); } static void test_destroy_object (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_ATTRIBUTE attrs[8]; char label[32]; CK_RV rv; module = setup_mock_module (&session); attrs[0].type = CKA_LABEL; attrs[0].pValue = label; attrs[0].ulValueLen = sizeof (label); rv = (module->C_GetAttributeValue) (session, MOCK_PUBLIC_KEY_CAPITALIZE, attrs, 1); assert (rv == CKR_OK); rv = (module->C_DestroyObject) (0, MOCK_PUBLIC_KEY_CAPITALIZE); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_DestroyObject) (session, MOCK_PUBLIC_KEY_CAPITALIZE); assert (rv == CKR_OK); rv = (module->C_GetAttributeValue) (session, MOCK_PUBLIC_KEY_CAPITALIZE, attrs, 1); assert (rv == CKR_OBJECT_HANDLE_INVALID); teardown_mock_module (module); } static void test_get_object_size (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_ULONG size; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_GetObjectSize) (session, 1333, &size); assert (rv == CKR_OBJECT_HANDLE_INVALID); rv = (module->C_GetObjectSize) (session, MOCK_PUBLIC_KEY_CAPITALIZE, &size); assert (rv == CKR_OK); /* The number here is the length of all attributes added up */ assert_num_eq (sizeof (CK_ULONG) == 8 ? 44 : 36, size); teardown_mock_module (module); } static void test_find_objects (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_OBJECT_CLASS klass = CKO_PUBLIC_KEY; CK_ATTRIBUTE attr = { CKA_CLASS, &klass, sizeof (klass) }; CK_OBJECT_HANDLE objects[16]; CK_ULONG count; CK_ULONG i; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_FindObjectsInit) (0, &attr, 1); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_FindObjectsInit) (session, &attr, 1); assert (rv == CKR_OK); rv = (module->C_FindObjects) (0, objects, 16, &count); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_FindObjects) (session, objects, 16, &count); assert (rv == CKR_OK); assert (count < 16); /* Make sure we get the capitalize public key */ for (i = 0; i < count; i++) { if (objects[i] == MOCK_PUBLIC_KEY_CAPITALIZE) break; } assert (i != count); /* Make sure we get the prefix public key */ for (i = 0; i < count; i++) { if (objects[i] == MOCK_PUBLIC_KEY_PREFIX) break; } assert (i != count); /* Make sure all public keys */ for (i = 0; i < count; i++) { klass = (CK_ULONG)-1; rv = (module->C_GetAttributeValue) (session, objects[i], &attr, 1); assert (rv == CKR_OK); assert_num_eq (CKO_PUBLIC_KEY, klass); } rv = (module->C_FindObjectsFinal) (session); assert (rv == CKR_OK); rv = (module->C_FindObjectsFinal) (session); assert (rv == CKR_OPERATION_NOT_INITIALIZED); teardown_mock_module (module); } static void test_encrypt (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_CAPITALIZE, NULL, 0 }; CK_BYTE data[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_EncryptInit) (session, &mech, MOCK_PUBLIC_KEY_PREFIX); assert (rv == CKR_KEY_HANDLE_INVALID); rv = (module->C_EncryptInit) (session, &mech, MOCK_PUBLIC_KEY_CAPITALIZE); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_Encrypt) (0, (CK_BYTE_PTR)"blah", 4, data, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (data); rv = (module->C_Encrypt) (session, (CK_BYTE_PTR)"blah", 4, data, &length); assert (rv == CKR_OK); assert_num_eq (4, length); assert (memcmp (data, "BLAH", 4) == 0); rv = (module->C_EncryptInit) (session, &mech, MOCK_PUBLIC_KEY_CAPITALIZE); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_EncryptUpdate) (0, (CK_BYTE_PTR)"blah", 4, data, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (data); rv = (module->C_EncryptUpdate) (session, (CK_BYTE_PTR)"sLurm", 5, data, &length); assert (rv == CKR_OK); assert_num_eq (5, length); assert (memcmp (data, "SLURM", 5) == 0); length = sizeof (data); rv = (module->C_EncryptFinal) (0, data, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (data); rv = (module->C_EncryptFinal) (session, data, &length); assert (rv == CKR_OK); teardown_mock_module (module); } static void test_decrypt (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_CAPITALIZE, NULL, 0 }; CK_BYTE data[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_Login) (session, CKU_USER, (CK_BYTE_PTR)"booo", 4); assert (rv == CKR_OK); rv = (module->C_DecryptInit) (session, &mech, MOCK_PRIVATE_KEY_PREFIX); assert (rv == CKR_KEY_HANDLE_INVALID); rv = (module->C_DecryptInit) (session, &mech, MOCK_PRIVATE_KEY_CAPITALIZE); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_Decrypt) (0, (CK_BYTE_PTR)"bLAH", 4, data, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (data); rv = (module->C_Decrypt) (session, (CK_BYTE_PTR)"BLAh", 4, data, &length); assert (rv == CKR_OK); assert_num_eq (4, length); assert (memcmp (data, "blah", 4) == 0); rv = (module->C_DecryptInit) (session, &mech, MOCK_PRIVATE_KEY_CAPITALIZE); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_DecryptUpdate) (0, (CK_BYTE_PTR)"blah", 4, data, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (data); rv = (module->C_DecryptUpdate) (session, (CK_BYTE_PTR)"sLuRM", 5, data, &length); assert (rv == CKR_OK); assert_num_eq (5, length); assert (memcmp (data, "slurm", 5) == 0); length = sizeof (data); rv = (module->C_DecryptFinal) (0, data, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (data); rv = (module->C_DecryptFinal) (session, data, &length); assert (rv == CKR_OK); teardown_mock_module (module); } static void test_digest (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_COUNT, NULL, 0 }; CK_BYTE digest[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_DigestInit) (0, &mech); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_DigestInit) (session, &mech); assert (rv == CKR_OK); length = sizeof (digest); rv = (module->C_Digest) (0, (CK_BYTE_PTR)"bLAH", 4, digest, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (digest); rv = (module->C_Digest) (session, (CK_BYTE_PTR)"BLAh", 4, digest, &length); assert (rv == CKR_OK); assert_num_eq (1, length); assert (memcmp (digest, "4", 1) == 0); rv = (module->C_DigestInit) (session, &mech); assert (rv == CKR_OK); rv = (module->C_DigestUpdate) (0, (CK_BYTE_PTR)"blah", 4); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_DigestUpdate) (session, (CK_BYTE_PTR)"sLuRM", 5); assert (rv == CKR_OK); /* Adds the the value of object handle to hash: 6 */ assert_num_eq (6, MOCK_PUBLIC_KEY_PREFIX); rv = (module->C_DigestKey) (session, MOCK_PUBLIC_KEY_PREFIX); assert (rv == CKR_OK); rv = (module->C_DigestUpdate) (session, (CK_BYTE_PTR)"Other", 5); assert (rv == CKR_OK); length = sizeof (digest); rv = (module->C_DigestFinal) (0, digest, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (digest); rv = (module->C_DigestFinal) (session, digest, &length); assert (rv == CKR_OK); assert_num_eq (2, length); assert (memcmp (digest, "16", 2) == 0); teardown_mock_module (module); } static void test_sign (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_PREFIX, "prefix:", 7 }; CK_BYTE signature[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_Login) (session, CKU_USER, (CK_BYTE_PTR)"booo", 4); assert (rv == CKR_OK); rv = (module->C_SignInit) (0, &mech, MOCK_PRIVATE_KEY_PREFIX); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_SignInit) (session, &mech, MOCK_PRIVATE_KEY_PREFIX); assert (rv == CKR_OK); rv = (module->C_Login) (session, CKU_CONTEXT_SPECIFIC, (CK_BYTE_PTR)"booo", 4); assert (rv == CKR_OK); length = sizeof (signature); rv = (module->C_Sign) (0, (CK_BYTE_PTR)"bLAH", 4, signature, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (signature); rv = (module->C_Sign) (session, (CK_BYTE_PTR)"BLAh", 4, signature, &length); assert (rv == CKR_OK); assert_num_eq (13, length); assert (memcmp (signature, "prefix:value4", 13) == 0); rv = (module->C_SignInit) (session, &mech, MOCK_PRIVATE_KEY_PREFIX); assert (rv == CKR_OK); rv = (module->C_Login) (session, CKU_CONTEXT_SPECIFIC, (CK_BYTE_PTR)"booo", 4); assert (rv == CKR_OK); rv = (module->C_SignUpdate) (0, (CK_BYTE_PTR)"blah", 4); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_SignUpdate) (session, (CK_BYTE_PTR)"sLuRM", 5); assert (rv == CKR_OK); rv = (module->C_SignUpdate) (session, (CK_BYTE_PTR)"Other", 5); assert (rv == CKR_OK); length = sizeof (signature); rv = (module->C_SignFinal) (0, signature, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (signature); rv = (module->C_SignFinal) (session, signature, &length); assert (rv == CKR_OK); assert_num_eq (14, length); assert (memcmp (signature, "prefix:value10", 2) == 0); teardown_mock_module (module); } static void test_sign_recover (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_PREFIX, "prefix:", 7 }; CK_BYTE signature[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_Login) (session, CKU_USER, (CK_BYTE_PTR)"booo", 4); assert (rv == CKR_OK); rv = (module->C_SignRecoverInit) (0, &mech, MOCK_PRIVATE_KEY_PREFIX); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_SignRecoverInit) (session, &mech, MOCK_PRIVATE_KEY_PREFIX); assert (rv == CKR_OK); rv = (module->C_Login) (session, CKU_CONTEXT_SPECIFIC, (CK_BYTE_PTR)"booo", 4); assert (rv == CKR_OK); length = sizeof (signature); rv = (module->C_SignRecover) (0, (CK_BYTE_PTR)"bLAH", 4, signature, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (signature); rv = (module->C_SignRecover) (session, (CK_BYTE_PTR)"BLAh", 4, signature, &length); assert (rv == CKR_OK); assert_num_eq (16, length); assert (memcmp (signature, "prefix:valueBLAh", 16) == 0); teardown_mock_module (module); } static void test_verify (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_PREFIX, "prefix:", 7 }; CK_BYTE signature[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_VerifyInit) (0, &mech, MOCK_PUBLIC_KEY_PREFIX); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_VerifyInit) (session, &mech, MOCK_PUBLIC_KEY_PREFIX); assert (rv == CKR_OK); length = 13; memcpy (signature, "prefix:value4", length); rv = (module->C_Verify) (0, (CK_BYTE_PTR)"bLAH", 4, signature, 5); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_Verify) (session, (CK_BYTE_PTR)"BLAh", 4, signature, length); assert (rv == CKR_OK); rv = (module->C_VerifyInit) (session, &mech, MOCK_PUBLIC_KEY_PREFIX); assert (rv == CKR_OK); rv = (module->C_VerifyUpdate) (0, (CK_BYTE_PTR)"blah", 4); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_VerifyUpdate) (session, (CK_BYTE_PTR)"sLuRM", 5); assert (rv == CKR_OK); rv = (module->C_VerifyUpdate) (session, (CK_BYTE_PTR)"Other", 5); assert (rv == CKR_OK); length = 14; memcpy (signature, "prefix:value10", length); rv = (module->C_VerifyFinal) (session, signature, 5); assert (rv == CKR_SIGNATURE_LEN_RANGE); rv = (module->C_VerifyFinal) (session, signature, length); assert (rv == CKR_OK); teardown_mock_module (module); } static void test_verify_recover (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_PREFIX, "prefix:", 7 }; CK_BYTE data[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_VerifyRecoverInit) (0, &mech, MOCK_PUBLIC_KEY_PREFIX); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_VerifyRecoverInit) (session, &mech, MOCK_PUBLIC_KEY_PREFIX); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_VerifyRecover) (0, (CK_BYTE_PTR)"prefix:valueBLah", 16, data, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (data); rv = (module->C_VerifyRecover) (session, (CK_BYTE_PTR)"prefix:valueBLah", 16, data, &length); assert (rv == CKR_OK); assert_num_eq (4, length); assert (memcmp (data, "BLah", 4) == 0); teardown_mock_module (module); } static void test_digest_encrypt (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_CAPITALIZE, NULL, 0 }; CK_MECHANISM dmech = { CKM_MOCK_COUNT, NULL, 0 }; CK_BYTE data[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_EncryptInit) (session, &mech, MOCK_PUBLIC_KEY_CAPITALIZE); assert (rv == CKR_OK); rv = (module->C_DigestInit) (session, &dmech); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_DigestEncryptUpdate) (0, (CK_BYTE_PTR)"blah", 4, data, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (data); rv = (module->C_DigestEncryptUpdate) (session, (CK_BYTE_PTR)"blah", 4, data, &length); assert (rv == CKR_OK); assert_num_eq (4, length); assert (memcmp (data, "BLAH", 4) == 0); length = sizeof (data); rv = (module->C_EncryptFinal) (session, data, &length); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_DigestFinal) (session, data, &length); assert (rv == CKR_OK); assert_num_eq (1, length); assert (memcmp (data, "4", 1) == 0); teardown_mock_module (module); } static void test_decrypt_digest (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_CAPITALIZE, NULL, 0 }; CK_MECHANISM dmech = { CKM_MOCK_COUNT, NULL, 0 }; CK_BYTE data[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_Login) (session, CKU_USER, (CK_BYTE_PTR)"booo", 4); assert (rv == CKR_OK); rv = (module->C_DecryptInit) (session, &mech, MOCK_PRIVATE_KEY_CAPITALIZE); assert (rv == CKR_OK); rv = (module->C_DigestInit) (session, &dmech); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_DecryptDigestUpdate) (0, (CK_BYTE_PTR)"BLAH", 4, data, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (data); rv = (module->C_DecryptDigestUpdate) (session, (CK_BYTE_PTR)"BLAH", 4, data, &length); assert (rv == CKR_OK); assert_num_eq (4, length); assert (memcmp (data, "blah", 4) == 0); length = sizeof (data); rv = (module->C_DecryptFinal) (session, data, &length); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_DigestFinal) (session, data, &length); assert (rv == CKR_OK); assert_num_eq (1, length); assert (memcmp (data, "4", 1) == 0); teardown_mock_module (module); } static void test_sign_encrypt (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_CAPITALIZE, NULL, 0 }; CK_MECHANISM smech = { CKM_MOCK_PREFIX, "p:", 2 }; CK_BYTE data[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_Login) (session, CKU_USER, (CK_BYTE_PTR)"booo", 4); assert (rv == CKR_OK); rv = (module->C_EncryptInit) (session, &mech, MOCK_PUBLIC_KEY_CAPITALIZE); assert (rv == CKR_OK); rv = (module->C_SignInit) (session, &smech, MOCK_PRIVATE_KEY_PREFIX); assert (rv == CKR_OK); rv = (module->C_Login) (session, CKU_CONTEXT_SPECIFIC, (CK_BYTE_PTR)"booo", 4); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_SignEncryptUpdate) (0, (CK_BYTE_PTR)"blah", 4, data, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (data); rv = (module->C_SignEncryptUpdate) (session, (CK_BYTE_PTR)"blah", 4, data, &length); assert (rv == CKR_OK); assert_num_eq (4, length); assert (memcmp (data, "BLAH", 4) == 0); length = sizeof (data); rv = (module->C_EncryptFinal) (session, data, &length); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_SignFinal) (session, data, &length); assert (rv == CKR_OK); assert_num_eq (8, length); assert (memcmp (data, "p:value4", 1) == 0); teardown_mock_module (module); } static void test_decrypt_verify (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_CAPITALIZE, NULL, 0 }; CK_MECHANISM vmech = { CKM_MOCK_PREFIX, "p:", 2 }; CK_BYTE data[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_Login) (session, CKU_USER, (CK_BYTE_PTR)"booo", 4); assert (rv == CKR_OK); rv = (module->C_DecryptInit) (session, &mech, MOCK_PRIVATE_KEY_CAPITALIZE); assert (rv == CKR_OK); rv = (module->C_VerifyInit) (session, &vmech, MOCK_PUBLIC_KEY_PREFIX); assert (rv == CKR_OK); length = sizeof (data); rv = (module->C_DecryptVerifyUpdate) (0, (CK_BYTE_PTR)"BLAH", 4, data, &length); assert (rv == CKR_SESSION_HANDLE_INVALID); length = sizeof (data); rv = (module->C_DecryptVerifyUpdate) (session, (CK_BYTE_PTR)"BLAH", 4, data, &length); assert (rv == CKR_OK); assert_num_eq (4, length); assert (memcmp (data, "blah", 4) == 0); length = sizeof (data); rv = (module->C_DecryptFinal) (session, data, &length); assert (rv == CKR_OK); rv = (module->C_VerifyFinal) (session, (CK_BYTE_PTR)"p:value4", 8); assert (rv == CKR_OK); teardown_mock_module (module); } static void test_generate_key (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_OBJECT_HANDLE object; CK_MECHANISM mech = { CKM_MOCK_GENERATE, NULL, 0 }; CK_ATTRIBUTE attrs[8]; char label[32]; char value[64]; CK_ULONG bits; CK_RV rv; module = setup_mock_module (&session); strcpy (label, "Blahooo"); bits = 1555; attrs[0].type = CKA_LABEL; attrs[0].pValue = label; attrs[0].ulValueLen = strlen (label); attrs[1].type = CKA_BITS_PER_PIXEL; attrs[1].pValue = &bits; attrs[1].ulValueLen = sizeof (bits); rv = (module->C_GenerateKey) (session, &mech, attrs, 2, &object); assert (rv == CKR_MECHANISM_PARAM_INVALID); mech.pParameter = "generate"; mech.ulParameterLen = 9; rv = (module->C_GenerateKey) (session, &mech, attrs, 2, &object); assert (rv == CKR_OK); attrs[0].ulValueLen = sizeof (label); memset (label, 0, sizeof (label)); bits = 0; attrs[2].type = CKA_VALUE; attrs[2].pValue = value; attrs[2].ulValueLen = sizeof (value); rv = (module->C_GetAttributeValue) (session, object, attrs, 3); assert (rv == CKR_OK); assert_num_eq (bits, 1555); assert_num_eq (7, attrs[0].ulValueLen); assert (memcmp (label, "Blahooo", attrs[0].ulValueLen) == 0); assert_num_eq (9, attrs[2].ulValueLen); assert (memcmp (value, "generated", attrs[2].ulValueLen) == 0); teardown_mock_module (module); } static void test_generate_key_pair (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_OBJECT_HANDLE pub_object; CK_OBJECT_HANDLE priv_object; CK_MECHANISM mech = { CKM_MOCK_GENERATE, "generated", 9 }; CK_ATTRIBUTE pub_attrs[8]; CK_ATTRIBUTE priv_attrs[8]; char pub_label[32]; char pub_value[64]; char priv_label[32]; char priv_value[64]; CK_ULONG pub_bits; CK_ULONG priv_bits; CK_RV rv; module = setup_mock_module (&session); strcpy (pub_label, "Blahooo"); pub_bits = 1555; pub_attrs[0].type = CKA_LABEL; pub_attrs[0].pValue = pub_label; pub_attrs[0].ulValueLen = strlen (pub_label); pub_attrs[1].type = CKA_BITS_PER_PIXEL; pub_attrs[1].pValue = &pub_bits; pub_attrs[1].ulValueLen = sizeof (pub_bits); strcpy (priv_label, "Private"); priv_bits = 1666; priv_attrs[0].type = CKA_LABEL; priv_attrs[0].pValue = priv_label; priv_attrs[0].ulValueLen = strlen (priv_label); priv_attrs[1].type = CKA_BITS_PER_PIXEL; priv_attrs[1].pValue = &priv_bits; priv_attrs[1].ulValueLen = sizeof (priv_bits); rv = (module->C_GenerateKeyPair) (0, &mech, pub_attrs, 2, priv_attrs, 2, &pub_object, &priv_object); assert (rv == CKR_SESSION_HANDLE_INVALID); mech.pParameter = "generate"; mech.ulParameterLen = 9; rv = (module->C_GenerateKeyPair) (session, &mech, pub_attrs, 2, priv_attrs, 2, &pub_object, &priv_object); assert (rv == CKR_OK); pub_bits = 0; pub_attrs[0].ulValueLen = sizeof (pub_label); memset (pub_label, 0, sizeof (pub_label)); pub_attrs[2].type = CKA_VALUE; pub_attrs[2].pValue = pub_value; pub_attrs[2].ulValueLen = sizeof (pub_value); rv = (module->C_GetAttributeValue) (session, pub_object, pub_attrs, 3); assert (rv == CKR_OK); assert_num_eq (1555, pub_bits); assert_num_eq (7, pub_attrs[0].ulValueLen); assert (memcmp (pub_label, "Blahooo", pub_attrs[0].ulValueLen) == 0); assert_num_eq (9, pub_attrs[2].ulValueLen); assert (memcmp (pub_value, "generated", pub_attrs[2].ulValueLen) == 0); priv_bits = 0; priv_attrs[0].ulValueLen = sizeof (priv_label); memset (priv_label, 0, sizeof (priv_label)); priv_attrs[2].type = CKA_VALUE; priv_attrs[2].pValue = priv_value; priv_attrs[2].ulValueLen = sizeof (priv_value); rv = (module->C_GetAttributeValue) (session, priv_object, priv_attrs, 3); assert (rv == CKR_OK); assert_num_eq (1666, priv_bits); assert_num_eq (7, priv_attrs[0].ulValueLen); assert (memcmp (priv_label, "Private", priv_attrs[0].ulValueLen) == 0); assert_num_eq (9, priv_attrs[2].ulValueLen); assert (memcmp (priv_value, "generated", priv_attrs[2].ulValueLen) == 0); teardown_mock_module (module); } static void test_wrap_key (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_MECHANISM mech = { CKM_MOCK_WRAP, NULL, 0 }; CK_BYTE data[128]; CK_ULONG length; CK_RV rv; module = setup_mock_module (&session); length = sizeof (data); rv = (module->C_WrapKey) (session, &mech, MOCK_PUBLIC_KEY_PREFIX, MOCK_PUBLIC_KEY_PREFIX, data, &length); assert (rv == CKR_MECHANISM_PARAM_INVALID); mech.pParameter = "wrap"; mech.ulParameterLen = 4; rv = (module->C_WrapKey) (session, &mech, MOCK_PUBLIC_KEY_PREFIX, MOCK_PUBLIC_KEY_PREFIX, data, &length); assert (rv == CKR_OK); assert_num_eq (5, length); assert (memcmp (data, "value", 5) == 0); teardown_mock_module (module); } static void test_unwrap_key (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_OBJECT_HANDLE object; CK_MECHANISM mech = { CKM_MOCK_WRAP, NULL, 0 }; CK_ATTRIBUTE attrs[8]; char label[32]; char value[64]; CK_ULONG bits; CK_RV rv; module = setup_mock_module (&session); strcpy (label, "Blahooo"); bits = 1555; attrs[0].type = CKA_LABEL; attrs[0].pValue = label; attrs[0].ulValueLen = strlen (label); attrs[1].type = CKA_BITS_PER_PIXEL; attrs[1].pValue = &bits; attrs[1].ulValueLen = sizeof (bits); rv = (module->C_UnwrapKey) (session, &mech, MOCK_PUBLIC_KEY_PREFIX, (CK_BYTE_PTR)"wheee", 5, attrs, 2, &object); assert (rv == CKR_MECHANISM_PARAM_INVALID); mech.pParameter = "wrap"; mech.ulParameterLen = 4; rv = (module->C_UnwrapKey) (session, &mech, MOCK_PUBLIC_KEY_PREFIX, (CK_BYTE_PTR)"wheee", 5, attrs, 2, &object); assert (rv == CKR_OK); attrs[0].ulValueLen = sizeof (label); memset (label, 0, sizeof (label)); bits = 0; attrs[2].type = CKA_VALUE; attrs[2].pValue = value; attrs[2].ulValueLen = sizeof (value); rv = (module->C_GetAttributeValue) (session, object, attrs, 3); assert (rv == CKR_OK); assert_num_eq (bits, 1555); assert_num_eq (7, attrs[0].ulValueLen); assert (memcmp (label, "Blahooo", attrs[0].ulValueLen) == 0); assert_num_eq (5, attrs[2].ulValueLen); assert (memcmp (value, "wheee", attrs[2].ulValueLen) == 0); teardown_mock_module (module); } static void test_derive_key (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_OBJECT_HANDLE object; CK_MECHANISM mech = { CKM_MOCK_DERIVE, NULL, 0 }; CK_ATTRIBUTE attrs[8]; char label[32]; char value[64]; CK_ULONG bits; CK_RV rv; module = setup_mock_module (&session); strcpy (label, "Blahooo"); bits = 1555; attrs[0].type = CKA_LABEL; attrs[0].pValue = label; attrs[0].ulValueLen = strlen (label); attrs[1].type = CKA_BITS_PER_PIXEL; attrs[1].pValue = &bits; attrs[1].ulValueLen = sizeof (bits); rv = (module->C_DeriveKey) (session, &mech, MOCK_PUBLIC_KEY_PREFIX, attrs, 2, &object); assert (rv == CKR_MECHANISM_PARAM_INVALID); mech.pParameter = "derive"; mech.ulParameterLen = 6; rv = (module->C_DeriveKey) (session, &mech, MOCK_PUBLIC_KEY_PREFIX, attrs, 2, &object); assert (rv == CKR_OK); attrs[0].ulValueLen = sizeof (label); memset (label, 0, sizeof (label)); bits = 0; attrs[2].type = CKA_VALUE; attrs[2].pValue = value; attrs[2].ulValueLen = sizeof (value); rv = (module->C_GetAttributeValue) (session, object, attrs, 3); assert (rv == CKR_OK); assert_num_eq (bits, 1555); assert_num_eq (7, attrs[0].ulValueLen); assert (memcmp (label, "Blahooo", attrs[0].ulValueLen) == 0); assert_num_eq (7, attrs[2].ulValueLen); assert (memcmp (value, "derived", attrs[2].ulValueLen) == 0); teardown_mock_module (module); } static void test_random (void) { CK_FUNCTION_LIST_PTR module; CK_SESSION_HANDLE session = 0; CK_BYTE data[10]; CK_RV rv; module = setup_mock_module (&session); rv = (module->C_SeedRandom) (0, (CK_BYTE_PTR)"seed", 4); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_SeedRandom) (session, (CK_BYTE_PTR)"seed", 4); assert (rv == CKR_OK); rv = (module->C_GenerateRandom) (0, data, sizeof (data)); assert (rv == CKR_SESSION_HANDLE_INVALID); rv = (module->C_GenerateRandom) (session, data, sizeof (data)); assert (rv == CKR_OK); assert (memcmp (data, "seedseedse", sizeof (data)) == 0); teardown_mock_module (module); } static void test_mock_add_tests (const char *prefix) { p11_test (test_get_info, "%s/test_get_info", prefix); p11_test (test_get_slot_list, "%s/test_get_slot_list", prefix); p11_test (test_get_slot_info, "%s/test_get_slot_info", prefix); p11_test (test_get_token_info, "%s/test_get_token_info", prefix); p11_test (test_get_mechanism_list, "%s/test_get_mechanism_list", prefix); p11_test (test_get_mechanism_info, "%s/test_get_mechanism_info", prefix); p11_test (test_init_token, "%s/test_init_token", prefix); p11_test (test_wait_for_slot_event, "%s/test_wait_for_slot_event", prefix); p11_test (test_open_close_session, "%s/test_open_close_session", prefix); p11_test (test_close_all_sessions, "%s/test_close_all_sessions", prefix); p11_test (test_get_function_status, "%s/test_get_function_status", prefix); p11_test (test_cancel_function, "%s/test_cancel_function", prefix); p11_test (test_get_session_info, "%s/test_get_session_info", prefix); p11_test (test_init_pin, "%s/test_init_pin", prefix); p11_test (test_set_pin, "%s/test_set_pin", prefix); p11_test (test_operation_state, "%s/test_operation_state", prefix); p11_test (test_login_logout, "%s/test_login_logout", prefix); p11_test (test_get_attribute_value, "%s/test_get_attribute_value", prefix); p11_test (test_set_attribute_value, "%s/test_set_attribute_value", prefix); p11_test (test_create_object, "%s/test_create_object", prefix); p11_test (test_copy_object, "%s/test_copy_object", prefix); p11_test (test_destroy_object, "%s/test_destroy_object", prefix); p11_test (test_get_object_size, "%s/test_get_object_size", prefix); p11_test (test_find_objects, "%s/test_find_objects", prefix); p11_test (test_encrypt, "%s/test_encrypt", prefix); p11_test (test_decrypt, "%s/test_decrypt", prefix); p11_test (test_digest, "%s/test_digest", prefix); p11_test (test_sign, "%s/test_sign", prefix); p11_test (test_sign_recover, "%s/test_sign_recover", prefix); p11_test (test_verify, "%s/test_verify", prefix); p11_test (test_verify_recover, "%s/test_verify_recover", prefix); p11_test (test_digest_encrypt, "%s/test_digest_encrypt", prefix); p11_test (test_decrypt_digest, "%s/test_decrypt_digest", prefix); p11_test (test_sign_encrypt, "%s/test_sign_encrypt", prefix); p11_test (test_decrypt_verify, "%s/test_decrypt_verify", prefix); p11_test (test_generate_key, "%s/test_generate_key", prefix); p11_test (test_generate_key_pair, "%s/test_generate_key_pair", prefix); p11_test (test_wrap_key, "%s/test_wrap_key", prefix); p11_test (test_unwrap_key, "%s/test_unwrap_key", prefix); p11_test (test_derive_key, "%s/test_derive_key", prefix); p11_test (test_random, "%s/test_random", prefix); } p11-kit-0.20.2/p11-kit/tests/test-util.c0000664000175000017500000000424712226763526014354 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "p11-kit.h" #include #include static void test_space_strlen (void) { assert_num_eq (4, p11_kit_space_strlen ((const unsigned char *)"Test ", 20)); assert_num_eq (20, p11_kit_space_strlen ((const unsigned char *)"01234567890123456789", 20)); assert_num_eq (0, p11_kit_space_strlen ((const unsigned char *)" ", 20)); } int main (int argc, char *argv[]) { putenv ("P11_KIT_STRICT=1"); p11_test (test_space_strlen, "/util/space-strlen"); return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/test-pin.c0000664000175000017500000002131612226763526014161 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "test.h" #include "library.h" #include #include #include #include #include #include "p11-kit/pin.h" #include "p11-kit/private.h" static P11KitPin * callback_one (const char *pin_source, P11KitUri *pin_uri, const char *pin_description, P11KitPinFlags pin_flags, void *callback_data) { int *data = callback_data; assert (*data == 33); return p11_kit_pin_new_for_buffer ((unsigned char*)strdup ("one"), 3, free); } static P11KitPin* callback_other (const char *pin_source, P11KitUri *pin_uri, const char *pin_description, P11KitPinFlags pin_flags, void *callback_data) { char *data = callback_data; return p11_kit_pin_new_for_string (data); } static void destroy_data (void *callback_data) { int *data = callback_data; (*data)++; } static void test_pin_register_unregister (void) { int data = 33; p11_kit_pin_register_callback ("/the/pin_source", callback_one, &data, destroy_data); p11_kit_pin_unregister_callback ("/the/pin_source", callback_one, &data); assert_num_eq (34, data); } static void test_pin_read (void) { P11KitUri *uri; P11KitPin *pin; int data = 33; size_t length; const unsigned char *ptr; p11_kit_pin_register_callback ("/the/pin_source", callback_one, &data, destroy_data); uri = p11_kit_uri_new (); pin = p11_kit_pin_request ("/the/pin_source", uri, "The token", P11_KIT_PIN_FLAGS_USER_LOGIN); p11_kit_uri_free (uri); assert_ptr_not_null (pin); ptr = p11_kit_pin_get_value (pin, &length); assert_num_eq (3, length); assert (memcmp (ptr, "one", 3) == 0); p11_kit_pin_unregister_callback ("/the/pin_source", callback_one, &data); p11_kit_pin_unref (pin); } static void test_pin_read_no_match (void) { P11KitUri *uri; P11KitPin *pin; uri = p11_kit_uri_new (); pin = p11_kit_pin_request ("/the/pin_source", uri, "The token", P11_KIT_PIN_FLAGS_USER_LOGIN); p11_kit_uri_free (uri); assert_ptr_eq (NULL, pin); } static void test_pin_register_duplicate (void) { P11KitUri *uri; P11KitPin *pin; char *value = "secret"; int data = 33; size_t length; const unsigned char *ptr; uri = p11_kit_uri_new (); p11_kit_pin_register_callback ("/the/pin_source", callback_one, &data, destroy_data); p11_kit_pin_register_callback ("/the/pin_source", callback_other, value, NULL); pin = p11_kit_pin_request ("/the/pin_source", uri, "The token", P11_KIT_PIN_FLAGS_USER_LOGIN); assert_ptr_not_null (pin); ptr = p11_kit_pin_get_value (pin, &length); assert_num_eq (6, length); assert (memcmp (ptr, "secret", length) == 0); p11_kit_pin_unref (pin); p11_kit_pin_unregister_callback ("/the/pin_source", callback_other, value); pin = p11_kit_pin_request ("/the/pin_source", uri, "The token", P11_KIT_PIN_FLAGS_USER_LOGIN); assert_ptr_not_null (pin); ptr = p11_kit_pin_get_value (pin, &length); assert_num_eq (3, length); assert (memcmp (ptr, "one", length) == 0); p11_kit_pin_unref (pin); p11_kit_pin_unregister_callback ("/the/pin_source", callback_one, &data); pin = p11_kit_pin_request ("/the/pin_source", uri, "The token", P11_KIT_PIN_FLAGS_USER_LOGIN); assert_ptr_eq (NULL, pin); p11_kit_uri_free (uri); } static void test_pin_register_fallback (void) { char *value = "secret"; P11KitUri *uri; P11KitPin *pin; int data = 33; size_t length; const unsigned char *ptr; uri = p11_kit_uri_new (); p11_kit_pin_register_callback (P11_KIT_PIN_FALLBACK, callback_one, &data, destroy_data); pin = p11_kit_pin_request ("/the/pin_source", uri, "The token", P11_KIT_PIN_FLAGS_USER_LOGIN); assert_ptr_not_null (pin); ptr = p11_kit_pin_get_value (pin, &length); assert_num_eq (3, length); assert (memcmp (ptr, "one", length) == 0); p11_kit_pin_unref (pin); p11_kit_pin_register_callback ("/the/pin_source", callback_other, value, NULL); pin = p11_kit_pin_request ("/the/pin_source", uri, "The token", P11_KIT_PIN_FLAGS_USER_LOGIN); assert_ptr_not_null (pin); ptr = p11_kit_pin_get_value (pin, &length); assert_num_eq (6, length); assert (memcmp (ptr, "secret", length) == 0); p11_kit_pin_unref (pin); p11_kit_pin_unregister_callback ("/the/pin_source", callback_other, value); p11_kit_pin_unregister_callback (P11_KIT_PIN_FALLBACK, callback_one, &data); p11_kit_uri_free (uri); } static void test_pin_file (void) { P11KitUri *uri; P11KitPin *pin; size_t length; const unsigned char *ptr; uri = p11_kit_uri_new (); p11_kit_pin_register_callback (P11_KIT_PIN_FALLBACK, p11_kit_pin_file_callback, NULL, NULL); pin = p11_kit_pin_request (SRCDIR "/files/test-pinfile", uri, "The token", P11_KIT_PIN_FLAGS_USER_LOGIN); assert_ptr_not_null (pin); ptr = p11_kit_pin_get_value (pin, &length); assert_num_eq (12, length); assert (memcmp (ptr, "yogabbagabba", length) == 0); p11_kit_pin_unref (pin); pin = p11_kit_pin_request (SRCDIR "/files/nonexistant", uri, "The token", P11_KIT_PIN_FLAGS_USER_LOGIN); assert_ptr_eq (NULL, pin); p11_kit_pin_unregister_callback (P11_KIT_PIN_FALLBACK, p11_kit_pin_file_callback, NULL); p11_kit_uri_free (uri); } static void test_pin_file_large (void) { P11KitUri *uri; P11KitPin *pin; int error; uri = p11_kit_uri_new (); p11_kit_pin_register_callback (P11_KIT_PIN_FALLBACK, p11_kit_pin_file_callback, NULL, NULL); pin = p11_kit_pin_request (SRCDIR "/files/test-pinfile-large", uri, "The token", P11_KIT_PIN_FLAGS_USER_LOGIN); error = errno; assert_ptr_eq (NULL, pin); assert_num_eq (EFBIG, error); p11_kit_pin_unregister_callback (P11_KIT_PIN_FALLBACK, p11_kit_pin_file_callback, NULL); p11_kit_uri_free (uri); } static void test_pin_ref_unref (void) { P11KitPin *pin; P11KitPin *check; pin = p11_kit_pin_new_for_string ("crack of lies"); check = p11_kit_pin_ref (pin); assert_ptr_eq (pin, check); p11_kit_pin_unref (pin); p11_kit_pin_unref (check); } int main (int argc, char *argv[]) { p11_library_init (); p11_test (test_pin_register_unregister, "/pin/test_pin_register_unregister"); p11_test (test_pin_read, "/pin/test_pin_read"); p11_test (test_pin_read_no_match, "/pin/test_pin_read_no_match"); p11_test (test_pin_register_duplicate, "/pin/test_pin_register_duplicate"); p11_test (test_pin_register_fallback, "/pin/test_pin_register_fallback"); p11_test (test_pin_file, "/pin/test_pin_file"); p11_test (test_pin_file_large, "/pin/test_pin_file_large"); p11_test (test_pin_ref_unref, "/pin/test_pin_ref_unref"); return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/Makefile.in0000664000175000017500000011721312265245664014322 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/build/Makefile.tests $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/build/aux/depcomp @WITH_FFI_TRUE@am__append_1 = \ @WITH_FFI_TRUE@ test-virtual \ @WITH_FFI_TRUE@ test-managed \ @WITH_FFI_TRUE@ test-log \ @WITH_FFI_TRUE@ $(NULL) noinst_PROGRAMS = print-messages$(EXEEXT) frob-setuid$(EXEEXT) \ $(am__EXEEXT_3) TESTS = $(am__EXEEXT_3) subdir = p11-kit/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/gettext.m4 \ $(top_srcdir)/build/m4/iconv.m4 \ $(top_srcdir)/build/m4/lib-ld.m4 \ $(top_srcdir)/build/m4/lib-link.m4 \ $(top_srcdir)/build/m4/lib-prefix.m4 \ $(top_srcdir)/build/m4/libtool.m4 \ $(top_srcdir)/build/m4/ltoptions.m4 \ $(top_srcdir)/build/m4/ltsugar.m4 \ $(top_srcdir)/build/m4/ltversion.m4 \ $(top_srcdir)/build/m4/lt~obsolete.m4 \ $(top_srcdir)/build/m4/nls.m4 $(top_srcdir)/build/m4/po.m4 \ $(top_srcdir)/build/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) mock_four_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am__objects_1 = mock-module-ep.lo am_mock_four_la_OBJECTS = $(am__objects_1) mock_four_la_OBJECTS = $(am_mock_four_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = mock_four_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(mock_four_la_LDFLAGS) $(LDFLAGS) -o $@ mock_one_la_DEPENDENCIES = $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) am_mock_one_la_OBJECTS = mock_one_la-mock-module-ep.lo mock_one_la_OBJECTS = $(am_mock_one_la_OBJECTS) mock_one_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mock_one_la_CFLAGS) \ $(CFLAGS) $(mock_one_la_LDFLAGS) $(LDFLAGS) -o $@ mock_three_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am__objects_2 = mock_three_la-mock-module-ep.lo am_mock_three_la_OBJECTS = $(am__objects_2) mock_three_la_OBJECTS = $(am_mock_three_la_OBJECTS) mock_three_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mock_three_la_CFLAGS) \ $(CFLAGS) $(mock_three_la_LDFLAGS) $(LDFLAGS) -o $@ mock_two_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am__objects_3 = mock_two_la-mock-module-ep.lo am_mock_two_la_OBJECTS = $(am__objects_3) mock_two_la_OBJECTS = $(am_mock_two_la_OBJECTS) mock_two_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(mock_two_la_CFLAGS) \ $(CFLAGS) $(mock_two_la_LDFLAGS) $(LDFLAGS) -o $@ am__EXEEXT_1 = @WITH_FFI_TRUE@am__EXEEXT_2 = test-virtual$(EXEEXT) \ @WITH_FFI_TRUE@ test-managed$(EXEEXT) test-log$(EXEEXT) \ @WITH_FFI_TRUE@ $(am__EXEEXT_1) am__EXEEXT_3 = test-progname$(EXEEXT) test-util$(EXEEXT) \ test-conf$(EXEEXT) test-uri$(EXEEXT) test-pin$(EXEEXT) \ test-init$(EXEEXT) test-modules$(EXEEXT) \ test-deprecated$(EXEEXT) test-proxy$(EXEEXT) \ test-iter$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) PROGRAMS = $(noinst_PROGRAMS) frob_setuid_SOURCES = frob-setuid.c frob_setuid_OBJECTS = frob-setuid.$(OBJEXT) frob_setuid_LDADD = $(LDADD) frob_setuid_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) print_messages_SOURCES = print-messages.c print_messages_OBJECTS = print-messages.$(OBJEXT) print_messages_LDADD = $(LDADD) print_messages_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_conf_SOURCES = test-conf.c test_conf_OBJECTS = test-conf.$(OBJEXT) test_conf_LDADD = $(LDADD) test_conf_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_deprecated_SOURCES = test-deprecated.c test_deprecated_OBJECTS = test-deprecated.$(OBJEXT) test_deprecated_LDADD = $(LDADD) test_deprecated_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_init_SOURCES = test-init.c test_init_OBJECTS = test-init.$(OBJEXT) test_init_LDADD = $(LDADD) test_init_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_iter_SOURCES = test-iter.c test_iter_OBJECTS = test-iter.$(OBJEXT) test_iter_LDADD = $(LDADD) test_iter_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_log_SOURCES = test-log.c test_log_OBJECTS = test-log.$(OBJEXT) test_log_LDADD = $(LDADD) test_log_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_managed_SOURCES = test-managed.c test_managed_OBJECTS = test-managed.$(OBJEXT) test_managed_LDADD = $(LDADD) test_managed_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_modules_SOURCES = test-modules.c test_modules_OBJECTS = test-modules.$(OBJEXT) test_modules_LDADD = $(LDADD) test_modules_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_pin_SOURCES = test-pin.c test_pin_OBJECTS = test-pin.$(OBJEXT) test_pin_LDADD = $(LDADD) test_pin_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_progname_SOURCES = test-progname.c test_progname_OBJECTS = test-progname.$(OBJEXT) test_progname_LDADD = $(LDADD) test_progname_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_proxy_SOURCES = test-proxy.c test_proxy_OBJECTS = test-proxy.$(OBJEXT) test_proxy_LDADD = $(LDADD) test_proxy_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_uri_SOURCES = test-uri.c test_uri_OBJECTS = test-uri.$(OBJEXT) test_uri_LDADD = $(LDADD) test_uri_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_util_SOURCES = test-util.c test_util_OBJECTS = test-util.$(OBJEXT) test_util_LDADD = $(LDADD) test_util_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) test_virtual_SOURCES = test-virtual.c test_virtual_OBJECTS = test-virtual.$(OBJEXT) test_virtual_LDADD = $(LDADD) test_virtual_DEPENDENCIES = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(mock_four_la_SOURCES) $(mock_one_la_SOURCES) \ $(mock_three_la_SOURCES) $(mock_two_la_SOURCES) frob-setuid.c \ print-messages.c test-conf.c test-deprecated.c test-init.c \ test-iter.c test-log.c test-managed.c test-modules.c \ test-pin.c test-progname.c test-proxy.c test-uri.c test-util.c \ test-virtual.c DIST_SOURCES = $(mock_four_la_SOURCES) $(mock_one_la_SOURCES) \ $(mock_three_la_SOURCES) $(mock_two_la_SOURCES) frob-setuid.c \ print-messages.c test-conf.c test-deprecated.c test-init.c \ test-iter.c test-log.c test-managed.c test-modules.c \ test-pin.c test-progname.c test-proxy.c test-uri.c test-util.c \ test-virtual.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTKDOC_SCAN = @GTKDOC_SCAN@ HASH_LIBS = @HASH_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_CFLAGS = @LIBFFI_CFLAGS@ LIBFFI_LIBS = @LIBFFI_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTASN1_CFLAGS = @LIBTASN1_CFLAGS@ LIBTASN1_LIBS = @LIBTASN1_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P11KIT_LT_RELEASE = @P11KIT_LT_RELEASE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLEXT = @SHLEXT@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ p11_module_path = @p11_module_path@ p11_package_config_modules = @p11_package_config_modules@ p11_system_config = @p11_system_config@ p11_system_config_file = @p11_system_config_file@ p11_system_config_modules = @p11_system_config_modules@ p11_user_config = @p11_user_config@ p11_user_config_file = @p11_user_config_file@ p11_user_config_modules = @p11_user_config_modules@ pdfdir = @pdfdir@ prefix = @prefix@ privatedir = @privatedir@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_trust_paths = @with_trust_paths@ NULL = TEST_CFLAGS = \ -DSRCDIR=\"$(abs_srcdir)\" \ -DBUILDDIR=\"$(abs_builddir)\" \ -DP11_KIT_FUTURE_UNSTABLE_API MEMCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=80 --quiet LEAKCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=81 --quiet --leak-check=yes HELLCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=82 --quiet --tool=helgrind COMMON = $(top_srcdir)/common AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(srcdir)/.. \ -I$(COMMON) \ $(TEST_CFLAGS) LDADD = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la \ $(LTLIBINTL) CHECK_PROGS = test-progname test-util test-conf test-uri test-pin \ test-init test-modules test-deprecated test-proxy test-iter \ $(NULL) $(am__append_1) noinst_LTLIBRARIES = \ mock-one.la \ mock-two.la \ mock-three.la \ mock-four.la mock_one_la_SOURCES = \ mock-module-ep.c mock_one_la_CFLAGS = \ $(AM_CFLAGS) mock_one_la_LIBADD = \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la \ $(NULL) mock_one_la_LDFLAGS = \ -module -avoid-version -rpath /nowhere \ -no-undefined -export-symbols-regex 'C_GetFunctionList' mock_two_la_SOURCES = $(mock_one_la_SOURCES) mock_two_la_CFLAGS = $(mock_one_la_CFLAGS) mock_two_la_LDFLAGS = $(mock_one_la_LDFLAGS) mock_two_la_LIBADD = $(mock_one_la_LIBADD) mock_three_la_SOURCES = $(mock_one_la_SOURCES) mock_three_la_CFLAGS = $(mock_one_la_CFLAGS) mock_three_la_LDFLAGS = $(mock_one_la_LDFLAGS) mock_three_la_LIBADD = $(mock_one_la_LIBADD) mock_four_la_SOURCES = $(mock_one_la_SOURCES) mock_four_la_LDFLAGS = $(mock_one_la_LDFLAGS) mock_four_la_LIBADD = $(mock_one_la_LIBADD) EXTRA_DIST = \ files \ test-mock.c \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/build/Makefile.tests $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign p11-kit/tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign p11-kit/tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/build/Makefile.tests: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } mock-four.la: $(mock_four_la_OBJECTS) $(mock_four_la_DEPENDENCIES) $(EXTRA_mock_four_la_DEPENDENCIES) $(AM_V_CCLD)$(mock_four_la_LINK) $(mock_four_la_OBJECTS) $(mock_four_la_LIBADD) $(LIBS) mock-one.la: $(mock_one_la_OBJECTS) $(mock_one_la_DEPENDENCIES) $(EXTRA_mock_one_la_DEPENDENCIES) $(AM_V_CCLD)$(mock_one_la_LINK) $(mock_one_la_OBJECTS) $(mock_one_la_LIBADD) $(LIBS) mock-three.la: $(mock_three_la_OBJECTS) $(mock_three_la_DEPENDENCIES) $(EXTRA_mock_three_la_DEPENDENCIES) $(AM_V_CCLD)$(mock_three_la_LINK) $(mock_three_la_OBJECTS) $(mock_three_la_LIBADD) $(LIBS) mock-two.la: $(mock_two_la_OBJECTS) $(mock_two_la_DEPENDENCIES) $(EXTRA_mock_two_la_DEPENDENCIES) $(AM_V_CCLD)$(mock_two_la_LINK) $(mock_two_la_OBJECTS) $(mock_two_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list frob-setuid$(EXEEXT): $(frob_setuid_OBJECTS) $(frob_setuid_DEPENDENCIES) $(EXTRA_frob_setuid_DEPENDENCIES) @rm -f frob-setuid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(frob_setuid_OBJECTS) $(frob_setuid_LDADD) $(LIBS) print-messages$(EXEEXT): $(print_messages_OBJECTS) $(print_messages_DEPENDENCIES) $(EXTRA_print_messages_DEPENDENCIES) @rm -f print-messages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(print_messages_OBJECTS) $(print_messages_LDADD) $(LIBS) test-conf$(EXEEXT): $(test_conf_OBJECTS) $(test_conf_DEPENDENCIES) $(EXTRA_test_conf_DEPENDENCIES) @rm -f test-conf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_conf_OBJECTS) $(test_conf_LDADD) $(LIBS) test-deprecated$(EXEEXT): $(test_deprecated_OBJECTS) $(test_deprecated_DEPENDENCIES) $(EXTRA_test_deprecated_DEPENDENCIES) @rm -f test-deprecated$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_deprecated_OBJECTS) $(test_deprecated_LDADD) $(LIBS) test-init$(EXEEXT): $(test_init_OBJECTS) $(test_init_DEPENDENCIES) $(EXTRA_test_init_DEPENDENCIES) @rm -f test-init$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_init_OBJECTS) $(test_init_LDADD) $(LIBS) test-iter$(EXEEXT): $(test_iter_OBJECTS) $(test_iter_DEPENDENCIES) $(EXTRA_test_iter_DEPENDENCIES) @rm -f test-iter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_iter_OBJECTS) $(test_iter_LDADD) $(LIBS) test-log$(EXEEXT): $(test_log_OBJECTS) $(test_log_DEPENDENCIES) $(EXTRA_test_log_DEPENDENCIES) @rm -f test-log$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_log_OBJECTS) $(test_log_LDADD) $(LIBS) test-managed$(EXEEXT): $(test_managed_OBJECTS) $(test_managed_DEPENDENCIES) $(EXTRA_test_managed_DEPENDENCIES) @rm -f test-managed$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_managed_OBJECTS) $(test_managed_LDADD) $(LIBS) test-modules$(EXEEXT): $(test_modules_OBJECTS) $(test_modules_DEPENDENCIES) $(EXTRA_test_modules_DEPENDENCIES) @rm -f test-modules$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_modules_OBJECTS) $(test_modules_LDADD) $(LIBS) test-pin$(EXEEXT): $(test_pin_OBJECTS) $(test_pin_DEPENDENCIES) $(EXTRA_test_pin_DEPENDENCIES) @rm -f test-pin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_pin_OBJECTS) $(test_pin_LDADD) $(LIBS) test-progname$(EXEEXT): $(test_progname_OBJECTS) $(test_progname_DEPENDENCIES) $(EXTRA_test_progname_DEPENDENCIES) @rm -f test-progname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_progname_OBJECTS) $(test_progname_LDADD) $(LIBS) test-proxy$(EXEEXT): $(test_proxy_OBJECTS) $(test_proxy_DEPENDENCIES) $(EXTRA_test_proxy_DEPENDENCIES) @rm -f test-proxy$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_proxy_OBJECTS) $(test_proxy_LDADD) $(LIBS) test-uri$(EXEEXT): $(test_uri_OBJECTS) $(test_uri_DEPENDENCIES) $(EXTRA_test_uri_DEPENDENCIES) @rm -f test-uri$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_uri_OBJECTS) $(test_uri_LDADD) $(LIBS) test-util$(EXEEXT): $(test_util_OBJECTS) $(test_util_DEPENDENCIES) $(EXTRA_test_util_DEPENDENCIES) @rm -f test-util$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_util_OBJECTS) $(test_util_LDADD) $(LIBS) test-virtual$(EXEEXT): $(test_virtual_OBJECTS) $(test_virtual_DEPENDENCIES) $(EXTRA_test_virtual_DEPENDENCIES) @rm -f test-virtual$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_virtual_OBJECTS) $(test_virtual_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob-setuid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mock-module-ep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mock_one_la-mock-module-ep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mock_three_la-mock-module-ep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mock_two_la-mock-module-ep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-messages.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-deprecated.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-init.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-managed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-modules.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-progname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-proxy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-uri.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-virtual.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mock_one_la-mock-module-ep.lo: mock-module-ep.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mock_one_la_CFLAGS) $(CFLAGS) -MT mock_one_la-mock-module-ep.lo -MD -MP -MF $(DEPDIR)/mock_one_la-mock-module-ep.Tpo -c -o mock_one_la-mock-module-ep.lo `test -f 'mock-module-ep.c' || echo '$(srcdir)/'`mock-module-ep.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mock_one_la-mock-module-ep.Tpo $(DEPDIR)/mock_one_la-mock-module-ep.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mock-module-ep.c' object='mock_one_la-mock-module-ep.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mock_one_la_CFLAGS) $(CFLAGS) -c -o mock_one_la-mock-module-ep.lo `test -f 'mock-module-ep.c' || echo '$(srcdir)/'`mock-module-ep.c mock_three_la-mock-module-ep.lo: mock-module-ep.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mock_three_la_CFLAGS) $(CFLAGS) -MT mock_three_la-mock-module-ep.lo -MD -MP -MF $(DEPDIR)/mock_three_la-mock-module-ep.Tpo -c -o mock_three_la-mock-module-ep.lo `test -f 'mock-module-ep.c' || echo '$(srcdir)/'`mock-module-ep.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mock_three_la-mock-module-ep.Tpo $(DEPDIR)/mock_three_la-mock-module-ep.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mock-module-ep.c' object='mock_three_la-mock-module-ep.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mock_three_la_CFLAGS) $(CFLAGS) -c -o mock_three_la-mock-module-ep.lo `test -f 'mock-module-ep.c' || echo '$(srcdir)/'`mock-module-ep.c mock_two_la-mock-module-ep.lo: mock-module-ep.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mock_two_la_CFLAGS) $(CFLAGS) -MT mock_two_la-mock-module-ep.lo -MD -MP -MF $(DEPDIR)/mock_two_la-mock-module-ep.Tpo -c -o mock_two_la-mock-module-ep.lo `test -f 'mock-module-ep.c' || echo '$(srcdir)/'`mock-module-ep.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mock_two_la-mock-module-ep.Tpo $(DEPDIR)/mock_two_la-mock-module-ep.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mock-module-ep.c' object='mock_two_la-mock-module-ep.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mock_two_la_CFLAGS) $(CFLAGS) -c -o mock_two_la-mock-module-ep.lo `test -f 'mock-module-ep.c' || echo '$(srcdir)/'`mock-module-ep.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am memcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(MEMCHECK_ENV)" check-TESTS leakcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(LEAKCHECK_ENV)" check-TESTS hellcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(HELLCHECK_ENV)" check-TESTS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: p11-kit-0.20.2/p11-kit/tests/test-deprecated.c0000664000175000017500000002737512226763526015506 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * Copyright (c) 2012 Red Hat Inc * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #define P11_KIT_NO_DEPRECATIONS #include "config.h" #include "test.h" #include "dict.h" #include "library.h" #include "p11-kit.h" #include "private.h" #include "mock.h" #include #include #include #include #include #include #include #include static CK_FUNCTION_LIST_PTR_PTR initialize_and_get_modules (void) { CK_FUNCTION_LIST_PTR_PTR modules; CK_RV rv; rv = p11_kit_initialize_registered (); assert_num_eq (CKR_OK, rv); modules = p11_kit_registered_modules (); assert (modules != NULL && modules[0] != NULL); return modules; } static void finalize_and_free_modules (CK_FUNCTION_LIST_PTR_PTR modules) { CK_RV rv; free (modules); rv = p11_kit_finalize_registered (); assert_num_eq (CKR_OK, rv); } static void test_no_duplicates (void) { CK_FUNCTION_LIST_PTR_PTR modules; p11_dict *paths; p11_dict *funcs; char *path; int i; modules = initialize_and_get_modules (); paths = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, NULL, NULL); funcs = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, NULL); /* The loaded modules should not contain duplicates */ for (i = 0; modules[i] != NULL; i++) { path = p11_kit_registered_option (modules[i], "module"); if (p11_dict_get (funcs, modules[i])) assert_fail ("found duplicate function list pointer", NULL); if (p11_dict_get (paths, path)) assert_fail ("found duplicate path name", NULL); if (!p11_dict_set (funcs, modules[i], "")) assert_not_reached (); if (!p11_dict_set (paths, path, "")) assert_not_reached (); free (path); } p11_dict_free (paths); p11_dict_free (funcs); finalize_and_free_modules (modules); } static CK_FUNCTION_LIST_PTR lookup_module_with_name (CK_FUNCTION_LIST_PTR_PTR modules, const char *name) { CK_FUNCTION_LIST_PTR match = NULL; CK_FUNCTION_LIST_PTR module; char *module_name; int i; for (i = 0; match == NULL && modules[i] != NULL; i++) { module_name = p11_kit_registered_module_to_name (modules[i]); assert_ptr_not_null (module_name); if (strcmp (module_name, name) == 0) match = modules[i]; free (module_name); } /* * As a side effect, we should check that the results of this function * matches the above search. */ module = p11_kit_registered_name_to_module (name); if (module != match) assert_fail ("different result from p11_kit_registered_name_to_module()", NULL); return match; } static void test_disable (void) { CK_FUNCTION_LIST_PTR_PTR modules; /* * The module four should be present, as we don't match any prognames * that it has disabled. */ modules = initialize_and_get_modules (); assert (lookup_module_with_name (modules, "four") != NULL); finalize_and_free_modules (modules); /* * The module two shouldn't have been loaded, because in its config * file we have: * * disable-in: test-disable */ p11_kit_set_progname ("test-disable"); modules = initialize_and_get_modules (); assert (lookup_module_with_name (modules, "four") == NULL); finalize_and_free_modules (modules); p11_kit_set_progname (NULL); } static void test_disable_later (void) { CK_FUNCTION_LIST_PTR_PTR modules; CK_RV rv; /* * The module two shouldn't be matched, because in its config * file we have: * * disable-in: test-disable */ rv = p11_kit_initialize_registered (); assert_num_eq (CKR_OK, rv); p11_kit_set_progname ("test-disable"); modules = p11_kit_registered_modules (); assert (modules != NULL && modules[0] != NULL); assert (lookup_module_with_name (modules, "two") == NULL); finalize_and_free_modules (modules); p11_kit_set_progname (NULL); } static void test_enable (void) { CK_FUNCTION_LIST_PTR_PTR modules; /* * The module three should not be present, as we don't match the current * program. */ modules = initialize_and_get_modules (); assert (lookup_module_with_name (modules, "three") == NULL); finalize_and_free_modules (modules); /* * The module three should be loaded here , because in its config * file we have: * * enable-in: test-enable */ p11_kit_set_progname ("test-enable"); modules = initialize_and_get_modules (); assert (lookup_module_with_name (modules, "three") != NULL); finalize_and_free_modules (modules); p11_kit_set_progname (NULL); } CK_FUNCTION_LIST module; #ifdef OS_UNIX #include static CK_RV mock_C_Initialize__with_fork (CK_VOID_PTR init_args) { struct timespec ts = { 0, 100 * 1000 * 1000 }; CK_RV rv; pid_t child; pid_t ret; int status; rv = mock_C_Initialize (init_args); assert (rv == CKR_OK); /* Fork during the initialization */ child = fork (); if (child == 0) { close (1); nanosleep (&ts, NULL); exit (66); } ret = waitpid (child, &status, 0); assert (ret == child); assert (WIFEXITED (status)); assert (WEXITSTATUS (status) == 66); return CKR_OK; } static void test_fork_initialization (void) { CK_RV rv; assert (!mock_module_initialized ()); /* Build up our own function list */ memcpy (&module, &mock_module_no_slots, sizeof (CK_FUNCTION_LIST)); module.C_Initialize = mock_C_Initialize__with_fork; rv = p11_kit_initialize_module (&module); assert (rv == CKR_OK); rv = p11_kit_finalize_module (&module); assert (rv == CKR_OK); assert (!mock_module_initialized ()); } #endif /* OS_UNIX */ static CK_RV mock_C_Initialize__with_recursive (CK_VOID_PTR init_args) { /* Recursively initialize, this is broken */ return p11_kit_initialize_module (&module); } static void test_recursive_initialization (void) { CK_RV rv; assert (!mock_module_initialized ()); /* Build up our own function list */ memcpy (&module, &mock_module_no_slots, sizeof (CK_FUNCTION_LIST)); module.C_Initialize = mock_C_Initialize__with_recursive; rv = p11_kit_initialize_module (&module); assert (rv == CKR_FUNCTION_FAILED); assert (!mock_module_initialized ()); } static p11_mutex_t race_mutex; static int initialization_count = 0; static int finalization_count = 0; static CK_RV mock_C_Initialize__threaded_race (CK_VOID_PTR init_args) { /* Atomically increment value */ p11_mutex_lock (&race_mutex); initialization_count += 1; p11_mutex_unlock (&race_mutex); p11_sleep_ms (100); return CKR_OK; } static CK_RV mock_C_Finalize__threaded_race (CK_VOID_PTR reserved) { /* Atomically increment value */ p11_mutex_lock (&race_mutex); finalization_count += 1; p11_mutex_unlock (&race_mutex); p11_sleep_ms (100); return CKR_OK; } static void * initialization_thread (void *data) { CK_RV rv; assert_str_eq (data, "thread-data"); rv = p11_kit_initialize_module (&module); assert (rv == CKR_OK); return "thread-data"; } static void * finalization_thread (void *data) { CK_RV rv; assert_str_eq (data, "thread-data"); rv = p11_kit_finalize_module (&module); assert (rv == CKR_OK); return "thread-data"; } static void test_threaded_initialization (void) { static const int num_threads = 2; p11_thread_t threads[num_threads]; int ret; int i; assert (!mock_module_initialized ()); /* Build up our own function list */ memcpy (&module, &mock_module_no_slots, sizeof (CK_FUNCTION_LIST)); module.C_Initialize = mock_C_Initialize__threaded_race; module.C_Finalize = mock_C_Finalize__threaded_race; initialization_count = 0; finalization_count = 0; for (i = 0; i < num_threads; i++) { ret = p11_thread_create (&threads[i], initialization_thread, "thread-data"); assert_num_eq (0, ret); assert (threads[i] != 0); } for (i = 0; i < num_threads; i++) { ret = p11_thread_join (threads[i]); assert_num_eq (0, ret); threads[i] = 0; } for (i = 0; i < num_threads; i++) { ret = p11_thread_create (&threads[i], finalization_thread, "thread-data"); assert_num_eq (0, ret); assert (threads[i] != 0); } for (i = 0; i < num_threads; i++) { ret = p11_thread_join (threads[i]); assert_num_eq (0, ret); threads[i] = 0; } /* C_Initialize should have been called exactly once */ assert_num_eq (1, initialization_count); assert_num_eq (1, finalization_count); assert (!mock_module_initialized ()); } static CK_RV mock_C_Initialize__test_mutexes (CK_VOID_PTR args) { CK_C_INITIALIZE_ARGS_PTR init_args; void *mutex = NULL; CK_RV rv; rv = mock_C_Initialize (NULL); if (rv != CKR_OK) return rv; assert (args != NULL); init_args = args; rv = (init_args->CreateMutex) (&mutex); assert (rv == CKR_OK); rv = (init_args->LockMutex) (mutex); assert (rv == CKR_OK); rv = (init_args->UnlockMutex) (mutex); assert (rv == CKR_OK); rv = (init_args->DestroyMutex) (mutex); assert (rv == CKR_OK); return CKR_OK; } static void test_mutexes (void) { CK_RV rv; assert (!mock_module_initialized ()); /* Build up our own function list */ memcpy (&module, &mock_module_no_slots, sizeof (CK_FUNCTION_LIST)); module.C_Initialize = mock_C_Initialize__test_mutexes; rv = p11_kit_initialize_module (&module); assert (rv == CKR_OK); rv = p11_kit_finalize_module (&module); assert (rv == CKR_OK); assert (!mock_module_initialized ()); } static void test_load_and_initialize (void) { CK_FUNCTION_LIST_PTR module; CK_INFO info; CK_RV rv; int ret; rv = p11_kit_load_initialize_module (BUILDDIR "/.libs/mock-one" SHLEXT, &module); assert (rv == CKR_OK); assert (module != NULL); rv = (module->C_GetInfo) (&info); assert (rv == CKR_OK); ret = memcmp (info.manufacturerID, "MOCK MANUFACTURER ", 32); assert (ret == 0); rv = p11_kit_finalize_module (module); assert (ret == CKR_OK); } int main (int argc, char *argv[]) { p11_mutex_init (&race_mutex); mock_module_init (); p11_library_init (); p11_test (test_no_duplicates, "/deprecated/test_no_duplicates"); p11_test (test_disable, "/deprecated/test_disable"); p11_test (test_disable_later, "/deprecated/test_disable_later"); p11_test (test_enable, "/deprecated/test_enable"); #ifdef OS_UNIX p11_test (test_fork_initialization, "/deprecated/test_fork_initialization"); #endif p11_test (test_recursive_initialization, "/deprecated/test_recursive_initialization"); p11_test (test_threaded_initialization, "/deprecated/test_threaded_initialization"); p11_test (test_mutexes, "/deprecated/test_mutexes"); p11_test (test_load_and_initialize, "/deprecated/test_load_and_initialize"); p11_kit_be_quiet (); return p11_test_run (argc, argv); } p11-kit-0.20.2/p11-kit/tests/Makefile.am0000664000175000017500000000313312226763526014303 00000000000000 include $(top_srcdir)/build/Makefile.tests COMMON = $(top_srcdir)/common AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(srcdir)/.. \ -I$(COMMON) \ $(TEST_CFLAGS) LDADD = \ $(top_builddir)/p11-kit/libp11-kit-testable.la \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la \ $(LTLIBINTL) CHECK_PROGS = \ test-progname \ test-util \ test-conf \ test-uri \ test-pin \ test-init \ test-modules \ test-deprecated \ test-proxy \ test-iter \ $(NULL) if WITH_FFI CHECK_PROGS += \ test-virtual \ test-managed \ test-log \ $(NULL) endif noinst_PROGRAMS = \ print-messages \ frob-setuid \ $(CHECK_PROGS) TESTS = $(CHECK_PROGS) noinst_LTLIBRARIES = \ mock-one.la \ mock-two.la \ mock-three.la \ mock-four.la mock_one_la_SOURCES = \ mock-module-ep.c mock_one_la_CFLAGS = \ $(AM_CFLAGS) mock_one_la_LIBADD = \ $(top_builddir)/common/libp11-test.la \ $(top_builddir)/common/libp11-common.la \ $(NULL) mock_one_la_LDFLAGS = \ -module -avoid-version -rpath /nowhere \ -no-undefined -export-symbols-regex 'C_GetFunctionList' mock_two_la_SOURCES = $(mock_one_la_SOURCES) mock_two_la_CFLAGS = $(mock_one_la_CFLAGS) mock_two_la_LDFLAGS = $(mock_one_la_LDFLAGS) mock_two_la_LIBADD = $(mock_one_la_LIBADD) mock_three_la_SOURCES = $(mock_one_la_SOURCES) mock_three_la_CFLAGS = $(mock_one_la_CFLAGS) mock_three_la_LDFLAGS = $(mock_one_la_LDFLAGS) mock_three_la_LIBADD = $(mock_one_la_LIBADD) mock_four_la_SOURCES = $(mock_one_la_SOURCES) mock_four_la_LDFLAGS = $(mock_one_la_LDFLAGS) mock_four_la_LIBADD = $(mock_one_la_LIBADD) EXTRA_DIST = \ files \ test-mock.c \ $(NULL) p11-kit-0.20.2/p11-kit/proxy.h0000664000175000017500000000356212226763526012445 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef __P11_PROXY_H__ #define __P11_PROXY_H__ void p11_proxy_after_fork (void); bool p11_proxy_module_check (CK_FUNCTION_LIST_PTR module); void p11_proxy_module_cleanup (void); #endif /* __P11_PROXY_H__ */ p11-kit-0.20.2/p11-kit/deprecated.h0000664000175000017500000000722312226763526013362 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef __P11_KIT_DEPRECATED_H__ #define __P11_KIT_DEPRECATED_H__ #ifndef __P11_KIT_H__ #error "Please include instead of this file." #endif #ifdef __cplusplus extern "C" { #endif #ifndef P11_KIT_NO_DEPRECATIONS #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) #define P11_KIT_DEPRECATED_FOR(f) __attribute__((deprecated("Use " #f " instead"))) #elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) #define P11_KIT_DEPRECATED_FOR(f) __attribute__((__deprecated__)) #endif #endif #ifndef P11_KIT_DEPRECATED_FOR #define P11_KIT_DEPRECATED_FOR(f) #endif #ifndef P11_KIT_DISABLE_DEPRECATED P11_KIT_DEPRECATED_FOR (p11_kit_modules_load) CK_RV p11_kit_initialize_registered (void); P11_KIT_DEPRECATED_FOR (p11_kit_modules_release) CK_RV p11_kit_finalize_registered (void); P11_KIT_DEPRECATED_FOR (p11_kit_modules_release) CK_FUNCTION_LIST_PTR * p11_kit_registered_modules (void); P11_KIT_DEPRECATED_FOR (p11_kit_module_for_name) CK_FUNCTION_LIST_PTR p11_kit_registered_name_to_module (const char *name); P11_KIT_DEPRECATED_FOR (p11_kit_module_get_name) char * p11_kit_registered_module_to_name (CK_FUNCTION_LIST_PTR module); P11_KIT_DEPRECATED_FOR (p11_kit_config_option) char * p11_kit_registered_option (CK_FUNCTION_LIST_PTR module, const char *field); P11_KIT_DEPRECATED_FOR (module->C_Initialize) CK_RV p11_kit_initialize_module (CK_FUNCTION_LIST_PTR module); P11_KIT_DEPRECATED_FOR (module->C_Finalize) CK_RV p11_kit_finalize_module (CK_FUNCTION_LIST_PTR module); P11_KIT_DEPRECATED_FOR (p11_kit_module_load) CK_RV p11_kit_load_initialize_module (const char *module_path, CK_FUNCTION_LIST_PTR *module); #endif /* P11_KIT_DISABLE_DEPRECATED */ #undef P11_KIT_DEPRECATED_FOR #ifdef __cplusplus } /* extern "C" */ #endif #endif /* __P11_KIT_DEPRECATED_H__ */ p11-kit-0.20.2/p11-kit/modules.h0000664000175000017500000000435212226763526012732 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef __P11_MODULES_H__ #define __P11_MODULES_H__ #include "pkcs11.h" CK_RV p11_modules_load_inlock_reentrant (int flags, CK_FUNCTION_LIST_PTR **results); CK_RV p11_modules_release_inlock_reentrant (CK_FUNCTION_LIST_PTR *modules); CK_RV p11_module_load_inlock_reentrant (CK_FUNCTION_LIST_PTR module, int flags, CK_FUNCTION_LIST_PTR *result); CK_RV p11_module_release_inlock_reentrant (CK_FUNCTION_LIST_PTR module); #endif /* __P11_MODULES_H__ */ p11-kit-0.20.2/p11-kit/util.c0000664000175000017500000001634612226763526012240 00000000000000/* * Copyright (c) 2011 Collabora Ltd * Copyright (c) 2012 Stef Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * CONTRIBUTORS * Stef Walter */ #include "config.h" #include "compat.h" #define P11_DEBUG_FLAG P11_DEBUG_LIB #include "debug.h" #include "library.h" #include "message.h" #include "p11-kit.h" #include "private.h" #include "proxy.h" #include #include #include #include #include /** * SECTION:p11-kit-future * @title: Future * @short_description: Future Unstable API * * API that is not yet stable enough to be enabled by default. In all likelyhood * this will be included in the next release. To use this API you must define a * MACRO. See the p11-kit.h header for more details. */ /** * p11_kit_space_strlen: * @string: Pointer to string block * @max_length: Maximum length of string block * * In PKCS\#11 structures many strings are encoded in a strange way. The string * is placed in a fixed length buffer and then padded with spaces. * * This function determines the actual length of the string. Since the string * is not null-terminated you need to pass in the size of buffer as max_length. * The string will never be longer than this buffer. * * * CK_INFO info; * size_t length; * ... * length = p11_kit_space_strlen (info->libraryDescription, sizeof (info->libraryDescription)); * * * Returns: The length of the space padded string. */ size_t p11_kit_space_strlen (const unsigned char *string, size_t max_length) { size_t i = max_length; assert (string); while (i > 0 && string[i - 1] == ' ') --i; return i; } /** * p11_kit_space_strdup: * @string: Pointer to string block * @max_length: Maximum length of string block * * In PKCS\#11 structures many strings are encoded in a strange way. The string * is placed in a fixed length buffer and then padded with spaces. * * This function copies the space padded string into a normal null-terminated * string. The result is owned by the caller. * * * CK_INFO info; * char *description; * ... * description = p11_kit_space_strdup (info->libraryDescription, sizeof (info->libraryDescription)); * * * Returns: The newly allocated string, or %NULL if memory could not be allocated. */ char* p11_kit_space_strdup (const unsigned char *string, size_t max_length) { size_t length; char *result; assert (string); length = p11_kit_space_strlen (string, max_length); result = malloc (length + 1); if (!result) return NULL; memcpy (result, string, length); result[length] = 0; return result; } /** * p11_kit_be_quiet: * * Once this function is called, the p11-kit library will no longer print * failure or warning messages to stderr. */ void p11_kit_be_quiet (void) { p11_lock (); p11_message_quiet (); p11_debug_init (); p11_unlock (); } /** * p11_kit_be_loud: * * Tell the p11-kit library will print failure or warning messages to stderr. * This is the default behavior, but can be changed using p11_kit_be_quiet(). */ void p11_kit_be_loud (void) { p11_lock (); p11_message_loud (); p11_debug_init (); p11_unlock (); } /** * p11_kit_message: * * Gets the failure message for a recently called p11-kit function, which * returned a failure code on this thread. Not all functions set this message. * Each function that does so, will note it in its documentation. * * If the most recent p11-kit function did not fail, then this will return NULL. * The string is owned by the p11-kit library and is only valid on the same * thread that the failed function executed on. * * Returns: The last failure message, or %NULL. */ const char* p11_kit_message (void) { return p11_message_last (); } void _p11_kit_default_message (CK_RV rv) { const char *msg; if (rv != CKR_OK) { msg = p11_kit_strerror (rv); p11_message_store (msg, strlen (msg)); } } /* This is the progname that we think of this process as. */ char p11_my_progname[256] = { 0, }; /** * p11_kit_set_progname: * @progname: the program base name * * Set the program base name that is used by the enable-in * and disable-in module configuration options. * * Normally this is automatically calculated from the program's argument list. * You would usually call this before initializing p11-kit modules. */ void p11_kit_set_progname (const char *progname) { p11_library_init_once (); p11_lock (); _p11_set_progname_unlocked (progname); p11_unlock (); } void _p11_set_progname_unlocked (const char *progname) { /* We can be called with NULL */ if (progname == NULL) progname = ""; strncpy (p11_my_progname, progname, sizeof (p11_my_progname)); p11_my_progname[sizeof (p11_my_progname) - 1] = 0; } const char * _p11_get_progname_unlocked (void) { if (p11_my_progname[0] == '\0') _p11_set_progname_unlocked (getprogname ()); if (p11_my_progname[0] == '\0') return NULL; return p11_my_progname; } #ifdef OS_UNIX void _p11_kit_init (void); void _p11_kit_fini (void); #ifdef __GNUC__ __attribute__((constructor)) #endif void _p11_kit_init (void) { p11_library_init_once (); } #ifdef __GNUC__ __attribute__((destructor)) #endif void _p11_kit_fini (void) { p11_proxy_module_cleanup (); p11_library_uninit (); } #endif /* OS_UNIX */ #ifdef OS_WIN32 BOOL WINAPI DllMain (HINSTANCE, DWORD, LPVOID); BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, LPVOID reserved) { switch (reason) { case DLL_PROCESS_ATTACH: p11_library_init (); break; case DLL_THREAD_DETACH: p11_library_thread_cleanup (); break; case DLL_PROCESS_DETACH: p11_proxy_module_cleanup (); p11_library_uninit (); break; default: break; } return TRUE; } #endif /* OS_WIN32 */ p11-kit-0.20.2/p11-kit/pin.h0000664000175000017500000001151012161102013012012 00000000000000/* * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_KIT_PIN_H #define P11_KIT_PIN_H #include #ifdef __cplusplus extern "C" { #endif typedef struct p11_kit_pin P11KitPin; typedef enum { P11_KIT_PIN_FLAGS_USER_LOGIN = 1<<0, P11_KIT_PIN_FLAGS_SO_LOGIN = 1<<1, P11_KIT_PIN_FLAGS_CONTEXT_LOGIN = 1<<2, P11_KIT_PIN_FLAGS_RETRY = 1<<3, P11_KIT_PIN_FLAGS_MANY_TRIES = 1<<4, P11_KIT_PIN_FLAGS_FINAL_TRY = 1<<5 } P11KitPinFlags; #define P11_KIT_PIN_FALLBACK "" typedef void (*p11_kit_pin_destroy_func) (void *data); P11KitPin* p11_kit_pin_new (const unsigned char *value, size_t length); P11KitPin* p11_kit_pin_new_for_string (const char *value); P11KitPin* p11_kit_pin_new_for_buffer (unsigned char *buffer, size_t length, p11_kit_pin_destroy_func destroy); P11KitPin* p11_kit_pin_ref (P11KitPin *pin); void p11_kit_pin_unref (P11KitPin *pin); const unsigned char * p11_kit_pin_get_value (P11KitPin *pin, size_t *length); size_t p11_kit_pin_get_length (P11KitPin *pin); typedef P11KitPin* (*p11_kit_pin_callback) (const char *pin_source, P11KitUri *pin_uri, const char *pin_description, P11KitPinFlags pin_flags, void *callback_data); int p11_kit_pin_register_callback (const char *pin_source, p11_kit_pin_callback callback, void *callback_data, p11_kit_pin_destroy_func callback_destroy); void p11_kit_pin_unregister_callback (const char *pin_source, p11_kit_pin_callback callback, void *callback_data); P11KitPin* p11_kit_pin_request (const char *pin_source, P11KitUri *pin_uri, const char *pin_description, P11KitPinFlags pin_flags); P11KitPin* p11_kit_pin_file_callback (const char *pin_source, P11KitUri *pin_uri, const char *pin_description, P11KitPinFlags pin_flags, void *callback_data); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* P11_KIT_URI_H */ p11-kit-0.20.2/p11-kit/p11-kit.h0000664000175000017500000001111212226763526012440 00000000000000/* * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef __P11_KIT_H__ #define __P11_KIT_H__ #include "p11-kit/pkcs11.h" /* * If the caller is using the PKCS#11 GNU calling convention, then we cater * to that here. */ #ifdef CRYPTOKI_GNU typedef ck_rv_t CK_RV; typedef struct ck_function_list* CK_FUNCTION_LIST_PTR; typedef struct ck_function_list CK_FUNCTION_LIST; #endif #include "p11-kit/deprecated.h" #ifdef __cplusplus extern "C" { #endif enum { P11_KIT_MODULE_UNMANAGED = 1 << 0, P11_KIT_MODULE_CRITICAL = 1 << 1, P11_KIT_MODULE_TRUSTED = 1 << 2, }; typedef void (* p11_kit_destroyer) (void *data); CK_FUNCTION_LIST ** p11_kit_modules_load (const char *reserved, int flags); CK_RV p11_kit_modules_initialize (CK_FUNCTION_LIST **modules, p11_kit_destroyer failure_callback); CK_FUNCTION_LIST ** p11_kit_modules_load_and_initialize (int flags); CK_RV p11_kit_modules_finalize (CK_FUNCTION_LIST **modules); void p11_kit_modules_release (CK_FUNCTION_LIST **modules); void p11_kit_modules_finalize_and_release (CK_FUNCTION_LIST **modules); CK_FUNCTION_LIST * p11_kit_module_for_name (CK_FUNCTION_LIST **modules, const char *name); char * p11_kit_module_get_name (CK_FUNCTION_LIST *module); int p11_kit_module_get_flags (CK_FUNCTION_LIST *module); CK_FUNCTION_LIST * p11_kit_module_load (const char *module_path, int flags); CK_RV p11_kit_module_initialize (CK_FUNCTION_LIST *module); CK_RV p11_kit_module_finalize (CK_FUNCTION_LIST *module); void p11_kit_module_release (CK_FUNCTION_LIST *module); char * p11_kit_config_option (CK_FUNCTION_LIST *module, const char *option); const char* p11_kit_strerror (CK_RV rv); size_t p11_kit_space_strlen (const unsigned char *string, size_t max_length); char* p11_kit_space_strdup (const unsigned char *string, size_t max_length); #ifdef P11_KIT_FUTURE_UNSTABLE_API void p11_kit_set_progname (const char *progname); void p11_kit_be_quiet (void); void p11_kit_be_loud (void); #endif const char * p11_kit_message (void); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* __P11_KIT_H__ */ p11-kit-0.20.2/p11-kit/virtual.c0000664000175000017500000030443312226763526012746 00000000000000/* * Copyright (C) 2008 Stefan Walter * Copyright (C) 2012 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #define P11_DEBUG_FLAG P11_DEBUG_LIB #include "debug.h" #include "library.h" #include "virtual.h" #include #include #include #include #ifdef WITH_FFI /* * We use libffi to build closures. Note that even with libffi certain * platforms do not support using ffi_closure. In this case FFI_CLOSURES will * not be defined. This is checked in configure.ac */ #include "ffi.h" #ifndef FFI_CLOSURES #error "FFI_CLOSURES should be checked in configure.ac" #endif /* There are 66 functions in PKCS#11, with a maximum of 8 args */ #define MAX_FUNCTIONS 66 #define MAX_ARGS 10 typedef struct { /* This is first so we can cast between CK_FUNCTION_LIST* and Context* */ CK_FUNCTION_LIST bound; /* The PKCS#11 functions to call into */ p11_virtual *virt; p11_destroyer destroyer; /* A list of our libffi built closures, for cleanup later */ ffi_closure *ffi_closures[MAX_FUNCTIONS]; ffi_cif ffi_cifs[MAX_FUNCTIONS]; int ffi_used; } Wrapper; static CK_RV short_C_GetFunctionStatus (CK_SESSION_HANDLE handle) { return CKR_FUNCTION_NOT_PARALLEL; } static CK_RV short_C_CancelFunction (CK_SESSION_HANDLE handle) { return CKR_FUNCTION_NOT_PARALLEL; } static void binding_C_GetFunctionList (ffi_cif *cif, CK_RV *ret, void* args[], Wrapper *wrapper) { CK_FUNCTION_LIST_PTR_PTR list = *(CK_FUNCTION_LIST_PTR_PTR *)args[0]; if (list == NULL) { *ret = CKR_ARGUMENTS_BAD; } else { *list = &wrapper->bound; *ret = CKR_OK; } } static void binding_C_Initialize (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_Initialize (funcs, *(CK_VOID_PTR *)args[0]); } static void binding_C_Finalize (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_Finalize (funcs, *(CK_VOID_PTR *)args[0]); } static void binding_C_GetInfo (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GetInfo (funcs, *(CK_INFO_PTR *)args[0]); } static void binding_C_GetSlotList (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GetSlotList (funcs, *(CK_BBOOL *)args[0], *(CK_SLOT_ID_PTR *)args[1], *(CK_ULONG_PTR *)args[2]); } static void binding_C_GetSlotInfo (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GetSlotInfo (funcs, *(CK_SLOT_ID *)args[0], *(CK_SLOT_INFO_PTR *)args[1]); } static void binding_C_GetTokenInfo (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GetTokenInfo (funcs, *(CK_SLOT_ID *)args[0], *(CK_TOKEN_INFO_PTR *)args[1]); } static void binding_C_WaitForSlotEvent (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_WaitForSlotEvent (funcs, *(CK_FLAGS *)args[0], *(CK_SLOT_ID_PTR *)args[1], *(CK_VOID_PTR *)args[2]); } static void binding_C_GetMechanismList (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GetMechanismList (funcs, *(CK_SLOT_ID *)args[0], *(CK_MECHANISM_TYPE_PTR *)args[1], *(CK_ULONG_PTR *)args[2]); } static void binding_C_GetMechanismInfo (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GetMechanismInfo (funcs, *(CK_SLOT_ID *)args[0], *(CK_MECHANISM_TYPE *)args[1], *(CK_MECHANISM_INFO_PTR *)args[2]); } static void binding_C_InitToken (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_InitToken (funcs, *(CK_SLOT_ID *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3]); } static void binding_C_InitPIN (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_InitPIN (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2]); } static void binding_C_SetPIN (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_SetPIN (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG *)args[4]); } static void binding_C_OpenSession (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_OpenSession (funcs, *(CK_SLOT_ID *)args[0], *(CK_FLAGS *)args[1], *(CK_VOID_PTR *)args[2], *(CK_NOTIFY *)args[3], *(CK_SESSION_HANDLE_PTR *)args[4]); } static void binding_C_CloseSession (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_CloseSession (funcs, *(CK_SESSION_HANDLE *)args[0]); } static void binding_C_CloseAllSessions (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_CloseAllSessions (funcs, *(CK_SLOT_ID *)args[0]); } static void binding_C_GetSessionInfo (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GetSessionInfo (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_SESSION_INFO_PTR *)args[1]); } static void binding_C_GetOperationState (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GetOperationState (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG_PTR *)args[2]); } static void binding_C_SetOperationState (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_SetOperationState (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_OBJECT_HANDLE *)args[3], *(CK_OBJECT_HANDLE *)args[4]); } static void binding_C_Login (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_Login (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_USER_TYPE *)args[1], *(CK_BYTE_PTR *)args[2], *(CK_ULONG *)args[3]); } static void binding_C_Logout (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_Logout (funcs, *(CK_SESSION_HANDLE *)args[0]); } static void binding_C_CreateObject (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_CreateObject (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_ATTRIBUTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_OBJECT_HANDLE_PTR *)args[3]); } static void binding_C_CopyObject (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_CopyObject (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_OBJECT_HANDLE *)args[1], *(CK_ATTRIBUTE_PTR *)args[2], *(CK_ULONG *)args[3], *(CK_OBJECT_HANDLE_PTR *)args[4]); } static void binding_C_DestroyObject (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DestroyObject (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_OBJECT_HANDLE *)args[1]); } static void binding_C_GetObjectSize (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GetObjectSize (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_OBJECT_HANDLE *)args[1], *(CK_ULONG_PTR *)args[2]); } static void binding_C_GetAttributeValue (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GetAttributeValue (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_OBJECT_HANDLE *)args[1], *(CK_ATTRIBUTE_PTR *)args[2], *(CK_ULONG *)args[3]); } static void binding_C_SetAttributeValue (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_SetAttributeValue (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_OBJECT_HANDLE *)args[1], *(CK_ATTRIBUTE_PTR *)args[2], *(CK_ULONG *)args[3]); } static void binding_C_FindObjectsInit (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_FindObjectsInit (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_ATTRIBUTE_PTR *)args[1], *(CK_ULONG *)args[2]); } static void binding_C_FindObjects (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_FindObjects (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_OBJECT_HANDLE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_ULONG_PTR *)args[3]); } static void binding_C_FindObjectsFinal (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_FindObjectsFinal (funcs, *(CK_SESSION_HANDLE *)args[0]); } static void binding_C_EncryptInit (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_EncryptInit (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1], *(CK_OBJECT_HANDLE *)args[2]); } static void binding_C_Encrypt (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_Encrypt (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_EncryptUpdate (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_EncryptUpdate (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_EncryptFinal (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_EncryptFinal (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG_PTR *)args[2]); } static void binding_C_DecryptInit (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DecryptInit (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1], *(CK_OBJECT_HANDLE *)args[2]); } static void binding_C_Decrypt (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_Decrypt (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_DecryptUpdate (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DecryptUpdate (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_DecryptFinal (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DecryptFinal (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG_PTR *)args[2]); } static void binding_C_DigestInit (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DigestInit (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1]); } static void binding_C_Digest (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_Digest (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_DigestUpdate (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DigestUpdate (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2]); } static void binding_C_DigestKey (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DigestKey (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_OBJECT_HANDLE *)args[1]); } static void binding_C_DigestFinal (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DigestFinal (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG_PTR *)args[2]); } static void binding_C_SignInit (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_SignInit (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1], *(CK_OBJECT_HANDLE *)args[2]); } static void binding_C_Sign (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_Sign (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_SignUpdate (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_SignUpdate (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2]); } static void binding_C_SignFinal (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_SignFinal (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG_PTR *)args[2]); } static void binding_C_SignRecoverInit (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_SignRecoverInit (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1], *(CK_OBJECT_HANDLE *)args[2]); } static void binding_C_SignRecover (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_SignRecover (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_VerifyInit (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_VerifyInit (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1], *(CK_OBJECT_HANDLE *)args[2]); } static void binding_C_Verify (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_Verify (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG *)args[4]); } static void binding_C_VerifyUpdate (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_VerifyUpdate (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2]); } static void binding_C_VerifyFinal (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_VerifyFinal (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2]); } static void binding_C_VerifyRecoverInit (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_VerifyRecoverInit (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1], *(CK_OBJECT_HANDLE *)args[2]); } static void binding_C_VerifyRecover (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_VerifyRecover (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_DigestEncryptUpdate (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DigestEncryptUpdate (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_DecryptDigestUpdate (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DecryptDigestUpdate (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_SignEncryptUpdate (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_SignEncryptUpdate (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_DecryptVerifyUpdate (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DecryptVerifyUpdate (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG_PTR *)args[4]); } static void binding_C_GenerateKey (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GenerateKey (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1], *(CK_ATTRIBUTE_PTR *)args[2], *(CK_ULONG *)args[3], *(CK_OBJECT_HANDLE_PTR *)args[4]); } static void binding_C_GenerateKeyPair (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GenerateKeyPair (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1], *(CK_ATTRIBUTE_PTR *)args[2], *(CK_ULONG *)args[3], *(CK_ATTRIBUTE_PTR *)args[4], *(CK_ULONG *)args[5], *(CK_OBJECT_HANDLE_PTR *)args[6], *(CK_OBJECT_HANDLE_PTR *)args[7]); } static void binding_C_WrapKey (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_WrapKey (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1], *(CK_OBJECT_HANDLE *)args[2], *(CK_OBJECT_HANDLE *)args[3], *(CK_BYTE_PTR *)args[4], *(CK_ULONG_PTR *)args[5]); } static void binding_C_UnwrapKey (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_UnwrapKey (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1], *(CK_OBJECT_HANDLE *)args[2], *(CK_BYTE_PTR *)args[3], *(CK_ULONG *)args[4], *(CK_ATTRIBUTE_PTR *)args[5], *(CK_ULONG *)args[6], *(CK_OBJECT_HANDLE_PTR *)args[7]); } static void binding_C_DeriveKey (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_DeriveKey (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_MECHANISM_PTR *)args[1], *(CK_OBJECT_HANDLE *)args[2], *(CK_ATTRIBUTE_PTR *)args[3], *(CK_ULONG *)args[4], *(CK_OBJECT_HANDLE_PTR *)args[5]); } static void binding_C_SeedRandom (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_SeedRandom (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2]); } static void binding_C_GenerateRandom (ffi_cif *cif, CK_RV *ret, void* args[], CK_X_FUNCTION_LIST *funcs) { *ret = funcs->C_GenerateRandom (funcs, *(CK_SESSION_HANDLE *)args[0], *(CK_BYTE_PTR *)args[1], *(CK_ULONG *)args[2]); } #endif /* WITH_FFI */ static CK_RV stack_C_Initialize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR init_args) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Initialize (funcs, init_args); } static CK_RV stack_C_Finalize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR reserved) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Finalize (funcs, reserved); } static CK_RV stack_C_GetInfo (CK_X_FUNCTION_LIST *self, CK_INFO_PTR info) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetInfo (funcs, info); } static CK_RV stack_C_GetSlotList (CK_X_FUNCTION_LIST *self, CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetSlotList (funcs, token_present, slot_list, count); } static CK_RV stack_C_GetSlotInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_SLOT_INFO_PTR info) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetSlotInfo (funcs, slot_id, info); } static CK_RV stack_C_GetTokenInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_TOKEN_INFO_PTR info) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetTokenInfo (funcs, slot_id, info); } static CK_RV stack_C_GetMechanismList (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_MECHANISM_TYPE_PTR mechanism_list, CK_ULONG_PTR count) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetMechanismList (funcs, slot_id, mechanism_list, count); } static CK_RV stack_C_GetMechanismInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR info) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetMechanismInfo (funcs, slot_id, type, info); } static CK_RV stack_C_InitToken (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len, CK_UTF8CHAR_PTR label) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_InitToken (funcs, slot_id, pin, pin_len, label); } static CK_RV stack_C_OpenSession (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_FLAGS flags, CK_VOID_PTR application, CK_NOTIFY notify, CK_SESSION_HANDLE_PTR session) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_OpenSession (funcs, slot_id, flags, application, notify, session); } static CK_RV stack_C_CloseSession (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_CloseSession (funcs, session); } static CK_RV stack_C_CloseAllSessions (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_CloseAllSessions (funcs, slot_id); } static CK_RV stack_C_GetSessionInfo (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_SESSION_INFO_PTR info) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetSessionInfo (funcs, session, info); } static CK_RV stack_C_InitPIN (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_InitPIN (funcs, session, pin, pin_len); } static CK_RV stack_C_SetPIN (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR old_pin, CK_ULONG old_len, CK_UTF8CHAR_PTR new_pin, CK_ULONG new_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SetPIN (funcs, session, old_pin, old_len, new_pin, new_len); } static CK_RV stack_C_GetOperationState (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG_PTR operation_state_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetOperationState (funcs, session, operation_state, operation_state_len); } static CK_RV stack_C_SetOperationState (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key, CK_OBJECT_HANDLE authentication_key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SetOperationState (funcs, session, operation_state, operation_state_len, encryption_key, authentication_key); } static CK_RV stack_C_Login (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_USER_TYPE user_type, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Login (funcs, session, user_type, pin, pin_len); } static CK_RV stack_C_Logout (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Logout (funcs, session); } static CK_RV stack_C_CreateObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR object) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_CreateObject (funcs, session, template, count, object); } static CK_RV stack_C_CopyObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_CopyObject (funcs, session, object, template, count, new_object); } static CK_RV stack_C_DestroyObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DestroyObject (funcs, session, object); } static CK_RV stack_C_GetObjectSize (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ULONG_PTR size) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetObjectSize (funcs, session, object, size); } static CK_RV stack_C_GetAttributeValue (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetAttributeValue (funcs, session, object, template, count); } static CK_RV stack_C_SetAttributeValue (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SetAttributeValue (funcs, session, object, template, count); } static CK_RV stack_C_FindObjectsInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_FindObjectsInit (funcs, session, template, count); } static CK_RV stack_C_FindObjects (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE_PTR object, CK_ULONG max_object_count, CK_ULONG_PTR object_count) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_FindObjects (funcs, session, object, max_object_count, object_count); } static CK_RV stack_C_FindObjectsFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_FindObjectsFinal (funcs, session); } static CK_RV stack_C_EncryptInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_EncryptInit (funcs, session, mechanism, key); } static CK_RV stack_C_Encrypt (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR encrypted_data, CK_ULONG_PTR encrypted_data_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Encrypt (funcs, session, input, input_len, encrypted_data, encrypted_data_len); } static CK_RV stack_C_EncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_EncryptUpdate (funcs, session, part, part_len, encrypted_part, encrypted_part_len); } static CK_RV stack_C_EncryptFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR last_encrypted_part, CK_ULONG_PTR last_encrypted_part_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_EncryptFinal (funcs, session, last_encrypted_part, last_encrypted_part_len); } static CK_RV stack_C_DecryptInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DecryptInit (funcs, session, mechanism, key); } static CK_RV stack_C_Decrypt (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_data, CK_ULONG encrypted_data_len, CK_BYTE_PTR output, CK_ULONG_PTR output_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Decrypt (funcs, session, encrypted_data, encrypted_data_len, output, output_len); } static CK_RV stack_C_DecryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DecryptUpdate (funcs, session, encrypted_part, encrypted_part_len, part, part_len); } static CK_RV stack_C_DecryptFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DecryptFinal (funcs, session, last_part, last_part_len); } static CK_RV stack_C_DigestInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DigestInit (funcs, session, mechanism); } static CK_RV stack_C_Digest (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Digest (funcs, session, input, input_len, digest, digest_len); } static CK_RV stack_C_DigestUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DigestUpdate (funcs, session, part, part_len); } static CK_RV stack_C_DigestKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DigestKey (funcs, session, key); } static CK_RV stack_C_DigestFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DigestFinal (funcs, session, digest, digest_len); } static CK_RV stack_C_SignInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignInit (funcs, session, mechanism, key); } static CK_RV stack_C_Sign (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Sign (funcs, session, input, input_len, signature, signature_len); } static CK_RV stack_C_SignUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignUpdate (funcs, session, part, part_len); } static CK_RV stack_C_SignFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignFinal (funcs, session, signature, signature_len); } static CK_RV stack_C_SignRecoverInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignRecoverInit (funcs, session, mechanism, key); } static CK_RV stack_C_SignRecover (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignRecover (funcs, session, input, input_len, signature, signature_len); } static CK_RV stack_C_VerifyInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_VerifyInit (funcs, session, mechanism, key); } static CK_RV stack_C_Verify (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR signature, CK_ULONG signature_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Verify (funcs, session, input, input_len, signature, signature_len); } static CK_RV stack_C_VerifyUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_VerifyUpdate (funcs, session, part, part_len); } static CK_RV stack_C_VerifyFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_VerifyFinal (funcs, session, signature, signature_len); } static CK_RV stack_C_VerifyRecoverInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_VerifyRecoverInit (funcs, session, mechanism, key); } static CK_RV stack_C_VerifyRecover (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len, CK_BYTE_PTR input, CK_ULONG_PTR input_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_VerifyRecover (funcs, session, signature, signature_len, input, input_len); } static CK_RV stack_C_DigestEncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DigestEncryptUpdate (funcs, session, part, part_len, encrypted_part, encrypted_part_len); } static CK_RV stack_C_DecryptDigestUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DecryptDigestUpdate (funcs, session, encrypted_part, encrypted_part_len, part, part_len); } static CK_RV stack_C_SignEncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignEncryptUpdate (funcs, session, part, part_len, encrypted_part, encrypted_part_len); } static CK_RV stack_C_DecryptVerifyUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DecryptVerifyUpdate (funcs, session, encrypted_part, encrypted_part_len, part, part_len); } static CK_RV stack_C_GenerateKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GenerateKey (funcs, session, mechanism, template, count, key); } static CK_RV stack_C_GenerateKeyPair (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR public_key_template, CK_ULONG public_key_count, CK_ATTRIBUTE_PTR private_key_template, CK_ULONG private_key_count, CK_OBJECT_HANDLE_PTR public_key, CK_OBJECT_HANDLE_PTR private_key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GenerateKeyPair (funcs, session, mechanism, public_key_template, public_key_count, private_key_template, private_key_count, public_key, private_key); } static CK_RV stack_C_WrapKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key, CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_WrapKey (funcs, session, mechanism, wrapping_key, key, wrapped_key, wrapped_key_len); } static CK_RV stack_C_UnwrapKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key, CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_UnwrapKey (funcs, session, mechanism, unwrapping_key, wrapped_key, wrapped_key_len, template, count, key); } static CK_RV stack_C_DeriveKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DeriveKey (funcs, session, mechanism, base_key, template, count, key); } static CK_RV stack_C_SeedRandom (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR seed, CK_ULONG seed_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SeedRandom (funcs, session, seed, seed_len); } static CK_RV stack_C_GenerateRandom (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR random_data, CK_ULONG random_len) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GenerateRandom (funcs, session, random_data, random_len); } static CK_RV stack_C_WaitForSlotEvent (CK_X_FUNCTION_LIST *self, CK_FLAGS flags, CK_SLOT_ID_PTR slot_id, CK_VOID_PTR reserved) { p11_virtual *virt = (p11_virtual *)self; CK_X_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_WaitForSlotEvent (funcs, flags, slot_id, reserved); } static CK_RV base_C_Initialize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR init_args) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Initialize (init_args); } static CK_RV base_C_Finalize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR reserved) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Finalize (reserved); } static CK_RV base_C_GetInfo (CK_X_FUNCTION_LIST *self, CK_INFO_PTR info) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetInfo (info); } static CK_RV base_C_GetSlotList (CK_X_FUNCTION_LIST *self, CK_BBOOL token_present, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR count) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetSlotList (token_present, slot_list, count); } static CK_RV base_C_GetSlotInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_SLOT_INFO_PTR info) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetSlotInfo (slot_id, info); } static CK_RV base_C_GetTokenInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_TOKEN_INFO_PTR info) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetTokenInfo (slot_id, info); } static CK_RV base_C_GetMechanismList (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_MECHANISM_TYPE_PTR mechanism_list, CK_ULONG_PTR count) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetMechanismList (slot_id, mechanism_list, count); } static CK_RV base_C_GetMechanismInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR info) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetMechanismInfo (slot_id, type, info); } static CK_RV base_C_InitToken (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len, CK_UTF8CHAR_PTR label) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_InitToken (slot_id, pin, pin_len, label); } static CK_RV base_C_OpenSession (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_FLAGS flags, CK_VOID_PTR application, CK_NOTIFY notify, CK_SESSION_HANDLE_PTR session) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_OpenSession (slot_id, flags, application, notify, session); } static CK_RV base_C_CloseSession (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_CloseSession (session); } static CK_RV base_C_CloseAllSessions (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_CloseAllSessions (slot_id); } static CK_RV base_C_GetSessionInfo (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_SESSION_INFO_PTR info) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetSessionInfo (session, info); } static CK_RV base_C_InitPIN (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_InitPIN (session, pin, pin_len); } static CK_RV base_C_SetPIN (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_UTF8CHAR_PTR old_pin, CK_ULONG old_len, CK_UTF8CHAR_PTR new_pin, CK_ULONG new_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SetPIN (session, old_pin, old_len, new_pin, new_len); } static CK_RV base_C_GetOperationState (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG_PTR operation_state_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetOperationState (session, operation_state, operation_state_len); } static CK_RV base_C_SetOperationState (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR operation_state, CK_ULONG operation_state_len, CK_OBJECT_HANDLE encryption_key, CK_OBJECT_HANDLE authentication_key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SetOperationState (session, operation_state, operation_state_len, encryption_key, authentication_key); } static CK_RV base_C_Login (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_USER_TYPE user_type, CK_UTF8CHAR_PTR pin, CK_ULONG pin_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Login (session, user_type, pin, pin_len); } static CK_RV base_C_Logout (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Logout (session); } static CK_RV base_C_CreateObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR object) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_CreateObject (session, template, count, object); } static CK_RV base_C_CopyObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR new_object) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_CopyObject (session, object, template, count, new_object); } static CK_RV base_C_DestroyObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DestroyObject (session, object); } static CK_RV base_C_GetObjectSize (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ULONG_PTR size) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetObjectSize (session, object, size); } static CK_RV base_C_GetAttributeValue (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GetAttributeValue (session, object, template, count); } static CK_RV base_C_SetAttributeValue (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object, CK_ATTRIBUTE_PTR template, CK_ULONG count) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SetAttributeValue (session, object, template, count); } static CK_RV base_C_FindObjectsInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR template, CK_ULONG count) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_FindObjectsInit (session, template, count); } static CK_RV base_C_FindObjects (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE_PTR object, CK_ULONG max_object_count, CK_ULONG_PTR object_count) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_FindObjects (session, object, max_object_count, object_count); } static CK_RV base_C_FindObjectsFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_FindObjectsFinal (session); } static CK_RV base_C_EncryptInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_EncryptInit (session, mechanism, key); } static CK_RV base_C_Encrypt (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR encrypted_data, CK_ULONG_PTR encrypted_data_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Encrypt (session, input, input_len, encrypted_data, encrypted_data_len); } static CK_RV base_C_EncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_EncryptUpdate (session, part, part_len, encrypted_part, encrypted_part_len); } static CK_RV base_C_EncryptFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR last_encrypted_part, CK_ULONG_PTR last_encrypted_part_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_EncryptFinal (session, last_encrypted_part, last_encrypted_part_len); } static CK_RV base_C_DecryptInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DecryptInit (session, mechanism, key); } static CK_RV base_C_Decrypt (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_data, CK_ULONG encrypted_data_len, CK_BYTE_PTR output, CK_ULONG_PTR output_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Decrypt (session, encrypted_data, encrypted_data_len, output, output_len); } static CK_RV base_C_DecryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DecryptUpdate (session, encrypted_part, encrypted_part_len, part, part_len); } static CK_RV base_C_DecryptFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR last_part, CK_ULONG_PTR last_part_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DecryptFinal (session, last_part, last_part_len); } static CK_RV base_C_DigestInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DigestInit (session, mechanism); } static CK_RV base_C_Digest (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Digest (session, input, input_len, digest, digest_len); } static CK_RV base_C_DigestUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DigestUpdate (session, part, part_len); } static CK_RV base_C_DigestKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DigestKey (session, key); } static CK_RV base_C_DigestFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR digest, CK_ULONG_PTR digest_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DigestFinal (session, digest, digest_len); } static CK_RV base_C_SignInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignInit (session, mechanism, key); } static CK_RV base_C_Sign (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Sign (session, input, input_len, signature, signature_len); } static CK_RV base_C_SignUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignUpdate (session, part, part_len); } static CK_RV base_C_SignFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignFinal (session, signature, signature_len); } static CK_RV base_C_SignRecoverInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignRecoverInit (session, mechanism, key); } static CK_RV base_C_SignRecover (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR signature, CK_ULONG_PTR signature_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignRecover (session, input, input_len, signature, signature_len); } static CK_RV base_C_VerifyInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_VerifyInit (session, mechanism, key); } static CK_RV base_C_Verify (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR input, CK_ULONG input_len, CK_BYTE_PTR signature, CK_ULONG signature_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_Verify (session, input, input_len, signature, signature_len); } static CK_RV base_C_VerifyUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_VerifyUpdate (session, part, part_len); } static CK_RV base_C_VerifyFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_VerifyFinal (session, signature, signature_len); } static CK_RV base_C_VerifyRecoverInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_VerifyRecoverInit (session, mechanism, key); } static CK_RV base_C_VerifyRecover (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR signature, CK_ULONG signature_len, CK_BYTE_PTR input, CK_ULONG_PTR input_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_VerifyRecover (session, signature, signature_len, input, input_len); } static CK_RV base_C_DigestEncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DigestEncryptUpdate (session, part, part_len, encrypted_part, encrypted_part_len); } static CK_RV base_C_DecryptDigestUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DecryptDigestUpdate (session, encrypted_part, encrypted_part_len, part, part_len); } static CK_RV base_C_SignEncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR part, CK_ULONG part_len, CK_BYTE_PTR encrypted_part, CK_ULONG_PTR encrypted_part_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SignEncryptUpdate (session, part, part_len, encrypted_part, encrypted_part_len); } static CK_RV base_C_DecryptVerifyUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR encrypted_part, CK_ULONG encrypted_part_len, CK_BYTE_PTR part, CK_ULONG_PTR part_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DecryptVerifyUpdate (session, encrypted_part, encrypted_part_len, part, part_len); } static CK_RV base_C_GenerateKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GenerateKey (session, mechanism, template, count, key); } static CK_RV base_C_GenerateKeyPair (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_ATTRIBUTE_PTR public_key_template, CK_ULONG public_key_count, CK_ATTRIBUTE_PTR private_key_template, CK_ULONG private_key_count, CK_OBJECT_HANDLE_PTR public_key, CK_OBJECT_HANDLE_PTR private_key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GenerateKeyPair (session, mechanism, public_key_template, public_key_count, private_key_template, private_key_count, public_key, private_key); } static CK_RV base_C_WrapKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE wrapping_key, CK_OBJECT_HANDLE key, CK_BYTE_PTR wrapped_key, CK_ULONG_PTR wrapped_key_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_WrapKey (session, mechanism, wrapping_key, key, wrapped_key, wrapped_key_len); } static CK_RV base_C_UnwrapKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE unwrapping_key, CK_BYTE_PTR wrapped_key, CK_ULONG wrapped_key_len, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_UnwrapKey (session, mechanism, unwrapping_key, wrapped_key, wrapped_key_len, template, count, key); } static CK_RV base_C_DeriveKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_MECHANISM_PTR mechanism, CK_OBJECT_HANDLE base_key, CK_ATTRIBUTE_PTR template, CK_ULONG count, CK_OBJECT_HANDLE_PTR key) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_DeriveKey (session, mechanism, base_key, template, count, key); } static CK_RV base_C_SeedRandom (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR seed, CK_ULONG seed_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_SeedRandom (session, seed, seed_len); } static CK_RV base_C_GenerateRandom (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session, CK_BYTE_PTR random_data, CK_ULONG random_len) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_GenerateRandom (session, random_data, random_len); } static CK_RV base_C_WaitForSlotEvent (CK_X_FUNCTION_LIST *self, CK_FLAGS flags, CK_SLOT_ID_PTR slot_id, CK_VOID_PTR reserved) { p11_virtual *virt = (p11_virtual *)self; CK_FUNCTION_LIST *funcs = virt->lower_module; return funcs->C_WaitForSlotEvent (flags, slot_id, reserved); } void p11_virtual_init (p11_virtual *virt, CK_X_FUNCTION_LIST *funcs, void *lower_module, p11_destroyer lower_destroy) { memcpy (virt, funcs, sizeof (CK_X_FUNCTION_LIST)); virt->lower_module = lower_module; virt->lower_destroy = lower_destroy; } void p11_virtual_uninit (p11_virtual *virt) { if (virt->lower_destroy) (virt->lower_destroy) (virt->lower_module); } #ifdef WITH_FFI typedef struct { const char *name; void *binding_function; void *stack_fallback; size_t virtual_offset; void *base_fallback; size_t module_offset; ffi_type *types[MAX_ARGS]; } FunctionInfo; #define STRUCT_OFFSET(struct_type, member) \ ((size_t) ((unsigned char *) &((struct_type *) 0)->member)) #define STRUCT_MEMBER_P(struct_p, struct_offset) \ ((void *) ((unsigned char *) (struct_p) + (long) (struct_offset))) #define STRUCT_MEMBER(member_type, struct_p, struct_offset) \ (*(member_type*) STRUCT_MEMBER_P ((struct_p), (struct_offset))) #define FUNCTION(name) \ #name, binding_C_##name, \ stack_C_##name, STRUCT_OFFSET (CK_X_FUNCTION_LIST, C_##name), \ base_C_##name, STRUCT_OFFSET (CK_FUNCTION_LIST, C_##name) static const FunctionInfo function_info[] = { { FUNCTION (Initialize), { &ffi_type_pointer, NULL } }, { FUNCTION (Finalize), { &ffi_type_pointer, NULL } }, { FUNCTION (GetInfo), { &ffi_type_pointer, NULL } }, { FUNCTION (GetSlotList), { &ffi_type_uchar, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (GetSlotInfo), { &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (GetTokenInfo), { &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (WaitForSlotEvent), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (GetMechanismList), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (GetMechanismInfo), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (InitToken), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (InitPIN), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (SetPIN), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (OpenSession), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (CloseSession), { &ffi_type_ulong, NULL } }, { FUNCTION (CloseAllSessions), { &ffi_type_ulong, NULL } }, { FUNCTION (GetSessionInfo), { &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (GetOperationState), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (SetOperationState), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_ulong, &ffi_type_ulong, NULL } }, { FUNCTION (Login), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (Logout), { &ffi_type_ulong, NULL } }, { FUNCTION (CreateObject), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (CopyObject), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (DestroyObject), { &ffi_type_ulong, &ffi_type_ulong, NULL } }, { FUNCTION (GetObjectSize), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (GetAttributeValue), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (SetAttributeValue), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (FindObjectsInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (FindObjects), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (FindObjectsFinal), { &ffi_type_ulong, NULL } }, { FUNCTION (EncryptInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (Encrypt), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (EncryptUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (EncryptFinal), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (DecryptInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (Decrypt), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (DecryptUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (DecryptFinal), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (DigestInit), { &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (Digest), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (DigestUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (DigestKey), { &ffi_type_ulong, &ffi_type_ulong, NULL } }, { FUNCTION (DigestFinal), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (SignInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (Sign), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (SignUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (SignFinal), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (SignRecoverInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (SignRecover), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (VerifyInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (Verify), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (VerifyUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (VerifyFinal), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (VerifyRecoverInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (VerifyRecover), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (DigestEncryptUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (DecryptDigestUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (SignEncryptUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (DecryptVerifyUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (GenerateKey), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (GenerateKeyPair), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (WrapKey), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } }, { FUNCTION (UnwrapKey), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (DeriveKey), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } }, { FUNCTION (SeedRandom), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { FUNCTION (GenerateRandom), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } }, { 0, } }; static bool lookup_fall_through (p11_virtual *virt, const FunctionInfo *info, void **bound_func) { void *func; /* * So the basic concept here is if we have only fall-through functions * all the way down the stack, then we can just get the actual module * function, so that calls go right through. */ func = STRUCT_MEMBER (void *, virt, info->virtual_offset); /* * This is a fall-through function and the stack goes down further, so * ask the next level down for the */ if (func == info->stack_fallback) { return lookup_fall_through (virt->lower_module, info, bound_func); /* * This is a fall-through function at the bottom level of the stack * so return the function from the module. */ } else if (func == info->base_fallback) { *bound_func = STRUCT_MEMBER (void *, virt->lower_module, info->module_offset); return true; } return false; } static bool bind_ffi_closure (Wrapper *wrapper, void *binding_data, void *binding_func, ffi_type **args, void **bound_func) { ffi_closure *clo; ffi_cif *cif; int nargs = 0; int i = 0; int ret; assert (wrapper->ffi_used < MAX_FUNCTIONS); cif = wrapper->ffi_cifs + wrapper->ffi_used; /* The number of arguments */ for (i = 0, nargs = 0; args[i] != NULL; i++) nargs++; assert (nargs <= MAX_ARGS); /* * The failures here are unexpected conditions. There's a chance they * might occur on other esoteric platforms, so we take a little * extra care to print relevant debugging info, and return a status, * so that we can get back useful debug info on platforms that we * don't have access to. */ ret = ffi_prep_cif (cif, FFI_DEFAULT_ABI, nargs, &ffi_type_ulong, args); if (ret != FFI_OK) { p11_debug_precond ("ffi_prep_cif failed: %d\n", ret); return false; } clo = ffi_closure_alloc (sizeof (ffi_closure), bound_func); if (clo == NULL) { p11_debug_precond ("ffi_closure_alloc failed\n"); return false; } ret = ffi_prep_closure_loc (clo, cif, binding_func, binding_data, *bound_func); if (ret != FFI_OK) { p11_debug_precond ("ffi_prep_closure_loc failed: %d\n", ret); return false; } wrapper->ffi_closures[wrapper->ffi_used] = clo; wrapper->ffi_used++; return true; } static bool init_wrapper_funcs (Wrapper *wrapper) { static const ffi_type *get_function_list_args[] = { &ffi_type_pointer, NULL }; const FunctionInfo *info; CK_X_FUNCTION_LIST *over; void **bound; int i; /* Pointer to where our calls go */ over = &wrapper->virt->funcs; for (i = 0; function_info[i].name != NULL; i++) { info = function_info + i; /* Address to where we're placing the bound function */ bound = &STRUCT_MEMBER (void *, &wrapper->bound, info->module_offset); /* * See if we can just shoot straight through to the module function * without wrapping at all. If all the stacked virtual modules just * fall through, then this returns the original module function. */ if (!lookup_fall_through (wrapper->virt, info, bound)) { if (!bind_ffi_closure (wrapper, over, info->binding_function, (ffi_type **)info->types, bound)) return_val_if_reached (false); } } /* Always bind the C_GetFunctionList function itself */ if (!bind_ffi_closure (wrapper, wrapper, binding_C_GetFunctionList, (ffi_type **)get_function_list_args, (void **)&wrapper->bound.C_GetFunctionList)) return_val_if_reached (false); /* * These functions are used as a marker to indicate whether this is * one of our CK_FUNCTION_LIST_PTR sets of functions or not. These * functions are defined to always have the same standard implementation * in PKCS#11 2.x so we don't need to call through to the base for * these guys. */ wrapper->bound.C_CancelFunction = short_C_CancelFunction; wrapper->bound.C_GetFunctionStatus = short_C_GetFunctionStatus; return true; } static void uninit_wrapper_funcs (Wrapper *wrapper) { int i; for (i = 0; i < wrapper->ffi_used; i++) ffi_closure_free (wrapper->ffi_closures[i]); } CK_FUNCTION_LIST * p11_virtual_wrap (p11_virtual *virt, p11_destroyer destroyer) { Wrapper *wrapper; return_val_if_fail (virt != NULL, NULL); wrapper = calloc (1, sizeof (Wrapper)); return_val_if_fail (wrapper != NULL, NULL); wrapper->virt = virt; wrapper->destroyer = destroyer; wrapper->bound.version.major = CRYPTOKI_VERSION_MAJOR; wrapper->bound.version.minor = CRYPTOKI_VERSION_MINOR; if (!init_wrapper_funcs (wrapper)) return_val_if_reached (NULL); assert ((void *)wrapper == (void *)&wrapper->bound); assert (p11_virtual_is_wrapper (&wrapper->bound)); assert (wrapper->bound.C_GetFunctionList != NULL); return &wrapper->bound; } bool p11_virtual_can_wrap (void) { return TRUE; } bool p11_virtual_is_wrapper (CK_FUNCTION_LIST_PTR module) { /* * We use these functions as a marker to indicate whether this is * one of our CK_FUNCTION_LIST_PTR sets of functions or not. These * functions are defined to always have the same standard implementation * in PKCS#11 2.x so we don't need to call through to the base for * these guys. */ return (module->C_GetFunctionStatus == short_C_GetFunctionStatus && module->C_CancelFunction == short_C_CancelFunction); } void p11_virtual_unwrap (CK_FUNCTION_LIST_PTR module) { Wrapper *wrapper; return_if_fail (p11_virtual_is_wrapper (module)); /* The bound CK_FUNCTION_LIST_PTR sits at the front of Context */ wrapper = (Wrapper *)module; /* * Make sure that the CK_FUNCTION_LIST_PTR is invalid, and that * p11_virtual_is_wrapper() recognizes this. This is in case the * destroyer callback tries to do something fancy. */ memset (&wrapper->bound, 0xFEEEFEEE, sizeof (wrapper->bound)); if (wrapper->destroyer) (wrapper->destroyer) (wrapper->virt); uninit_wrapper_funcs (wrapper); free (wrapper); } #else /* !WITH_FFI */ CK_FUNCTION_LIST * p11_virtual_wrap (p11_virtual *virt, p11_destroyer destroyer) { assert_not_reached (); } bool p11_virtual_can_wrap (void) { return FALSE; } bool p11_virtual_is_wrapper (CK_FUNCTION_LIST_PTR module) { return FALSE; } void p11_virtual_unwrap (CK_FUNCTION_LIST_PTR module) { assert_not_reached (); } #endif /* !WITH_FFI */ CK_X_FUNCTION_LIST p11_virtual_stack = { { CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, /* version */ stack_C_Initialize, stack_C_Finalize, stack_C_GetInfo, stack_C_GetSlotList, stack_C_GetSlotInfo, stack_C_GetTokenInfo, stack_C_GetMechanismList, stack_C_GetMechanismInfo, stack_C_InitToken, stack_C_InitPIN, stack_C_SetPIN, stack_C_OpenSession, stack_C_CloseSession, stack_C_CloseAllSessions, stack_C_GetSessionInfo, stack_C_GetOperationState, stack_C_SetOperationState, stack_C_Login, stack_C_Logout, stack_C_CreateObject, stack_C_CopyObject, stack_C_DestroyObject, stack_C_GetObjectSize, stack_C_GetAttributeValue, stack_C_SetAttributeValue, stack_C_FindObjectsInit, stack_C_FindObjects, stack_C_FindObjectsFinal, stack_C_EncryptInit, stack_C_Encrypt, stack_C_EncryptUpdate, stack_C_EncryptFinal, stack_C_DecryptInit, stack_C_Decrypt, stack_C_DecryptUpdate, stack_C_DecryptFinal, stack_C_DigestInit, stack_C_Digest, stack_C_DigestUpdate, stack_C_DigestKey, stack_C_DigestFinal, stack_C_SignInit, stack_C_Sign, stack_C_SignUpdate, stack_C_SignFinal, stack_C_SignRecoverInit, stack_C_SignRecover, stack_C_VerifyInit, stack_C_Verify, stack_C_VerifyUpdate, stack_C_VerifyFinal, stack_C_VerifyRecoverInit, stack_C_VerifyRecover, stack_C_DigestEncryptUpdate, stack_C_DecryptDigestUpdate, stack_C_SignEncryptUpdate, stack_C_DecryptVerifyUpdate, stack_C_GenerateKey, stack_C_GenerateKeyPair, stack_C_WrapKey, stack_C_UnwrapKey, stack_C_DeriveKey, stack_C_SeedRandom, stack_C_GenerateRandom, stack_C_WaitForSlotEvent }; CK_X_FUNCTION_LIST p11_virtual_base = { { CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, /* version */ base_C_Initialize, base_C_Finalize, base_C_GetInfo, base_C_GetSlotList, base_C_GetSlotInfo, base_C_GetTokenInfo, base_C_GetMechanismList, base_C_GetMechanismInfo, base_C_InitToken, base_C_InitPIN, base_C_SetPIN, base_C_OpenSession, base_C_CloseSession, base_C_CloseAllSessions, base_C_GetSessionInfo, base_C_GetOperationState, base_C_SetOperationState, base_C_Login, base_C_Logout, base_C_CreateObject, base_C_CopyObject, base_C_DestroyObject, base_C_GetObjectSize, base_C_GetAttributeValue, base_C_SetAttributeValue, base_C_FindObjectsInit, base_C_FindObjects, base_C_FindObjectsFinal, base_C_EncryptInit, base_C_Encrypt, base_C_EncryptUpdate, base_C_EncryptFinal, base_C_DecryptInit, base_C_Decrypt, base_C_DecryptUpdate, base_C_DecryptFinal, base_C_DigestInit, base_C_Digest, base_C_DigestUpdate, base_C_DigestKey, base_C_DigestFinal, base_C_SignInit, base_C_Sign, base_C_SignUpdate, base_C_SignFinal, base_C_SignRecoverInit, base_C_SignRecover, base_C_VerifyInit, base_C_Verify, base_C_VerifyUpdate, base_C_VerifyFinal, base_C_VerifyRecoverInit, base_C_VerifyRecover, base_C_DigestEncryptUpdate, base_C_DecryptDigestUpdate, base_C_SignEncryptUpdate, base_C_DecryptVerifyUpdate, base_C_GenerateKey, base_C_GenerateKeyPair, base_C_WrapKey, base_C_UnwrapKey, base_C_DeriveKey, base_C_SeedRandom, base_C_GenerateRandom, base_C_WaitForSlotEvent }; p11-kit-0.20.2/p11-kit/log.c0000664000175000017500000016025512226763526012043 00000000000000/* * Copyright (c) 2007, Stefan Walter * Copyright (c) 2013, Red Hat Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * CONTRIBUTORS * Stef Walter */ #include "config.h" #include "attrs.h" #include "buffer.h" #include "constants.h" #include "debug.h" #include "log.h" #include "p11-kit.h" #include "virtual.h" #include #include #include #include #include #include bool p11_log_force = false; bool p11_log_output = true; typedef struct { p11_virtual virt; CK_X_FUNCTION_LIST *lower; p11_destroyer destroyer; } LogData; #define LOG_FLAG(buf, flags, had, flag) \ if ((flags & flag) == flag) { \ p11_buffer_add (buf, had ? " | " : " = ", 3); \ p11_buffer_add (buf, #flag, -1); \ had++; \ } static void log_CKM (p11_buffer *buf, CK_MECHANISM_TYPE v) { char temp[32]; const char *string; string = p11_constant_name (p11_constant_mechanisms, v); if (string == NULL) { snprintf (temp, sizeof (temp), "CKM_0x%08lX", v); p11_buffer_add (buf, temp, -1); } else { p11_buffer_add (buf, string, -1); } } static void log_CKS (p11_buffer *buf, CK_STATE v) { char temp[32]; const char *string; string = p11_constant_name (p11_constant_states, v); if (string == NULL) { snprintf (temp, sizeof (temp), "CKS_0x%08lX", v); p11_buffer_add (buf, temp, -1); } else { p11_buffer_add (buf, string, -1); } } static void log_CKU (p11_buffer *buf, CK_USER_TYPE v) { char temp[32]; const char *string; string = p11_constant_name (p11_constant_users, v); if (string == NULL) { snprintf (temp, sizeof (temp), "CKU_0x%08lX", v); p11_buffer_add (buf, temp, -1); } else { p11_buffer_add (buf, string, -1); } } static void log_CKR (p11_buffer *buf, CK_RV v) { char temp[32]; const char *string; string = p11_constant_name (p11_constant_returns, v); if (string == NULL) { snprintf (temp, sizeof (temp), "CKR_0x%08lX", v); p11_buffer_add (buf, temp, -1); } else { p11_buffer_add (buf, string, -1); } } static void log_some_bytes (p11_buffer *buf, CK_BYTE_PTR arr, CK_ULONG num) { CK_ULONG i; char temp[128]; char *p, *e; CK_BYTE ch; if(!arr) { p11_buffer_add (buf, "NULL", 4); return; } else if (num == (CK_ULONG)-1) { p11_buffer_add (buf, "????", 4); return; } temp[0] = '\"'; p = temp + 1; e = temp + (sizeof (temp) - 8); for(i = 0; i < num && p < e; ++i, ++p) { ch = arr[i]; if (ch == '\t') { p[0] = '\\'; p[1] = 't'; ++p; } else if (ch == '\n') { p[0] = '\\'; p[1] = 'n'; ++p; } else if (ch == '\r') { p[0] = '\\'; p[1] = 'r'; ++p; } else if (ch >= 32 && ch < 127) { *p = ch; } else { p[0] = '\\'; p[1] = 'x'; sprintf(p + 2, "%02X", ch); p += 3; } } *p = 0; if (p >= e) strcpy (e, "..."); strcat (p, "\""); p11_buffer_add (buf, temp, -1); } static void log_pointer (p11_buffer *buf, const char *pref, const char *name, CK_VOID_PTR val, CK_RV status) { char temp[32]; if (status != CKR_OK) return; p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = ", 3); if (val == NULL) { p11_buffer_add (buf, "NULL\n", 5); } else { snprintf (temp, sizeof (temp), "0x%08lX\n", (unsigned long)(size_t)val); p11_buffer_add (buf, temp, -1); } } static void log_attribute_types (p11_buffer *buf, const char *pref, const char *name, CK_ATTRIBUTE_PTR arr, CK_ULONG num, CK_RV status) { const char *string; char temp[32]; CK_ULONG i; if (status == CKR_BUFFER_TOO_SMALL) { arr = NULL; status = CKR_OK; } if (status != CKR_OK) return; p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = ", 3); if (arr == NULL) { snprintf (temp, sizeof (temp), "(%lu) NONE\n", num); p11_buffer_add (buf, temp, -1); } else { snprintf (temp, sizeof (temp), "(%lu) [ ", num); p11_buffer_add (buf, temp, -1); for (i = 0; i < num; i++) { if (i > 0) p11_buffer_add (buf, ", ", 2); string = p11_constant_name (p11_constant_types, arr[i].type); if (string != NULL) { p11_buffer_add (buf, string, -1); } else { snprintf (temp, sizeof (temp), "CKA_0x%08lX", arr[i].type); p11_buffer_add (buf, temp, -1); } } p11_buffer_add (buf, " ]\n", 3); } } static void log_attribute_array (p11_buffer *buf, const char *pref, const char *name, CK_ATTRIBUTE_PTR arr, CK_ULONG num, CK_RV status) { char temp[32]; if (status == CKR_BUFFER_TOO_SMALL) { arr = NULL; status = CKR_OK; } if (status != CKR_OK) return; p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = ", 3); if (arr == NULL) { snprintf (temp, sizeof (temp), "(%lu) NONE\n", num); p11_buffer_add (buf, temp, -1); } else { p11_attrs_format (buf, arr, num); p11_buffer_add (buf, "\n", 1); } } static void log_bool (p11_buffer *buf, const char *pref, const char *name, CK_BBOOL val, CK_RV status) { if (status == CKR_OK) { p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = ", 3); p11_buffer_add (buf, val ? "CK_TRUE" : "CK_FALSE", -1); p11_buffer_add (buf, "\n", 1); } } static void log_byte_array (p11_buffer *buf, const char *pref, const char *name, CK_BYTE_PTR arr, CK_ULONG_PTR num, CK_RV status) { char temp[32]; if (status == CKR_BUFFER_TOO_SMALL) { arr = NULL; status = CKR_OK; } if (status != CKR_OK) return; p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = ", 3); if (num == NULL) { p11_buffer_add (buf, "(?) NOTHING\n", -1); } else if (arr == NULL) { snprintf (temp, sizeof (temp), "(%lu) NOTHING\n", *num); p11_buffer_add (buf, temp, -1); } else { snprintf (temp, sizeof (temp), "(%lu) ", *num); p11_buffer_add (buf, temp, -1); log_some_bytes (buf, arr, *num); p11_buffer_add (buf, "\n", 1); } } static void log_info (p11_buffer *buf, const char *pref, const char *name, CK_INFO_PTR info, CK_RV status) { char temp[32]; if (status != CKR_OK) return; if (info == NULL) { log_pointer (buf, pref, name, info, status); } else { p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = {\n", 5); p11_buffer_add (buf, "\tcryptokiVersion: ", -1); snprintf (temp, sizeof (temp), "%u.%u", (unsigned int)info->cryptokiVersion.major, (unsigned int)info->cryptokiVersion.minor); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tmanufacturerID: \"", -1); p11_buffer_add (buf, info->manufacturerID, p11_kit_space_strlen (info->manufacturerID, sizeof (info->manufacturerID))); p11_buffer_add (buf, "\"\n\tflags: ", -1); snprintf (temp, sizeof (temp), "%lX", info->flags); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tlibraryDescription: \"", -1); p11_buffer_add (buf, info->libraryDescription, p11_kit_space_strlen (info->libraryDescription, sizeof (info->libraryDescription))); p11_buffer_add (buf, "\"\n\tlibraryVersion: ", -1); snprintf (temp, sizeof (temp), "%u.%u", (unsigned int)info->libraryVersion.major, (unsigned int)info->libraryVersion.minor); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n }\n", -1); } } static void log_pInitArgs (p11_buffer *buf, const char *pref, const char *name, CK_VOID_PTR pInitArgs, CK_RV status) { char temp[32]; int had = 0; if (status != CKR_OK) return; if (pInitArgs == NULL) log_pointer (buf, pref, name, pInitArgs, status); else { CK_C_INITIALIZE_ARGS *args = (CK_C_INITIALIZE_ARGS*)pInitArgs; p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = {\n", 5); p11_buffer_add (buf, "\tCreateMutex: ", -1); snprintf (temp, sizeof (temp), "0x%08lX", (unsigned long)(size_t)args->CreateMutex); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tDestroyMutex: ", -1); snprintf (temp, sizeof (temp), "0x%08lX", (unsigned long)(size_t)args->DestroyMutex); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tLockMutex: ", -1); snprintf (temp, sizeof (temp), "0x%08lX", (unsigned long)(size_t)args->LockMutex); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tUnlockMutex: ", -1); snprintf (temp, sizeof (temp), "0x%08lX", (unsigned long)(size_t)args->UnlockMutex); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tflags: ", -1); snprintf (temp, sizeof (temp), "%lX", args->flags); LOG_FLAG (buf, args->flags, had, CKF_OS_LOCKING_OK); p11_buffer_add (buf, "\n\treserved: ", -1); snprintf (temp, sizeof (temp), "0x%08lX", (unsigned long)(size_t)args->pReserved); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n }\n", -1); } } static void log_mechanism_info (p11_buffer *buf, const char *pref, const char *name, CK_MECHANISM_INFO_PTR info, CK_RV status) { char temp[32]; int had = 0; if (status != CKR_OK) return; if (info == NULL) { log_pointer (buf, pref, name, info, status); } else { p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = {\n", 5); p11_buffer_add (buf, "\tulMinKeySize: ", -1); snprintf (temp, sizeof (temp), "%lu", info->ulMinKeySize); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tulMaxKeySize: ", -1); snprintf (temp, sizeof (temp), "%lu", info->ulMaxKeySize); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tflags: ", -1); snprintf (temp, sizeof (temp), "%lX", info->flags); p11_buffer_add (buf, temp, -1); LOG_FLAG (buf, info->flags, had, CKF_HW); LOG_FLAG (buf, info->flags, had, CKF_ENCRYPT); LOG_FLAG (buf, info->flags, had, CKF_DECRYPT); LOG_FLAG (buf, info->flags, had, CKF_DIGEST); LOG_FLAG (buf, info->flags, had, CKF_SIGN); LOG_FLAG (buf, info->flags, had, CKF_SIGN_RECOVER); LOG_FLAG (buf, info->flags, had, CKF_VERIFY); LOG_FLAG (buf, info->flags, had, CKF_VERIFY_RECOVER); LOG_FLAG (buf, info->flags, had, CKF_GENERATE); LOG_FLAG (buf, info->flags, had, CKF_GENERATE_KEY_PAIR); LOG_FLAG (buf, info->flags, had, CKF_WRAP); LOG_FLAG (buf, info->flags, had, CKF_UNWRAP); LOG_FLAG (buf, info->flags, had, CKF_DERIVE); LOG_FLAG (buf, info->flags, had, CKF_EXTENSION); p11_buffer_add (buf, "\n }\n", -1); } } static void log_mechanism (p11_buffer *buf, const char *pref, const char *name, CK_MECHANISM_PTR mech, CK_RV status) { char temp[32]; if (status != CKR_OK) return; p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = {\n", 5); p11_buffer_add (buf, "\tmechanism: ", -1); log_CKM (buf, mech->mechanism); p11_buffer_add (buf, "\n\tpParameter: ", -1); snprintf (temp, sizeof (temp), "(%lu) ", mech->ulParameterLen); p11_buffer_add (buf, temp, -1); log_some_bytes (buf, mech->pParameter, mech->ulParameterLen); p11_buffer_add (buf, "\n }\n", -1); } static void log_mechanism_type (p11_buffer *buf, const char *pref, const char *name, CK_MECHANISM_TYPE val, CK_RV status) { if (status != CKR_OK) return; p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = ", 3); log_CKM (buf, val); p11_buffer_add (buf, "\n", 1); } static void log_mechanism_type_array (p11_buffer *buf, const char *pref, const char *name, CK_MECHANISM_TYPE_PTR arr, CK_ULONG_PTR num, CK_RV status) { char temp[32]; CK_ULONG i; if (status == CKR_BUFFER_TOO_SMALL) { arr = NULL; status = CKR_OK; } if (status != CKR_OK) return; p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = ", 3); if (num == NULL) { p11_buffer_add (buf, "(?) NO-VALUES\n", -1); } else if (arr == NULL) { snprintf (temp, sizeof (temp), "(%lu) NO-VALUES\n", *num); p11_buffer_add (buf, temp, -1); } else { snprintf (temp, sizeof (temp), "(%lu) [ ", *num); p11_buffer_add (buf, temp, -1); for(i = 0; i < *num; ++i) { if (i > 0) p11_buffer_add (buf, ", ", 2); log_CKM (buf, arr[i]); } p11_buffer_add (buf, " ]\n", 3); } } static void log_session_info (p11_buffer *buf, const char *pref, const char *name, CK_SESSION_INFO_PTR info, CK_RV status) { char temp[32]; int had = 0; if (status != CKR_OK) return; if (info == NULL) { log_pointer (buf, pref, name, info, status); } else { p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = {\n", 5); p11_buffer_add (buf, "\tslotID: ", -1); snprintf (temp, sizeof (temp), "SL%lu", info->slotID); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tstate: ", -1); log_CKS (buf, info->state); p11_buffer_add (buf, "\n\tflags: ", -1); snprintf (temp, sizeof (temp), "%lX", info->flags); p11_buffer_add (buf, temp, -1); LOG_FLAG (buf, info->flags, had, CKF_SERIAL_SESSION); LOG_FLAG (buf, info->flags, had, CKF_RW_SESSION); p11_buffer_add (buf, "\n\tulDeviceError: ", -1); snprintf (temp, sizeof (temp), "%lu", info->ulDeviceError); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n }\n", -1); } } static void log_slot_info (p11_buffer *buf, const char *pref, const char *name, CK_SLOT_INFO_PTR info, CK_RV status) { char temp[32]; int had = 0; if (status != CKR_OK) return; if (info == NULL) { log_pointer (buf, pref, name, info, status); } else { p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = {\n", 5); p11_buffer_add (buf, "\tslotDescription: \"", -1); p11_buffer_add (buf, info->slotDescription, p11_kit_space_strlen (info->slotDescription, sizeof (info->slotDescription))); p11_buffer_add (buf, "\"\n\tmanufacturerID: \"", -1); p11_buffer_add (buf, info->manufacturerID, p11_kit_space_strlen (info->manufacturerID, sizeof (info->manufacturerID))); p11_buffer_add (buf, "\"\n\tflags: ", -1); snprintf (temp, sizeof (temp), "%lu", info->flags); p11_buffer_add (buf, temp, -1); LOG_FLAG (buf, info->flags, had, CKF_TOKEN_PRESENT); LOG_FLAG (buf, info->flags, had, CKF_REMOVABLE_DEVICE); LOG_FLAG (buf, info->flags, had, CKF_HW_SLOT); p11_buffer_add (buf, "\n\thardwareVersion: ", -1); snprintf (temp, sizeof (temp), "%u.%u", (unsigned int)info->hardwareVersion.major, (unsigned int)info->hardwareVersion.minor); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tfirmwareVersion: ", -1); snprintf (temp, sizeof (temp), "%u.%u", (unsigned int)info->firmwareVersion.major, (unsigned int)info->firmwareVersion.minor); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n }\n", -1); } } static void log_string (p11_buffer *buf, const char *pref, const char *name, CK_UTF8CHAR_PTR str, const CK_RV status) { if (status != CKR_OK) return; if (str == NULL) { log_pointer (buf, pref, name, str, status); } else { p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = \"", 4); p11_buffer_add (buf, str, -1); p11_buffer_add (buf, "\"\n", 2); } } static void log_token_number (p11_buffer *buf, CK_ULONG number) { char temp[32]; if (number == 0) { p11_buffer_add (buf, "CK_UNAVAILABLE_INFORMATION", -1); } else if (number == (CK_ULONG)-1) { p11_buffer_add (buf, "CK_EFFECTIVELY_INFINITE", -1); } else { snprintf (temp, sizeof (temp), "%lu", number); p11_buffer_add (buf, temp, -1); } } static void log_token_info (p11_buffer *buf, const char *pref, const char *name, CK_TOKEN_INFO_PTR info, CK_RV status) { char temp[32]; int had = 0; if (status != CKR_OK) return; if (info == NULL) { log_pointer (buf, pref, name, info, status); } else { p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = {\n", 5); p11_buffer_add (buf, "\tlabel: \"", -1); p11_buffer_add (buf, info->label, p11_kit_space_strlen (info->label, sizeof (info->label))); p11_buffer_add (buf, "\"\n\tmanufacturerID: \"", -1); p11_buffer_add (buf, info->manufacturerID, p11_kit_space_strlen (info->manufacturerID, sizeof (info->manufacturerID))); p11_buffer_add (buf, "\"\n\tmodel: \"", -1); p11_buffer_add (buf, info->model, p11_kit_space_strlen (info->model, sizeof (info->model))); p11_buffer_add (buf, "\"\n\tserialNumber: \"", -1); p11_buffer_add (buf, info->serialNumber, p11_kit_space_strlen (info->serialNumber, sizeof (info->serialNumber))); p11_buffer_add (buf, "\"\n\tflags: ", -1); snprintf (temp, sizeof (temp), "%lu", info->flags); p11_buffer_add (buf, temp, -1); LOG_FLAG (buf, info->flags, had, CKF_RNG); LOG_FLAG (buf, info->flags, had, CKF_WRITE_PROTECTED); LOG_FLAG (buf, info->flags, had, CKF_LOGIN_REQUIRED); LOG_FLAG (buf, info->flags, had, CKF_USER_PIN_INITIALIZED); LOG_FLAG (buf, info->flags, had, CKF_RESTORE_KEY_NOT_NEEDED); LOG_FLAG (buf, info->flags, had, CKF_CLOCK_ON_TOKEN); LOG_FLAG (buf, info->flags, had, CKF_PROTECTED_AUTHENTICATION_PATH); LOG_FLAG (buf, info->flags, had, CKF_DUAL_CRYPTO_OPERATIONS); LOG_FLAG (buf, info->flags, had, CKF_TOKEN_INITIALIZED); LOG_FLAG (buf, info->flags, had, CKF_SECONDARY_AUTHENTICATION); LOG_FLAG (buf, info->flags, had, CKF_USER_PIN_COUNT_LOW); LOG_FLAG (buf, info->flags, had, CKF_USER_PIN_FINAL_TRY); LOG_FLAG (buf, info->flags, had, CKF_USER_PIN_LOCKED); LOG_FLAG (buf, info->flags, had, CKF_USER_PIN_TO_BE_CHANGED); LOG_FLAG (buf, info->flags, had, CKF_SO_PIN_COUNT_LOW); LOG_FLAG (buf, info->flags, had, CKF_SO_PIN_FINAL_TRY); LOG_FLAG (buf, info->flags, had, CKF_SO_PIN_LOCKED); LOG_FLAG (buf, info->flags, had, CKF_SO_PIN_TO_BE_CHANGED); if (!had) { snprintf (temp, sizeof (temp), "%lu", info->flags); p11_buffer_add (buf, temp, -1); } p11_buffer_add (buf, "\n\tulMaxSessionCount: ", -1); log_token_number (buf, info->ulMaxSessionCount); p11_buffer_add (buf, "\n\tulSessionCount: ", -1); snprintf (temp, sizeof (temp), "%lu", info->ulSessionCount); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tulMaxRwSessionCount: ", -1); log_token_number (buf, info->ulMaxSessionCount); p11_buffer_add (buf, "\n\tulRwSessionCount: ", -1); snprintf (temp, sizeof (temp), "%lu", info->ulRwSessionCount); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tulMaxPinLen: ", -1); snprintf (temp, sizeof (temp), "%lu", info->ulMaxPinLen); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tulMinPinLen: ", -1); snprintf (temp, sizeof (temp), "%lu", info->ulMinPinLen); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tulTotalPublicMemory: ", -1); log_token_number (buf, info->ulMaxSessionCount); p11_buffer_add (buf, "\n\tulFreePublicMemory: ", -1); log_token_number (buf, info->ulMaxSessionCount); p11_buffer_add (buf, "\n\tulTotalPrivateMemory: ", -1); log_token_number (buf, info->ulMaxSessionCount); p11_buffer_add (buf, "\n\tulFreePrivateMemory: ", -1); log_token_number (buf, info->ulMaxSessionCount); p11_buffer_add (buf, "\n\tulFreePrivateMemory: ", -1); log_token_number (buf, info->ulMaxSessionCount); p11_buffer_add (buf, "\n\thardwareVersion: ", -1); snprintf (temp, sizeof (temp), "%u.%u", (unsigned int)info->hardwareVersion.major, (unsigned int)info->hardwareVersion.minor); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tfirmwareVersion: ", -1); snprintf (temp, sizeof (temp), "%u.%u", (unsigned int)info->firmwareVersion.major, (unsigned int)info->firmwareVersion.minor); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n\tutcTime: ", -1); p11_buffer_add (buf, (info->flags & CKF_CLOCK_ON_TOKEN) ? (const char*)info->utcTime : "", -1); p11_buffer_add (buf, "\n }\n", -1); } } static void log_ulong (p11_buffer *buf, const char *pref, const char *name, CK_ULONG val, const char* npref, CK_RV status) { char temp[32]; if (!npref) npref = ""; if (status == CKR_OK) { p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = ", 3); p11_buffer_add (buf, npref, -1); snprintf (temp, sizeof (temp), "%lu", val); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n", 1); } } static void log_ulong_array (p11_buffer *buf, const char *pref, const char *name, CK_ULONG_PTR arr, CK_ULONG_PTR num, const char *npref, CK_RV status) { char temp[32]; CK_ULONG i; if (status == CKR_BUFFER_TOO_SMALL) { arr = NULL; status = CKR_OK; } if (status != CKR_OK) return; if (npref == NULL) npref = ""; p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = ", 3); if (num == NULL) { p11_buffer_add (buf, "(?) NO-VALUES\n", -1); } else if (arr == NULL) { snprintf (temp, sizeof (temp), "(%lu) NO-VALUES\n", *num); p11_buffer_add (buf, temp, -1); } else { snprintf (temp, sizeof (temp), "(%lu) [ ", *num); p11_buffer_add (buf, temp, -1); for (i = 0; i < *num; ++i) { if (i > 0) p11_buffer_add (buf, ", ", 2); p11_buffer_add (buf, npref, -1); snprintf (temp, sizeof (temp), "%lu", arr[i]); p11_buffer_add (buf, temp, -1); } p11_buffer_add (buf, " ]\n", 3); } } static void log_ulong_pointer (p11_buffer *buf, const char *pref, const char *name, CK_ULONG_PTR val, const char *npref, CK_RV status) { char temp[32]; if (status != CKR_OK) return; if (npref == NULL) npref = ""; p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = ", 3); if (val == NULL) { p11_buffer_add (buf, "NULL\n", 5); } else { snprintf (temp, sizeof (temp), "0x%08lX", (unsigned long)(size_t)val); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, " = ", 3); p11_buffer_add (buf, npref, -1); snprintf (temp, sizeof (temp), "%lu", *val); p11_buffer_add (buf, temp, -1); p11_buffer_add (buf, "\n", 1); } } static void log_user_type (p11_buffer *buf, const char *pref, const char *name, CK_USER_TYPE val, CK_RV status) { if (status != CKR_OK) return; p11_buffer_add (buf, pref, -1); p11_buffer_add (buf, name, -1); p11_buffer_add (buf, " = ", 3); log_CKU (buf, val); p11_buffer_add (buf, "\n", 1); } static void flush_buffer (p11_buffer *buf) { if (p11_log_output) { fwrite (buf->data, 1, buf->len, stderr); fflush (stderr); } p11_buffer_reset (buf, 128); } #define BEGIN_CALL(name) \ { \ LogData *_log = (LogData *)self; \ const char* _name = "C_" #name; \ p11_buffer _buf; \ CK_X_##name _func = _log->lower->C_##name; \ CK_RV _ret = CKR_OK; \ p11_buffer_init_null (&_buf, 128); \ return_val_if_fail (_func != NULL, CKR_DEVICE_ERROR); \ p11_buffer_add (&_buf, _name, -1); \ p11_buffer_add (&_buf, "\n", 1); \ self = _log->lower; #define PROCESS_CALL(args) \ flush_buffer (&_buf); \ _ret = (_func) args; #define DONE_CALL \ p11_buffer_add (&_buf, _name, -1); \ p11_buffer_add (&_buf, " = ", 3); \ log_CKR (&_buf, _ret); \ p11_buffer_add (&_buf, "\n", 1); \ flush_buffer (&_buf); \ p11_buffer_uninit (&_buf); \ return _ret; \ } #define LIN " IN: " #define LOUT " OUT: " #define IN_ATTRIBUTE_ARRAY(a, n) \ log_attribute_types (&_buf, LIN, #a, a, n, CKR_OK); #define IN_BOOL(a) \ log_bool (&_buf, LIN, #a, a, CKR_OK); #define IN_BYTE_ARRAY(a, n) \ log_byte_array (&_buf, LIN, #a, a, &n, CKR_OK); #define IN_HANDLE(a) \ log_ulong (&_buf, LIN, #a, a, "H", CKR_OK); #define IN_INIT_ARGS(a) \ log_pInitArgs (&_buf, LIN, #a, a, CKR_OK); #define IN_POINTER(a) \ log_pointer (&_buf, LIN, #a, a, CKR_OK); #define IN_MECHANISM(a) \ log_mechanism (&_buf, LIN, #a, a, CKR_OK); #define IN_MECHANISM_TYPE(a) \ log_mechanism_type (&_buf, LIN, #a, a, CKR_OK); #define IN_SESSION(a) \ log_ulong (&_buf, LIN, #a, a, "S", CKR_OK); #define IN_SLOT_ID(a) \ log_ulong (&_buf, LIN, #a, a, "SL", CKR_OK); #define IN_STRING(a) \ log_string (&_buf, LIN, #a, a, CKR_OK); #define IN_ULONG(a) \ log_ulong (&_buf, LIN, #a, a, NULL, CKR_OK); #define IN_ULONG_PTR(a) \ log_ulong_pointer (&_buf, LIN, #a, a, NULL, CKR_OK); #define IN_USER_TYPE(a) \ log_user_type (&_buf, LIN, #a, a, CKR_OK); #define OUT_ATTRIBUTE_ARRAY(a, n) \ log_attribute_array (&_buf, LOUT, #a, a, n, _ret); #define OUT_BYTE_ARRAY(a, n) \ log_byte_array(&_buf, LOUT, #a, a, n, _ret); #define OUT_HANDLE(a) \ log_ulong_pointer (&_buf, LOUT, #a, a, "H", _ret); #define OUT_HANDLE_ARRAY(a, n) \ log_ulong_array (&_buf, LOUT, #a, a, n, "H", _ret); #define OUT_INFO(a) \ log_info (&_buf, LOUT, #a, a, _ret); #define OUT_MECHANISM_INFO(a) \ log_mechanism_info (&_buf, LOUT, #a, a, _ret); #define OUT_MECHANISM_TYPE_ARRAY(a, n) \ log_mechanism_type_array (&_buf, LOUT, #a, a, n, _ret); #define OUT_POINTER(a) \ log_pointer (&_buf, LOUT, #a, a, _ret); #define OUT_SESSION(a) \ log_ulong_pointer (&_buf, LOUT, #a, a, "S", _ret); #define OUT_SESSION_INFO(a) \ log_session_info (&_buf, LOUT, #a, a, _ret); #define OUT_SLOT_ID_ARRAY(a, n) \ log_ulong_array (&_buf, LOUT, #a, a, n, "SL", _ret); #define OUT_SLOT_ID(a) \ log_ulong_pointer (&_buf, LOUT, #a, a, "SL", _ret); #define OUT_SLOT_INFO(a) \ log_slot_info (&_buf, LOUT, #a, a, _ret); #define OUT_TOKEN_INFO(a) \ log_token_info (&_buf, LOUT, #a, a, _ret); #define OUT_ULONG(a) \ log_ulong_pointer (&_buf, LOUT, #a, a, NULL, _ret); #define OUT_ULONG_ARRAY(a, n) \ log_ulong_array (&_buf, LOUT, #a, a, n, NULL, _ret); /* ---------------------------------------------------------------- */ static CK_RV log_C_Initialize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR pInitArgs) { BEGIN_CALL (Initialize) IN_INIT_ARGS (pInitArgs) PROCESS_CALL ((self, pInitArgs)) DONE_CALL } static CK_RV log_C_Finalize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR pReserved) { BEGIN_CALL (Finalize) IN_POINTER (pReserved) PROCESS_CALL ((self, pReserved)) DONE_CALL } static CK_RV log_C_GetInfo (CK_X_FUNCTION_LIST *self, CK_INFO_PTR pInfo) { BEGIN_CALL (GetInfo) PROCESS_CALL ((self, pInfo)) OUT_INFO (pInfo) DONE_CALL } static CK_RV log_C_GetSlotList (CK_X_FUNCTION_LIST *self, CK_BBOOL tokenPresent, CK_SLOT_ID_PTR pSlotList, CK_ULONG_PTR pulCount) { BEGIN_CALL (GetSlotList) IN_BOOL (tokenPresent) IN_ULONG_PTR (pulCount) PROCESS_CALL ((self, tokenPresent, pSlotList, pulCount)) OUT_SLOT_ID_ARRAY (pSlotList, pulCount) DONE_CALL } static CK_RV log_C_GetSlotInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slotID, CK_SLOT_INFO_PTR pInfo) { BEGIN_CALL (GetSlotInfo) IN_SLOT_ID (slotID) PROCESS_CALL ((self, slotID, pInfo)) OUT_SLOT_INFO (pInfo) DONE_CALL } static CK_RV log_C_GetTokenInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slotID, CK_TOKEN_INFO_PTR pInfo) { BEGIN_CALL (GetTokenInfo) IN_SLOT_ID (slotID) PROCESS_CALL ((self, slotID, pInfo)) OUT_TOKEN_INFO (pInfo) DONE_CALL } static CK_RV log_C_GetMechanismList (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slotID, CK_MECHANISM_TYPE_PTR pMechanismList, CK_ULONG_PTR pulCount) { BEGIN_CALL (GetMechanismList) IN_SLOT_ID (slotID) IN_ULONG_PTR (pulCount) PROCESS_CALL ((self, slotID, pMechanismList, pulCount)) OUT_MECHANISM_TYPE_ARRAY (pMechanismList, pulCount) DONE_CALL } static CK_RV log_C_GetMechanismInfo (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slotID, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR pInfo) { BEGIN_CALL (GetMechanismInfo) IN_SLOT_ID (slotID) IN_MECHANISM_TYPE (type) PROCESS_CALL ((self, slotID, type, pInfo)) OUT_MECHANISM_INFO (pInfo) DONE_CALL } static CK_RV log_C_InitToken (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slotID, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen, CK_UTF8CHAR_PTR pLabel) { BEGIN_CALL (InitToken) IN_SLOT_ID (slotID) IN_BYTE_ARRAY (pPin, ulPinLen) IN_STRING (pLabel) PROCESS_CALL ((self, slotID, pPin, ulPinLen, pLabel)) DONE_CALL } static CK_RV log_C_WaitForSlotEvent (CK_X_FUNCTION_LIST *self, CK_FLAGS flags, CK_SLOT_ID_PTR pSlot, CK_VOID_PTR pReserved) { char temp[32]; int had = 0; BEGIN_CALL (WaitForSlotEvent) p11_buffer_add (&_buf, " IN: flags = ", -1); snprintf (temp, sizeof (temp), "%lu", flags); p11_buffer_add (&_buf, temp, -1); LOG_FLAG (&_buf, flags, had, CKF_DONT_BLOCK); p11_buffer_add (&_buf, "\n", 1); PROCESS_CALL ((self, flags, pSlot, pReserved)) OUT_SLOT_ID (pSlot) OUT_POINTER (pReserved) DONE_CALL } static CK_RV log_C_OpenSession (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slotID, CK_FLAGS flags, CK_VOID_PTR pApplication, CK_NOTIFY Notify, CK_SESSION_HANDLE_PTR phSession) { char temp[32]; int had = 0; BEGIN_CALL (OpenSession) IN_SLOT_ID (slotID) p11_buffer_add (&_buf, " IN: flags = ", -1); snprintf (temp, sizeof (temp), "%lu", flags); p11_buffer_add (&_buf, temp, -1); LOG_FLAG (&_buf, flags, had, CKF_SERIAL_SESSION); LOG_FLAG (&_buf, flags, had, CKF_RW_SESSION); p11_buffer_add (&_buf, "\n", 1); IN_POINTER (pApplication); IN_POINTER (Notify); PROCESS_CALL ((self, slotID, flags, pApplication, Notify, phSession)); OUT_SESSION (phSession) DONE_CALL } static CK_RV log_C_CloseSession (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession) { BEGIN_CALL (CloseSession) IN_SESSION (hSession) PROCESS_CALL ((self, hSession)) DONE_CALL } static CK_RV log_C_CloseAllSessions (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slotID) { BEGIN_CALL (CloseAllSessions) IN_SLOT_ID (slotID) PROCESS_CALL ((self, slotID)) DONE_CALL } static CK_RV log_C_GetSessionInfo (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_SESSION_INFO_PTR pInfo) { BEGIN_CALL (GetSessionInfo) IN_SESSION (hSession) PROCESS_CALL ((self, hSession, pInfo)) OUT_SESSION_INFO (pInfo) DONE_CALL } static CK_RV log_C_InitPIN (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen) { BEGIN_CALL (InitPIN) IN_SESSION (hSession) IN_BYTE_ARRAY (pPin, ulPinLen) PROCESS_CALL ((self, hSession, pPin, ulPinLen)) DONE_CALL } static CK_RV log_C_SetPIN (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pOldPin, CK_ULONG ulOldLen, CK_UTF8CHAR_PTR pNewPin, CK_ULONG ulNewLen) { BEGIN_CALL (SetPIN) IN_SESSION (hSession) IN_BYTE_ARRAY (pOldPin, ulOldLen) IN_BYTE_ARRAY (pNewPin, ulNewLen); PROCESS_CALL ((self, hSession, pOldPin, ulOldLen, pNewPin, ulNewLen)) DONE_CALL } static CK_RV log_C_GetOperationState (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pOperationState, CK_ULONG_PTR pulOperationStateLen) { BEGIN_CALL (GetOperationState) IN_SESSION (hSession) IN_ULONG_PTR (pulOperationStateLen) PROCESS_CALL ((self, hSession, pOperationState, pulOperationStateLen)) OUT_BYTE_ARRAY (pOperationState, pulOperationStateLen) DONE_CALL } static CK_RV log_C_SetOperationState (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pOperationState, CK_ULONG ulOperationStateLen, CK_OBJECT_HANDLE hEncryptionKey, CK_OBJECT_HANDLE hAuthenticationKey) { BEGIN_CALL (SetOperationState) IN_SESSION (hSession) IN_BYTE_ARRAY (pOperationState, ulOperationStateLen) IN_HANDLE (hEncryptionKey) IN_HANDLE (hAuthenticationKey) PROCESS_CALL ((self, hSession, pOperationState, ulOperationStateLen, hEncryptionKey, hAuthenticationKey)) DONE_CALL } static CK_RV log_C_Login (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_USER_TYPE userType, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen) { BEGIN_CALL (Login) IN_SESSION (hSession) IN_USER_TYPE (userType) IN_BYTE_ARRAY (pPin, ulPinLen); PROCESS_CALL ((self, hSession, userType, pPin, ulPinLen)) DONE_CALL } static CK_RV log_C_Logout (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession) { BEGIN_CALL (Logout) IN_SESSION (hSession) PROCESS_CALL ((self, hSession)) DONE_CALL } static CK_RV log_C_CreateObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount, CK_OBJECT_HANDLE_PTR phObject) { BEGIN_CALL (CreateObject) IN_SESSION (hSession) IN_ATTRIBUTE_ARRAY (pTemplate, ulCount) PROCESS_CALL ((self, hSession, pTemplate, ulCount, phObject)) OUT_HANDLE (phObject) DONE_CALL } static CK_RV log_C_CopyObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount, CK_OBJECT_HANDLE_PTR phNewObject) { BEGIN_CALL (CopyObject) IN_SESSION (hSession) IN_HANDLE (hObject) IN_ATTRIBUTE_ARRAY (pTemplate, ulCount) PROCESS_CALL ((self, hSession, hObject, pTemplate, ulCount, phNewObject)) OUT_HANDLE (phNewObject) DONE_CALL } static CK_RV log_C_DestroyObject (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject) { BEGIN_CALL (DestroyObject); IN_SESSION (hSession) IN_HANDLE (hObject) PROCESS_CALL ((self, hSession, hObject)) DONE_CALL } static CK_RV log_C_GetObjectSize (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, CK_ULONG_PTR size) { BEGIN_CALL (GetObjectSize); IN_SESSION (hSession) IN_HANDLE (hObject) PROCESS_CALL ((self, hSession, hObject, size)) OUT_ULONG (size) DONE_CALL } static CK_RV log_C_GetAttributeValue (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount) { BEGIN_CALL (GetAttributeValue) IN_SESSION (hSession) IN_HANDLE (hObject) IN_ATTRIBUTE_ARRAY (pTemplate, ulCount) PROCESS_CALL ((self, hSession, hObject, pTemplate, ulCount)) OUT_ATTRIBUTE_ARRAY (pTemplate, ulCount) DONE_CALL } static CK_RV log_C_SetAttributeValue (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount) { BEGIN_CALL (SetAttributeValue) IN_SESSION (hSession) IN_HANDLE (hObject) IN_ATTRIBUTE_ARRAY (pTemplate, ulCount) PROCESS_CALL ((self, hSession, hObject, pTemplate, ulCount)) DONE_CALL } static CK_RV log_C_FindObjectsInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount) { BEGIN_CALL (FindObjectsInit) IN_SESSION (hSession) IN_ATTRIBUTE_ARRAY (pTemplate, ulCount) PROCESS_CALL ((self, hSession, pTemplate, ulCount)) DONE_CALL } static CK_RV log_C_FindObjects (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE_PTR object, CK_ULONG max_object_count, CK_ULONG_PTR object_count) { BEGIN_CALL (FindObjects) IN_SESSION (hSession) IN_ULONG (max_object_count) PROCESS_CALL ((self, hSession, object, max_object_count, object_count)) OUT_HANDLE_ARRAY (object, object_count) DONE_CALL } static CK_RV log_C_FindObjectsFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession) { BEGIN_CALL (FindObjectsFinal) IN_SESSION (hSession) PROCESS_CALL ((self, hSession)) DONE_CALL } static CK_RV log_C_EncryptInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey) { BEGIN_CALL (EncryptInit) IN_SESSION (hSession) IN_MECHANISM (pMechanism) IN_HANDLE (hKey) PROCESS_CALL ((self, hSession, pMechanism, hKey)) DONE_CALL } static CK_RV log_C_Encrypt (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, CK_BYTE_PTR pEncryptedData, CK_ULONG_PTR pulEncryptedDataLen) { BEGIN_CALL (Encrypt) IN_SESSION (hSession) IN_BYTE_ARRAY (pData, ulDataLen) PROCESS_CALL ((self, hSession, pData, ulDataLen, pEncryptedData, pulEncryptedDataLen)) OUT_BYTE_ARRAY (pEncryptedData, pulEncryptedDataLen) DONE_CALL } static CK_RV log_C_EncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen, CK_BYTE_PTR pEncryptedPart, CK_ULONG_PTR pulEncryptedPartLen) { BEGIN_CALL (EncryptUpdate) IN_SESSION (hSession) IN_BYTE_ARRAY (pPart, ulPartLen) PROCESS_CALL ((self, hSession, pPart, ulPartLen, pEncryptedPart, pulEncryptedPartLen)) OUT_BYTE_ARRAY (pEncryptedPart, pulEncryptedPartLen) DONE_CALL } static CK_RV log_C_EncryptFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pLastEncryptedPart, CK_ULONG_PTR pulLastEncryptedPartLen) { BEGIN_CALL (EncryptFinal) IN_SESSION (hSession) PROCESS_CALL ((self, hSession, pLastEncryptedPart, pulLastEncryptedPartLen)) OUT_BYTE_ARRAY (pLastEncryptedPart, pulLastEncryptedPartLen) DONE_CALL } static CK_RV log_C_DecryptInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey) { BEGIN_CALL (DecryptInit) IN_SESSION (hSession) IN_MECHANISM (pMechanism) IN_HANDLE (hKey) PROCESS_CALL ((self, hSession, pMechanism, hKey)) DONE_CALL } static CK_RV log_C_Decrypt (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedData, CK_ULONG ulEncryptedDataLen, CK_BYTE_PTR pData, CK_ULONG_PTR pulDataLen) { BEGIN_CALL (Decrypt) IN_SESSION (hSession) IN_BYTE_ARRAY (pEncryptedData, ulEncryptedDataLen) PROCESS_CALL ((self, hSession, pEncryptedData, ulEncryptedDataLen, pData, pulDataLen)) OUT_BYTE_ARRAY (pData, pulDataLen) DONE_CALL } static CK_RV log_C_DecryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen, CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen) { BEGIN_CALL (DecryptUpdate) IN_SESSION (hSession) IN_BYTE_ARRAY (pEncryptedPart, ulEncryptedPartLen) PROCESS_CALL ((self, hSession, pEncryptedPart, ulEncryptedPartLen, pPart, pulPartLen)) OUT_BYTE_ARRAY (pPart, pulPartLen) DONE_CALL } static CK_RV log_C_DecryptFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pLastPart, CK_ULONG_PTR pulLastPartLen) { BEGIN_CALL (DecryptFinal) IN_SESSION (hSession) PROCESS_CALL ((self, hSession, pLastPart, pulLastPartLen)) OUT_BYTE_ARRAY (pLastPart, pulLastPartLen) DONE_CALL } static CK_RV log_C_DigestInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism) { BEGIN_CALL (DigestInit) IN_SESSION (hSession) IN_MECHANISM (pMechanism) PROCESS_CALL ((self, hSession, pMechanism)) DONE_CALL } static CK_RV log_C_Digest (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, CK_BYTE_PTR pDigest, CK_ULONG_PTR pulDigestLen) { BEGIN_CALL (Digest) IN_SESSION (hSession) IN_BYTE_ARRAY (pData, ulDataLen) PROCESS_CALL ((self, hSession, pData, ulDataLen, pDigest, pulDigestLen)) OUT_BYTE_ARRAY (pDigest, pulDigestLen) DONE_CALL } static CK_RV log_C_DigestUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen) { BEGIN_CALL (DigestUpdate) IN_SESSION (hSession) IN_BYTE_ARRAY (pPart, ulPartLen) PROCESS_CALL ((self, hSession, pPart, ulPartLen)) DONE_CALL } static CK_RV log_C_DigestKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey) { BEGIN_CALL (DigestKey) IN_SESSION (hSession) IN_HANDLE (hKey) PROCESS_CALL ((self, hSession, hKey)) DONE_CALL } static CK_RV log_C_DigestFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pDigest, CK_ULONG_PTR pulDigestLen) { BEGIN_CALL (DigestFinal) IN_SESSION (hSession) PROCESS_CALL ((self, hSession, pDigest, pulDigestLen)) OUT_BYTE_ARRAY (pDigest, pulDigestLen) DONE_CALL } static CK_RV log_C_SignInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey) { BEGIN_CALL (SignInit) IN_SESSION (hSession) IN_MECHANISM (pMechanism) IN_HANDLE (hKey) PROCESS_CALL ((self, hSession, pMechanism, hKey)) DONE_CALL } static CK_RV log_C_Sign (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen) { BEGIN_CALL (Sign) IN_SESSION (hSession) IN_BYTE_ARRAY (pData, ulDataLen) PROCESS_CALL ((self, hSession, pData, ulDataLen, pSignature, pulSignatureLen)) OUT_BYTE_ARRAY (pSignature, pulSignatureLen) DONE_CALL } static CK_RV log_C_SignUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen) { BEGIN_CALL (SignUpdate) IN_SESSION (hSession) IN_BYTE_ARRAY (pPart, ulPartLen) PROCESS_CALL ((self, hSession, pPart, ulPartLen)) DONE_CALL } static CK_RV log_C_SignFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen) { BEGIN_CALL (SignFinal) IN_SESSION (hSession) PROCESS_CALL ((self, hSession, pSignature, pulSignatureLen)) OUT_BYTE_ARRAY (pSignature, pulSignatureLen) DONE_CALL } static CK_RV log_C_SignRecoverInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey) { BEGIN_CALL (SignRecoverInit) IN_SESSION (hSession) IN_MECHANISM (pMechanism) IN_HANDLE (hKey) PROCESS_CALL ((self, hSession, pMechanism, hKey)) DONE_CALL } static CK_RV log_C_SignRecover (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen) { BEGIN_CALL (SignRecover) IN_SESSION (hSession) IN_BYTE_ARRAY (pData, ulDataLen) PROCESS_CALL ((self, hSession, pData, ulDataLen, pSignature, pulSignatureLen)) OUT_BYTE_ARRAY (pSignature, pulSignatureLen) DONE_CALL } static CK_RV log_C_VerifyInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey) { BEGIN_CALL (VerifyInit); IN_SESSION (hSession) IN_MECHANISM (pMechanism) IN_HANDLE (hKey) PROCESS_CALL ((self, hSession, pMechanism, hKey)) DONE_CALL } static CK_RV log_C_Verify (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen) { BEGIN_CALL (Verify) IN_SESSION (hSession) IN_BYTE_ARRAY (pData, ulDataLen) IN_BYTE_ARRAY (pSignature, ulSignatureLen) PROCESS_CALL ((self, hSession, pData, ulDataLen, pSignature, ulSignatureLen)) DONE_CALL } static CK_RV log_C_VerifyUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen) { BEGIN_CALL (VerifyUpdate) IN_SESSION (hSession) IN_BYTE_ARRAY (pPart, ulPartLen) PROCESS_CALL ((self, hSession, pPart, ulPartLen)) DONE_CALL } static CK_RV log_C_VerifyFinal (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen) { BEGIN_CALL (VerifyFinal) IN_SESSION (hSession) IN_BYTE_ARRAY (pSignature, ulSignatureLen); PROCESS_CALL ((self, hSession, pSignature, ulSignatureLen)) DONE_CALL } static CK_RV log_C_VerifyRecoverInit (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey) { BEGIN_CALL (VerifyRecoverInit) IN_SESSION (hSession) IN_MECHANISM (pMechanism) IN_HANDLE (hKey) PROCESS_CALL ((self, hSession, pMechanism, hKey)) DONE_CALL } static CK_RV log_C_VerifyRecover (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen, CK_BYTE_PTR pData, CK_ULONG_PTR pulDataLen) { BEGIN_CALL (VerifyRecover) IN_SESSION (hSession) IN_BYTE_ARRAY (pSignature, ulSignatureLen) PROCESS_CALL ((self, hSession, pSignature, ulSignatureLen, pData, pulDataLen)) OUT_BYTE_ARRAY (pData, pulDataLen) DONE_CALL } static CK_RV log_C_DigestEncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen, CK_BYTE_PTR pEncryptedPart, CK_ULONG_PTR pulEncryptedPartLen) { BEGIN_CALL (DigestEncryptUpdate); IN_SESSION (hSession) IN_BYTE_ARRAY (pPart, ulPartLen) PROCESS_CALL ((self, hSession, pPart, ulPartLen, pEncryptedPart, pulEncryptedPartLen)) OUT_BYTE_ARRAY (pEncryptedPart, pulEncryptedPartLen) DONE_CALL } static CK_RV log_C_DecryptDigestUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen, CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen) { BEGIN_CALL (DecryptDigestUpdate) IN_SESSION (hSession) IN_BYTE_ARRAY (pEncryptedPart, ulEncryptedPartLen) PROCESS_CALL ((self, hSession, pEncryptedPart, ulEncryptedPartLen, pPart, pulPartLen)) OUT_BYTE_ARRAY (pPart, pulPartLen) DONE_CALL } static CK_RV log_C_SignEncryptUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen, CK_BYTE_PTR pEncryptedPart, CK_ULONG_PTR pulEncryptedPartLen) { BEGIN_CALL (SignEncryptUpdate) IN_SESSION (hSession) IN_BYTE_ARRAY (pPart, ulPartLen) PROCESS_CALL ((self, hSession, pPart, ulPartLen, pEncryptedPart, pulEncryptedPartLen)) OUT_BYTE_ARRAY (pEncryptedPart, pulEncryptedPartLen) DONE_CALL } static CK_RV log_C_DecryptVerifyUpdate (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen, CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen) { BEGIN_CALL (DecryptVerifyUpdate) IN_SESSION (hSession) IN_BYTE_ARRAY (pEncryptedPart, ulEncryptedPartLen) PROCESS_CALL ((self, hSession, pEncryptedPart, ulEncryptedPartLen, pPart, pulPartLen)) OUT_BYTE_ARRAY (pPart, pulPartLen) DONE_CALL } static CK_RV log_C_GenerateKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount, CK_OBJECT_HANDLE_PTR phKey) { BEGIN_CALL (GenerateKey) IN_SESSION (hSession) IN_MECHANISM (pMechanism) IN_ATTRIBUTE_ARRAY (pTemplate, ulCount) PROCESS_CALL ((self, hSession, pMechanism, pTemplate, ulCount, phKey)) OUT_HANDLE (phKey) DONE_CALL } static CK_RV log_C_GenerateKeyPair (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_ATTRIBUTE_PTR pPublicKeyTemplate, CK_ULONG ulPublicKeyAttributeCount, CK_ATTRIBUTE_PTR pPrivateKeyTemplate, CK_ULONG ulPrivateKeyAttributeCount, CK_OBJECT_HANDLE_PTR phPublicKey, CK_OBJECT_HANDLE_PTR phPrivateKey) { BEGIN_CALL (GenerateKeyPair) IN_SESSION (hSession) IN_MECHANISM (pMechanism) IN_ATTRIBUTE_ARRAY (pPublicKeyTemplate, ulPublicKeyAttributeCount) IN_ATTRIBUTE_ARRAY (pPrivateKeyTemplate, ulPrivateKeyAttributeCount) PROCESS_CALL ((self, hSession, pMechanism, pPublicKeyTemplate, ulPublicKeyAttributeCount, pPrivateKeyTemplate, ulPrivateKeyAttributeCount, phPublicKey, phPrivateKey)) OUT_HANDLE (phPublicKey) OUT_HANDLE (phPrivateKey) DONE_CALL } static CK_RV log_C_WrapKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hWrappingKey, CK_OBJECT_HANDLE hKey, CK_BYTE_PTR pWrappedKey, CK_ULONG_PTR pulWrappedKeyLen) { BEGIN_CALL (WrapKey) IN_SESSION (hSession) IN_MECHANISM (pMechanism) IN_HANDLE (hWrappingKey) IN_HANDLE (hKey) PROCESS_CALL ((self, hSession, pMechanism, hWrappingKey, hKey, pWrappedKey, pulWrappedKeyLen)) OUT_BYTE_ARRAY (pWrappedKey, pulWrappedKeyLen) DONE_CALL } static CK_RV log_C_UnwrapKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hUnwrappingKey, CK_BYTE_PTR pWrappedKey, CK_ULONG ulWrappedKeyLen, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulAttributeCount, CK_OBJECT_HANDLE_PTR phKey) { BEGIN_CALL (UnwrapKey) IN_SESSION (hSession) IN_MECHANISM (pMechanism) IN_HANDLE (hUnwrappingKey) IN_BYTE_ARRAY (pWrappedKey, ulWrappedKeyLen) IN_ATTRIBUTE_ARRAY (pTemplate, ulAttributeCount) PROCESS_CALL ((self, hSession, pMechanism, hUnwrappingKey, pWrappedKey, ulWrappedKeyLen, pTemplate, ulAttributeCount, phKey)) OUT_HANDLE (phKey) DONE_CALL } static CK_RV log_C_DeriveKey (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hBaseKey, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulAttributeCount, CK_OBJECT_HANDLE_PTR phObject) { BEGIN_CALL (DeriveKey) IN_SESSION (hSession) IN_MECHANISM (pMechanism) IN_HANDLE (hBaseKey) IN_ATTRIBUTE_ARRAY (pTemplate, ulAttributeCount) PROCESS_CALL ((self, hSession, pMechanism, hBaseKey, pTemplate, ulAttributeCount, phObject)) OUT_HANDLE (phObject) DONE_CALL } static CK_RV log_C_SeedRandom (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSeed, CK_ULONG ulSeedLen) { BEGIN_CALL (SeedRandom) IN_SESSION (hSession) IN_BYTE_ARRAY (pSeed, ulSeedLen); PROCESS_CALL ((self, hSession, pSeed, ulSeedLen)) DONE_CALL } static CK_RV log_C_GenerateRandom (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE hSession, CK_BYTE_PTR pRandomData, CK_ULONG ulRandomLen) { BEGIN_CALL (GenerateRandom) IN_SESSION (hSession) IN_ULONG (ulRandomLen) PROCESS_CALL ((self, hSession, pRandomData, ulRandomLen)) OUT_BYTE_ARRAY (pRandomData, &ulRandomLen) DONE_CALL } static CK_X_FUNCTION_LIST log_functions = { { -1, -1 }, log_C_Initialize, log_C_Finalize, log_C_GetInfo, log_C_GetSlotList, log_C_GetSlotInfo, log_C_GetTokenInfo, log_C_GetMechanismList, log_C_GetMechanismInfo, log_C_InitToken, log_C_InitPIN, log_C_SetPIN, log_C_OpenSession, log_C_CloseSession, log_C_CloseAllSessions, log_C_GetSessionInfo, log_C_GetOperationState, log_C_SetOperationState, log_C_Login, log_C_Logout, log_C_CreateObject, log_C_CopyObject, log_C_DestroyObject, log_C_GetObjectSize, log_C_GetAttributeValue, log_C_SetAttributeValue, log_C_FindObjectsInit, log_C_FindObjects, log_C_FindObjectsFinal, log_C_EncryptInit, log_C_Encrypt, log_C_EncryptUpdate, log_C_EncryptFinal, log_C_DecryptInit, log_C_Decrypt, log_C_DecryptUpdate, log_C_DecryptFinal, log_C_DigestInit, log_C_Digest, log_C_DigestUpdate, log_C_DigestKey, log_C_DigestFinal, log_C_SignInit, log_C_Sign, log_C_SignUpdate, log_C_SignFinal, log_C_SignRecoverInit, log_C_SignRecover, log_C_VerifyInit, log_C_Verify, log_C_VerifyUpdate, log_C_VerifyFinal, log_C_VerifyRecoverInit, log_C_VerifyRecover, log_C_DigestEncryptUpdate, log_C_DecryptDigestUpdate, log_C_SignEncryptUpdate, log_C_DecryptVerifyUpdate, log_C_GenerateKey, log_C_GenerateKeyPair, log_C_WrapKey, log_C_UnwrapKey, log_C_DeriveKey, log_C_SeedRandom, log_C_GenerateRandom, log_C_WaitForSlotEvent, }; void p11_log_release (void *data) { LogData *log = (LogData *)data; return_if_fail (data != NULL); p11_virtual_uninit (&log->virt); free (log); } p11_virtual * p11_log_subclass (p11_virtual *lower, p11_destroyer destroyer) { LogData *log; log = calloc (1, sizeof (LogData)); return_val_if_fail (log != NULL, NULL); p11_virtual_init (&log->virt, &log_functions, lower, destroyer); log->lower = &lower->funcs; return &log->virt; } p11-kit-0.20.2/p11-kit/docs.h0000664000175000017500000000334612226763526012214 00000000000000/* * Copyright (c) 2013 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ /* This header is not used by anything, and merely to help gtk-doc be sane */ #define P11_KIT_MODULE_UNMANAGED 1 #define P11_KIT_MODULE_CRITICAL 1 p11-kit-0.20.2/p11-kit/p11-kit.c0000664000175000017500000000710212226763526012437 00000000000000/* * Copyright (c) 2011, Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "compat.h" #include "debug.h" #include "message.h" #include "path.h" #include #include #include #include #include #include #include #include #include "tool.h" int p11_kit_list_modules (int argc, char *argv[]); int p11_kit_trust (int argc, char *argv[]); int p11_kit_external (int argc, char *argv[]); static const p11_tool_command commands[] = { { "list-modules", p11_kit_list_modules, "List modules and tokens" }, { P11_TOOL_FALLBACK, p11_kit_external, NULL }, { 0, } }; int p11_kit_trust (int argc, char *argv[]) { char **args; args = calloc (argc + 2, sizeof (char *)); return_val_if_fail (args != NULL, 1); args[0] = BINDIR "/trust"; memcpy (args + 1, argv, sizeof (char *) * argc); args[argc + 1] = NULL; execv (args[0], args); /* At this point we have no command */ p11_message_err (errno, "couldn't run trust tool"); free (args); return 2; } int p11_kit_external (int argc, char *argv[]) { char *filename; char *path; /* These are trust commands, send them to that tool */ if (strcmp (argv[0], "extract") == 0) { return p11_kit_trust (argc, argv); } else if (strcmp (argv[0], "extract-trust") == 0) { argv[0] = "extract-compat"; return p11_kit_trust (argc, argv); } if (!asprintf (&filename, "p11-kit-%s", argv[0]) < 0) return_val_if_reached (1); /* Add our libexec directory to the path */ path = p11_path_build (PRIVATEDIR, filename, NULL); return_val_if_fail (path != NULL, 1); argv[argc] = NULL; execv (path, argv); /* At this point we have no command */ p11_message ("'%s' is not a valid command. See 'p11-kit --help'", argv[0]); free (filename); free (path); return 2; } int main (int argc, char *argv[]) { return p11_tool_main (argc, argv, commands); } p11-kit-0.20.2/p11-kit/conf.h0000664000175000017500000000565412226763526012215 00000000000000/* * Copyright (c) 2005 Stefan Walter * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef __CONF_H__ #define __CONF_H__ #include "dict.h" enum { CONF_IGNORE_MISSING = 0x01, CONF_IGNORE_ACCESS_DENIED = 0x02, }; enum { CONF_USER_INVALID = 0, CONF_USER_NONE = 1, CONF_USER_MERGE, CONF_USER_ONLY }; bool _p11_conf_merge_defaults (p11_dict *config, p11_dict *defaults); /* Returns a hash of char *key -> char *value */ p11_dict * _p11_conf_parse_file (const char *filename, struct stat *sb, int flags); /* Returns a hash of char *key -> char *value */ p11_dict * _p11_conf_load_globals (const char *system_conf, const char *user_conf, int *user_mode); /* Returns a hash of char* name -> hash_t *config */ p11_dict * _p11_conf_load_modules (int user_mode, const char *package_dir, const char *system_dir, const char *user_dir); bool _p11_conf_parse_boolean (const char *string, bool default_value); #endif /* __CONF_H__ */ p11-kit-0.20.2/p11-kit/pkcs11.conf.example.in0000664000175000017500000000061012225010114015063 00000000000000# This is an example @p11_system_config_file@ file. Copy it into # place before use. # This setting controls whether to load user configuration from the # @p11_user_config@ directory. Possible values: # none: No user configuration # merge: Merge the user config over the system configuration (default) # only: Only user configuration, ignore system configuration user-config: merge p11-kit-0.20.2/p11-kit/conf.c0000664000175000017500000003021212226763526012174 00000000000000/* * Copyright (c) 2005 Stefan Walter * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * CONTRIBUTORS * Stef Walter */ #include "config.h" #include "conf.h" #define P11_DEBUG_FLAG P11_DEBUG_CONF #include "debug.h" #include "lexer.h" #include "message.h" #include "path.h" #include "private.h" #include #include #include #include #include #include #include #include #include #include static int strequal (const char *one, const char *two) { return strcmp (one, two) == 0; } /* ----------------------------------------------------------------------------- * CONFIG PARSER */ bool _p11_conf_merge_defaults (p11_dict *map, p11_dict *defaults) { p11_dictiter iter; void *key; void *value; p11_dict_iterate (defaults, &iter); while (p11_dict_next (&iter, &key, &value)) { /* Only override if not set */ if (p11_dict_get (map, key)) continue; key = strdup (key); return_val_if_fail (key != NULL, false); value = strdup (value); return_val_if_fail (key != NULL, false); if (!p11_dict_set (map, key, value)) return_val_if_reached (false); } return true; } p11_dict * _p11_conf_parse_file (const char* filename, struct stat *sb, int flags) { p11_dict *map = NULL; void *data; p11_lexer lexer; bool failed = false; size_t length; p11_mmap *mmap; int error; assert (filename); p11_debug ("reading config file: %s", filename); mmap = p11_mmap_open (filename, sb, &data, &length); if (mmap == NULL) { error = errno; if ((flags & CONF_IGNORE_MISSING) && (error == ENOENT || error == ENOTDIR)) { p11_debug ("config file does not exist"); } else if ((flags & CONF_IGNORE_ACCESS_DENIED) && (error == EPERM || error == EACCES)) { p11_debug ("config file is inaccessible"); } else { p11_message_err (error, "couldn't open config file: %s", filename); errno = error; return NULL; } } map = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, free); return_val_if_fail (map != NULL, NULL); /* Empty config fall through above */ if (mmap == NULL) return map; p11_lexer_init (&lexer, filename, data, length); while (p11_lexer_next (&lexer, &failed)) { switch (lexer.tok_type) { case TOK_FIELD: p11_debug ("config value: %s: %s", lexer.tok.field.name, lexer.tok.field.value); if (!p11_dict_set (map, lexer.tok.field.name, lexer.tok.field.value)) return_val_if_reached (NULL); lexer.tok.field.name = NULL; lexer.tok.field.value = NULL; break; case TOK_PEM: p11_message ("%s: unexpected pem block", filename); failed = true; break; case TOK_SECTION: p11_message ("%s: unexpected section header", filename); failed = true; break; case TOK_EOF: assert_not_reached (); break; } if (failed) break; } p11_lexer_done (&lexer); p11_mmap_close (mmap); if (failed) { p11_dict_free (map); map = NULL; errno = EINVAL; } return map; } static int user_config_mode (p11_dict *config, int defmode) { const char *mode; /* Whether we should use or override from user directory */ mode = p11_dict_get (config, "user-config"); if (mode == NULL) { return defmode; } else if (strequal (mode, "none")) { return CONF_USER_NONE; } else if (strequal (mode, "merge")) { return CONF_USER_MERGE; } else if (strequal (mode, "only")) { return CONF_USER_ONLY; } else if (strequal (mode, "override")) { return CONF_USER_ONLY; } else { p11_message ("invalid mode for 'user-config': %s", mode); return CONF_USER_INVALID; } } p11_dict * _p11_conf_load_globals (const char *system_conf, const char *user_conf, int *user_mode) { p11_dict *config = NULL; p11_dict *uconfig = NULL; p11_dict *result = NULL; char *path = NULL; int error = 0; int flags; int mode; /* * This loads the system and user configs. This depends on the user-config * value in both the system and user configs. A bit more complex than * you might imagine, since user-config can be set to 'none' in the * user configuration, essentially turning itself off. */ /* Load the main configuration */ config = _p11_conf_parse_file (system_conf, NULL, CONF_IGNORE_MISSING); if (!config) goto finished; /* Whether we should use or override from user directory */ mode = user_config_mode (config, CONF_USER_MERGE); if (mode == CONF_USER_INVALID) { error = EINVAL; goto finished; } if (mode != CONF_USER_NONE && getauxval (AT_SECURE)) { p11_debug ("skipping user config in setuid or setgid program"); mode = CONF_USER_NONE; } if (mode != CONF_USER_NONE) { path = p11_path_expand (user_conf); if (!path) { error = errno; goto finished; } /* Load up the user configuration, ignore selinux denying us access */ flags = CONF_IGNORE_MISSING | CONF_IGNORE_ACCESS_DENIED; uconfig = _p11_conf_parse_file (path, NULL, flags); if (!uconfig) { error = errno; goto finished; } /* Figure out what the user mode is, defaulting to system mode if not set */ mode = user_config_mode (uconfig, mode); if (mode == CONF_USER_INVALID) { error = EINVAL; goto finished; } /* If merging, then supplement user config with system values */ if (mode == CONF_USER_MERGE) { if (!_p11_conf_merge_defaults (uconfig, config)) { error = errno; goto finished; } } /* If user config valid at all, then replace system with what we have */ if (mode != CONF_USER_NONE) { p11_dict_free (config); config = uconfig; uconfig = NULL; } } if (user_mode) *user_mode = mode; result = config; config = NULL; finished: free (path); p11_dict_free (config); p11_dict_free (uconfig); errno = error; return result; } static char * calc_name_from_filename (const char *fname) { /* We eventually want to settle on .module */ static const char *const suffix = ".module"; static const size_t suffix_len = 7; const char *c = fname; size_t fname_len; size_t name_len; char *name; assert (fname); /* Make sure the filename starts with an alphanumeric */ if (!isalnum(*c)) return NULL; ++c; /* Only allow alnum, _, -, and . */ while (*c) { if (!isalnum(*c) && *c != '_' && *c != '-' && *c != '.') return NULL; ++c; } /* Make sure we have one of the suffixes */ fname_len = strlen (fname); if (suffix_len >= fname_len) return NULL; name_len = (fname_len - suffix_len); if (strcmp (fname + name_len, suffix) != 0) return NULL; name = malloc (name_len + 1); return_val_if_fail (name != NULL, NULL); memcpy (name, fname, name_len); name[name_len] = 0; return name; } static bool load_config_from_file (const char *configfile, struct stat *sb, const char *name, p11_dict *configs, int flags) { p11_dict *config; p11_dict *prev; char *key; int error = 0; assert (configfile); key = calc_name_from_filename (name); if (key == NULL) { p11_message ("invalid config filename, will be ignored in the future: %s", configfile); key = strdup (name); return_val_if_fail (key != NULL, false); } config = _p11_conf_parse_file (configfile, sb, flags); if (!config) { free (key); return false; } prev = p11_dict_get (configs, key); if (prev == NULL) { if (!p11_dict_set (configs, key, config)) return_val_if_reached (false); config = NULL; } else { if (!_p11_conf_merge_defaults (prev, config)) error = errno; free (key); } /* If still set */ p11_dict_free (config); if (error) { errno = error; return false; } return true; } static bool load_configs_from_directory (const char *directory, p11_dict *configs, int flags) { struct dirent *dp; struct stat st; DIR *dir; int error = 0; bool is_dir; char *path; int count = 0; p11_debug ("loading module configs in: %s", directory); /* First we load all the modules */ dir = opendir (directory); if (!dir) { error = errno; if ((flags & CONF_IGNORE_MISSING) && (errno == ENOENT || errno == ENOTDIR)) { p11_debug ("module configs do not exist"); return true; } else if ((flags & CONF_IGNORE_ACCESS_DENIED) && (errno == EPERM || errno == EACCES)) { p11_debug ("couldn't list inacessible module configs"); return true; } p11_message_err (error, "couldn't list directory: %s", directory); errno = error; return false; } while ((dp = readdir(dir)) != NULL) { path = p11_path_build (directory, dp->d_name, NULL); return_val_if_fail (path != NULL, false); if (stat (path, &st) < 0) { error = errno; p11_message_err (error, "couldn't stat path: %s", path); free (path); break; } is_dir = S_ISDIR (st.st_mode); if (!is_dir && !load_config_from_file (path, &st, dp->d_name, configs, flags)) { error = errno; free (path); break; } free (path); count ++; } closedir (dir); if (error) { errno = error; return false; } return true; } p11_dict * _p11_conf_load_modules (int mode, const char *package_dir, const char *system_dir, const char *user_dir) { p11_dict *configs; char *path; int error = 0; int flags; /* A hash table of name -> config */ configs = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, (p11_destroyer)p11_dict_free); /* Load each user config first, if user config is allowed */ if (mode != CONF_USER_NONE) { flags = CONF_IGNORE_MISSING | CONF_IGNORE_ACCESS_DENIED; path = p11_path_expand (user_dir); if (!path) error = errno; else if (!load_configs_from_directory (path, configs, flags)) error = errno; free (path); if (error != 0) { p11_dict_free (configs); errno = error; return NULL; } } /* * Now unless user config is overriding, load system modules. * Basically if a value for the same config name is not already * loaded above (in the user configs) then they're loaded here. */ if (mode != CONF_USER_ONLY) { flags = CONF_IGNORE_MISSING; if (!load_configs_from_directory (system_dir, configs, flags) || !load_configs_from_directory (package_dir, configs, flags)) { error = errno; p11_dict_free (configs); errno = error; return NULL; } } return configs; } bool _p11_conf_parse_boolean (const char *string, bool default_value) { if (!string) return default_value; if (strcmp (string, "yes") == 0) { return true; } else if (strcmp (string, "no") == 0) { return false; } else { p11_message ("invalid setting '%s' defaulting to '%s'", string, default_value ? "yes" : "no"); return default_value; } } p11-kit-0.20.2/p11-kit/pkcs11.h0000664000175000017500000000341512161102013012333 00000000000000/* * Copyright (c) 2012 Red Hat, Inc * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ /* * This is so that we can use the path in our installed * headers, but still have the actual file live in our common/ subdirectory. */ #include "common/pkcs11.h" p11-kit-0.20.2/p11-kit/virtual.h0000664000175000017500000000516112226763526012747 00000000000000/* * Copyright (c) 2013 Red Hat, Inc * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef __P11_VIRTUAL_H__ #define __P11_VIRTUAL_H__ #include "pkcs11.h" #include "pkcs11x.h" #include "array.h" typedef struct { CK_X_FUNCTION_LIST funcs; void *lower_module; p11_destroyer lower_destroy; } p11_virtual; extern CK_X_FUNCTION_LIST p11_virtual_base; extern CK_X_FUNCTION_LIST p11_virtual_stack; void p11_virtual_init (p11_virtual *virt, CK_X_FUNCTION_LIST *funcs, void *lower_module, p11_destroyer lower_destroy); void p11_virtual_uninit (p11_virtual *virt); bool p11_virtual_can_wrap (void); CK_FUNCTION_LIST * p11_virtual_wrap (p11_virtual *virt, p11_destroyer destroyer); bool p11_virtual_is_wrapper (CK_FUNCTION_LIST *module); void p11_virtual_unwrap (CK_FUNCTION_LIST *module); #endif /* __P11_VIRTUAL_H__ */ p11-kit-0.20.2/p11-kit/uri.c0000664000175000017500000010405712226763526012057 00000000000000/* * Copyright (C) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #include "attrs.h" #include "buffer.h" #define P11_DEBUG_FLAG P11_DEBUG_URI #include "debug.h" #include "message.h" #include "pkcs11.h" #include "private.h" #include "p11-kit.h" #include "uri.h" #include "url.h" #include #include #include #include #include /** * SECTION:p11-kit-uri * @title: URIs * @short_description: Parsing and formatting PKCS\#11 URIs * * PKCS\#11 URIs can be used in configuration files or applications to represent * PKCS\#11 modules, tokens or objects. An example of a URI might be: * * * pkcs11:token=The\%20Software\%20PKCS\#11\%20softtoken; * manufacturer=Snake\%20Oil,\%20Inc.;serial=;object=my-certificate; * model=1.0;object-type=cert;id=\%69\%95\%3e\%5c\%f4\%bd\%ec\%91 * * * You can use p11_kit_uri_parse() to parse such a URI, and p11_kit_uri_format() * to build one. URIs are represented by the #P11KitUri structure. You can match * a parsed URI against PKCS\#11 tokens with p11_kit_uri_match_token_info() * or attributes with p11_kit_uri_match_attributes(). * * Since URIs can represent different sorts of things, when parsing or formatting * a URI a 'context' can be used to indicate which sort of URI is expected. * * URIs have an unrecognized flag. This flag is set during parsing * if any parts of the URI are not recognized. This may be because the part is * from a newer version of the PKCS\#11 spec or because that part was not valid * inside of the desired context used when parsing. */ /** * P11KitUri: * * A structure representing a PKCS\#11 URI. There are no public fields * visible in this structure. Use the various accessor functions. */ /** * P11KitUriType: * @P11_KIT_URI_FOR_OBJECT: The URI represents one or more objects * @P11_KIT_URI_FOR_TOKEN: The URI represents one or more tokens * @P11_KIT_URI_FOR_MODULE: The URI represents one or more modules * @P11_KIT_URI_FOR_MODULE_WITH_VERSION: The URI represents a module with * a specific version. * @P11_KIT_URI_FOR_OBJECT_ON_TOKEN: The URI represents one or more objects * that are present on a specific token. * @P11_KIT_URI_FOR_OBJECT_ON_TOKEN_AND_MODULE: The URI represents one or more * objects that are present on a specific token, being used with a certain * module. * @P11_KIT_URI_FOR_ANY: The URI can represent anything * * A PKCS\#11 URI can represent different kinds of things. This flag is used by * p11_kit_uri_parse() to denote in what context the URI will be used. * * The various types can be combined. */ /** * P11KitUriResult: * @P11_KIT_URI_OK: Success * @P11_KIT_URI_UNEXPECTED: Unexpected or internal system error * @P11_KIT_URI_BAD_SCHEME: The URI had a bad scheme * @P11_KIT_URI_BAD_ENCODING: The URI had a bad encoding * @P11_KIT_URI_BAD_SYNTAX: The URI had a bad syntax * @P11_KIT_URI_BAD_VERSION: The URI contained a bad version number * @P11_KIT_URI_NOT_FOUND: A requested part of the URI was not found * * Error codes returned by various functions. The functions each clearly state * which error codes they are capable of returning. */ /** * P11_KIT_URI_NO_MEMORY: * * Unexpected memory allocation failure result. Same as #P11_KIT_URI_UNEXPECTED. */ /** * P11_KIT_URI_SCHEME: * * String of URI scheme for PKCS\#11 URIs. */ /** * P11_KIT_URI_SCHEME_LEN: * * Length of %P11_KIT_URI_SCHEME. */ struct p11_kit_uri { bool unrecognized; CK_INFO module; CK_TOKEN_INFO token; CK_ATTRIBUTE *attrs; char *pin_source; }; const static char WHITESPACE[] = " \n\r\v"; static char * key_decode (const char *value, const char *end) { size_t length = (end - value); char *at, *pos; char *key; key = malloc (length + 1); return_val_if_fail (key != NULL, NULL); memcpy (key, value, length); key[length] = '\0'; /* Do we have any whitespace? Strip it out. */ if (strcspn (key, WHITESPACE) != length) { for (at = key, pos = key; pos != key + length + 1; ++pos) { if (!strchr (WHITESPACE, *pos)) *(at++) = *pos; } *at = '\0'; } return key; } static bool match_struct_string (const unsigned char *inuri, const unsigned char *real, size_t length) { assert (inuri); assert (real); assert (length > 0); /* NULL matches anything */ if (inuri[0] == 0) return true; return memcmp (inuri, real, length) == 0 ? true : false; } static bool match_struct_version (CK_VERSION_PTR inuri, CK_VERSION_PTR real) { /* This matches anything */ if (inuri->major == (CK_BYTE)-1 && inuri->minor == (CK_BYTE)-1) return true; return memcmp (inuri, real, sizeof (CK_VERSION)) == 0 ? true : false; } /** * p11_kit_uri_get_module_info: * @uri: the URI * * Get the CK_INFO structure associated with this URI. * * If this is a parsed URI, then the fields corresponding to library parts of * the URI will be filled in. Any library URI parts that were missing will have * their fields filled with zeros. * * If the caller wishes to setup information for building a URI, then relevant * fields should be filled in. Fields that should not appear as parts in the * resulting URI should be filled with zeros. * * Returns: A pointer to the CK_INFO structure. */ CK_INFO_PTR p11_kit_uri_get_module_info (P11KitUri *uri) { return_val_if_fail (uri != NULL, NULL); return &uri->module; } int p11_match_uri_module_info (CK_INFO_PTR one, CK_INFO_PTR two) { return (match_struct_string (one->libraryDescription, two->libraryDescription, sizeof (one->libraryDescription)) && match_struct_string (one->manufacturerID, two->manufacturerID, sizeof (one->manufacturerID)) && match_struct_version (&one->libraryVersion, &two->libraryVersion)); } /** * p11_kit_uri_match_module_info: * @uri: the URI * @info: the structure to match against the URI * * Match a CK_INFO structure against the library parts of this URI. * * Only the fields of the CK_INFO structure that are valid for use * in a URI will be matched. A URI part that was not specified in the URI will * match any value in the structure. If during the URI parsing any unrecognized * parts were encountered then this match will fail. * * Returns: 1 if the URI matches, 0 if not. */ int p11_kit_uri_match_module_info (P11KitUri *uri, CK_INFO_PTR info) { return_val_if_fail (uri != NULL, 0); return_val_if_fail (info != NULL, 0); if (uri->unrecognized) return 0; return p11_match_uri_module_info (&uri->module, info); } /** * p11_kit_uri_get_token_info: * @uri: the URI * * Get the CK_TOKEN_INFO structure associated with this URI. * * If this is a parsed URI, then the fields corresponding to token parts of * the URI will be filled in. Any token URI parts that were missing will have * their fields filled with zeros. * * If the caller wishes to setup information for building a URI, then relevant * fields should be filled in. Fields that should not appear as parts in the * resulting URI should be filled with zeros. * * Returns: A pointer to the CK_INFO structure. */ CK_TOKEN_INFO_PTR p11_kit_uri_get_token_info (P11KitUri *uri) { return_val_if_fail (uri != NULL, NULL); return &uri->token; } int p11_match_uri_token_info (CK_TOKEN_INFO_PTR one, CK_TOKEN_INFO_PTR two) { return (match_struct_string (one->label, two->label, sizeof (one->label)) && match_struct_string (one->manufacturerID, two->manufacturerID, sizeof (one->manufacturerID)) && match_struct_string (one->model, two->model, sizeof (one->model)) && match_struct_string (one->serialNumber, two->serialNumber, sizeof (one->serialNumber))); } /** * p11_kit_uri_match_token_info: * @uri: the URI * @token_info: the structure to match against the URI * * Match a CK_TOKEN_INFO structure against the token parts of this * URI. * * Only the fields of the CK_TOKEN_INFO structure that are valid * for use in a URI will be matched. A URI part that was not specified in the * URI will match any value in the structure. If during the URI parsing any * unrecognized parts were encountered then this match will fail. * * Returns: 1 if the URI matches, 0 if not. */ int p11_kit_uri_match_token_info (P11KitUri *uri, CK_TOKEN_INFO_PTR token_info) { return_val_if_fail (uri != NULL, 0); return_val_if_fail (token_info != NULL, 0); if (uri->unrecognized) return 0; return p11_match_uri_token_info (&uri->token, token_info); } /** * p11_kit_uri_get_attribute: * @uri: The URI * @attr_type: The attribute type * * Get a pointer to an attribute present in this URI. * * Returns: A pointer to the attribute, or NULL if not present. * The attribute is owned by the URI and should not be freed. */ CK_ATTRIBUTE_PTR p11_kit_uri_get_attribute (P11KitUri *uri, CK_ATTRIBUTE_TYPE attr_type) { return_val_if_fail (uri != NULL, NULL); if (uri->attrs == NULL) return NULL; return p11_attrs_find (uri->attrs, attr_type); } /** * p11_kit_uri_set_attribute: * @uri: The URI * @attr: The attribute to set * * Set an attribute on the URI. * * Only attributes that map to parts in a PKCS\#11 URI will be accepted. * * Returns: %P11_KIT_URI_OK if the attribute was successfully set. * %P11_KIT_URI_NOT_FOUND if the attribute was not valid for a URI. */ int p11_kit_uri_set_attribute (P11KitUri *uri, CK_ATTRIBUTE_PTR attr) { return_val_if_fail (uri != NULL, P11_KIT_URI_UNEXPECTED); uri->attrs = p11_attrs_buildn (uri->attrs, attr, 1); return_val_if_fail (uri->attrs != NULL, P11_KIT_URI_UNEXPECTED); return P11_KIT_URI_OK; } /** * p11_kit_uri_clear_attribute: * @uri: The URI * @attr_type: The type of the attribute to clear * * Clear an attribute on the URI. * * Only attributes that map to parts in a PKCS\#11 URI will be accepted. * * Returns: %P11_KIT_URI_OK if the attribute was successfully cleared. * %P11_KIT_URI_NOT_FOUND if the attribute was not valid for a URI. */ int p11_kit_uri_clear_attribute (P11KitUri *uri, CK_ATTRIBUTE_TYPE attr_type) { return_val_if_fail (uri != NULL, P11_KIT_URI_UNEXPECTED); if (attr_type != CKA_CLASS && attr_type != CKA_LABEL && attr_type != CKA_ID) return P11_KIT_URI_NOT_FOUND; if (uri->attrs) p11_attrs_remove (uri->attrs, attr_type); return P11_KIT_URI_OK; } /** * p11_kit_uri_get_attribute_types: * @uri: The URI * @n_attrs: A location to store the number of attributes returned. * * Get the attributes present in this URI. The attributes and values are * owned by the URI. If the URI is modified, then the attributes that were * returned from this function will not remain consistent. * * Returns: The attributes for this URI. These are owned by the URI. */ CK_ATTRIBUTE_PTR p11_kit_uri_get_attributes (P11KitUri *uri, CK_ULONG_PTR n_attrs) { static const CK_ATTRIBUTE terminator = { CKA_INVALID, NULL, 0UL }; return_val_if_fail (uri != NULL, NULL); if (!uri->attrs) { if (n_attrs) *n_attrs = 0; return (CK_ATTRIBUTE_PTR)&terminator; } if (n_attrs) *n_attrs = p11_attrs_count (uri->attrs); return uri->attrs; } int p11_kit_uri_set_attributes (P11KitUri *uri, CK_ATTRIBUTE_PTR attrs, CK_ULONG n_attrs) { CK_ULONG i; int ret; return_val_if_fail (uri != NULL, P11_KIT_URI_UNEXPECTED); p11_kit_uri_clear_attributes (uri); for (i = 0; i < n_attrs; i++) { ret = p11_kit_uri_set_attribute (uri, &attrs[i]); if (ret != P11_KIT_URI_OK && ret != P11_KIT_URI_NOT_FOUND) return ret; } return P11_KIT_URI_OK; } void p11_kit_uri_clear_attributes (P11KitUri *uri) { return_if_fail (uri != NULL); p11_attrs_free (uri->attrs); uri->attrs = NULL; } /** * p11_kit_uri_match_attributes: * @uri: The URI * @attrs: The attributes to match * @n_attrs: The number of attributes * * Match a attributes against the object parts of this URI. * * Only the attributes that are valid for use in a URI will be matched. A URI * part that was not specified in the URI will match any attribute value. If * during the URI parsing any unrecognized parts were encountered then this * match will fail. * * Returns: 1 if the URI matches, 0 if not. */ int p11_kit_uri_match_attributes (P11KitUri *uri, CK_ATTRIBUTE_PTR attrs, CK_ULONG n_attrs) { CK_ATTRIBUTE *attr; CK_ULONG i; return_val_if_fail (uri != NULL, 0); return_val_if_fail (attrs != NULL || n_attrs == 0, 0); if (uri->unrecognized) return 0; for (i = 0; i < n_attrs; i++) { if (attrs[i].type != CKA_CLASS && attrs[i].type != CKA_LABEL && attrs[i].type != CKA_ID) continue; attr = NULL; if (uri->attrs) attr = p11_attrs_find (uri->attrs, attrs[i].type); if (!attr) continue; if (!p11_attr_equal (attr, attrs + i)) return 0; } return 1; } /** * p11_kit_uri_set_unrecognized: * @uri: The URI * @unrecognized: The new unregognized flag value * * Set the unrecognized flag on this URI. * * The unrecognized flag is automatically set to 1 when during parsing any part * of the URI is unrecognized. If the unrecognized flag is set to 1, then * matching against this URI will always fail. */ void p11_kit_uri_set_unrecognized (P11KitUri *uri, int unrecognized) { return_if_fail (uri != NULL); uri->unrecognized = unrecognized ? true : false; } /** * p11_kit_uri_any_unrecognized: * @uri: The URI * * Get the unrecognized flag for this URI. * * The unrecognized flag is automatically set to 1 when during parsing any part * of the URI is unrecognized. If the unrecognized flag is set to 1, then * matching against this URI will always fail. * * Returns: 1 if unrecognized flag is set, 0 otherwise. */ int p11_kit_uri_any_unrecognized (P11KitUri *uri) { return_val_if_fail (uri != NULL, 1); return uri->unrecognized; } /** * p11_kit_uri_get_pin_source: * @uri: The URI * * Get the 'pin-source' part of the URI. This is used by some applications to * lookup a PIN for logging into a PKCS\#11 token. * * Returns: The pin-source or %NULL if not present. */ const char* p11_kit_uri_get_pin_source (P11KitUri *uri) { return_val_if_fail (uri != NULL, NULL); return uri->pin_source; } /** * p11_kit_uri_get_pinfile: * @uri: The URI * * Deprecated: use p11_kit_uri_get_pin_source(). */ const char* p11_kit_uri_get_pinfile (P11KitUri *uri) { return_val_if_fail (uri != NULL, NULL); return p11_kit_uri_get_pin_source (uri); } /** * p11_kit_uri_set_pin_source: * @uri: The URI * @pin_source: The new pin-source * * Set the 'pin-source' part of the URI. This is used by some applications to * lookup a PIN for logging into a PKCS\#11 token. */ void p11_kit_uri_set_pin_source (P11KitUri *uri, const char *pin_source) { return_if_fail (uri != NULL); free (uri->pin_source); uri->pin_source = pin_source ? strdup (pin_source) : NULL; } /** * p11_kit_uri_set_pinfile: * @uri: The URI * @pinfile: The pinfile * * Deprecated: use p11_kit_uri_set_pin_source(). */ void p11_kit_uri_set_pinfile (P11KitUri *uri, const char *pinfile) { return_if_fail (uri != NULL); p11_kit_uri_set_pin_source (uri, pinfile); } /** * p11_kit_uri_new: * * Create a new blank PKCS\#11 URI. * * The new URI is in the right state to parse a string into. All relevant fields * are zeroed out. Formatting this URI will produce a valid but empty URI. * * Returns: A newly allocated URI. This should be freed with p11_kit_uri_free(). */ P11KitUri* p11_kit_uri_new (void) { P11KitUri *uri; uri = calloc (1, sizeof (P11KitUri)); return_val_if_fail (uri != NULL, NULL); /* So that it matches anything */ uri->module.libraryVersion.major = (CK_BYTE)-1; uri->module.libraryVersion.minor = (CK_BYTE)-1; return uri; } static void format_name_equals (p11_buffer *buffer, bool *is_first, const char *name) { if (!*is_first) p11_buffer_add (buffer, ";", 1); p11_buffer_add (buffer, name, -1); p11_buffer_add (buffer, "=", 1); *is_first = false; } static bool format_raw_string (p11_buffer *buffer, bool *is_first, const char *name, const char *value) { /* Not set */ if (!value) return true; format_name_equals (buffer, is_first, name); p11_buffer_add (buffer, value, -1); return p11_buffer_ok (buffer); } static bool format_encode_string (p11_buffer *buffer, bool *is_first, const char *name, const unsigned char *value, size_t n_value, bool force) { /* Not set */ if (!value) return true; format_name_equals (buffer, is_first, name); p11_url_encode (value, value + n_value, force ? "" : P11_URL_VERBATIM, buffer); return p11_buffer_ok (buffer); } static bool format_struct_string (p11_buffer *buffer, bool *is_first, const char *name, const unsigned char *value, size_t value_max) { size_t len; /* Not set */ if (!value[0]) return true; len = p11_kit_space_strlen (value, value_max); return format_encode_string (buffer, is_first, name, value, len, false); } static bool format_attribute_string (p11_buffer *buffer, bool *is_first, const char *name, CK_ATTRIBUTE_PTR attr, bool force) { /* Not set */; if (attr == NULL) return true; return format_encode_string (buffer, is_first, name, attr->pValue, attr->ulValueLen, force); } static bool format_attribute_class (p11_buffer *buffer, bool *is_first, const char *name, CK_ATTRIBUTE_PTR attr) { CK_OBJECT_CLASS klass; const char *value; /* Not set */; if (attr == NULL) return true; klass = *((CK_OBJECT_CLASS*)attr->pValue); switch (klass) { case CKO_DATA: value = "data"; break; case CKO_SECRET_KEY: value = "secret-key"; break; case CKO_CERTIFICATE: value = "cert"; break; case CKO_PUBLIC_KEY: value = "public"; break; case CKO_PRIVATE_KEY: value = "private"; break; default: return true; } return format_raw_string (buffer, is_first, name, value); } static bool format_struct_version (p11_buffer *buffer, bool *is_first, const char *name, CK_VERSION_PTR version) { char buf[64]; /* Not set */ if (version->major == (CK_BYTE)-1 && version->minor == (CK_BYTE)-1) return true; snprintf (buf, sizeof (buf), "%d.%d", (int)version->major, (int)version->minor); return format_raw_string (buffer, is_first, name, buf); } /** * p11_kit_uri_format: * @uri: The URI. * @uri_type: The type of URI that should be produced. * @string: Location to store a newly allocated string. * * Format a PKCS\#11 URI into a string. * * Fields which are zeroed out will not be included in the resulting string. * Attributes which are not present will also not be included. * * The uri_type of URI specified limits the different parts of the resulting * URI. To format a URI containing all possible information use * %P11_KIT_URI_FOR_ANY * * It's up to the caller to guarantee that the attributes set in @uri are * those appropriate for inclusion in a URI, specifically: * CKA_ID, CKA_LABEL * and CKA_CLASS. The class must be one of * CKO_DATA, CKO_SECRET_KEY, * CKO_CERTIFICATE, CKO_PUBLIC_KEY, * CKO_PRIVATE_KEY. * * The resulting string should be freed with free(). * * Returns: %P11_KIT_URI_OK if the URI was formatted successfully, * %P11_KIT_URI_UNEXPECTED if the data in @uri is invalid for a URI. */ int p11_kit_uri_format (P11KitUri *uri, P11KitUriType uri_type, char **string) { p11_buffer buffer; bool is_first = true; return_val_if_fail (uri != NULL, P11_KIT_URI_UNEXPECTED); return_val_if_fail (string != NULL, P11_KIT_URI_UNEXPECTED); if (!p11_buffer_init_null (&buffer, 64)) return_val_if_reached (P11_KIT_URI_UNEXPECTED); p11_buffer_add (&buffer, P11_KIT_URI_SCHEME, P11_KIT_URI_SCHEME_LEN); p11_buffer_add (&buffer, ":", 1); if ((uri_type & P11_KIT_URI_FOR_MODULE) == P11_KIT_URI_FOR_MODULE) { if (!format_struct_string (&buffer, &is_first, "library-description", uri->module.libraryDescription, sizeof (uri->module.libraryDescription)) || !format_struct_string (&buffer, &is_first, "library-manufacturer", uri->module.manufacturerID, sizeof (uri->module.manufacturerID))) { return_val_if_reached (P11_KIT_URI_UNEXPECTED); } } if ((uri_type & P11_KIT_URI_FOR_MODULE_WITH_VERSION) == P11_KIT_URI_FOR_MODULE_WITH_VERSION) { if (!format_struct_version (&buffer, &is_first, "library-version", &uri->module.libraryVersion)) { return_val_if_reached (P11_KIT_URI_UNEXPECTED); } } if ((uri_type & P11_KIT_URI_FOR_TOKEN) == P11_KIT_URI_FOR_TOKEN) { if (!format_struct_string (&buffer, &is_first, "model", uri->token.model, sizeof (uri->token.model)) || !format_struct_string (&buffer, &is_first, "manufacturer", uri->token.manufacturerID, sizeof (uri->token.manufacturerID)) || !format_struct_string (&buffer, &is_first, "serial", uri->token.serialNumber, sizeof (uri->token.serialNumber)) || !format_struct_string (&buffer, &is_first, "token", uri->token.label, sizeof (uri->token.label))) { return_val_if_reached (P11_KIT_URI_UNEXPECTED); } } if ((uri_type & P11_KIT_URI_FOR_OBJECT) == P11_KIT_URI_FOR_OBJECT) { if (!format_attribute_string (&buffer, &is_first, "id", p11_kit_uri_get_attribute (uri, CKA_ID), true) || !format_attribute_string (&buffer, &is_first, "object", p11_kit_uri_get_attribute (uri, CKA_LABEL), false)) { return_val_if_reached (P11_KIT_URI_UNEXPECTED); } if (!format_attribute_class (&buffer, &is_first, "object-type", p11_kit_uri_get_attribute (uri, CKA_CLASS))) { return_val_if_reached (P11_KIT_URI_UNEXPECTED); } } if (uri->pin_source) { if (!format_encode_string (&buffer, &is_first, "pin-source", (const unsigned char*)uri->pin_source, strlen (uri->pin_source), 0)) { return_val_if_reached (P11_KIT_URI_UNEXPECTED); } } return_val_if_fail (p11_buffer_ok (&buffer), P11_KIT_URI_UNEXPECTED); *string = p11_buffer_steal (&buffer, NULL); return P11_KIT_URI_OK; } static int parse_string_attribute (const char *name, const char *start, const char *end, P11KitUri *uri) { unsigned char *value; CK_ATTRIBUTE_TYPE type; size_t length; assert (start <= end); if (strcmp ("id", name) == 0) type = CKA_ID; else if (strcmp ("object", name) == 0) type = CKA_LABEL; else return 0; value = p11_url_decode (start, end, P11_URL_WHITESPACE, &length); if (value == NULL) return P11_KIT_URI_BAD_ENCODING; uri->attrs = p11_attrs_take (uri->attrs, type, value, length); return 1; } static int parse_class_attribute (const char *name, const char *start, const char *end, P11KitUri *uri) { CK_OBJECT_CLASS klass = 0; CK_ATTRIBUTE attr; char *value; assert (start <= end); if (strcmp ("objecttype", name) != 0 && strcmp ("object-type", name) != 0) return 0; value = key_decode (start, end); return_val_if_fail (value != NULL, P11_KIT_URI_UNEXPECTED); if (strcmp (value, "cert") == 0) klass = CKO_CERTIFICATE; else if (strcmp (value, "public") == 0) klass = CKO_PUBLIC_KEY; else if (strcmp (value, "private") == 0) klass = CKO_PRIVATE_KEY; else if (strcmp (value, "secretkey") == 0) klass = CKO_SECRET_KEY; else if (strcmp (value, "secret-key") == 0) klass = CKO_SECRET_KEY; else if (strcmp (value, "data") == 0) klass = CKO_DATA; else { free (value); uri->unrecognized = true; return 1; } free (value); attr.pValue = &klass; attr.ulValueLen = sizeof (klass); attr.type = CKA_CLASS; uri->attrs = p11_attrs_build (uri->attrs, &attr, NULL); return 1; } static int parse_struct_info (unsigned char *where, size_t length, const char *start, const char *end, P11KitUri *uri) { unsigned char *value; size_t value_length; assert (start <= end); value = p11_url_decode (start, end, P11_URL_WHITESPACE, &value_length); if (value == NULL) return P11_KIT_URI_BAD_ENCODING; /* Too long, shouldn't match anything */ if (value_length > length) { free (value); uri->unrecognized = true; return 1; } memset (where, ' ', length); memcpy (where, value, value_length); free (value); return 1; } static int parse_token_info (const char *name, const char *start, const char *end, P11KitUri *uri) { unsigned char *where; size_t length; assert (start <= end); if (strcmp (name, "model") == 0) { where = uri->token.model; length = sizeof (uri->token.model); } else if (strcmp (name, "manufacturer") == 0) { where = uri->token.manufacturerID; length = sizeof (uri->token.manufacturerID); } else if (strcmp (name, "serial") == 0) { where = uri->token.serialNumber; length = sizeof (uri->token.serialNumber); } else if (strcmp (name, "token") == 0) { where = uri->token.label; length = sizeof (uri->token.label); } else { return 0; } return parse_struct_info (where, length, start, end, uri); } static int atoin (const char *start, const char *end) { int ret = 0; while (start != end) { if (strchr (WHITESPACE, *start)) { start++; continue; } if (*start < '0' || *start > '9') return -1; ret *= 10; ret += (*start - '0'); ++start; } return ret; } static int parse_struct_version (const char *start, const char *end, CK_VERSION_PTR version) { const char *dot; int val; assert (start <= end); dot = memchr (start, '.', end - start); if (!dot) dot = end; if (dot == start) return P11_KIT_URI_BAD_VERSION; val = atoin (start, dot); if (val < 0 || val >= 255) return P11_KIT_URI_BAD_VERSION; version->major = (CK_BYTE)val; version->minor = 0; if (dot != end) { if (dot + 1 == end) return P11_KIT_URI_BAD_VERSION; val = atoin (dot + 1, end); if (val < 0 || val >= 255) return P11_KIT_URI_BAD_VERSION; version->minor = (CK_BYTE)val; } return 1; } static int parse_module_version_info (const char *name, const char *start, const char *end, P11KitUri *uri) { assert (start <= end); if (strcmp (name, "library-version") == 0) return parse_struct_version (start, end, &uri->module.libraryVersion); return 0; } static int parse_module_info (const char *name, const char *start, const char *end, P11KitUri *uri) { unsigned char *where; size_t length; assert (start <= end); if (strcmp (name, "library-description") == 0) { where = uri->module.libraryDescription; length = sizeof (uri->module.libraryDescription); } else if (strcmp (name, "library-manufacturer") == 0) { where = uri->module.manufacturerID; length = sizeof (uri->module.manufacturerID); } else { return 0; } return parse_struct_info (where, length, start, end, uri); } static int parse_extra_info (const char *name, const char *start, const char *end, P11KitUri *uri) { unsigned char *pin_source; assert (start <= end); if (strcmp (name, "pinfile") == 0 || strcmp (name, "pin-source") == 0) { pin_source = p11_url_decode (start, end, P11_URL_WHITESPACE, NULL); if (pin_source == NULL) return P11_KIT_URI_BAD_ENCODING; free (uri->pin_source); uri->pin_source = (char*)pin_source; return 1; } return 0; } /** * p11_kit_uri_parse: * @string: The string to parse * @uri_type: The type of URI that is expected * @uri: The blank URI to parse the values into * * Parse a PKCS\#11 URI string. * * PKCS\#11 URIs can represent tokens, objects or modules. The uri_type argument * allows the caller to specify what type of URI is expected and the sorts of * things the URI should match. %P11_KIT_URI_FOR_ANY can be used to parse a URI * for any context. It's then up to the caller to make sense of the way that * it is used. * * If the PKCS\#11 URI contains unrecognized URI parts or parts not applicable * to the specified context, then the unrecognized flag will be set. This will * prevent the URI from matching using the various match functions. * * Returns: %P11_KIT_URI_OK if the URI was parsed successfully. * %P11_KIT_URI_BAD_SCHEME if this was not a PKCS\#11 URI. * %P11_KIT_URI_BAD_SYNTAX if the URI syntax was bad. * %P11_KIT_URI_BAD_VERSION if a version number was bad. * %P11_KIT_URI_BAD_ENCODING if the URI encoding was invalid. */ int p11_kit_uri_parse (const char *string, P11KitUriType uri_type, P11KitUri *uri) { const char *spos, *epos; char *key = NULL; int ret; assert (string); assert (uri); epos = strchr (string, ':'); if (epos == NULL) return P11_KIT_URI_BAD_SCHEME; key = key_decode (string, epos); ret = strcmp (key, P11_KIT_URI_SCHEME); free (key); if (ret != 0) return P11_KIT_URI_BAD_SCHEME; string = epos + 1; /* Clear everything out */ memset (&uri->module, 0, sizeof (uri->module)); memset (&uri->token, 0, sizeof (uri->token)); p11_attrs_free (uri->attrs); uri->attrs = NULL; uri->module.libraryVersion.major = (CK_BYTE)-1; uri->module.libraryVersion.minor = (CK_BYTE)-1; uri->unrecognized = 0; free (uri->pin_source); uri->pin_source = NULL; for (;;) { spos = strchr (string, ';'); if (spos == NULL) { spos = string + strlen (string); assert (*spos == '\0'); if (spos == string) break; } epos = strchr (string, '='); if (epos == NULL || spos == string || epos == string || epos >= spos) return P11_KIT_URI_BAD_SYNTAX; key = key_decode (string, epos); return_val_if_fail (key != NULL, P11_KIT_URI_UNEXPECTED); epos++; ret = 0; if ((uri_type & P11_KIT_URI_FOR_OBJECT) == P11_KIT_URI_FOR_OBJECT) ret = parse_string_attribute (key, epos, spos, uri); if (ret == 0 && (uri_type & P11_KIT_URI_FOR_OBJECT) == P11_KIT_URI_FOR_OBJECT) ret = parse_class_attribute (key, epos, spos, uri); if (ret == 0 && (uri_type & P11_KIT_URI_FOR_TOKEN) == P11_KIT_URI_FOR_TOKEN) ret = parse_token_info (key, epos, spos, uri); if (ret == 0 && (uri_type & P11_KIT_URI_FOR_MODULE) == P11_KIT_URI_FOR_MODULE) ret = parse_module_info (key, epos, spos, uri); if (ret == 0 && (uri_type & P11_KIT_URI_FOR_MODULE_WITH_VERSION) == P11_KIT_URI_FOR_MODULE_WITH_VERSION) ret = parse_module_version_info (key, epos, spos, uri); if (ret == 0) ret = parse_extra_info (key, epos, spos, uri); free (key); if (ret < 0) return ret; if (ret == 0) uri->unrecognized = true; if (*spos == '\0') break; string = spos + 1; } return P11_KIT_URI_OK; } /** * p11_kit_uri_free: * @uri: The URI * * Free a PKCS\#11 URI. */ void p11_kit_uri_free (P11KitUri *uri) { if (!uri) return; p11_attrs_free (uri->attrs); free (uri->pin_source); free (uri); } /** * p11_kit_uri_message: * @code: The error code * * Lookup a message for the uri error code. These codes are the P11_KIT_URI_XXX * error codes that can be returned from p11_kit_uri_parse() or * p11_kit_uri_format(). As a special case %NULL, will be returned for * %P11_KIT_URI_OK. * * Returns: The message for the error code. This string is owned by the p11-kit * library. */ const char* p11_kit_uri_message (int code) { switch (code) { case P11_KIT_URI_OK: return NULL; case P11_KIT_URI_UNEXPECTED: return "Unexpected or internal system error"; case P11_KIT_URI_BAD_SCHEME: return "URI scheme must be 'pkcs11:'"; case P11_KIT_URI_BAD_ENCODING: return "URI encoding invalid or corrupted"; case P11_KIT_URI_BAD_SYNTAX: return "URI syntax is invalid"; case P11_KIT_URI_BAD_VERSION: return "URI version component is invalid"; case P11_KIT_URI_NOT_FOUND: return "The URI component was not found"; default: p11_debug ("unknown error code: %d", code); return "Unknown error"; } } p11-kit-0.20.2/p11-kit/p11-kit-1.pc.in0000664000175000017500000000133312144374545013360 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ datadir=@datadir@ pkgdatadir=@datadir@/p11-kit sysconfdir=@sysconfdir@ p11_module_configs=@p11_package_config_modules@ p11_module_path=@p11_module_path@ proxy_module=@libdir@/p11-kit-proxy.so # This is for compatibility. Other packages were using this to determine # the directory they should install their module configs to, so override # this and redirect them to the new location p11_system_config_modules=@p11_package_config_modules@ Name: p11-kit Description: Library and proxy module for properly loading and sharing PKCS#11 modules. Version: @VERSION@ Libs: -L${libdir} -lp11-kit Cflags: -I${includedir}/p11-kit-1 p11-kit-0.20.2/p11-kit/Makefile.in0000664000175000017500000017741712265245664013174 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/build/Makefile.decl $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(srcdir)/p11-kit-1.pc.in \ $(srcdir)/pkcs11.conf.example.in \ $(top_srcdir)/build/aux/depcomp $(inc_HEADERS) bin_PROGRAMS = p11-kit$(EXEEXT) subdir = p11-kit ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/gettext.m4 \ $(top_srcdir)/build/m4/iconv.m4 \ $(top_srcdir)/build/m4/lib-ld.m4 \ $(top_srcdir)/build/m4/lib-link.m4 \ $(top_srcdir)/build/m4/lib-prefix.m4 \ $(top_srcdir)/build/m4/libtool.m4 \ $(top_srcdir)/build/m4/ltoptions.m4 \ $(top_srcdir)/build/m4/ltsugar.m4 \ $(top_srcdir)/build/m4/ltversion.m4 \ $(top_srcdir)/build/m4/lt~obsolete.m4 \ $(top_srcdir)/build/m4/nls.m4 $(top_srcdir)/build/m4/po.m4 \ $(top_srcdir)/build/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = p11-kit-1.pc pkcs11.conf.example CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(incdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(top_builddir)/common/libp11-common.la \ $(top_builddir)/common/libp11-library.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) libp11_kit_testable_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am__objects_1 = am__objects_2 = $(am__objects_1) am__objects_3 = libp11_kit_testable_la-util.lo \ libp11_kit_testable_la-conf.lo libp11_kit_testable_la-iter.lo \ libp11_kit_testable_la-log.lo \ libp11_kit_testable_la-modules.lo \ libp11_kit_testable_la-pin.lo libp11_kit_testable_la-proxy.lo \ libp11_kit_testable_la-messages.lo \ libp11_kit_testable_la-uri.lo \ libp11_kit_testable_la-virtual.lo $(am__objects_2) am_libp11_kit_testable_la_OBJECTS = $(am__objects_3) libp11_kit_testable_la_OBJECTS = $(am_libp11_kit_testable_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libp11_kit_testable_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) \ $(libp11_kit_testable_la_LDFLAGS) $(LDFLAGS) -o $@ libp11_kit_la_DEPENDENCIES = $(top_builddir)/common/libp11-common.la \ $(top_builddir)/common/libp11-library.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__objects_4 = libp11_kit_la-util.lo libp11_kit_la-conf.lo \ libp11_kit_la-iter.lo libp11_kit_la-log.lo \ libp11_kit_la-modules.lo libp11_kit_la-pin.lo \ libp11_kit_la-proxy.lo libp11_kit_la-messages.lo \ libp11_kit_la-uri.lo libp11_kit_la-virtual.lo $(am__objects_2) am_libp11_kit_la_OBJECTS = $(am__objects_4) libp11_kit_la_OBJECTS = $(am_libp11_kit_la_OBJECTS) libp11_kit_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libp11_kit_la_CFLAGS) \ $(CFLAGS) $(libp11_kit_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(bin_PROGRAMS) am_p11_kit_OBJECTS = p11_kit-lists.$(OBJEXT) p11_kit-p11-kit.$(OBJEXT) \ $(am__objects_1) p11_kit_OBJECTS = $(am_p11_kit_OBJECTS) p11_kit_DEPENDENCIES = libp11-kit.la \ $(top_builddir)/common/libp11-tool.la \ $(top_builddir)/common/libp11-common.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) p11_kit_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(p11_kit_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libp11_kit_testable_la_SOURCES) $(libp11_kit_la_SOURCES) \ $(p11_kit_SOURCES) DIST_SOURCES = $(libp11_kit_testable_la_SOURCES) \ $(libp11_kit_la_SOURCES) $(p11_kit_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(example_DATA) $(pkgconfig_DATA) HEADERS = $(inc_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTKDOC_SCAN = @GTKDOC_SCAN@ HASH_LIBS = @HASH_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_CFLAGS = @LIBFFI_CFLAGS@ LIBFFI_LIBS = @LIBFFI_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTASN1_CFLAGS = @LIBTASN1_CFLAGS@ LIBTASN1_LIBS = @LIBTASN1_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P11KIT_LT_RELEASE = @P11KIT_LT_RELEASE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLEXT = @SHLEXT@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ p11_module_path = @p11_module_path@ p11_package_config_modules = @p11_package_config_modules@ p11_system_config = @p11_system_config@ p11_system_config_file = @p11_system_config_file@ p11_system_config_modules = @p11_system_config_modules@ p11_user_config = @p11_user_config@ p11_user_config_file = @p11_user_config_file@ p11_user_config_modules = @p11_user_config_modules@ pdfdir = @pdfdir@ prefix = @prefix@ privatedir = @privatedir@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_trust_paths = @with_trust_paths@ NULL = SUBDIRS = . tests COMMON = $(top_srcdir)/common AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(COMMON) \ -DSRCDIR=\"$(srcdir)\" \ -DBINDIR=\"$(bindir)\" \ -DPRIVATEDIR=\"$(privatedir)\" \ -DP11_KIT_FUTURE_UNSTABLE_API \ $(NULL) incdir = $(includedir)/p11-kit-1/p11-kit inc_HEADERS = \ deprecated.h \ iter.h \ p11-kit.h \ pin.h \ uri.h \ $(NULL) MODULE_SRCS = \ util.c \ conf.c conf.h \ iter.c \ log.c log.h \ modules.c modules.h \ pkcs11.h \ pin.c \ pkcs11.h \ proxy.c proxy.h \ private.h \ messages.c \ uri.c \ virtual.c virtual.h \ $(inc_HEADERS) lib_LTLIBRARIES = \ libp11-kit.la libp11_kit_la_CFLAGS = \ -DP11_SYSTEM_CONFIG_FILE=\""$(p11_system_config_file)"\" \ -DP11_SYSTEM_CONFIG_MODULES=\""$(p11_system_config_modules)"\" \ -DP11_PACKAGE_CONFIG_MODULES=\""$(p11_package_config_modules)"\" \ -DP11_USER_CONFIG_FILE=\""$(p11_user_config_file)"\" \ -DP11_USER_CONFIG_MODULES=\""$(p11_user_config_modules)"\" \ -DP11_MODULE_PATH=\""$(p11_module_path)"\" \ $(LIBFFI_CFLAGS) \ $(NULL) libp11_kit_la_LDFLAGS = \ -no-undefined \ -version-info $(P11KIT_LT_RELEASE) \ -export-symbols-regex '^C_GetFunctionList|^p11_kit_' libp11_kit_la_SOURCES = $(MODULE_SRCS) libp11_kit_la_LIBADD = \ $(top_builddir)/common/libp11-common.la \ $(top_builddir)/common/libp11-library.la \ $(LIBFFI_LIBS) \ $(LTLIBINTL) \ $(NULL) noinst_LTLIBRARIES = \ libp11-kit-testable.la libp11_kit_testable_la_LDFLAGS = -no-undefined libp11_kit_testable_la_SOURCES = $(MODULE_SRCS) libp11_kit_testable_la_LIBADD = $(libp11_kit_la_LIBADD) @OS_WIN32_FALSE@libp11_kit_testable_la_CFLAGS = \ @OS_WIN32_FALSE@ -DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/system-pkcs11.conf"\" \ @OS_WIN32_FALSE@ -DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/system-modules"\" \ @OS_WIN32_FALSE@ -DP11_PACKAGE_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/package-modules"\" \ @OS_WIN32_FALSE@ -DP11_USER_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/user-pkcs11.conf"\" \ @OS_WIN32_FALSE@ -DP11_USER_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/user-modules"\" \ @OS_WIN32_FALSE@ -DP11_MODULE_PATH=\""$(abs_top_builddir)/p11-kit/tests/.libs"\" \ @OS_WIN32_FALSE@ $(LIBFFI_CFLAGS) \ @OS_WIN32_FALSE@ $(NULL) @OS_WIN32_TRUE@libp11_kit_testable_la_CFLAGS = \ @OS_WIN32_TRUE@ -DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/system-pkcs11.conf"\" \ @OS_WIN32_TRUE@ -DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/system-modules/win32"\" \ @OS_WIN32_TRUE@ -DP11_PACKAGE_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/package-modules/win32"\" \ @OS_WIN32_TRUE@ -DP11_USER_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/user-pkcs11.conf"\" \ @OS_WIN32_TRUE@ -DP11_USER_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/user-modules/win32"\" \ @OS_WIN32_TRUE@ -DP11_MODULE_PATH=\""$(abs_top_builddir)/p11-kit/tests/.libs"\" \ @OS_WIN32_TRUE@ $(LIBFFI_CFLAGS) \ @OS_WIN32_TRUE@ $(NULL) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = p11-kit-1.pc exampledir = $(p11_system_config) example_DATA = pkcs11.conf.example EXTRA_DIST = \ p11-kit-1.pc.in \ pkcs11.conf.example.in \ docs.h \ $(NULL) p11_kit_SOURCES = \ lists.c \ p11-kit.c \ $(NULL) p11_kit_CFLAGS = \ $(NULL) p11_kit_LDADD = \ libp11-kit.la \ $(top_builddir)/common/libp11-tool.la \ $(top_builddir)/common/libp11-common.la \ $(LTLIBINTL) \ $(NULL) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/build/Makefile.decl $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign p11-kit/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign p11-kit/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/build/Makefile.decl: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): p11-kit-1.pc: $(top_builddir)/config.status $(srcdir)/p11-kit-1.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ pkcs11.conf.example: $(top_builddir)/config.status $(srcdir)/pkcs11.conf.example.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libp11-kit-testable.la: $(libp11_kit_testable_la_OBJECTS) $(libp11_kit_testable_la_DEPENDENCIES) $(EXTRA_libp11_kit_testable_la_DEPENDENCIES) $(AM_V_CCLD)$(libp11_kit_testable_la_LINK) $(libp11_kit_testable_la_OBJECTS) $(libp11_kit_testable_la_LIBADD) $(LIBS) libp11-kit.la: $(libp11_kit_la_OBJECTS) $(libp11_kit_la_DEPENDENCIES) $(EXTRA_libp11_kit_la_DEPENDENCIES) $(AM_V_CCLD)$(libp11_kit_la_LINK) -rpath $(libdir) $(libp11_kit_la_OBJECTS) $(libp11_kit_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list p11-kit$(EXEEXT): $(p11_kit_OBJECTS) $(p11_kit_DEPENDENCIES) $(EXTRA_p11_kit_DEPENDENCIES) @rm -f p11-kit$(EXEEXT) $(AM_V_CCLD)$(p11_kit_LINK) $(p11_kit_OBJECTS) $(p11_kit_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_la-conf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_la-iter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_la-log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_la-messages.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_la-modules.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_la-pin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_la-proxy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_la-uri.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_la-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_la-virtual.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_testable_la-conf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_testable_la-iter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_testable_la-log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_testable_la-messages.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_testable_la-modules.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_testable_la-pin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_testable_la-proxy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_testable_la-uri.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_testable_la-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libp11_kit_testable_la-virtual.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p11_kit-lists.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p11_kit-p11-kit.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libp11_kit_testable_la-util.lo: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -MT libp11_kit_testable_la-util.lo -MD -MP -MF $(DEPDIR)/libp11_kit_testable_la-util.Tpo -c -o libp11_kit_testable_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_testable_la-util.Tpo $(DEPDIR)/libp11_kit_testable_la-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='libp11_kit_testable_la-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_testable_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c libp11_kit_testable_la-conf.lo: conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -MT libp11_kit_testable_la-conf.lo -MD -MP -MF $(DEPDIR)/libp11_kit_testable_la-conf.Tpo -c -o libp11_kit_testable_la-conf.lo `test -f 'conf.c' || echo '$(srcdir)/'`conf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_testable_la-conf.Tpo $(DEPDIR)/libp11_kit_testable_la-conf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conf.c' object='libp11_kit_testable_la-conf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_testable_la-conf.lo `test -f 'conf.c' || echo '$(srcdir)/'`conf.c libp11_kit_testable_la-iter.lo: iter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -MT libp11_kit_testable_la-iter.lo -MD -MP -MF $(DEPDIR)/libp11_kit_testable_la-iter.Tpo -c -o libp11_kit_testable_la-iter.lo `test -f 'iter.c' || echo '$(srcdir)/'`iter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_testable_la-iter.Tpo $(DEPDIR)/libp11_kit_testable_la-iter.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iter.c' object='libp11_kit_testable_la-iter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_testable_la-iter.lo `test -f 'iter.c' || echo '$(srcdir)/'`iter.c libp11_kit_testable_la-log.lo: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -MT libp11_kit_testable_la-log.lo -MD -MP -MF $(DEPDIR)/libp11_kit_testable_la-log.Tpo -c -o libp11_kit_testable_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_testable_la-log.Tpo $(DEPDIR)/libp11_kit_testable_la-log.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='libp11_kit_testable_la-log.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_testable_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c libp11_kit_testable_la-modules.lo: modules.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -MT libp11_kit_testable_la-modules.lo -MD -MP -MF $(DEPDIR)/libp11_kit_testable_la-modules.Tpo -c -o libp11_kit_testable_la-modules.lo `test -f 'modules.c' || echo '$(srcdir)/'`modules.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_testable_la-modules.Tpo $(DEPDIR)/libp11_kit_testable_la-modules.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='modules.c' object='libp11_kit_testable_la-modules.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_testable_la-modules.lo `test -f 'modules.c' || echo '$(srcdir)/'`modules.c libp11_kit_testable_la-pin.lo: pin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -MT libp11_kit_testable_la-pin.lo -MD -MP -MF $(DEPDIR)/libp11_kit_testable_la-pin.Tpo -c -o libp11_kit_testable_la-pin.lo `test -f 'pin.c' || echo '$(srcdir)/'`pin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_testable_la-pin.Tpo $(DEPDIR)/libp11_kit_testable_la-pin.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pin.c' object='libp11_kit_testable_la-pin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_testable_la-pin.lo `test -f 'pin.c' || echo '$(srcdir)/'`pin.c libp11_kit_testable_la-proxy.lo: proxy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -MT libp11_kit_testable_la-proxy.lo -MD -MP -MF $(DEPDIR)/libp11_kit_testable_la-proxy.Tpo -c -o libp11_kit_testable_la-proxy.lo `test -f 'proxy.c' || echo '$(srcdir)/'`proxy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_testable_la-proxy.Tpo $(DEPDIR)/libp11_kit_testable_la-proxy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='proxy.c' object='libp11_kit_testable_la-proxy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_testable_la-proxy.lo `test -f 'proxy.c' || echo '$(srcdir)/'`proxy.c libp11_kit_testable_la-messages.lo: messages.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -MT libp11_kit_testable_la-messages.lo -MD -MP -MF $(DEPDIR)/libp11_kit_testable_la-messages.Tpo -c -o libp11_kit_testable_la-messages.lo `test -f 'messages.c' || echo '$(srcdir)/'`messages.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_testable_la-messages.Tpo $(DEPDIR)/libp11_kit_testable_la-messages.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='messages.c' object='libp11_kit_testable_la-messages.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_testable_la-messages.lo `test -f 'messages.c' || echo '$(srcdir)/'`messages.c libp11_kit_testable_la-uri.lo: uri.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -MT libp11_kit_testable_la-uri.lo -MD -MP -MF $(DEPDIR)/libp11_kit_testable_la-uri.Tpo -c -o libp11_kit_testable_la-uri.lo `test -f 'uri.c' || echo '$(srcdir)/'`uri.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_testable_la-uri.Tpo $(DEPDIR)/libp11_kit_testable_la-uri.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uri.c' object='libp11_kit_testable_la-uri.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_testable_la-uri.lo `test -f 'uri.c' || echo '$(srcdir)/'`uri.c libp11_kit_testable_la-virtual.lo: virtual.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -MT libp11_kit_testable_la-virtual.lo -MD -MP -MF $(DEPDIR)/libp11_kit_testable_la-virtual.Tpo -c -o libp11_kit_testable_la-virtual.lo `test -f 'virtual.c' || echo '$(srcdir)/'`virtual.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_testable_la-virtual.Tpo $(DEPDIR)/libp11_kit_testable_la-virtual.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='virtual.c' object='libp11_kit_testable_la-virtual.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_testable_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_testable_la-virtual.lo `test -f 'virtual.c' || echo '$(srcdir)/'`virtual.c libp11_kit_la-util.lo: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -MT libp11_kit_la-util.lo -MD -MP -MF $(DEPDIR)/libp11_kit_la-util.Tpo -c -o libp11_kit_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_la-util.Tpo $(DEPDIR)/libp11_kit_la-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='libp11_kit_la-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c libp11_kit_la-conf.lo: conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -MT libp11_kit_la-conf.lo -MD -MP -MF $(DEPDIR)/libp11_kit_la-conf.Tpo -c -o libp11_kit_la-conf.lo `test -f 'conf.c' || echo '$(srcdir)/'`conf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_la-conf.Tpo $(DEPDIR)/libp11_kit_la-conf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conf.c' object='libp11_kit_la-conf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_la-conf.lo `test -f 'conf.c' || echo '$(srcdir)/'`conf.c libp11_kit_la-iter.lo: iter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -MT libp11_kit_la-iter.lo -MD -MP -MF $(DEPDIR)/libp11_kit_la-iter.Tpo -c -o libp11_kit_la-iter.lo `test -f 'iter.c' || echo '$(srcdir)/'`iter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_la-iter.Tpo $(DEPDIR)/libp11_kit_la-iter.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='iter.c' object='libp11_kit_la-iter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_la-iter.lo `test -f 'iter.c' || echo '$(srcdir)/'`iter.c libp11_kit_la-log.lo: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -MT libp11_kit_la-log.lo -MD -MP -MF $(DEPDIR)/libp11_kit_la-log.Tpo -c -o libp11_kit_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_la-log.Tpo $(DEPDIR)/libp11_kit_la-log.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='libp11_kit_la-log.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c libp11_kit_la-modules.lo: modules.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -MT libp11_kit_la-modules.lo -MD -MP -MF $(DEPDIR)/libp11_kit_la-modules.Tpo -c -o libp11_kit_la-modules.lo `test -f 'modules.c' || echo '$(srcdir)/'`modules.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_la-modules.Tpo $(DEPDIR)/libp11_kit_la-modules.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='modules.c' object='libp11_kit_la-modules.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_la-modules.lo `test -f 'modules.c' || echo '$(srcdir)/'`modules.c libp11_kit_la-pin.lo: pin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -MT libp11_kit_la-pin.lo -MD -MP -MF $(DEPDIR)/libp11_kit_la-pin.Tpo -c -o libp11_kit_la-pin.lo `test -f 'pin.c' || echo '$(srcdir)/'`pin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_la-pin.Tpo $(DEPDIR)/libp11_kit_la-pin.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pin.c' object='libp11_kit_la-pin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_la-pin.lo `test -f 'pin.c' || echo '$(srcdir)/'`pin.c libp11_kit_la-proxy.lo: proxy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -MT libp11_kit_la-proxy.lo -MD -MP -MF $(DEPDIR)/libp11_kit_la-proxy.Tpo -c -o libp11_kit_la-proxy.lo `test -f 'proxy.c' || echo '$(srcdir)/'`proxy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_la-proxy.Tpo $(DEPDIR)/libp11_kit_la-proxy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='proxy.c' object='libp11_kit_la-proxy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_la-proxy.lo `test -f 'proxy.c' || echo '$(srcdir)/'`proxy.c libp11_kit_la-messages.lo: messages.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -MT libp11_kit_la-messages.lo -MD -MP -MF $(DEPDIR)/libp11_kit_la-messages.Tpo -c -o libp11_kit_la-messages.lo `test -f 'messages.c' || echo '$(srcdir)/'`messages.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_la-messages.Tpo $(DEPDIR)/libp11_kit_la-messages.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='messages.c' object='libp11_kit_la-messages.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_la-messages.lo `test -f 'messages.c' || echo '$(srcdir)/'`messages.c libp11_kit_la-uri.lo: uri.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -MT libp11_kit_la-uri.lo -MD -MP -MF $(DEPDIR)/libp11_kit_la-uri.Tpo -c -o libp11_kit_la-uri.lo `test -f 'uri.c' || echo '$(srcdir)/'`uri.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_la-uri.Tpo $(DEPDIR)/libp11_kit_la-uri.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uri.c' object='libp11_kit_la-uri.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_la-uri.lo `test -f 'uri.c' || echo '$(srcdir)/'`uri.c libp11_kit_la-virtual.lo: virtual.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -MT libp11_kit_la-virtual.lo -MD -MP -MF $(DEPDIR)/libp11_kit_la-virtual.Tpo -c -o libp11_kit_la-virtual.lo `test -f 'virtual.c' || echo '$(srcdir)/'`virtual.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libp11_kit_la-virtual.Tpo $(DEPDIR)/libp11_kit_la-virtual.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='virtual.c' object='libp11_kit_la-virtual.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libp11_kit_la_CFLAGS) $(CFLAGS) -c -o libp11_kit_la-virtual.lo `test -f 'virtual.c' || echo '$(srcdir)/'`virtual.c p11_kit-lists.o: lists.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_CFLAGS) $(CFLAGS) -MT p11_kit-lists.o -MD -MP -MF $(DEPDIR)/p11_kit-lists.Tpo -c -o p11_kit-lists.o `test -f 'lists.c' || echo '$(srcdir)/'`lists.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit-lists.Tpo $(DEPDIR)/p11_kit-lists.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lists.c' object='p11_kit-lists.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_CFLAGS) $(CFLAGS) -c -o p11_kit-lists.o `test -f 'lists.c' || echo '$(srcdir)/'`lists.c p11_kit-lists.obj: lists.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_CFLAGS) $(CFLAGS) -MT p11_kit-lists.obj -MD -MP -MF $(DEPDIR)/p11_kit-lists.Tpo -c -o p11_kit-lists.obj `if test -f 'lists.c'; then $(CYGPATH_W) 'lists.c'; else $(CYGPATH_W) '$(srcdir)/lists.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit-lists.Tpo $(DEPDIR)/p11_kit-lists.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lists.c' object='p11_kit-lists.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_CFLAGS) $(CFLAGS) -c -o p11_kit-lists.obj `if test -f 'lists.c'; then $(CYGPATH_W) 'lists.c'; else $(CYGPATH_W) '$(srcdir)/lists.c'; fi` p11_kit-p11-kit.o: p11-kit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_CFLAGS) $(CFLAGS) -MT p11_kit-p11-kit.o -MD -MP -MF $(DEPDIR)/p11_kit-p11-kit.Tpo -c -o p11_kit-p11-kit.o `test -f 'p11-kit.c' || echo '$(srcdir)/'`p11-kit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit-p11-kit.Tpo $(DEPDIR)/p11_kit-p11-kit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='p11-kit.c' object='p11_kit-p11-kit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_CFLAGS) $(CFLAGS) -c -o p11_kit-p11-kit.o `test -f 'p11-kit.c' || echo '$(srcdir)/'`p11-kit.c p11_kit-p11-kit.obj: p11-kit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_CFLAGS) $(CFLAGS) -MT p11_kit-p11-kit.obj -MD -MP -MF $(DEPDIR)/p11_kit-p11-kit.Tpo -c -o p11_kit-p11-kit.obj `if test -f 'p11-kit.c'; then $(CYGPATH_W) 'p11-kit.c'; else $(CYGPATH_W) '$(srcdir)/p11-kit.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/p11_kit-p11-kit.Tpo $(DEPDIR)/p11_kit-p11-kit.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='p11-kit.c' object='p11_kit-p11-kit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(p11_kit_CFLAGS) $(CFLAGS) -c -o p11_kit-p11-kit.obj `if test -f 'p11-kit.c'; then $(CYGPATH_W) 'p11-kit.c'; else $(CYGPATH_W) '$(srcdir)/p11-kit.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-exampleDATA: $(example_DATA) @$(NORMAL_INSTALL) @list='$(example_DATA)'; test -n "$(exampledir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(exampledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(exampledir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(exampledir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(exampledir)" || exit $$?; \ done uninstall-exampleDATA: @$(NORMAL_UNINSTALL) @list='$(example_DATA)'; test -n "$(exampledir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(exampledir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-incHEADERS: $(inc_HEADERS) @$(NORMAL_INSTALL) @list='$(inc_HEADERS)'; test -n "$(incdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(incdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(incdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(incdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(incdir)" || exit $$?; \ done uninstall-incHEADERS: @$(NORMAL_UNINSTALL) @list='$(inc_HEADERS)'; test -n "$(incdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(incdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(incdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-exampleDATA install-incHEADERS \ install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-exampleDATA \ uninstall-incHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) install-am install-exec-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exampleDATA install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-incHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-exampleDATA \ uninstall-incHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA memcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir memcheck; \ done leakcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir leakcheck; \ done hellcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir hellcheck; \ done # Proxy module is actually same as library, so install a link install-exec-hook: $(LN_S) -f `readlink $(DESTDIR)$(libdir)/libp11-kit.so` $(DESTDIR)$(libdir)/p11-kit-proxy.so $(MKDIR_P) $(DESTDIR)$(p11_package_config_modules) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: p11-kit-0.20.2/p11-kit/private.h0000664000175000017500000000505612226763526012736 00000000000000/* * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef __P11_KIT_PRIVATE_H__ #define __P11_KIT_PRIVATE_H__ #include "compat.h" #include "pkcs11.h" CK_RV _p11_load_config_files_unlocked (const char *system_conf, const char *user_conf, int *user_mode); void _p11_kit_default_message (CK_RV rv); const char * _p11_get_progname_unlocked (void); void _p11_set_progname_unlocked (const char *progname); int p11_match_uri_module_info (CK_INFO_PTR one, CK_INFO_PTR two); int p11_match_uri_token_info (CK_TOKEN_INFO_PTR one, CK_TOKEN_INFO_PTR two); #endif /* __P11_KIT_PRIVATE_H__ */ p11-kit-0.20.2/p11-kit/log.h0000664000175000017500000000376712226763526012054 00000000000000/* * Copyright (c) 2013, Red Hat Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * * CONTRIBUTORS * Stef Walter */ #ifndef P11_LOG_H_ #define P11_LOG_H_ #include "virtual.h" p11_virtual * p11_log_subclass (p11_virtual *lower, p11_destroyer destroyer); void p11_log_release (void *logger); extern bool p11_log_force; extern bool p11_log_output; #endif /* P11_LOG_H_ */ p11-kit-0.20.2/p11-kit/Makefile.am0000664000175000017500000000664612226763526013155 00000000000000 include $(top_srcdir)/build/Makefile.decl SUBDIRS = . tests COMMON = $(top_srcdir)/common AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(COMMON) \ -DSRCDIR=\"$(srcdir)\" \ -DBINDIR=\"$(bindir)\" \ -DPRIVATEDIR=\"$(privatedir)\" \ -DP11_KIT_FUTURE_UNSTABLE_API \ $(NULL) incdir = $(includedir)/p11-kit-1/p11-kit inc_HEADERS = \ deprecated.h \ iter.h \ p11-kit.h \ pin.h \ uri.h \ $(NULL) MODULE_SRCS = \ util.c \ conf.c conf.h \ iter.c \ log.c log.h \ modules.c modules.h \ pkcs11.h \ pin.c \ pkcs11.h \ proxy.c proxy.h \ private.h \ messages.c \ uri.c \ virtual.c virtual.h \ $(inc_HEADERS) lib_LTLIBRARIES = \ libp11-kit.la libp11_kit_la_CFLAGS = \ -DP11_SYSTEM_CONFIG_FILE=\""$(p11_system_config_file)"\" \ -DP11_SYSTEM_CONFIG_MODULES=\""$(p11_system_config_modules)"\" \ -DP11_PACKAGE_CONFIG_MODULES=\""$(p11_package_config_modules)"\" \ -DP11_USER_CONFIG_FILE=\""$(p11_user_config_file)"\" \ -DP11_USER_CONFIG_MODULES=\""$(p11_user_config_modules)"\" \ -DP11_MODULE_PATH=\""$(p11_module_path)"\" \ $(LIBFFI_CFLAGS) \ $(NULL) libp11_kit_la_LDFLAGS = \ -no-undefined \ -version-info $(P11KIT_LT_RELEASE) \ -export-symbols-regex '^C_GetFunctionList|^p11_kit_' libp11_kit_la_SOURCES = $(MODULE_SRCS) libp11_kit_la_LIBADD = \ $(top_builddir)/common/libp11-common.la \ $(top_builddir)/common/libp11-library.la \ $(LIBFFI_LIBS) \ $(LTLIBINTL) \ $(NULL) noinst_LTLIBRARIES = \ libp11-kit-testable.la libp11_kit_testable_la_LDFLAGS = -no-undefined libp11_kit_testable_la_SOURCES = $(MODULE_SRCS) libp11_kit_testable_la_LIBADD = $(libp11_kit_la_LIBADD) if OS_WIN32 libp11_kit_testable_la_CFLAGS = \ -DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/system-pkcs11.conf"\" \ -DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/system-modules/win32"\" \ -DP11_PACKAGE_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/package-modules/win32"\" \ -DP11_USER_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/user-pkcs11.conf"\" \ -DP11_USER_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/user-modules/win32"\" \ -DP11_MODULE_PATH=\""$(abs_top_builddir)/p11-kit/tests/.libs"\" \ $(LIBFFI_CFLAGS) \ $(NULL) else libp11_kit_testable_la_CFLAGS = \ -DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/system-pkcs11.conf"\" \ -DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/system-modules"\" \ -DP11_PACKAGE_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/package-modules"\" \ -DP11_USER_CONFIG_FILE=\""$(abs_top_srcdir)/p11-kit/tests/files/user-pkcs11.conf"\" \ -DP11_USER_CONFIG_MODULES=\""$(abs_top_srcdir)/p11-kit/tests/files/user-modules"\" \ -DP11_MODULE_PATH=\""$(abs_top_builddir)/p11-kit/tests/.libs"\" \ $(LIBFFI_CFLAGS) \ $(NULL) endif pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = p11-kit-1.pc exampledir = $(p11_system_config) example_DATA = pkcs11.conf.example EXTRA_DIST = \ p11-kit-1.pc.in \ pkcs11.conf.example.in \ docs.h \ $(NULL) # Proxy module is actually same as library, so install a link install-exec-hook: $(LN_S) -f `readlink $(DESTDIR)$(libdir)/libp11-kit.so` $(DESTDIR)$(libdir)/p11-kit-proxy.so $(MKDIR_P) $(DESTDIR)$(p11_package_config_modules) bin_PROGRAMS = \ p11-kit p11_kit_SOURCES = \ lists.c \ p11-kit.c \ $(NULL) p11_kit_CFLAGS = \ $(NULL) p11_kit_LDADD = \ libp11-kit.la \ $(top_builddir)/common/libp11-tool.la \ $(top_builddir)/common/libp11-common.la \ $(LTLIBINTL) \ $(NULL) p11-kit-0.20.2/p11-kit/modules.c0000664000175000017500000020660212226763526012727 00000000000000/* * Copyright (C) 2008 Stefan Walter * Copyright (C) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" /* We use and define deprecated functions here */ #define P11_KIT_NO_DEPRECATIONS #define P11_DEBUG_FLAG P11_DEBUG_LIB #include "conf.h" #include "debug.h" #include "dict.h" #include "library.h" #include "log.h" #include "message.h" #include "modules.h" #include "path.h" #include "pkcs11.h" #include "p11-kit.h" #include "private.h" #include "proxy.h" #include "virtual.h" #include #include #include #include #include #include #include #include #include #include #include #include #include /** * SECTION:p11-kit * @title: Modules * @short_description: Module loading and initializing * * PKCS\#11 modules are used by crypto libraries and applications to access * crypto objects (like keys and certificates) and to perform crypto operations. * * In order for applications to behave consistently with regard to the user's * installed PKCS\#11 modules, each module must be configured so that applications * or libraries know that they should load it. * * When multiple consumers of a module (such as libraries or applications) are * in the same process, coordination of the initialization and finalization * of PKCS\#11 modules is required. To do this modules are managed by p11-kit. * This means that various unsafe methods are coordinated between callers. Unmanaged * modules are simply the raw PKCS\#11 module pointers without p11-kit getting in the * way. It is highly recommended that the default managed behavior is used. * * The functions here provide support for initializing configured modules. The * p11_kit_modules_load() function should be used to load and initialize * the configured modules. When done, the p11_kit_modules_release() function * should be used to release those modules and associated resources. * * In addition p11_kit_config_option() can be used to access other parts * of the module configuration. * * If a consumer wishes to load an arbitrary PKCS\#11 module that's not * configured use p11_kit_module_load() to do so. And use p11_kit_module_release() * to later release it. * * Modules are represented by a pointer to their CK_FUNCTION_LIST * entry points. */ /** * SECTION:p11-kit-deprecated * @title: Deprecated * @short_description: Deprecated functions * * These functions have been deprecated from p11-kit and are not recommended for * general usage. In large part they were deprecated because they did not adequately * insulate multiple callers of a PKCS\#11 module from another, and could not * support the 'managed' mode needed to do this. */ /** * P11_KIT_MODULE_UNMANAGED: * * Module is loaded in non 'managed' mode. This is not recommended, * disables many features, and prevents coordination between multiple * callers of the same module. */ /** * P11_KIT_MODULE_CRITICAL: * * Flag to load a module in 'critical' mode. Failure to load a critical module * will prevent all other modules from loading. A failure when loading a * non-critical module skips that module. */ typedef struct _Module { /* * When using managed modules, this forms the base of the * virtual stack into which all the other modules call. This is also * the first field in this structure so we can cast between them. */ p11_virtual virt; /* The initialize args built from configuration */ CK_C_INITIALIZE_ARGS init_args; int ref_count; int init_count; /* Registered modules */ char *name; p11_dict *config; bool critical; /* * This is a pointer to the actual dl shared module, or perhaps * the RPC client context. */ void *loaded_module; p11_kit_destroyer loaded_destroy; /* Initialization, mutex must be held */ p11_mutex_t initialize_mutex; bool initialize_called; p11_thread_id_t initialize_thread; } Module; /* * Shared data between threads, protected by the mutex, a structure so * we can audit thread safety easier. */ static struct _Shared { p11_dict *modules; p11_dict *unmanaged_by_funcs; p11_dict *managed_by_closure; p11_dict *config; } gl = { NULL, NULL }; /* ----------------------------------------------------------------------------- * P11-KIT FUNCTIONALITY */ static CK_RV create_mutex (CK_VOID_PTR_PTR mut) { p11_mutex_t *pmutex; return_val_if_fail (mut != NULL, CKR_ARGUMENTS_BAD); pmutex = malloc (sizeof (p11_mutex_t)); return_val_if_fail (pmutex != NULL, CKR_HOST_MEMORY); p11_mutex_init (pmutex); *mut = pmutex; return CKR_OK; } static CK_RV destroy_mutex (CK_VOID_PTR mut) { p11_mutex_t *pmutex = mut; return_val_if_fail (mut != NULL, CKR_MUTEX_BAD); p11_mutex_uninit (pmutex); free (pmutex); return CKR_OK; } static CK_RV lock_mutex (CK_VOID_PTR mut) { p11_mutex_t *pmutex = mut; return_val_if_fail (mut != NULL, CKR_MUTEX_BAD); p11_mutex_lock (pmutex); return CKR_OK; } static CK_RV unlock_mutex (CK_VOID_PTR mut) { p11_mutex_t *pmutex = mut; return_val_if_fail (mut != NULL, CKR_MUTEX_BAD); p11_mutex_unlock (pmutex); return CKR_OK; } static void free_module_unlocked (void *data) { Module *mod = data; assert (mod != NULL); /* Module must have no outstanding references */ assert (mod->ref_count == 0); if (mod->init_count > 0) { p11_debug_precond ("module unloaded without C_Finalize having been " "called for each C_Initialize"); } else { assert (!mod->initialize_called); assert (mod->initialize_thread == 0); } if (mod->loaded_destroy) mod->loaded_destroy (mod->loaded_module); p11_mutex_uninit (&mod->initialize_mutex); p11_dict_free (mod->config); free (mod->name); free (mod); } static Module * alloc_module_unlocked (void) { Module *mod; mod = calloc (1, sizeof (Module)); return_val_if_fail (mod != NULL, NULL); mod->init_args.CreateMutex = create_mutex; mod->init_args.DestroyMutex = destroy_mutex; mod->init_args.LockMutex = lock_mutex; mod->init_args.UnlockMutex = unlock_mutex; mod->init_args.flags = CKF_OS_LOCKING_OK; p11_mutex_init (&mod->initialize_mutex); /* * The default for configured modules is non-critical, but for * modules loaded explicitly, and not from config, we treat them * as critical. So this gets overridden for configured modules * later when the config is loaded. */ mod->critical = true; return mod; } static CK_RV dlopen_and_get_function_list (Module *mod, const char *path, CK_FUNCTION_LIST **funcs) { CK_C_GetFunctionList gfl; dl_module_t dl; char *error; CK_RV rv; assert (mod != NULL); assert (path != NULL); assert (funcs != NULL); dl = p11_dl_open (path); if (dl == NULL) { error = p11_dl_error (); p11_message ("couldn't load module: %s: %s", path, error); free (error); return CKR_GENERAL_ERROR; } /* When the Module goes away, dlclose the loaded module */ mod->loaded_destroy = (p11_kit_destroyer)p11_dl_close; mod->loaded_module = dl; gfl = p11_dl_symbol (dl, "C_GetFunctionList"); if (!gfl) { error = p11_dl_error (); p11_message ("couldn't find C_GetFunctionList entry point in module: %s: %s", path, error); free (error); return CKR_GENERAL_ERROR; } rv = gfl (funcs); if (rv != CKR_OK) { p11_message ("call to C_GetFunctiontList failed in module: %s: %s", path, p11_kit_strerror (rv)); return rv; } if (p11_proxy_module_check (*funcs)) { p11_message ("refusing to load the p11-kit-proxy.so module as a registered module"); return CKR_FUNCTION_FAILED; } p11_virtual_init (&mod->virt, &p11_virtual_base, *funcs, NULL); p11_debug ("opened module: %s", path); return CKR_OK; } static CK_RV load_module_from_file_inlock (const char *name, const char *path, Module **result) { CK_FUNCTION_LIST *funcs; char *expand = NULL; Module *mod; Module *prev; CK_RV rv; assert (path != NULL); assert (result != NULL); mod = alloc_module_unlocked (); return_val_if_fail (mod != NULL, CKR_HOST_MEMORY); if (!p11_path_absolute (path)) { p11_debug ("module path is relative, loading from: %s", P11_MODULE_PATH); path = expand = p11_path_build (P11_MODULE_PATH, path, NULL); return_val_if_fail (path != NULL, CKR_HOST_MEMORY); } p11_debug ("loading module %s%sfrom path: %s", name ? name : "", name ? " " : "", path); rv = dlopen_and_get_function_list (mod, path, &funcs); free (expand); if (rv != CKR_OK) { free_module_unlocked (mod); return rv; } /* Do we have a previous one like this, if so ignore load */ prev = p11_dict_get (gl.unmanaged_by_funcs, funcs); /* If same module was loaded previously, just take over config */ if (prev != NULL) { if (!name || prev->name || prev->config) p11_debug ("duplicate module %s, using previous", path); free_module_unlocked (mod); mod = prev; /* This takes ownership of the module */ } else if (!p11_dict_set (gl.modules, mod, mod) || !p11_dict_set (gl.unmanaged_by_funcs, funcs, mod)) { return_val_if_reached (CKR_HOST_MEMORY); } *result= mod; return CKR_OK; } static int is_list_delimiter (char ch) { return ch == ',' || isspace (ch); } static bool is_string_in_list (const char *list, const char *string) { const char *where; where = strstr (list, string); if (where == NULL) return false; /* Has to be at beginning/end of string, and delimiter before/after */ if (where != list && !is_list_delimiter (*(where - 1))) return false; where += strlen (string); return (*where == '\0' || is_list_delimiter (*where)); } static bool is_module_enabled_unlocked (const char *name, p11_dict *config) { const char *progname; const char *enable_in; const char *disable_in; bool enable = false; enable_in = p11_dict_get (config, "enable-in"); disable_in = p11_dict_get (config, "disable-in"); /* Defaults to enabled if neither of these are set */ if (!enable_in && !disable_in) return true; progname = _p11_get_progname_unlocked (); if (enable_in && disable_in) p11_message ("module '%s' has both enable-in and disable-in options", name); if (enable_in) enable = (progname != NULL && is_string_in_list (enable_in, progname)); else if (disable_in) enable = (progname == NULL || !is_string_in_list (disable_in, progname)); p11_debug ("%s module '%s' running in '%s'", enable ? "enabled" : "disabled", name, progname ? progname : "(null)"); return enable; } static CK_RV take_config_and_load_module_inlock (char **name, p11_dict **config, bool critical) { const char *filename; Module *mod; CK_RV rv; assert (name); assert (*name); assert (config); assert (*config); if (!is_module_enabled_unlocked (*name, *config)) return CKR_OK; filename = p11_dict_get (*config, "module"); if (filename == NULL) { p11_debug ("no module path for module, skipping: %s", *name); return CKR_OK; } rv = load_module_from_file_inlock (*name, filename, &mod); if (rv != CKR_OK) return CKR_OK; /* Take ownership of thes evariables */ p11_dict_free (mod->config); mod->config = *config; *config = NULL; free (mod->name); mod->name = *name; *name = NULL; mod->critical = critical; /* * We support setting of CK_C_INITIALIZE_ARGS.pReserved from * 'x-init-reserved' setting in the config. This only works with specific * PKCS#11 modules, and is non-standard use of that field. */ mod->init_args.pReserved = p11_dict_get (mod->config, "x-init-reserved"); return CKR_OK; } static CK_RV load_registered_modules_unlocked (void) { p11_dictiter iter; p11_dict *configs; void *key; char *name; p11_dict *config; int mode; CK_RV rv; bool critical; if (gl.config) return CKR_OK; /* Load the global configuration files */ config = _p11_conf_load_globals (P11_SYSTEM_CONFIG_FILE, P11_USER_CONFIG_FILE, &mode); if (config == NULL) return CKR_GENERAL_ERROR; assert (mode != CONF_USER_INVALID); configs = _p11_conf_load_modules (mode, P11_PACKAGE_CONFIG_MODULES, P11_SYSTEM_CONFIG_MODULES, P11_USER_CONFIG_MODULES); if (configs == NULL) { rv = CKR_GENERAL_ERROR; p11_dict_free (config); return rv; } assert (gl.config == NULL); gl.config = config; /* * Now go through each config and turn it into a module. As we iterate * we steal the values of the config. */ p11_dict_iterate (configs, &iter); while (p11_dict_next (&iter, &key, NULL)) { if (!p11_dict_steal (configs, key, (void**)&name, (void**)&config)) assert_not_reached (); /* Is this a critical module, should abort loading of others? */ critical = _p11_conf_parse_boolean (p11_dict_get (config, "critical"), false); rv = take_config_and_load_module_inlock (&name, &config, critical); /* * These variables will be cleared if ownership is transeferred * by the above function call. */ p11_dict_free (config); if (critical && rv != CKR_OK) { p11_message ("aborting initialization because module '%s' was marked as critical", name); p11_dict_free (configs); free (name); return rv; } free (name); } p11_dict_free (configs); return CKR_OK; } static CK_RV initialize_module_inlock_reentrant (Module *mod) { CK_RV rv = CKR_OK; p11_thread_id_t self; assert (mod); self = p11_thread_id_self (); if (mod->initialize_thread == self) { p11_message ("p11-kit initialization called recursively"); return CKR_FUNCTION_FAILED; } /* * Increase ref first, so module doesn't get freed out from * underneath us when the mutex is unlocked below. */ ++mod->ref_count; mod->initialize_thread = self; /* Change over to the module specific mutex */ p11_unlock (); p11_mutex_lock (&mod->initialize_mutex); if (!mod->initialize_called) { p11_debug ("C_Initialize: calling"); rv = mod->virt.funcs.C_Initialize (&mod->virt.funcs, &mod->init_args); p11_debug ("C_Initialize: result: %lu", rv); /* Module was initialized and C_Finalize should be called */ if (rv == CKR_OK) mod->initialize_called = true; /* Module was already initialized, we don't call C_Finalize */ else if (rv == CKR_CRYPTOKI_ALREADY_INITIALIZED) rv = CKR_OK; } p11_mutex_unlock (&mod->initialize_mutex); p11_lock (); if (rv == CKR_OK) { /* Matches the ref count in finalize_module_inlock_reentrant() */ if (mod->init_count == 0) mod->ref_count++; mod->init_count++; } mod->ref_count--; mod->initialize_thread = 0; return rv; } #ifdef OS_UNIX static void reinitialize_after_fork (void) { p11_dictiter iter; Module *mod; p11_debug ("forked"); p11_lock (); if (gl.modules) { p11_dict_iterate (gl.modules, &iter); while (p11_dict_next (&iter, (void **)&mod, NULL)) mod->initialize_called = false; } p11_unlock (); p11_proxy_after_fork (); } #endif /* OS_UNIX */ static CK_RV init_globals_unlocked (void) { static bool once = false; if (!gl.modules) { gl.modules = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, free_module_unlocked, NULL); return_val_if_fail (gl.modules != NULL, CKR_HOST_MEMORY); } if (!gl.unmanaged_by_funcs) { gl.unmanaged_by_funcs = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, NULL); return_val_if_fail (gl.unmanaged_by_funcs != NULL, CKR_HOST_MEMORY); } if (!gl.managed_by_closure) { gl.managed_by_closure = p11_dict_new (p11_dict_direct_hash, p11_dict_direct_equal, NULL, NULL); return_val_if_fail (gl.managed_by_closure != NULL, CKR_HOST_MEMORY); } if (once) return CKR_OK; #ifdef OS_UNIX pthread_atfork (NULL, NULL, reinitialize_after_fork); #endif once = true; return CKR_OK; } static void free_modules_when_no_refs_unlocked (void) { Module *mod; p11_dictiter iter; /* Check if any modules have a ref count */ p11_dict_iterate (gl.modules, &iter); while (p11_dict_next (&iter, (void **)&mod, NULL)) { if (mod->ref_count) return; } p11_dict_free (gl.unmanaged_by_funcs); gl.unmanaged_by_funcs = NULL; p11_dict_free (gl.managed_by_closure); gl.managed_by_closure = NULL; p11_dict_free (gl.modules); gl.modules = NULL; p11_dict_free (gl.config); gl.config = NULL; } static CK_RV finalize_module_inlock_reentrant (Module *mod) { assert (mod); /* * We leave module info around until all are finalized * so we can encounter these zombie Module structures. */ if (mod->ref_count == 0) return CKR_ARGUMENTS_BAD; if (--mod->init_count > 0) return CKR_OK; /* * Becuase of the mutex unlock below, we temporarily increase * the ref count. This prevents module from being freed out * from ounder us. */ p11_unlock (); p11_mutex_lock (&mod->initialize_mutex); if (mod->initialize_called) { mod->virt.funcs.C_Finalize (&mod->virt.funcs, NULL); mod->initialize_called = false; } p11_mutex_unlock (&mod->initialize_mutex); p11_lock (); /* Match the ref increment in initialize_module_inlock_reentrant() */ mod->ref_count--; free_modules_when_no_refs_unlocked (); return CKR_OK; } static CK_RV initialize_registered_inlock_reentrant (void) { p11_dictiter iter; Module *mod; CK_RV rv; /* * This is only called by deprecated code. The caller expects all * configured and enabled modules to be initialized. */ rv = init_globals_unlocked (); if (rv != CKR_OK) return rv; rv = load_registered_modules_unlocked (); if (rv == CKR_OK) { p11_dict_iterate (gl.unmanaged_by_funcs, &iter); while (rv == CKR_OK && p11_dict_next (&iter, NULL, (void **)&mod)) { /* Skip all modules that aren't registered or enabled */ if (mod->name == NULL || !is_module_enabled_unlocked (mod->name, mod->config)) continue; rv = initialize_module_inlock_reentrant (mod); if (rv != CKR_OK) { if (mod->critical) { p11_message ("initialization of critical module '%s' failed: %s", mod->name, p11_kit_strerror (rv)); } else { p11_message ("skipping module '%s' whose initialization failed: %s", mod->name, p11_kit_strerror (rv)); rv = CKR_OK; } } } } return rv; } static Module * module_for_functions_inlock (CK_FUNCTION_LIST *funcs) { if (p11_virtual_is_wrapper (funcs)) return p11_dict_get (gl.managed_by_closure, funcs); else return p11_dict_get (gl.unmanaged_by_funcs, funcs); } static CK_FUNCTION_LIST * unmanaged_for_module_inlock (Module *mod) { CK_FUNCTION_LIST *funcs; funcs = mod->virt.lower_module; if (p11_dict_get (gl.unmanaged_by_funcs, funcs) == mod) return funcs; return NULL; } /** * p11_kit_initialize_registered: * * Initialize all the registered PKCS\#11 modules. * * If this is the first time this function is called multiple times * consecutively within a single process, then it merely increments an * initialization reference count for each of these modules. * * Use p11_kit_finalize_registered() to finalize these registered modules once * the caller is done with them. * * If this function fails, then an error message will be available via the * p11_kit_message() function. * * Deprecated: Since: 0.19.0: Use p11_kit_modules_load() instead. * * Returns: CKR_OK if the initialization succeeded, or an error code. */ CK_RV p11_kit_initialize_registered (void) { CK_RV rv; p11_library_init_once (); /* WARNING: This function must be reentrant */ p11_debug ("in"); p11_lock (); p11_message_clear (); /* WARNING: Reentrancy can occur here */ rv = initialize_registered_inlock_reentrant (); _p11_kit_default_message (rv); p11_unlock (); /* Cleanup any partial initialization */ if (rv != CKR_OK) p11_kit_finalize_registered (); p11_debug ("out: %lu", rv); return rv; } static CK_RV finalize_registered_inlock_reentrant (void) { Module *mod; p11_dictiter iter; Module **to_finalize; int i, count; /* * This is only called from deprecated code. The caller expects all * modules initialized earlier to be finalized (once). If non-critical * modules failed to initialize, then it is not possible to completely * guarantee the internal state. */ if (!gl.modules) return CKR_CRYPTOKI_NOT_INITIALIZED; /* WARNING: This function must be reentrant */ to_finalize = calloc (p11_dict_size (gl.unmanaged_by_funcs), sizeof (Module *)); if (!to_finalize) return CKR_HOST_MEMORY; count = 0; p11_dict_iterate (gl.unmanaged_by_funcs, &iter); while (p11_dict_next (&iter, NULL, (void **)&mod)) { /* Skip all modules that aren't registered */ if (mod->name && mod->init_count) to_finalize[count++] = mod; } p11_debug ("finalizing %d modules", count); for (i = 0; i < count; ++i) { /* WARNING: Reentrant calls can occur here */ finalize_module_inlock_reentrant (to_finalize[i]); } free (to_finalize); /* In case nothing loaded, free up internal memory */ if (count == 0) free_modules_when_no_refs_unlocked (); return CKR_OK; } /** * p11_kit_finalize_registered: * * Finalize all the registered PKCS\#11 modules. These should have been * initialized with p11_kit_initialize_registered(). * * If p11_kit_initialize_registered() has been called more than once in this * process, then this function must be called the same number of times before * actual finalization will occur. * * If this function fails, then an error message will be available via the * p11_kit_message() function. * * Deprecated: Since 0.19.0: Use p11_kit_modules_release() instead. * * Returns: CKR_OK if the finalization succeeded, or an error code. */ CK_RV p11_kit_finalize_registered (void) { CK_RV rv; p11_library_init_once (); /* WARNING: This function must be reentrant */ p11_debug ("in"); p11_lock (); p11_message_clear (); /* WARNING: Reentrant calls can occur here */ rv = finalize_registered_inlock_reentrant (); _p11_kit_default_message (rv); p11_unlock (); p11_debug ("out: %lu", rv); return rv; } static int compar_priority (const void *one, const void *two) { CK_FUNCTION_LIST_PTR f1 = *((CK_FUNCTION_LIST_PTR *)one); CK_FUNCTION_LIST_PTR f2 = *((CK_FUNCTION_LIST_PTR *)two); Module *m1, *m2; const char *v1, *v2; int o1, o2; m1 = module_for_functions_inlock (f1); m2 = module_for_functions_inlock (f2); assert (m1 != NULL && m2 != NULL); v1 = p11_dict_get (m1->config, "priority"); v2 = p11_dict_get (m2->config, "priority"); o1 = atoi (v1 ? v1 : "0"); o2 = atoi (v2 ? v2 : "0"); /* Priority is in descending order, highest first */ if (o1 != o2) return o1 > o2 ? -1 : 1; /* * Otherwise use the names alphabetically in ascending order. This * is really just to provide consistency between various loads of * the configuration. */ if (m1->name == m2->name) return 0; if (!m1->name) return -1; if (!m2->name) return 1; return strcmp (m1->name, m2->name); } static void sort_modules_by_priority (CK_FUNCTION_LIST_PTR *modules, int count) { qsort (modules, count, sizeof (CK_FUNCTION_LIST_PTR), compar_priority); } static CK_FUNCTION_LIST ** list_registered_modules_inlock (void) { CK_FUNCTION_LIST **result = NULL; CK_FUNCTION_LIST *funcs; Module *mod; p11_dictiter iter; int i = 0; /* * This is only called by deprecated code. The caller expects to get * a list of all registered enabled modules that have been initialized. */ if (gl.unmanaged_by_funcs) { result = calloc (p11_dict_size (gl.unmanaged_by_funcs) + 1, sizeof (CK_FUNCTION_LIST *)); return_val_if_fail (result != NULL, NULL); p11_dict_iterate (gl.unmanaged_by_funcs, &iter); while (p11_dict_next (&iter, (void **)&funcs, (void **)&mod)) { /* * We don't include unreferenced modules. We don't include * modules that have been initialized but aren't in the * registry. These have a NULL name. * * In addition we check again that the module isn't disabled * using enable-in or disable-in. This is because a caller * can change the progname we recognize the process as after * having initialized. This is a corner case, but want to make * sure to cover it. */ if (mod->ref_count && mod->name && mod->init_count && is_module_enabled_unlocked (mod->name, mod->config)) { result[i++] = funcs; } } sort_modules_by_priority (result, i); } return result; } /** * p11_kit_registered_modules: * * Get a list of all the registered PKCS\#11 modules. This list will be valid * once the p11_kit_initialize_registered() function has been called. * * The returned value is a NULL terminated array of * CK_FUNCTION_LIST_PTR pointers. * * The returned modules are unmanaged. * * Deprecated: Since 0.19.0: Use p11_kit_modules_load() instead. * * Returns: A list of all the registered modules. Use the free() function to * free the list. */ CK_FUNCTION_LIST_PTR_PTR p11_kit_registered_modules (void) { CK_FUNCTION_LIST_PTR_PTR result; p11_library_init_once (); p11_lock (); p11_message_clear (); result = list_registered_modules_inlock (); p11_unlock (); return result; } /** * p11_kit_registered_module_to_name: * @module: pointer to a registered module * * Get the name of a registered PKCS\#11 module. * * You can use p11_kit_registered_modules() to get a list of all the registered * modules. This name is specified by the registered module configuration. * * Deprecated: Since 0.19.0: Use p11_kit_module_get_name() instead. * * Returns: A newly allocated string containing the module name, or * NULL if no such registered module exists. Use free() to * free this string. */ char* p11_kit_registered_module_to_name (CK_FUNCTION_LIST_PTR module) { return_val_if_fail (module != NULL, NULL); return p11_kit_module_get_name (module); } /** * p11_kit_module_get_name: * @module: pointer to a loaded module * * Get the configured name of the PKCS\#11 module. * * Configured modules are loaded by p11_kit_modules_load(). The module * passed to this function can be either managed or unmanaged. Non * configured modules will return %NULL. * * Use free() to release the return value when you're done with it. * * Returns: a newly allocated string containing the module name, or * NULL if the module is not a configured module */ char * p11_kit_module_get_name (CK_FUNCTION_LIST *module) { Module *mod; char *name = NULL; return_val_if_fail (module != NULL, NULL); p11_library_init_once (); p11_lock (); p11_message_clear (); if (gl.modules) { mod = module_for_functions_inlock (module); if (mod && mod->name) name = strdup (mod->name); } p11_unlock (); return name; } static const char * module_get_option_inlock (Module *mod, const char *option) { p11_dict *config; if (mod == NULL) config = gl.config; else config = mod->config; if (config == NULL) return NULL; return p11_dict_get (config, option); } /** * p11_kit_module_get_flags: * @module: the module * * Get the flags for this module. * * The %P11_KIT_MODULE_UNMANAGED flag will be set if the module is not * managed by p11-kit. It is a raw PKCS\#11 module function list. * * The %P11_KIT_MODULE_CRITICAL flag will be set if the module is configured * to be critical, and not be skipped over if it fails to initialize or * load. This flag is also set for modules that are not configured, but have * been loaded in another fashion. * * Returns: the flags for the module */ int p11_kit_module_get_flags (CK_FUNCTION_LIST *module) { const char *trusted; Module *mod; int flags = 0; return_val_if_fail (module != NULL, 0); p11_library_init_once (); p11_lock (); p11_message_clear (); if (gl.modules) { if (p11_virtual_is_wrapper (module)) { mod = p11_dict_get (gl.managed_by_closure, module); } else { flags |= P11_KIT_MODULE_UNMANAGED; mod = p11_dict_get (gl.unmanaged_by_funcs, module); } if (!mod || mod->critical) flags |= P11_KIT_MODULE_CRITICAL; if (mod) { trusted = module_get_option_inlock (mod, "trust-policy"); if (_p11_conf_parse_boolean (trusted, false)) flags |= P11_KIT_MODULE_TRUSTED; } } p11_unlock (); return flags; } /** * p11_kit_registered_name_to_module: * @name: name of a registered module * * Lookup a registered PKCS\#11 module by its name. This name is specified by * the registered module configuration. * * Deprecated: Since 0.19.0: Use p11_kit_module_for_name() instead. * * Returns: a pointer to a PKCS\#11 module, or NULL if this name was * not found. */ CK_FUNCTION_LIST_PTR p11_kit_registered_name_to_module (const char *name) { CK_FUNCTION_LIST_PTR module = NULL; CK_FUNCTION_LIST_PTR funcs; p11_dictiter iter; Module *mod; return_val_if_fail (name != NULL, NULL); p11_lock (); p11_message_clear (); if (gl.modules) { assert (name); p11_dict_iterate (gl.unmanaged_by_funcs, &iter); while (p11_dict_next (&iter, (void **)&funcs, (void **)&mod)) { if (mod->ref_count && mod->name && strcmp (name, mod->name) == 0) { module = funcs; break; } } } p11_unlock (); return module; } /** * p11_kit_module_for_name: * @modules: a list of modules to look through * @name: the name of the module to find * * Look through the list of @modules and return the module whose @name * matches. * * Only configured modules have names. Configured modules are loaded by * p11_kit_modules_load(). The module passed to this function can be either * managed or unmanaged. * * The return value is not copied or duplicated in anyway. It is still * 'owned' by the @modules list. * * Returns: the module which matches the name, or %NULL if no match. */ CK_FUNCTION_LIST * p11_kit_module_for_name (CK_FUNCTION_LIST **modules, const char *name) { CK_FUNCTION_LIST *ret = NULL; Module *mod; int i; return_val_if_fail (name != NULL, NULL); if (!modules) return NULL; p11_library_init_once (); p11_lock (); p11_message_clear (); for (i = 0; gl.modules && modules[i] != NULL; i++) { mod = module_for_functions_inlock (modules[i]); if (mod && mod->name && strcmp (mod->name, name) == 0) { ret = modules[i]; break; } } p11_unlock (); return ret; } /** * p11_kit_registered_option: * @module: a pointer to a registered module * @field: the name of the option to lookup. * * Lookup a configured option for a registered PKCS\#11 module. If a * NULL module argument is specified, then this will lookup * the configuration option in the global config file. * * Deprecated: Since 0.19.0: Use p11_kit_config_option() instead. * * Returns: A newly allocated string containing the option value, or * NULL if the registered module or the option were not found. * Use free() to free the returned string. */ char* p11_kit_registered_option (CK_FUNCTION_LIST_PTR module, const char *field) { Module *mod = NULL; char *option = NULL; const char *value; return_val_if_fail (field != NULL, NULL); p11_library_init_once (); p11_lock (); p11_message_clear (); if (module == NULL) mod = NULL; else mod = gl.unmanaged_by_funcs ? p11_dict_get (gl.unmanaged_by_funcs, module) : NULL; value = module_get_option_inlock (mod, field); if (value) option = strdup (value); p11_unlock (); return option; } /** * p11_kit_config_option: * @module: the module to retrieve the option for, or %NULL for global options * @option: the option to retrieve * * Retrieve the value for a configured option. * * If @module is %NULL, then the global option with the given name will * be retrieved. Otherwise @module should point to a configured loaded module. * If no such @option or configured @module exists, then %NULL will be returned. * * Use free() to release the returned value. * * Returns: the option value or %NULL */ char * p11_kit_config_option (CK_FUNCTION_LIST *module, const char *option) { Module *mod = NULL; const char *value = NULL; char *ret = NULL; return_val_if_fail (option != NULL, NULL); p11_library_init_once (); p11_lock (); p11_message_clear (); if (gl.modules) { if (module != NULL) { mod = module_for_functions_inlock (module); if (mod == NULL) goto cleanup; } value = module_get_option_inlock (mod, option); if (value) ret = strdup (value); } cleanup: p11_unlock (); return ret; } typedef struct { p11_virtual virt; Module *mod; bool initialized; p11_dict *sessions; } Managed; static CK_RV managed_C_Initialize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR init_args) { Managed *managed = ((Managed *)self); p11_dict *sessions; CK_RV rv; p11_debug ("in"); p11_lock (); if (managed->initialized) { rv = CKR_CRYPTOKI_ALREADY_INITIALIZED; } else { sessions = p11_dict_new (p11_dict_ulongptr_hash, p11_dict_ulongptr_equal, free, free); if (!sessions) rv = CKR_HOST_MEMORY; else rv = initialize_module_inlock_reentrant (managed->mod); if (rv == CKR_OK) { managed->sessions = sessions; managed->initialized = true; } else { p11_dict_free (sessions); } } p11_unlock (); p11_debug ("out: %lu", rv); return rv; } static CK_RV managed_track_session_inlock (p11_dict *sessions, CK_SLOT_ID slot_id, CK_SESSION_HANDLE session) { void *key; void *value; key = memdup (&session, sizeof (CK_SESSION_HANDLE)); return_val_if_fail (key != NULL, CKR_HOST_MEMORY); value = memdup (&slot_id, sizeof (CK_SESSION_HANDLE)); return_val_if_fail (value != NULL, CKR_HOST_MEMORY); if (!p11_dict_set (sessions, key, value)) return_val_if_reached (CKR_HOST_MEMORY); return CKR_OK; } static void managed_untrack_session_inlock (p11_dict *sessions, CK_SESSION_HANDLE session) { p11_dict_remove (sessions, &session); } static CK_SESSION_HANDLE * managed_steal_sessions_inlock (p11_dict *sessions, bool matching_slot_id, CK_SLOT_ID slot_id, int *count) { CK_SESSION_HANDLE *stolen; CK_SESSION_HANDLE *key; CK_SLOT_ID *value; p11_dictiter iter; int at, i; assert (sessions != NULL); assert (count != NULL); stolen = calloc (p11_dict_size (sessions), sizeof (CK_SESSION_HANDLE)); return_val_if_fail (stolen != NULL, NULL); at = 0; p11_dict_iterate (sessions, &iter); while (p11_dict_next (&iter, (void **)&key, (void **)&value)) { if (!matching_slot_id || slot_id == *value) stolen[at++] = *key; } /* Removed them all, clear the whole array */ if (at == p11_dict_size (sessions)) { p11_dict_clear (sessions); /* Only removed some, go through and remove those */ } else { for (i = 0; i < at; i++) { if (!p11_dict_remove (sessions, stolen + at)) assert_not_reached (); } } *count = at; return stolen; } static void managed_close_sessions (CK_X_FUNCTION_LIST *funcs, CK_SESSION_HANDLE *stolen, int count) { CK_RV rv; int i; for (i = 0; i < count; i++) { rv = funcs->C_CloseSession (funcs, stolen[i]); if (rv != CKR_OK) p11_message ("couldn't close session: %s", p11_kit_strerror (rv)); } } static CK_RV managed_C_Finalize (CK_X_FUNCTION_LIST *self, CK_VOID_PTR reserved) { Managed *managed = ((Managed *)self); CK_SESSION_HANDLE *sessions; int count; CK_RV rv; p11_debug ("in"); p11_lock (); if (!managed->initialized) { rv = CKR_CRYPTOKI_NOT_INITIALIZED; } else { sessions = managed_steal_sessions_inlock (managed->sessions, false, 0, &count); if (sessions && count) { /* WARNING: reentrancy can occur here */ p11_unlock (); managed_close_sessions (&managed->mod->virt.funcs, sessions, count); p11_lock (); } free (sessions); /* WARNING: reentrancy can occur here */ rv = finalize_module_inlock_reentrant (managed->mod); if (rv == CKR_OK) { managed->initialized = false; p11_dict_free (managed->sessions); managed->sessions = NULL; } } p11_unlock (); p11_debug ("out: %lu", rv); return rv; } static CK_RV managed_C_OpenSession (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id, CK_FLAGS flags, CK_VOID_PTR application, CK_NOTIFY notify, CK_SESSION_HANDLE_PTR session) { Managed *managed = ((Managed *)self); CK_RV rv; return_val_if_fail (session != NULL, CKR_ARGUMENTS_BAD); self = &managed->mod->virt.funcs; rv = self->C_OpenSession (self, slot_id, flags, application, notify, session); if (rv == CKR_OK) { p11_lock (); rv = managed_track_session_inlock (managed->sessions, slot_id, *session); p11_unlock (); } return rv; } static CK_RV managed_C_CloseSession (CK_X_FUNCTION_LIST *self, CK_SESSION_HANDLE session) { Managed *managed = ((Managed *)self); CK_RV rv; self = &managed->mod->virt.funcs; rv = self->C_CloseSession (self, session); if (rv == CKR_OK) { p11_lock (); managed_untrack_session_inlock (managed->sessions, session); p11_unlock (); } return rv; } static CK_RV managed_C_CloseAllSessions (CK_X_FUNCTION_LIST *self, CK_SLOT_ID slot_id) { Managed *managed = ((Managed *)self); CK_SESSION_HANDLE *stolen; int count; p11_lock (); stolen = managed_steal_sessions_inlock (managed->sessions, true, slot_id, &count); p11_unlock (); self = &managed->mod->virt.funcs; managed_close_sessions (self, stolen, count); free (stolen); return stolen ? CKR_OK : CKR_GENERAL_ERROR; } static void managed_free_inlock (void *data) { Managed *managed = data; managed->mod->ref_count--; free (managed); } static p11_virtual * managed_create_inlock (Module *mod) { Managed *managed; managed = calloc (1, sizeof (Managed)); return_val_if_fail (managed != NULL, NULL); p11_virtual_init (&managed->virt, &p11_virtual_stack, &mod->virt, NULL); managed->virt.funcs.C_Initialize = managed_C_Initialize; managed->virt.funcs.C_Finalize = managed_C_Finalize; managed->virt.funcs.C_CloseAllSessions = managed_C_CloseAllSessions; managed->virt.funcs.C_CloseSession = managed_C_CloseSession; managed->virt.funcs.C_OpenSession = managed_C_OpenSession; managed->mod = mod; mod->ref_count++; return &managed->virt; } static bool lookup_managed_option (Module *mod, bool supported, const char *option, bool def_value) { const char *string; bool value; string = module_get_option_inlock (NULL, option); if (!string) string = module_get_option_inlock (mod, option); if (!string) { if (!supported) return false; return def_value; } value = _p11_conf_parse_boolean (string, def_value); if (!supported && value != supported) { if (!p11_virtual_can_wrap ()) { /* * This is because libffi dependency was not built. The libffi dependency * is highly recommended and building without it results in a large loss * of functionality. */ p11_message ("the '%s' option for module '%s' is not supported on this system", option, mod->name); } else { /* * This is because the module is running in unmanaged mode, so turn off the */ p11_message ("the '%s' option for module '%s' is only supported for managed modules", option, mod->name); } return false; } return value; } static CK_RV release_module_inlock_rentrant (CK_FUNCTION_LIST *module, const char *caller_func) { Module *mod; assert (module != NULL); /* See if a managed module, and finalize if so */ if (p11_virtual_is_wrapper (module)) { mod = p11_dict_get (gl.managed_by_closure, module); if (mod != NULL) { if (!p11_dict_remove (gl.managed_by_closure, module)) assert_not_reached (); p11_virtual_unwrap (module); } /* If an unmanaged module then caller should have finalized */ } else { mod = p11_dict_get (gl.unmanaged_by_funcs, module); } if (mod == NULL) { p11_debug_precond ("invalid module pointer passed to %s", caller_func); return CKR_ARGUMENTS_BAD; } /* Matches the ref in prepare_module_inlock_reentrant() */ mod->ref_count--; return CKR_OK; } CK_RV p11_modules_release_inlock_reentrant (CK_FUNCTION_LIST **modules) { CK_RV ret = CKR_OK; CK_RV rv; int i; for (i = 0; modules[i] != NULL; i++) { rv = release_module_inlock_rentrant (modules[i], __PRETTY_FUNCTION__); if (rv != CKR_OK) ret = rv; } free (modules); /* In case nothing loaded, free up internal memory */ free_modules_when_no_refs_unlocked (); return ret; } static CK_RV prepare_module_inlock_reentrant (Module *mod, int flags, CK_FUNCTION_LIST **module) { p11_destroyer destroyer; const char *trusted; p11_virtual *virt; bool is_managed; bool with_log; assert (module != NULL); if (flags & P11_KIT_MODULE_TRUSTED) { trusted = module_get_option_inlock (mod, "trust-policy"); if (!_p11_conf_parse_boolean (trusted, false)) return CKR_FUNCTION_NOT_SUPPORTED; } if (flags & P11_KIT_MODULE_UNMANAGED) { is_managed = false; with_log = false; } else { is_managed = lookup_managed_option (mod, p11_virtual_can_wrap (), "managed", true); with_log = lookup_managed_option (mod, is_managed, "log-calls", false); } if (is_managed) { virt = managed_create_inlock (mod); return_val_if_fail (virt != NULL, CKR_HOST_MEMORY); destroyer = managed_free_inlock; /* Add the logger if configured */ if (p11_log_force || with_log) { virt = p11_log_subclass (virt, destroyer); destroyer = p11_log_release; } *module = p11_virtual_wrap (virt, destroyer); return_val_if_fail (*module != NULL, CKR_GENERAL_ERROR); if (!p11_dict_set (gl.managed_by_closure, *module, mod)) return_val_if_reached (CKR_HOST_MEMORY); } else { *module = unmanaged_for_module_inlock (mod); if (*module == NULL) return CKR_FUNCTION_NOT_SUPPORTED; } /* Matches the deref in release_module_inlock_rentrant() */ mod->ref_count++; return CKR_OK; } CK_RV p11_modules_load_inlock_reentrant (int flags, CK_FUNCTION_LIST ***results) { CK_FUNCTION_LIST **modules; Module *mod; p11_dictiter iter; CK_RV rv; int at; rv = init_globals_unlocked (); if (rv != CKR_OK) return rv; rv = load_registered_modules_unlocked (); if (rv != CKR_OK) return rv; modules = calloc (p11_dict_size (gl.modules) + 1, sizeof (CK_FUNCTION_LIST *)); return_val_if_fail (modules != NULL, CKR_HOST_MEMORY); at = 0; rv = CKR_OK; p11_dict_iterate (gl.modules, &iter); while (p11_dict_next (&iter, NULL, (void **)&mod)) { /* * We don't include unreferenced modules. We don't include * modules that have been initialized but aren't in the * registry. These have a NULL name. * * In addition we check again that the module isn't disabled * using enable-in or disable-in. This is because a caller * can change the progname we recognize the process as after * having initialized. This is a corner case, but want to make * sure to cover it. */ if (!mod->name || !is_module_enabled_unlocked (mod->name, mod->config)) continue; rv = prepare_module_inlock_reentrant (mod, flags, modules + at); if (rv == CKR_OK) at++; else if (rv == CKR_FUNCTION_NOT_SUPPORTED) rv = CKR_OK; else break; } modules[at] = NULL; if (rv != CKR_OK) { p11_modules_release_inlock_reentrant (modules); return rv; } sort_modules_by_priority (modules, at); *results = modules; return CKR_OK; } /** * p11_kit_modules_load: * @reserved: set to %NULL * @flags: flags to use to load the module * * Load the configured PKCS\#11 modules. * * If @flags contains the %P11_KIT_MODULE_UNMANAGED flag, then the * modules will be not be loaded in 'managed' mode regardless of its * configuration. This is not recommended for general usage. * * If @flags contains the %P11_KIT_MODULE_CRITICAL flag then the * modules will all be treated as 'critical', regardless of the module * configuration. This means that a failure to load any module will * cause this funtion to fail. * * For unmanaged modules there is no guarantee to the state of the * modules. Other callers may be using the modules. Using unmanaged * modules haphazardly is not recommended for this reason. Some * modules (such as those configured with RPC) cannot be loaded in * unmanaged mode, and will be skipped. * * Use p11_kit_modules_release() to release the modules returned by * this function. * * If this function fails, then an error message will be available via the * p11_kit_message() function. * * Returns: a null terminated list of modules represented as PKCS\#11 * function lists, or %NULL on failure */ CK_FUNCTION_LIST ** p11_kit_modules_load (const char *reserved, int flags) { CK_FUNCTION_LIST **modules; CK_RV rv; /* progname attribute not implemented yet */ return_val_if_fail (reserved == NULL, NULL); p11_library_init_once (); /* WARNING: This function must be reentrant */ p11_debug ("in"); p11_lock (); p11_message_clear (); /* WARNING: Reentrancy can occur here */ rv = p11_modules_load_inlock_reentrant (flags, &modules); p11_unlock (); if (rv != CKR_OK) modules = NULL; p11_debug ("out: %s", modules ? "success" : "fail"); return modules; } /** * p11_kit_modules_initialize: * @modules: a %NULL terminated list of modules * @failure_callback: called with modules that fail to initialize * * Initialize all the modules in the @modules list by calling their * C_Initialize function. * * For managed modules the C_Initialize function * is overridden so that multiple callers can initialize the same * modules. In addition for managed modules multiple callers can * initialize from different threads, and still guarantee consistent * thread-safe behavior. * * For unmanaged modules if multiple callers try to initialize * a module, then one of the calls will return * CKR_CRYPTOKI_ALREADY_INITIALIZED according to the * PKCS\#11 specification. In addition there are no guarantees that * thread-safe behavior will occur if multiple callers initialize from * different threads. * * When a module fails to initialize it is removed from the @modules list. * If the @failure_callback is not %NULL then it is called with the modules that * fail to initialize. For example, you may pass p11_kit_module_release() * as a @failure_callback if the @modules list was loaded wit p11_kit_modules_load(). * * The return value will return the failure code of the last critical * module that failed to initialize. Non-critical module failures do not affect * the return value. If no critical modules failed to initialize then the * return value will be CKR_OK. * * When modules are removed, the list will be %NULL terminated at the * appropriate place so it can continue to be used as a modules list. * * This function does not accept a CK_C_INITIALIZE_ARGS argument. * Custom initialization arguments cannot be supported when multiple consumers * load the same module. * * Returns: CKR_OK or the failure code of the last critical * module that failed to initialize. */ CK_RV p11_kit_modules_initialize (CK_FUNCTION_LIST **modules, p11_kit_destroyer failure_callback) { CK_RV ret = CKR_OK; CK_RV rv; bool critical; char *name; int i, out; return_val_if_fail (modules != NULL, CKR_ARGUMENTS_BAD); for (i = 0, out = 0; modules[i] != NULL; i++, out++) { rv = modules[i]->C_Initialize (NULL); if (rv != CKR_OK) { name = p11_kit_module_get_name (modules[i]); if (name == NULL) name = strdup ("(unknown)"); return_val_if_fail (name != NULL, CKR_HOST_MEMORY); critical = (p11_kit_module_get_flags (modules[i]) & P11_KIT_MODULE_CRITICAL); p11_message ("%s: module failed to initialize%s: %s", name, critical ? "" : ", skipping", p11_kit_strerror (rv)); if (critical) ret = rv; if (failure_callback) failure_callback (modules[i]); out--; free (name); } } /* NULL terminate after above changes */ modules[out] = NULL; return ret; } /** * p11_kit_modules_load_and_initialize: * @flags: flags to use to load the modules * * Load and initialize configured modules. * * If a critical module fails to load or initialize then the function will * return NULL. Non-critical modules will be skipped * and not included in the returned module list. * * Use p11_kit_modules_finalize_and_release() when you're done with the * modules returned by this function. * * Returns: a NULL terminated list of modules, or * NULL on failure */ CK_FUNCTION_LIST ** p11_kit_modules_load_and_initialize (int flags) { CK_FUNCTION_LIST **modules; CK_RV rv; modules = p11_kit_modules_load (NULL, flags); if (modules == NULL) return NULL; rv = p11_kit_modules_initialize (modules, (p11_destroyer)p11_kit_module_release); if (rv != CKR_OK) { p11_kit_modules_release (modules); modules = NULL; } return modules; } /** * p11_kit_modules_finalize: * @modules: a NULL terminated list of modules * * Finalize each module in the @modules list by calling its * C_Finalize function. Regardless of failures, all * @modules will have their C_Finalize function called. * * If a module returns a failure from its C_Finalize * method it will be returned. If multiple modules fail, the last failure * will be returned. * * For managed modules the C_Finalize function * is overridden so that multiple callers can finalize the same * modules. In addition for managed modules multiple callers can * finalize from different threads, and still guarantee consistent * thread-safe behavior. * * For unmanaged modules if multiple callers try to finalize * a module, then one of the calls will return * CKR_CRYPTOKI_NOT_INITIALIZED according to the * PKCS\#11 specification. In addition there are no guarantees that * thread-safe behavior will occur if multiple callers finalize from * different threads. * * Returns: CKR_OK or the failure code of the last * module that failed to finalize */ CK_RV p11_kit_modules_finalize (CK_FUNCTION_LIST **modules) { CK_RV ret = CKR_OK; CK_RV rv; char *name; int i; return_val_if_fail (modules != NULL, CKR_ARGUMENTS_BAD); for (i = 0; modules[i] != NULL; i++) { rv = modules[i]->C_Finalize (NULL); if (rv != CKR_OK) { name = p11_kit_module_get_name (modules[i]); p11_message ("%s: module failed to finalize: %s", name ? name : "(unknown)", p11_kit_strerror (rv)); free (name); ret = rv; } } return ret; } /** * p11_kit_modules_release: * @modules: the modules to release * * Release the a set of loaded PKCS\#11 modules. * * The modules may be either managed or unmanaged. The array containing * the module pointers is also freed by this function. * * Managed modules will not be actually released until all * callers using them have done so. If the modules were initialized, they * should have been finalized first. */ void p11_kit_modules_release (CK_FUNCTION_LIST **modules) { p11_library_init_once (); return_if_fail (modules != NULL); /* WARNING: This function must be reentrant */ p11_debug ("in"); p11_lock (); p11_message_clear (); p11_modules_release_inlock_reentrant (modules); p11_unlock (); p11_debug ("out"); } /** * p11_kit_modules_finalize_and_release: * @modules: the modules to release * * Finalize and then release the a set of loaded PKCS\#11 modules. * * The modules may be either managed or unmanaged. The array containing * the module pointers is also freed by this function. * * Modules are released even if their finalization returns an error code. * Managed modules will not be actually finalized or released until all * callers using them have done so. * * For managed modules the C_Finalize function * is overridden so that multiple callers can finalize the same * modules. In addition for managed modules multiple callers can * finalize from different threads, and still guarantee consistent * thread-safe behavior. * * For unmanaged modules if multiple callers try to finalize * a module, then one of the calls will return * CKR_CRYPTOKI_NOT_INITIALIZED according to the * PKCS\#11 specification. In addition there are no guarantees that * thread-safe behavior will occur if multiple callers initialize from * different threads. */ void p11_kit_modules_finalize_and_release (CK_FUNCTION_LIST **modules) { return_if_fail (modules != NULL); p11_kit_modules_finalize (modules); p11_kit_modules_release (modules); } /** * p11_kit_initialize_module: * @module: loaded module to initialize. * * Initialize an arbitrary PKCS\#11 module. Normally using the * p11_kit_initialize_registered() is preferred. * * Using this function to initialize modules allows coordination between * multiple users of the same module in a single process. It should be called * on modules that have been loaded (with dlopen() for example) but not yet * initialized. The caller should not yet have called the module's * C_Initialize method. This function will call * C_Initialize as necessary. * * Subsequent calls to this function for the same module will result in an * initialization count being incremented for the module. It is safe (although * usually unnecessary) to use this function on registered modules. * * The module must be finalized with p11_kit_finalize_module() instead of * calling its C_Finalize method directly. * * This function does not accept a CK_C_INITIALIZE_ARGS argument. * Custom initialization arguments cannot be supported when multiple consumers * load the same module. * * If this function fails, then an error message will be available via the * p11_kit_message() function. * * Deprecated: Since 0.19.0: Use p11_kit_module_initialize() instead. * * Returns: CKR_OK if the initialization was successful. */ CK_RV p11_kit_initialize_module (CK_FUNCTION_LIST_PTR module) { CK_FUNCTION_LIST_PTR result; Module *mod; int flags; CK_RV rv; return_val_if_fail (module != NULL, CKR_ARGUMENTS_BAD); p11_library_init_once (); /* WARNING: This function must be reentrant for the same arguments */ p11_debug ("in"); p11_lock (); p11_message_clear (); flags = P11_KIT_MODULE_CRITICAL | P11_KIT_MODULE_UNMANAGED; rv = p11_module_load_inlock_reentrant (module, flags, &result); /* An unmanaged module should return the same pointer */ assert (rv != CKR_OK || result == module); if (rv == CKR_OK) { mod = p11_dict_get (gl.unmanaged_by_funcs, module); assert (mod != NULL); rv = initialize_module_inlock_reentrant (mod); if (rv != CKR_OK) { p11_message ("module initialization failed: %s", p11_kit_strerror (rv)); p11_module_release_inlock_reentrant (module); } } p11_unlock (); p11_debug ("out: %lu", rv); return rv; } CK_RV p11_module_load_inlock_reentrant (CK_FUNCTION_LIST *module, int flags, CK_FUNCTION_LIST **result) { Module *allocated = NULL; Module *mod; CK_RV rv = CKR_OK; rv = init_globals_unlocked (); if (rv == CKR_OK) { mod = p11_dict_get (gl.unmanaged_by_funcs, module); if (mod == NULL) { p11_debug ("allocating new module"); allocated = mod = alloc_module_unlocked (); return_val_if_fail (mod != NULL, CKR_HOST_MEMORY); p11_virtual_init (&mod->virt, &p11_virtual_base, module, NULL); } /* If this was newly allocated, add it to the list */ if (rv == CKR_OK && allocated) { if (!p11_dict_set (gl.modules, allocated, allocated) || !p11_dict_set (gl.unmanaged_by_funcs, module, allocated)) return_val_if_reached (CKR_HOST_MEMORY); allocated = NULL; } if (rv == CKR_OK) { /* WARNING: Reentrancy can occur here */ rv = prepare_module_inlock_reentrant (mod, flags, result); } free (allocated); } /* * If initialization failed, we may need to cleanup. * If we added this module above, then this will * clean things up as expected. */ if (rv != CKR_OK) free_modules_when_no_refs_unlocked (); _p11_kit_default_message (rv); return rv; } /** * p11_kit_module_load: * @module_path: full file path of module library * @flags: flags to use when loading the module * * Load an arbitrary PKCS\#11 module from a dynamic library file, and * initialize it. Normally using the p11_kit_modules_load() function * is preferred. * * Using this function to load modules allows coordination between multiple * callers of the same module in a single process. If @flags contains the * %P11_KIT_MODULE_UNMANAGED flag, then the modules will be not be loaded * in 'managed' mode and not be coordinated. This is not recommended * for general usage. * * Subsequent calls to this function for the same module will result in an * initialization count being incremented for the module. It is safe (although * usually unnecessary) to use this function on registered modules. * * The module should be released with p11_kit_module_release(). * * If this function fails, then an error message will be available via the * p11_kit_message() function. * * Returns: the loaded module PKCS\#11 functions or %NULL on failure */ CK_FUNCTION_LIST * p11_kit_module_load (const char *module_path, int flags) { CK_FUNCTION_LIST *module = NULL; CK_RV rv; Module *mod; return_val_if_fail (module_path != NULL, NULL); p11_library_init_once (); /* WARNING: This function must be reentrant for the same arguments */ p11_debug ("in: %s", module_path); p11_lock (); p11_message_clear (); rv = init_globals_unlocked (); if (rv == CKR_OK) { rv = load_module_from_file_inlock (NULL, module_path, &mod); if (rv == CKR_OK) { /* WARNING: Reentrancy can occur here */ rv = prepare_module_inlock_reentrant (mod, flags, &module); if (rv != CKR_OK) module = NULL; } } /* * If initialization failed, we may need to cleanup. * If we added this module above, then this will * clean things up as expected. */ if (rv != CKR_OK) free_modules_when_no_refs_unlocked (); p11_unlock (); p11_debug ("out: %s", module ? "success" : "fail"); return module; } /** * p11_kit_finalize_module: * @module: loaded module to finalize. * * Finalize an arbitrary PKCS\#11 module. The module must have been initialized * using p11_kit_initialize_module(). In most cases callers will want to use * p11_kit_finalize_registered() instead of this function. * * Using this function to finalize modules allows coordination between * multiple users of the same module in a single process. The caller should not * call the module's C_Finalize method. This function will call * C_Finalize as necessary. * * If the module was initialized more than once, then this function will * decrement an initialization count for the module. When the count reaches zero * the module will be truly finalized. It is safe (although usually unnecessary) * to use this function on registered modules if (and only if) they were * initialized using p11_kit_initialize_module() for some reason. * * If this function fails, then an error message will be available via the * p11_kit_message() function. * * Deprecated: Since 0.19.0: Use p11_kit_module_finalize() and * p11_kit_module_release() instead. * * Returns: CKR_OK if the finalization was successful. */ CK_RV p11_kit_finalize_module (CK_FUNCTION_LIST *module) { Module *mod; CK_RV rv = CKR_OK; return_val_if_fail (module != NULL, CKR_ARGUMENTS_BAD); p11_library_init_once (); /* WARNING: This function must be reentrant for the same arguments */ p11_debug ("in"); p11_lock (); p11_message_clear (); mod = gl.unmanaged_by_funcs ? p11_dict_get (gl.unmanaged_by_funcs, module) : NULL; if (mod == NULL) { p11_debug ("module not found"); rv = CKR_ARGUMENTS_BAD; } else { /* WARNING: Rentrancy can occur here */ rv = finalize_module_inlock_reentrant (mod); } _p11_kit_default_message (rv); p11_unlock (); p11_debug ("out: %lu", rv); return rv; } /** * p11_kit_module_initialize: * @module: the module to initialize * * Initialize a PKCS\#11 module by calling its C_Initialize * function. * * For managed modules the C_Initialize function * is overridden so that multiple callers can initialize the same * modules. In addition for managed modules multiple callers can * initialize from different threads, and still guarantee consistent * thread-safe behavior. * * For unmanaged modules if multiple callers try to initialize * a module, then one of the calls will return * CKR_CRYPTOKI_ALREADY_INITIALIZED according to the * PKCS\#11 specification. In addition there are no guarantees that * thread-safe behavior will occur if multiple callers initialize from * different threads. * * This function does not accept a CK_C_INITIALIZE_ARGS argument. * Custom initialization arguments cannot be supported when multiple consumers * load the same module. * * Returns: CKR_OK or a failure code */ CK_RV p11_kit_module_initialize (CK_FUNCTION_LIST *module) { char *name; CK_RV rv; return_val_if_fail (module != NULL, CKR_ARGUMENTS_BAD); rv = module->C_Initialize (NULL); if (rv != CKR_OK) { name = p11_kit_module_get_name (module); p11_message ("%s: module failed to initialize: %s", name ? name : "(unknown)", p11_kit_strerror (rv)); free (name); } return rv; } /** * p11_kit_module_finalize: * @module: the module to finalize * * Finalize a PKCS\#11 module by calling its C_Finalize * function. * * For managed modules the C_Finalize function * is overridden so that multiple callers can finalize the same * modules. In addition for managed modules multiple callers can * finalize from different threads, and still guarantee consistent * thread-safe behavior. * * For unmanaged modules if multiple callers try to finalize * a module, then one of the calls will return * CKR_CRYPTOKI_NOT_INITIALIZED according to the * PKCS\#11 specification. In addition there are no guarantees that * thread-safe behavior will occur if multiple callers finalize from * different threads. * * Returns: CKR_OK or a failure code */ CK_RV p11_kit_module_finalize (CK_FUNCTION_LIST *module) { char *name; CK_RV rv; return_val_if_fail (module != NULL, CKR_ARGUMENTS_BAD); rv = module->C_Finalize (NULL); if (rv != CKR_OK) { name = p11_kit_module_get_name (module); p11_message ("%s: module failed to finalize: %s", name ? name : "(unknown)", p11_kit_strerror (rv)); free (name); } return rv; } /** * p11_kit_module_release: * @module: the module to release * * Release the a loaded PKCS\#11 modules. * * The module may be either managed or unmanaged. The C_Finalize * function will be called if no other callers are using this module. */ void p11_kit_module_release (CK_FUNCTION_LIST *module) { return_if_fail (module != NULL); p11_library_init_once (); /* WARNING: This function must be reentrant for the same arguments */ p11_debug ("in"); p11_lock (); p11_message_clear (); release_module_inlock_rentrant (module, __PRETTY_FUNCTION__); p11_unlock (); p11_debug ("out"); } CK_RV p11_module_release_inlock_reentrant (CK_FUNCTION_LIST *module) { return release_module_inlock_rentrant (module, __PRETTY_FUNCTION__); } /** * p11_kit_load_initialize_module: * @module_path: full file path of module library * @module: location to place loaded module pointer * * Load an arbitrary PKCS\#11 module from a dynamic library file, and * initialize it. Normally using the p11_kit_initialize_registered() function * is preferred. * * Using this function to load and initialize modules allows coordination between * multiple users of the same module in a single process. The caller should not * call the module's C_Initialize method. This function will call * C_Initialize as necessary. * * If a module has already been loaded, then use of this function is unnecesasry. * Instead use the p11_kit_initialize_module() function to initialize it. * * Subsequent calls to this function for the same module will result in an * initialization count being incremented for the module. It is safe (although * usually unnecessary) to use this function on registered modules. * * The module must be finalized with p11_kit_finalize_module() instead of * calling its C_Finalize method directly. * * This function does not accept a CK_C_INITIALIZE_ARGS argument. * Custom initialization arguments cannot be supported when multiple consumers * load the same module. * * If this function fails, then an error message will be available via the * p11_kit_message() function. * * Deprecated: Since 0.19.0: Use p11_kit_module_load() instead. * * Returns: CKR_OK if the initialization was successful. */ CK_RV p11_kit_load_initialize_module (const char *module_path, CK_FUNCTION_LIST_PTR_PTR module) { Module *mod; CK_RV rv = CKR_OK; return_val_if_fail (module_path != NULL, CKR_ARGUMENTS_BAD); return_val_if_fail (module != NULL, CKR_ARGUMENTS_BAD); p11_library_init_once (); /* WARNING: This function must be reentrant for the same arguments */ p11_debug ("in: %s", module_path); p11_lock (); p11_message_clear (); rv = init_globals_unlocked (); if (rv == CKR_OK) { rv = load_module_from_file_inlock (NULL, module_path, &mod); if (rv == CKR_OK) { /* WARNING: Reentrancy can occur here */ rv = initialize_module_inlock_reentrant (mod); } } if (rv == CKR_OK && module) { *module = unmanaged_for_module_inlock (mod); assert (*module != NULL); } /* * If initialization failed, we may need to cleanup. * If we added this module above, then this will * clean things up as expected. */ if (rv != CKR_OK) free_modules_when_no_refs_unlocked (); _p11_kit_default_message (rv); p11_unlock (); p11_debug ("out: %lu", rv); return rv; } p11-kit-0.20.2/p11-kit/pin.c0000664000175000017500000005076212225010114012022 00000000000000/* * Copyright (C) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #include "config.h" #define P11_DEBUG_FLAG P11_DEBUG_PIN #include "debug.h" #include "dict.h" #include "library.h" #include "message.h" #include "pkcs11.h" #include "p11-kit.h" #include "pin.h" #include "private.h" #include "array.h" #include #include #include #include #include #include /** * SECTION:p11-kit-pin * @title: PIN Callbacks * @short_description: PIN Callbacks * * Applications can register a callback which will be called to provide a * password associated with a given pin source. * * PKCS\#11 URIs can contain a 'pin-source' attribute. The value of this attribute * is application dependent, but often references a file containing a PIN to * use. * * Using these functions, an applications or libraries can register a * callback with p11_kit_pin_register_callback() to be called when a given * 'pin-source' attribute value is requested. The application can then prompt * the user or retrieve a PIN for the given context. These registered * callbacks are only relevant and valid within the current process. * * A fallback callback can be registered by passing the %P11_KIT_PIN_FALLBACK * value to p11_kit_pin_register_callback(). This fallback callback will be * called for every 'pin-source' attribute request for which no callback has been * directly registered. * * To request a PIN for a given 'pin-source' attribute, use the * p11_kit_pin_request() function. If this function returns %NULL then either * no callbacks were registered or none of them could handle the request. * * If multiple callbacks are registered for the same PIN source, then they are * called in last-registered-first-called order. They are called in turn until * one of them can handle the request. Fallback callbacks are not called if * a callback was registered specifically for a requested 'pin-source' attribute. * * PINs themselves are handled inside of P11KitPin structures. These are thread * safe and allow the callback to specify how the PIN is stored in memory * and freed. A callback can use p11_kit_pin_new_for_string() or related * functions to create a PIN to be returned. * * For example in order to handle the following PKCS\#11 URI with a 'pin-source' * attribute * * * pkcs11:id=\%69\%95\%3e\%5c\%f4\%bd\%ec\%91;pin-source=my-application * * * an application could register a callback like this: * * * static P11KitPin* * my_application_pin_callback (const char *pin_source, P11KitUri *pin_uri, * const char *pin_description, P11KitPinFlags pin_flags, * void *callback_data) * { * return p11_kit_pin_new_from_string ("pin-value"); * } * * p11_kit_pin_register_callback ("my-application", my_application_pin_callback, * NULL, NULL); * */ /** * P11KitPinFlags: * @P11_KIT_PIN_FLAGS_USER_LOGIN: The PIN is for a PKCS\#11 user type login. * @P11_KIT_PIN_FLAGS_SO_LOGIN: The PIN is for a PKCS\#11 security officer type login. * @P11_KIT_PIN_FLAGS_CONTEXT_LOGIN: The PIN is for a PKCS\#11 contect specific type login. * @P11_KIT_PIN_FLAGS_RETRY: The PIN is being requested again, due to an invalid previous PIN. * @P11_KIT_PIN_FLAGS_MANY_TRIES: The PIN has failed too many times, and few tries are left. * @P11_KIT_PIN_FLAGS_FINAL_TRY: The PIN has failed too many times, and this is the last try. * * Flags that are passed to p11_kit_pin_request() and registered callbacks. */ /** * P11_KIT_PIN_FALLBACK: * * Used with p11_kit_pin_register_callback() to register a fallback callback. * This callback will be called if no other callback is registered for a 'pin-source'. */ typedef struct _PinCallback { /* Only used/modified within the lock */ int refs; /* Readonly after construct */ p11_kit_pin_callback func; void *user_data; p11_kit_pin_destroy_func destroy; } PinCallback; /* * Shared data between threads, protected by the mutex, a structure so * we can audit thread safety easier. */ static struct _Shared { p11_dict *pin_sources; } gl = { NULL }; static void* ref_pin_callback (void *pointer) { PinCallback *cb = pointer; cb->refs++; return pointer; } static void unref_pin_callback (void *pointer) { PinCallback *cb = pointer; assert (cb->refs >= 1); cb->refs--; if (cb->refs == 0) { if (cb->destroy) (cb->destroy) (cb->user_data); free (cb); } } static bool register_callback_unlocked (const char *pin_source, PinCallback *cb) { p11_array *callbacks = NULL; char *name; name = strdup (pin_source); return_val_if_fail (name != NULL, false); if (gl.pin_sources == NULL) { gl.pin_sources = p11_dict_new (p11_dict_str_hash, p11_dict_str_equal, free, (p11_destroyer)p11_array_free); return_val_if_fail (gl.pin_sources != NULL, false); } if (gl.pin_sources != NULL) callbacks = p11_dict_get (gl.pin_sources, name); if (callbacks == NULL) { callbacks = p11_array_new (unref_pin_callback); return_val_if_fail (callbacks != NULL, false); if (!p11_dict_set (gl.pin_sources, name, callbacks)) return_val_if_reached (false); name = NULL; } if (!p11_array_push (callbacks, cb)) return_val_if_reached (false); free (name); return true; } /** * p11_kit_pin_register_callback: * @pin_source: the 'pin-source' attribute this this callback is for * @callback: the callback function * @callback_data: data that will be passed to the callback * @callback_destroy: a function that will be called with @callback_data when * the callback is unregistered. * * Register a callback to handle PIN requests for a given 'pin-source' attribute. * If @pin_source is set to P11_KIT_PIN_FALLBACK then this will be a fallback * callback and will be called for requests for which no other callback has * been specifically registered. * * If multiple callbacks are registered for the same @pin_source value, then * the last registered callback will be the first to be called. * * Returns: Returns negative if registering fails. */ int p11_kit_pin_register_callback (const char *pin_source, p11_kit_pin_callback callback, void *callback_data, p11_kit_pin_destroy_func callback_destroy) { PinCallback *cb; bool ret; return_val_if_fail (pin_source != NULL, -1); return_val_if_fail (callback != NULL, -1); cb = calloc (1, sizeof (PinCallback)); return_val_if_fail (cb != NULL, -1); cb->refs = 1; cb->func = callback; cb->user_data = callback_data; cb->destroy = callback_destroy; p11_lock (); ret = register_callback_unlocked (pin_source, cb); p11_unlock (); return ret ? 0 : -1; } /** * p11_kit_pin_unregister_callback: * @pin_source: the 'pin-source' attribute the callback was registered for * @callback: the callback function that was registered * @callback_data: data that was registered for the callback * * Unregister a callback that was previously registered with the * p11_kit_pin_register_callback() function. If more than one registered * callback matches the given arguments, then only one of those will be * removed. */ void p11_kit_pin_unregister_callback (const char *pin_source, p11_kit_pin_callback callback, void *callback_data) { PinCallback *cb; p11_array *callbacks; unsigned int i; return_if_fail (pin_source != NULL); return_if_fail (callback != NULL); p11_lock (); if (gl.pin_sources) { callbacks = p11_dict_get (gl.pin_sources, pin_source); if (callbacks) { for (i = 0; i < callbacks->num; i++) { cb = callbacks->elem[i]; if (cb->func == callback && cb->user_data == callback_data) { p11_array_remove (callbacks, i); break; } } if (callbacks->num == 0) p11_dict_remove (gl.pin_sources, pin_source); } /* When there are no more pin sources, get rid of the hash table */ if (p11_dict_size (gl.pin_sources) == 0) { p11_dict_free (gl.pin_sources); gl.pin_sources = NULL; } } p11_unlock (); } /** * p11_kit_pin_request: * @pin_source: the 'pin-source' attribute that is being requested * @pin_uri: a PKCS\#11 URI that the PIN is being requested for, optionally %NULL. * @pin_description: a description of what the PIN is for, must not be %NULL. * @pin_flags: various flags for this request * * Request a PIN for a given 'pin-source' attribute. The result depends on the * registered callbacks. * * If not %NULL, then the @pin_uri attribute should point to the thing that the * PIN is being requested for. In most use cases this should be a PKCS\#11 URI * pointing to a token. * * The @pin_description should always be specified. It is a string describing * what the PIN is for. For example this would be the token label, if the PIN * is for a token. * * If more than one callback is registered for the @pin_source, then the latest * registered one will be called first. If that callback does not return a * PIN, then the next will be called in turn. * * If no callback is registered for @pin_source, then the fallback callbacks will * be invoked in the same way. The fallback callbacks will not be called if any * callback has been registered specifically for @pin_source. * * The PIN returned should be released with p11_kit_pin_unref(). * * Returns: the PIN which should be released with p11_kit_pin_unref(), or %NULL * if no callback was registered or could proivde a PIN */ P11KitPin * p11_kit_pin_request (const char *pin_source, P11KitUri *pin_uri, const char *pin_description, P11KitPinFlags pin_flags) { PinCallback **snapshot = NULL; unsigned int snapshot_count = 0; p11_array *callbacks; P11KitPin *pin; unsigned int i; return_val_if_fail (pin_source != NULL, NULL); p11_lock (); /* Find and ref the pin source data */ if (gl.pin_sources) { callbacks = p11_dict_get (gl.pin_sources, pin_source); /* If we didn't find any snapshots try the global ones */ if (callbacks == NULL) callbacks = p11_dict_get (gl.pin_sources, P11_KIT_PIN_FALLBACK); if (callbacks != NULL && callbacks->num) { snapshot = memdup (callbacks->elem, sizeof (void *) * callbacks->num); snapshot_count = callbacks->num; for (i = 0; snapshot && i < snapshot_count; i++) ref_pin_callback (snapshot[i]); } } p11_unlock (); if (snapshot == NULL) return NULL; for (pin = NULL, i = snapshot_count; pin == NULL && i > 0; i--) { pin = (snapshot[i - 1]->func) (pin_source, pin_uri, pin_description, pin_flags, snapshot[i - 1]->user_data); } p11_lock (); for (i = 0; i < snapshot_count; i++) unref_pin_callback (snapshot[i]); free (snapshot); p11_unlock (); return pin; } /** * p11_kit_pin_callback: * @pin_source: a 'pin-source' attribute string * @pin_uri: a PKCS\#11 URI that the PIN is for, or %NULL * @pin_description: a descrption of what the PIN is for * @pin_flags: flags describing the PIN request * @callback_data: data that was provided when registering this callback * * Represents a PIN callback function. * * The various arguments are the same as the ones passed to * p11_kit_pin_request(). The @callback_data argument was the one passed to * p11_kit_pin_register_callback() when registering this callback. * * The function should return %NULL if it could not provide a PIN, either * because of an error or a user cancellation. * * If a PIN is returned, it will be unreferenced by the caller. So it should be * either newly allocated, or referenced before returning. * * Returns: A PIN or %NULL */ /** * p11_kit_pin_destroy_func: * @data: the data to destroy * * A function called to free or cleanup @data. */ /** * p11_kit_pin_file_callback: * @pin_source: a 'pin-source' attribute string * @pin_uri: a PKCS\#11 URI that the PIN is for, or %NULL * @pin_description: a descrption of what the PIN is for * @pin_flags: flags describing the PIN request * @callback_data: unused, should be %NULL * * This is a PIN callback function that looks up the 'pin-source' attribute in * a file with that name. This can be used to enable the normal PKCS\#11 URI * behavior described in the RFC. * * If @pin_flags contains the %P11_KIT_PIN_FLAGS_RETRY flag, then this * callback will always return %NULL. This is to prevent endless loops * where an application is expecting to interact with a prompter, but * instead is interacting with this callback reading a file over and over. * * This callback fails on files larger than 4 Kilobytes. * * This callback is not registered by default. It may have security * implications depending on the source of the PKCS\#11 URI and the PKCS\#11 * in use. To register it, use code like the following: * * * p11_kit_pin_register_callback (P11_KIT_PIN_FALLBACK, p11_kit_pin_file_callback, * NULL, NULL); * * * Returns: a referenced PIN with the file contents, or %NULL if the file * could not be read */ P11KitPin * p11_kit_pin_file_callback (const char *pin_source, P11KitUri *pin_uri, const char *pin_description, P11KitPinFlags pin_flags, void *callback_data) { const size_t block = 1024; unsigned char *buffer; unsigned char *memory; size_t used, allocated; int error = 0; int fd; int res; return_val_if_fail (pin_source != NULL, NULL); /* We don't support retries */ if (pin_flags & P11_KIT_PIN_FLAGS_RETRY) return NULL; fd = open (pin_source, O_BINARY | O_RDONLY | O_CLOEXEC); if (fd == -1) return NULL; buffer = NULL; used = 0; allocated = 0; for (;;) { if (used + block > 4096) { error = EFBIG; break; } if (used + block > allocated) { memory = realloc (buffer, used + block); if (memory == NULL) { error = ENOMEM; break; } buffer = memory; allocated = used + block; } res = read (fd, buffer + used, allocated - used); if (res < 0) { if (errno == EAGAIN) continue; error = errno; break; } else if (res == 0) { break; } else { used += res; } } close (fd); if (error != 0) { free (buffer); errno = error; return NULL; } return p11_kit_pin_new_for_buffer (buffer, used, free); } /** * P11KitPin: * * A structure representing a PKCS\#11 PIN. There are no public fields * visible in this structure. Use the various accessor functions. */ struct p11_kit_pin { int ref_count; unsigned char *buffer; size_t length; p11_kit_pin_destroy_func destroy; }; /** * p11_kit_pin_new: * @value: the value of the PIN * @length: the length of @value * * Create a new P11KitPin with the given PIN value. This function is * usually used from within registered PIN callbacks. * * Exactly @length bytes from @value are used. Null terminated strings, * or encodings are not considered. A copy of the @value will be made. * * Returns: The newly allocated P11KitPin, which should be freed with * p11_kit_pin_unref() when no longer needed. */ P11KitPin * p11_kit_pin_new (const unsigned char *value, size_t length) { unsigned char *copy; P11KitPin *pin; copy = malloc (length); return_val_if_fail (copy != NULL, NULL); memcpy (copy, value, length); pin = p11_kit_pin_new_for_buffer (copy, length, free); return_val_if_fail (pin != NULL, NULL); return pin; } /** * p11_kit_pin_new_for_string: * @value: the value of the PIN * * Create a new P11KitPin for the given null-terminated string, such as a * password. This function is usually used from within registered * PIN callbacks. * * The PIN will consist of the string not including the null terminator. * String encoding is not considered. A copy of the @value will be made. * * Returns: The newly allocated P11KitPin, which should be freed with * p11_kit_pin_unref() when no longer needed. */ P11KitPin * p11_kit_pin_new_for_string (const char *value) { return p11_kit_pin_new ((const unsigned char *)value, strlen (value)); } /** * p11_kit_pin_new_for_buffer: * @buffer: the value of the PIN * @length: the length of @buffer * @destroy: if not %NULL, then called when PIN is destroyed. * * Create a new P11KitPin which will use @buffer for the PIN value. * This function is usually used from within registered PIN callbacks. * * The buffer will not be copied. String encodings and null characters * are not considered. * * When the last reference to this PIN is lost, then the @destroy callback * function will be called passing @buffer as an argument. This allows the * caller to use a buffer as a PIN without copying it. * * * char *buffer = malloc (128); * P11KitPin *pin; * .... * pin = p11_kit_pin_new_for_buffer (buffer, 128, free); * * * Returns: The newly allocated P11KitPin, which should be freed with * p11_kit_pin_unref() when no longer needed. */ P11KitPin * p11_kit_pin_new_for_buffer (unsigned char *buffer, size_t length, p11_kit_pin_destroy_func destroy) { P11KitPin *pin; pin = calloc (1, sizeof (P11KitPin)); return_val_if_fail (pin != NULL, NULL); pin->ref_count = 1; pin->buffer = buffer; pin->length = length; pin->destroy = destroy; return pin; } /** * p11_kit_pin_get_value: * @pin: the P11KitPin * @length: a location to return the value length * * Get the PIN value from a P11KitPin. @length will be set to the * length of the value. * * The value returned is owned by the P11KitPin and should not be modified. * It remains valid as long as a reference to the PIN is held. The PIN value * will not contain an extra null-terminator character. * * Returns: the value for the PIN. */ const unsigned char * p11_kit_pin_get_value (P11KitPin *pin, size_t *length) { if (length) *length = pin->length; return pin->buffer; } /** * p11_kit_pin_get_length * @pin: the P11KitPin * * Get the length of the PIN value from a P11KitPin. * * Returns: the length of the PIN value. */ size_t p11_kit_pin_get_length (P11KitPin *pin) { return pin->length; } /** * p11_kit_pin_ref: * @pin: the P11KitPin * * Add a reference to a P11KitPin. This should be matched with a later call * to p11_kit_pin_unref(). As long as at least one reference is held, the PIN * will remain valid and in memory. * * Returns: the @pin pointer, for convenience sake. */ P11KitPin * p11_kit_pin_ref (P11KitPin *pin) { p11_lock (); pin->ref_count++; p11_unlock (); return pin; } /** * p11_kit_pin_unref: * @pin: the P11KitPin * * Remove a reference from a P11KitPin. When all references have been removed * then the PIN will be freed and will no longer be in memory. */ void p11_kit_pin_unref (P11KitPin *pin) { bool last = false; p11_lock (); last = (pin->ref_count == 1); pin->ref_count--; p11_unlock (); if (last) { if (pin->destroy) (pin->destroy) (pin->buffer); free (pin); } } p11-kit-0.20.2/p11-kit/uri.h0000664000175000017500000001432112226763526012056 00000000000000/* * Copyright (c) 2011 Collabora Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the * following disclaimer. * * Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and * the following disclaimer in the documentation and/or * other materials provided with the distribution. * * The names of contributors to this software may not be * used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * Author: Stef Walter */ #ifndef P11_KIT_URI_H #define P11_KIT_URI_H #include "p11-kit/pkcs11.h" #ifdef __cplusplus extern "C" { #endif #define P11_KIT_URI_SCHEME "pkcs11" #define P11_KIT_URI_SCHEME_LEN 6 typedef enum { P11_KIT_URI_OK = 0, P11_KIT_URI_UNEXPECTED = -1, P11_KIT_URI_BAD_SCHEME = -2, P11_KIT_URI_BAD_ENCODING = -3, P11_KIT_URI_BAD_SYNTAX = -4, P11_KIT_URI_BAD_VERSION = -5, P11_KIT_URI_NOT_FOUND = -6, } P11KitUriResult; #define P11_KIT_URI_NO_MEMORY P11_KIT_URI_UNEXPECTED typedef enum { P11_KIT_URI_FOR_OBJECT = (1 << 1), P11_KIT_URI_FOR_TOKEN = (1 << 2), P11_KIT_URI_FOR_MODULE = (1 << 3), P11_KIT_URI_FOR_MODULE_WITH_VERSION = (1 << 4) | P11_KIT_URI_FOR_MODULE, P11_KIT_URI_FOR_OBJECT_ON_TOKEN = P11_KIT_URI_FOR_OBJECT | P11_KIT_URI_FOR_TOKEN, P11_KIT_URI_FOR_OBJECT_ON_TOKEN_AND_MODULE = P11_KIT_URI_FOR_OBJECT_ON_TOKEN | P11_KIT_URI_FOR_MODULE, P11_KIT_URI_FOR_ANY = 0x0000FFFF, } P11KitUriType; /* * If the caller is using the PKCS#11 GNU calling convention, then we cater * to that here. */ #ifdef CRYPTOKI_GNU typedef struct ck_info *CK_INFO_PTR; typedef struct ck_token_info *CK_TOKEN_INFO_PTR; typedef ck_attribute_type_t CK_ATTRIBUTE_TYPE; typedef struct ck_attribute *CK_ATTRIBUTE_PTR; typedef unsigned long int CK_ULONG; typedef P11KitUriType p11_kit_uri_type_t; typedef P11KitUriResult p11_kit_uri_result_t; #endif typedef struct p11_kit_uri P11KitUri; typedef struct p11_kit_uri p11_kit_uri; CK_INFO_PTR p11_kit_uri_get_module_info (P11KitUri *uri); int p11_kit_uri_match_module_info (P11KitUri *uri, CK_INFO_PTR info); CK_TOKEN_INFO_PTR p11_kit_uri_get_token_info (P11KitUri *uri); int p11_kit_uri_match_token_info (P11KitUri *uri, CK_TOKEN_INFO_PTR token_info); CK_ATTRIBUTE_PTR p11_kit_uri_get_attribute (P11KitUri *uri, CK_ATTRIBUTE_TYPE attr_type); int p11_kit_uri_set_attribute (P11KitUri *uri, CK_ATTRIBUTE_PTR attr); int p11_kit_uri_clear_attribute (P11KitUri *uri, CK_ATTRIBUTE_TYPE attr_type); CK_ATTRIBUTE_PTR p11_kit_uri_get_attributes (P11KitUri *uri, CK_ULONG *n_attrs); int p11_kit_uri_set_attributes (P11KitUri *uri, CK_ATTRIBUTE_PTR attrs, CK_ULONG n_attrs); void p11_kit_uri_clear_attributes (P11KitUri *uri); int p11_kit_uri_match_attributes (P11KitUri *uri, CK_ATTRIBUTE_PTR attrs, CK_ULONG n_attrs); const char* p11_kit_uri_get_pin_source (P11KitUri *uri); void p11_kit_uri_set_pin_source (P11KitUri *uri, const char *pin_source); #ifndef P11_KIT_DISABLE_DEPRECATED const char* p11_kit_uri_get_pinfile (P11KitUri *uri); void p11_kit_uri_set_pinfile (P11KitUri *uri, const char *pinfile); #endif /* P11_KIT_DISABLE_DEPRECATED */ void p11_kit_uri_set_unrecognized (P11KitUri *uri, int unrecognized); int p11_kit_uri_any_unrecognized (P11KitUri *uri); P11KitUri* p11_kit_uri_new (void); int p11_kit_uri_format (P11KitUri *uri, P11KitUriType uri_type, char **string); int p11_kit_uri_parse (const char *string, P11KitUriType uri_type, P11KitUri *uri); void p11_kit_uri_free (P11KitUri *uri); const char* p11_kit_uri_message (int code); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* P11_KIT_URI_H */ p11-kit-0.20.2/configure0000775000175000017500000224500012265245665011633 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for p11-kit 0.20.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='p11-kit' PACKAGE_TARNAME='p11-kit' PACKAGE_VERSION='0.20.2' PACKAGE_STRING='p11-kit 0.20.2' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue' PACKAGE_URL='http://p11-glue.freedesktop.org/p11-kit.html' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" gt_needs= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS privatedir SHLEXT P11KIT_LT_RELEASE WITH_COVERAGE_FALSE WITH_COVERAGE_TRUE GENHTML LCOV GCOV GTK_DOC_USE_REBASE_FALSE GTK_DOC_USE_REBASE_TRUE GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_BUILD_PDF_FALSE GTK_DOC_BUILD_PDF_TRUE GTK_DOC_BUILD_HTML_FALSE GTK_DOC_BUILD_HTML_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE HTML_DIR XSLTPROC GTKDOC_SCAN GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK with_trust_paths WITH_TRUST_MODULE_FALSE WITH_TRUST_MODULE_TRUE HASH_LIBS WITH_FFI_FALSE WITH_FFI_TRUE LIBFFI_LIBS LIBFFI_CFLAGS WITH_ASN1_FALSE WITH_ASN1_TRUE LIBTASN1_LIBS LIBTASN1_CFLAGS p11_module_path p11_user_config_modules p11_user_config_file p11_user_config p11_package_config_modules p11_system_config_modules p11_system_config_file p11_system_config OS_WIN32_FALSE OS_WIN32_TRUE PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG POSUB LTLIBINTL LIBINTL INTLLIBS LTLIBICONV LIBICONV INTL_MACOSX_LIBS XGETTEXT_EXTRA_OPTIONS MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 MSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION USE_NLS CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_static enable_shared with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_nls enable_rpath with_libiconv_prefix with_libintl_prefix with_module_config with_system_config with_user_config with_module_path with_libtasn1 with_libffi with_hash_impl enable_trust_module with_trust_paths with_html_dir enable_doc enable_doc_html enable_doc_pdf enable_debug enable_strict enable_coverage ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR LIBTASN1_CFLAGS LIBTASN1_LIBS LIBFFI_CFLAGS LIBFFI_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures p11-kit 0.20.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/p11-kit] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of p11-kit 0.20.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --disable-maintainer-mode disable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths --disable-trust-module Disable building the trust module --enable-doc build documentation using gtk-doc [[default=no]] --enable-doc-html build documentation in html format [[default=yes]] --enable-doc-pdf build documentation in pdf format [[default=no]] --enable-debug=no/default/yes Turn on or off debugging --enable-strict Strict code compilation --enable-coverage Whether to enable coverage testing Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir --with-module-config Module configuration files shipped by packages --with-system-config Change PKCS#11 system config directory --with-system-config Change PKCS#11 user config directory --with-module-path Load modules with relative path names from here --without-libtasn1 Disable dependency on libtasn1 --without-libffi Don't use libffi for building closures --with-hash-impl=[freebl/internal] Choose the hash implementation to use --with-trust-paths=[path]: input paths for trust module --with-html-dir=PATH path to installed docs Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path LIBTASN1_CFLAGS C compiler flags for LIBTASN1, overriding pkg-config LIBTASN1_LIBS linker flags for LIBTASN1, overriding pkg-config LIBFFI_CFLAGS C compiler flags for LIBFFI, overriding pkg-config LIBFFI_LIBS linker flags for LIBFFI, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . p11-kit home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF p11-kit configure 0.20.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by p11-kit $as_me 0.20.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gt_needs="$gt_needs need-ngettext" gt_needs="$gt_needs need-ngettext" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # ------------------------------------------------------------------------------ # p11-kit libtool versioning # CURRENT : REVISION : AGE # +1 : 0 : +1 == new interface that does not break old one. # +1 : 0 : 0 == removed an interface. Breaks old apps. # ? : +1 : ? == internal changes that doesn't break anything. P11KIT_CURRENT=0 P11KIT_REVISION=0 P11KIT_AGE=0 # ------------------------------------------------------------------------------ ac_config_headers="$ac_config_headers config.h" ac_aux_dir= for ac_dir in build/aux "$srcdir"/build/aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build/aux \"$srcdir\"/build/aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.13' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='p11-kit' VERSION='0.20.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; powerpcle-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=yes # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } GETTEXT_MACRO_VERSION=0.18 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1; then : gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFPreferencesCopyAppValue=yes else gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 $as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFLocaleCopyCurrent=yes else gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } if eval \${$gt_func_gnugettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libc=yes" else eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$gt_func_gnugettext_libc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; const char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes else am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= HAVE_LIBINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if eval \${$gt_func_gnugettext_libintl+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libintl=yes" else eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 $as_echo_n "checking whether to use NLS... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 $as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 $as_echo "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 $as_echo "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi LINGUAS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFPreferencesCopyAppValue=yes else gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 $as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFLocaleCopyCurrent=yes else gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } if eval \${$gt_func_gnugettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libc=yes" else eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$gt_func_gnugettext_libc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; const char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes else am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= HAVE_LIBINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if eval \${$gt_func_gnugettext_libintl+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libintl=yes" else eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 $as_echo_n "checking whether to use NLS... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 $as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 $as_echo "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 $as_echo "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" if test "$enable_static" = "yes"; then as_fn_error $? "p11-kit cannot be used as a static library" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for win32" >&5 $as_echo_n "checking for win32... " >&6; } case "$host" in *-*-mingw*) cat >>confdefs.h <<_ACEOF #define OS_WIN32 1 _ACEOF os_win32=yes os_unix=no ;; *) cat >>confdefs.h <<_ACEOF #define OS_UNIX 1 _ACEOF os_win32=no os_unix=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $os_win32" >&5 $as_echo "$os_win32" >&6; } if test "$os_win32" = "yes"; then OS_WIN32_TRUE= OS_WIN32_FALSE='#' else OS_WIN32_TRUE='#' OS_WIN32_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # ------------------------------------------------------------------------------ # Checks for libraries and headers { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi if test "$os_unix" = "yes"; then ac_fn_c_check_func "$LINENO" "pthread_mutexattr_init" "ac_cv_func_pthread_mutexattr_init" if test "x$ac_cv_func_pthread_mutexattr_init" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutexattr_init in -lpthread" >&5 $as_echo_n "checking for pthread_mutexattr_init in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_mutexattr_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutexattr_init (); int main () { return pthread_mutexattr_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_mutexattr_init=yes else ac_cv_lib_pthread_pthread_mutexattr_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutexattr_init" >&5 $as_echo "$ac_cv_lib_pthread_pthread_mutexattr_init" >&6; } if test "x$ac_cv_lib_pthread_pthread_mutexattr_init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" else as_fn_error $? "could not find pthread_mutexattr_init" "$LINENO" 5 fi fi ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" if test "x$ac_cv_func_nanosleep" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5 $as_echo_n "checking for library containing nanosleep... " >&6; } if ${ac_cv_search_nanosleep+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char nanosleep (); int main () { return nanosleep (); ; return 0; } _ACEOF for ac_lib in '' rt; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_nanosleep=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_nanosleep+:} false; then : break fi done if ${ac_cv_search_nanosleep+:} false; then : else ac_cv_search_nanosleep=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5 $as_echo "$ac_cv_search_nanosleep" >&6; } ac_res=$ac_cv_search_nanosleep if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "could not find nanosleep" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl dld; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "could not find dlopen" "$LINENO" 5 fi # These are thngs we can work around for ac_func in getprogname getexecname basename mkstemp mkdtemp do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getauxval issetugid getresuid do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in strnstr memdup strndup strerror_r do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in asprintf vasprintf vsnprintf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in timegm do : ac_fn_c_check_func "$LINENO" "timegm" "ac_cv_func_timegm" if test "x$ac_cv_func_timegm" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TIMEGM 1 _ACEOF fi done ac_fn_c_check_decl "$LINENO" "asprintf" "ac_cv_have_decl_asprintf" "#include " if test "x$ac_cv_have_decl_asprintf" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ASPRINTF $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "vasprintf" "ac_cv_have_decl_vasprintf" "#include " if test "x$ac_cv_have_decl_vasprintf" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_VASPRINTF $ac_have_decl _ACEOF # Required functions for ac_func in gmtime_r do : ac_fn_c_check_func "$LINENO" "gmtime_r" "ac_cv_func_gmtime_r" if test "x$ac_cv_func_gmtime_r" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GMTIME_R 1 _ACEOF $as_echo "#define HAVE_GMTIME_R 1" >>confdefs.h else as_fn_error $? "could not find required gmtime_r() function" "$LINENO" 5 fi done # Check if these are declared and/or available to link against ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "$ac_includes_default" if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether program_invocation_short_name is available" >&5 $as_echo_n "checking whether program_invocation_short_name is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { program_invocation_short_name = "test"; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_PROGRAM_INVOCATION_SHORT_NAME 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_fn_c_check_decl "$LINENO" "__progname" "ac_cv_have_decl___progname" "$ac_includes_default" if test "x$ac_cv_have_decl___progname" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL___PROGNAME $ac_have_decl _ACEOF cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern char *__progname; int main () { __progname=(char*)0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE___PROGNAME 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern int __libc_enable_secure; int main () { __libc_enable_secure = 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE___LIBC_ENABLE_SECURE 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 $as_echo_n "checking for dgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_dgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dgettext (); int main () { return dgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_dgettext=yes else ac_cv_lib_intl_dgettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 $as_echo "$ac_cv_lib_intl_dgettext" >&6; } if test "x$ac_cv_lib_intl_dgettext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBINTL 1 _ACEOF LIBS="-lintl $LIBS" fi # ------------------------------------------------------------------------------ # PKCS#11 Directories # Check whether --with-module-config was given. if test "${with_module_config+set}" = set; then : withval=$with_module_config; module_config=$withval else module_config='${pkgdatadir}/modules' fi # Check whether --with-system-config was given. if test "${with_system_config+set}" = set; then : withval=$with_system_config; system_config_dir=$withval else system_config_dir=$sysconfdir/pkcs11 fi # Check whether --with-user-config was given. if test "${with_user_config+set}" = set; then : withval=$with_user_config; user_config_dir=$withval else user_config_dir="~/.config/pkcs11" fi # Check whether --with-module-path was given. if test "${with_module_path+set}" = set; then : withval=$with_module_path; module_path=$withval else module_path=$libdir/pkcs11 fi # We expand these so we have concrete paths p11_system_config=$system_config_dir p11_system_config_file=$p11_system_config/pkcs11.conf p11_system_config_modules=$p11_system_config/modules p11_package_config_modules=$module_config p11_user_config=$user_config_dir p11_user_config_file="$p11_user_config/pkcs11.conf" p11_user_config_modules="$p11_user_config/modules" p11_module_path="$module_path" # -------------------------------------------------------------------- # libtasn1 support # Check whether --with-libtasn1 was given. if test "${with_libtasn1+set}" = set; then : withval=$with_libtasn1; fi if test "$with_libtasn1" != "no"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBTASN1" >&5 $as_echo_n "checking for LIBTASN1... " >&6; } if test -n "$LIBTASN1_CFLAGS"; then pkg_cv_LIBTASN1_CFLAGS="$LIBTASN1_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtasn1 >= 2.3\""; } >&5 ($PKG_CONFIG --exists --print-errors "libtasn1 >= 2.3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBTASN1_CFLAGS=`$PKG_CONFIG --cflags "libtasn1 >= 2.3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBTASN1_LIBS"; then pkg_cv_LIBTASN1_LIBS="$LIBTASN1_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtasn1 >= 2.3\""; } >&5 ($PKG_CONFIG --exists --print-errors "libtasn1 >= 2.3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBTASN1_LIBS=`$PKG_CONFIG --libs "libtasn1 >= 2.3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBTASN1_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtasn1 >= 2.3" 2>&1` else LIBTASN1_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtasn1 >= 2.3" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBTASN1_PKG_ERRORS" >&5 as_fn_error $? "libtasn1 not found. Building without it results in significant loss of functionality. To proceed use --without-libtasn1" "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "libtasn1 not found. Building without it results in significant loss of functionality. To proceed use --without-libtasn1" "$LINENO" 5 else LIBTASN1_CFLAGS=$pkg_cv_LIBTASN1_CFLAGS LIBTASN1_LIBS=$pkg_cv_LIBTASN1_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi with_libtasn1="yes" cat >>confdefs.h <<_ACEOF #define WITH_ASN1 1 _ACEOF fi if test "$with_libtasn1" = "yes"; then WITH_ASN1_TRUE= WITH_ASN1_FALSE='#' else WITH_ASN1_TRUE='#' WITH_ASN1_FALSE= fi # -------------------------------------------------------------------- # libffi # Check whether --with-libffi was given. if test "${with_libffi+set}" = set; then : withval=$with_libffi; fi if test "$with_libffi" != "no"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBFFI" >&5 $as_echo_n "checking for LIBFFI... " >&6; } if test -n "$LIBFFI_CFLAGS"; then pkg_cv_LIBFFI_CFLAGS="$LIBFFI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libffi >= 3.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libffi >= 3.0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBFFI_CFLAGS=`$PKG_CONFIG --cflags "libffi >= 3.0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBFFI_LIBS"; then pkg_cv_LIBFFI_LIBS="$LIBFFI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libffi >= 3.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libffi >= 3.0.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBFFI_LIBS=`$PKG_CONFIG --libs "libffi >= 3.0.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBFFI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libffi >= 3.0.0" 2>&1` else LIBFFI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libffi >= 3.0.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBFFI_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libffi >= 3.0.0) were not met: $LIBFFI_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBFFI_CFLAGS and LIBFFI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LIBFFI_CFLAGS and LIBFFI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else LIBFFI_CFLAGS=$pkg_cv_LIBFFI_CFLAGS LIBFFI_LIBS=$pkg_cv_LIBFFI_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi cat >>confdefs.h <<_ACEOF #define WITH_FFI 1 _ACEOF SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $LIBFFI_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if FFI_CLOSURES #else #error no closures #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else as_fn_error $? "the libffi on this system has no support for closures." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" with_libffi="yes" fi if test "$with_libffi" = "yes"; then WITH_FFI_TRUE= WITH_FFI_FALSE='#' else WITH_FFI_TRUE='#' WITH_FFI_FALSE= fi # -------------------------------------------------------------------- # Hash implementation # Check whether --with-hash-impl was given. if test "${with_hash_impl+set}" = set; then : withval=$with_hash_impl; fi if test "$with_hash_impl" = ""; then : with_hash_impl=internal fi case $with_hash_impl in #( freebl) : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSSLOW_Init in -lfreebl3" >&5 $as_echo_n "checking for NSSLOW_Init in -lfreebl3... " >&6; } if ${ac_cv_lib_freebl3_NSSLOW_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfreebl3 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char NSSLOW_Init (); int main () { return NSSLOW_Init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_freebl3_NSSLOW_Init=yes else ac_cv_lib_freebl3_NSSLOW_Init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freebl3_NSSLOW_Init" >&5 $as_echo "$ac_cv_lib_freebl3_NSSLOW_Init" >&6; } if test "x$ac_cv_lib_freebl3_NSSLOW_Init" = xyes; then : HASH_LIBS=-lfreebl3 cat >>confdefs.h <<_ACEOF #define WITH_FREEBL 1 _ACEOF else as_fn_error $? "could not find the freebl3 library" "$LINENO" 5 fi ;; #( internal) : HASH_LIBS= ;; #( *) : as_fn_error $? "unsupported hash impl: $with_hash_impl" "$LINENO" 5 ;; esac # -------------------------------------------------------------------- # Trust Module # Check whether --enable-trust-module was given. if test "${enable_trust_module+set}" = set; then : enableval=$enable_trust_module; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if trust module is enabled" >&5 $as_echo_n "checking if trust module is enabled... " >&6; } if test "$with_libtasn1" != "yes"; then : if test "$enable_trust_module" = "yes"; then : as_fn_error $? "--with-libtasn1 is needed in order to build the trust module" "$LINENO" 5 fi if test "$enable_trust_module" != "no"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-libtasn1 is needed in order to build the trust module, disabling" >&5 $as_echo "$as_me: WARNING: --with-libtasn1 is needed in order to build the trust module, disabling" >&2;} fi enable_trust_module="no" fi if test "$enable_trust_module" != "no"; then : enable_trust_module="yes" fi if test "$enable_trust_module" = "yes"; then WITH_TRUST_MODULE_TRUE= WITH_TRUST_MODULE_FALSE='#' else WITH_TRUST_MODULE_TRUE='#' WITH_TRUST_MODULE_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_trust_module" >&5 $as_echo "$enable_trust_module" >&6; } # Check whether --with-trust-paths was given. if test "${with_trust_paths+set}" = set; then : withval=$with_trust_paths; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for trust module paths" >&5 $as_echo_n "checking for trust module paths... " >&6; } # This option was disabled, no anchors if test "$with_trust_paths" = "no"; then with_trust_paths="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 $as_echo "disabled" >&6; } elif test "$enable_trust_module" != "yes"; then if test "$with_trust_paths" != ""; then as_fn_error $? "need --enable-trust-module in order to specify trust module paths." "$LINENO" 5 fi with_trust_paths="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 $as_echo "disabled" >&6; } # Option was not set, try to detect elif test "$with_trust_paths" = "" -o "$with_trust_paths" = "yes"; then with_trust_paths="" for f in /etc/pki/tls/certs/ca-bundle.crt \ /etc/ssl/certs/ca-certificates.crt \ /etc/ssl/ca-bundle.pem \ /etc/ssl/ca-bundle.crt; do if test -f "$f"; then with_trust_paths="$f" break fi done if test "$with_trust_paths" = ""; then as_fn_error $? "could not find. Use --with-trust-paths=/path to set, or --without-trust-paths to disable" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_trust_paths" >&5 $as_echo "$with_trust_paths" >&6; } else # Anchors explicitly set { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_trust_paths" >&5 $as_echo "$with_trust_paths" >&6; } fi cat >>confdefs.h <<_ACEOF #define TRUST_PATHS "$with_trust_paths" _ACEOF # -------------------------------------------------------------------- # GTK Doc # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_CHECK in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK if test -n "$GTKDOC_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 $as_echo "$GTKDOC_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_prog in gtkdoc-rebase do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_REBASE+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_REBASE in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE if test -n "$GTKDOC_REBASE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 $as_echo "$GTKDOC_REBASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$GTKDOC_REBASE" && break done test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. set dummy gtkdoc-mkpdf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_MKPDF in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF if test -n "$GTKDOC_MKPDF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 $as_echo "$GTKDOC_MKPDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gtkdoc-scan", so it can be a program name with args. set dummy gtkdoc-scan; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_SCAN+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_SCAN in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_SCAN="$GTKDOC_SCAN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_SCAN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_SCAN=$ac_cv_path_GTKDOC_SCAN if test -n "$GTKDOC_SCAN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_SCAN" >&5 $as_echo "$GTKDOC_SCAN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XSLTPROC=$ac_cv_path_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then : withval=$with_html_dir; else with_html_dir='${datadir}/gtk-doc/html' fi HTML_DIR="$with_html_dir" # Check whether --enable-doc was given. if test "${enable_doc+set}" = set; then : enableval=$enable_doc; else enable_doc=no fi if test x$enable_doc = xyes; then if test -z "$GTKDOC_SCAN"; then as_fn_error $? "gtk-doc not installed and --enable-doc requested" "$LINENO" 5 fi if test -z "$XSLTPROC"; then as_fn_error $? "the xsltproc command was not found and --enable-doc requested" "$LINENO" 5 fi doc_status="yes (manual, reference)" else enable_doc=no doc_status="no (no manual or reference)" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build documentation" >&5 $as_echo_n "checking whether to build documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_doc" >&5 $as_echo "$enable_doc" >&6; } # Check whether --enable-doc-html was given. if test "${enable_doc_html+set}" = set; then : enableval=$enable_doc_html; else enable_doc_html=yes fi # Check whether --enable-doc-pdf was given. if test "${enable_doc_pdf+set}" = set; then : enableval=$enable_doc_pdf; else enable_doc_pdf=no fi if test -z "$GTKDOC_MKPDF"; then enable_doc_pdf=no fi if test x$enable_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test x$enable_doc_html = xyes; then GTK_DOC_BUILD_HTML_TRUE= GTK_DOC_BUILD_HTML_FALSE='#' else GTK_DOC_BUILD_HTML_TRUE='#' GTK_DOC_BUILD_HTML_FALSE= fi if test x$enable_doc_pdf = xyes; then GTK_DOC_BUILD_PDF_TRUE= GTK_DOC_BUILD_PDF_FALSE='#' else GTK_DOC_BUILD_PDF_TRUE='#' GTK_DOC_BUILD_PDF_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi if test -n "$GTKDOC_REBASE"; then GTK_DOC_USE_REBASE_TRUE= GTK_DOC_USE_REBASE_FALSE='#' else GTK_DOC_USE_REBASE_TRUE='#' GTK_DOC_USE_REBASE_FALSE= fi # -------------------------------------------------------------------- # Compilation and linking options { $as_echo "$as_me:${as_lineno-$LINENO}: checking for debug mode" >&5 $as_echo_n "checking for debug mode... " >&6; } # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi if test "$enable_debug" != "no"; then cat >>confdefs.h <<_ACEOF #define WITH_DEBUG 1 _ACEOF cat >>confdefs.h <<_ACEOF #define _DEBUG 1 _ACEOF CFLAGS="$CFLAGS -g" fi if test "$enable_debug" = "yes"; then debug_status="yes (-g, -O0, debug output)" CFLAGS="$CFLAGS -O0" elif test "$enable_debug" = "no"; then debug_status="no (no debug output, NDEBUG)" cat >>confdefs.h <<_ACEOF #define NDEBUG 1 _ACEOF else debug_status="default (-g, debug output)" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $debug_status" >&5 $as_echo "$debug_status" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for more warnings" >&5 $as_echo_n "checking for more warnings... " >&6; } if test "$GCC" = "yes"; then CFLAGS="$CFLAGS \ -Wall -Wstrict-prototypes -Wmissing-declarations \ -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ -Wdeclaration-after-statement -Wformat=2 -Winit-self \ -Waggregate-return -Wno-missing-format-attribute \ -fno-strict-aliasing -fno-common" for option in -Wmissing-include-dirs -Wundef; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc understands $option" >&5 $as_echo_n "checking whether gcc understands $option... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : has_option=yes else has_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_option" >&5 $as_echo "$has_option" >&6; } if test $has_option = no; then CFLAGS="$SAVE_CFLAGS" fi done else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --enable-strict was given. if test "${enable_strict+set}" = set; then : enableval=$enable_strict; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking build strict" >&5 $as_echo_n "checking build strict... " >&6; } if test "$enable_strict" = "yes"; then CFLAGS="$CFLAGS -Werror" cat >>confdefs.h <<_ACEOF #define WITH_STRICT 1 _ACEOF strict_status="yes (-Werror, fatals)" else strict_status="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $strict_status" >&5 $as_echo "$strict_status" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with gcov testing" >&5 $as_echo_n "checking whether to build with gcov testing... " >&6; } # Check whether --enable-coverage was given. if test "${enable_coverage+set}" = set; then : enableval=$enable_coverage; else enable_coverage=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_coverage" >&5 $as_echo "$enable_coverage" >&6; } if test "$enable_coverage" = "yes"; then if test "$GCC" != "yes"; then as_fn_error $? "Coverage testing requires GCC" "$LINENO" 5 fi # Extract the first word of "gcov", so it can be a program name with args. set dummy gcov; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GCOV+:} false; then : $as_echo_n "(cached) " >&6 else case $GCOV in [\\/]* | ?:[\\/]*) ac_cv_path_GCOV="$GCOV" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GCOV="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GCOV" && ac_cv_path_GCOV="no" ;; esac fi GCOV=$ac_cv_path_GCOV if test -n "$GCOV"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 $as_echo "$GCOV" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$GCOV" = "no" ; then as_fn_error $? "gcov tool is not available" "$LINENO" 5 fi # Extract the first word of "lcov", so it can be a program name with args. set dummy lcov; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_LCOV+:} false; then : $as_echo_n "(cached) " >&6 else case $LCOV in [\\/]* | ?:[\\/]*) ac_cv_path_LCOV="$LCOV" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LCOV="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LCOV" && ac_cv_path_LCOV="no" ;; esac fi LCOV=$ac_cv_path_LCOV if test -n "$LCOV"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 $as_echo "$LCOV" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$LCOV" = "no" ; then as_fn_error $? "lcov tool is not installed" "$LINENO" 5 fi # Extract the first word of "genhtml", so it can be a program name with args. set dummy genhtml; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GENHTML+:} false; then : $as_echo_n "(cached) " >&6 else case $GENHTML in [\\/]* | ?:[\\/]*) ac_cv_path_GENHTML="$GENHTML" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GENHTML="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GENHTML" && ac_cv_path_GENHTML="no" ;; esac fi GENHTML=$ac_cv_path_GENHTML if test -n "$GENHTML"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 $as_echo "$GENHTML" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$GENHTML" = "no" ; then as_fn_error $? "lcov's genhtml tool is not installed" "$LINENO" 5 fi CFLAGS="$CFLAGS -O0 -g --coverage" LDFLAGS="$LDFLAGS --coverage" fi if test "$enable_coverage" = "yes"; then WITH_COVERAGE_TRUE= WITH_COVERAGE_FALSE='#' else WITH_COVERAGE_TRUE='#' WITH_COVERAGE_FALSE= fi # --------------------------------------------------------------------- P11KIT_LT_RELEASE=$P11KIT_CURRENT:$P11KIT_REVISION:$P11KIT_AGE echo $PACKAGE_VERSION | tr '.' ' ' | while read major minor unused; do cat >>confdefs.h <<_ACEOF #define PACKAGE_MAJOR $major _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_MINOR $minor _ACEOF break done case "$host" in *-*-darwin*) # It seems like libtool lies about this see: # https://bugs.freedesktop.org/show_bug.cgi?id=57714 SHLEXT='.so' ;; *) eval SHLEXT=$shrext_cmds ;; esac cat >>confdefs.h <<_ACEOF #define SHLEXT "$SHLEXT" _ACEOF privatedir='${libdir}/p11-kit' ac_config_files="$ac_config_files Makefile common/Makefile common/tests/Makefile doc/Makefile doc/manual/Makefile po/Makefile.in p11-kit/Makefile p11-kit/tests/Makefile p11-kit/p11-kit-1.pc p11-kit/pkcs11.conf.example trust/Makefile trust/trust-extract-compat trust/tests/Makefile trust/tests/test-extract" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OS_WIN32_TRUE}" && test -z "${OS_WIN32_FALSE}"; then as_fn_error $? "conditional \"OS_WIN32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_ASN1_TRUE}" && test -z "${WITH_ASN1_FALSE}"; then as_fn_error $? "conditional \"WITH_ASN1\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_FFI_TRUE}" && test -z "${WITH_FFI_FALSE}"; then as_fn_error $? "conditional \"WITH_FFI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_TRUST_MODULE_TRUE}" && test -z "${WITH_TRUST_MODULE_FALSE}"; then as_fn_error $? "conditional \"WITH_TRUST_MODULE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_COVERAGE_TRUE}" && test -z "${WITH_COVERAGE_FALSE}"; then as_fn_error $? "conditional \"WITH_COVERAGE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by p11-kit $as_me 0.20.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . p11-kit home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ p11-kit config.status 0.20.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; "common/tests/Makefile") CONFIG_FILES="$CONFIG_FILES common/tests/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/manual/Makefile") CONFIG_FILES="$CONFIG_FILES doc/manual/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "p11-kit/Makefile") CONFIG_FILES="$CONFIG_FILES p11-kit/Makefile" ;; "p11-kit/tests/Makefile") CONFIG_FILES="$CONFIG_FILES p11-kit/tests/Makefile" ;; "p11-kit/p11-kit-1.pc") CONFIG_FILES="$CONFIG_FILES p11-kit/p11-kit-1.pc" ;; "p11-kit/pkcs11.conf.example") CONFIG_FILES="$CONFIG_FILES p11-kit/pkcs11.conf.example" ;; "trust/Makefile") CONFIG_FILES="$CONFIG_FILES trust/Makefile" ;; "trust/trust-extract-compat") CONFIG_FILES="$CONFIG_FILES trust/trust-extract-compat" ;; "trust/tests/Makefile") CONFIG_FILES="$CONFIG_FILES trust/tests/Makefile" ;; "trust/tests/test-extract") CONFIG_FILES="$CONFIG_FILES trust/tests/test-extract" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi # Format paths arguments which should wrap correctly in the output indent='\n ' trust_status=$(echo "$with_trust_paths" | sed -e "s/:/$indent/g") { $as_echo "$as_me:${as_lineno-$LINENO}: build options: Host: $host Debug build: $debug_status Strict build: $strict_status Build documentation: $doc_status System global config: $p11_system_config_file System module config directory: $p11_system_config_modules Package module config directory: $p11_package_config_modules User global config: $p11_user_config_file User module config directory: $p11_user_config_modules Load relative module paths from: $p11_module_path With libtasn1 dependency: $with_libtasn1 With libffi: $with_libffi With hash implementation: $with_hash_impl Build trust module: $enable_trust_module Trust module paths: $trust_status " >&5 $as_echo "$as_me: build options: Host: $host Debug build: $debug_status Strict build: $strict_status Build documentation: $doc_status System global config: $p11_system_config_file System module config directory: $p11_system_config_modules Package module config directory: $p11_package_config_modules User global config: $p11_user_config_file User module config directory: $p11_user_config_modules Load relative module paths from: $p11_module_path With libtasn1 dependency: $with_libtasn1 With libffi: $with_libffi With hash implementation: $with_hash_impl Build trust module: $enable_trust_module Trust module paths: $trust_status " >&6;} p11-kit-0.20.2/aclocal.m40000664000175000017500000014436112265245663011570 00000000000000# generated automatically by aclocal 1.13.4 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # intlmacosx.m4 serial 5 (gettext-0.18.2) dnl Copyright (C) 2004-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Checks for special options needed on Mac OS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in Mac OS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFPreferencesCopyAppValue(NULL, NULL)]])], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in Mac OS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFLocaleCopyCurrent();]])], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # PKG_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable pkgconfigdir as the location where a module # should install pkg-config .pc files. By default the directory is # $libdir/pkgconfig, but the default can be changed by passing # DIRECTORY. The user can override through the --with-pkgconfigdir # parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_INSTALLDIR # PKG_NOARCH_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable noarch_pkgconfigdir as the location where a # module should install arch-independent pkg-config .pc files. By # default the directory is $datadir/pkgconfig, but the default can be # changed by passing DIRECTORY. The user can override through the # --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_NOARCH_INSTALLDIR # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # ------------------------------------------- # Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])# PKG_CHECK_VAR # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.13' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.13.4], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.13.4])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([build/m4/gettext.m4]) m4_include([build/m4/iconv.m4]) m4_include([build/m4/lib-ld.m4]) m4_include([build/m4/lib-link.m4]) m4_include([build/m4/lib-prefix.m4]) m4_include([build/m4/libtool.m4]) m4_include([build/m4/ltoptions.m4]) m4_include([build/m4/ltsugar.m4]) m4_include([build/m4/ltversion.m4]) m4_include([build/m4/lt~obsolete.m4]) m4_include([build/m4/nls.m4]) m4_include([build/m4/po.m4]) m4_include([build/m4/progtest.m4]) p11-kit-0.20.2/COPYING0000664000175000017500000000264712161102013010733 00000000000000Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The names of contributors to this software may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.p11-kit-0.20.2/doc/0000775000175000017500000000000012265245672010544 500000000000000p11-kit-0.20.2/doc/manual/0000775000175000017500000000000012265245672012021 500000000000000p11-kit-0.20.2/doc/manual/p11-kit-sharing.xml0000664000175000017500000001117312226763526015305 00000000000000 Sharing PKCS#11 modules
Multiple consumers of PKCS#11 in a process As more and more applications and libraries use PKCS#11 we run into a very basic problem. The PKCS#11 modules cannot be initialized and finalized properly without coordination between the various consumers. An example: An application might use GnuTLS for TLS connections, and use libgcr for display of certificates. Both of these want to load (and initialze) the same PKCS#11 modules. There are many places where this situation occurs, including large applications like Evolution which due to their dependencies end up using both NSS and GnuTLS. Consumer A loads a PKCS#11 module and uses the module's C_Initialize function to initialize it, which works as expected. When consumer B initializes the module (also using C_Initialize), the error code CKR_CRYPTOKI_ALREADY_INITIALIZED is correctly returned. This is normal PKCS#11 specification defined behavior for when a module is initalized twice in the same process. If consumer B is aware of this situation they may choose to ignore this error code. However when the consumer A is done with its use of the PKCS#11 module it finalizes the module using the module's C_Finalize function. This is expected of a well behaved PKCS#11 consumer. This then causes errors and/or crashes for consumer B, which cannot know that the module has now been finalized out from underneath it. It is necessary for the two consumers to coordinate their initialization and finalization in some fashion. In p11-kit we provide this coordination in a loosely coupled, backwards compatible, and flexible way.
Managed modules p11-kit wraps PKCS#11 modules to manage them and customize their functionality so that they are able to be shared between multiple callers in the same process. Each caller that uses the p11_kit_modules_load() or p11_kit_module_load() function gets independent wrapped PKCS#11 module(s). This is unless a caller or module configuration specifies that a module should be used in an unmanaged fashion. When modules are managed, the following aspects are wrapped and coordinated: Calls to C_Initialize and C_Finalize can be called by multiple callers. The first time that the managed module C_Initialize is called, the PKCS#11 module's actual C_Initialize function is called. Subsequent calls by other callers will cause p11-kit to increment an internal initialization count, rather than calling C_Initialize again. Multiple callers can call the managed C_Initialize function concurrently from different threads and p11-kit will guarantee that this managed in a thread-safe manner. When the managed module C_Finalize is used to finalize a module, each time it is called it decrements the internal initialization count for that module. When the internal initialization count reaches zero, the module's actual C_Finalize function is called. Multiple callers can call the managed C_Finalize function concurrently from different threads and p11-kit will guarantee that this managed in a thread-safe manner. Call to C_CloseAllSessions only close the sessions that the caller of the managed module has opened. This allows the C_CloseAllSessions function to be used without closing sessions for other callers of the same PKCS#11 module. Managed modules have ability to log PKCS#11 method calls for debugging purposes. See the log-calls = yes module configuration option.
p11-kit-0.20.2/doc/manual/p11-kit-trust.xml0000664000175000017500000001201412226763526015026 00000000000000 ]> Trust Policy Module The trust module provides system certificate anchors, blacklists and other trust policy to crypto libraries applications. This information is exposed as PKCS#11 objects. You can use the trust command line tool to examine and modify the trust policy store.
Paths loaded by the Module The trust module loads certificates and trust policy information from preconfigured paths and allows them to be looked up via PKCS#11. The input paths can be determined with using the following command: $ pkg-config --variable p11_trust_paths p11-kit-1 /usr/share/p11-kit/trust:/etc/pki/trust Files in the following formats are supported for loading by the trust policy module: X.509 certificates X.509 certificates in raw DER format. Does not automatically contain trust policy information. PEM certificates X.509 certificates in PEM format. These have a BEGIN CERTIFICATE header. This file does not automatically contain trust policy information. OpenSSL trust certificates OpenSSL specific certificates in PEM format that contain trust information. These have a BEGIN TRUSTED CERTIFICATE PEM header. Both trust anchor and blacklist information can be loaded from these files. If the input path is a file, then it is loaded. Certificate(s) in the file are automatically treated as anchors, unless they contain alternate trust policy information. If the input path is a directory, files inside that directory are parsed and loaded. If the file contains trust policy information (such as the OpenSSL trust certificates) then it will be respected. Files without trust policy information are not automatically marked as an anchor or blacklisted. In addition two optional subdirectories of the input path are loaded. Files placed in the anchors/ subdirectory become trust anchors when they do not contain trust policy information. Files placed in the blacklist/ subdirectory are blacklisted whether they contain trust information or not. The first input path becomes the first PKCS#11 token of the trust module, and has the highest priority when callers search for trust policy information.
Using the Trust Policy Module with NSS The trust policy module is a drop in replacement for the libnssckbi.so module and thus works out of the box with NSS. The trust policy module provides NSS style PKCS#11 trust objects for NSS to retrieve. The module may be used to replace the libnssckbi.so file via an distribution specific alternatives mechanism or otherwise. Alternatively NSS applications like Firefox or Thunderbird may be configured to use the trust policy module by adding the p11-kit-trust.so PKCS#11 module via their GUI or command line configuration.
Using the Trust Policy Module with glib-networking The trust policy module can be used as a source of trust information for glib-networking's gnutls-pkcs11 backend. The module provides PKCS#11 trust assertion objects as expected. The module should work by default if the gnutls-pkcs11 backend is selected as the glib-networking TLS backend.
Disabling the Trust Policy Module This module is installed and enabled by default. It may be disabled in the following ways: Use the during the p11-kit build. Disable loading trust policy information from this module by adding a file to &sysdir;/modules called p11-kit-trust.module containing a trust-policy: no line. Disable this module completely by adding a file to &sysdir;/modules called p11-kit-trust.module containing a enable-in: line (without a value).
p11-kit-0.20.2/doc/manual/userdir.xml0000664000175000017500000000002412265207765014135 00000000000000/data/.config/pkcs11p11-kit-0.20.2/doc/manual/p11-kit-docs.xml0000664000175000017500000000246512226763526014606 00000000000000 ]> p11-kit for p11-kit &version; Manual Pages API Reference API Index p11-kit-0.20.2/doc/manual/style.css0000664000175000017500000000324012144374545013610 00000000000000@import url("gtk-doc.css"); TABLE.navigation { background-color: #f9b631 !important; border-width: 0 !important; color: white; font-family: Georgia, "Times New Roman", Times, serif; height: 4em !important; } TABLE.navigation TH { font-size: 30pt !important; font-weight: normal; text-align: left !important; padding-left: 10pt; } TABLE.navigation TH:first-child { padding-left: 40pt; } .shortcuts { color: white !important; } .shortcuts a { color: white !important; font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; } P.title { font-size: 30pt !important; } BODY { padding-top: 5.5em !important; } DIV.book, DIV.refentry, DIV.chapter, DIV.index, DIV.footer, DIV.section { font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 9.5pt; line-height: 150%; } BODY > DIV.book, BODY > DIV.footer { margin-left: 1em; margin-right: 1em; } BODY > DIV.refentry, BODY > DIV.chapter, BODY > DIV.index, BODY > DIV.section { margin-left: 3em; margin-right: 1em; } DIV.variablelist TABLE { font-size: 9.5pt; line-height: 150%; } DIV.refsect1, DIV.refsect2, DIV.refsynopsisdiv { margin-bottom: 3em !important; } H1 { position: relative; left: -1em; font-weight: normal !important; } H2 { position: relative; left: -1em; font-weight: normal !important; } H3 { position: relative; left: -1em; font-weight: normal !important; } CODE.option { white-space: nowrap; } DIV.toc DL { margin-top: 0; margin-bottom: 0; } DIV.book > DIV.toc > DL > DT { margin-top: 1em; } DIV.toc DT { margin-bottom: 0.3em; } TABLE.variablelist SPAN.term { padding-right: 1em; } DIV.cmdsynopsis { font-family: monospace; } p11-kit-0.20.2/doc/manual/trust.xml0000664000175000017500000003030712226763526013647 00000000000000 trust p11-kit Maintainer Stef Walter stef@thewalter.net trust 1 User Commands trust Tool for operating on the trust policy store trust list trust extract --filter=<what> --format=<type> /path/to/destination trust anchor /path/to/certificate.crt Description trust is a command line tool to examine and modify the shared trust policy store. See the various sub commands below. The following global options can be used: Run in verbose mode with debug output. Run in quiet mode without warning or failure messages. List List trust policy store items. $ trust list List information about the various items in the trust policy store. Each item is listed with it's PKCS#11 URI and some descriptive information. You can specify the following options to control what to list. Specifies what certificates to extract. You can specify the following values: Certificate anchors Anchors and blacklist (default) Blacklisted certificates All certificates A PKCS#11 URI to filter with If an output format is chosen that cannot support type what has been specified by the filter, a message will be printed. None of the available formats support storage of blacklist entries that do not contain a full certificate. Thus any certificates blacklisted by their issuer and serial number alone, are not included in the extracted blacklist. Limit to certificates usable for the given purpose You can specify one of the following values: For authenticating servers For authenticating clients For email protection For authenticated signed code An arbitrary purpose OID Anchor Store or remove trust anchors. $ trust anchor /path/to/certificate.crt $ trust anchor --remove /path/to/certificate.crt $ trust anchor --remove "pkcs11:id=%AA%BB%CC%DD%EE;object-type=cert" Store or remove trust anchors in the trust policy store. These are usually root certificate authorities. Specify either the or operations. If no operation is specified then is assumed. When storing, one or more certificate files are expected on the command line. These are stored as anchors, unless they are already present. When removing an anchor, either specify certificate files or PKCS#11 URI's on the command line. Matching anchors will be removed. It may be that this command needs to be run as root in order to modify the system trust policy store, if no user specific store is available. You can specify the following options. Remove one or more anchors from the trust policy store. Specify certificate files or PKCS#11 URI's on the command line. Store one or more anchors to the trust policy store. Specify certificate files on the command line. Extract Extract trust policy from the shared trust policy store. $ trust extract --format=x509-directory --filter=ca-anchors /path/to/directory You can specify the following options to control what to extract. The and arguments should be specified. By default this command will not overwrite the destination file or directory. Add identifying comments to PEM bundle output files before each certificate. Specifies what certificates to extract. You can specify the following values: Certificate anchors (default) Anchors and blacklist Blacklisted certificates All certificates A PKCS#11 URI If an output format is chosen that cannot support type what has been specified by the filter, a message will be printed. None of the available formats support storage of blacklist entries that do not contain a full certificate. Thus any certificates blacklisted by their issuer and serial number alone, are not included in the extracted blacklist. The format of the destination file or directory. You can specify one of the following values: DER X.509 certificate file directory of X.509 certificates File containing one or more certificate PEM blocks Directory PEM files each containing one certifiacte OpenSSL specific PEM bundle of certificates Directory of OpenSSL specific PEM files Java keystore 'cacerts' certificate bundle Overwrite output file or directory. Limit to certificates usable for the given purpose You can specify one of the following values: For authenticating servers For authenticating clients For email protection For authenticated signed code An arbitrary purpose OID Extract Compat Extract compatibility trust certificate bundles. $ trust extract-compat OpenSSL, Java and some versions of GnuTLS cannot currently read trust information directly from the trust policy store. This command extracts trust information such as certificate anchors for use by these libraries. What this command does, and where it extracts the files is distribution or site specific. Packagers or administrators are expected customize this command. Bugs Please send bug reports to either the distribution bug tracker or the upstream bug tracker at https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue&component=p11-kit. See also p11-kit8 An explanatory document about storing trust policy: http://p11-glue.freedesktop.org/doc/storing-trust-policy/ Further details available in the p11-kit online documentation at http://p11-glue.freedesktop.org/doc/p11-kit/. p11-kit-0.20.2/doc/manual/pkcs11.conf.xml0000664000175000017500000002403312226763526014513 00000000000000 ]> pkcs11.conf p11-kit Maintainer Stef Walter stef@thewalter.net pkcs11.conf 5 System Files pkcs11.conf Configuration files for PKCS#11 modules Description The pkcs11.conf configuration files are a standard way to configure PKCS#11 modules. File format A complete configuration consists of several files. These files are text files. Since p11-kit is built to be used in all sorts of environments and at very low levels of the software stack, we cannot make use of high level configuration APIs that you may find on a modern desktop. Each setting in the config file is specified consists of a name and a value. The name is a simple string consisting of characters and dashes. The name consists of alpha numeric characters, dot, hyphen and underscore. The value is specified after the name on the same line, separated from it by a : (colon). White space between the name and value is ignored. Blank lines are ignored. White space at the beginning or end of lines is stripped. Lines that begin with a # character are ignored as comments. Comments are not recognized when they come after a value on a line. A fictitious module configuration file might look like: module: module.so # Here is a comment managed: true setting.2: A long value with text. x-custom : text Module Configuration Each configured PKCS#11 module has its own config file. These files can be placed in various locations. The filename of the configuration file may consist of upper and lowercase letters underscore, comma, dash and dots. The first characters needs to be an alphanumeric, the filename should end with a .module extension. Most importantly each config file specifies the path of the PKCS#11 module to load. A module config file has the following fields: The filename of the PKCS#11 module to load. This should include an extension like .so If this value is blank, then the module will be ignored. This can be used in the user configs to override loading of a module specified in the system configuration. If this is a relative path, then the module will be loaded from the default module directory. Set to yes if the module is critical and required to load. If a critical module fails to load or initialize, then the loading process for all registered modules will abort and return an error code. This argument is optional and defaults to no. A comma and/or space separated list of names of programs that this module should only be loaded in. The module will not be loaded for other programs using p11-kit. The base name of the process executable should be used here, for example seahorse, ssh. This is not a security feature. The argument is optional. If not present, then any process will load the module. A comma and/or space separated list of names of programs that this module should not be loaded in. The module will be loaded for any other programs using p11-kit. The base name of the process executable should be used here, for example firefox, thunderbird-bin. This is not a security feature. The argument is optional. If not present, then any process will load the module. Set to no if the module is not to be managed by p11-kit. Making a module unmanaged is not recommended, and will cause problems if multiple callers in a single process share a PKCS#11 module. This argument is optonal and defaults to yes. The value should be an integer. When lists of modules are returned to a caller of p11-kit, modules with a higher number are sorted first. When applications search modules for for certificates, keys and trust policy information, this setting will affect what find first. This argument is optional, and defaults to zero. Modules with the same option will be sorted alphabetically. Set to yes to use use this module as a source of trust policy information such as certificate anchors and black lists. log-calls: Set to yes to write a log to stderr of all the calls into the module. This is only supported for managed modules. This argument is optonal and defaults to no. Do not specify both enable-in and disable-in for the same module. Other fields may be present, but it is recommended that field names that are not specified in this document start with a x- prefix. Global Configuration A global configuration may also be present. This file contains settings that are not related to a single PKCS#11 module. The location(s) of the global configuration are described below. The global configuration file can contain the following fields: This will be equal to one of the following values: none, merge, only. Set to yes or no to force all modules to be managed or unmanaged by p11-kit. Setting this setting in a global configuration file will override the managed setting in the individual module configuration files. Making modules unmanaged is not recommended, and will cause problems if multiple callers in a single process share a PKCS#11 module. This argument is optonal. log-calls: Set to yes to write a log to stderr of all the calls into all configured modules. This is only supported for managed modules. This argument is optional. Other fields may be present, but it is recommended that field names that are not specified in this document start with a x- prefix. Configuration Files Each configured PKCS#11 module is has its own config file. These files are placed in a directory. In addition a global config file exists. There is a system configuration consisting of the various module config files and a file for global configuration. Optionally each user can provide additional configuration or override the system configuration. The system global configuration file is usually in &sysdir;/pkcs11.conf and the user global configuration file is in &userdir;/pkcs11.conf in the user's home directory. The module config files are usually located in the &sysdir;/modules directory, with one configuration file per module. In addition the &userdir;/modules directory can be used for modules installed by the user. Note that user configuration files are not loaded from the home directory if running inside a setuid or setgid program. The default system config file and module directory can be changed when building p11-kit. Always lookup these paths using pkg-config. See also p11-kit8 Further details available in the p11-kit online documentation at http://p11-glue.freedesktop.org/doc/p11-kit/. p11-kit-0.20.2/doc/manual/p11-kit-overrides.txt0000664000175000017500000000000012144374545015654 00000000000000p11-kit-0.20.2/doc/manual/annotation-glossary.xml0000664000175000017500000000407712144374545016504 00000000000000 ]> Annotation Glossary A allow-none NULL is ok, both for passing and for returning. array Parameter points to an array of items. E element-type Generics and defining elements of containers and arrays. I inout Parameter for input and for returning results. Default is transfer full. O out Parameter for returning results. Default is transfer full. T transfer full Free data after the code is done. type Override the parsed C type with given type transfer none Don't free data after the code is done. p11-kit-0.20.2/doc/manual/p11-kit.types0000664000175000017500000000000012265245672014203 00000000000000p11-kit-0.20.2/doc/manual/sysdir.xml0000664000175000017500000000001312265207765013773 00000000000000/etc/pkcs11p11-kit-0.20.2/doc/manual/html/0000775000175000017500000000000012265245672012765 500000000000000p11-kit-0.20.2/doc/manual/html/config-files.html0000664000175000017500000000423412265245672016143 00000000000000 Configuration Files

Configuration Files

A complete configuration consists of several files. These files are text files. Since p11-kit is built to be used in all sorts of environments and at very low levels of the software stack, we cannot make use of high level configuration APIs that you may find on a modern desktop.

See the manual page for more details on the format and available options.

Note that user configuration files are not loaded from the home directory if running inside a setuid or setgid program.

p11-kit-0.20.2/doc/manual/html/trust-module.html0000664000175000017500000001140312265245672016236 00000000000000 Trust Policy Module

Trust Policy Module

The trust module provides system certificate anchors, blacklists and other trust policy to crypto libraries applications. This information is exposed as PKCS#11 objects.

You can use the trust command line tool to examine and modify the trust policy store.

Paths loaded by the Module

The trust module loads certificates and trust policy information from preconfigured paths and allows them to be looked up via PKCS#11. The input paths can be determined with using the following command:

$ pkg-config --variable p11_trust_paths p11-kit-1
/usr/share/p11-kit/trust:/etc/pki/trust

Files in the following formats are supported for loading by the trust policy module:

X.509 certificates

X.509 certificates in raw DER format. Does not automatically contain trust policy information.

PEM certificates

X.509 certificates in PEM format. These have a BEGIN CERTIFICATE header. This file does not automatically contain trust policy information.

OpenSSL trust certificates

OpenSSL specific certificates in PEM format that contain trust information. These have a BEGIN TRUSTED CERTIFICATE PEM header. Both trust anchor and blacklist information can be loaded from these files.

If the input path is a file, then it is loaded. Certificate(s) in the file are automatically treated as anchors, unless they contain alternate trust policy information.

If the input path is a directory, files inside that directory are parsed and loaded. If the file contains trust policy information (such as the OpenSSL trust certificates) then it will be respected. Files without trust policy information are not automatically marked as an anchor or blacklisted.

In addition two optional subdirectories of the input path are loaded. Files placed in the anchors/ subdirectory become trust anchors when they do not contain trust policy information. Files placed in the blacklist/ subdirectory are blacklisted whether they contain trust information or not.

The first input path becomes the first PKCS#11 token of the trust module, and has the highest priority when callers search for trust policy information.

p11-kit-0.20.2/doc/manual/html/devel-commands.html0000664000175000017500000000501212265245672016467 00000000000000 Customizing installed commands

Customizing installed commands

The p11-kit tool provides a extract-trust command which extracts trust policy information such as certificate anchors and so on into files for use with libraries that cannot read this trust information directly.

In order to be useful the extract-trust command needs to be customized per distribution or site. You can find this file in at tools/p11-kit-trust-extract.in in the p11-kit source code.

The command is implemented as a simple script which performs the various p11-kit extract commands necessary to extract the information.

Using this script as a standard way to extract this information allows for consistency between distributions and ease of system administration.

p11-kit-0.20.2/doc/manual/html/up.png0000644000175000017500000000062612265245672014041 00000000000000PNG  IHDRw=bKGD pHYs  ~tIME2.E#IDATx=J@Fo] !+2[Z<@/9|t$D9nnBjBRIsI:H8UPN1fcsN95M㧖ɵ 束1~pEe$I 7nrDf!;`'ykI䲤sI_]y^^I>O>?YBIENDB`p11-kit-0.20.2/doc/manual/html/devel-building.html0000664000175000017500000002354612265245672016477 00000000000000 Compiling p11-kit from Source

Compiling p11-kit from Source

This describes how to compiling the p11-kit package from source code. This is normally only necessary for those wishing to contribute to the project or package p11-kit.

You can download tarballs of the releases of p11-kit or check out the source code from git. This documentation will not go into all the details of how to get your development environment set up and instead focus on the what's unique to compiling p11-kit.

Building on UNIX

p11-kit uses the standard GNU build system, using autoconf for package configuration and resolving portability issues, automake for building makefiles that comply with the GNU Coding Standards, and libtool for building shared libraries on multiple platforms. The normal sequence for compiling and installing the p11-kit library is thus:

$ ./configure --prefix=/path/to/prefix ...
$ make
$ make install

If you've checked out the source code from git, then the configure script does not yet exist. So use the following instead:

$ ./autogen.sh --prefix=/path/to/prefix ...
$ make
$ make install

The standard options provided by GNU autoconf may be passed to the configure script. Please see the autoconf documentation or run ./configure --help for information about the standard options. In particular you probably want to adjust the --prefix=/xxx argument depending on your system and development environment.

Optional Dependencies

On a modern GNU Linux system, p11-kit has no required dependencies other than the standard C library. However on older UNIX systems, some of the following may be required.

  • gettext is required if your system doesn't have the gettext() functionality for handling message translation databases. This can be provided by the libintl library from the GNU gettext package.

  • pthread is required if your (ancient) system doesn't have this included in the base system. How this is provided is platform specific.

In addition p11-kit has several optional dependencies. If these are not available during the build, then certain features will be disabled.

  • libffi for sharing of PKCS#11 modules between multiple callers in the same process. It is highly recommended that this dependency be treated as a required dependency.

  • gtk-doc is required to build the reference manual. Use --enable-doc to control this dependency.

  • xsltproc is required to build the command manual pages. Use --enable-doc to control this dependency.

  • libtasn1 is required to build the trust module and code that interacts with certificates.

  • freebl3 (developed as part of the NSS code base) is an optional dependency that may be used to meet policy requirements of system builders. Enabling this dependency provides no other advantage.

Extra Configuration Options

In addition to the normal options, the configure script in the p11-kit library supports these additional arguments:

--disable-trust-module

Disables building of the trust policy module.

--disable-debug, --enable-debug

By default p11-kit is built with debug symbols assertions and and precondition checks. Enabling the debug option configures even more detailed debug build, including disabling optimization. Disabling the debug option is not recommended, as it disables all assertions, preconditions and internal consistency checks, although it may result it a slightly faster library.

--enable-doc

Enables building of the documentation and command line manual. The documentation is built in the doc/html/ directory of the build. Requires the gtk-doc and xsltproc dependencies.

--enable-strict

Enables strict checks during building of p11-kit. All compiler warnings become errors.

--with-hash-impl=freebl

Instead of using internal hash code, link to the freebl3 library and use its hash implementations. The only advantage this brings is to meet the policy requirements of system builders.

--with-libtasn1, --without-libtasn1

Build with a dependency on the libtasn1 library. This dependency allows the trust policy module to be built as well as other code that interacts with certificates.

--with-module-path

Specify the path to look for PKCS#11 modules which were listed in a module config file with a relative path.

--with-trust-paths

Specify the files or directories to look for certificate anchors and blacklists. Multiple files and/or directories are specified with a : in between them. The first path has the highest priority when searching for certificates.

--with-system-config

Specify the path to look for p11-kit config files. This usually defaults to something like /etc/pkcs11

--with-user-config

Specify the path to look for user specific p11-kit config files. If specify a path that begins with ~/ then this is expanded to the home directory of the user running p11-kit. If you specify a path that begins with ~/.config/ then this is expanded to the $XDG_CONFIG_HOME directory, as outlined in the XDG Base Dir specification. This option defaults to ~/.pkcs11

p11-kit-0.20.2/doc/manual/html/config-example.html0000664000175000017500000000745412265245672016503 00000000000000 Example

Example

The following sections describe the config format in detail. But first an example which shows the various features. The configuration below, loads two modules called 'my-module' and 'nss'. The user settings override some aspects of the system settings.

Global configuration file: /etc/pkcs11/pkcs11.conf

# This setting controls whether to load user configuration from the
# /data/.config/pkcs11 directory. Possible values:
#    none: No user configuration
#    merge: Merge the user config over the system configuration (default)
#    only: Only user configuration, ignore system configuration
user-config: merge

One module configuration file per module: /etc/pkcs11/modules/my-module

# This setting controls the actual module library to load. This config file
# might be installed by the package that installs this module library. This
# is not an absolute path name. Relative path names are loaded from the
# $(libdir)/pkcs11 directory by default.
module: my-pkcs11-module.so

# This controls whether the module is required to successfully initialize. If 'yes', then
# a failure to load or initialize this module will result in a p11-kit system failure.
critical: no

User configuration file: /data/.config/pkcs11/pkcs11.conf

# This is an empty file. Files that do not exist are treated as empty.

User configuration file: /data/.config/pkcs11/modules/my-module

# Merge with the settings in the system my-module config file. In this case
# a developer has overridden to load a different module for my-module instead.
module: /home/user/src/custom-module/my-module.so

User configuration file: /data/.config/pkcs11/modules/nss

# Load the NSS libsoftokn.so.3 PKCS#11 library as a module. Note that we pass
# some custom non-standard initialization arguments, as NSS expects.
module: /usr/lib/libsoftokn3.so
x-init-reserved: configdir='sql:/home/test/.pki/nssdb' certPrefix='' keyPrefix='' secmod='socmod.db'
critical: yes
p11-kit-0.20.2/doc/manual/html/pkcs11-conf.html0000664000175000017500000002655212265245672015632 00000000000000 pkcs11.conf

pkcs11.conf

pkcs11.conf — Configuration files for PKCS#11 modules

Description

The pkcs11.conf configuration files are a standard way to configure PKCS#11 modules.

File format

A complete configuration consists of several files. These files are text files. Since p11-kit is built to be used in all sorts of environments and at very low levels of the software stack, we cannot make use of high level configuration APIs that you may find on a modern desktop.

Each setting in the config file is specified consists of a name and a value. The name is a simple string consisting of characters and dashes. The name consists of alpha numeric characters, dot, hyphen and underscore.

The value is specified after the name on the same line, separated from it by a : (colon). White space between the name and value is ignored.

Blank lines are ignored. White space at the beginning or end of lines is stripped. Lines that begin with a # character are ignored as comments. Comments are not recognized when they come after a value on a line.

A fictitious module configuration file might look like:

module: module.so
# Here is a comment

managed: true
setting.2: A long value with text.
x-custom : text

Module Configuration

Each configured PKCS#11 module has its own config file. These files can be placed in various locations.

The filename of the configuration file may consist of upper and lowercase letters underscore, comma, dash and dots. The first characters needs to be an alphanumeric, the filename should end with a .module extension.

Most importantly each config file specifies the path of the PKCS#11 module to load. A module config file has the following fields:

module:

The filename of the PKCS#11 module to load. This should include an extension like .so

If this value is blank, then the module will be ignored. This can be used in the user configs to override loading of a module specified in the system configuration.

If this is a relative path, then the module will be loaded from the default module directory.

critical:

Set to yes if the module is critical and required to load. If a critical module fails to load or initialize, then the loading process for all registered modules will abort and return an error code.

This argument is optional and defaults to no.

enable-in:

A comma and/or space separated list of names of programs that this module should only be loaded in. The module will not be loaded for other programs using p11-kit. The base name of the process executable should be used here, for example seahorse, ssh.

This is not a security feature. The argument is optional. If not present, then any process will load the module.

disable-in:

A comma and/or space separated list of names of programs that this module should not be loaded in. The module will be loaded for any other programs using p11-kit. The base name of the process executable should be used here, for example firefox, thunderbird-bin.

This is not a security feature. The argument is optional. If not present, then any process will load the module.

managed:

Set to no if the module is not to be managed by p11-kit. Making a module unmanaged is not recommended, and will cause problems if multiple callers in a single process share a PKCS#11 module.

This argument is optonal and defaults to yes.

priority:

The value should be an integer. When lists of modules are returned to a caller of p11-kit, modules with a higher number are sorted first. When applications search modules for for certificates, keys and trust policy information, this setting will affect what find first.

This argument is optional, and defaults to zero. Modules with the same priority option will be sorted alphabetically.

trust-policy:

Set to yes to use use this module as a source of trust policy information such as certificate anchors and black lists.

log-calls:

Set to yes to write a log to stderr of all the calls into the module. This is only supported for managed modules.

This argument is optonal and defaults to no.

Do not specify both enable-in and disable-in for the same module.

Other fields may be present, but it is recommended that field names that are not specified in this document start with a x- prefix.

Global Configuration

A global configuration may also be present. This file contains settings that are not related to a single PKCS#11 module. The location(s) of the global configuration are described below. The global configuration file can contain the following fields:

user-config:

This will be equal to one of the following values: none, merge, only.

managed:

Set to yes or no to force all modules to be managed or unmanaged by p11-kit. Setting this setting in a global configuration file will override the managed setting in the individual module configuration files. Making modules unmanaged is not recommended, and will cause problems if multiple callers in a single process share a PKCS#11 module.

This argument is optonal.

log-calls:

Set to yes to write a log to stderr of all the calls into all configured modules. This is only supported for managed modules.

This argument is optional.

Other fields may be present, but it is recommended that field names that are not specified in this document start with a x- prefix.

Configuration Files

Each configured PKCS#11 module is has its own config file. These files are placed in a directory. In addition a global config file exists. There is a system configuration consisting of the various module config files and a file for global configuration. Optionally each user can provide additional configuration or override the system configuration.

The system global configuration file is usually in /etc/pkcs11/pkcs11.conf and the user global configuration file is in /data/.config/pkcs11/pkcs11.conf in the user's home directory.

The module config files are usually located in the /etc/pkcs11/modules directory, with one configuration file per module. In addition the /data/.config/pkcs11/modules directory can be used for modules installed by the user.

Note that user configuration files are not loaded from the home directory if running inside a setuid or setgid program.

The default system config file and module directory can be changed when building p11-kit. Always lookup these paths using pkg-config.

See also

p11-kit(8)

Further details available in the p11-kit online documentation at http://p11-glue.freedesktop.org/doc/p11-kit/.

p11-kit-0.20.2/doc/manual/html/devel.html0000664000175000017500000000721412265245672014676 00000000000000 Building, Packaging, and Contributing to p11-kit p11-kit-0.20.2/doc/manual/html/devel-building-style.html0000664000175000017500000000624412265245672017631 00000000000000 Coding Style

Coding Style

We use a code style similar to the linux kernel. Use tabs to indent and spaces to align/wrap beyond the indentation level.

We don't try to guarantee completely robust and problem free behavior in cases where the caller or system isn't behaving. We consider these to be outside of our control:

  • Broken input from callers. We use preconditions to check input and immediately return. We don't try to provide error codes for all the various ways callers can screw around.

  • Out of memory. It is pretty much impossible to handle out of memory errors correctly. Handling them alongside other errors is naive and broken. We don't try to guarantee library state (such as locks or memory leaks) when memory allocation fails.

    We do check the results from all memory allocations, but treat them as unexpected conditions. As a nod to the behavior of callers of this library, we don't abort on memory allocation failures. We use preconditions with somewhat sane results.

    Exception: when reading files or allocating potentially unbounded amounts of memory, we should respond robustly to memory allocation failures.

These unexpected conditions indicate a bug either in p11-kit or in the system. All bets are off once this occurs.

Use the return_val_xxx() precondition macros to check for unexpected conditions.

p11-kit-0.20.2/doc/manual/html/p11-kit-Future.html0000664000175000017500000013640212265245672016237 00000000000000 Future

Future

Future — Future Unstable API

Description

API that is not yet stable enough to be enabled by default. In all likelyhood this will be included in the next release. To use this API you must define a MACRO. See the p11-kit.h header for more details.

Details

p11_kit_set_progname ()

void                p11_kit_set_progname                (const char *progname);

Set the program base name that is used by the enable-in and disable-in module configuration options.

Normally this is automatically calculated from the program's argument list. You would usually call this before initializing p11-kit modules.

progname :

the program base name

p11_kit_be_quiet ()

void                p11_kit_be_quiet                    (void);

Once this function is called, the p11-kit library will no longer print failure or warning messages to stderr.


p11_kit_be_loud ()

void                p11_kit_be_loud                     (void);

Tell the p11-kit library will print failure or warning messages to stderr. This is the default behavior, but can be changed using p11_kit_be_quiet().


p11_kit_destroyer ()

void                (*p11_kit_destroyer)                (void *data);

A callback called to free a resource.

data :

data to destroy

P11KitIter

typedef struct p11_kit_iter P11KitIter;

Used to iterate over PKCS#11 objects.


p11_kit_iter

typedef P11KitIter p11_kit_iter;

p11_kit_iter_new ()

P11KitIter *        p11_kit_iter_new                    (P11KitUri *uri,
                                                         P11KitIterBehavior behavior);

Create a new PKCS#11 iterator for iterating over objects. Only objects that match the uri will be returned by the iterator. Relevant information in uri is copied, and you need not keep uri around.

If no uri is specified then the iterator will iterate over all objects, unless otherwise filtered.

uri :

a PKCS#11 URI to filter on, or NULL. [allow-none]

behavior :

various behavior flags for iterator

Returns :

a new iterator, which should be freed with p11_kit_iter_free(). [transfer full]

p11_kit_iter_set_uri ()

void                p11_kit_iter_set_uri                (P11KitIter *iter,
                                                         P11KitUri *uri);

Set the PKCS#11 uri for iterator. Only objects that match the uri will be returned by the iterator. Relevant information in uri is copied, and you need not keep uri around.

If no uri is specified then the iterator will iterate over all objects, unless otherwise filtered.

This function should be called at most once, and should be called before iterating begins.

iter :

the iterator

uri :

a PKCS#11 URI to filter on, or NULL. [allow-none]

p11_kit_iter_add_callback ()

void                p11_kit_iter_add_callback           (P11KitIter *iter,
                                                         p11_kit_iter_callback callback,
                                                         void *callback_data,
                                                         p11_kit_destroyer callback_destroy);

Adds a callback to the iterator which will be called each time that an object is iterated.

These callbacks can also perform filtering. If any callback indicates through it's matches argument that the object should not match, then that object will not be iterated as far as p11_kit_iter_next() is concerned.

The callbacks will be called with the matches set to CK_TRUE and it's up to filters to change it to CK_FALSE when necessary.

iter :

the iterator

callback :

a function to call for each iteration

callback_data :

data to pass to the function. [allow-none]

callback_destroy :

used to cleanup the data. [allow-none]

p11_kit_iter_add_filter ()

void                p11_kit_iter_add_filter             (P11KitIter *iter,
                                                         CK_ATTRIBUTE *matching,
                                                         CK_ULONG count);

Add a filter to limit the objects that the iterator iterates over.

Only objects matching the passed in attributes will be iterated. This function can be called multiple times.

The matching attributes are copied.

iter :

the iterator

matching :

the attributes that the objects should match. [array length=count]

count :

the number of attributes

p11_kit_iter_callback ()

CK_RV               (*p11_kit_iter_callback)            (P11KitIter *iter,
                                                         CK_BBOOL *matches,
                                                         void *data);

A callback setup with p11_kit_iter_add_callback(). This callback is called for each object iterated.

If the callback sets matches to CK_FALSE, then this object is skipped and not matched by p11_kit_iter_next(). If you return anything but CKR_OK, then the iteration is stopped, and p11_kit_iter_next() returns the result code.

iter :

the iterator

matches :

whether to match the current object. [out]

data :

callback data

Returns :

CKR_OK to continue iterating, CKR_CANCEL to stop, or anything else to fail

p11_kit_iter_begin ()

void                p11_kit_iter_begin                  (P11KitIter *iter,
                                                         CK_FUNCTION_LIST_PTR *modules);

Begin iterating PKCS#11 objects in the given modules.

The modules arguments should be a null-terminated list of pointers to the modules' PKCS#11 function pointers.

For each module, all initialized slots will be iterated over, having sessions opened for each of them in turn, and searched for objects matching the search criteria.

iter :

the iterator

modules :

null-terminated list of modules to iterate over. [array zero-terminated=1]

p11_kit_iter_begin_with ()

void                p11_kit_iter_begin_with             (P11KitIter *iter,
                                                         CK_FUNCTION_LIST_PTR module,
                                                         CK_SLOT_ID slot,
                                                         CK_SESSION_HANDLE session);

Begin iterating PKCS#11 objects in the given module.

If slot is non-zero then the iteration will be limited to that slot.

If session is non-zero then the iteration will be limited to objects visible through that session, which implies that they are also limited to the slot which the session was opened for.

iter :

the iterator

module :

the module to iterate over

slot :

the slot to iterate objects in, or zero. [allow-none]

session :

the session to search for objects on, or zero. [allow-none]

p11_kit_iter_next ()

CK_RV               p11_kit_iter_next                   (P11KitIter *iter);

Iterate to the next matching object.

To access the object, session and so on, use the p11_kit_iter_get_object(), p11_kit_iter_get_session(), and p11_kit_iter_get_module() functions.

This call must only be called after either p11_kit_iter_begin() or p11_kit_iter_begin_with() have been called.

Objects which are skipped by callbacks will not be returned here as matching objects.

iter :

the iterator

Returns :

CKR_OK if an object matched, CKR_CANCEL if no more objects, or another error

p11_kit_iter_get_module ()

CK_FUNCTION_LIST_PTR p11_kit_iter_get_module            (P11KitIter *iter);

Get the module function pointers for the current matching object.

This can only be called after p11_kit_iter_next() succeeds.

iter :

the iterator

Returns :

the module which the current matching object is in

p11_kit_iter_get_slot ()

CK_SLOT_ID          p11_kit_iter_get_slot               (P11KitIter *iter);

Get the slot which the current matching object is on.

This can only be called after p11_kit_iter_next() succeeds.

iter :

the iterator

Returns :

the slot of the current matching object

p11_kit_iter_get_token ()

CK_TOKEN_INFO *     p11_kit_iter_get_token              (P11KitIter *iter);

Get the token info for the token which the current matching object is on.

This can only be called after p11_kit_iter_next(0 succeeds.

iter :

the iterator

Returns :

the slot of the current matching object.

p11_kit_iter_get_session ()

CK_SESSION_HANDLE   p11_kit_iter_get_session            (P11KitIter *iter);

Get the session which the current matching object is acessible through.

This can only be called after p11_kit_iter_next() succeeds.

The session may be closed after the next p11_kit_iter_next() call unless p11_kit_iter_keep_session() is called.

iter :

the iterator

Returns :

the session used to find the current matching object

p11_kit_iter_keep_session ()

CK_SESSION_HANDLE   p11_kit_iter_keep_session           (P11KitIter *iter);

After calling this function the session open for iterating the current object will not be automatically closed by the iterator after later calls to p11_kit_iter_next() or p11_kit_iter_free().

It is the callers responsibility to close this session, after the iterator has been freed. The session may still be used by the iterator if further iterations are performed.

This can only be called after p11_kit_iter_next() succeeds.

iter :

the iterator

Returns :

the current session

p11_kit_iter_get_object ()

CK_OBJECT_HANDLE    p11_kit_iter_get_object             (P11KitIter *iter);

Get the current matching object.

This can only be called after p11_kit_iter_next() succeeds.

iter :

the iterator

Returns :

the current matching object

p11_kit_iter_load_attributes ()

CK_RV               p11_kit_iter_load_attributes        (P11KitIter *iter,
                                                         CK_ATTRIBUTE *template,
                                                         CK_ULONG count);

Retrieve attributes for the current matching object.

Each attribute in the array will be filled in with the value of that attribute retrieved from the object. After use the attribute value memory pointed to by the pValue of each attribute should be freed with the free() function.

If the pValue of an attribute is not NULL passed to this function, then it will be passed to realloc() to allocate the correct amount of space for the attribute value.

If any attribute is not present on the object, or is sensitive and cannot be retrieved, then the pValue will be NULL. If pValue was not NULL when passed to this function then it will be freed with free(). In these cases CKR_OK is returned.

This can only be called after p11_kit_iter_next() succeeds.

iter :

the iterator

template :

the attributes to load. [array length=count][inout]

count :

the number of attributes

Returns :

CKR_OK or a failure code

p11_kit_iter_destroy_object ()

CK_RV               p11_kit_iter_destroy_object         (P11KitIter *iter);

Destory the current matching object.

This can only be called after p11_kit_iter_next() succeeds.

iter :

teh iterator

Returns :

CKR_OK or a failure code

p11_kit_iter_free ()

void                p11_kit_iter_free                   (P11KitIter *iter);

Frees the iterator and all resources, such as sessions or callbacks held by the iterator.

iter :

the iterator

enum P11KitIterBehavior

typedef enum {
	P11_KIT_ITER_BUSY_SESSIONS = 1 << 1,
	P11_KIT_ITER_WANT_WRITABLE = 1 << 2,
} P11KitIterBehavior;

Various flags controling the behavior of the iterator.

P11_KIT_ITER_BUSY_SESSIONS

Allow the iterator's sessions to be in a busy state when the iterator returns an object.

P11_KIT_ITER_WANT_WRITABLE

Try to open read-write sessions when iterating over obojects.
p11-kit-0.20.2/doc/manual/html/config.html0000664000175000017500000000476212265245672015051 00000000000000 PKCS#11 Configuration

PKCS#11 Configuration

Consistent configuration

In order for multiple applications on the user's desktop to use PKCS#11 modules in a consistent manner, there must be a configuration or registry to specify which modules to load and how to use them. The PKCS#11 specification does not specify such a configuration standard.

Because of the multi-library module initialization problem, use of PKCS#11 modules must be coordinated within an application. p11-kit provides that coordination. Since coordination is required, it follows that p11-kit can also implement a consistent module configuration.

p11-kit-0.20.2/doc/manual/html/left-insensitive.png0000644000175000017500000000061312265245672016701 00000000000000PNG  IHDRabKGD pHYs B(xtIMEƫqIDAT8͒NQ@pds`*4@W@ A!Ԇ@6^ 5hxIH R`sQp̙339B|sKEQTK@۝΁i^~Wʆ`0TJ6TcYn6A ƀ~߱>}ǭs; lYkwr 5U= /" "uU=ɲlArDzp5I4^E+P3Ɯq_p ̥iUYp=#IENDB`p11-kit-0.20.2/doc/manual/html/style.css0000664000175000017500000000324012265245672014556 00000000000000@import url("gtk-doc.css"); TABLE.navigation { background-color: #f9b631 !important; border-width: 0 !important; color: white; font-family: Georgia, "Times New Roman", Times, serif; height: 4em !important; } TABLE.navigation TH { font-size: 30pt !important; font-weight: normal; text-align: left !important; padding-left: 10pt; } TABLE.navigation TH:first-child { padding-left: 40pt; } .shortcuts { color: white !important; } .shortcuts a { color: white !important; font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; } P.title { font-size: 30pt !important; } BODY { padding-top: 5.5em !important; } DIV.book, DIV.refentry, DIV.chapter, DIV.index, DIV.footer, DIV.section { font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif; font-size: 9.5pt; line-height: 150%; } BODY > DIV.book, BODY > DIV.footer { margin-left: 1em; margin-right: 1em; } BODY > DIV.refentry, BODY > DIV.chapter, BODY > DIV.index, BODY > DIV.section { margin-left: 3em; margin-right: 1em; } DIV.variablelist TABLE { font-size: 9.5pt; line-height: 150%; } DIV.refsect1, DIV.refsect2, DIV.refsynopsisdiv { margin-bottom: 3em !important; } H1 { position: relative; left: -1em; font-weight: normal !important; } H2 { position: relative; left: -1em; font-weight: normal !important; } H3 { position: relative; left: -1em; font-weight: normal !important; } CODE.option { white-space: nowrap; } DIV.toc DL { margin-top: 0; margin-bottom: 0; } DIV.book > DIV.toc > DL > DT { margin-top: 1em; } DIV.toc DT { margin-bottom: 0.3em; } TABLE.variablelist SPAN.term { padding-right: 1em; } DIV.cmdsynopsis { font-family: monospace; } p11-kit-0.20.2/doc/manual/html/sharing-managed.html0000664000175000017500000001062212265245672016621 00000000000000 Managed modules

Managed modules

p11-kit wraps PKCS#11 modules to manage them and customize their functionality so that they are able to be shared between multiple callers in the same process.

Each caller that uses the p11_kit_modules_load() or p11_kit_module_load() function gets independent wrapped PKCS#11 module(s). This is unless a caller or module configuration specifies that a module should be used in an unmanaged fashion.

When modules are managed, the following aspects are wrapped and coordinated:

  • Calls to C_Initialize and C_Finalize can be called by multiple callers.

    The first time that the managed module C_Initialize is called, the PKCS#11 module's actual C_Initialize function is called. Subsequent calls by other callers will cause p11-kit to increment an internal initialization count, rather than calling C_Initialize again.

    Multiple callers can call the managed C_Initialize function concurrently from different threads and p11-kit will guarantee that this managed in a thread-safe manner.

  • When the managed module C_Finalize is used to finalize a module, each time it is called it decrements the internal initialization count for that module. When the internal initialization count reaches zero, the module's actual C_Finalize function is called.

    Multiple callers can call the managed C_Finalize function concurrently from different threads and p11-kit will guarantee that this managed in a thread-safe manner.

  • Call to C_CloseAllSessions only close the sessions that the caller of the managed module has opened. This allows the C_CloseAllSessions function to be used without closing sessions for other callers of the same PKCS#11 module.

  • Managed modules have ability to log PKCS#11 method calls for debugging purposes. See the log-calls = yes module configuration option.

p11-kit-0.20.2/doc/manual/html/p11-kit-URIs.html0000664000175000017500000014342412265245672015611 00000000000000 URIs

URIs

URIs — Parsing and formatting PKCS#11 URIs

Synopsis

#define             P11_KIT_URI_SCHEME
#define             P11_KIT_URI_SCHEME_LEN
enum                P11KitUriType;
enum                P11KitUriResult;
typedef             P11KitUri;
typedef             p11_kit_uri;
P11KitUri *         p11_kit_uri_new                     (void);
CK_INFO_PTR         p11_kit_uri_get_module_info         (P11KitUri *uri);
int                 p11_kit_uri_match_module_info       (P11KitUri *uri,
                                                         CK_INFO_PTR info);
CK_TOKEN_INFO_PTR   p11_kit_uri_get_token_info          (P11KitUri *uri);
int                 p11_kit_uri_match_token_info        (P11KitUri *uri,
                                                         CK_TOKEN_INFO_PTR token_info);
CK_ATTRIBUTE_PTR    p11_kit_uri_get_attributes          (P11KitUri *uri,
                                                         CK_ULONG *n_attrs);
int                 p11_kit_uri_set_attributes          (P11KitUri *uri,
                                                         CK_ATTRIBUTE_PTR attrs,
                                                         CK_ULONG n_attrs);
void                p11_kit_uri_clear_attributes        (P11KitUri *uri);
int                 p11_kit_uri_match_attributes        (P11KitUri *uri,
                                                         CK_ATTRIBUTE_PTR attrs,
                                                         CK_ULONG n_attrs);
CK_ATTRIBUTE_PTR    p11_kit_uri_get_attribute           (P11KitUri *uri,
                                                         CK_ATTRIBUTE_TYPE attr_type);
int                 p11_kit_uri_set_attribute           (P11KitUri *uri,
                                                         CK_ATTRIBUTE_PTR attr);
int                 p11_kit_uri_clear_attribute         (P11KitUri *uri,
                                                         CK_ATTRIBUTE_TYPE attr_type);
void                p11_kit_uri_set_unrecognized        (P11KitUri *uri,
                                                         int unrecognized);
int                 p11_kit_uri_any_unrecognized        (P11KitUri *uri);
const char *        p11_kit_uri_get_pin_source          (P11KitUri *uri);
void                p11_kit_uri_set_pin_source          (P11KitUri *uri,
                                                         const char *pin_source);
const char *        p11_kit_uri_get_pinfile             (P11KitUri *uri);
void                p11_kit_uri_set_pinfile             (P11KitUri *uri,
                                                         const char *pinfile);
int                 p11_kit_uri_format                  (P11KitUri *uri,
                                                         P11KitUriType uri_type,
                                                         char **string);
int                 p11_kit_uri_parse                   (const char *string,
                                                         P11KitUriType uri_type,
                                                         P11KitUri *uri);
void                p11_kit_uri_free                    (P11KitUri *uri);
const char *        p11_kit_uri_message                 (int code);
#define             P11_KIT_URI_NO_MEMORY

Description

PKCS#11 URIs can be used in configuration files or applications to represent PKCS#11 modules, tokens or objects. An example of a URI might be:


     pkcs11:token=The%20Software%20PKCS#11%20softtoken;
         manufacturer=Snake%20Oil,%20Inc.;serial=;object=my-certificate;
         model=1.0;object-type=cert;id=%69%95%3e%5c%f4%bd%ec%91

You can use p11_kit_uri_parse() to parse such a URI, and p11_kit_uri_format() to build one. URIs are represented by the P11KitUri structure. You can match a parsed URI against PKCS#11 tokens with p11_kit_uri_match_token_info() or attributes with p11_kit_uri_match_attributes().

Since URIs can represent different sorts of things, when parsing or formatting a URI a 'context' can be used to indicate which sort of URI is expected.

URIs have an unrecognized flag. This flag is set during parsing if any parts of the URI are not recognized. This may be because the part is from a newer version of the PKCS#11 spec or because that part was not valid inside of the desired context used when parsing.

Details

P11_KIT_URI_SCHEME

#define P11_KIT_URI_SCHEME "pkcs11"

String of URI scheme for PKCS#11 URIs.


P11_KIT_URI_SCHEME_LEN

#define P11_KIT_URI_SCHEME_LEN 6

Length of P11_KIT_URI_SCHEME.


enum P11KitUriType

typedef enum {
	P11_KIT_URI_FOR_OBJECT =  (1 << 1),
	P11_KIT_URI_FOR_TOKEN =   (1 << 2),
	P11_KIT_URI_FOR_MODULE =  (1 << 3),

	P11_KIT_URI_FOR_MODULE_WITH_VERSION =
		(1 << 4) | P11_KIT_URI_FOR_MODULE,

	P11_KIT_URI_FOR_OBJECT_ON_TOKEN =
		P11_KIT_URI_FOR_OBJECT | P11_KIT_URI_FOR_TOKEN,

	P11_KIT_URI_FOR_OBJECT_ON_TOKEN_AND_MODULE =
		P11_KIT_URI_FOR_OBJECT_ON_TOKEN | P11_KIT_URI_FOR_MODULE,

	P11_KIT_URI_FOR_ANY =     0x0000FFFF,
} P11KitUriType;

A PKCS#11 URI can represent different kinds of things. This flag is used by p11_kit_uri_parse() to denote in what context the URI will be used.

The various types can be combined.

P11_KIT_URI_FOR_OBJECT

The URI represents one or more objects

P11_KIT_URI_FOR_TOKEN

The URI represents one or more tokens

P11_KIT_URI_FOR_MODULE

The URI represents one or more modules

P11_KIT_URI_FOR_MODULE_WITH_VERSION

The URI represents a module with a specific version.

P11_KIT_URI_FOR_OBJECT_ON_TOKEN

The URI represents one or more objects that are present on a specific token.

P11_KIT_URI_FOR_OBJECT_ON_TOKEN_AND_MODULE

The URI represents one or more objects that are present on a specific token, being used with a certain module.

P11_KIT_URI_FOR_ANY

The URI can represent anything

enum P11KitUriResult

typedef enum {
	P11_KIT_URI_OK = 0,
	P11_KIT_URI_UNEXPECTED = -1,
	P11_KIT_URI_BAD_SCHEME = -2,
	P11_KIT_URI_BAD_ENCODING = -3,
	P11_KIT_URI_BAD_SYNTAX = -4,
	P11_KIT_URI_BAD_VERSION = -5,
	P11_KIT_URI_NOT_FOUND = -6,
} P11KitUriResult;

Error codes returned by various functions. The functions each clearly state which error codes they are capable of returning.

P11_KIT_URI_OK

Success

P11_KIT_URI_UNEXPECTED

Unexpected or internal system error

P11_KIT_URI_BAD_SCHEME

The URI had a bad scheme

P11_KIT_URI_BAD_ENCODING

The URI had a bad encoding

P11_KIT_URI_BAD_SYNTAX

The URI had a bad syntax

P11_KIT_URI_BAD_VERSION

The URI contained a bad version number

P11_KIT_URI_NOT_FOUND

A requested part of the URI was not found

P11KitUri

typedef struct p11_kit_uri P11KitUri;

A structure representing a PKCS#11 URI. There are no public fields visible in this structure. Use the various accessor functions.


p11_kit_uri

typedef struct p11_kit_uri p11_kit_uri;

p11_kit_uri_new ()

P11KitUri *         p11_kit_uri_new                     (void);

Create a new blank PKCS#11 URI.

The new URI is in the right state to parse a string into. All relevant fields are zeroed out. Formatting this URI will produce a valid but empty URI.

Returns :

A newly allocated URI. This should be freed with p11_kit_uri_free().

p11_kit_uri_get_module_info ()

CK_INFO_PTR         p11_kit_uri_get_module_info         (P11KitUri *uri);

Get the CK_INFO structure associated with this URI.

If this is a parsed URI, then the fields corresponding to library parts of the URI will be filled in. Any library URI parts that were missing will have their fields filled with zeros.

If the caller wishes to setup information for building a URI, then relevant fields should be filled in. Fields that should not appear as parts in the resulting URI should be filled with zeros.

uri :

the URI

Returns :

A pointer to the CK_INFO structure.

p11_kit_uri_match_module_info ()

int                 p11_kit_uri_match_module_info       (P11KitUri *uri,
                                                         CK_INFO_PTR info);

Match a CK_INFO structure against the library parts of this URI.

Only the fields of the CK_INFO structure that are valid for use in a URI will be matched. A URI part that was not specified in the URI will match any value in the structure. If during the URI parsing any unrecognized parts were encountered then this match will fail.

uri :

the URI

info :

the structure to match against the URI

Returns :

1 if the URI matches, 0 if not.

p11_kit_uri_get_token_info ()

CK_TOKEN_INFO_PTR   p11_kit_uri_get_token_info          (P11KitUri *uri);

Get the CK_TOKEN_INFO structure associated with this URI.

If this is a parsed URI, then the fields corresponding to token parts of the URI will be filled in. Any token URI parts that were missing will have their fields filled with zeros.

If the caller wishes to setup information for building a URI, then relevant fields should be filled in. Fields that should not appear as parts in the resulting URI should be filled with zeros.

uri :

the URI

Returns :

A pointer to the CK_INFO structure.

p11_kit_uri_match_token_info ()

int                 p11_kit_uri_match_token_info        (P11KitUri *uri,
                                                         CK_TOKEN_INFO_PTR token_info);

Match a CK_TOKEN_INFO structure against the token parts of this URI.

Only the fields of the CK_TOKEN_INFO structure that are valid for use in a URI will be matched. A URI part that was not specified in the URI will match any value in the structure. If during the URI parsing any unrecognized parts were encountered then this match will fail.

uri :

the URI

token_info :

the structure to match against the URI

Returns :

1 if the URI matches, 0 if not.

p11_kit_uri_get_attributes ()

CK_ATTRIBUTE_PTR    p11_kit_uri_get_attributes          (P11KitUri *uri,
                                                         CK_ULONG *n_attrs);

p11_kit_uri_set_attributes ()

int                 p11_kit_uri_set_attributes          (P11KitUri *uri,
                                                         CK_ATTRIBUTE_PTR attrs,
                                                         CK_ULONG n_attrs);

p11_kit_uri_clear_attributes ()

void                p11_kit_uri_clear_attributes        (P11KitUri *uri);

p11_kit_uri_match_attributes ()

int                 p11_kit_uri_match_attributes        (P11KitUri *uri,
                                                         CK_ATTRIBUTE_PTR attrs,
                                                         CK_ULONG n_attrs);

Match a attributes against the object parts of this URI.

Only the attributes that are valid for use in a URI will be matched. A URI part that was not specified in the URI will match any attribute value. If during the URI parsing any unrecognized parts were encountered then this match will fail.

uri :

The URI

attrs :

The attributes to match

n_attrs :

The number of attributes

Returns :

1 if the URI matches, 0 if not.

p11_kit_uri_get_attribute ()

CK_ATTRIBUTE_PTR    p11_kit_uri_get_attribute           (P11KitUri *uri,
                                                         CK_ATTRIBUTE_TYPE attr_type);

Get a pointer to an attribute present in this URI.

uri :

The URI

attr_type :

The attribute type

Returns :

A pointer to the attribute, or NULL if not present. The attribute is owned by the URI and should not be freed.

p11_kit_uri_set_attribute ()

int                 p11_kit_uri_set_attribute           (P11KitUri *uri,
                                                         CK_ATTRIBUTE_PTR attr);

Set an attribute on the URI.

Only attributes that map to parts in a PKCS#11 URI will be accepted.

uri :

The URI

attr :

The attribute to set

Returns :

P11_KIT_URI_OK if the attribute was successfully set. P11_KIT_URI_NOT_FOUND if the attribute was not valid for a URI.

p11_kit_uri_clear_attribute ()

int                 p11_kit_uri_clear_attribute         (P11KitUri *uri,
                                                         CK_ATTRIBUTE_TYPE attr_type);

Clear an attribute on the URI.

Only attributes that map to parts in a PKCS#11 URI will be accepted.

uri :

The URI

attr_type :

The type of the attribute to clear

Returns :

P11_KIT_URI_OK if the attribute was successfully cleared. P11_KIT_URI_NOT_FOUND if the attribute was not valid for a URI.

p11_kit_uri_set_unrecognized ()

void                p11_kit_uri_set_unrecognized        (P11KitUri *uri,
                                                         int unrecognized);

Set the unrecognized flag on this URI.

The unrecognized flag is automatically set to 1 when during parsing any part of the URI is unrecognized. If the unrecognized flag is set to 1, then matching against this URI will always fail.

uri :

The URI

unrecognized :

The new unregognized flag value

p11_kit_uri_any_unrecognized ()

int                 p11_kit_uri_any_unrecognized        (P11KitUri *uri);

Get the unrecognized flag for this URI.

The unrecognized flag is automatically set to 1 when during parsing any part of the URI is unrecognized. If the unrecognized flag is set to 1, then matching against this URI will always fail.

uri :

The URI

Returns :

1 if unrecognized flag is set, 0 otherwise.

p11_kit_uri_get_pin_source ()

const char *        p11_kit_uri_get_pin_source          (P11KitUri *uri);

Get the 'pin-source' part of the URI. This is used by some applications to lookup a PIN for logging into a PKCS#11 token.

uri :

The URI

Returns :

The pin-source or NULL if not present.

p11_kit_uri_set_pin_source ()

void                p11_kit_uri_set_pin_source          (P11KitUri *uri,
                                                         const char *pin_source);

Set the 'pin-source' part of the URI. This is used by some applications to lookup a PIN for logging into a PKCS#11 token.

uri :

The URI

pin_source :

The new pin-source

p11_kit_uri_get_pinfile ()

const char *        p11_kit_uri_get_pinfile             (P11KitUri *uri);

Warning

p11_kit_uri_get_pinfile is deprecated and should not be used in newly-written code. use p11_kit_uri_get_pin_source().

uri :

The URI

p11_kit_uri_set_pinfile ()

void                p11_kit_uri_set_pinfile             (P11KitUri *uri,
                                                         const char *pinfile);

Warning

p11_kit_uri_set_pinfile is deprecated and should not be used in newly-written code. use p11_kit_uri_set_pin_source().

uri :

The URI

pinfile :

The pinfile

p11_kit_uri_format ()

int                 p11_kit_uri_format                  (P11KitUri *uri,
                                                         P11KitUriType uri_type,
                                                         char **string);

Format a PKCS#11 URI into a string.

Fields which are zeroed out will not be included in the resulting string. Attributes which are not present will also not be included.

The uri_type of URI specified limits the different parts of the resulting URI. To format a URI containing all possible information use P11_KIT_URI_FOR_ANY

It's up to the caller to guarantee that the attributes set in uri are those appropriate for inclusion in a URI, specifically: CKA_ID, CKA_LABEL and CKA_CLASS. The class must be one of CKO_DATA, CKO_SECRET_KEY, CKO_CERTIFICATE, CKO_PUBLIC_KEY, CKO_PRIVATE_KEY.

The resulting string should be freed with free().

uri :

The URI.

uri_type :

The type of URI that should be produced.

string :

Location to store a newly allocated string.

Returns :

P11_KIT_URI_OK if the URI was formatted successfully, P11_KIT_URI_UNEXPECTED if the data in uri is invalid for a URI.

p11_kit_uri_parse ()

int                 p11_kit_uri_parse                   (const char *string,
                                                         P11KitUriType uri_type,
                                                         P11KitUri *uri);

Parse a PKCS#11 URI string.

PKCS#11 URIs can represent tokens, objects or modules. The uri_type argument allows the caller to specify what type of URI is expected and the sorts of things the URI should match. P11_KIT_URI_FOR_ANY can be used to parse a URI for any context. It's then up to the caller to make sense of the way that it is used.

If the PKCS#11 URI contains unrecognized URI parts or parts not applicable to the specified context, then the unrecognized flag will be set. This will prevent the URI from matching using the various match functions.

string :

The string to parse

uri_type :

The type of URI that is expected

uri :

The blank URI to parse the values into

Returns :

P11_KIT_URI_OK if the URI was parsed successfully. P11_KIT_URI_BAD_SCHEME if this was not a PKCS#11 URI. P11_KIT_URI_BAD_SYNTAX if the URI syntax was bad. P11_KIT_URI_BAD_VERSION if a version number was bad. P11_KIT_URI_BAD_ENCODING if the URI encoding was invalid.

p11_kit_uri_free ()

void                p11_kit_uri_free                    (P11KitUri *uri);

Free a PKCS#11 URI.

uri :

The URI

p11_kit_uri_message ()

const char *        p11_kit_uri_message                 (int code);

Lookup a message for the uri error code. These codes are the P11_KIT_URI_XXX error codes that can be returned from p11_kit_uri_parse() or p11_kit_uri_format(). As a special case NULL, will be returned for P11_KIT_URI_OK.

code :

The error code

Returns :

The message for the error code. This string is owned by the p11-kit library.

P11_KIT_URI_NO_MEMORY

#define P11_KIT_URI_NO_MEMORY P11_KIT_URI_UNEXPECTED

Unexpected memory allocation failure result. Same as P11_KIT_URI_UNEXPECTED.

p11-kit-0.20.2/doc/manual/html/reference.html0000664000175000017500000006661612265245672015550 00000000000000 API Reference

API Reference

Modules — Module loading and initializing
URIs — Parsing and formatting PKCS#11 URIs
PIN Callbacks — PIN Callbacks
Utilities — PKCS#11 utilities
Future — Future Unstable API
Deprecated — Deprecated functions
API Index
Annotation Glossary

API Index

K

P11KitIter, typedef in Future
P11KitIterBehavior, enum in Future
P11KitPin, typedef in PIN Callbacks
P11KitPinFlags, enum in PIN Callbacks
P11KitUri, typedef in URIs
P11KitUriResult, enum in URIs
P11KitUriType, enum in URIs
p11_kit_be_loud, function in Future
p11_kit_be_quiet, function in Future
p11_kit_config_option, function in Modules
P11_KIT_DEPRECATED_FOR, macro in Deprecated
p11_kit_destroyer, user_function in Future
p11_kit_finalize_module, function in Deprecated
p11_kit_finalize_registered, function in Deprecated
p11_kit_initialize_module, function in Deprecated
p11_kit_initialize_registered, function in Deprecated
p11_kit_iter, typedef in Future
p11_kit_iter_add_callback, function in Future
p11_kit_iter_add_filter, function in Future
p11_kit_iter_begin, function in Future
p11_kit_iter_begin_with, function in Future
p11_kit_iter_callback, user_function in Future
p11_kit_iter_destroy_object, function in Future
p11_kit_iter_free, function in Future
p11_kit_iter_get_module, function in Future
p11_kit_iter_get_object, function in Future
p11_kit_iter_get_session, function in Future
p11_kit_iter_get_slot, function in Future
p11_kit_iter_get_token, function in Future
p11_kit_iter_keep_session, function in Future
p11_kit_iter_load_attributes, function in Future
p11_kit_iter_new, function in Future
p11_kit_iter_next, function in Future
p11_kit_iter_set_uri, function in Future
p11_kit_load_initialize_module, function in Deprecated
p11_kit_message, function in Utilities
p11_kit_modules_finalize, function in Modules
p11_kit_modules_finalize_and_release, function in Modules
p11_kit_modules_initialize, function in Modules
p11_kit_modules_load, function in Modules
p11_kit_modules_load_and_initialize, function in Modules
p11_kit_modules_release, function in Modules
P11_KIT_MODULE_CRITICAL, macro in Modules
p11_kit_module_finalize, function in Modules
p11_kit_module_for_name, function in Modules
p11_kit_module_get_flags, function in Modules
p11_kit_module_get_name, function in Modules
p11_kit_module_initialize, function in Modules
p11_kit_module_load, function in Modules
p11_kit_module_release, function in Modules
P11_KIT_MODULE_UNMANAGED, macro in Modules
p11_kit_pin_callback, user_function in PIN Callbacks
p11_kit_pin_destroy_func, user_function in PIN Callbacks
P11_KIT_PIN_FALLBACK, macro in PIN Callbacks
p11_kit_pin_file_callback, function in PIN Callbacks
p11_kit_pin_get_length, function in PIN Callbacks
p11_kit_pin_get_value, function in PIN Callbacks
p11_kit_pin_new, function in PIN Callbacks
p11_kit_pin_new_for_buffer, function in PIN Callbacks
p11_kit_pin_new_for_string, function in PIN Callbacks
p11_kit_pin_ref, function in PIN Callbacks
p11_kit_pin_register_callback, function in PIN Callbacks
p11_kit_pin_request, function in PIN Callbacks
p11_kit_pin_unref, function in PIN Callbacks
p11_kit_pin_unregister_callback, function in PIN Callbacks
p11_kit_registered_modules, function in Deprecated
p11_kit_registered_module_to_name, function in Deprecated
p11_kit_registered_name_to_module, function in Deprecated
p11_kit_registered_option, function in Deprecated
p11_kit_set_progname, function in Future
p11_kit_space_strdup, function in Utilities
p11_kit_space_strlen, function in Utilities
p11_kit_strerror, function in Utilities
p11_kit_uri, typedef in URIs
p11_kit_uri_any_unrecognized, function in URIs
p11_kit_uri_clear_attribute, function in URIs
p11_kit_uri_clear_attributes, function in URIs
p11_kit_uri_format, function in URIs
p11_kit_uri_free, function in URIs
p11_kit_uri_get_attribute, function in URIs
p11_kit_uri_get_attributes, function in URIs
p11_kit_uri_get_module_info, function in URIs
p11_kit_uri_get_pinfile, function in URIs
p11_kit_uri_get_pin_source, function in URIs
p11_kit_uri_get_token_info, function in URIs
p11_kit_uri_match_attributes, function in URIs
p11_kit_uri_match_module_info, function in URIs
p11_kit_uri_match_token_info, function in URIs
p11_kit_uri_message, function in URIs
p11_kit_uri_new, function in URIs
P11_KIT_URI_NO_MEMORY, macro in URIs
p11_kit_uri_parse, function in URIs
P11_KIT_URI_SCHEME, macro in URIs
P11_KIT_URI_SCHEME_LEN, macro in URIs
p11_kit_uri_set_attribute, function in URIs
p11_kit_uri_set_attributes, function in URIs
p11_kit_uri_set_pinfile, function in URIs
p11_kit_uri_set_pin_source, function in URIs
p11_kit_uri_set_unrecognized, function in URIs

Annotation Glossary

A

allow-none

NULL is ok, both for passing and for returning.

array

Parameter points to an array of items.

E

element-type

Generics and defining elements of containers and arrays.

I

inout

Parameter for input and for returning results. Default is transfer full.

O

out

Parameter for returning results. Default is transfer full.

T

transfer full

Free data after the code is done.

type

Override the parsed C type with given type

transfer none

Don't free data after the code is done.

p11-kit-0.20.2/doc/manual/html/devel-debugging.html0000664000175000017500000000355412265245672016632 00000000000000 Debugging Tips

Debugging Tips

Unexpected conditions will produce critical warnings by p11-kit. These are often failed internal preconditions, and usually indicate a bug either in p11-kit or the software calling it.

You can use the environment variable P11_KIT_STRICT=yes to make p11-kit do an abort() (and core dump depending on your configuration) when a critical warning occurs.

p11-kit-0.20.2/doc/manual/html/index.sgml0000664000175000017500000004100012265245672014673 00000000000000 p11-kit-0.20.2/doc/manual/html/right-insensitive.png0000644000175000017500000000056512265245672017072 00000000000000PNG  IHDRabKGD pHYs B(xtIME ^IDAT8͒J` /S_$AqrW(>m"]\(49.Nd39{eM#MSIιEiHz|3{̲l3,KkV'@EEQlwyiq]Kh4:mĦ,;ts\aR5/7'Wps׭I,K1=0j0Wg> PU𻤝0 ]?qCҫιg~kA_IENDB`p11-kit-0.20.2/doc/manual/html/trust-disable.html0000664000175000017500000000516512265245672016364 00000000000000 Disabling the Trust Policy Module

Disabling the Trust Policy Module

This module is installed and enabled by default. It may be disabled in the following ways:

  • Use the --disable-trust-module during the p11-kit build.

  • Disable loading trust policy information from this module by adding a file to /etc/pkcs11/modules called p11-kit-trust.module containing a trust-policy: no line.

  • Disable this module completely by adding a file to /etc/pkcs11/modules called p11-kit-trust.module containing a enable-in: line (without a value).

p11-kit-0.20.2/doc/manual/html/devel-testing.html0000664000175000017500000000537612265245672016360 00000000000000 Testing and Code Coverage

Testing and Code Coverage

As a general rule changes to p11-kit should have a tests exercising that change. Use the make check command to run all the tests. If you run it from a subdirectory only the tests in that directory will be run.

To check for memory errors or memory leaks, run make memcheck or make leakcheck respectively. This requires valgrind be installed.

Build p11-kit with the --enable-coverage configure option to build code coverage support.

Once you've done that you can either use make coverage to build code coverage information. Alternatively (and this is usually easier) you can use git coverage to easily check whether you've tested the lines changed by a patch.

A code coverage report is available online

.
p11-kit-0.20.2/doc/manual/html/p11-kit-Modules.html0000664000175000017500000011113412265245672016370 00000000000000 Modules

Modules

Modules — Module loading and initializing

Synopsis

#define             P11_KIT_MODULE_CRITICAL
#define             P11_KIT_MODULE_UNMANAGED
CK_FUNCTION_LIST ** p11_kit_modules_load_and_initialize (int flags);
void                p11_kit_modules_finalize_and_release
                                                        (CK_FUNCTION_LIST **modules);
CK_FUNCTION_LIST ** p11_kit_modules_load                (const char *reserved,
                                                         int flags);
CK_RV               p11_kit_modules_initialize          (CK_FUNCTION_LIST **modules,
                                                         p11_kit_destroyer failure_callback);
CK_RV               p11_kit_modules_finalize            (CK_FUNCTION_LIST **modules);
void                p11_kit_modules_release             (CK_FUNCTION_LIST **modules);
CK_FUNCTION_LIST *  p11_kit_module_load                 (const char *module_path,
                                                         int flags);
CK_RV               p11_kit_module_initialize           (CK_FUNCTION_LIST *module);
CK_RV               p11_kit_module_finalize             (CK_FUNCTION_LIST *module);
void                p11_kit_module_release              (CK_FUNCTION_LIST *module);
CK_FUNCTION_LIST *  p11_kit_module_for_name             (CK_FUNCTION_LIST **modules,
                                                         const char *name);
char *              p11_kit_module_get_name             (CK_FUNCTION_LIST *module);
int                 p11_kit_module_get_flags            (CK_FUNCTION_LIST *module);
char *              p11_kit_config_option               (CK_FUNCTION_LIST *module,
                                                         const char *option);

Description

PKCS#11 modules are used by crypto libraries and applications to access crypto objects (like keys and certificates) and to perform crypto operations.

In order for applications to behave consistently with regard to the user's installed PKCS#11 modules, each module must be configured so that applications or libraries know that they should load it.

When multiple consumers of a module (such as libraries or applications) are in the same process, coordination of the initialization and finalization of PKCS#11 modules is required. To do this modules are managed by p11-kit. This means that various unsafe methods are coordinated between callers. Unmanaged modules are simply the raw PKCS#11 module pointers without p11-kit getting in the way. It is highly recommended that the default managed behavior is used.

The functions here provide support for initializing configured modules. The p11_kit_modules_load() function should be used to load and initialize the configured modules. When done, the p11_kit_modules_release() function should be used to release those modules and associated resources.

In addition p11_kit_config_option() can be used to access other parts of the module configuration.

If a consumer wishes to load an arbitrary PKCS#11 module that's not configured use p11_kit_module_load() to do so. And use p11_kit_module_release() to later release it.

Modules are represented by a pointer to their CK_FUNCTION_LIST entry points.

Details

P11_KIT_MODULE_CRITICAL

#define P11_KIT_MODULE_CRITICAL 1

Flag to load a module in 'critical' mode. Failure to load a critical module will prevent all other modules from loading. A failure when loading a non-critical module skips that module.


P11_KIT_MODULE_UNMANAGED

#define P11_KIT_MODULE_UNMANAGED 1

Module is loaded in non 'managed' mode. This is not recommended, disables many features, and prevents coordination between multiple callers of the same module.


p11_kit_modules_load_and_initialize ()

CK_FUNCTION_LIST ** p11_kit_modules_load_and_initialize (int flags);

Load and initialize configured modules.

If a critical module fails to load or initialize then the function will return NULL. Non-critical modules will be skipped and not included in the returned module list.

Use p11_kit_modules_finalize_and_release() when you're done with the modules returned by this function.

flags :

flags to use to load the modules

Returns :

a NULL terminated list of modules, or NULL on failure

p11_kit_modules_finalize_and_release ()

void                p11_kit_modules_finalize_and_release
                                                        (CK_FUNCTION_LIST **modules);

Finalize and then release the a set of loaded PKCS#11 modules.

The modules may be either managed or unmanaged. The array containing the module pointers is also freed by this function.

Modules are released even if their finalization returns an error code. Managed modules will not be actually finalized or released until all callers using them have done so.

For managed modules the C_Finalize function is overridden so that multiple callers can finalize the same modules. In addition for managed modules multiple callers can finalize from different threads, and still guarantee consistent thread-safe behavior.

For unmanaged modules if multiple callers try to finalize a module, then one of the calls will return CKR_CRYPTOKI_NOT_INITIALIZED according to the PKCS#11 specification. In addition there are no guarantees that thread-safe behavior will occur if multiple callers initialize from different threads.

modules :

the modules to release

p11_kit_modules_load ()

CK_FUNCTION_LIST ** p11_kit_modules_load                (const char *reserved,
                                                         int flags);

Load the configured PKCS#11 modules.

If flags contains the P11_KIT_MODULE_UNMANAGED flag, then the modules will be not be loaded in 'managed' mode regardless of its configuration. This is not recommended for general usage.

If flags contains the P11_KIT_MODULE_CRITICAL flag then the modules will all be treated as 'critical', regardless of the module configuration. This means that a failure to load any module will cause this funtion to fail.

For unmanaged modules there is no guarantee to the state of the modules. Other callers may be using the modules. Using unmanaged modules haphazardly is not recommended for this reason. Some modules (such as those configured with RPC) cannot be loaded in unmanaged mode, and will be skipped.

Use p11_kit_modules_release() to release the modules returned by this function.

If this function fails, then an error message will be available via the p11_kit_message() function.

reserved :

set to NULL

flags :

flags to use to load the module

Returns :

a null terminated list of modules represented as PKCS#11 function lists, or NULL on failure

p11_kit_modules_initialize ()

CK_RV               p11_kit_modules_initialize          (CK_FUNCTION_LIST **modules,
                                                         p11_kit_destroyer failure_callback);

Initialize all the modules in the modules list by calling their C_Initialize function.

For managed modules the C_Initialize function is overridden so that multiple callers can initialize the same modules. In addition for managed modules multiple callers can initialize from different threads, and still guarantee consistent thread-safe behavior.

For unmanaged modules if multiple callers try to initialize a module, then one of the calls will return CKR_CRYPTOKI_ALREADY_INITIALIZED according to the PKCS#11 specification. In addition there are no guarantees that thread-safe behavior will occur if multiple callers initialize from different threads.

When a module fails to initialize it is removed from the modules list. If the failure_callback is not NULL then it is called with the modules that fail to initialize. For example, you may pass p11_kit_module_release() as a failure_callback if the modules list was loaded wit p11_kit_modules_load().

The return value will return the failure code of the last critical module that failed to initialize. Non-critical module failures do not affect the return value. If no critical modules failed to initialize then the return value will be CKR_OK.

When modules are removed, the list will be NULL terminated at the appropriate place so it can continue to be used as a modules list.

This function does not accept a CK_C_INITIALIZE_ARGS argument. Custom initialization arguments cannot be supported when multiple consumers load the same module.

modules :

a NULL terminated list of modules

failure_callback :

called with modules that fail to initialize

Returns :

CKR_OK or the failure code of the last critical module that failed to initialize.

p11_kit_modules_finalize ()

CK_RV               p11_kit_modules_finalize            (CK_FUNCTION_LIST **modules);

Finalize each module in the modules list by calling its C_Finalize function. Regardless of failures, all modules will have their C_Finalize function called.

If a module returns a failure from its C_Finalize method it will be returned. If multiple modules fail, the last failure will be returned.

For managed modules the C_Finalize function is overridden so that multiple callers can finalize the same modules. In addition for managed modules multiple callers can finalize from different threads, and still guarantee consistent thread-safe behavior.

For unmanaged modules if multiple callers try to finalize a module, then one of the calls will return CKR_CRYPTOKI_NOT_INITIALIZED according to the PKCS#11 specification. In addition there are no guarantees that thread-safe behavior will occur if multiple callers finalize from different threads.

modules :

a NULL terminated list of modules

Returns :

CKR_OK or the failure code of the last module that failed to finalize

p11_kit_modules_release ()

void                p11_kit_modules_release             (CK_FUNCTION_LIST **modules);

Release the a set of loaded PKCS#11 modules.

The modules may be either managed or unmanaged. The array containing the module pointers is also freed by this function.

Managed modules will not be actually released until all callers using them have done so. If the modules were initialized, they should have been finalized first.

modules :

the modules to release

p11_kit_module_load ()

CK_FUNCTION_LIST *  p11_kit_module_load                 (const char *module_path,
                                                         int flags);

Load an arbitrary PKCS#11 module from a dynamic library file, and initialize it. Normally using the p11_kit_modules_load() function is preferred.

Using this function to load modules allows coordination between multiple callers of the same module in a single process. If flags contains the P11_KIT_MODULE_UNMANAGED flag, then the modules will be not be loaded in 'managed' mode and not be coordinated. This is not recommended for general usage.

Subsequent calls to this function for the same module will result in an initialization count being incremented for the module. It is safe (although usually unnecessary) to use this function on registered modules.

The module should be released with p11_kit_module_release().

If this function fails, then an error message will be available via the p11_kit_message() function.

module_path :

full file path of module library

flags :

flags to use when loading the module

Returns :

the loaded module PKCS#11 functions or NULL on failure

p11_kit_module_initialize ()

CK_RV               p11_kit_module_initialize           (CK_FUNCTION_LIST *module);

Initialize a PKCS#11 module by calling its C_Initialize function.

For managed modules the C_Initialize function is overridden so that multiple callers can initialize the same modules. In addition for managed modules multiple callers can initialize from different threads, and still guarantee consistent thread-safe behavior.

For unmanaged modules if multiple callers try to initialize a module, then one of the calls will return CKR_CRYPTOKI_ALREADY_INITIALIZED according to the PKCS#11 specification. In addition there are no guarantees that thread-safe behavior will occur if multiple callers initialize from different threads.

This function does not accept a CK_C_INITIALIZE_ARGS argument. Custom initialization arguments cannot be supported when multiple consumers load the same module.

module :

the module to initialize

Returns :

CKR_OK or a failure code

p11_kit_module_finalize ()

CK_RV               p11_kit_module_finalize             (CK_FUNCTION_LIST *module);

Finalize a PKCS#11 module by calling its C_Finalize function.

For managed modules the C_Finalize function is overridden so that multiple callers can finalize the same modules. In addition for managed modules multiple callers can finalize from different threads, and still guarantee consistent thread-safe behavior.

For unmanaged modules if multiple callers try to finalize a module, then one of the calls will return CKR_CRYPTOKI_NOT_INITIALIZED according to the PKCS#11 specification. In addition there are no guarantees that thread-safe behavior will occur if multiple callers finalize from different threads.

module :

the module to finalize

Returns :

CKR_OK or a failure code

p11_kit_module_release ()

void                p11_kit_module_release              (CK_FUNCTION_LIST *module);

Release the a loaded PKCS#11 modules.

The module may be either managed or unmanaged. The C_Finalize function will be called if no other callers are using this module.

module :

the module to release

p11_kit_module_for_name ()

CK_FUNCTION_LIST *  p11_kit_module_for_name             (CK_FUNCTION_LIST **modules,
                                                         const char *name);

Look through the list of modules and return the module whose name matches.

Only configured modules have names. Configured modules are loaded by p11_kit_modules_load(). The module passed to this function can be either managed or unmanaged.

The return value is not copied or duplicated in anyway. It is still 'owned' by the modules list.

modules :

a list of modules to look through

name :

the name of the module to find

Returns :

the module which matches the name, or NULL if no match.

p11_kit_module_get_name ()

char *              p11_kit_module_get_name             (CK_FUNCTION_LIST *module);

Get the configured name of the PKCS#11 module.

Configured modules are loaded by p11_kit_modules_load(). The module passed to this function can be either managed or unmanaged. Non configured modules will return NULL.

Use free() to release the return value when you're done with it.

module :

pointer to a loaded module

Returns :

a newly allocated string containing the module name, or NULL if the module is not a configured module

p11_kit_module_get_flags ()

int                 p11_kit_module_get_flags            (CK_FUNCTION_LIST *module);

Get the flags for this module.

The P11_KIT_MODULE_UNMANAGED flag will be set if the module is not managed by p11-kit. It is a raw PKCS#11 module function list.

The P11_KIT_MODULE_CRITICAL flag will be set if the module is configured to be critical, and not be skipped over if it fails to initialize or load. This flag is also set for modules that are not configured, but have been loaded in another fashion.

module :

the module

Returns :

the flags for the module

p11_kit_config_option ()

char *              p11_kit_config_option               (CK_FUNCTION_LIST *module,
                                                         const char *option);

Retrieve the value for a configured option.

If module is NULL, then the global option with the given name will be retrieved. Otherwise module should point to a configured loaded module. If no such option or configured module exists, then NULL will be returned.

Use free() to release the returned value.

module :

the module to retrieve the option for, or NULL for global options

option :

the option to retrieve

Returns :

the option value or NULL
p11-kit-0.20.2/doc/manual/html/p11-kit.devhelp20000664000175000017500000004300112265245672015524 00000000000000 p11-kit-0.20.2/doc/manual/html/right.png0000644000175000017500000000073012265245672014526 00000000000000PNG  IHDRw=bKGD pHYs  ~tIME2 I%=eIDATx!o@.'**M0$$?1~vIeEuLl&4䝠Bݛ|>$ݶoc trust

trust

trust — Tool for operating on the trust policy store

Synopsis

trust list

trust extract --filter=<what> --format=<type> /path/to/destination

trust anchor /path/to/certificate.crt

Description

trust is a command line tool to examine and modify the shared trust policy store.

See the various sub commands below. The following global options can be used:

-v, --verbose

Run in verbose mode with debug output.

-q, --quiet

Run in quiet mode without warning or failure messages.

List

List trust policy store items.

$ trust list

List information about the various items in the trust policy store. Each item is listed with it's PKCS#11 URI and some descriptive information.

You can specify the following options to control what to list.

--filter=<what>

Specifies what certificates to extract. You can specify the following values:

ca-anchors

Certificate anchors

trust-policy

Anchors and blacklist (default)

blacklist

Blacklisted certificates

certificates

All certificates

pkcs11:object=xx

A PKCS#11 URI to filter with

If an output format is chosen that cannot support type what has been specified by the filter, a message will be printed.

None of the available formats support storage of blacklist entries that do not contain a full certificate. Thus any certificates blacklisted by their issuer and serial number alone, are not included in the extracted blacklist.

--purpose=<usage>

Limit to certificates usable for the given purpose You can specify one of the following values:

server-auth

For authenticating servers

client-auth

For authenticating clients

email

For email protection

code-signing

For authenticated signed code

1.2.3.4.5...

An arbitrary purpose OID

Anchor

Store or remove trust anchors.

$ trust anchor /path/to/certificate.crt
$ trust anchor --remove /path/to/certificate.crt
$ trust anchor --remove "pkcs11:id=%AA%BB%CC%DD%EE;object-type=cert"

Store or remove trust anchors in the trust policy store. These are usually root certificate authorities.

Specify either the --store or --remove operations. If no operation is specified then --store is assumed.

When storing, one or more certificate files are expected on the command line. These are stored as anchors, unless they are already present.

When removing an anchor, either specify certificate files or PKCS#11 URI's on the command line. Matching anchors will be removed.

It may be that this command needs to be run as root in order to modify the system trust policy store, if no user specific store is available.

You can specify the following options.

--remove

Remove one or more anchors from the trust policy store. Specify certificate files or PKCS#11 URI's on the command line.

--store

Store one or more anchors to the trust policy store. Specify certificate files on the command line.

Extract

Extract trust policy from the shared trust policy store.

$ trust extract --format=x509-directory --filter=ca-anchors /path/to/directory

You can specify the following options to control what to extract. The --filter and --format arguments should be specified. By default this command will not overwrite the destination file or directory.

--comment

Add identifying comments to PEM bundle output files before each certificate.

--filter=<what>

Specifies what certificates to extract. You can specify the following values:

ca-anchors

Certificate anchors (default)

trust-policy

Anchors and blacklist

blacklist

Blacklisted certificates

certificates

All certificates

pkcs11:object=xx

A PKCS#11 URI

If an output format is chosen that cannot support type what has been specified by the filter, a message will be printed.

None of the available formats support storage of blacklist entries that do not contain a full certificate. Thus any certificates blacklisted by their issuer and serial number alone, are not included in the extracted blacklist.

--format=<type>

The format of the destination file or directory. You can specify one of the following values:

x509-file

DER X.509 certificate file

x509-directory

directory of X.509 certificates

pem-bundle

File containing one or more certificate PEM blocks

pem-directory

Directory PEM files each containing one certifiacte

openssl-bundle

OpenSSL specific PEM bundle of certificates

openssl-directory

Directory of OpenSSL specific PEM files

java-cacerts

Java keystore 'cacerts' certificate bundle

--overwrite

Overwrite output file or directory.

--purpose=<usage>

Limit to certificates usable for the given purpose You can specify one of the following values:

server-auth

For authenticating servers

client-auth

For authenticating clients

email

For email protection

code-signing

For authenticated signed code

1.2.3.4.5...

An arbitrary purpose OID

Extract Compat

Extract compatibility trust certificate bundles.

$ trust extract-compat

OpenSSL, Java and some versions of GnuTLS cannot currently read trust information directly from the trust policy store. This command extracts trust information such as certificate anchors for use by these libraries.

What this command does, and where it extracts the files is distribution or site specific. Packagers or administrators are expected customize this command.

Bugs

Please send bug reports to either the distribution bug tracker or the upstream bug tracker at https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue&component=p11-kit.

See also

p11-kit(8)

An explanatory document about storing trust policy: http://p11-glue.freedesktop.org/doc/storing-trust-policy/

Further details available in the p11-kit online documentation at http://p11-glue.freedesktop.org/doc/p11-kit/.

p11-kit-0.20.2/doc/manual/html/p11-kit-Deprecated.html0000664000175000017500000006576412265245672017041 00000000000000 Deprecated

Deprecated

Deprecated — Deprecated functions

Description

These functions have been deprecated from p11-kit and are not recommended for general usage. In large part they were deprecated because they did not adequately insulate multiple callers of a PKCS#11 module from another, and could not support the 'managed' mode needed to do this.

Details

p11_kit_initialize_registered ()

CK_RV               p11_kit_initialize_registered       (void);

Warning

p11_kit_initialize_registered is deprecated and should not be used in newly-written code. Since: 0.19.0: Use p11_kit_modules_load() instead.

Initialize all the registered PKCS#11 modules.

If this is the first time this function is called multiple times consecutively within a single process, then it merely increments an initialization reference count for each of these modules.

Use p11_kit_finalize_registered() to finalize these registered modules once the caller is done with them.

If this function fails, then an error message will be available via the p11_kit_message() function.

Returns :

CKR_OK if the initialization succeeded, or an error code.

p11_kit_finalize_registered ()

CK_RV               p11_kit_finalize_registered         (void);

Warning

p11_kit_finalize_registered is deprecated and should not be used in newly-written code. Since 0.19.0: Use p11_kit_modules_release() instead.

Finalize all the registered PKCS#11 modules. These should have been initialized with p11_kit_initialize_registered().

If p11_kit_initialize_registered() has been called more than once in this process, then this function must be called the same number of times before actual finalization will occur.

If this function fails, then an error message will be available via the p11_kit_message() function.

Returns :

CKR_OK if the finalization succeeded, or an error code.

p11_kit_registered_modules ()

CK_FUNCTION_LIST_PTR * p11_kit_registered_modules       (void);

Warning

p11_kit_registered_modules is deprecated and should not be used in newly-written code. Since 0.19.0: Use p11_kit_modules_load() instead.

Get a list of all the registered PKCS#11 modules. This list will be valid once the p11_kit_initialize_registered() function has been called.

The returned value is a NULL terminated array of CK_FUNCTION_LIST_PTR pointers.

The returned modules are unmanaged.

Returns :

A list of all the registered modules. Use the free() function to free the list.

p11_kit_registered_module_to_name ()

char *              p11_kit_registered_module_to_name   (CK_FUNCTION_LIST_PTR module);

Warning

p11_kit_registered_module_to_name is deprecated and should not be used in newly-written code. Since 0.19.0: Use p11_kit_module_get_name() instead.

Get the name of a registered PKCS#11 module.

You can use p11_kit_registered_modules() to get a list of all the registered modules. This name is specified by the registered module configuration.

module :

pointer to a registered module

Returns :

A newly allocated string containing the module name, or NULL if no such registered module exists. Use free() to free this string.

p11_kit_registered_name_to_module ()

CK_FUNCTION_LIST_PTR p11_kit_registered_name_to_module  (const char *name);

Warning

p11_kit_registered_name_to_module is deprecated and should not be used in newly-written code. Since 0.19.0: Use p11_kit_module_for_name() instead.

Lookup a registered PKCS#11 module by its name. This name is specified by the registered module configuration.

name :

name of a registered module

Returns :

a pointer to a PKCS#11 module, or NULL if this name was not found.

p11_kit_registered_option ()

char *              p11_kit_registered_option           (CK_FUNCTION_LIST_PTR module,
                                                         const char *field);

Warning

p11_kit_registered_option is deprecated and should not be used in newly-written code. Since 0.19.0: Use p11_kit_config_option() instead.

Lookup a configured option for a registered PKCS#11 module. If a NULL module argument is specified, then this will lookup the configuration option in the global config file.

module :

a pointer to a registered module

field :

the name of the option to lookup.

Returns :

A newly allocated string containing the option value, or NULL if the registered module or the option were not found. Use free() to free the returned string.

p11_kit_initialize_module ()

CK_RV               p11_kit_initialize_module           (CK_FUNCTION_LIST_PTR module);

Warning

p11_kit_initialize_module is deprecated and should not be used in newly-written code. Since 0.19.0: Use p11_kit_module_initialize() instead.

Initialize an arbitrary PKCS#11 module. Normally using the p11_kit_initialize_registered() is preferred.

Using this function to initialize modules allows coordination between multiple users of the same module in a single process. It should be called on modules that have been loaded (with dlopen() for example) but not yet initialized. The caller should not yet have called the module's C_Initialize method. This function will call C_Initialize as necessary.

Subsequent calls to this function for the same module will result in an initialization count being incremented for the module. It is safe (although usually unnecessary) to use this function on registered modules.

The module must be finalized with p11_kit_finalize_module() instead of calling its C_Finalize method directly.

This function does not accept a CK_C_INITIALIZE_ARGS argument. Custom initialization arguments cannot be supported when multiple consumers load the same module.

If this function fails, then an error message will be available via the p11_kit_message() function.

module :

loaded module to initialize.

Returns :

CKR_OK if the initialization was successful.

p11_kit_load_initialize_module ()

CK_RV               p11_kit_load_initialize_module      (const char *module_path,
                                                         CK_FUNCTION_LIST_PTR *module);

Warning

p11_kit_load_initialize_module is deprecated and should not be used in newly-written code. Since 0.19.0: Use p11_kit_module_load() instead.

Load an arbitrary PKCS#11 module from a dynamic library file, and initialize it. Normally using the p11_kit_initialize_registered() function is preferred.

Using this function to load and initialize modules allows coordination between multiple users of the same module in a single process. The caller should not call the module's C_Initialize method. This function will call C_Initialize as necessary.

If a module has already been loaded, then use of this function is unnecesasry. Instead use the p11_kit_initialize_module() function to initialize it.

Subsequent calls to this function for the same module will result in an initialization count being incremented for the module. It is safe (although usually unnecessary) to use this function on registered modules.

The module must be finalized with p11_kit_finalize_module() instead of calling its C_Finalize method directly.

This function does not accept a CK_C_INITIALIZE_ARGS argument. Custom initialization arguments cannot be supported when multiple consumers load the same module.

If this function fails, then an error message will be available via the p11_kit_message() function.

module_path :

full file path of module library

module :

location to place loaded module pointer

Returns :

CKR_OK if the initialization was successful.

p11_kit_finalize_module ()

CK_RV               p11_kit_finalize_module             (CK_FUNCTION_LIST_PTR module);

Warning

p11_kit_finalize_module is deprecated and should not be used in newly-written code. Since 0.19.0: Use p11_kit_module_finalize() and p11_kit_module_release() instead.

Finalize an arbitrary PKCS#11 module. The module must have been initialized using p11_kit_initialize_module(). In most cases callers will want to use p11_kit_finalize_registered() instead of this function.

Using this function to finalize modules allows coordination between multiple users of the same module in a single process. The caller should not call the module's C_Finalize method. This function will call C_Finalize as necessary.

If the module was initialized more than once, then this function will decrement an initialization count for the module. When the count reaches zero the module will be truly finalized. It is safe (although usually unnecessary) to use this function on registered modules if (and only if) they were initialized using p11_kit_initialize_module() for some reason.

If this function fails, then an error message will be available via the p11_kit_message() function.

module :

loaded module to finalize.

Returns :

CKR_OK if the finalization was successful.

P11_KIT_DEPRECATED_FOR()

#define P11_KIT_DEPRECATED_FOR(f) __attribute__((deprecated("Use " #f " instead")))
p11-kit-0.20.2/doc/manual/html/up-insensitive.png0000644000175000017500000000056612265245672016402 00000000000000PNG  IHDRabKGD pHYs B(xtIMEwIIDAT8?/Qϙ?[u$VHTDۈBM+! Proxy Module

Proxy Module

When an application is aware of the fact that coordination is necessary between multiple consumers of a PKCS#11 module, and wants to load standard configured PKCS#11 modules, it can link to p11-kit and use the functions there to provide this functionality.

However most current consumers of PKCS#11 are ignorant of this problem, and do not link to p11-kit. In order to solve this multiple initialization problem for all applications, p11-kit provides a proxy compatibility module.

This proxy module acts like a normal PKCS#11 module, but internally loads a preconfigured set of PKCS#11 modules and manages their features as described earlier. Each slot in the configured modules is exposed as a slot of the p11-kit proxy module. The proxy module is then used as a normal PKCS#11 module would be. It can be loaded by crypto libraries like NSS and behaves as expected.

The C_GetFunctionList exported entry point of the proxy module returns a new managed PKCS#11 module each time it is called. These managed instances are released when the proxy module is unloaded.

p11-kit-0.20.2/doc/manual/html/p11-kit-Utilities.html0000664000175000017500000002625612265245672016745 00000000000000 Utilities

Utilities

Utilities — PKCS#11 utilities

Synopsis

const char *        p11_kit_strerror                    (CK_RV rv);
const char *        p11_kit_message                     (void);
char *              p11_kit_space_strdup                (const unsigned char *string,
                                                         size_t max_length);
size_t              p11_kit_space_strlen                (const unsigned char *string,
                                                         size_t max_length);

Description

Utility functions for working with PKCS#11.

Details

p11_kit_strerror ()

const char *        p11_kit_strerror                    (CK_RV rv);

Get a message for a PKCS#11 return value or error code. Do not pass CKR_OK or other such non errors to this function.

rv :

The code to get a message for.

Returns :

The user readable and localized message.

p11_kit_message ()

const char *        p11_kit_message                     (void);

Gets the failure message for a recently called p11-kit function, which returned a failure code on this thread. Not all functions set this message. Each function that does so, will note it in its documentation.

If the most recent p11-kit function did not fail, then this will return NULL. The string is owned by the p11-kit library and is only valid on the same thread that the failed function executed on.

Returns :

The last failure message, or NULL.

p11_kit_space_strdup ()

char *              p11_kit_space_strdup                (const unsigned char *string,
                                                         size_t max_length);

In PKCS#11 structures many strings are encoded in a strange way. The string is placed in a fixed length buffer and then padded with spaces.

This function copies the space padded string into a normal null-terminated string. The result is owned by the caller.

1
2
3
4
CK_INFO info;
char *description;
   ...
description = p11_kit_space_strdup (info->libraryDescription, sizeof (info->libraryDescription));

string :

Pointer to string block

max_length :

Maximum length of string block

Returns :

The newly allocated string, or NULL if memory could not be allocated.

p11_kit_space_strlen ()

size_t              p11_kit_space_strlen                (const unsigned char *string,
                                                         size_t max_length);

In PKCS#11 structures many strings are encoded in a strange way. The string is placed in a fixed length buffer and then padded with spaces.

This function determines the actual length of the string. Since the string is not null-terminated you need to pass in the size of buffer as max_length. The string will never be longer than this buffer.

1
2
3
4
CK_INFO info;
size_t length;
   ...
length = p11_kit_space_strlen (info->libraryDescription, sizeof (info->libraryDescription));

string :

Pointer to string block

max_length :

Maximum length of string block

Returns :

The length of the space padded string.
p11-kit-0.20.2/doc/manual/html/gtk-doc.css0000644000175000017500000001210012265245672014737 00000000000000.synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; border: solid 1px #d3d7cf; padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ background: #e6f3ff; border: solid 1px #729fcf; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } @media screen { sup a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 3.2em; padding-bottom: 20em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; z-index: 10; } .navigation a, .navigation a:visited { /* tango:scarlet red 3 */ color: #a40000; } .navigation a:hover { /* tango:scarlet red 1 */ color: #ef2929; } td.shortcuts { /* tango:scarlet red 1 */ color: #ef2929; font-size: 80%; white-space: nowrap; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } .navigation .title { font-size: 200%; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } hr { /* tango:aluminium 3 */ color: #babdb6; background: #babdb6; border: none 0px; height: 1px; clear: both; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .warning { /* tango:orange 0/1 */ background: #ffeed9; border-color: #ffb04f; } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; border-color: #abf562; } .note, .warning { padding: 0.5em; border-width: 1px; border-style: solid; } .note h3, .warning h3 { margin-top: 0.0em } .note p, .warning p { margin-bottom: 0.0em } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-size: 80%; font-weight: normal; } /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ .listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ .listing_code .programlisting .function { color: #000000; font-weight: bold; } .listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ .listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .normal { color: #000000; } .listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ .listing_code .programlisting .type { color: #000000; } .listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ .listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; } .listing_lines pre, .listing_code pre { margin: 0px; } p11-kit-0.20.2/doc/manual/html/p11-kit-PIN-Callbacks.html0000664000175000017500000013642012265245672017270 00000000000000 PIN Callbacks

PIN Callbacks

PIN Callbacks — PIN Callbacks

Synopsis

typedef             P11KitPin;
P11KitPin *         p11_kit_pin_new                     (const unsigned char *value,
                                                         size_t length);
P11KitPin *         p11_kit_pin_new_for_buffer          (unsigned char *buffer,
                                                         size_t length,
                                                         p11_kit_pin_destroy_func destroy);
P11KitPin *         p11_kit_pin_new_for_string          (const char *value);
const unsigned char * p11_kit_pin_get_value             (P11KitPin *pin,
                                                         size_t *length);
size_t              p11_kit_pin_get_length              (P11KitPin *pin);
P11KitPin *         p11_kit_pin_ref                     (P11KitPin *pin);
void                p11_kit_pin_unref                   (P11KitPin *pin);
enum                P11KitPinFlags;
#define             P11_KIT_PIN_FALLBACK
int                 p11_kit_pin_register_callback       (const char *pin_source,
                                                         p11_kit_pin_callback callback,
                                                         void *callback_data,
                                                         p11_kit_pin_destroy_func callback_destroy);
void                p11_kit_pin_unregister_callback     (const char *pin_source,
                                                         p11_kit_pin_callback callback,
                                                         void *callback_data);
P11KitPin *         (*p11_kit_pin_callback)             (const char *pin_source,
                                                         P11KitUri *pin_uri,
                                                         const char *pin_description,
                                                         P11KitPinFlags pin_flags,
                                                         void *callback_data);
P11KitPin *         p11_kit_pin_request                 (const char *pin_source,
                                                         P11KitUri *pin_uri,
                                                         const char *pin_description,
                                                         P11KitPinFlags pin_flags);
void                (*p11_kit_pin_destroy_func)         (void *data);
P11KitPin *         p11_kit_pin_file_callback           (const char *pin_source,
                                                         P11KitUri *pin_uri,
                                                         const char *pin_description,
                                                         P11KitPinFlags pin_flags,
                                                         void *callback_data);

Description

Applications can register a callback which will be called to provide a password associated with a given pin source.

PKCS#11 URIs can contain a 'pin-source' attribute. The value of this attribute is application dependent, but often references a file containing a PIN to use.

Using these functions, an applications or libraries can register a callback with p11_kit_pin_register_callback() to be called when a given 'pin-source' attribute value is requested. The application can then prompt the user or retrieve a PIN for the given context. These registered callbacks are only relevant and valid within the current process.

A fallback callback can be registered by passing the P11_KIT_PIN_FALLBACK value to p11_kit_pin_register_callback(). This fallback callback will be called for every 'pin-source' attribute request for which no callback has been directly registered.

To request a PIN for a given 'pin-source' attribute, use the p11_kit_pin_request() function. If this function returns NULL then either no callbacks were registered or none of them could handle the request.

If multiple callbacks are registered for the same PIN source, then they are called in last-registered-first-called order. They are called in turn until one of them can handle the request. Fallback callbacks are not called if a callback was registered specifically for a requested 'pin-source' attribute.

PINs themselves are handled inside of P11KitPin structures. These are thread safe and allow the callback to specify how the PIN is stored in memory and freed. A callback can use p11_kit_pin_new_for_string() or related functions to create a PIN to be returned.

For example in order to handle the following PKCS#11 URI with a 'pin-source' attribute


     pkcs11:id=%69%95%3e%5c%f4%bd%ec%91;pin-source=my-application

an application could register a callback like this:

1
2
3
4
5
6
7
8
9
10
static P11KitPin*
my_application_pin_callback (const char *pin_source, P11KitUri *pin_uri,
                             const char *pin_description, P11KitPinFlags pin_flags,
                             void *callback_data)
{
    return p11_kit_pin_new_from_string ("pin-value");
}

p11_kit_pin_register_callback ("my-application", my_application_pin_callback,
                               NULL, NULL);

Details

P11KitPin

typedef struct p11_kit_pin P11KitPin;

A structure representing a PKCS#11 PIN. There are no public fields visible in this structure. Use the various accessor functions.


p11_kit_pin_new ()

P11KitPin *         p11_kit_pin_new                     (const unsigned char *value,
                                                         size_t length);

Create a new P11KitPin with the given PIN value. This function is usually used from within registered PIN callbacks.

Exactly length bytes from value are used. Null terminated strings, or encodings are not considered. A copy of the value will be made.

value :

the value of the PIN

length :

the length of value

Returns :

The newly allocated P11KitPin, which should be freed with p11_kit_pin_unref() when no longer needed.

p11_kit_pin_new_for_buffer ()

P11KitPin *         p11_kit_pin_new_for_buffer          (unsigned char *buffer,
                                                         size_t length,
                                                         p11_kit_pin_destroy_func destroy);

Create a new P11KitPin which will use buffer for the PIN value. This function is usually used from within registered PIN callbacks.

The buffer will not be copied. String encodings and null characters are not considered.

When the last reference to this PIN is lost, then the destroy callback function will be called passing buffer as an argument. This allows the caller to use a buffer as a PIN without copying it.

1
2
3
4
char *buffer = malloc (128);
P11KitPin *pin;
 ....
pin = p11_kit_pin_new_for_buffer (buffer, 128, free);

buffer :

the value of the PIN

length :

the length of buffer

destroy :

if not NULL, then called when PIN is destroyed.

Returns :

The newly allocated P11KitPin, which should be freed with p11_kit_pin_unref() when no longer needed.

p11_kit_pin_new_for_string ()

P11KitPin *         p11_kit_pin_new_for_string          (const char *value);

Create a new P11KitPin for the given null-terminated string, such as a password. This function is usually used from within registered PIN callbacks.

The PIN will consist of the string not including the null terminator. String encoding is not considered. A copy of the value will be made.

value :

the value of the PIN

Returns :

The newly allocated P11KitPin, which should be freed with p11_kit_pin_unref() when no longer needed.

p11_kit_pin_get_value ()

const unsigned char * p11_kit_pin_get_value             (P11KitPin *pin,
                                                         size_t *length);

Get the PIN value from a P11KitPin. length will be set to the length of the value.

The value returned is owned by the P11KitPin and should not be modified. It remains valid as long as a reference to the PIN is held. The PIN value will not contain an extra null-terminator character.

pin :

the P11KitPin

length :

a location to return the value length

Returns :

the value for the PIN.

p11_kit_pin_get_length ()

size_t              p11_kit_pin_get_length              (P11KitPin *pin);

Get the length of the PIN value from a P11KitPin.

pin :

the P11KitPin

Returns :

the length of the PIN value.

p11_kit_pin_ref ()

P11KitPin *         p11_kit_pin_ref                     (P11KitPin *pin);

Add a reference to a P11KitPin. This should be matched with a later call to p11_kit_pin_unref(). As long as at least one reference is held, the PIN will remain valid and in memory.

pin :

the P11KitPin

Returns :

the pin pointer, for convenience sake.

p11_kit_pin_unref ()

void                p11_kit_pin_unref                   (P11KitPin *pin);

Remove a reference from a P11KitPin. When all references have been removed then the PIN will be freed and will no longer be in memory.

pin :

the P11KitPin

enum P11KitPinFlags

typedef enum {
	P11_KIT_PIN_FLAGS_USER_LOGIN = 1<<0,
	P11_KIT_PIN_FLAGS_SO_LOGIN = 1<<1,
	P11_KIT_PIN_FLAGS_CONTEXT_LOGIN = 1<<2,
	P11_KIT_PIN_FLAGS_RETRY = 1<<3,
	P11_KIT_PIN_FLAGS_MANY_TRIES = 1<<4,
	P11_KIT_PIN_FLAGS_FINAL_TRY = 1<<5
} P11KitPinFlags;

Flags that are passed to p11_kit_pin_request() and registered callbacks.

P11_KIT_PIN_FLAGS_USER_LOGIN

The PIN is for a PKCS#11 user type login.

P11_KIT_PIN_FLAGS_SO_LOGIN

The PIN is for a PKCS#11 security officer type login.

P11_KIT_PIN_FLAGS_CONTEXT_LOGIN

The PIN is for a PKCS#11 contect specific type login.

P11_KIT_PIN_FLAGS_RETRY

The PIN is being requested again, due to an invalid previous PIN.

P11_KIT_PIN_FLAGS_MANY_TRIES

The PIN has failed too many times, and few tries are left.

P11_KIT_PIN_FLAGS_FINAL_TRY

The PIN has failed too many times, and this is the last try.

P11_KIT_PIN_FALLBACK

#define P11_KIT_PIN_FALLBACK ""

Used with p11_kit_pin_register_callback() to register a fallback callback. This callback will be called if no other callback is registered for a 'pin-source'.


p11_kit_pin_register_callback ()

int                 p11_kit_pin_register_callback       (const char *pin_source,
                                                         p11_kit_pin_callback callback,
                                                         void *callback_data,
                                                         p11_kit_pin_destroy_func callback_destroy);

Register a callback to handle PIN requests for a given 'pin-source' attribute. If pin_source is set to P11_KIT_PIN_FALLBACK then this will be a fallback callback and will be called for requests for which no other callback has been specifically registered.

If multiple callbacks are registered for the same pin_source value, then the last registered callback will be the first to be called.

pin_source :

the 'pin-source' attribute this this callback is for

callback :

the callback function

callback_data :

data that will be passed to the callback

callback_destroy :

a function that will be called with callback_data when the callback is unregistered.

Returns :

Returns negative if registering fails.

p11_kit_pin_unregister_callback ()

void                p11_kit_pin_unregister_callback     (const char *pin_source,
                                                         p11_kit_pin_callback callback,
                                                         void *callback_data);

Unregister a callback that was previously registered with the p11_kit_pin_register_callback() function. If more than one registered callback matches the given arguments, then only one of those will be removed.

pin_source :

the 'pin-source' attribute the callback was registered for

callback :

the callback function that was registered

callback_data :

data that was registered for the callback

p11_kit_pin_callback ()

P11KitPin *         (*p11_kit_pin_callback)             (const char *pin_source,
                                                         P11KitUri *pin_uri,
                                                         const char *pin_description,
                                                         P11KitPinFlags pin_flags,
                                                         void *callback_data);

Represents a PIN callback function.

The various arguments are the same as the ones passed to p11_kit_pin_request(). The callback_data argument was the one passed to p11_kit_pin_register_callback() when registering this callback.

The function should return NULL if it could not provide a PIN, either because of an error or a user cancellation.

If a PIN is returned, it will be unreferenced by the caller. So it should be either newly allocated, or referenced before returning.

pin_source :

a 'pin-source' attribute string

pin_uri :

a PKCS#11 URI that the PIN is for, or NULL

pin_description :

a descrption of what the PIN is for

pin_flags :

flags describing the PIN request

callback_data :

data that was provided when registering this callback

Returns :

A PIN or NULL

p11_kit_pin_request ()

P11KitPin *         p11_kit_pin_request                 (const char *pin_source,
                                                         P11KitUri *pin_uri,
                                                         const char *pin_description,
                                                         P11KitPinFlags pin_flags);

Request a PIN for a given 'pin-source' attribute. The result depends on the registered callbacks.

If not NULL, then the pin_uri attribute should point to the thing that the PIN is being requested for. In most use cases this should be a PKCS#11 URI pointing to a token.

The pin_description should always be specified. It is a string describing what the PIN is for. For example this would be the token label, if the PIN is for a token.

If more than one callback is registered for the pin_source, then the latest registered one will be called first. If that callback does not return a PIN, then the next will be called in turn.

If no callback is registered for pin_source, then the fallback callbacks will be invoked in the same way. The fallback callbacks will not be called if any callback has been registered specifically for pin_source.

The PIN returned should be released with p11_kit_pin_unref().

pin_source :

the 'pin-source' attribute that is being requested

pin_uri :

a PKCS#11 URI that the PIN is being requested for, optionally NULL.

pin_description :

a description of what the PIN is for, must not be NULL.

pin_flags :

various flags for this request

Returns :

the PIN which should be released with p11_kit_pin_unref(), or NULL if no callback was registered or could proivde a PIN

p11_kit_pin_destroy_func ()

void                (*p11_kit_pin_destroy_func)         (void *data);

A function called to free or cleanup data.

data :

the data to destroy

p11_kit_pin_file_callback ()

P11KitPin *         p11_kit_pin_file_callback           (const char *pin_source,
                                                         P11KitUri *pin_uri,
                                                         const char *pin_description,
                                                         P11KitPinFlags pin_flags,
                                                         void *callback_data);

This is a PIN callback function that looks up the 'pin-source' attribute in a file with that name. This can be used to enable the normal PKCS#11 URI behavior described in the RFC.

If pin_flags contains the P11_KIT_PIN_FLAGS_RETRY flag, then this callback will always return NULL. This is to prevent endless loops where an application is expecting to interact with a prompter, but instead is interacting with this callback reading a file over and over.

This callback fails on files larger than 4 Kilobytes.

This callback is not registered by default. It may have security implications depending on the source of the PKCS#11 URI and the PKCS#11 in use. To register it, use code like the following:

pin_source :

a 'pin-source' attribute string

pin_uri :

a PKCS#11 URI that the PIN is for, or NULL

pin_description :

a descrption of what the PIN is for

pin_flags :

flags describing the PIN request

callback_data :

unused, should be NULL

Returns :

a referenced PIN with the file contents, or NULL if the file could not be read
p11-kit-0.20.2/doc/manual/html/home.png0000644000175000017500000000121612265245672014341 00000000000000PNG  IHDRw=bKGD pHYs  ~tIME1KvIDATxՕkq?rCp ~CnpCAAJ .B-\'G]:ܠC -(8 Ԁ!fDғklbRoyxwpðIJ<of_-@RHf֟t^ښ$Q|pgv;X^^&s(bwwZF9&3඙ ^IRZUE.0Z]]U PYM8HGIekqqҀ! $۬3n e{-/seeeÌXOͷ$8==USQRR'9-s+B^ Cەs+%<7W :2IENDB`p11-kit-0.20.2/doc/manual/html/tools.html0000664000175000017500000000371612265245672014742 00000000000000 Manual Pages

Manual Pages

p11-kit — Tool for operating on configured PKCS#11 modules
pkcs11.conf — Configuration files for PKCS#11 modules
trust — Tool for operating on the trust policy store
p11-kit-0.20.2/doc/manual/html/trust-glib-networking.html0000664000175000017500000000406312265245672020057 00000000000000 Using the Trust Policy Module with glib-networking

Using the Trust Policy Module with glib-networking

The trust policy module can be used as a source of trust information for glib-networking's gnutls-pkcs11 backend. The module provides PKCS#11 trust assertion objects as expected.

The module should work by default if the gnutls-pkcs11 backend is selected as the glib-networking TLS backend.

p11-kit-0.20.2/doc/manual/html/p11-kit.html0000664000175000017500000001044612265245672014766 00000000000000 p11-kit

p11-kit

p11-kit — Tool for operating on configured PKCS#11 modules

Synopsis

p11-kit list-modules

p11-kit extract ...

Description

p11-kit is a command line tool that can be used to perform operations on PKCS#11 modules configured on the system.

See the various sub commands below. The following global options can be used:

-v, --verbose

Run in verbose mode with debug output.

-q, --quiet

Run in quiet mode without warning or failure messages.

List Modules

List system configured PKCS#11 modules.

$ p11-kit list-modules

The modules, information about them and the tokens present in the PKCS#11 modules will be displayed.

Extract

Extract certificates from configured PKCS#11 modules.

See trust(1) for more information

Extract Trust

Extract standard trust information files.

See trust(1) for more information

Bugs

Please send bug reports to either the distribution bug tracker or the upstream bug tracker at https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue&component=p11-kit.

See also

pkcs11.conf(5)

Further details available in the p11-kit online documentation at http://p11-glue.freedesktop.org/doc/p11-kit/.

p11-kit-0.20.2/doc/manual/html/trust-nss.html0000664000175000017500000000447012265245672015562 00000000000000 Using the Trust Policy Module with NSS

Using the Trust Policy Module with NSS

The trust policy module is a drop in replacement for the libnssckbi.so module and thus works out of the box with NSS. The trust policy module provides NSS style PKCS#11 trust objects for NSS to retrieve.

The module may be used to replace the libnssckbi.so file via an distribution specific alternatives mechanism or otherwise.

Alternatively NSS applications like Firefox or Thunderbird may be configured to use the trust policy module by adding the p11-kit-trust.so PKCS#11 module via their GUI or command line configuration.

p11-kit-0.20.2/doc/manual/html/left.png0000644000175000017500000000071312265245672014344 00000000000000PNG  IHDRw=bKGD pHYs  ~tIME1&[(XIDATx!OPE*ID%~ꊯ"p'ŏ`sܖrKf hmiIz}ܯI.p\`x l?l[,Hk<#c%\AUx[S7n6rzEs1j@NL$ݤi0 5/}\EKIo͓$a0jdFbkIAh>WlC'?tk;|/t*INZ^`y4Nr]׮ J<ڐt`X1@p䀸dZ')hK $V?%]+LsgUK"w53OIENDB`p11-kit-0.20.2/doc/manual/html/index.html0000664000175000017500000001271412265245672014707 00000000000000 p11-kit p11-kit-0.20.2/doc/manual/html/devel-paths.html0000664000175000017500000000667012265245672016020 00000000000000 Packaging PKCS#11 module configs

Packaging PKCS#11 module configs

Developers or packagers of PKCS#11 modules need to install various files into specific locations so that p11-kit will recognize and load the module correctly.

You should use pkg-config as described below to determine configuration paths. p11-kit installs a pkg-config file called p11-kit-1.pc. This file contains all the information about the various paths that p11-kit looks for files at.

Path to place module configuration

As described in the module configuration documentation, each PKCS#11 module should install a config file describing that module. These config files should be installed to a specific directory which can be determined by running:

$ pkg-config p11-kit-1 --variable p11_module_configs
/usr/share/p11-kit/modules

Default path for modules with relative paths

If a module configuration contains a relative path in its module: setting, then that module will be loaded from the default module path. This path can be determined by running:

$ pkg-config p11-kit-1 --variable p11_module_path
/usr/lib64/pkcs11
p11-kit-0.20.2/doc/manual/p11-kit.xml0000664000175000017500000000634212226763526013656 00000000000000 p11-kit p11-kit Maintainer Stef Walter stef@thewalter.net p11-kit 8 System Commands p11-kit Tool for operating on configured PKCS#11 modules p11-kit list-modules p11-kit extract ... Description p11-kit is a command line tool that can be used to perform operations on PKCS#11 modules configured on the system. See the various sub commands below. The following global options can be used: Run in verbose mode with debug output. Run in quiet mode without warning or failure messages. List Modules List system configured PKCS#11 modules. $ p11-kit list-modules The modules, information about them and the tokens present in the PKCS#11 modules will be displayed. Extract Extract certificates from configured PKCS#11 modules. See trust1 for more information Extract Trust Extract standard trust information files. See trust1 for more information Bugs Please send bug reports to either the distribution bug tracker or the upstream bug tracker at https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue&component=p11-kit. See also pkcs11.conf5 Further details available in the p11-kit online documentation at http://p11-glue.freedesktop.org/doc/p11-kit/. p11-kit-0.20.2/doc/manual/Makefile.in0000664000175000017500000010117212265245664014011 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/build/gtk-doc.make $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am subdir = doc/manual ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/gettext.m4 \ $(top_srcdir)/build/m4/iconv.m4 \ $(top_srcdir)/build/m4/lib-ld.m4 \ $(top_srcdir)/build/m4/lib-link.m4 \ $(top_srcdir)/build/m4/lib-prefix.m4 \ $(top_srcdir)/build/m4/libtool.m4 \ $(top_srcdir)/build/m4/ltoptions.m4 \ $(top_srcdir)/build/m4/ltsugar.m4 \ $(top_srcdir)/build/m4/ltversion.m4 \ $(top_srcdir)/build/m4/lt~obsolete.m4 \ $(top_srcdir)/build/m4/nls.m4 $(top_srcdir)/build/m4/po.m4 \ $(top_srcdir)/build/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(man8dir)" man5dir = $(mandir)/man5 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man1_MANS) $(man5_MANS) $(man8_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTKDOC_SCAN = @GTKDOC_SCAN@ HASH_LIBS = @HASH_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_CFLAGS = @LIBFFI_CFLAGS@ LIBFFI_LIBS = @LIBFFI_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTASN1_CFLAGS = @LIBTASN1_CFLAGS@ LIBTASN1_LIBS = @LIBTASN1_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P11KIT_LT_RELEASE = @P11KIT_LT_RELEASE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLEXT = @SHLEXT@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ p11_module_path = @p11_module_path@ p11_package_config_modules = @p11_package_config_modules@ p11_system_config = @p11_system_config@ p11_system_config_file = @p11_system_config_file@ p11_system_config_modules = @p11_system_config_modules@ p11_user_config = @p11_user_config@ p11_user_config_file = @p11_user_config_file@ p11_user_config_modules = @p11_user_config_modules@ pdfdir = @pdfdir@ prefix = @prefix@ privatedir = @privatedir@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_trust_paths = @with_trust_paths@ NULL = # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # The name of the module, e.g. 'glib'. DOC_MODULE = p11-kit # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR = $(top_srcdir)/p11-kit # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = --version # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS = --rebuild-types --deprecated-guards="P11_KIT_DISABLE_DEPRECATED" # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # MKHTML_OPTIONS=--path="$(builddir)/html $(srcdir)/html" # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = $(top_srcdir)/p11-kit/*.h CFILE_GLOB = $(top_srcdir)/p11-kit/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = \ private.h \ pkcs11.h \ conf.h \ debug.h \ dict.h \ log.h \ mock.h \ modules.h \ pkcs11.h \ pkcs11x.h \ private.h \ proxy.h \ util.h \ virtual.h \ array.h \ compat.h \ $(NULL) # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = generate_files = \ version.xml \ userdir.xml \ sysdir.xml \ $(NULL) # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = p11-kit-config.xml p11-kit-sharing.xml \ p11-kit-devel.xml \ p11-kit-proxy.xml \ p11-kit-trust.xml \ p11-kit.xml \ pkcs11.conf.xml \ trust.xml \ annotation-glossary.xml \ $(NULL) # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = $(generate_files) # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_LIBS = @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt \ style.css EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) $(MAN_IN_FILES) sysdir.xml \ userdir.xml version.xml $(NULL) DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) \ $(man1_MANS) $(man5_MANS) $(man8_MANS) $(NULL) @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp @ENABLE_GTK_DOC_FALSE@man1_MANS = # This includes the standard gtk-doc make rules, copied by gtkdocize. @ENABLE_GTK_DOC_TRUE@man1_MANS = trust.1 @ENABLE_GTK_DOC_FALSE@man8_MANS = @ENABLE_GTK_DOC_TRUE@man8_MANS = p11-kit.8 @ENABLE_GTK_DOC_FALSE@man5_MANS = @ENABLE_GTK_DOC_TRUE@man5_MANS = pkcs11.conf.5 @ENABLE_GTK_DOC_TRUE@XSLTPROC_FLAGS = \ @ENABLE_GTK_DOC_TRUE@ --nonet \ @ENABLE_GTK_DOC_TRUE@ --stringparam man.output.quietly 1 \ @ENABLE_GTK_DOC_TRUE@ --stringparam funcsynopsis.style ansi \ @ENABLE_GTK_DOC_TRUE@ --stringparam man.th.extra1.suppress 1 \ @ENABLE_GTK_DOC_TRUE@ --stringparam man.authors.section.enabled 0 \ @ENABLE_GTK_DOC_TRUE@ --stringparam man.copyright.section.enabled 0 @ENABLE_GTK_DOC_TRUE@XSLTPROC_MAN = \ @ENABLE_GTK_DOC_TRUE@ $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(builddir) \ @ENABLE_GTK_DOC_TRUE@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl MAN_IN_FILES = \ $(man8_MANS:.8=.xml) \ $(man5_MANS:.5=.xml) \ $(man1_MANS:.1=.xml) \ $(NULL) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/build/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/manual/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/manual/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/build/gtk-doc.make: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man1_MANS) @$(NORMAL_INSTALL) @list1='$(man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man5: $(man5_MANS) @$(NORMAL_INSTALL) @list1='$(man5_MANS)'; \ list2=''; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list='$(man5_MANS)'; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-man8: $(man8_MANS) @$(NORMAL_INSTALL) @list1='$(man8_MANS)'; \ list2=''; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile $(MANS) all-local installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man5 install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local uninstall-man uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local cscopelist-am ctags-am dist-hook \ distclean distclean-generic distclean-libtool distclean-local \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-data-local \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man1 install-man5 install-man8 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic maintainer-clean-local mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-local uninstall-man \ uninstall-man1 uninstall-man5 uninstall-man8 # Hacks around gtk-doc brokenness for out of tree builds p11-kit-sections.txt: $(srcdir)/p11-kit-sections.txt cp $(srcdir)/p11-kit-sections.txt p11-kit-sections.txt p11-kit-overrides.txt: $(srcdir)/p11-kit-overrides.txt cp $(srcdir)/p11-kit-overrides.txt p11-kit-overrides.txt # Generate our files with variables sysdir.xml: $(AM_V_GEN) echo -n $(p11_system_config) > "$@" userdir.xml: $(AM_V_GEN) echo -n $(p11_user_config) > "$@" version.xml: $(AM_V_GEN) echo -n $(VERSION) > "$@" @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### setup-build.stamp: -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ echo ' DOC Preparing build'; \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ done; \ fi; \ fi @touch setup-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo ' DOC Scanning header files' @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ echo " DOC Introspecting gobjects"; \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp @true #### xml #### sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) @echo ' DOC Building XML' @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(srcdir)/style.css @echo ' DOC Building HTML' @rm -rf html @mkdir html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; @echo ' DOC Fixing cross-references' @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @mv $(builddir)/html/style.css $(builddir)/html/gtk-doc.css @cp $(srcdir)/style.css $(builddir)/html/style.css @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building PDF' @rm -f $(DOC_MODULE).pdf @mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ fi maintainer-clean-local: clean @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and --enable-doc in order to make dist" @ENABLE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs @ENABLE_GTK_DOC_TRUE@trust.1: trust.xml $(generate_files) @ENABLE_GTK_DOC_TRUE@ $(AM_V_GEN) $(XSLTPROC_MAN) $< @ENABLE_GTK_DOC_TRUE@pkcs11.conf.5: pkcs11.conf.xml $(generate_files) @ENABLE_GTK_DOC_TRUE@ $(AM_V_GEN) $(XSLTPROC_MAN) $< @ENABLE_GTK_DOC_TRUE@p11-kit.8: p11-kit.xml $(generate_files) @ENABLE_GTK_DOC_TRUE@ $(AM_V_GEN) $(XSLTPROC_MAN) $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: p11-kit-0.20.2/doc/manual/version.xml0000664000175000017500000000000612265207765014145 000000000000000.20.1p11-kit-0.20.2/doc/manual/p11-kit-config.xml0000664000175000017500000000756012226763526015124 00000000000000 ]> PKCS#11 Configuration
Consistent configuration In order for multiple applications on the user's desktop to use PKCS#11 modules in a consistent manner, there must be a configuration or registry to specify which modules to load and how to use them. The PKCS#11 specification does not specify such a configuration standard. Because of the multi-library module initialization problem, use of PKCS#11 modules must be coordinated within an application. p11-kit provides that coordination. Since coordination is required, it follows that p11-kit can also implement a consistent module configuration.
Example The following sections describe the config format in detail. But first an example which shows the various features. The configuration below, loads two modules called 'my-module' and 'nss'. The user settings override some aspects of the system settings. Global configuration file: &sysdir;/pkcs11.conf # This setting controls whether to load user configuration from the # &userdir; directory. Possible values: # none: No user configuration # merge: Merge the user config over the system configuration (default) # only: Only user configuration, ignore system configuration user-config: merge One module configuration file per module: &sysdir;/modules/my-module # This setting controls the actual module library to load. This config file # might be installed by the package that installs this module library. This # is not an absolute path name. Relative path names are loaded from the # $(libdir)/pkcs11 directory by default. module: my-pkcs11-module.so # This controls whether the module is required to successfully initialize. If 'yes', then # a failure to load or initialize this module will result in a p11-kit system failure. critical: no User configuration file: &userdir;/pkcs11.conf # This is an empty file. Files that do not exist are treated as empty. User configuration file: &userdir;/modules/my-module # Merge with the settings in the system my-module config file. In this case # a developer has overridden to load a different module for my-module instead. module: /home/user/src/custom-module/my-module.so User configuration file: &userdir;/modules/nss # Load the NSS libsoftokn.so.3 PKCS#11 library as a module. Note that we pass # some custom non-standard initialization arguments, as NSS expects. module: /usr/lib/libsoftokn3.so x-init-reserved: configdir='sql:/home/test/.pki/nssdb' certPrefix='' keyPrefix='' secmod='socmod.db' critical: yes
Configuration Files A complete configuration consists of several files. These files are text files. Since p11-kit is built to be used in all sorts of environments and at very low levels of the software stack, we cannot make use of high level configuration APIs that you may find on a modern desktop. See the manual page for more details on the format and available options. Note that user configuration files are not loaded from the home directory if running inside a setuid or setgid program.
p11-kit-0.20.2/doc/manual/Makefile.am0000664000175000017500000001064212265210523013763 00000000000000abs_top_builddir = @abs_top_builddir@ NULL = # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # The name of the module, e.g. 'glib'. DOC_MODULE=p11-kit # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR=$(top_srcdir)/p11-kit # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= --version # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS= --rebuild-types --deprecated-guards="P11_KIT_DISABLE_DEPRECATED" # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # MKHTML_OPTIONS=--path="$(builddir)/html $(srcdir)/html" # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB=$(top_srcdir)/p11-kit/*.h CFILE_GLOB=$(top_srcdir)/p11-kit/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES= \ private.h \ pkcs11.h \ conf.h \ debug.h \ dict.h \ log.h \ mock.h \ modules.h \ pkcs11.h \ pkcs11x.h \ private.h \ proxy.h \ util.h \ virtual.h \ array.h \ compat.h \ $(NULL) # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= generate_files= \ version.xml \ userdir.xml \ sysdir.xml \ $(NULL) # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files=p11-kit-config.xml p11-kit-sharing.xml \ p11-kit-devel.xml \ p11-kit-proxy.xml \ p11-kit-trust.xml \ p11-kit.xml \ pkcs11.conf.xml \ trust.xml \ annotation-glossary.xml \ $(NULL) # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= $(generate_files) # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_LIBS= # Hacks around gtk-doc brokenness for out of tree builds p11-kit-sections.txt: $(srcdir)/p11-kit-sections.txt cp $(srcdir)/p11-kit-sections.txt p11-kit-sections.txt p11-kit-overrides.txt: $(srcdir)/p11-kit-overrides.txt cp $(srcdir)/p11-kit-overrides.txt p11-kit-overrides.txt # Generate our files with variables sysdir.xml: $(AM_V_GEN) echo -n $(p11_system_config) > "$@" userdir.xml: $(AM_V_GEN) echo -n $(p11_user_config) > "$@" version.xml: $(AM_V_GEN) echo -n $(VERSION) > "$@" # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/build/gtk-doc.make if ENABLE_GTK_DOC man1_MANS = trust.1 man8_MANS = p11-kit.8 man5_MANS = pkcs11.conf.5 XSLTPROC_FLAGS = \ --nonet \ --stringparam man.output.quietly 1 \ --stringparam funcsynopsis.style ansi \ --stringparam man.th.extra1.suppress 1 \ --stringparam man.authors.section.enabled 0 \ --stringparam man.copyright.section.enabled 0 XSLTPROC_MAN = \ $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(builddir) \ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl trust.1: trust.xml $(generate_files) $(AM_V_GEN) $(XSLTPROC_MAN) $< pkcs11.conf.5: pkcs11.conf.xml $(generate_files) $(AM_V_GEN) $(XSLTPROC_MAN) $< p11-kit.8: p11-kit.xml $(generate_files) $(AM_V_GEN) $(XSLTPROC_MAN) $< else # ENABLE_GTK_DOC man1_MANS = man5_MANS = man8_MANS = endif # ENABLE_GTK_DOC MAN_IN_FILES = \ $(man8_MANS:.8=.xml) \ $(man5_MANS:.5=.xml) \ $(man1_MANS:.1=.xml) \ $(NULL) CLEANFILES += \ $(man1_MANS) \ $(man5_MANS) \ $(man8_MANS) \ $(NULL) EXTRA_DIST += \ $(MAN_IN_FILES) \ sysdir.xml \ userdir.xml \ version.xml \ $(NULL) p11-kit-0.20.2/doc/manual/p11-kit-proxy.xml0000664000175000017500000000262712226763526015037 00000000000000 Proxy Module When an application is aware of the fact that coordination is necessary between multiple consumers of a PKCS#11 module, and wants to load standard configured PKCS#11 modules, it can link to p11-kit and use the functions there to provide this functionality. However most current consumers of PKCS#11 are ignorant of this problem, and do not link to p11-kit. In order to solve this multiple initialization problem for all applications, p11-kit provides a proxy compatibility module. This proxy module acts like a normal PKCS#11 module, but internally loads a preconfigured set of PKCS#11 modules and manages their features as described earlier. Each slot in the configured modules is exposed as a slot of the p11-kit proxy module. The proxy module is then used as a normal PKCS#11 module would be. It can be loaded by crypto libraries like NSS and behaves as expected. The C_GetFunctionList exported entry point of the proxy module returns a new managed PKCS#11 module each time it is called. These managed instances are released when the proxy module is unloaded. p11-kit-0.20.2/doc/manual/p11-kit-devel.xml0000664000175000017500000003441512226763526014755 00000000000000 Building, Packaging, and Contributing to p11-kit
Packaging PKCS#11 module configs Developers or packagers of PKCS#11 modules need to install various files into specific locations so that p11-kit will recognize and load the module correctly. You should use pkg-config as described below to determine configuration paths. p11-kit installs a pkg-config file called p11-kit-1.pc. This file contains all the information about the various paths that p11-kit looks for files at.
Path to place module configuration As described in the module configuration documentation, each PKCS#11 module should install a config file describing that module. These config files should be installed to a specific directory which can be determined by running: $ pkg-config p11-kit-1 --variable p11_module_configs /usr/share/p11-kit/modules
Default path for modules with relative paths If a module configuration contains a relative path in its module: setting, then that module will be loaded from the default module path. This path can be determined by running: $ pkg-config p11-kit-1 --variable p11_module_path /usr/lib64/pkcs11
Customizing installed commands The p11-kit tool provides a extract-trust command which extracts trust policy information such as certificate anchors and so on into files for use with libraries that cannot read this trust information directly. In order to be useful the extract-trust command needs to be customized per distribution or site. You can find this file in at tools/p11-kit-trust-extract.in in the p11-kit source code. The command is implemented as a simple script which performs the various p11-kit extract commands necessary to extract the information. Using this script as a standard way to extract this information allows for consistency between distributions and ease of system administration.
Compiling p11-kit from Source This describes how to compiling the p11-kit package from source code. This is normally only necessary for those wishing to contribute to the project or package p11-kit. You can download tarballs of the releases of p11-kit or check out the source code from git. This documentation will not go into all the details of how to get your development environment set up and instead focus on the what's unique to compiling p11-kit.
Building on UNIX p11-kit uses the standard GNU build system, using autoconf for package configuration and resolving portability issues, automake for building makefiles that comply with the GNU Coding Standards, and libtool for building shared libraries on multiple platforms. The normal sequence for compiling and installing the p11-kit library is thus: $ ./configure --prefix=/path/to/prefix ... $ make $ make install If you've checked out the source code from git, then the configure script does not yet exist. So use the following instead: $ ./autogen.sh --prefix=/path/to/prefix ... $ make $ make install The standard options provided by GNU autoconf may be passed to the configure script. Please see the autoconf documentation or run ./configure --help for information about the standard options. In particular you probably want to adjust the --prefix=/xxx argument depending on your system and development environment.
Optional Dependencies On a modern GNU Linux system, p11-kit has no required dependencies other than the standard C library. However on older UNIX systems, some of the following may be required. gettext is required if your system doesn't have the gettext() functionality for handling message translation databases. This can be provided by the libintl library from the GNU gettext package. pthread is required if your (ancient) system doesn't have this included in the base system. How this is provided is platform specific. In addition p11-kit has several optional dependencies. If these are not available during the build, then certain features will be disabled. libffi for sharing of PKCS#11 modules between multiple callers in the same process. It is highly recommended that this dependency be treated as a required dependency. gtk-doc is required to build the reference manual. Use --enable-doc to control this dependency. xsltproc is required to build the command manual pages. Use --enable-doc to control this dependency. libtasn1 is required to build the trust module and code that interacts with certificates. freebl3 (developed as part of the NSS code base) is an optional dependency that may be used to meet policy requirements of system builders. Enabling this dependency provides no other advantage.
Extra Configuration Options In addition to the normal options, the configure script in the p11-kit library supports these additional arguments: Disables building of the trust policy module. , By default p11-kit is built with debug symbols assertions and and precondition checks. Enabling the debug option configures even more detailed debug build, including disabling optimization. Disabling the debug option is not recommended, as it disables all assertions, preconditions and internal consistency checks, although it may result it a slightly faster library. Enables building of the documentation and command line manual. The documentation is built in the doc/html/ directory of the build. Requires the gtk-doc and xsltproc dependencies. Enables strict checks during building of p11-kit. All compiler warnings become errors. Instead of using internal hash code, link to the freebl3 library and use its hash implementations. The only advantage this brings is to meet the policy requirements of system builders. , Build with a dependency on the libtasn1 library. This dependency allows the trust policy module to be built as well as other code that interacts with certificates. Specify the path to look for PKCS#11 modules which were listed in a module config file with a relative path. Specify the files or directories to look for certificate anchors and blacklists. Multiple files and/or directories are specified with a : in between them. The first path has the highest priority when searching for certificates. Specify the path to look for p11-kit config files. This usually defaults to something like /etc/pkcs11 Specify the path to look for user specific p11-kit config files. If specify a path that begins with ~/ then this is expanded to the home directory of the user running p11-kit. If you specify a path that begins with ~/.config/ then this is expanded to the $XDG_CONFIG_HOME directory, as outlined in the XDG Base Dir specification. This option defaults to ~/.pkcs11
Coding Style We use a code style similar to the linux kernel. Use tabs to indent and spaces to align/wrap beyond the indentation level. We don't try to guarantee completely robust and problem free behavior in cases where the caller or system isn't behaving. We consider these to be outside of our control: Broken input from callers. We use preconditions to check input and immediately return. We don't try to provide error codes for all the various ways callers can screw around. Out of memory. It is pretty much impossible to handle out of memory errors correctly. Handling them alongside other errors is naive and broken. We don't try to guarantee library state (such as locks or memory leaks) when memory allocation fails. We do check the results from all memory allocations, but treat them as unexpected conditions. As a nod to the behavior of callers of this library, we don't abort on memory allocation failures. We use preconditions with somewhat sane results. Exception: when reading files or allocating potentially unbounded amounts of memory, we should respond robustly to memory allocation failures. These unexpected conditions indicate a bug either in p11-kit or in the system. All bets are off once this occurs. Use the return_val_xxx() precondition macros to check for unexpected conditions.
Testing and Code Coverage As a general rule changes to p11-kit should have a tests exercising that change. Use the make check command to run all the tests. If you run it from a subdirectory only the tests in that directory will be run. To check for memory errors or memory leaks, run make memcheck or make leakcheck respectively. This requires valgrind be installed. Build p11-kit with the configure option to build code coverage support. Once you've done that you can either use make coverage to build code coverage information. Alternatively (and this is usually easier) you can use git coverage to easily check whether you've tested the lines changed by a patch. A code coverage report is available online.
Debugging Tips Unexpected conditions will produce critical warnings by p11-kit. These are often failed internal preconditions, and usually indicate a bug either in p11-kit or the software calling it. You can use the environment variable P11_KIT_STRICT=yes to make p11-kit do an abort() (and core dump depending on your configuration) when a critical warning occurs.
p11-kit-0.20.2/doc/manual/p11-kit-sections.txt0000664000175000017500000000533412265245672015522 00000000000000
p11-kit-uri P11_KIT_URI_SCHEME P11_KIT_URI_SCHEME_LEN P11KitUriType P11KitUriResult P11KitUri p11_kit_uri p11_kit_uri_new p11_kit_uri_get_module_info p11_kit_uri_match_module_info p11_kit_uri_get_token_info p11_kit_uri_match_token_info p11_kit_uri_get_attributes p11_kit_uri_set_attributes p11_kit_uri_clear_attributes p11_kit_uri_match_attributes p11_kit_uri_get_attribute p11_kit_uri_set_attribute p11_kit_uri_clear_attribute p11_kit_uri_set_unrecognized p11_kit_uri_any_unrecognized p11_kit_uri_get_pin_source p11_kit_uri_set_pin_source p11_kit_uri_get_pinfile p11_kit_uri_set_pinfile p11_kit_uri_format p11_kit_uri_parse p11_kit_uri_free p11_kit_uri_message P11_KIT_URI_NO_MEMORY
p11-kit-pin P11KitPin p11_kit_pin_new p11_kit_pin_new_for_buffer p11_kit_pin_new_for_string p11_kit_pin_get_value p11_kit_pin_get_length p11_kit_pin_ref p11_kit_pin_unref P11KitPinFlags P11_KIT_PIN_FALLBACK p11_kit_pin_register_callback p11_kit_pin_unregister_callback p11_kit_pin_callback p11_kit_pin_request p11_kit_pin_destroy_func p11_kit_pin_file_callback
p11-kit P11_KIT_MODULE_CRITICAL P11_KIT_MODULE_UNMANAGED p11_kit_modules_load_and_initialize p11_kit_modules_finalize_and_release p11_kit_modules_load p11_kit_modules_initialize p11_kit_modules_finalize p11_kit_modules_release p11_kit_module_load p11_kit_module_initialize p11_kit_module_finalize p11_kit_module_release p11_kit_module_for_name p11_kit_module_get_name p11_kit_module_get_flags p11_kit_config_option
p11-kit-util p11_kit_strerror p11_kit_message p11_kit_space_strdup p11_kit_space_strlen CK_FUNCTION_LIST_PTR CK_RV CK_ATTRIBUTE CK_ATTRIBUTE_PTR CK_ATTRIBUTE_TYPE CK_FLAGS CK_FUNCTION_LIST CK_INFO_PTR CK_TOKEN_INFO_PTR CK_ULONG p11_kit_uri_result_t p11_kit_uri_type_t
p11-kit-future p11_kit_set_progname p11_kit_be_quiet p11_kit_be_loud p11_kit_destroyer P11KitIter p11_kit_iter p11_kit_iter_new p11_kit_iter_set_uri p11_kit_iter_add_callback p11_kit_iter_add_filter p11_kit_iter_callback p11_kit_iter_begin p11_kit_iter_begin_with p11_kit_iter_next p11_kit_iter_get_module p11_kit_iter_get_slot p11_kit_iter_get_token p11_kit_iter_get_session p11_kit_iter_keep_session p11_kit_iter_get_object p11_kit_iter_load_attributes p11_kit_iter_destroy_object p11_kit_iter_free P11KitIterBehavior
p11-kit-deprecated p11_kit_initialize_registered p11_kit_finalize_registered p11_kit_registered_modules p11_kit_registered_module_to_name p11_kit_registered_name_to_module p11_kit_registered_option p11_kit_initialize_module p11_kit_load_initialize_module p11_kit_finalize_module P11_KIT_DEPRECATED_FOR
p11-kit-0.20.2/doc/Makefile.in0000664000175000017500000004665012265245664012545 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/gettext.m4 \ $(top_srcdir)/build/m4/iconv.m4 \ $(top_srcdir)/build/m4/lib-ld.m4 \ $(top_srcdir)/build/m4/lib-link.m4 \ $(top_srcdir)/build/m4/lib-prefix.m4 \ $(top_srcdir)/build/m4/libtool.m4 \ $(top_srcdir)/build/m4/ltoptions.m4 \ $(top_srcdir)/build/m4/ltsugar.m4 \ $(top_srcdir)/build/m4/ltversion.m4 \ $(top_srcdir)/build/m4/lt~obsolete.m4 \ $(top_srcdir)/build/m4/nls.m4 $(top_srcdir)/build/m4/po.m4 \ $(top_srcdir)/build/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTKDOC_SCAN = @GTKDOC_SCAN@ HASH_LIBS = @HASH_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_CFLAGS = @LIBFFI_CFLAGS@ LIBFFI_LIBS = @LIBFFI_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTASN1_CFLAGS = @LIBTASN1_CFLAGS@ LIBTASN1_LIBS = @LIBTASN1_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P11KIT_LT_RELEASE = @P11KIT_LT_RELEASE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLEXT = @SHLEXT@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ p11_module_path = @p11_module_path@ p11_package_config_modules = @p11_package_config_modules@ p11_system_config = @p11_system_config@ p11_system_config_file = @p11_system_config_file@ p11_system_config_modules = @p11_system_config_modules@ p11_user_config = @p11_user_config@ p11_user_config_file = @p11_user_config_file@ p11_user_config_modules = @p11_user_config_modules@ pdfdir = @pdfdir@ prefix = @prefix@ privatedir = @privatedir@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_trust_paths = @with_trust_paths@ SUBDIRS = manual all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am memcheck: leakcheck: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: p11-kit-0.20.2/doc/Makefile.am0000664000175000017500000000005112144374545012512 00000000000000 SUBDIRS = manual memcheck: leakcheck: p11-kit-0.20.2/config.h.in0000664000175000017500000001331212265245671011741 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have the `asprintf' function. */ #undef HAVE_ASPRINTF /* Define to 1 if you have the `basename' function. */ #undef HAVE_BASENAME /* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT /* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the declaration of `asprintf', and to 0 if you don't. */ #undef HAVE_DECL_ASPRINTF /* Define to 1 if you have the declaration of `program_invocation_short_name', and to 0 if you don't. */ #undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME /* Define to 1 if you have the declaration of `vasprintf', and to 0 if you don't. */ #undef HAVE_DECL_VASPRINTF /* Define to 1 if you have the declaration of `__progname', and to 0 if you don't. */ #undef HAVE_DECL___PROGNAME /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `getauxval' function. */ #undef HAVE_GETAUXVAL /* Define to 1 if you have the `getexecname' function. */ #undef HAVE_GETEXECNAME /* Define to 1 if you have the `getprogname' function. */ #undef HAVE_GETPROGNAME /* Define to 1 if you have the `getresuid' function. */ #undef HAVE_GETRESUID /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Whether gmtime_r() is available */ #undef HAVE_GMTIME_R /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `issetugid' function. */ #undef HAVE_ISSETUGID /* Define to 1 if you have the `intl' library (-lintl). */ #undef HAVE_LIBINTL /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Define to 1 if you have the `memdup' function. */ #undef HAVE_MEMDUP /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkdtemp' function. */ #undef HAVE_MKDTEMP /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Whether program_invocation_short_name available */ #undef HAVE_PROGRAM_INVOCATION_SHORT_NAME /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the `strnstr' function. */ #undef HAVE_STRNSTR /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `timegm' function. */ #undef HAVE_TIMEGM /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vasprintf' function. */ #undef HAVE_VASPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Whether __libc_enable_secure available */ #undef HAVE___LIBC_ENABLE_SECURE /* Whether __progname available */ #undef HAVE___PROGNAME /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Disable glib assertions */ #undef NDEBUG /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Building for unix */ #undef OS_UNIX /* Building for win32 */ #undef OS_WIN32 /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Major version of package */ #undef PACKAGE_MAJOR /* Minor version of package */ #undef PACKAGE_MINOR /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* File extension for shared libraries */ #undef SHLEXT /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* The trust module input paths */ #undef TRUST_PATHS /* Version number of package */ #undef VERSION /* Build with libtasn1 and certificate support */ #undef WITH_ASN1 /* Print debug output */ #undef WITH_DEBUG /* Use libffi for building closures */ #undef WITH_FFI /* Use freebl for hash implementation */ #undef WITH_FREEBL /* More strict checks */ #undef WITH_STRICT /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* In debug mode */ #undef _DEBUG p11-kit-0.20.2/NEWS0000664000175000017500000002016212265245660010414 000000000000000.20.2 (stable) * Fix bug where blacklist didn't affect extracted ca-anchors if the anchor and blacklist were not in the same trust path (regression) [#73558] * Check for race in BasicConstraints stapled extension [#69314] * autogen.sh now runs configure as srcdir != builddir by default * Build fixes and cleanup 0.20.1 (stable) * Extract compat trust data after we've changes * Skip compat extraction if running as non-root * Better failure messages when removing anchors * Build cleanup 0.20.0 (stable) * Doc fixes 0.19.4 (unstable) * 'trust anchor' now adds/removes certificate anchors * 'trust list' lists trust policy stuff * 'p11-kit extract' is now 'trust extract' * 'p11-kit extract-trust' is now 'trust extract-compat' * Workarounds for working on broken zfsonlinux.org [#68525] * Add --with-module-config parameter to the configure script [#68122] * Add support for removing stored PKCS#11 objects in trust module * Various debugging tweaks 0.19.3 (unstable) * Fix up problems with automake testing * Fix a bunch of memory leaks in newly refactored code * Don't use _GNU_SOURCE and the unportability it brings * Testing fixes 0.19.2 (unstable) * Add basic 'trust anchor' command to store a new anchor * Support for writing out trust token objects * Port to use CKA_PUBLIC_KEY_INFO and updated trust store spec * Add option to use freebl for hashing * Implement reloading of token data * Fix warnings and possible minor bugs higlighted by code scanners * Don't load configs in home directories when running setuid or setgid * Support treating ~/.config as $XDG_CONFIG_HOME * Use $XDG_DATA_HOME/pkcs11 as default user config directory * Use $TMPDIR instead of $TEMP while testing * Open files and fds with O_CLOEXEC * Abort initialization if a critical module fails to load * Don't use thread-unsafe functions: strerror, getpwuid * Fix p11_kit_space_strlen() result when empty string * Refactoring of where various components live * Build fixes 0.19.1 (unstable) * Refactor API to be able to handle managed modules * Deprecate much of old p11-kit API * Implement concept of managed modules * Make C_CloseAllSessions function work for multiple callers * New dependency on libffi * Fix possible threading problems reported by hellgrind * Add log-calls option * Mark p11_kit_message() as a stable function * Use our own unit testing framework 0.18.3 (stable) * Fix reinitialization of trust module [#65401] * Fix crash in trust module C_Initialize * Mac OS fixes [#57714] 0.18.2 (stable) * Build fixes [#64378 ...] 0.18.1 (stable) * Put the external tools in $libdir/p11-kit * Documentation build fixes 0.18.0 (stable) * Fix use of trust module with gcr and empathy [#62896] * Further tweaks to trust module date parsing * Fix unaligned memory reads [#62819] * Win32 fixes [#63062, #63046] * Debug and logging tweaks [#62874] * Other build fixes 0.17.5 (unstable) * Don't try to guess at overflowing time values on 32-bit systems [#62825] * Test fixes [#927394] 0.17.4 (unstable) * Check for duplicate certificates in a token, warn and discard [#62548] * Implement a proper index so we have decent load performance 0.17.3 (unstable) * Use descriptive labels for the trust module tokens [#62534] * Remove the temporary built in distrust objects * Make extracted output directories and files read-only [#61898] * Don't export unneccessary ABI * Build fixes [#62479] 0.17.2 (unstable) * Fix build on 32-bit linux * Fix several crashers 0.17.1 (unstable) * Support a p11-kit specific PKCS#11 attribute persistance format [#62156] * Use the SHA1 hash of SPKI as the CKA_ID in the trust module by default [#62329] * Refactor a trust builder which builds objects out of parsed data [#62329] * Combine trust policy when extracting certificates [#61497] * The extract --comment option adds comments to PEM bundles [#62029] * A new 'priority' config option for ordering modules [#61978] * Make each configured path its own trust module token [#61499] * Use --with-trust-paths to configure trust module [#62327] * Fix bug decoding some PEM files * Better debug output for trust module lookups * Work around bug in NSS when doing serial number lookups * Work around broken strndup() function in firefox * Fix the nickname for the distrusted attribute * Build fixes 0.16.4 (stable) * Display per command help again [#62153] * Don't always print tools debug output [#62152] 0.16.3 (stable) * When iterating don't skip tokens without the CKF_TOKEN_INITIALIZED flag * Hardcode some distrust records for NSS temporarily * Parse global options better in the p11-kit command * Better debugging 0.16.2 (stable) * Fix regression in 'p11-kit extract --purpose' option [#62009] * Documentation updates * Build fixes [#62001, ...] 0.16.1 (stable) * Don't break when cA field of BasicConstraints is missing [#61975] * Documentation fixes and updates * p11-kit extract-trust is a placeholder script now 0.16.0 (stable) * Update the pkcs11.h header for new mechanisms * Fix build and tests on mingw64 (ie: win32) * Relicense LGPL code to BSD license * Documentation tweaks * Pull translations from Transifex [#60792] * Build fixes [#61739, #60894, #61740] 0.15.2 (unstable) * Add German and Finish translations * Better define the libtasn1 dependency * Crasher and bug fixes * Build fixes 0.15.1 (unstable) * Fix some memory leaks * Add a location for packages to drop module configs * Documentation updates and fixes * Add command line tool manual page * Remove unused err() function and friends * Move more code into common/ directory and refactor * Add a system trust policy module * Refactor how the p11-kit command line tool works * Add p11-kit extract and extract-trust commands * Don't complain if we cannot access ~/.pkcs11/pkcs11.conf * Refuse to load the p11-kit-proxy.so as a registered module * Don't fail initialization if last initialized module fails 0.14 * Change default for user-config to merge * Always URI-encode the 'id' attribute in PKCS#11 URIs * Expect a .module extension on module configs * Windows compatibility fixes * Testing fixes * Build fixes 0.13 * Don't allow reading of PIN files larger than 4096 bytes * If a module is not marked as critical then ignore init failure * Use preconditions to check for input problems and out of memory * Add enable-in and disable-in options to module config * Fix the flags in pin.h * Use gcc extensions to check varargs during compile * Fix crasher when a duplicate module is present * Fix broken hashmap behavior * Testing fixes * Win32 build fixes * 'p11-kit -h' now works * Documentation fixes 0.12 * Build fix 0.11 * Remove automatic reinitialization of PKCS#11 after fork 0.10 * Build fixes, for windows, gcc 4.6.1 0.9 * p11-kit can't be used as a static library * Fix problems crashing when freeing TLS on windows * Add debug output to windows init and uninit of library * Build fixes, especially for windows 0.8 * Rename non-static functions to have a _p11_xxx prefix * No concurrent calling of C_Initialize and C_Finalize * Print more information in 'p11-kit -l' * Initial port to win32 * Build, testing fixes 0.7 * Expand p11-kit config variables correctly invarious build scenarios * Add test tool to print out error messages * Build fix on FreeBSD 0.6 * Add concept of a default module directory from which modules with relative paths are loaded. * Renamed pkg-config variables to make it clearer what's what. 0.5 * Fix crasher in p11_kit_registered_modules() * Add 'critical' setting for modules, which defaults to 'no' * Fix initialization issues in the proxy module 0.4 * Fix endless loop if module forks during initialization * Update PKCS#11 URI code for new draft of spec * Don't fail when duplicate modules are configured * Better debug output * Add example configuration documentation * Support whitespace in PKCS#11 URIs 0.3 * Rewrite hash table, and simplify licensing. * Correct paths for p11-kit config files. * Many build fixes and tweaks. 0.2 * List token labels in 'p11-kit -l' * Add API's for handing the pinfile part of URIs * Use /etc/pkcs11 by default instead of ${prefix}/etc/pkcs11 * Bug fixes 0.1 * Initial release p11-kit-0.20.2/ChangeLog0000664000175000017500000000216412161102013011444 00000000000000=== ChangeLog is autogenerated === This project relys on commit messages to provide change history. Please write commit messages in the following format: === begin example commit === Short explanation of the commit Longer explanation explaining exactly what's changed, whether any external or private interfaces changed, what bugs were fixed (with bug tracker reference if applicable) and so forth. Be concise but not too brief. === end example commit === - Always add a brief description of the commit to the _first_ line of the commit and terminate by two newlines. This may be the title of a fixed bug, copied from Bugzilla. - First line (the brief description) must only be one sentence and should start with a capital letter unless it starts with a lowercase symbol or identifier. Don't use a trailing full stop, and don't exceed 72 characters. - The main description (the body) is normal prose and should use normal punctuation and capital letters where appropriate. - When committing code on behalf of others use the --author option, e.g. git commit -a --author "Joe Coder " and --signoff. p11-kit-0.20.2/build/0000775000175000017500000000000012265245672011076 500000000000000p11-kit-0.20.2/build/m4/0000775000175000017500000000000012265245671011415 500000000000000p11-kit-0.20.2/build/m4/ltoptions.m40000644000175000017500000003007312265210001013606 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) p11-kit-0.20.2/build/m4/gettext.m40000644000175000017500000003561512265207774013275 00000000000000# gettext.m4 serial 66 (gettext-0.18.2) dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value '$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ]])], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST([DATADIRNAME]) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST([INSTOBJEXT]) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST([GENCAT]) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST([INTLOBJS]) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST([INTLLIBS]) dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) AC_SUBST([POSUB]) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) p11-kit-0.20.2/build/m4/progtest.m40000644000175000017500000000604012265207774013446 00000000000000# progtest.m4 serial 7 (gettext-0.18.2) dnl Copyright (C) 1996-2003, 2005, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. AC_PREREQ([2.50]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$][$1]) else AC_MSG_RESULT([no]) fi AC_SUBST([$1])dnl ]) p11-kit-0.20.2/build/m4/po.m40000644000175000017500000004504112265207774012221 00000000000000# po.m4 serial 21 (gettext-0.18.3) dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" tab=`printf '\t'` if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; powerpcle-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS p11-kit-0.20.2/build/m4/ltsugar.m40000644000175000017500000001042412265210001013232 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) p11-kit-0.20.2/build/m4/lib-ld.m40000644000175000017500000000714312265207774012747 00000000000000# lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; const char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; }]])], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], [ changequote(,)dnl case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac changequote([,])dnl ]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [m4_ifdef([gl_00GNULIB], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ]], [[]])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test -n "$am_cv_proto_iconv_arg1"; then ICONV_CONST="const" fi ]) fi ]) p11-kit-0.20.2/build/m4/ltversion.m40000644000175000017500000000126212265210001013576 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) p11-kit-0.20.2/build/m4/lib-prefix.m40000644000175000017500000002042212265207774013640 00000000000000# lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) p11-kit-0.20.2/build/m4/nls.m40000644000175000017500000000231512265207774012374 00000000000000# nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) p11-kit-0.20.2/build/m4/lib-link.m40000644000175000017500000010044312265207774013302 00000000000000# lib-link.m4 serial 26 (gettext-0.18.2) dnl Copyright (C) 2001-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ([2.54]) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[m4_translit([$1],[./+-], [____])]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes popdef([NAME]) popdef([Name]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. The missing-message dnl defaults to 'no' and may contain additional hints for the user. dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[m4_translit([$1],[./+-], [____])]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, dnl because these -l options might require -L options that are present in dnl LIBS. -l options benefit only from the -L options listed before it. dnl Otherwise, add it to the front of LIBS, because it may be a static dnl library that depends on another static library that is present in LIBS. dnl Static libraries benefit only from the static libraries listed after dnl it. case " $LIB[]NAME" in *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; *) LIBS="$LIB[]NAME $LIBS" ;; esac AC_LINK_IFELSE( [AC_LANG_PROGRAM([[$3]], [[$4]])], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) popdef([NAME]) popdef([Name]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl acl_libext, dnl acl_shlibext, dnl acl_libname_spec, dnl acl_library_names_spec, dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_separator, dnl acl_hardcode_direct, dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) p11-kit-0.20.2/build/aux/0000775000175000017500000000000012265245671011672 500000000000000p11-kit-0.20.2/build/aux/missing0000755000175000017500000001533112265210005013171 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: p11-kit-0.20.2/build/aux/depcomp0000755000175000017500000005601612265210006013155 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: p11-kit-0.20.2/build/aux/config.guess0000755000175000017500000012746312265210005014124 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012, 2013 Free Software Foundation, Inc. timestamp='2012-12-29' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: p11-kit-0.20.2/build/aux/install-sh0000755000175000017500000003325512265210005013603 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: p11-kit-0.20.2/build/aux/config.rpath0000755000175000017500000004443512265207774014134 00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2013 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; nagfor*) wl='-Wl,-Wl,,' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; xl* | bgxl* | bgf* | mpixl*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) wl= ;; *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; newsos6) ;; *nto* | *qnx*) ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) wl='-Qoption ld ' ;; *) wl='-Wl,' ;; esac ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; haiku*) ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) case "$host_cpu" in powerpc*) library_names_spec='$libname$shrext' ;; m68k) library_names_spec='$libname.a' ;; esac ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) library_names_spec='$libname$shrext$versuffix' ;; *) library_names_spec='$libname$shrext' ;; esac ;; gnu*) library_names_spec='$libname$shrext' ;; haiku*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; tpf*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: p11-kit-0.20.2/build/aux/ltmain.sh0000644000175000017500000105152212265210001013411 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 p11-kit-0.20.2/build/aux/config.sub0000755000175000017500000010550312265210005013556 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012, 2013 Free Software Foundation, Inc. timestamp='2012-12-29' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: p11-kit-0.20.2/build/Makefile.tests0000664000175000017500000000115112265200507013601 00000000000000NULL = TEST_CFLAGS = \ -DSRCDIR=\"$(abs_srcdir)\" \ -DBUILDDIR=\"$(abs_builddir)\" \ -DP11_KIT_FUTURE_UNSTABLE_API MEMCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=80 --quiet LEAKCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=81 --quiet --leak-check=yes HELLCHECK_ENV = $(TEST_RUNNER) valgrind --error-exitcode=82 --quiet --tool=helgrind memcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(MEMCHECK_ENV)" check-TESTS leakcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(LEAKCHECK_ENV)" check-TESTS hellcheck: all make $(AM_MAKEFLAGS) TESTS_ENVIRONMENT="$(HELLCHECK_ENV)" check-TESTS p11-kit-0.20.2/build/gtk-doc.make0000664000175000017500000001742712226763526013220 00000000000000# -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt \ style.css EXTRA_DIST = \ $(HTML_IMAGES) \ $(SETUP_FILES) DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) if ENABLE_GTK_DOC if GTK_DOC_BUILD_HTML HTML_BUILD_STAMP=html-build.stamp else HTML_BUILD_STAMP= endif if GTK_DOC_BUILD_PDF PDF_BUILD_STAMP=pdf-build.stamp else PDF_BUILD_STAMP= endif all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) else all-local: endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### setup-build.stamp: -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ echo ' DOC Preparing build'; \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ done; \ fi; \ fi @touch setup-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo ' DOC Scanning header files' @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ echo " DOC Introspecting gobjects"; \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp @true #### xml #### sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) @echo ' DOC Building XML' @_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(srcdir)/style.css @echo ' DOC Building HTML' @rm -rf html @mkdir html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; @echo ' DOC Fixing cross-references' @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @mv $(builddir)/html/style.css $(builddir)/html/gtk-doc.css @cp $(srcdir)/style.css $(builddir)/html/style.css @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building PDF' @rm -f $(DOC_MODULE).pdf @mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ fi maintainer-clean-local: clean @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # if ENABLE_GTK_DOC dist-check-gtkdoc: else dist-check-gtkdoc: @echo "*** gtk-doc must be installed and --enable-doc in order to make dist" @false endif dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs p11-kit-0.20.2/build/Makefile.decl0000664000175000017500000000046712226763526013373 00000000000000NULL = memcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir memcheck; \ done leakcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir leakcheck; \ done hellcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir hellcheck; \ done p11-kit-0.20.2/configure.ac0000664000175000017500000003773612265245660012222 00000000000000AC_PREREQ(2.61) AC_INIT([p11-kit], [0.20.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=p11-glue], [p11-kit], [http://p11-glue.freedesktop.org/p11-kit.html]) # ------------------------------------------------------------------------------ # p11-kit libtool versioning # CURRENT : REVISION : AGE # +1 : 0 : +1 == new interface that does not break old one. # +1 : 0 : 0 == removed an interface. Breaks old apps. # ? : +1 : ? == internal changes that doesn't break anything. P11KIT_CURRENT=0 P11KIT_REVISION=0 P11KIT_AGE=0 # ------------------------------------------------------------------------------ AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([build/m4]) AC_CONFIG_AUX_DIR([build/aux]) AM_INIT_AUTOMAKE([1.10 foreign serial-tests]) AM_SANITY_CHECK AM_MAINTAINER_MODE([enable]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],) LT_PREREQ([2.2.6]) LT_INIT([dlopen disable-static]) AM_GNU_GETTEXT([external], [need-ngettext]) dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AM_PROG_CC_C_O PKG_PROG_PKG_CONFIG LINGUAS="" AM_GNU_GETTEXT([external], [need-ngettext]) if test "$enable_static" = "yes"; then AC_MSG_ERROR([p11-kit cannot be used as a static library]) fi AC_MSG_CHECKING([for win32]) case "$host" in *-*-mingw*) AC_DEFINE_UNQUOTED(OS_WIN32, 1, [Building for win32]) os_win32=yes os_unix=no ;; *) AC_DEFINE_UNQUOTED(OS_UNIX, 1, [Building for unix]) os_win32=no os_unix=yes ;; esac AC_MSG_RESULT([$os_win32]) AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes") AC_C_BIGENDIAN # ------------------------------------------------------------------------------ # Checks for libraries and headers AC_HEADER_STDBOOL if test "$os_unix" = "yes"; then AC_CHECK_FUNC([pthread_mutexattr_init], , [ AC_CHECK_LIB(pthread, pthread_mutexattr_init, , [ AC_MSG_ERROR([could not find pthread_mutexattr_init]) ]) ]) AC_CHECK_FUNC([nanosleep], , [ AC_SEARCH_LIBS([nanosleep], [rt], , [ AC_MSG_ERROR([could not find nanosleep]) ]) ]) AC_SEARCH_LIBS([dlopen], [dl dld], [], [ AC_MSG_ERROR([could not find dlopen]) ]) # These are thngs we can work around AC_CHECK_FUNCS([getprogname getexecname basename mkstemp mkdtemp]) AC_CHECK_FUNCS([getauxval issetugid getresuid]) AC_CHECK_FUNCS([strnstr memdup strndup strerror_r]) AC_CHECK_FUNCS([asprintf vasprintf vsnprintf]) AC_CHECK_FUNCS([timegm]) AC_CHECK_DECLS([asprintf, vasprintf], [], [], [[#include ]]) # Required functions AC_CHECK_FUNCS([gmtime_r], [AC_DEFINE([HAVE_GMTIME_R], 1, [Whether gmtime_r() is available])], [AC_MSG_ERROR([could not find required gmtime_r() function])]) # Check if these are declared and/or available to link against AC_CHECK_DECLS([program_invocation_short_name]) AC_MSG_CHECKING([whether program_invocation_short_name is available]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[program_invocation_short_name = "test";]])], [AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1], [Whether program_invocation_short_name available]) AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_CHECK_DECLS([__progname]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern char *__progname;]], [[__progname=(char*)0;]])], [AC_DEFINE(HAVE___PROGNAME, [1], [Whether __progname available])]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int __libc_enable_secure;]], [[__libc_enable_secure = 0;]])], [AC_DEFINE(HAVE___LIBC_ENABLE_SECURE, [1], [Whether __libc_enable_secure available])]) fi AC_CHECK_LIB(intl, dgettext) # ------------------------------------------------------------------------------ # PKCS#11 Directories AC_ARG_WITH([module-config], [AS_HELP_STRING([--with-module-config], [Module configuration files shipped by packages])], [module_config=$withval], [module_config='${pkgdatadir}/modules']) AC_ARG_WITH([system-config], [AS_HELP_STRING([--with-system-config], [Change PKCS#11 system config directory])], [system_config_dir=$withval], [system_config_dir=$sysconfdir/pkcs11]) AC_ARG_WITH([user-config], [AS_HELP_STRING([--with-system-config], [Change PKCS#11 user config directory])], [user_config_dir=$withval], [user_config_dir="~/.config/pkcs11"]) AC_ARG_WITH([module-path], [AS_HELP_STRING([--with-module-path], [Load modules with relative path names from here])], [module_path=$withval], [module_path=$libdir/pkcs11]) # We expand these so we have concrete paths p11_system_config=$system_config_dir p11_system_config_file=$p11_system_config/pkcs11.conf p11_system_config_modules=$p11_system_config/modules p11_package_config_modules=$module_config p11_user_config=$user_config_dir p11_user_config_file="$p11_user_config/pkcs11.conf" p11_user_config_modules="$p11_user_config/modules" p11_module_path="$module_path" AC_SUBST(p11_system_config) AC_SUBST(p11_system_config_file) AC_SUBST(p11_system_config_modules) AC_SUBST(p11_package_config_modules) AC_SUBST(p11_user_config) AC_SUBST(p11_user_config_file) AC_SUBST(p11_user_config_modules) AC_SUBST(p11_module_path) # -------------------------------------------------------------------- # libtasn1 support AC_ARG_WITH([libtasn1], AS_HELP_STRING([--without-libtasn1], [Disable dependency on libtasn1]) ) AS_IF([test "$with_libtasn1" != "no"], [ PKG_CHECK_MODULES([LIBTASN1], [libtasn1 >= 2.3], [], [AC_MSG_ERROR([libtasn1 not found. Building without it results in significant loss of functionality. To proceed use --without-libtasn1])] ) AC_SUBST(LIBTASN1_CFLAGS) AC_SUBST(LIBTASN1_LIBS) with_libtasn1="yes" AC_DEFINE_UNQUOTED(WITH_ASN1, 1, [Build with libtasn1 and certificate support]) ]) AM_CONDITIONAL(WITH_ASN1, test "$with_libtasn1" = "yes") # -------------------------------------------------------------------- # libffi AC_ARG_WITH([libffi], AS_HELP_STRING([--without-libffi], [Don't use libffi for building closures])) if test "$with_libffi" != "no"; then PKG_CHECK_MODULES(LIBFFI, [libffi >= 3.0.0]) AC_DEFINE_UNQUOTED(WITH_FFI, 1, [Use libffi for building closures]) AC_SUBST(LIBFFI_CFLAGS) AC_SUBST(LIBFFI_LIBS) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $LIBFFI_CFLAGS" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [ #if FFI_CLOSURES #else #error no closures #endif ])], [], [AC_MSG_ERROR([the libffi on this system has no support for closures.])]) CFLAGS="$SAVE_CFLAGS" with_libffi="yes" fi AM_CONDITIONAL(WITH_FFI, test "$with_libffi" = "yes") # -------------------------------------------------------------------- # Hash implementation AC_ARG_WITH([hash-impl], AS_HELP_STRING([--with-hash-impl=@<:@freebl/internal@:>@], [Choose the hash implementation to use]) ) AS_IF([test "$with_hash_impl" = ""], [with_hash_impl=internal]) AS_CASE([$with_hash_impl], [freebl], [ AC_CHECK_LIB(freebl3, NSSLOW_Init, [ HASH_LIBS=-lfreebl3 AC_DEFINE_UNQUOTED(WITH_FREEBL, 1, [Use freebl for hash implementation]) ], AC_MSG_ERROR([could not find the freebl3 library]) ) ], [internal], [ HASH_LIBS= ], [ AC_MSG_ERROR([unsupported hash impl: $with_hash_impl]) ] ) AC_SUBST(HASH_LIBS) # -------------------------------------------------------------------- # Trust Module AC_ARG_ENABLE([trust-module], AS_HELP_STRING([--disable-trust-module], [Disable building the trust module]) ) AC_MSG_CHECKING([if trust module is enabled]) AS_IF([test "$with_libtasn1" != "yes"], [ AS_IF([test "$enable_trust_module" = "yes"], [ AC_MSG_ERROR([--with-libtasn1 is needed in order to build the trust module]) ]) AS_IF([test "$enable_trust_module" != "no"], [ AC_MSG_WARN([--with-libtasn1 is needed in order to build the trust module, disabling]) ]) enable_trust_module="no" ]) AS_IF([test "$enable_trust_module" != "no"], [enable_trust_module="yes"]) AM_CONDITIONAL(WITH_TRUST_MODULE, test "$enable_trust_module" = "yes") AC_MSG_RESULT([$enable_trust_module]) AC_ARG_WITH([trust-paths], AS_HELP_STRING([--with-trust-paths=@<:@path@:>@]: [input paths for trust module]) ) AC_MSG_CHECKING([for trust module paths]) # This option was disabled, no anchors if test "$with_trust_paths" = "no"; then with_trust_paths="" AC_MSG_RESULT([disabled]) elif test "$enable_trust_module" != "yes"; then if test "$with_trust_paths" != ""; then AC_MSG_ERROR([need --enable-trust-module in order to specify trust module paths.]) fi with_trust_paths="" AC_MSG_RESULT([disabled]) # Option was not set, try to detect elif test "$with_trust_paths" = "" -o "$with_trust_paths" = "yes"; then with_trust_paths="" for f in /etc/pki/tls/certs/ca-bundle.crt \ /etc/ssl/certs/ca-certificates.crt \ /etc/ssl/ca-bundle.pem \ /etc/ssl/ca-bundle.crt; do if test -f "$f"; then with_trust_paths="$f" break fi done if test "$with_trust_paths" = ""; then AC_MSG_ERROR([could not find. Use --with-trust-paths=/path to set, or --without-trust-paths to disable]) fi AC_MSG_RESULT($with_trust_paths) else # Anchors explicitly set AC_MSG_RESULT($with_trust_paths) fi AC_DEFINE_UNQUOTED(TRUST_PATHS, ["$with_trust_paths"], [The trust module input paths]) AC_SUBST(with_trust_paths) # -------------------------------------------------------------------- # GTK Doc dnl check for tools AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) AC_PATH_PROG([GTKDOC_SCAN],[gtkdoc-scan]) AC_PATH_PROG([XSLTPROC], [xsltproc]) dnl for overriding the documentation installation directory AC_ARG_WITH([html-dir], AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, [with_html_dir='${datadir}/gtk-doc/html']) HTML_DIR="$with_html_dir" AC_SUBST([HTML_DIR]) dnl enable/disable documentation building AC_ARG_ENABLE([doc], AS_HELP_STRING([--enable-doc], [build documentation using gtk-doc [[default=no]]]),, [enable_doc=no]) if test x$enable_doc = xyes; then if test -z "$GTKDOC_SCAN"; then AC_MSG_ERROR([gtk-doc not installed and --enable-doc requested]) fi if test -z "$XSLTPROC"; then AC_MSG_ERROR([the xsltproc command was not found and --enable-doc requested]) fi doc_status="yes (manual, reference)" else enable_doc=no doc_status="no (no manual or reference)" fi AC_MSG_CHECKING([whether to build documentation]) AC_MSG_RESULT($enable_doc) dnl enable/disable output formats AC_ARG_ENABLE([doc-html], AS_HELP_STRING([--enable-doc-html], [build documentation in html format [[default=yes]]]),, [enable_doc_html=yes]) AC_ARG_ENABLE([doc-pdf], AS_HELP_STRING([--enable-doc-pdf], [build documentation in pdf format [[default=no]]]),, [enable_doc_pdf=no]) if test -z "$GTKDOC_MKPDF"; then enable_doc_pdf=no fi AM_CONDITIONAL(ENABLE_GTK_DOC, [test x$enable_doc = xyes]) AM_CONDITIONAL(GTK_DOC_BUILD_HTML, [test x$enable_doc_html = xyes]) AM_CONDITIONAL(GTK_DOC_BUILD_PDF, [test x$enable_doc_pdf = xyes]) AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, [test -n "$LIBTOOL"]) AM_CONDITIONAL(GTK_DOC_USE_REBASE, [test -n "$GTKDOC_REBASE"]) # -------------------------------------------------------------------- # Compilation and linking options AC_MSG_CHECKING([for debug mode]) AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug=no/default/yes], [Turn on or off debugging])) if test "$enable_debug" != "no"; then AC_DEFINE_UNQUOTED(WITH_DEBUG, 1, [Print debug output]) AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode]) CFLAGS="$CFLAGS -g" fi if test "$enable_debug" = "yes"; then debug_status="yes (-g, -O0, debug output)" CFLAGS="$CFLAGS -O0" elif test "$enable_debug" = "no"; then debug_status="no (no debug output, NDEBUG)" AC_DEFINE_UNQUOTED(NDEBUG, 1, [Disable glib assertions]) else debug_status="default (-g, debug output)" fi AC_MSG_RESULT($debug_status) AC_MSG_CHECKING(for more warnings) if test "$GCC" = "yes"; then CFLAGS="$CFLAGS \ -Wall -Wstrict-prototypes -Wmissing-declarations \ -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ -Wdeclaration-after-statement -Wformat=2 -Winit-self \ -Waggregate-return -Wno-missing-format-attribute \ -fno-strict-aliasing -fno-common" for option in -Wmissing-include-dirs -Wundef; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $option" AC_MSG_CHECKING([whether gcc understands $option]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [has_option=yes], [has_option=no]) AC_MSG_RESULT($has_option) if test $has_option = no; then CFLAGS="$SAVE_CFLAGS" fi done else AC_MSG_RESULT(no) fi AC_ARG_ENABLE(strict, [AS_HELP_STRING([--enable-strict], [Strict code compilation])] ) AC_MSG_CHECKING([build strict]) if test "$enable_strict" = "yes"; then CFLAGS="$CFLAGS -Werror" AC_DEFINE_UNQUOTED(WITH_STRICT, 1, [More strict checks]) strict_status="yes (-Werror, fatals)" else strict_status="no" fi AC_MSG_RESULT($strict_status) AC_MSG_CHECKING([whether to build with gcov testing]) AC_ARG_ENABLE([coverage], [AS_HELP_STRING([--enable-coverage], [Whether to enable coverage testing ])], [], [enable_coverage=no]) AC_MSG_RESULT([$enable_coverage]) if test "$enable_coverage" = "yes"; then if test "$GCC" != "yes"; then AC_MSG_ERROR(Coverage testing requires GCC) fi AC_PATH_PROG(GCOV, gcov, no) if test "$GCOV" = "no" ; then AC_MSG_ERROR(gcov tool is not available) fi AC_PATH_PROG(LCOV, lcov, no) if test "$LCOV" = "no" ; then AC_MSG_ERROR(lcov tool is not installed) fi AC_PATH_PROG(GENHTML, genhtml, no) if test "$GENHTML" = "no" ; then AC_MSG_ERROR(lcov's genhtml tool is not installed) fi CFLAGS="$CFLAGS -O0 -g --coverage" LDFLAGS="$LDFLAGS --coverage" fi AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"]) AC_SUBST(LCOV) AC_SUBST(GCOV) AC_SUBST(GENHTML) # --------------------------------------------------------------------- P11KIT_LT_RELEASE=$P11KIT_CURRENT:$P11KIT_REVISION:$P11KIT_AGE AC_SUBST(P11KIT_LT_RELEASE) echo $PACKAGE_VERSION | tr '.' ' ' | while read major minor unused; do AC_DEFINE_UNQUOTED(PACKAGE_MAJOR, $major, [Major version of package]) AC_DEFINE_UNQUOTED(PACKAGE_MINOR, $minor, [Minor version of package]) break done case "$host" in *-*-darwin*) # It seems like libtool lies about this see: # https://bugs.freedesktop.org/show_bug.cgi?id=57714 SHLEXT='.so' ;; *) eval SHLEXT=$shrext_cmds ;; esac AC_DEFINE_UNQUOTED(SHLEXT, ["$SHLEXT"], [File extension for shared libraries]) AC_SUBST(SHLEXT) privatedir='${libdir}/p11-kit' AC_SUBST(privatedir) AC_CONFIG_FILES([Makefile common/Makefile common/tests/Makefile doc/Makefile doc/manual/Makefile po/Makefile.in p11-kit/Makefile p11-kit/tests/Makefile p11-kit/p11-kit-1.pc p11-kit/pkcs11.conf.example trust/Makefile trust/trust-extract-compat trust/tests/Makefile trust/tests/test-extract ]) AC_OUTPUT # Format paths arguments which should wrap correctly in the output indent='\n ' trust_status=$(echo "$with_trust_paths" | sed -e "s/:/$indent/g") AC_MSG_NOTICE([build options: Host: $host Debug build: $debug_status Strict build: $strict_status Build documentation: $doc_status System global config: $p11_system_config_file System module config directory: $p11_system_config_modules Package module config directory: $p11_package_config_modules User global config: $p11_user_config_file User module config directory: $p11_user_config_modules Load relative module paths from: $p11_module_path With libtasn1 dependency: $with_libtasn1 With libffi: $with_libffi With hash implementation: $with_hash_impl Build trust module: $enable_trust_module Trust module paths: $trust_status ]) p11-kit-0.20.2/Makefile.in0000664000175000017500000007121012265245664011766 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/build/Makefile.decl $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(srcdir)/config.h.in ABOUT-NLS AUTHORS \ COPYING ChangeLog NEWS README build/aux/compile \ build/aux/config.guess build/aux/config.rpath \ build/aux/config.sub build/aux/depcomp build/aux/install-sh \ build/aux/missing build/aux/ltmain.sh \ $(top_srcdir)/build/aux/compile \ $(top_srcdir)/build/aux/config.guess \ $(top_srcdir)/build/aux/config.rpath \ $(top_srcdir)/build/aux/config.sub \ $(top_srcdir)/build/aux/install-sh \ $(top_srcdir)/build/aux/ltmain.sh \ $(top_srcdir)/build/aux/missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/m4/gettext.m4 \ $(top_srcdir)/build/m4/iconv.m4 \ $(top_srcdir)/build/m4/lib-ld.m4 \ $(top_srcdir)/build/m4/lib-link.m4 \ $(top_srcdir)/build/m4/lib-prefix.m4 \ $(top_srcdir)/build/m4/libtool.m4 \ $(top_srcdir)/build/m4/ltoptions.m4 \ $(top_srcdir)/build/m4/ltsugar.m4 \ $(top_srcdir)/build/m4/ltversion.m4 \ $(top_srcdir)/build/m4/lt~obsolete.m4 \ $(top_srcdir)/build/m4/nls.m4 $(top_srcdir)/build/m4/po.m4 \ $(top_srcdir)/build/m4/progtest.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = common p11-kit trust doc po DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ GTKDOC_SCAN = @GTKDOC_SCAN@ HASH_LIBS = @HASH_LIBS@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBFFI_CFLAGS = @LIBFFI_CFLAGS@ LIBFFI_LIBS = @LIBFFI_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTASN1_CFLAGS = @LIBTASN1_CFLAGS@ LIBTASN1_LIBS = @LIBTASN1_LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P11KIT_LT_RELEASE = @P11KIT_LT_RELEASE@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLEXT = @SHLEXT@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ p11_module_path = @p11_module_path@ p11_package_config_modules = @p11_package_config_modules@ p11_system_config = @p11_system_config@ p11_system_config_file = @p11_system_config_file@ p11_system_config_modules = @p11_system_config_modules@ p11_user_config = @p11_user_config@ p11_user_config_file = @p11_user_config_file@ p11_user_config_modules = @p11_user_config_modules@ pdfdir = @pdfdir@ prefix = @prefix@ privatedir = @privatedir@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_trust_paths = @with_trust_paths@ NULL = WEBHOST = anarchy.freedesktop.org WEBBASE = /srv/p11-glue.freedesktop.org/www @WITH_TRUST_MODULE_FALSE@TRUST_DIR = @WITH_TRUST_MODULE_TRUE@TRUST_DIR = trust SUBDIRS = \ common \ p11-kit \ $(TRUST_DIR) \ doc \ po ACLOCAL_AMFLAGS = -I build/m4 DISTCHECK_CONFIGURE_FLAGS = \ --enable-doc \ --disable-coverage \ --enable-strict \ CFLAGS='-O2' EXTRA_DIST = \ build/Makefile.tests \ build/Makefile.decl \ HACKING all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/build/Makefile.decl $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/build/Makefile.decl: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am memcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir memcheck; \ done leakcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir leakcheck; \ done hellcheck: @for dir in $(SUBDIRS); do \ test "$$dir" = "." || $(MAKE) -C $$dir hellcheck; \ done dist-hook: @if test -d "$(srcdir)/.git"; \ then \ echo Creating ChangeLog && \ ( cd "$(top_srcdir)" && \ echo '# Generate automatically. Do not edit.'; echo; \ $(top_srcdir)/missing --run git log --stat --date=short ) > ChangeLog.tmp \ && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \ || ( rm -f ChangeLog.tmp ; \ echo Failed to generate ChangeLog >&2 ); \ else \ echo A git clone is required to generate a ChangeLog >&2; \ fi @WITH_COVERAGE_TRUE@coverage: @WITH_COVERAGE_TRUE@ mkdir -p build/coverage @WITH_COVERAGE_TRUE@ $(LCOV) --directory . --zerocounters @WITH_COVERAGE_TRUE@ $(MAKE) check @WITH_COVERAGE_TRUE@ $(LCOV) --directory . --capture --output-file build/coverage.info @WITH_COVERAGE_TRUE@ $(GENHTML) --output-directory build/coverage \ @WITH_COVERAGE_TRUE@ --title "p11-kit $(PACKAGE_VERSION)" \ @WITH_COVERAGE_TRUE@ build/coverage.info @WITH_COVERAGE_TRUE@ @echo "file://$(abs_top_builddir)/build/coverage/index.html" @WITH_COVERAGE_TRUE@upload-coverage: coverage @WITH_COVERAGE_TRUE@ rsync -Hvax build/coverage/./ $(WEBHOST):$(WEBBASE)/build/coverage/./ @ENABLE_GTK_DOC_TRUE@upload-doc: all @ENABLE_GTK_DOC_TRUE@ rsync -Hvax --exclude doc --exclude build \ @ENABLE_GTK_DOC_TRUE@ doc/manual/html/./ $(WEBHOST):$(WEBBASE)/doc/p11-kit/./ upload-release: $(DIST_ARCHIVES) gpg --detach-sign --local-user 'stef@thewalter.net' $(DIST_ARCHIVES) scp $(DIST_ARCHIVES) $(DIST_ARCHIVES).sig $(WEBHOST):$(WEBBASE)/releases/ transifex: sh build/tx-update # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: p11-kit-0.20.2/Makefile.am0000664000175000017500000000326212265245660011753 00000000000000 include $(top_srcdir)/build/Makefile.decl WEBHOST = anarchy.freedesktop.org WEBBASE = /srv/p11-glue.freedesktop.org/www if WITH_TRUST_MODULE TRUST_DIR = trust else TRUST_DIR = endif SUBDIRS = \ common \ p11-kit \ $(TRUST_DIR) \ doc \ po ACLOCAL_AMFLAGS = -I build/m4 DISTCHECK_CONFIGURE_FLAGS = \ --enable-doc \ --disable-coverage \ --enable-strict \ CFLAGS='-O2' dist-hook: @if test -d "$(srcdir)/.git"; \ then \ echo Creating ChangeLog && \ ( cd "$(top_srcdir)" && \ echo '# Generate automatically. Do not edit.'; echo; \ $(top_srcdir)/missing --run git log --stat --date=short ) > ChangeLog.tmp \ && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \ || ( rm -f ChangeLog.tmp ; \ echo Failed to generate ChangeLog >&2 ); \ else \ echo A git clone is required to generate a ChangeLog >&2; \ fi if WITH_COVERAGE coverage: mkdir -p build/coverage $(LCOV) --directory . --zerocounters $(MAKE) check $(LCOV) --directory . --capture --output-file build/coverage.info $(GENHTML) --output-directory build/coverage \ --title "p11-kit $(PACKAGE_VERSION)" \ build/coverage.info @echo "file://$(abs_top_builddir)/build/coverage/index.html" upload-coverage: coverage rsync -Hvax build/coverage/./ $(WEBHOST):$(WEBBASE)/build/coverage/./ endif if ENABLE_GTK_DOC upload-doc: all rsync -Hvax --exclude doc --exclude build \ doc/manual/html/./ $(WEBHOST):$(WEBBASE)/doc/p11-kit/./ endif upload-release: $(DIST_ARCHIVES) gpg --detach-sign --local-user 'stef@thewalter.net' $(DIST_ARCHIVES) scp $(DIST_ARCHIVES) $(DIST_ARCHIVES).sig $(WEBHOST):$(WEBBASE)/releases/ EXTRA_DIST = \ build/Makefile.tests \ build/Makefile.decl \ HACKING transifex: sh build/tx-update p11-kit-0.20.2/AUTHORS0000664000175000017500000000004412161102013010735 00000000000000Stef Walter p11-kit-0.20.2/README0000664000175000017500000000045312161102013010551 00000000000000P11-KIT Provides a way to load and enumerate PKCS#11 modules. Provides a standard configuration setup for installing PKCS#11 modules in such a way that they're discoverable. Also solves problems with coordinating the use of PKCS#11 by different components or libraries living in the same process.